Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1930 for code


Ignore:
Timestamp:
Oct 15, 2008, 1:55:36 PM (16 years ago)
Author:
rgrieder
Message:

Added command line argument 'level' to specify the level file. Include the extension and don't put quotes around it!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r1887 r1930  
    3838#include "core/CommandExecutor.h"
    3939#include "core/ConsoleCommand.h"
     40#include "core/CommandLine.h"
    4041#include "core/ConfigValueIncludes.h"
    4142#include "core/CoreIncludes.h"
     
    4950namespace orxonox
    5051{
     52    SetCommandLineArgument(level, "sample.oxw").setShortcut("l");
     53
    5154    GSLevel::GSLevel(const std::string& name)
    5255        : GameState<GSGraphics>(name)
     
    157160        // call the loader
    158161        COUT(0) << "Loading level..." << std::endl;
    159         startLevel_ = new Level(Settings::getDataPath() + "levels/sample.oxw");
     162        std::string levelName;
     163        CommandLine::getValue("level", &levelName);
     164        startLevel_ = new Level(Settings::getDataPath() + std::string("levels/") + levelName);
    160165        Loader::open(startLevel_);
    161166    }
Note: See TracChangeset for help on using the changeset viewer.