[colobot] 281/377: Moved LightLocations to outside of UniformLocations

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:34:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 79c21f66763c55495109f8226152273c18c05df9
Author: Tomasz Kapuściński <tomaszkax86 at gmail.com>
Date:   Mon Feb 15 20:05:25 2016 +0100

    Moved LightLocations to outside of UniformLocations
---
 src/graphics/opengl/gl21device.cpp |  2 +-
 src/graphics/opengl/gl21device.h   | 36 +++++++++++++++++++-----------------
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/graphics/opengl/gl21device.cpp b/src/graphics/opengl/gl21device.cpp
index 1f8d16e..f68d698 100644
--- a/src/graphics/opengl/gl21device.cpp
+++ b/src/graphics/opengl/gl21device.cpp
@@ -683,7 +683,7 @@ void CGL21Device::SetLight(int index, const Light &light)
 
     m_lights[index] = light;
 
-    UniformLocations::LightLocations &loc = m_uniforms[m_mode].lights[index];
+    LightLocations &loc = m_uniforms[m_mode].lights[index];
 
     glUniform4fv(loc.ambient, 1, light.ambient.Array());
     glUniform4fv(loc.diffuse, 1, light.diffuse.Array());
diff --git a/src/graphics/opengl/gl21device.h b/src/graphics/opengl/gl21device.h
index 7ee790b..c436254 100644
--- a/src/graphics/opengl/gl21device.h
+++ b/src/graphics/opengl/gl21device.h
@@ -42,6 +42,24 @@
 namespace Gfx
 {
 
+struct LightLocations
+{
+    //! true enables light
+    GLint enabled = -1;
+    //! Light type
+    GLint type = -1;
+    //! Position or direction vector
+    GLint position = -1;
+    //! Ambient color
+    GLint ambient = -1;
+    //! Diffuse color
+    GLint diffuse = -1;
+    //! Specular color
+    GLint specular = -1;
+    //! Attenuation
+    GLint attenuation = -1;
+};
+
 struct UniformLocations
 {
     // Uniforms
@@ -91,23 +109,7 @@ struct UniformLocations
     //! Specular color
     GLint specularColor = -1;
 
-    struct LightLocations
-    {
-        //! true enables light
-        GLint enabled = -1;
-        //! Light type
-        GLint type = -1;
-        //! Position or direction vector
-        GLint position = -1;
-        //! Ambient color
-        GLint ambient = -1;
-        //! Diffuse color
-        GLint diffuse = -1;
-        //! Specular color
-        GLint specular = -1;
-        //! Attenuation
-        GLint attenuation = -1;
-    } lights[8];
+    LightLocations lights[8] = {};
 };
 
 /**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list