Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3983 in orxonox.OLD


Ignore:
Timestamp:
Apr 26, 2005, 3:33:06 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: resource now also gets loaded if the data-directory is not where it is supposed to be… this will be better in the future (i hope)

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r3966 r3983  
    167167  PRINT(3)("initializing ResourceManager\n");
    168168  resourceManager = ResourceManager::getInstance();
    169   resourceManager->setDataDir("../data/");
     169  if (!resourceManager->setDataDir("data/"))
     170    if (!resourceManager->setDataDir("../data/"))
     171      if (!resourceManager->setDataDir("../../data/"))
     172        resourceManager->setDataDir("../../../data/");
    170173  return 0;
    171174  PRINT(3)("initializing TextEngine\n");
  • orxonox/trunk/src/util/resource_manager.cc

    r3883 r3983  
    9292      this->dataDir = new char[strlen(dataDir)+1];
    9393      strcpy(this->dataDir, dataDir);
     94      return true;
    9495    }
    9596  else
    9697    {
    9798      PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", dataDir, this->dataDir);
     99      return false;
    98100    }
    99101}
  • orxonox/trunk/src/util/resource_manager.h

    r3911 r3983  
    7373  bool unload(Resource* resource, ResourcePriority = RP_NO);
    7474  bool unloadAllByPriority(ResourcePriority prio);
     75
    7576  void debug(void);
     77
     78  // utility functions of this class
     79  static bool isDir(const char* directory);
     80  static bool isFile(const char* directory);
    7681
    7782 private:
     
    8792  Resource* locateResourceByPointer(const void* pointer);
    8893 
    89   bool isDir(const char* directory);
    90   bool isFile(const char* directory);
    91 
    9294};
    9395
Note: See TracChangeset for help on using the changeset viewer.