diff options
author | Brian Paul <[email protected]> | 2001-09-14 21:30:31 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-09-14 21:30:31 +0000 |
commit | edf8c06270a0e62f33e3f45e1f0307acfeff3b5d (patch) | |
tree | 6da442d6083e6948895479866c884d60392bb7e5 /src/mesa/tnl/t_vb_lighttmp.h | |
parent | 7cc49c2dc84ce17a9b4cc1a376da74515a724c92 (diff) |
more warning fixes (Karl Schultz)
Diffstat (limited to 'src/mesa/tnl/t_vb_lighttmp.h')
-rw-r--r-- | src/mesa/tnl/t_vb_lighttmp.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index a60a140d50f..cb833e245d4 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -1,4 +1,4 @@ -/* $Id: t_vb_lighttmp.h,v 1.17 2001/08/13 22:17:19 keithw Exp $ */ +/* $Id: t_vb_lighttmp.h,v 1.18 2001/09/14 21:30:31 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -215,16 +215,15 @@ static void TAG(light_rgba_spec)( GLcontext *ctx, continue; /* this light makes no contribution */ } else { - double x = PV_dot_dir * (EXP_TABLE_SIZE-1); - int k = (int) x; + GLdouble x = PV_dot_dir * (EXP_TABLE_SIZE-1); + GLint k = (GLint) x; GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] - + (x-k)*light->_SpotExpTable[k][1]); + + (x-k)*light->_SpotExpTable[k][1]); attenuation *= spot; } } } - if (attenuation < 1e-3) continue; /* this light makes no contribution */ @@ -405,7 +404,7 @@ static void TAG(light_rgba)( GLcontext *ctx, SUB_3V(VP, light->_Position, vertex); - d = LEN_3FV( VP ); + d = (GLfloat) LEN_3FV( VP ); if ( d > 1e-6) { GLfloat invd = 1.0F / d; @@ -424,20 +423,18 @@ static void TAG(light_rgba)( GLcontext *ctx, continue; /* this light makes no contribution */ } else { - double x = PV_dot_dir * (EXP_TABLE_SIZE-1); - int k = (int) x; - GLfloat spot = (light->_SpotExpTable[k][0] + GLdouble x = PV_dot_dir * (EXP_TABLE_SIZE-1); + GLint k = (GLint) x; + GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] + (x-k)*light->_SpotExpTable[k][1]); attenuation *= spot; } } } - if (attenuation < 1e-3) continue; /* this light makes no contribution */ - /* Compute dot product or normal and vector from V to light pos */ n_dot_VP = DOT3( normal, VP ); @@ -880,7 +877,7 @@ static void TAG(light_ci)( GLcontext *ctx, SUB_3V(VP, light->_Position, vertex); - d = LEN_3FV( VP ); + d = (GLfloat) LEN_3FV( VP ); if ( d > 1e-6) { GLfloat invd = 1.0F / d; SELF_SCALE_SCALAR_3V(VP, invd); @@ -897,9 +894,9 @@ static void TAG(light_ci)( GLcontext *ctx, continue; /* this light makes no contribution */ } else { - double x = PV_dot_dir * (EXP_TABLE_SIZE-1); - int k = (int) x; - GLfloat spot = (light->_SpotExpTable[k][0] + GLdouble x = PV_dot_dir * (EXP_TABLE_SIZE-1); + GLint k = (GLint) x; + GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] + (x-k)*light->_SpotExpTable[k][1]); attenuation *= spot; } |