Horde3D

Next-Generation Graphics Engine
It is currently 29.03.2024, 10:38

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 24.07.2008, 02:53 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
When a resource isn't loaded successfully, I can see an entry in the log file. But from the code side this isn't really helpful. I can still apparently possible to successfully add nodes from a resource that wasn't successfully loaded, as apparently it does no error checking or at least it returns a nonzero node. (I think it *should* do error checking even if it's a bit slower though).

There is no utility function to only load a single resource from disk (well, I guess I'll have to write one). Wouldn't it be nice to just be able to check whether a resource is loaded or not, after calling loadResourcesFromDisk?

In addition to the patch below, I think adding nodes from the resource should also fail.

I won't make separate patch, but just paste the changed I made here because my diffs show extremal amount of windows linebreaks... Also the whitespace seems to get smashed when I paste here, but it's just a matter of indenting it again.

in egMain.cpp
Code:
DLLEXP bool isResourceLoaded( ResHandle res )
   {
      return Modules::resMan().resolveResHandle(res)->isLoaded();
   }


in Horde3d.h

Code:

   /*    Function: loadResource
         Returns whether a resource has been successfully loaded.

        This function returns whether a resource has been successfully loaded.

      Parameters:
         res      - handle to the inspected resource

      Returns:
         true in case resource is loaded, otherwise false
   */
   DLL bool isResourceLoaded( ResHandle res );


Top
 Profile  
Reply with quote  
PostPosted: 24.07.2008, 19:45 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Thanks for these hints. The isResourceLoaded functionality can be useful in some cases.
I also just discussed with Volker the best behavior when calling addNodes with an unloaded resource and it makes sense to return 0 since the scene graph will not be updated automatically even if the scene graph resource is loaded later.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot] and 58 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