Changeset 9851 in orxonox.OLD for branches/new_class_id
- Timestamp:
- Sep 28, 2006, 12:48:03 AM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/shell/some_shell_commands.cc
r9848 r9851 56 56 SHELL_COMMAND(debug, ResourceManager, debug); 57 57 SHELL_COMMAND(load, ResourceManager, loadFromLoadString); 58 SHELL_COMMAND(unload, ResourceManager, unloadAllBelowKeepLevelINT); 58 59 } 59 60 -
branches/new_class_id/src/lib/util/loading/resource.cc
r9850 r9851 165 165 StorePointer::StorePointer(const std::string& loadString, const KeepLevel& keeplevel) 166 166 : _loadString(loadString), _keepLevel(keeplevel) 167 {} 168 167 { 168 PRINTF(4)("Acquired a Resource with LoadString '%s' and KeepLevel '%s'\n", _loadString.c_str(), _keepLevel.name().c_str()); 169 } 170 171 StorePointer::~StorePointer() 172 { 173 PRINTF(4)("Deleting Stored Resource '%s' from KeepLevel '%s'\n", _loadString.c_str(), _keepLevel.name().c_str()); 174 }; 169 175 170 176 … … 234 240 void Type::unloadAllBelowKeepLevel(const Resources::KeepLevel& keepLevel) 235 241 { 236 std::vector<Resources::StorePointer*>::iterator it; 237 for (it = this->_storedResources.begin(); it != this->_storedResources.end(); ++it) 238 if((*it)->keepLevel() < keepLevel && (*it)->last()) 239 { 240 delete (*it); 241 this->_storedResources.erase(it); 242 it = this->_storedResources.begin(); 243 } 242 std::vector<Resources::StorePointer*>::iterator it, it2; 243 bool finished = false; 244 245 while (!finished) 246 { 247 finished = true; 248 for (it = this->_storedResources.begin(); it != this->_storedResources.end();++it) 249 if((*it)->keepLevel() < keepLevel && (*it)->last()) 250 { 251 delete (*it); 252 this->_storedResources.erase(it); 253 finished = false; 254 break; 255 } 256 } 244 257 } 245 258 -
branches/new_class_id/src/lib/util/loading/resource.h
r9850 r9851 55 55 public: 56 56 //! Virtual Destructor, that removes the Stored information-pointer. 57 virtual ~StorePointer() {};57 virtual ~StorePointer(); 58 58 59 59 /** @returns the LoadString this resource was loaded with */ -
branches/new_class_id/src/lib/util/loading/resource_manager.h
r9848 r9851 47 47 48 48 void unloadAllBelowKeepLevel(const Resources::KeepLevel& keepLevel); 49 void unloadAllBelowKeepLevelINT(unsigned int level) { unloadAllBelowKeepLevel(level); }; 49 50 void loadFromLoadString(const std::string& resourceTypeName, const std::string& loadString); 50 51
Note: See TracChangeset
for help on using the changeset viewer.