Removed hardcoded level file path and moved it into the config.xml.

This commit is contained in:
Faerbit 2015-03-14 13:04:33 +01:00
parent 370135fca8
commit 63acfef341
2 changed files with 3 additions and 5 deletions

View File

@ -21,8 +21,7 @@
<heightmapPath>data/levels/</heightmapPath> <heightmapPath>data/levels/</heightmapPath>
<levelXmlPath>data/levels/</levelXmlPath> <levelXmlPath>data/levels/Level1.xml</levelXmlPath>
<!-- must be located in the textures directory --> <!-- must be located in the textures directory -->
<loadingScreen> <loadingScreen>

View File

@ -22,8 +22,7 @@ void Application::init()
} }
void Application::initLevel() { void Application::initLevel() {
std::string levelXmlFilePath = levelXmlPath + "Level1.xml"; this->level = Level(levelXmlPath);
this->level = Level(levelXmlFilePath);
level.getPhysics()->init(geometryPath); level.getPhysics()->init(geometryPath);
// Don't change this! // Don't change this!
ignoredMouseUpdates = 0; ignoredMouseUpdates = 0;
@ -36,7 +35,7 @@ void Application::initLevel() {
level.load(); level.load();
Loader loader = Loader(); Loader loader = Loader();
loader.load(levelXmlFilePath, &level, compositionsPath, scriptPath, geometryPath, texturePath, heightmapPath); loader.load(levelXmlPath, &level, compositionsPath, scriptPath, geometryPath, texturePath, heightmapPath);
graphics.init(&level); graphics.init(&level);
// just in case: check for errors // just in case: check for errors