summaryrefslogtreecommitdiff
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2010-03-10 15:49:30 +0100
committerMichal Krol <michal@vmware.com>2010-03-10 15:49:30 +0100
commit3ce4375912c8ea488460e593e07c5bb15b92dca9 (patch)
tree1011fa439bd829fd46a44fd99478135848800e73 /src/mesa/main/light.c
parentf59f28093ea827bd234d8e1a36bdd56a9fce5f09 (diff)
parent9b348d0ed125a22be3f318ac60cef6f201edfdab (diff)
Merge branch 'master' into gallium-sampler-view
Conflicts: src/gallium/auxiliary/Makefile src/gallium/auxiliary/SConscript src/gallium/auxiliary/tgsi/tgsi_exec.c src/gallium/auxiliary/util/u_blitter.c src/gallium/drivers/i915/i915_context.h src/gallium/drivers/i965/brw_context.h src/gallium/drivers/llvmpipe/lp_context.h src/gallium/drivers/nv50/nv50_context.h src/gallium/drivers/nv50/nv50_state_validate.c src/gallium/drivers/nv50/nv50_tex.c src/gallium/drivers/r300/r300_blit.c src/gallium/drivers/r300/r300_context.h src/gallium/drivers/r300/r300_emit.c src/gallium/drivers/r300/r300_state.c src/gallium/drivers/softpipe/sp_context.h src/gallium/drivers/svga/svga_context.h src/gallium/drivers/svga/svga_pipe_sampler.c
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c45
1 files changed, 18 insertions, 27 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 654faa5c77..19dc96892d 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1093,31 +1093,22 @@ _mesa_update_lighting( GLcontext *ctx )
* FLUSH_UPDATE_CURRENT, as when any outstanding material changes
* are flushed, they will update the derived state at that time.
*/
- if (ctx->Visual.rgbMode) {
- if (ctx->Light.Model.TwoSide)
- _mesa_update_material( ctx,
- MAT_BIT_FRONT_EMISSION |
- MAT_BIT_FRONT_AMBIENT |
- MAT_BIT_FRONT_DIFFUSE |
- MAT_BIT_FRONT_SPECULAR |
- MAT_BIT_BACK_EMISSION |
- MAT_BIT_BACK_AMBIENT |
- MAT_BIT_BACK_DIFFUSE |
- MAT_BIT_BACK_SPECULAR);
- else
- _mesa_update_material( ctx,
- MAT_BIT_FRONT_EMISSION |
- MAT_BIT_FRONT_AMBIENT |
- MAT_BIT_FRONT_DIFFUSE |
- MAT_BIT_FRONT_SPECULAR);
- }
- else {
- static const GLfloat ci[3] = { .30F, .59F, .11F };
- foreach(light, &ctx->Light.EnabledList) {
- light->_dli = DOT3(ci, light->Diffuse);
- light->_sli = DOT3(ci, light->Specular);
- }
- }
+ if (ctx->Light.Model.TwoSide)
+ _mesa_update_material(ctx,
+ MAT_BIT_FRONT_EMISSION |
+ MAT_BIT_FRONT_AMBIENT |
+ MAT_BIT_FRONT_DIFFUSE |
+ MAT_BIT_FRONT_SPECULAR |
+ MAT_BIT_BACK_EMISSION |
+ MAT_BIT_BACK_AMBIENT |
+ MAT_BIT_BACK_DIFFUSE |
+ MAT_BIT_BACK_SPECULAR);
+ else
+ _mesa_update_material(ctx,
+ MAT_BIT_FRONT_EMISSION |
+ MAT_BIT_FRONT_AMBIENT |
+ MAT_BIT_FRONT_DIFFUSE |
+ MAT_BIT_FRONT_SPECULAR);
}
@@ -1433,7 +1424,7 @@ _mesa_free_lighting_data( GLcontext *ctx )
/* Free lighting shininess exponentiation table */
foreach_s( s, tmps, ctx->_ShineTabList ) {
- _mesa_free( s );
+ free( s );
}
- _mesa_free( ctx->_ShineTabList );
+ free( ctx->_ShineTabList );
}