Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2009, 2:22:00 AM (15 years ago)
Author:
rgrieder
Message:

Merged resource2 branch back to trunk.

IMPORTANT NOTE:
Upon this merge you need to specifically call your data directory "data_extern" when checking it out (when you don't provide a name, it will be just called 'trunk').
The new CMake variable is EXTERNAL_DATA_DIRECTORY. DATA_DIRECTORY now points to the one the source part of the repository.
UPDATE YOUR DATA DIRECTORY AS WELL!!!

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/LevelManager.cc

    r3370 r5695  
    3030
    3131#include <map>
    32 #include <boost/filesystem.hpp>
     32#include <OgreResourceGroupManager.h>
    3333
    3434#include "core/CommandLine.h"
     
    135135        availableLevels_.clear();
    136136
    137         boost::filesystem::directory_iterator file(Core::getMediaPathString() + "levels");
    138         boost::filesystem::directory_iterator end;
     137        availableLevels_ = *Ogre::ResourceGroupManager::getSingleton().findResourceNames(
     138            Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "*.oxw");
    139139
    140         while (file != end)
    141         {
    142             if (!boost::filesystem::is_directory(*file) && file->string()[file->string().length()-1] != '~')
     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
    143144            {
    144                 std::string filename = file->path().leaf();
    145                 if (filename.length() > 4)
    146                     availableLevels_.push_back(filename.substr(0,filename.length()-4));
     145                size_t pos = it->find(".oxw");
     146                *it = it->substr(0, pos);
     147                ++it;
    147148            }
    148             ++file;
    149         }
    150149    }
    151150}
Note: See TracChangeset for help on using the changeset viewer.