summaryrefslogtreecommitdiffstats
path: root/src/object/object.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-02-28 21:26:09 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2013-02-28 22:06:22 +0100
commit08c646bb929c7bc98b005521b6e0c14428f651d0 (patch)
treebd708ad596274bea8c387122bcd9fceadf620373 /src/object/object.cpp
parentb361d27d332591c59b5f8613fbf724d82872b877 (diff)
downloadcolobot-08c646bb929c7bc98b005521b6e0c14428f651d0.tar.gz
colobot-08c646bb929c7bc98b005521b6e0c14428f651d0.tar.bz2
colobot-08c646bb929c7bc98b005521b6e0c14428f651d0.zip
Fixed stupid error, tweaked ambient light colors
* fixed stupid error in light manager * tweaked ambient light colors to 0.1 of diffuse; colors should not be oversaturated now
Diffstat (limited to 'src/object/object.cpp')
-rw-r--r--src/object/object.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/src/object/object.cpp b/src/object/object.cpp
index 8f2a4cc..d6ac681 100644
--- a/src/object/object.cpp
+++ b/src/object/object.cpp
@@ -2248,15 +2248,10 @@ bool CObject::CreateShadowLight(float height, Gfx::Color color)
Gfx::Light light;
light.type = Gfx::LIGHT_SPOT;
- light.diffuse.r = color.r;
- light.diffuse.g = color.g;
- light.diffuse.b = color.b;
- light.position.x = pos.x;
- light.position.y = pos.y+height;
- light.position.z = pos.z;
- light.direction.x = 0.0f;
- light.direction.y = -1.0f; // against the bottom
- light.direction.z = 0.0f;
+ light.diffuse = color;
+ light.ambient = color * 0.1f;
+ light.position = Math::Vector(pos.x, pos.y+height, pos.z);
+ light.direction = Math::Vector(0.0f, -1.0f, 0.0f); // against the bottom
light.spotIntensity = 128;
light.attenuation0 = 1.0f;
light.attenuation1 = 0.0f;
@@ -2291,15 +2286,9 @@ bool CObject::CreateEffectLight(float height, Gfx::Color color)
Gfx::Light light;
light.type = Gfx::LIGHT_SPOT;
- light.diffuse.r = color.r;
- light.diffuse.g = color.g;
- light.diffuse.b = color.b;
- light.position.x = 0.0f;
- light.position.y = 0.0f+height;
- light.position.z = 0.0f;
- light.direction.x = 0.0f;
- light.direction.y = -1.0f; // against the bottom
- light.direction.z = 0.0f;
+ light.diffuse = color;
+ light.position = Math::Vector(0.0f, height, 0.0f);
+ light.direction = Math::Vector(0.0f, -1.0f, 0.0f); // against the bottom
light.spotIntensity = 0.0f;
light.attenuation0 = 1.0f;
light.attenuation1 = 0.0f;