Merge branch 'master' of github.com:Faerbit/swp

This commit is contained in:
Jasper 2015-03-04 15:33:50 +01:00
commit cdde802756
9 changed files with 11 additions and 3 deletions

Binary file not shown.

View File

@ -76,6 +76,8 @@
<bColour>0.3</bColour>
<intensity>4.0</intensity>
<flameOffset>-1.5</flameOffset>
<flameHeight>3.0</flameHeight>
<flameWidth>0.8</flameWidth>
</light>
</composition>

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 KiB

Binary file not shown.

BIN
data/textures/sun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
data/textures/sun.xcf Normal file

Binary file not shown.

View File

@ -1,10 +1,12 @@
#include "light.hh"
Light::Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset)
Light::Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset, float flameHeight, float flameWidth)
: Entity(position, glm::vec3(0.0f, 0.0f, 0.0f)) {
this->colour = colour;
this->intensity = intensity;
this->flameYOffset = flameYOffset;
this->flameHeight = flameHeight;
this->flameWidth = flameWidth;
}
Light::Light() {

View File

@ -6,7 +6,7 @@
class Light : public Entity {
public:
Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset = 0.0f);
Light(glm::vec3 position, glm::vec3 colour, float intensity, float flameYOffset = 0.0f, float flameHeight = 0.0f, float flameWidth = 0.0f);
Light();
glm::vec3 getColour();
float getIntensity();
@ -14,6 +14,8 @@ class Light : public Entity {
~Light();
private:
float flameYOffset;
float flameHeight;
float flameWidth;
float intensity;
glm::vec3 colour;
};

View File

@ -299,7 +299,9 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa
if (flameOffset != NULL){
float offset = 0;
errorCheck(flameOffset->QueryFloatText(&offset));
Light light = Light(lightPosition, lightColour, lightIntensity, offset);
float flameHeight = queryBool(xmlLight, "flameHeight");
float flameWidth = queryBool(xmlLight, "flameWidth");
Light light = Light(lightPosition, lightColour, lightIntensity, offset, flameHeight, flameWidth);
level->addLight(light);
}
else {