Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 2:41 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Sun Apr 18, 2010 12:14 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I've notice that the doc has the function raydium_path_package_find(package name). That function, according the doc, should return the path of the folder where the package has been registered.

Sadly that function is not in the svn. Can the author of the function to upload it? Thanks


Top
 Profile  
 
PostPosted: Mon Apr 19, 2010 7:36 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Extracted from rev 966:
Code:
__rayapi int raydium_path_package_find(char *name);
/**
Return path index associated with package name ##name##.
**/


I may miss something, but the function was supposed to simply return its index in the "internal" array of packages, no ?


Top
 Profile  
 
PostPosted: Tue Apr 20, 2010 12:08 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
hmm... I think I misread the prototype.

Simply I wanted a function to return the path folder in which the package has been registered. Reason? I'm having problems accessing to certain files from a package and I wanted to force the fullp ath of the file registered. (I'm recoding the animation stuff to work directly with packages).
Looks like the .cfg files are readed, but .xsf are not.
I have to investigate a bit more...


Top
 Profile  
 
PostPosted: Tue Apr 20, 2010 6:59 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
XSF files are opened "via" Raydium (file_fopen ? path_resolv ?) or directly by Cal3D ?


Top
 Profile  
 
PostPosted: Tue Apr 20, 2010 9:54 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Via cal3d, but I think the path_resolv should do the trick, right?
Code:
//*** SKELETON ***
               if(!strcasecmp(var,"skeleton") && (ret==RAYDIUM_PARSER_TYPE_STRING) )
               {
                  raydium_log("Readed: %s",(char*)val_s);
                  //raydium_path_ext(raydium_path_package_find(filename) ,"xsf");
                  //raydium_path_ext(raydium_path_package_find(filename),"csf");      
                  //raydium_path_ext(raydium_path_paths[raydium_path_package_find(newstr)].path,"xsf");                  
                  raydium_path_resolv((char*) val_s, newstr,"r");
                  raydium_log("the resolv is %s " , newstr);
                  //load the skeleton
                  if(CalCoreModel_LoadCoreSkeleton(raydium_anim_model[a],(char*)newstr))
                  {
                     raydium_log("Correctly Readed: %s",(char*)newstr);
                     //apply scale
                     CalCoreSkeleton_Scale(CalCoreModel_GetCoreSkeleton(raydium_anim_model[a]),scale);
                     raydium_log("Successfully loaded %s",newstr);
                  }   
                  else
                  {
                     raydium_log("ANIM:ERROR: Loading file %s",val_s);
                     error=1;
                  }               
               }

I think the code is right, but the line raydium_log("the resolv is %s " , newstr); returns a wrong path (just the name of the file):
Code:
Readed: model.xsf
Raydium: the resolv is model.xsf
Raydium: ANIM:ERROR: Loading file model.xsf

However the model.cfg is correctly loaded.
Is a problem with the extensions?


Top
 Profile  
 
PostPosted: Tue Apr 20, 2010 11:32 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
The default behavior of raydium_path_resolv() is to return the same string as the input, except if it founds an existing file in the registered paths.

So perhaps at this exact moment, the path API is not able to find "model.xsf" ? You can dump the current path list with raydium_path_dump(), it may help debugging, perhaps ?


Top
 Profile  
 
PostPosted: Tue Apr 20, 2010 4:08 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
argh! :oops:
"r" is not the same as 'r'. And so the resolv is skipping the first condition of the resolv function
Code:
if(mode=='r')
.
I know that was my fault, but should we make an alternative checking
Code:
if((mode=='r')||(!strcmp(mode,"r")) )
to avoid this kind of problems?.


Top
 Profile  
 
PostPosted: Tue Apr 20, 2010 4:21 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
This is a more deeper trouble : function prototype requests mode as a "char", it would mean breaking the compatibility. And the function only "understands" r,w, but not rw, so there's no need for a string.

The strange thing here is that GCC have not reported an error here ... ? Or perhaps this warning was hidden in a flood of warn_unused_result warning ? :)


Top
 Profile  
 
PostPosted: Tue Apr 20, 2010 4:35 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
yes, it was hidden in the warning flood :roll: :

Code:
raydium/anim.c:747: warning: passing argument 3 of ‘raydium_path_resolv’ makes integer from pointer without a cast
raydium/headers/path.h:115: note: expected ‘char’ but argument is of type ‘char *’


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group