Author Topic: Constant gameCamera declared twice  (Read 1289 times)

asmodeus

  • Guest
Constant gameCamera declared twice
« on: 12 October 2008, 11:17:57 »
the constant gameCamera is declared twice in Renderer::setupLighting

Code: [Select]
Index: trunk/source/glest_game/graphics/renderer.cpp
===================================================================
--- trunk/source/glest_game/graphics/renderer.cpp (revision 177)
+++ trunk/source/glest_game/graphics/renderer.cpp (working copy)
@@ -428,7 +428,7 @@
                     unit->getType()->getLight() && unit->isOperative()){
 
  Vec4f pos= Vec4f(unit->getCurrVector());
-                    pos.y+=4.f;
+                     pos.y+=4.f;
 
  GLenum lightEnum= GL_LIGHT0 + lightCount;
 
@@ -438,11 +438,8 @@
  glLightfv(lightEnum, GL_DIFFUSE, Vec4f(unit->getType()->getLightColor()).ptr());
  glLightfv(lightEnum, GL_SPECULAR, Vec4f(unit->getType()->getLightColor()*0.3f).ptr());
  glLightf(lightEnum, GL_QUADRATIC_ATTENUATION, 0.05f);
-
-                    ++lightCount;
+ ++lightCount;
                 
- const GameCamera *gameCamera= game->getGameCamera();
-
  if(Vec3f(pos).dist(gameCamera->getPos())<Vec3f(nearestLightPos).dist(gameCamera->getPos())){
  nearestLightPos= pos;
  }