Changeset 3008 for code/trunk/src/orxonox/gamestates
- Timestamp:
- May 21, 2009, 5:16:29 PM (16 years ago)
- Location:
- code/trunk/src/orxonox/gamestates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/gamestates/GSLevel.cc
r2928 r3008 60 60 SetCommandLineArgument(level, "presentation_dm.oxw").shortcut("l"); 61 61 SetConsoleCommand(GSLevel, showIngameGUI, true); 62 SetConsoleCommand(GSLevel, setLevel, true); 63 64 XMLFile* GSLevel::startFile_s = NULL; 62 65 63 66 GSLevel::GSLevel(const std::string& name) … … 68 71 , guiKeysOnlyInputState_(0) 69 72 , radar_(0) 70 , startFile_(0)71 73 , cameraManager_(0) 72 74 , levelManager_(0) … … 252 254 COUT(0) << "Loading level..." << std::endl; 253 255 std::string levelName; 254 CommandLine::getValue("level", &levelName); 255 startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName); 256 Loader::open(startFile_); 256 if (!startFile_s) 257 { 258 CommandLine::getValue("level", &levelName); 259 startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName); 260 } 261 Loader::open(startFile_s); 262 } 263 264 void GSLevel::setLevel(std::string levelName) 265 { 266 delete GSLevel::startFile_s; 267 GSLevel::startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName); 257 268 } 258 269 … … 265 276 ////////////////////////////////////////////////////////////////////////////////////////// 266 277 267 delete this->startFile_;278 delete startFile_s; 268 279 } 269 280 -
code/trunk/src/orxonox/gamestates/GSLevel.h
r2911 r3008 48 48 49 49 static void showIngameGUI(bool show); 50 static void setLevel(std::string levelName); 51 52 static XMLFile* startFile_s; 50 53 51 54 protected: … … 63 66 SimpleInputState* guiKeysOnlyInputState_; //!< input state if we only need the keys to use the GUI 64 67 Radar* radar_; //!< represents the Radar (not the HUD part) 65 XMLFile* startFile_; //!< current hard coded default level66 68 CameraManager* cameraManager_; //!< camera manager for this level 67 69 LevelManager* levelManager_; //!< global level manager
Note: See TracChangeset
for help on using the changeset viewer.