Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9795 in orxonox.OLD


Ignore:
Timestamp:
Sep 23, 2006, 6:52:01 PM (18 years ago)
Author:
bensch
Message:

the new ResourceManger should work with the global settings

Location:
branches/new_class_id/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/new_resource_manager.cc

    r9794 r9795  
    3434NewResourceManager::NewResourceManager ()
    3535{
    36   //this->registerObject(this, NewResourceManager::_objectList);
     36  this->registerObject(this, NewResourceManager::_objectList);
    3737  this->setName("NewResourceManager");
    3838
     
    103103
    104104
     105
     106bool NewResourceManager::checkFileInMainPath(const File& fileInside)
     107{
     108  return (this->_mainGlobalPath + fileInside).exists();
     109}
     110
     111
    105112/**
    106113 * @brief outputs debug information about the NewResourceManager
     
    114121  std::vector<Resources::Type*>::const_iterator it;
    115122  for (it = this->_resourceTypes.begin(); it != this->_resourceTypes.end(); ++it)
     123  {
    116124    (*it)->debug();
     125    if (it != --this->_resourceTypes.end())
     126      PRINT(0)(" ------------------------------------\n ");
     127  }
    117128
    118129  PRINT(0)("==================================RM==\n");
  • branches/new_class_id/src/lib/util/loading/new_resource_manager.h

    r9794 r9795  
    3333
    3434
    35   bool verifyDataDir(const std::string& fileInside);
     35  bool checkFileInMainPath(const File& fileInside);
    3636
    3737  bool unloadAllByPriority();
  • branches/new_class_id/src/lib/util/loading/resource.cc

    r9794 r9795  
    5050
    5151  std::string locatedFile;
    52   locatedFile = locateFileInSubDir(Directory("/home/bensch/svn/orxonox/data/"), fileName);
     52  locatedFile = locateFileInSubDir(NewResourceManager::getInstance()->mainGlobalPath(), fileName);
    5353  if (!locatedFile.empty())
    5454  {
     
    5656    return locatedFile;
    5757  }
    58   return std::string("/home/bensch/svn/orxonox/data/") + fileName;
     58
     59  return (NewResourceManager::getInstance()->mainGlobalPath() + File(fileName)).name();
    5960}
    6061
  • branches/new_class_id/src/orxonox.cc

    r9793 r9795  
    366366  }
    367367
     368  NewResourceManager::getInstance()->setMainGlobalPath(dataPath);
     369  if (!NewResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE)))
     370    exit(-1);
     371
     372
    368373  //! @todo this is a hack and should be loadable
    369374  NewResourceManager::getInstance()->addResourceSubPath("Texture", "maps");
Note: See TracChangeset for help on using the changeset viewer.