ulf.schroeter Posted November 10, 2010 Share Posted November 10, 2010 Problem mesh/texture load fails with error message "wrong magic" Cause error message is just a symptom for failed FileSystem background load operation (FileThread.data/size = 0). During Filesystem::getFile() this condition is not checked and a FileInterface with invalid data is returned. Fix FileSystem.cpp FileInterface *FileSystem::getFile(const char *n,const char *mode) { .... ///////////////////////////////// // thread file ///////////////////////////////// if(engine.threads) { .... if(it != loaded_files.end()) { FileInterface *file = NULL; // CHECK FOR NON-NULL DATA if( it->data.size > 0 ) { file = new FileMemory(name,it->data.data,it->data.size,1); } loaded_files.remove(it); engine.threads->unlockFileSystem(); return file; } ..... Link to comment
ulf.schroeter Posted November 30, 2010 Author Share Posted November 30, 2010 Looks like bug is NOT fixed within SDK-2010-11-29 Link to comment
binstream Posted November 30, 2010 Share Posted November 30, 2010 That's really odd, we'll re-check it tomorrow. Link to comment
ulf.schroeter Posted November 30, 2010 Author Share Posted November 30, 2010 That's really odd, we'll re-check it tomorrow. I think the bug which caused failed background loads in previous release is fixed, so in most cases the missing failure test does not show up. Nevertheless if background load fails for some other reasons getFile() should return NULL to signal failure as documented. Link to comment
frustum Posted December 1, 2010 Share Posted December 1, 2010 FileSystem::getFile() returns an empty file if file can't be opened. File is checked in cached files list before background loading. So file should really exist and if we can't open it in filesystem thread an empty file will be returned. The incorrect behavior is not likely to happen. I will add NULL return in the next update. Link to comment
Recommended Posts