Changeset 4094 in orxonox.OLD for orxonox/trunk/src/story_entities
- Timestamp:
- May 6, 2005, 8:49:29 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r4091 r4094 121 121 { 122 122 this->constuctorInit("", -1); 123 123 this->path = NULL; 124 124 const char *string; 125 125 char *name; … … 169 169 World::World (char* name) 170 170 { 171 this->path = NULL; 171 172 this->constuctorInit(name, -1); 172 173 //NullParent* np = NullParent::getInstance(); … … 179 180 World::World (int worldID) 180 181 { 182 this->path = NULL; 181 183 this->constuctorInit(NULL, worldID); 182 184 } … … 266 268 ErrorMessage World::load() 267 269 { 268 PRINTF 0("> Loading world: '%s'\n", getPath());270 PRINTF(0)("> Loading world: '%s'\n", getPath()); 269 271 270 272 GameLoader* loader = GameLoader::getInstance(); … … 467 469 glEndList(); 468 470 469 terrain = new Terrain(" ../data/worlds/newGround.obj");471 terrain = new Terrain("worlds/newGround.obj"); 470 472 terrain->setRelCoor(Vector(0,-10,0)); 471 473 this->spawn(terrain); … … 590 592 591 593 // Create SkySphere 592 sky = new Skysphere(" ../data/pictures/sky-replace.jpg");594 sky = new Skysphere("pictures/sky-replace.jpg"); 593 595 this->localPlayer->addChild(this->sky); 594 596 this->spawn(this->sky); … … 635 637 636 638 // Create SkySphere 637 this->sky = new Skysphere(" ../data/pictures/sky-replace.jpg");639 this->sky = new Skysphere("pictures/sky-replace.jpg"); 638 640 this->sky->setName("SkySphere"); 639 641 this->spawn(this->sky); … … 1231 1233 void World::setPath( const char* name) 1232 1234 { 1233 this->path = new char[strlen(name)+1]; 1234 strcpy(this->path, name); 1235 if (this->path) 1236 delete this->path; 1237 if (ResourceManager::isFile(name)) 1238 { 1239 this->path = new char[strlen(name)+1]; 1240 strcpy(this->path, name); 1241 } 1242 else 1243 { 1244 this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1]; 1245 sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name); 1246 } 1235 1247 } 1236 1248
Note: See TracChangeset
for help on using the changeset viewer.