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>
<levelXmlPath>data/levels/</levelXmlPath>
<levelXmlPath>data/levels/Level1.xml</levelXmlPath>
<!-- must be located in the textures directory -->
<loadingScreen>

View File

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