Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4094 in orxonox.OLD


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

Location:
orxonox/trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/defs/debug.h

    r4085 r4094  
    6161#define DEBUG_MODULE_COMMAND_NODE       4
    6262#define DEBUG_MODULE_GRAPHICS           0
    63 #define DEBUG_MODULE_LOAD               0
     63#define DEBUG_MODULE_LOAD               2
    6464
    6565#define DEBUG_MODULE_IMPORTER           3
  • orxonox/trunk/src/game_loader.cc

    r4091 r4094  
    2525#include "command_node.h"
    2626#include "vector.h"
     27#include "resource_manager.h"
    2728#include "factory.h"
    2829
     
    7677{
    7778  ErrorMessage errorCode;
    78  
    79   this->currentCampaign = this->fileToCampaign(name);
     79  char* campaignName;
     80  if (ResourceManager::isFile(name))
     81    {
     82      this->currentCampaign = this->fileToCampaign(name);
     83    }
     84  else
     85    {
     86      campaignName = new char[strlen(ResourceManager::getInstance()->getDataDir())+strlen(name)];
     87      sprintf(campaignName, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
     88      this->currentCampaign = this->fileToCampaign(campaignName);
     89      delete campaignName;
     90    }
    8091}
    8192
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r3844 r4094  
    1717
    1818#include "graphics_engine.h"
     19#include "resource_manager.h"
    1920
    2021#include "debug.h"
     
    101102 
    102103  // TO DO: Create a cool icon and use it here
    103   SDL_WM_SetIcon(SDL_LoadBMP("../data/pictures/orxonox-icon32x32.bmp"), NULL); 
    104 
     104  char* loadPic = new char[strlen(ResourceManager::getInstance()->getDataDir())+ 100];
     105  sprintf(loadPic, "%s%s", ResourceManager::getInstance()->getDataDir(),  "pictures/orxonox-icon32x32.bmp");
     106  SDL_WM_SetIcon(SDL_LoadBMP(loadPic), NULL); 
     107  delete loadPic;
    105108  // Enable default GL stuff
    106109  glEnable(GL_DEPTH_TEST);
  • orxonox/trunk/src/orxonox.cc

    r4091 r4094  
    247247 
    248248  this->gameLoader = GameLoader::getInstance();
    249   this->gameLoader->loadCampaign("../data/worlds/DefaultCampaign.oxc");
     249  this->gameLoader->loadCampaign("worlds/DefaultCampaign.oxc");
    250250  //  this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0);
    251251  this->gameLoader->init();
  • 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
  • orxonox/trunk/src/world_entities/environment.cc

    r3986 r4094  
    3030{
    3131  this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);
    32   //  this->model = new OBJModel("../data/models/fighter.obj");
    3332}
    3433
  • orxonox/trunk/src/world_entities/skysphere.cc

    r3763 r4094  
    4444{
    4545  if (fileName == NULL)
    46     this->initialize("../data/pictures/sky-replace.jpg");
     46    this->initialize("pictures/sky-replace.jpg");
    4747  else
    4848    this->initialize(fileName);
Note: See TracChangeset for help on using the changeset viewer.