From 6c2fb865b61ab1897f9526c644bc0e102a9b3289 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Wed, 4 Mar 2015 21:05:24 +0100 Subject: [PATCH] Removed hardcoded obj file name from skydome. --- data/levels/Level1.xml | 1 + loader.cc | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/data/levels/Level1.xml b/data/levels/Level1.xml index f7aee18..019539a 100644 --- a/data/levels/Level1.xml +++ b/data/levels/Level1.xml @@ -12115,6 +12115,7 @@ + skydome.obj skydomeNew.png diff --git a/loader.cc b/loader.cc index 09ed843..9fb62cf 100644 --- a/loader.cc +++ b/loader.cc @@ -71,18 +71,19 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa //load the skydome XMLElement* skydomeElement = doc->FirstChildElement("skydome"); std::string skydomeTexture = queryString(skydomeElement, "texture"); - std::string skydomePath = "../" + globalGeometryPath + "skydome.obj"; + std::string skydomeModelFileName = queryString(skydomeElement, "model"); + std::string skydomePath = "../" + globalGeometryPath + skydomeModelFileName; if(stat(skydomePath.c_str(), &buf) != 0){ std::cout << "The object file " << skydomePath << " does not exist." << std::endl; exit(-1); } - Model skydomeModel = Model("skydome.obj", level->getSkydomeSize()); + Model skydomeModel = Model(skydomeModelFileName, level->getSkydomeSize()); std::string skydomeTexturePath = "../" + globalTexturePath + skydomeTexture; if(stat(skydomeTexturePath.c_str(), &buf) != 0){ std::cout << "The texture file " << skydomeTexturePath << " does not exist." << std::endl; exit(-1); } - Material skydomeMaterial = Material(skydomeTexture, 0.7f, 0.0f, 0.0f, 0.0f); + Material skydomeMaterial = Material(skydomeTexture, 1.0f, 0.0f, 0.0f, 0.0f); Object* skydomeObject = new Object(skydomeModel, skydomeMaterial, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), true); level->setSkydomeObject(skydomeObject);