diff options
-rw-r--r-- | src/mesa/main/dlist.c | 131 | ||||
-rw-r--r-- | src/mesa/main/eval.c | 73 | ||||
-rw-r--r-- | src/mesa/main/get.c | 16 | ||||
-rw-r--r-- | src/mesa/main/light.c | 12 | ||||
-rw-r--r-- | src/mesa/main/matrix.c | 28 | ||||
-rw-r--r-- | src/mesa/main/pixel.c | 34 |
6 files changed, 152 insertions, 142 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index e942676dcaf..fe5241587df 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,4 +1,4 @@ -/* $Id: dlist.c,v 1.75 2001/06/18 17:26:08 brianp Exp $ */ +/* $Id: dlist.c,v 1.76 2001/09/18 16:16:21 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -999,10 +999,10 @@ static void save_ClipPlane( GLenum plane, const GLdouble *equ ) n = ALLOC_INSTRUCTION( ctx, OPCODE_CLIP_PLANE, 5 ); if (n) { n[1].e = plane; - n[2].f = equ[0]; - n[3].f = equ[1]; - n[4].f = equ[2]; - n[5].f = equ[3]; + n[2].f = (GLfloat) equ[0]; + n[3].f = (GLfloat) equ[1]; + n[4].f = (GLfloat) equ[2]; + n[5].f = (GLfloat) equ[3]; } if (ctx->ExecuteFlag) { (*ctx->Exec->ClipPlane)( plane, equ ); @@ -1770,12 +1770,12 @@ static void save_Frustum( GLdouble left, GLdouble right, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); n = ALLOC_INSTRUCTION( ctx, OPCODE_FRUSTUM, 6 ); if (n) { - n[1].f = left; - n[2].f = right; - n[3].f = bottom; - n[4].f = top; - n[5].f = nearval; - n[6].f = farval; + n[1].f = (GLfloat) left; + n[2].f = (GLfloat) right; + n[3].f = (GLfloat) bottom; + n[4].f = (GLfloat) top; + n[5].f = (GLfloat) nearval; + n[6].f = (GLfloat) farval; } if (ctx->ExecuteFlag) { (*ctx->Exec->Frustum)( left, right, bottom, top, nearval, farval ); @@ -2083,7 +2083,7 @@ static void save_LoadMatrixd( const GLdouble *m ) GLfloat f[16]; GLint i; for (i = 0; i < 16; i++) { - f[i] = m[i]; + f[i] = (GLfloat) m[i]; } save_LoadMatrixf(f); } @@ -2129,8 +2129,8 @@ static void save_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, if (n) { GLfloat *pnts = _mesa_copy_map_points1d( target, stride, order, points ); n[1].e = target; - n[2].f = u1; - n[3].f = u2; + n[2].f = (GLfloat) u1; + n[3].f = (GLfloat) u2; n[4].i = _mesa_evaluator_components(target); /* stride */ n[5].i = order; n[6].data = (void *) pnts; @@ -2175,10 +2175,10 @@ static void save_Map2d( GLenum target, GLfloat *pnts = _mesa_copy_map_points2d( target, ustride, uorder, vstride, vorder, points ); n[1].e = target; - n[2].f = u1; - n[3].f = u2; - n[4].f = v1; - n[5].f = v2; + n[2].f = (GLfloat) u1; + n[3].f = (GLfloat) u2; + n[4].f = (GLfloat) v1; + n[5].f = (GLfloat) v2; /* XXX verify these strides are correct */ n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride*/ n[7].i = _mesa_evaluator_components(target); /*vstride*/ @@ -2244,7 +2244,7 @@ static void save_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) static void save_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { - save_MapGrid1f(un, u1, u2); + save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2); } @@ -2273,7 +2273,8 @@ static void save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, static void save_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { - save_MapGrid2f(un, u1, u2, vn, v1, v2); + save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2, + vn, (GLfloat) v1, (GLfloat) v2); } @@ -2334,7 +2335,7 @@ static void save_MultMatrixd( const GLdouble *m ) GLfloat f[16]; GLint i; for (i = 0; i < 16; i++) { - f[i] = m[i]; + f[i] = (GLfloat) m[i]; } save_MultMatrixf(f); } @@ -2360,12 +2361,12 @@ static void save_Ortho( GLdouble left, GLdouble right, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); n = ALLOC_INSTRUCTION( ctx, OPCODE_ORTHO, 6 ); if (n) { - n[1].f = left; - n[2].f = right; - n[3].f = bottom; - n[4].f = top; - n[5].f = nearval; - n[6].f = farval; + n[1].f = (GLfloat) left; + n[2].f = (GLfloat) right; + n[3].f = (GLfloat) bottom; + n[4].f = (GLfloat) top; + n[5].f = (GLfloat) nearval; + n[6].f = (GLfloat) farval; } if (ctx->ExecuteFlag) { (*ctx->Exec->Ortho)( left, right, bottom, top, nearval, farval ); @@ -2688,7 +2689,7 @@ static void save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) static void save_RasterPos2d(GLdouble x, GLdouble y) { - save_RasterPos4f(x, y, 0.0F, 1.0F); + save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } static void save_RasterPos2f(GLfloat x, GLfloat y) @@ -2698,7 +2699,7 @@ static void save_RasterPos2f(GLfloat x, GLfloat y) static void save_RasterPos2i(GLint x, GLint y) { - save_RasterPos4f(x, y, 0.0F, 1.0F); + save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } static void save_RasterPos2s(GLshort x, GLshort y) @@ -2708,7 +2709,7 @@ static void save_RasterPos2s(GLshort x, GLshort y) static void save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { - save_RasterPos4f(x, y, z, 1.0F); + save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } static void save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) @@ -2718,7 +2719,7 @@ static void save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) static void save_RasterPos3i(GLint x, GLint y, GLint z) { - save_RasterPos4f(x, y, z, 1.0F); + save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } static void save_RasterPos3s(GLshort x, GLshort y, GLshort z) @@ -2728,12 +2729,12 @@ static void save_RasterPos3s(GLshort x, GLshort y, GLshort z) static void save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - save_RasterPos4f(x, y, z, w); + save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } static void save_RasterPos4i(GLint x, GLint y, GLint z, GLint w) { - save_RasterPos4f(x, y, z, w); + save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } static void save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) @@ -2743,7 +2744,7 @@ static void save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) static void save_RasterPos2dv(const GLdouble *v) { - save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); + save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } static void save_RasterPos2fv(const GLfloat *v) @@ -2753,7 +2754,7 @@ static void save_RasterPos2fv(const GLfloat *v) static void save_RasterPos2iv(const GLint *v) { - save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); + save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } static void save_RasterPos2sv(const GLshort *v) @@ -2763,7 +2764,7 @@ static void save_RasterPos2sv(const GLshort *v) static void save_RasterPos3dv(const GLdouble *v) { - save_RasterPos4f(v[0], v[1], v[2], 1.0F); + save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } static void save_RasterPos3fv(const GLfloat *v) @@ -2773,7 +2774,7 @@ static void save_RasterPos3fv(const GLfloat *v) static void save_RasterPos3iv(const GLint *v) { - save_RasterPos4f(v[0], v[1], v[2], 1.0F); + save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } static void save_RasterPos3sv(const GLshort *v) @@ -2783,7 +2784,8 @@ static void save_RasterPos3sv(const GLshort *v) static void save_RasterPos4dv(const GLdouble *v) { - save_RasterPos4f(v[0], v[1], v[2], v[3]); + save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } static void save_RasterPos4fv(const GLfloat *v) @@ -2793,7 +2795,8 @@ static void save_RasterPos4fv(const GLfloat *v) static void save_RasterPos4iv(const GLint *v) { - save_RasterPos4f(v[0], v[1], v[2], v[3]); + save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } static void save_RasterPos4sv(const GLshort *v) @@ -2884,7 +2887,7 @@ static void save_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) static void save_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) { - save_Rotatef(angle, x, y, z); + save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z); } @@ -2907,7 +2910,7 @@ static void save_Scalef( GLfloat x, GLfloat y, GLfloat z ) static void save_Scaled( GLdouble x, GLdouble y, GLdouble z ) { - save_Scalef(x, y, z); + save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z); } @@ -3062,10 +3065,10 @@ static void save_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) static void save_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) { GLfloat p[4]; - p[0] = params[0]; - p[1] = params[1]; - p[2] = params[2]; - p[3] = params[3]; + p[0] = (GLfloat) params[0]; + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; save_TexGenfv(coord, pname, p); } @@ -3080,10 +3083,10 @@ static void save_TexGend(GLenum coord, GLenum pname, GLdouble param ) static void save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) { GLfloat p[4]; - p[0] = params[0]; - p[1] = params[1]; - p[2] = params[2]; - p[3] = params[3]; + p[0] = (GLfloat) params[0]; + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; save_TexGenfv( coord, pname, p ); } @@ -3383,7 +3386,7 @@ static void save_Translatef( GLfloat x, GLfloat y, GLfloat z ) static void save_Translated( GLdouble x, GLdouble y, GLdouble z ) { - save_Translatef(x, y, z); + save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z); } @@ -3426,7 +3429,7 @@ static void save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) static void save_WindowPos2dMESA(GLdouble x, GLdouble y) { - save_WindowPos4fMESA(x, y, 0.0F, 1.0F); + save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } static void save_WindowPos2fMESA(GLfloat x, GLfloat y) @@ -3436,7 +3439,7 @@ static void save_WindowPos2fMESA(GLfloat x, GLfloat y) static void save_WindowPos2iMESA(GLint x, GLint y) { - save_WindowPos4fMESA(x, y, 0.0F, 1.0F); + save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } static void save_WindowPos2sMESA(GLshort x, GLshort y) @@ -3446,7 +3449,7 @@ static void save_WindowPos2sMESA(GLshort x, GLshort y) static void save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) { - save_WindowPos4fMESA(x, y, z, 1.0F); + save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } static void save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) @@ -3456,7 +3459,7 @@ static void save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) static void save_WindowPos3iMESA(GLint x, GLint y, GLint z) { - save_WindowPos4fMESA(x, y, z, 1.0F); + save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } static void save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) @@ -3466,12 +3469,12 @@ static void save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) static void save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - save_WindowPos4fMESA(x, y, z, w); + save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } static void save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) { - save_WindowPos4fMESA(x, y, z, w); + save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } static void save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) @@ -3481,7 +3484,7 @@ static void save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) static void save_WindowPos2dvMESA(const GLdouble *v) { - save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); + save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } static void save_WindowPos2fvMESA(const GLfloat *v) @@ -3491,7 +3494,7 @@ static void save_WindowPos2fvMESA(const GLfloat *v) static void save_WindowPos2ivMESA(const GLint *v) { - save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F); + save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } static void save_WindowPos2svMESA(const GLshort *v) @@ -3501,7 +3504,7 @@ static void save_WindowPos2svMESA(const GLshort *v) static void save_WindowPos3dvMESA(const GLdouble *v) { - save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); + save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } static void save_WindowPos3fvMESA(const GLfloat *v) @@ -3511,7 +3514,7 @@ static void save_WindowPos3fvMESA(const GLfloat *v) static void save_WindowPos3ivMESA(const GLint *v) { - save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F); + save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } static void save_WindowPos3svMESA(const GLshort *v) @@ -3521,7 +3524,8 @@ static void save_WindowPos3svMESA(const GLshort *v) static void save_WindowPos4dvMESA(const GLdouble *v) { - save_WindowPos4fMESA(v[0], v[1], v[2], v[3]); + save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } static void save_WindowPos4fvMESA(const GLfloat *v) @@ -3531,7 +3535,8 @@ static void save_WindowPos4fvMESA(const GLfloat *v) static void save_WindowPos4ivMESA(const GLint *v) { - save_WindowPos4fMESA(v[0], v[1], v[2], v[3]); + save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3]); } static void save_WindowPos4svMESA(const GLshort *v) @@ -4055,7 +4060,7 @@ execute_list( GLcontext *ctx, GLuint list ) (*ctx->Exec->ClearDepth)( (GLclampd) n[1].f ); break; case OPCODE_CLEAR_INDEX: - (*ctx->Exec->ClearIndex)( n[1].ui ); + (*ctx->Exec->ClearIndex)( (GLfloat) n[1].ui ); break; case OPCODE_CLEAR_STENCIL: (*ctx->Exec->ClearStencil)( n[1].i ); diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index b1b2823a137..732aec6720f 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -1,4 +1,4 @@ -/* $Id: eval.c,v 1.20 2001/05/16 17:06:28 brianp Exp $ */ +/* $Id: eval.c,v 1.21 2001/09/18 16:16:21 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -329,7 +329,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, map->Order = uorder; map->u1 = u1; map->u2 = u2; - map->du = 1.0 / (u2 - u1); + map->du = 1.0F / (u2 - u1); if (map->Points) FREE( map->Points ); map->Points = pnts; @@ -349,7 +349,7 @@ void _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ) { - map1(target, u1, u2, stride, order, points, GL_DOUBLE); + map1(target, (GLfloat) u1, (GLfloat) u2, stride, order, points, GL_DOUBLE); } @@ -450,11 +450,11 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, map->Uorder = uorder; map->u1 = u1; map->u2 = u2; - map->du = 1.0 / (u2 - u1); + map->du = 1.0F / (u2 - u1); map->Vorder = vorder; map->v1 = v1; map->v2 = v2; - map->dv = 1.0 / (v2 - v1); + map->dv = 1.0F / (v2 - v1); if (map->Points) FREE( map->Points ); map->Points = pnts; @@ -478,8 +478,8 @@ _mesa_Map2d( GLenum target, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points ) { - map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, - points, GL_DOUBLE); + map2(target, (GLfloat) u1, (GLfloat) u2, ustride, uorder, + (GLfloat) v1, (GLfloat) v2, vstride, vorder, points, GL_DOUBLE); } @@ -863,67 +863,67 @@ _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) case GL_ORDER: switch (target) { case GL_MAP1_COLOR_4: - *v = ctx->EvalMap.Map1Color4.Order; + *v = (GLfloat) ctx->EvalMap.Map1Color4.Order; break; case GL_MAP1_INDEX: - *v = ctx->EvalMap.Map1Index.Order; + *v = (GLfloat) ctx->EvalMap.Map1Index.Order; break; case GL_MAP1_NORMAL: - *v = ctx->EvalMap.Map1Normal.Order; + *v = (GLfloat) ctx->EvalMap.Map1Normal.Order; break; case GL_MAP1_TEXTURE_COORD_1: - *v = ctx->EvalMap.Map1Texture1.Order; + *v = (GLfloat) ctx->EvalMap.Map1Texture1.Order; break; case GL_MAP1_TEXTURE_COORD_2: - *v = ctx->EvalMap.Map1Texture2.Order; + *v = (GLfloat) ctx->EvalMap.Map1Texture2.Order; break; case GL_MAP1_TEXTURE_COORD_3: - *v = ctx->EvalMap.Map1Texture3.Order; + *v = (GLfloat) ctx->EvalMap.Map1Texture3.Order; break; case GL_MAP1_TEXTURE_COORD_4: - *v = ctx->EvalMap.Map1Texture4.Order; + *v = (GLfloat) ctx->EvalMap.Map1Texture4.Order; break; case GL_MAP1_VERTEX_3: - *v = ctx->EvalMap.Map1Vertex3.Order; + *v = (GLfloat) ctx->EvalMap.Map1Vertex3.Order; break; case GL_MAP1_VERTEX_4: - *v = ctx->EvalMap.Map1Vertex4.Order; + *v = (GLfloat) ctx->EvalMap.Map1Vertex4.Order; break; case GL_MAP2_COLOR_4: - v[0] = ctx->EvalMap.Map2Color4.Uorder; - v[1] = ctx->EvalMap.Map2Color4.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Color4.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Color4.Vorder; break; case GL_MAP2_INDEX: - v[0] = ctx->EvalMap.Map2Index.Uorder; - v[1] = ctx->EvalMap.Map2Index.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Index.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Index.Vorder; break; case GL_MAP2_NORMAL: - v[0] = ctx->EvalMap.Map2Normal.Uorder; - v[1] = ctx->EvalMap.Map2Normal.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Normal.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Normal.Vorder; break; case GL_MAP2_TEXTURE_COORD_1: - v[0] = ctx->EvalMap.Map2Texture1.Uorder; - v[1] = ctx->EvalMap.Map2Texture1.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Texture1.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Texture1.Vorder; break; case GL_MAP2_TEXTURE_COORD_2: - v[0] = ctx->EvalMap.Map2Texture2.Uorder; - v[1] = ctx->EvalMap.Map2Texture2.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Texture2.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Texture2.Vorder; break; case GL_MAP2_TEXTURE_COORD_3: - v[0] = ctx->EvalMap.Map2Texture3.Uorder; - v[1] = ctx->EvalMap.Map2Texture3.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Texture3.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Texture3.Vorder; break; case GL_MAP2_TEXTURE_COORD_4: - v[0] = ctx->EvalMap.Map2Texture4.Uorder; - v[1] = ctx->EvalMap.Map2Texture4.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Texture4.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Texture4.Vorder; break; case GL_MAP2_VERTEX_3: - v[0] = ctx->EvalMap.Map2Vertex3.Uorder; - v[1] = ctx->EvalMap.Map2Vertex3.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Vertex3.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Vertex3.Vorder; break; case GL_MAP2_VERTEX_4: - v[0] = ctx->EvalMap.Map2Vertex4.Uorder; - v[1] = ctx->EvalMap.Map2Vertex4.Vorder; + v[0] = (GLfloat) ctx->EvalMap.Map2Vertex4.Uorder; + v[1] = (GLfloat) ctx->EvalMap.Map2Vertex4.Vorder; break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(target)" ); @@ -1328,7 +1328,7 @@ _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) void _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { - _mesa_MapGrid1f( un, u1, u2 ); + _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 ); } @@ -1364,5 +1364,6 @@ void _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { - _mesa_MapGrid2f( un, u1, u2, vn, v1, v2 ); + _mesa_MapGrid2f( un, (GLfloat) u1, (GLfloat) u2, + vn, (GLfloat) v1, (GLfloat) v2 ); } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 8199ce2b972..f466107fdc4 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,4 +1,4 @@ -/* $Id: get.c,v 1.67 2001/08/28 22:46:22 brianp Exp $ */ +/* $Id: get.c,v 1.68 2001/09/18 16:16:21 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -3398,13 +3398,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Const.SubPixelBits; break; case GL_TEXTURE_1D: - *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0F : 0.0F; break; case GL_TEXTURE_2D: - *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0F : 0.0F; break; case GL_TEXTURE_3D: - *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0F : 0.0F; break; case GL_TEXTURE_BINDING_1D: *params = (GLfloat) textureUnit->Current1D->Name; @@ -3425,16 +3425,16 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = ENUM_TO_FLOAT(textureUnit->EnvMode); break; case GL_TEXTURE_GEN_S: - *params = (textureUnit->TexGenEnabled & S_BIT) ? 1.0 : 0.0; + *params = (textureUnit->TexGenEnabled & S_BIT) ? 1.0F : 0.0F; break; case GL_TEXTURE_GEN_T: - *params = (textureUnit->TexGenEnabled & T_BIT) ? 1.0 : 0.0; + *params = (textureUnit->TexGenEnabled & T_BIT) ? 1.0F : 0.0F; break; case GL_TEXTURE_GEN_R: - *params = (textureUnit->TexGenEnabled & R_BIT) ? 1.0 : 0.0; + *params = (textureUnit->TexGenEnabled & R_BIT) ? 1.0F : 0.0F; break; case GL_TEXTURE_GEN_Q: - *params = (textureUnit->TexGenEnabled & Q_BIT) ? 1.0 : 0.0; + *params = (textureUnit->TexGenEnabled & Q_BIT) ? 1.0F : 0.0F; break; case GL_TEXTURE_MATRIX: for (i=0;i<16;i++) { diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 8f4c607af5a..8bd545035c3 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,4 +1,4 @@ -/* $Id: light.c,v 1.45 2001/07/28 19:28:49 keithw Exp $ */ +/* $Id: light.c,v 1.46 2001/09/18 16:16:21 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -161,7 +161,7 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) return; FLUSH_VERTICES(ctx, _NEW_LIGHT); l->SpotCutoff = params[0]; - l->_CosCutoff = cos(params[0]*DEG2RAD); + l->_CosCutoff = (GLfloat) cos(params[0]*DEG2RAD); if (l->_CosCutoff < 0) l->_CosCutoff = 0; if (l->SpotCutoff != 180.0F) @@ -1058,7 +1058,7 @@ static void validate_spot_exp_table( struct gl_light *l ) clamp = 1; } } - l->_SpotExpTable[i][0] = tmp; + l->_SpotExpTable[i][0] = (GLfloat) tmp; } for (i = 0; i < EXP_TABLE_SIZE - 1; i++) { l->_SpotExpTable[i][1] = (l->_SpotExpTable[i+1][0] - @@ -1112,7 +1112,7 @@ static void validate_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess ) x = 0.005; t = pow(x, shininess); if (t > 1e-20) - m[j] = t; + m[j] = (GLfloat) t; else m[j] = 0.0; } @@ -1225,7 +1225,7 @@ _mesa_update_lighting( GLcontext *ctx ) } } else { - static const GLfloat ci[3] = { .30, .59, .11 }; + 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); @@ -1300,7 +1300,7 @@ _mesa_compute_light_positions( GLcontext *ctx ) double x = PV_dot_dir * (EXP_TABLE_SIZE-1); int k = (int) x; light->_VP_inf_spot_attenuation = - (light->_SpotExpTable[k][0] + + (GLfloat) (light->_SpotExpTable[k][0] + (x-k)*light->_SpotExpTable[k][1]); } else { diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index cb786607df0..4b510fefcd1 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1,4 +1,4 @@ -/* $Id: matrix.c,v 1.35 2001/06/12 22:08:41 brianp Exp $ */ +/* $Id: matrix.c,v 1.36 2001/09/18 16:16:21 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -104,7 +104,9 @@ _mesa_Frustum( GLdouble left, GLdouble right, return; } - _math_matrix_frustum( mat, left, right, bottom, top, nearval, farval ); + _math_matrix_frustum( mat, (GLfloat) left, (GLfloat) right, + (GLfloat) bottom, (GLfloat) top, + (GLfloat) nearval, (GLfloat) farval ); } @@ -127,7 +129,9 @@ _mesa_Ortho( GLdouble left, GLdouble right, return; } - _math_matrix_ortho( mat, left, right, bottom, top, nearval, farval ); + _math_matrix_ortho( mat, (GLfloat) left, (GLfloat) right, + (GLfloat) bottom, (GLfloat) top, + (GLfloat) nearval, (GLfloat) farval ); } @@ -293,7 +297,7 @@ _mesa_LoadMatrixd( const GLdouble *m ) GLint i; GLfloat f[16]; for (i = 0; i < 16; i++) - f[i] = m[i]; + f[i] = (GLfloat) m[i]; _mesa_LoadMatrixf(f); } @@ -322,7 +326,7 @@ _mesa_MultMatrixd( const GLdouble *m ) GLint i; GLfloat f[16]; for (i = 0; i < 16; i++) - f[i] = m[i]; + f[i] = (GLfloat) m[i]; _mesa_MultMatrixf( f ); } @@ -347,7 +351,7 @@ _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) void _mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) { - _mesa_Rotatef(angle, x, y, z); + _mesa_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z); } @@ -368,7 +372,7 @@ _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ) void _mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ) { - _mesa_Scalef(x, y, z); + _mesa_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z); } @@ -389,7 +393,7 @@ _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) void _mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) { - _mesa_Translatef(x, y, z); + _mesa_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z); } @@ -477,8 +481,8 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, ctx->Viewport._WindowMap.m[MAT_TX] = ctx->Viewport._WindowMap.m[MAT_SX] + x; ctx->Viewport._WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F; ctx->Viewport._WindowMap.m[MAT_TY] = ctx->Viewport._WindowMap.m[MAT_SY] + y; - ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0); - ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0 + n); + ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0F); + ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0F + n); ctx->Viewport._WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION; ctx->Viewport._WindowMap.type = MATRIX_3D_NO_ROT; ctx->NewState |= _NEW_VIEWPORT; @@ -521,8 +525,8 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval ) ctx->Viewport.Near = n; ctx->Viewport.Far = f; - ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0); - ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0 + n); + ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0F); + ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0F + n); ctx->NewState |= _NEW_VIEWPORT; if (ctx->Driver.DepthRange) { diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index e0acfd5b93a..b94dbf0e1a3 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,4 +1,4 @@ -/* $Id: pixel.c,v 1.30 2001/07/13 20:07:37 brianp Exp $ */ +/* $Id: pixel.c,v 1.31 2001/09/18 16:16:21 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -290,7 +290,7 @@ _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) case GL_PIXEL_MAP_I_TO_R: ctx->Pixel.MapItoRsize = mapsize; for (i=0;i<mapsize;i++) { - GLfloat val = CLAMP( values[i], 0.0, 1.0 ); + GLfloat val = CLAMP( values[i], 0.0F, 1.0F ); ctx->Pixel.MapItoR[i] = val; ctx->Pixel.MapItoR8[i] = (GLint) (val * 255.0F); } @@ -298,7 +298,7 @@ _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) case GL_PIXEL_MAP_I_TO_G: ctx->Pixel.MapItoGsize = mapsize; for (i=0;i<mapsize;i++) { - GLfloat val = CLAMP( values[i], 0.0, 1.0 ); + GLfloat val = CLAMP( values[i], 0.0F, 1.0F ); ctx->Pixel.MapItoG[i] = val; ctx->Pixel.MapItoG8[i] = (GLint) (val * 255.0F); } @@ -306,7 +306,7 @@ _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) case GL_PIXEL_MAP_I_TO_B: ctx->Pixel.MapItoBsize = mapsize; for (i=0;i<mapsize;i++) { - GLfloat val = CLAMP( values[i], 0.0, 1.0 ); + GLfloat val = CLAMP( values[i], 0.0F, 1.0F ); ctx->Pixel.MapItoB[i] = val; ctx->Pixel.MapItoB8[i] = (GLint) (val * 255.0F); } @@ -314,7 +314,7 @@ _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) case GL_PIXEL_MAP_I_TO_A: ctx->Pixel.MapItoAsize = mapsize; for (i=0;i<mapsize;i++) { - GLfloat val = CLAMP( values[i], 0.0, 1.0 ); + GLfloat val = CLAMP( values[i], 0.0F, 1.0F ); ctx->Pixel.MapItoA[i] = val; ctx->Pixel.MapItoA8[i] = (GLint) (val * 255.0F); } @@ -322,25 +322,25 @@ _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) case GL_PIXEL_MAP_R_TO_R: ctx->Pixel.MapRtoRsize = mapsize; for (i=0;i<mapsize;i++) { - ctx->Pixel.MapRtoR[i] = CLAMP( values[i], 0.0, 1.0 ); + ctx->Pixel.MapRtoR[i] = CLAMP( values[i], 0.0F, 1.0F ); } break; case GL_PIXEL_MAP_G_TO_G: ctx->Pixel.MapGtoGsize = mapsize; for (i=0;i<mapsize;i++) { - ctx->Pixel.MapGtoG[i] = CLAMP( values[i], 0.0, 1.0 ); + ctx->Pixel.MapGtoG[i] = CLAMP( values[i], 0.0F, 1.0F ); } break; case GL_PIXEL_MAP_B_TO_B: ctx->Pixel.MapBtoBsize = mapsize; for (i=0;i<mapsize;i++) { - ctx->Pixel.MapBtoB[i] = CLAMP( values[i], 0.0, 1.0 ); + ctx->Pixel.MapBtoB[i] = CLAMP( values[i], 0.0F, 1.0F ); } break; case GL_PIXEL_MAP_A_TO_A: ctx->Pixel.MapAtoAsize = mapsize; for (i=0;i<mapsize;i++) { - ctx->Pixel.MapAtoA[i] = CLAMP( values[i], 0.0, 1.0 ); + ctx->Pixel.MapAtoA[i] = CLAMP( values[i], 0.0F, 1.0F ); } break; default: @@ -822,10 +822,10 @@ _mesa_scale_and_bias_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4], void _mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] ) { - const GLfloat rscale = ctx->Pixel.MapRtoRsize - 1; - const GLfloat gscale = ctx->Pixel.MapGtoGsize - 1; - const GLfloat bscale = ctx->Pixel.MapBtoBsize - 1; - const GLfloat ascale = ctx->Pixel.MapAtoAsize - 1; + const GLfloat rscale = (GLfloat) (ctx->Pixel.MapRtoRsize - 1); + const GLfloat gscale = (GLfloat) (ctx->Pixel.MapGtoGsize - 1); + const GLfloat bscale = (GLfloat) (ctx->Pixel.MapBtoBsize - 1); + const GLfloat ascale = (GLfloat) (ctx->Pixel.MapAtoAsize - 1); const GLfloat *rMap = ctx->Pixel.MapRtoR; const GLfloat *gMap = ctx->Pixel.MapGtoG; const GLfloat *bMap = ctx->Pixel.MapBtoB; @@ -1297,15 +1297,15 @@ _mesa_chan_to_float_span(const GLcontext *ctx, GLuint n, const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits; const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits; GLuint aShift; - const GLfloat rScale = 1.0 / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); - const GLfloat gScale = 1.0 / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); - const GLfloat bScale = 1.0 / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); + const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); + const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); + const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); GLfloat aScale; GLuint i; if (ctx->Visual.alphaBits > 0) { aShift = CHAN_BITS - ctx->Visual.alphaBits; - aScale = 1.0 / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1); + aScale = 1.0F / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1); } else { aShift = 0; |