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 );