Changeset 4233 in orxonox.OLD for orxonox/branches/levelLoader/src/world_entities
- Timestamp:
- May 20, 2005, 1:37:47 AM (19 years ago)
- Location:
- orxonox/branches/levelLoader/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelLoader/src/world_entities/world_entity.cc
r4115 r4233 23 23 #include "vector.h" 24 24 25 //#include "stdincl.h" 26 //#include "collision.h" 25 #include "load_param.h" 27 26 28 27 using namespace std; … … 51 50 { 52 51 PRINTF(2)("WorldEntity is missing a proper 'name'\n"); 53 string = "Unknown"; 54 temp = new char[strlen(string + 2)]; 55 strcpy( temp, string); 56 this->setName( temp); 52 this->setName("unknown"); 57 53 } 58 54 else 59 55 { 60 temp = new char[strlen(string + 2)]; 61 strcpy( temp, string); 62 this->setName( temp); 56 LoadParam<WorldEntity> (string, this, &WorldEntity::setName); 63 57 } 64 58 // Model Loading … … 66 60 string = grabParameter( root, "model"); 67 61 if( string != NULL) 68 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);62 LoadParam<WorldEntity>(string, this, &WorldEntity::loadModel); 69 63 else 70 64 { … … 87 81 if (this->model) 88 82 ResourceManager::getInstance()->unload(this->model); 83 } 84 85 /** 86 \brief loads a Model onto a WorldEntity 87 \param fileName the name of the model to load 88 */ 89 void WorldEntity::loadModel(const char* fileName) 90 { 91 this->model = (Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN); 89 92 } 90 93 -
orxonox/branches/levelLoader/src/world_entities/world_entity.h
r4010 r4233 27 27 virtual ~WorldEntity (); 28 28 29 void loadModel(const char* fileName); 29 30 30 31 //void setCollision (CollisionCluster* newhull);
Note: See TracChangeset
for help on using the changeset viewer.