-/* $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
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 );
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 );
GLfloat f[16];
GLint i;
for (i = 0; i < 16; i++) {
- f[i] = m[i];
+ f[i] = (GLfloat) m[i];
}
save_LoadMatrixf(f);
}
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;
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*/
static void save_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
{
- save_MapGrid1f(un, u1, u2);
+ save_MapGrid1f(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);
}
GLfloat f[16];
GLint i;
for (i = 0; i < 16; i++) {
- f[i] = m[i];
+ f[i] = (GLfloat) m[i];
}
save_MultMatrixf(f);
}
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 );
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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);
}
static void save_Scaled( GLdouble x, GLdouble y, GLdouble z )
{
- save_Scalef(x, y, z);
+ save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
}
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);
}
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 );
}
static void save_Translated( GLdouble x, GLdouble y, GLdouble z )
{
- save_Translatef(x, y, z);
+ save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
}
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
(*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 );
-/* $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
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;
_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);
}
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;
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);
}
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)" );
void
_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 )
{
- _mesa_MapGrid1f( un, u1, u2 );
+ _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 );
}
_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 );
}
-/* $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
*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;
*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++) {
-/* $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
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)
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] -
x = 0.005;
t = pow(x, shininess);
if (t > 1e-20)
- m[j] = t;
+ m[j] = (GLfloat) t;
else
m[j] = 0.0;
}
}
}
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);
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 {
-/* $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
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 );
}
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 );
}
GLint i;
GLfloat f[16];
for (i = 0; i < 16; i++)
- f[i] = m[i];
+ f[i] = (GLfloat) m[i];
_mesa_LoadMatrixf(f);
}
GLint i;
GLfloat f[16];
for (i = 0; i < 16; i++)
- f[i] = m[i];
+ f[i] = (GLfloat) m[i];
_mesa_MultMatrixf( f );
}
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);
}
void
_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z )
{
- _mesa_Scalef(x, y, z);
+ _mesa_Scalef((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);
}
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;
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) {
-/* $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
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);
}
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);
}
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);
}
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);
}
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:
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;
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;