Changeset 3557 in orxonox.OLD for orxonox/branches/levelloader/src/story_entities/world.cc
- Timestamp:
- Mar 15, 2005, 10:53:46 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/story_entities/world.cc
r3542 r3557 68 68 69 69 localPlayer = NULL; 70 this->entities = new tList<WorldEntity>(); 70 71 71 72 } … … 142 143 { 143 144 144 PRINTF0(" Loading world: '%s'\n", getPath());145 PRINTF0("> Loading world: '%s'\n", getPath()); 145 146 146 147 GameLoader* loader = GameLoader::getInstance(); … … 166 167 assert( root != NULL); 167 168 168 TiXmlElement* element = root->FirstChildElement( "WorldDataFile"); 169 170 if( root == NULL ) 169 if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile")) 171 170 { 172 171 // report an error … … 197 196 198 197 // find WorldEntities 199 element = root->FirstChildElement( "WorldEntities");198 TiXmlElement* element = root->FirstChildElement( "WorldEntities"); 200 199 201 200 if( element == NULL) … … 207 206 element = element->FirstChildElement(); 208 207 // load Players/Objects/Whatever 208 PRINTF0("Loading WorldEntities\n"); 209 209 while( element != NULL) 210 210 { 211 211 WorldEntity* created = (WorldEntity*) loader->fabricate( element); 212 if( created != NULL) spawn( created); 213 assert( element->Value() != NULL); 212 if( created != NULL) this->spawn( created); 214 213 // if we load a 'Player' we use it as localPlayer 215 if(!strcmp( element->Value(), "Player")) localPlayer = (Player*) created;214 // if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created; 216 215 element = element->NextSiblingElement(); 217 216 } 217 PRINTF0("Done loading WorldEntities\n"); 218 218 } 219 219 … … 227 227 { 228 228 //load track 229 trackManager = TrackManager::getInstance(); 229 PRINTF0("Loading Track\n"); 230 trackManager = TrackManager::getInstance(); 230 231 trackManager->loadTrack( element); 231 232 trackManager->finalize(); 233 PRINTF0("Done loading Track\n"); 232 234 } 233 235 … … 495 497 //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR); 496 498 //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback ); 497 499 500 PRINTF0("> Done Loading world: '%s'\n", getPath()); 498 501 } 499 502
Note: See TracChangeset
for help on using the changeset viewer.