-/* $Id: t_context.h,v 1.31 2001/08/01 05:10:42 keithw Exp $ */
+/* $Id: t_context.h,v 1.32 2001/09/14 21:30:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* Flags for IM->TexCoordSize. Enough flags for 16 units.
*/
-#define TEX_0_SIZE_3 0x1
-#define TEX_0_SIZE_4 0x1001
+#define TEX_0_SIZE_3 (GLuint) 0x1
+#define TEX_0_SIZE_4 (GLuint) 0x1001
#define TEX_SIZE_3(unit) (TEX_0_SIZE_3<<unit)
#define TEX_SIZE_4(unit) (TEX_0_SIZE_4<<unit)
-/* $Id: t_imm_dlist.c,v 1.28 2001/08/02 22:39:51 keithw Exp $ */
+/* $Id: t_imm_dlist.c,v 1.29 2001/09/14 21:30:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
dest += IM->Start;
len = (GLfloat) LEN_3FV( data[0] );
- if (len > 0.0) len = 1.0/len;
+ if (len > 0.0F) len = 1.0F / len;
for (i = 0 ; i < count ; ) {
dest[i] = len;
if (flags[++i] & VERT_NORM) {
len = (GLfloat) LEN_3FV( data[i] );
- if (len > 0.0) len = 1.0/len;
+ if (len > 0.0F) len = 1.0F / len;
}
}
}
static void fixup_normal_lengths( struct immediate *IM )
{
GLuint i;
- GLfloat len = 1.0; /* just to silence warnings */
+ GLfloat len = 1.0F; /* just to silence warnings */
GLfloat (*data)[3] = IM->Normal;
GLfloat *dest = IM->NormalLengthPtr;
GLuint *flags = IM->Flag;
for (i = IM->CopyStart ; i <= IM->Start ; i++) {
len = (GLfloat) LEN_3FV( data[i] );
- if (len > 0.0) len = 1.0/len;
+ if (len > 0.0F) len = 1.0F / len;
dest[i] = len;
}
vertex( IM->Obj[i] );
}
else if (flags[i] & VERT_EVAL_C1)
- glEvalCoord1f(IM->Obj[i][0]);
+ glEvalCoord1f( IM->Obj[i][0] );
else if (flags[i] & VERT_EVAL_P1)
- glEvalPoint1(IM->Obj[i][0]);
+ glEvalPoint1( (GLint) IM->Obj[i][0] );
else if (flags[i] & VERT_EVAL_C2)
- glEvalCoord2f( IM->Obj[i][0], IM->Obj[i][1]);
+ glEvalCoord2f( IM->Obj[i][0], IM->Obj[i][1] );
else if (flags[i] & VERT_EVAL_P2)
- glEvalPoint2( IM->Obj[i][0], IM->Obj[i][1]);
+ glEvalPoint2( (GLint) IM->Obj[i][0], (GLint) IM->Obj[i][1] );
}
if (prim & PRIM_END) {
-/* $Id: t_imm_elt.c,v 1.11 2001/05/11 08:11:31 keithw Exp $ */
+/* $Id: t_imm_elt.c,v 1.12 2001/09/14 21:30:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
#define SRC GLdouble
#define SRC_IDX TYPE_IDX(GL_DOUBLE)
-#define TRX_3F(f,n) PTR_ELT(f,n)
-#define TRX_4F(f,n) PTR_ELT(f,n)
+#define TRX_3F(f,n) (GLfloat) PTR_ELT(f,n)
+#define TRX_4F(f,n) (GLfloat) PTR_ELT(f,n)
#define TRX_UB(ub,f,n) UNCLAMPED_FLOAT_TO_UBYTE(ub, PTR_ELT(f,n))
#define TRX_US(us,f,n) UNCLAMPED_FLOAT_TO_USHORT(us, PTR_ELT(f,n))
-#define TRX_UI(f,n) (GLuint) (GLint) PTR_ELT(f,n)
-#define TRX_1F(f,n) PTR_ELT(f,n)
+#define TRX_UI(f,n) (GLuint) (GLint) PTR_ELT(f,n)
+#define TRX_1F(f,n) (GLfloat) PTR_ELT(f,n)
#define SZ 4
-/* $Id: t_imm_eval.c,v 1.17 2001/08/14 00:59:08 keithw Exp $ */
+/* $Id: t_imm_eval.c,v 1.18 2001/09/14 21:30:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void copy_3f( GLfloat to[][3], GLfloat from[][3], GLuint count )
{
- int i;
+ GLuint i;
/* MEMCPY( to, from, (count) * sizeof(to[0])); */
for (i = 0 ; i < count ; i++) {
/* fprintf(stderr, "copy norm %d from %p: %f %f %f\n", i, */
-/* $Id: t_vb_fog.c,v 1.11 2001/05/15 20:52:51 brianp Exp $ */
+/* $Id: t_vb_fog.c,v 1.12 2001/09/14 21:30:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
#if 1
#define NEG_EXP( result, narg ) \
do { \
- float f = (narg * (1.0/FOG_INCR)); \
- int k = (int) f; \
+ GLfloat f = (GLfloat) (narg * (1.0/FOG_INCR)); \
+ GLint k = (GLint) f; \
if (k > FOG_EXP_TABLE_SIZE-2) \
- result = EXP_FOG_MAX; \
+ result = (GLfloat) EXP_FOG_MAX; \
else \
result = exp_table[k] + (f-k)*(exp_table[k+1]-exp_table[k]); \
} while (0)
static void init_static_data( void )
{
- float f = 0;
- int i = 0;
+ GLfloat f = 0.0F;
+ GLint i = 0;
for ( ; i < FOG_EXP_TABLE_SIZE ; i++, f += FOG_INCR) {
- exp_table[i] = exp(-f);
+ exp_table[i] = (GLfloat) exp(-f);
}
inited = 1;
}
-/* $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
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 */
SUB_3V(VP, light->_Position, vertex);
- d = LEN_3FV( VP );
+ d = (GLfloat) LEN_3FV( VP );
if ( d > 1e-6) {
GLfloat invd = 1.0F / d;
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 );
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);
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;
}