Changeset 3676 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Mar 30, 2005, 5:42:02 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 6 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 -
orxonox/trunk/src/orxonox.cc
r3671 r3676 331 331 orx->start(); 332 332 333 //delete orx;333 delete orx; 334 334 335 335 } -
orxonox/trunk/src/story_entities/world.cc
r3675 r3676 145 145 cn->unbind(this->localPlayer); 146 146 cn->reset(); 147 ResourceManager::getInstance()->debug(); 147 148 148 149 ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL); -
orxonox/trunk/src/world_entities/projectile.cc
r3675 r3676 33 33 Projectile::Projectile () : WorldEntity() 34 34 { 35 this->model = (Model*)ResourceManager::getInstance()->load("cube", PRIM, RP_LEVEL); 36 // this->projectileModel = new Primitive(P_SPHERE); 35 this->model = (Model*)ResourceManager::getInstance()->load("sphere", PRIM, RP_LEVEL); 37 36 this->flightDirection = NULL; 38 37 this->currentLifeTime = 0.0f; … … 138 137 glMultMatrixf((float*)matrix); 139 138 this->model->draw(); 140 //this->projectileModel->draw();141 139 142 140 glPopMatrix(); -
orxonox/trunk/src/world_entities/projectile.h
r3646 r3676 9 9 #include "world_entity.h" 10 10 11 class Primitive;12 11 class Vector; 13 12 … … 32 31 private: 33 32 //physical attriutes like: force, speed, acceleration etc. 34 Primitive* projectileModel; //!< this serves temporary as a plasma bullet35 33 float speed; //!< this is the speed of the projectile 36 34 float currentLifeTime; //!< this is the time, the projectile exists in this world (incremented by tick)
Note: See TracChangeset
for help on using the changeset viewer.