Changeset 3676 in orxonox.OLD for orxonox/trunk/src/lib/util
- Timestamp:
- Mar 30, 2005, 5:42:02 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/resource_manager.cc
r3672 r3676 217 217 if(isFile(fullName)) 218 218 { 219 PRINTF(4)("Image %s resides to %s\n", fileName, fullName); 219 220 tmpResource->pointer = new Texture(fullName); 220 221 } … … 229 230 sprintf(imgName, "%s%s", tmpDir, fileName); 230 231 if(isFile(imgName)) 231 tmpResource->pointer = new Texture(imgName); 232 { 233 PRINTF(4)("Image %s resides to %s\n", fileName, imgName); 234 tmpResource->pointer = new Texture(imgName); 235 delete []imgName; 236 break; 237 } 232 238 delete []imgName; 233 239 tmpDir = iterator->nextElement(); … … 242 248 PRINTF(1)("No type found for %s.\n !!This should not happen unless the Type is not supported yet.!!\n", tmpResource->name); 243 249 break; 244 }245 246 // checking if the File really exists.247 if(!isFile(fullName))248 {249 PRINTF(2)("Sorry, %s is not a regular file.\n", fullName);250 tmpResource->pointer = NULL;251 250 } 252 251 this->resourceList->add(tmpResource); … … 413 412 return false; 414 413 } 414 415 /** 416 \brief outputs debug information about the ResourceManager 417 */ 418 void ResourceManager::debug(void) 419 { 420 PRINT(0)("=RM===================================\n"); 421 PRINT(0)("= RESOURCE-MANAGER DEBUG INFORMATION =\n"); 422 PRINT(0)("======================================\n"); 423 // if it is not initialized 424 PRINT(0)(" Reference is: %p\n", ResourceManager::singletonRef); 425 PRINT(0)(" Data-Directory is: %s\n", this->dataDir); 426 PRINT(0)(" List of Image-Directories: "); 427 tIterator<char>* tmpIt = imageDirs->getIterator(); 428 char* tmpDir = tmpIt->nextElement(); 429 while(tmpDir) 430 { 431 PRINT(0)("%s ",tmpDir); 432 tmpDir = tmpIt->nextElement(); 433 } 434 delete tmpIt; 435 PRINT(0)("\n"); 436 437 PRINT(0)("List of all stored Resources:\n"); 438 tIterator<Resource>* iterator = resourceList->getIterator(); 439 Resource* enumRes = iterator->nextElement(); 440 while (enumRes) 441 { 442 PRINT(0)("-----------------------------------------\n"); 443 PRINT(0)("Name: %s; References: %d; Type:", enumRes->name, enumRes->count); 444 switch (enumRes->type) 445 { 446 case OBJ: 447 PRINT(0)("ObjectModel\n"); 448 break; 449 case PRIM: 450 PRINT(0)("PrimitiveModel\n"); 451 break; 452 case IMAGE: 453 PRINT(0)("ImageFile (Texture)\n"); 454 break; 455 default: 456 PRINT(0)("SoundFile\n"); 457 break; 458 } 459 PRINT(0)("gets deleted at "); 460 switch(enumRes->prio) 461 { 462 default: 463 case RP_NO: 464 PRINT(0)("first posibility (0)\n"); 465 break; 466 case RP_LEVEL: 467 PRINT(0)("the end of the Level (1)\n"); 468 break; 469 case RP_CAMPAIGN: 470 PRINT(0)("the end of the campaign (2)\n"); 471 break; 472 case RP_GAME: 473 PRINT(0)("when leaving the game (3)\n"); 474 break; 475 } 476 enumRes = iterator->nextElement(); 477 } 478 delete iterator; 479 480 481 482 PRINT(0)("==================================RM==\n"); 483 } -
orxonox/trunk/src/lib/util/resource_manager.h
r3672 r3676 63 63 bool unload(Resource* resource, ResourcePriority = RP_NO); 64 64 bool unloadAllByPriority(ResourcePriority prio); 65 void debug(void); 65 66 66 67 private: … … 77 78 78 79 bool isDir(const char* directory); 79 bool isFile(const char* directory); 80 bool isFile(const char* directory); 81 80 82 }; 81 83
Note: See TracChangeset
for help on using the changeset viewer.