summaryrefslogtreecommitdiff
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-01-09 02:14:29 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-01-09 02:14:29 +0000
commit0c5c1392abcd619f7f0a17c986b156d877738d40 (patch)
treef367b4fe8aec69d7c87fa0f75ad9f1caba36d4c5 /src/mesa/main/texstate.c
parenta701a1445c9c3ad3bda480c41377b90a9a48fad2 (diff)
fixed int->float conversion bug in _mesa_TexEnviv()
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 827a6bd894..a8c70f0a4c 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,10 +1,10 @@
-/* $Id: texstate.c,v 1.62 2001/12/18 04:06:45 brianp Exp $ */
+/* $Id: texstate.c,v 1.63 2002/01/09 02:14:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -469,10 +469,16 @@ void
_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param )
{
GLfloat p[4];
- p[0] = INT_TO_FLOAT( param[0] );
- p[1] = INT_TO_FLOAT( param[1] );
- p[2] = INT_TO_FLOAT( param[2] );
- p[3] = INT_TO_FLOAT( param[3] );
+ if (pname == GL_TEXTURE_ENV_COLOR) {
+ p[0] = INT_TO_FLOAT( param[0] );
+ p[1] = INT_TO_FLOAT( param[1] );
+ p[2] = INT_TO_FLOAT( param[2] );
+ p[3] = INT_TO_FLOAT( param[3] );
+ }
+ else {
+ p[0] = (GLint) param[0];
+ p[1] = p[2] = p[3] = 0; /* init to zero, just to be safe */
+ }
_mesa_TexEnvfv( target, pname, p );
}