diff options
author | Alan Hourihane <[email protected]> | 2004-04-26 10:10:22 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2004-04-26 10:10:22 +0000 |
commit | 462183fe4cb6df6d90632d9e2cee881c8d26b1cb (patch) | |
tree | 0fb5d1c17d80026bec0fe3c2e0449fe30ea9e69e /src/mesa/tnl/t_vb_lighttmp.h | |
parent | 08fa6de85035c428d77cb88b11a4638b706794b5 (diff) |
bring over build fixes from stable branch
Diffstat (limited to 'src/mesa/tnl/t_vb_lighttmp.h')
-rw-r--r-- | src/mesa/tnl/t_vb_lighttmp.h | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index cd7988518b0..2eaf61ff4d0 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -28,7 +28,7 @@ */ -#if (IDX & LIGHT_TWOSIDE) +#if IDX & LIGHT_TWOSIDE # define NR_SIDES 2 #else # define NR_SIDES 1 @@ -283,18 +283,19 @@ static void TAG(light_rgba)( GLcontext *ctx, GLfloat sum[2][3]; struct gl_light *light; - if ( IDX & LIGHT_MATERIAL ) { - update_materials( ctx, store ); - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; +#if IDX & LIGHT_MATERIAL + update_materials( ctx, store ); + sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; #if IDX & LIGHT_TWOSIDE - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; + sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; +#endif #endif - } COPY_3V(sum[0], base[0]); - if ( IDX & LIGHT_TWOSIDE ) - COPY_3V(sum[1], base[1]); +#if IDX & LIGHT_TWOSIDE + COPY_3V(sum[1], base[1]); +#endif /* Add contribution from each enabled light source */ foreach (light, &ctx->Light.EnabledList) { @@ -467,12 +468,16 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx, GLfloat n_dot_VP; - if ( IDX & LIGHT_MATERIAL ) - update_materials( ctx, store ); +#if IDX & LIGHT_MATERIAL + update_materials( ctx, store ); +#endif /* No attenuation, so incoporate _MatAmbient into base color. */ - if ( j == 0 || (IDX & LIGHT_MATERIAL) ) { +#if !(IDX & LIGHT_MATERIAL) + if ( j == 0 ) +#endif + { COPY_3V(base[0], light->_MatAmbient[0]); ACC_3V(base[0], ctx->Light._BaseColor[0] ); base[0][3] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; @@ -565,14 +570,14 @@ static void TAG(light_fast_rgba)( GLcontext *ctx, GLfloat sum[2][3]; - if ( IDX & LIGHT_MATERIAL ) { - update_materials( ctx, store ); +#if IDX & LIGHT_MATERIAL + update_materials( ctx, store ); - sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; + sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; #if IDX & LIGHT_TWOSIDE - sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; + sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; +#endif #endif - } COPY_3V(sum[0], ctx->Light._BaseColor[0]); @@ -675,14 +680,15 @@ static void TAG(light_ci)( GLcontext *ctx, GLuint side = 0; struct gl_light *light; - if ( IDX & LIGHT_MATERIAL ) - update_materials( ctx, store ); +#if IDX & LIGHT_MATERIAL + update_materials( ctx, store ); +#endif diffuse[0] = specular[0] = 0.0F; - if ( IDX & LIGHT_TWOSIDE ) { +#if IDX & LIGHT_TWOSIDE diffuse[1] = specular[1] = 0.0F; - } +#endif /* Accumulate diffuse and specular from each light source */ foreach (light, &ctx->Light.EnabledList) { |