Changeset 9836 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/resource_manager.cc
- Timestamp:
- Sep 26, 2006, 5:16:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/resource_manager.cc
r9835 r9836 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD 17 17 18 #include " new_resource_manager.h"18 #include "resource_manager.h" 19 19 #include "debug.h" 20 20 … … 25 25 namespace Resources 26 26 { 27 ObjectListDefinition( NewResourceManager);28 //! Singleton Reference to the NewResourceManager29 NewResourceManager* NewResourceManager::_singletonRef = NULL;27 ObjectListDefinition(ResourceManager); 28 //! Singleton Reference to the ResourceManager 29 ResourceManager* ResourceManager::_singletonRef = NULL; 30 30 31 31 … … 33 33 * @brief standard constructor 34 34 */ 35 NewResourceManager::NewResourceManager ()35 ResourceManager::ResourceManager () 36 36 { 37 this->registerObject(this, NewResourceManager::_objectList);38 this->setName(" NewResourceManager");37 this->registerObject(this, ResourceManager::_objectList); 38 this->setName("ResourceManager"); 39 39 this->_mainGlobalPath = Directory("./"); 40 40 } … … 44 44 * @brief standard destructor 45 45 */ 46 NewResourceManager::~NewResourceManager ()46 ResourceManager::~ResourceManager () 47 47 { 48 48 // deleting the Resources-List … … 52 52 // PRINTF(1)("Not removed all Resources, since there are still %d resources registered\n", this->resourceList.size()); 53 53 54 NewResourceManager::_singletonRef = NULL;54 ResourceManager::_singletonRef = NULL; 55 55 } 56 56 … … 58 58 59 59 60 void NewResourceManager::registerType(Resources::Type* type)60 void ResourceManager::registerType(Resources::Type* type) 61 61 { 62 62 if(type->id() == -1) … … 68 68 } 69 69 70 void NewResourceManager::unregisterType(Resources::Type* type)70 void ResourceManager::unregisterType(Resources::Type* type) 71 71 { 72 72 std::vector<Resources::Type*>::iterator it = std::find (this->_resourceTypes.begin(), this->_resourceTypes.end(), type); … … 79 79 80 80 81 void NewResourceManager::setMainGlobalPath(const Directory& directory)81 void ResourceManager::setMainGlobalPath(const Directory& directory) 82 82 { 83 83 this->_mainGlobalPath = directory; … … 85 85 } 86 86 87 void NewResourceManager::addGlobalPath(const Directory& directory)87 void ResourceManager::addGlobalPath(const Directory& directory) 88 88 { 89 89 std::vector<Directory>::const_iterator it = std::find(this->_globalPaths.begin(), this->_globalPaths.end(), directory); … … 93 93 94 94 95 bool NewResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName)95 bool ResourceManager::addResourcePath(const std::string& resourceName, const std::string& pathName) 96 96 { 97 97 std::vector<Resources::Type*>::iterator it; … … 103 103 } 104 104 105 bool NewResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName)105 bool ResourceManager::addResourceSubPath(const std::string& resourceName, const std::string& pathName) 106 106 { 107 107 std::vector<Resources::Type*>::iterator it; … … 115 115 116 116 117 bool NewResourceManager::checkFileInMainPath(const File& fileInside)117 bool ResourceManager::checkFileInMainPath(const File& fileInside) 118 118 { 119 119 return (this->_mainGlobalPath + fileInside).exists(); 120 120 } 121 121 122 std::string NewResourceManager::prependAbsoluteMainPath(const std::string& fileName)122 std::string ResourceManager::prependAbsoluteMainPath(const std::string& fileName) 123 123 { 124 124 return (this->_mainGlobalPath + File(fileName)).name(); … … 126 126 127 127 128 unsigned int NewResourceManager::addKeepLevelName(const std::string& keepLevelName)128 unsigned int ResourceManager::addKeepLevelName(const std::string& keepLevelName) 129 129 { 130 130 this->_keepLevelNames.push_back(keepLevelName); … … 132 132 } 133 133 134 unsigned int NewResourceManager::getKeepLevelID(const std::string& keepLevelName) const134 unsigned int ResourceManager::getKeepLevelID(const std::string& keepLevelName) const 135 135 { 136 136 for (unsigned int i = 0; i < this->_keepLevelNames.size(); ++i) … … 142 142 } 143 143 144 const std::string& NewResourceManager::getKeepLevelName(unsigned int keepLevelID) const144 const std::string& ResourceManager::getKeepLevelName(unsigned int keepLevelID) const 145 145 { 146 146 assert(keepLevelID < this->_keepLevelNames.size()); … … 150 150 151 151 /** 152 * @brief outputs debug information about the NewResourceManager152 * @brief outputs debug information about the ResourceManager 153 153 */ 154 void NewResourceManager::debug() const154 void ResourceManager::debug() const 155 155 { 156 156 PRINT(0)("=RM===================================\n");
Note: See TracChangeset
for help on using the changeset viewer.