Changeset 4139 in orxonox.OLD for orxonox/branches/md2_loader/src/util
- Timestamp:
- May 10, 2005, 10:39:01 AM (20 years ago)
- Location:
- orxonox/branches/md2_loader/src/util
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/util/object_manager.h
r4127 r4139 16 16 #include "base_object.h" 17 17 18 #define OM_ 19 20 class WorldEntity; 21 22 23 template<class T> class tList; 18 24 19 25 //! the object manager itself … … 24 30 virtual ~ObjectManager(void); 25 31 32 void preLoad(); 33 26 34 private: 27 35 ObjectManager(void); 28 36 static ObjectManager* singletonRef; 37 38 tList<WorldEntity>* projectileBuffer; //!< a list of projectiles that is generated at the beginning to make orx faster 39 40 29 41 }; 30 42 -
orxonox/branches/md2_loader/src/util/resource_manager.cc
r4065 r4139 100 100 return false; 101 101 } 102 } 103 104 /** 105 \brief checks for the DataDirectory, by looking if 106 \param fileInside is inisde?? 107 */ 108 bool ResourceManager::checkDataDir(const char* fileInside) 109 { 110 bool retVal; 111 if (!isDir(this->dataDir)) 112 { 113 PRINTF(1)("%s is not a directory\n", this->dataDir); 114 return false; 115 } 116 117 char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1]; 118 sprintf(testFile, "%s%s", this->dataDir, fileInside); 119 retVal = isFile(testFile); 120 delete testFile; 121 return retVal; 102 122 } 103 123 … … 183 203 // searching if the resource was loaded before. 184 204 Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3); 185 if (tmpResource) // if the resource was notloaded before.205 if (tmpResource) // if the resource was loaded before. 186 206 { 187 207 PRINTF(4)("not loading cached resource %s\n", tmpResource->name); … … 202 222 203 223 // creating the full name. (directoryName + FileName) 204 char* fullName = new char[strlen(dataDir)+strlen(fileName)+1]; 205 sprintf(fullName, "%s%s", this->dataDir, fileName); 206 224 char* fullName = new char[strlen(this->getDataDir())+strlen(fileName)+1]; 225 sprintf(fullName, "%s%s", this->getDataDir(), fileName); 207 226 // Checking for the type of resource \see ResourceType 208 227 switch(type) … … 214 233 tmpResource->modelSize = 1.0; 215 234 216 if( isFile(fullName))235 if(ResourceManager::isFile(fullName)) 217 236 tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize); 218 237 else -
orxonox/branches/md2_loader/src/util/resource_manager.h
r4063 r4139 65 65 66 66 bool setDataDir(const char* dataDir); 67 /** \returns the Name of the data directory */ 68 inline const char* getDataDir(void) {return this->dataDir;} 69 bool checkDataDir(const char* fileInside); 67 70 bool addImageDir(char* imageDir); 68 71 void* load(const char* fileName, ResourcePriority prio = RP_NO,
Note: See TracChangeset
for help on using the changeset viewer.