Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4295 in orxonox.OLD for orxonox


Ignore:
Timestamp:
May 26, 2005, 11:05:01 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: a better check for the data-directory

Location:
orxonox/branches/physics/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/subprojects/particles/framework.cc

    r4294 r4295  
    2424#include "debug.h"
    2525#include "graphics_engine.h"
     26#include "resource_manager.h"
    2627
    2728
     
    259260  mouse1Down = false;
    260261
     262  ResourceManager::getInstance()->setDataDir(DATA_DIRECTORY);
    261263 
    262264    // Creating a Test Particle System
  • orxonox/branches/physics/src/subprojects/particles/framework.h

    r4294 r4295  
    44#include "vector.h"
    55#include "glincl.h"
     6
     7#define DATA_DIRECTORY "~/svn/data/"
    68
    79float rotatorP;
  • orxonox/branches/physics/src/util/resource_manager.cc

    r4223 r4295  
    8787bool ResourceManager::setDataDir(const char* dataDir)
    8888{
    89   if (isDir(dataDir))
     89  char* checkDir = ResourceManager::homeDirCheck(dataDir);
     90  if (isDir(checkDir))
    9091    {
    9192      delete this->dataDir;
    92       this->dataDir = new char[strlen(dataDir)+1];
    93       strcpy(this->dataDir, dataDir);
     93      this->dataDir = new char[strlen(checkDir)+1];
     94      strcpy(this->dataDir, checkDir);
     95      delete checkDir;
    9496      return true;
    9597    }
     
    9799    {
    98100      PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", dataDir, this->dataDir);
     101      delete checkDir;
    99102      return false;
    100103    }
Note: See TracChangeset for help on using the changeset viewer.