From af9f6d69332829c9241c2a0d8727e0b17f0a412d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Tue, 17 Feb 2015 12:54:21 +0100 Subject: [PATCH] Added loading of flames. --- data/levels/Compositions.xml | 1 + loader.cc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/data/levels/Compositions.xml b/data/levels/Compositions.xml index e328779..9203b8f 100644 --- a/data/levels/Compositions.xml +++ b/data/levels/Compositions.xml @@ -75,6 +75,7 @@ 1.0 1.0 4.0 + 0.5 diff --git a/loader.cc b/loader.cc index 4f3cee2..0c091e1 100644 --- a/loader.cc +++ b/loader.cc @@ -374,6 +374,14 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa glm::vec3 lightPosition = compPos + glm::vec3(rotatedLightOffset.x,rotatedLightOffset.y,rotatedLightOffset.z); Light light = Light(lightPosition, lightColour, lightIntensity); level->addLight(light); + XMLElement* flameOffset = NULL; + flameOffset = xmlLight->FirstChildElement("flameOffset"); + if (flameOffset != NULL){ + float offset = 0; + errorCheck(flameOffset->QueryFloatText(&offset)); + Flame flame = Flame(offset, lightPosition, glm::vec3(0,0,0)); + level->addFlame(flame); + } }//iterating over all lights of the composition }//corect composition found }//iterating over all compositions in Compositions.xml