Changeset 5659 for code/branches/resource2/src/orxonox
- Timestamp:
- Aug 18, 2009, 11:41:56 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/src/orxonox/LevelManager.cc
r5645 r5659 30 30 31 31 #include <map> 32 #include < boost/filesystem.hpp>32 #include <OgreResourceGroupManager.h> 33 33 34 34 #include "core/CommandLine.h" … … 135 135 availableLevels_.clear(); 136 136 137 boost::filesystem::directory_iterator file(Core::getDataPathString() + "levels");138 boost::filesystem::directory_iterator end;137 availableLevels_ = *Ogre::ResourceGroupManager::getSingleton().findResourceNames( 138 Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "*.oxw"); 139 139 140 while (file != end) 141 { 142 if (!boost::filesystem::is_directory(*file) && file->string()[file->string().length()-1] != '~') 143 { 144 std::string filename = file->path().leaf(); 145 if (filename.length() > 4) 146 availableLevels_.push_back(filename.substr(0,filename.length()-4)); 147 } 148 ++file; 149 } 140 for (std::vector<std::string>::iterator it = availableLevels_.begin(); it != availableLevels_.end();) 141 if (it->find("old/") == 0) 142 it = availableLevels_.erase(it); 143 else 144 ++it; 150 145 } 151 146 }
Note: See TracChangeset
for help on using the changeset viewer.