Changeset 5366 in orxonox.OLD for trunk/src/util
- Timestamp:
- Oct 12, 2005, 1:23:08 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/resource_manager.cc
r5346 r5366 217 217 BaseObject* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3) 218 218 { 219 if (fileName == NULL) 220 return NULL; 219 221 ResourceType tmpType; 220 222 #ifndef NO_MODEL … … 284 286 void* param1, void* param2, void* param3) 285 287 { 288 if (fileName == NULL) 289 return NULL; 290 286 291 // searching if the resource was loaded before. 287 292 Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3); … … 320 325 else 321 326 { 322 PRINTF(2)(" Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);327 PRINTF(2)("File %s in %s does not exist. Loading a cube-Model instead\n", fileName, dataDir); 323 328 tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize); 324 329 } … … 461 466 bool ResourceManager::unload(void* pointer, ResourcePriority prio) 462 467 { 468 if (pointer == NULL) 469 return false; 463 470 // if pointer is existent. and only one resource of this type exists. 464 471 Resource* tmpResource = this->locateResourceByPointer(pointer); 465 if (tmpResource == NULL) 466 { 467 PRINTF(2)("Resource not Found %p\n", pointer); 468 return false; 469 } 470 else 472 if (tmpResource != NULL) 471 473 return unload(tmpResource, prio); 474 else 475 { 476 PRINTF(2)("Resource not Found %p\n", pointer); 477 return false; 478 } 472 479 } 473 480
Note: See TracChangeset
for help on using the changeset viewer.