Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4094 in orxonox.OLD for orxonox/trunk/src/story_entities


Ignore:
Timestamp:
May 6, 2005, 8:49:29 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: orxonox now runs from anywhere of the LINUX environment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r4091 r4094  
    121121{
    122122  this->constuctorInit("", -1);
    123 
     123  this->path = NULL;
    124124  const char *string;
    125125  char *name;
     
    169169World::World (char* name)
    170170{
     171  this->path = NULL;
    171172  this->constuctorInit(name, -1);
    172173  //NullParent* np = NullParent::getInstance();
     
    179180World::World (int worldID)
    180181{
     182  this->path = NULL;
    181183  this->constuctorInit(NULL, worldID);
    182184}
     
    266268ErrorMessage World::load()
    267269{       
    268   PRINTF0("> Loading world: '%s'\n", getPath());
     270  PRINTF(0)("> Loading world: '%s'\n", getPath());
    269271 
    270272  GameLoader* loader = GameLoader::getInstance();
     
    467469  glEndList();
    468470
    469   terrain = new Terrain("../data/worlds/newGround.obj");
     471  terrain = new Terrain("worlds/newGround.obj");
    470472  terrain->setRelCoor(Vector(0,-10,0));
    471473  this->spawn(terrain);
     
    590592
    591593        // Create SkySphere
    592         sky = new Skysphere("../data/pictures/sky-replace.jpg");
     594        sky = new Skysphere("pictures/sky-replace.jpg");
    593595        this->localPlayer->addChild(this->sky);
    594596        this->spawn(this->sky);
     
    635637
    636638        // Create SkySphere
    637         this->sky = new Skysphere("../data/pictures/sky-replace.jpg");
     639        this->sky = new Skysphere("pictures/sky-replace.jpg");
    638640        this->sky->setName("SkySphere");
    639641        this->spawn(this->sky);
     
    12311233void World::setPath( const char* name)
    12321234{
    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    }
    12351247}
    12361248
Note: See TracChangeset for help on using the changeset viewer.