diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-26 23:18:57 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-26 23:18:57 +0200 |
commit | 80d3a9bff1d5999ec5504b50103be7687672227a (patch) | |
tree | 70a695f4304d1ac10d391b7e5c0c641ff7fc05b5 /src/object | |
parent | 2fa4d7b0db88abcccbda287af10fc336a8dbb910 (diff) | |
download | colobot-80d3a9bff1d5999ec5504b50103be7687672227a.tar.gz colobot-80d3a9bff1d5999ec5504b50103be7687672227a.tar.bz2 colobot-80d3a9bff1d5999ec5504b50103be7687672227a.zip |
Lighting fix (experimental)
- changed fixed light allocation to prioritized per-use basis
- minor refactoring in CPlanet and CWater
Diffstat (limited to 'src/object')
-rw-r--r-- | src/object/robotmain.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index d6f2d2d..10733f7 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -3908,7 +3908,9 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) OpFloat(line, "dir", 0.0f), name, Math::Point(uv1.x, uv1.z), - Math::Point(uv2.x, uv2.z)); + Math::Point(uv2.x, uv2.z), + strstr(name, "planet") != nullptr // TODO: add transparent op or modify textures + ); } if (Cmd(line, "FrontsizeName") && !resetObject) @@ -4843,7 +4845,7 @@ int CRobotMain::CreateLight(Math::Vector direction, Gfx::Color color) light.type = Gfx::LIGHT_DIRECTIONAL; light.diffuse = color; light.direction = direction; - int obj = m_lightMan->CreateLight(); + int obj = m_lightMan->CreateLight(Gfx::LIGHT_PRI_HIGH); m_lightMan->SetLight(obj, light); return obj; @@ -4866,7 +4868,7 @@ int CRobotMain::CreateSpot(Math::Vector pos, Gfx::Color color) light.attenuation0 = 2.0f; light.attenuation1 = 0.0f; light.attenuation2 = 0.0f; - int obj = m_lightMan->CreateLight(); + int obj = m_lightMan->CreateLight(Gfx::LIGHT_PRI_HIGH); m_lightMan->SetLight(obj, light); return obj; |