From 08c646bb929c7bc98b005521b6e0c14428f651d0 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Thu, 28 Feb 2013 21:26:09 +0100 Subject: 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 --- src/object/task/taskbuild.cpp | 17 +++++------------ src/object/task/taskshield.cpp | 13 ++++--------- 2 files changed, 9 insertions(+), 21 deletions(-) (limited to 'src/object/task') diff --git a/src/object/task/taskbuild.cpp b/src/object/task/taskbuild.cpp index f209cd5..b9af475 100644 --- a/src/object/task/taskbuild.cpp +++ b/src/object/task/taskbuild.cpp @@ -114,7 +114,6 @@ bool CTaskBuild::CreateBuilding(Math::Vector pos, float angle) void CTaskBuild::CreateLight() { - Gfx::Light light; Gfx::Color color; Math::Vector center, pos, dir; Math::Point c, p; @@ -141,18 +140,12 @@ void CTaskBuild::CreateLight() pos.y = center.y+40.0f; dir = center-pos; - memset(&light, 0, sizeof(light)); + Gfx::Light light; light.type = Gfx::LIGHT_SPOT; - light.diffuse.r = 0.0f; - light.diffuse.g = 0.0f; - light.diffuse.b = 0.0f; // white (invisible) - light.position.x = pos.x; - light.position.y = pos.y; - light.position.z = pos.z; - light.direction.x = dir.x; - light.direction.y = dir.y; - light.direction.z = dir.z; - //TODO Is this value correct + light.ambient = Gfx::Color(0.0f, 0.0f, 0.0f); + light.diffuse = Gfx::Color(0.0f, 0.0f, 0.0f); // invisible + light.position = pos; + light.direction = dir; light.spotIntensity = 128; light.attenuation0 = 1.0f; light.attenuation1 = 0.0f; diff --git a/src/object/task/taskshield.cpp b/src/object/task/taskshield.cpp index 4b2fccd..929dd5c 100644 --- a/src/object/task/taskshield.cpp +++ b/src/object/task/taskshield.cpp @@ -488,15 +488,10 @@ bool CTaskShield::CreateLight(Math::Vector pos) memset(&light, 0, sizeof(light)); light.type = Gfx::LIGHT_SPOT; - light.diffuse.r = 0.0f; - light.diffuse.g = 1.0f; - light.diffuse.b = 2.0f; - light.position.x = pos.x; - light.position.y = pos.y; - light.position.z = pos.z; - light.direction.x = 0.0f; - light.direction.y = -1.0f; // against the bottom - light.direction.z = 0.0f; + light.ambient = Gfx::Color(0.0f, 0.0f, 0.0f); + light.diffuse = Gfx::Color(0.0f, 1.0f, 2.0f); + light.position = pos; + light.direction = Math::Vector(0.0f, -1.0f, 0.0f); // against the bottom light.spotIntensity = 128; light.attenuation0 = 1.0f; light.attenuation1 = 0.0f; -- cgit v1.2.3-1-g7c22