Changeset 4114 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- May 7, 2005, 10:02:57 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/factory.h
r4020 r4114 80 80 const char* grabParameter( TiXmlElement* root, const char* name); 81 81 82 83 84 85 82 #endif /* _FACTORY_H */ 86 83 -
orxonox/trunk/src/game_loader.cc
r4113 r4114 290 290 assert( factory != NULL); 291 291 292 PRINTF 0("Registered factory for '%s'\n", factory->getFactoryName());292 PRINTF(4)("Registered factory for '%s'\n", factory->getFactoryName()); 293 293 294 294 if( first == NULL) first = factory; … … 302 302 BaseObject* GameLoader::fabricate( TiXmlElement* element) 303 303 { 304 assert( element != NULL); 305 306 if( first == NULL) 307 { 308 PRINTF0("GameLoader does not know any factories, fabricate() failed\n"); 309 return NULL; 310 } 311 312 if( element->Value() != NULL) 313 { 314 PRINTF0("Attempting fabrication of a '%s'\n", element->Value()); 315 BaseObject* b = first->fabricate( element); 316 if( b == NULL) PRINTF0("Failed to fabricate a '%s'\n", element->Value()); 317 else PRINTF0("Successfully fabricated a '%s'\n", element->Value()); 318 return b; 319 } 320 321 PRINTF0("Fabricate failed, TiXmlElement did not contain a value\n"); 322 323 return NULL; 324 } 304 assert( element != NULL); 305 306 if( first == NULL) 307 { 308 PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n"); 309 return NULL; 310 } 311 312 if( element->Value() != NULL) 313 { 314 PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value()); 315 BaseObject* b = first->fabricate( element); 316 if( b == NULL) 317 PRINTF(2)("Failed to fabricate a '%s'\n", element->Value()); 318 else 319 PRINTF(4)("Successfully fabricated a '%s'\n", element->Value()); 320 return b; 321 } 322 323 PRINTF(2)("Fabricate failed, TiXmlElement did not contain a value\n"); 324 325 return NULL; 326 } -
orxonox/trunk/src/story_entities/campaign.cc
r4010 r4114 41 41 int id; 42 42 43 PRINTF 0("Loading Campaign...\n");43 PRINTF(3)("Loading Campaign...\n"); 44 44 45 45 assert( root != NULL); … … 53 53 if( string == NULL || sscanf(string, "%d", &id) != 1) 54 54 { 55 PRINTF 0("Campaign is missing a proper 'identifier'\n");55 PRINTF(2)("Campaign is missing a proper 'identifier'\n"); 56 56 this->setStoryID( -1); 57 57 } … … 62 62 if( element == NULL) 63 63 { 64 PRINTF 0("Campaign is missing a proper 'WorldList'\n");64 PRINTF(2)("Campaign is missing a proper 'WorldList'\n"); 65 65 } 66 66 else -
orxonox/trunk/src/world_entities/player.cc
r4091 r4114 82 82 Player::Player(TiXmlElement* root) : WorldEntity(root) 83 83 { 84 /*85 char* temp;86 const char* string;87 string = grabParameter( root, "name");88 if( string == NULL)89 {90 PRINTF0("Player is missing a proper 'name'\n");91 string = "Unknown";92 temp = new char[strlen(string + 2)];93 strcpy( temp, string);94 this->setName( temp);95 }96 else97 {98 temp = new char[strlen(string + 2)];99 strcpy( temp, string);100 this->setName( temp);101 }102 103 this->model = NULL;104 string = grabParameter( root, "model");105 if( string != NULL)106 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);107 else108 {109 PRINTF0("Player is missing a proper 'model'\n");110 this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);111 }112 if( this->model == NULL)113 {114 PRINTF0("Player model '%s' could not be loaded\n", string);115 }116 */117 84 this->weapons = new tList<Weapon>(); 118 85 this->activeWeapon = NULL; -
orxonox/trunk/src/world_entities/world_entity.cc
r4013 r4114 30 30 /** 31 31 \brief standard constructor 32 33 Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish34 between free and bound entities. The difference between them is simply the fact that the movement of a free entity is35 not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.36 To specify an entity to be free or bound set the default parameter in the declaration of the constructor.37 Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World38 class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.39 32 */ 40 33 WorldEntity::WorldEntity () … … 46 39 } 47 40 41 /** 42 \brief Loads the WordEntity-specific Part of any derived Class 43 */ 48 44 WorldEntity::WorldEntity(TiXmlElement* root) 49 45 { … … 54 50 if( string == NULL) 55 51 { 56 PRINTF( 0)("WorldEntity is missing a proper 'name'\n");52 PRINTF(2)("WorldEntity is missing a proper 'name'\n"); 57 53 string = "Unknown"; 58 54 temp = new char[strlen(string + 2)]; … … 69 65 this->model = NULL; 70 66 string = grabParameter( root, "model"); 67 printf("::::::::::::::::::::::string is %s\n", string); 71 68 if( string != NULL) 72 69 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN); 73 70 else 74 71 { 75 PRINTF( 0)("WorldEntity is missing a proper 'model'\n");72 PRINTF(2)("WorldEntity is missing a proper 'model'\n"); 76 73 this->model = NULL; 77 74 } 78 75 if( this->model == NULL) 79 76 { 80 PRINTF(0)("WorldEntity model '%s' could not be loaded\n", string); 81 } 82 77 PRINTF(2)("WorldEntity model '%s' could not be loaded\n", string); 78 } 83 79 this->bDraw = true; 84 80 }
Note: See TracChangeset
for help on using the changeset viewer.