fix int/float conversion for GL_TEXTURE_PRIORITY in gl[Get]TexParameteri[v]
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 3 Jul 2003 15:08:25 +0000 (15:08 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 3 Jul 2003 15:08:25 +0000 (15:08 +0000)
src/mesa/main/texstate.c

index d96b73a2f5b81e6a7fc73125532ef4db918dc0de..f27c346ec2fcf540a51acc917eae7d931d9a29a4 100644 (file)
@@ -1413,7 +1413,10 @@ void
 _mesa_TexParameteri( GLenum target, GLenum pname, GLint param )
 {
    GLfloat fparam[4];
-   fparam[0] = (GLfloat) param;
+   if (pname == GL_TEXTURE_PRIORITY)
+      fparam[0] = INT_TO_FLOAT(param);
+   else
+      fparam[0] = (GLfloat) param;
    fparam[1] = fparam[2] = fparam[3] = 0.0;
    _mesa_TexParameterfv(target, pname, fparam);
 }
@@ -1430,7 +1433,10 @@ _mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params )
       fparam[3] = INT_TO_FLOAT(params[3]);
    }
    else {
-      fparam[0] = (GLfloat) params[0];
+      if (pname == GL_TEXTURE_PRIORITY)
+         fparam[0] = INT_TO_FLOAT(params[0]);
+      else
+         fparam[0] = (GLfloat) params[0];
       fparam[1] = fparam[2] = fparam[3] = 0.0F;
    }
    _mesa_TexParameterfv(target, pname, fparam);
@@ -1827,7 +1833,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
          }
          return;
       case GL_TEXTURE_PRIORITY:
-         *params = (GLint) obj->Priority;
+         *params = FLOAT_TO_INT(obj->Priority);
          return;
       case GL_TEXTURE_MIN_LOD:
          *params = (GLint) obj->MinLod;