[Bf-blender-cvs] [3dbc408] soc-2013-viewport_fx: added assert to check for negative light index, also some whitespace cleanup
jwilkins
noreply at git.blender.org
Sat Feb 15 20:36:50 CET 2014
Commit: 3dbc408d897a9c45679adcea87781b0c0ae8da0e
Author: jwilkins
Date: Sat Feb 15 13:20:13 2014 -0600
https://developer.blender.org/rB3dbc408d897a9c45679adcea87781b0c0ae8da0e
added assert to check for negative light index, also some whitespace cleanup
===================================================================
M source/blender/gpu/intern/gpu_lighting.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_lighting.c b/source/blender/gpu/intern/gpu_lighting.c
index 41b5b46..85aa8d0 100644
--- a/source/blender/gpu/intern/gpu_lighting.c
+++ b/source/blender/gpu/intern/gpu_lighting.c
@@ -131,16 +131,16 @@ void gpu_commit_lighting(void)
glEnable (GL_LIGHT0+i);
glLightfv(GL_LIGHT0+i, GL_POSITION, light->position); // deprecated
- glLightfv(GL_LIGHT0+i, GL_DIFFUSE, light->diffuse); // deprecated
- glLightfv(GL_LIGHT0+i, GL_SPECULAR, light->specular); // deprecated
+ glLightfv(GL_LIGHT0+i, GL_DIFFUSE, light->diffuse); // deprecated
+ glLightfv(GL_LIGHT0+i, GL_SPECULAR, light->specular); // deprecated
- glLightf (GL_LIGHT0+i, GL_CONSTANT_ATTENUATION, light->constant_attenuation); // deprecated
- glLightf (GL_LIGHT0+i, GL_LINEAR_ATTENUATION, light->linear_attenuation); // deprecated
- glLightf (GL_LIGHT0+i, GL_QUADRATIC_ATTENUATION, light->quadratic_attenuation); // deprecated
+ glLightf (GL_LIGHT0+i, GL_CONSTANT_ATTENUATION, light->constant_attenuation); // deprecated
+ glLightf (GL_LIGHT0+i, GL_LINEAR_ATTENUATION, light->linear_attenuation); // deprecated
+ glLightf (GL_LIGHT0+i, GL_QUADRATIC_ATTENUATION, light->quadratic_attenuation); // deprecated
- glLightfv(GL_LIGHT0+i, GL_SPOT_DIRECTION, light->spot_direction); // deprecated
+ glLightfv(GL_LIGHT0+i, GL_SPOT_DIRECTION, light->spot_direction); // deprecated
glLightf (GL_LIGHT0+i, GL_SPOT_CUTOFF, light->spot_cutoff); // deprecated
- glLightf (GL_LIGHT0+i, GL_SPOT_EXPONENT, light->spot_exponent); // deprecated
+ glLightf (GL_LIGHT0+i, GL_SPOT_EXPONENT, light->spot_exponent); // deprecated
}
#endif
@@ -203,6 +203,7 @@ void GPU_set_basic_material_specular(const float specular[4])
void GPU_restore_basic_lights(int light_count, const GPUbasiclight lights[])
{
+ GPU_ASSERT(light_count >= 0);
GPU_ASSERT(light_count < GPU_MAX_COMMON_LIGHTS);
memcpy(LIGHTING.light, lights, light_count*sizeof(GPUbasiclight));
More information about the Bf-blender-cvs
mailing list