Fixed 'IRound' to 'IROUND' in mmath.h
[mesa.git] / src / mesa / drivers / glide / fxddtex.c
index dd2bf4456163e0f71dce69d7ef4d227396b6f560..7c101e823d9212fb2a5d7c7b7a0947a8ef9ee85e 100644 (file)
@@ -1,4 +1,3 @@
-/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
 
 /*
  * Mesa 3-D graphics library
@@ -100,7 +99,6 @@ static void fxTexInvalidate(GLcontext *ctx, struct gl_texture_object *tObj)
 
   ti->validated=GL_FALSE;
   fxMesa->new_state|=FX_NEW_TEXTURING;
-  ctx->Driver.RenderStart = fxSetupFXUnits;
 }
 
 static tfxTexInfo *fxAllocTexObjData(fxMesaContext fxMesa)
@@ -160,7 +158,6 @@ void fxDDTexBind(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj)
   ti->lastTimeUsed=fxMesa->texBindNumber;
 
   fxMesa->new_state|=FX_NEW_TEXTURING;
-  ctx->Driver.RenderStart = fxSetupFXUnits;
 }
 
 void fxDDTexEnv(GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *param)
@@ -185,7 +182,6 @@ void fxDDTexEnv(GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *para
    }
 
    fxMesa->new_state|=FX_NEW_TEXTURING;
-   ctx->Driver.RenderStart = fxSetupFXUnits;
 }
 
 void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj,
@@ -283,7 +279,6 @@ void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj,
       break;
     }
     fxMesa->new_state|=FX_NEW_TEXTURING;
-    ctx->Driver.RenderStart = fxSetupFXUnits;
     break;
 
   case GL_TEXTURE_WRAP_T:
@@ -298,7 +293,6 @@ void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj,
       break;
     }
     fxMesa->new_state|=FX_NEW_TEXTURING;
-    ctx->Driver.RenderStart = fxSetupFXUnits;
     break;
 
   case GL_TEXTURE_BORDER_COLOR:
@@ -339,8 +333,6 @@ void fxDDTexDel(GLcontext *ctx, struct gl_texture_object *tObj)
 
   FREE(ti);
   tObj->DriverData = NULL;
-
-  ctx->NewState |= NEW_TEXTURING;
 }
 
 
@@ -356,7 +348,7 @@ convertPalette(FxU32 data[256], const struct gl_color_table *table)
   FxU32 r, g, b, a;
   GLint i;
 
-  ASSERT(table->TableType == GL_UNSIGNED_BYTE);
+  ASSERT(!table->FloatTable);
 
   switch (table->Format) {
     case GL_INTENSITY:
@@ -437,7 +429,6 @@ void fxDDTexPalette(GLcontext *ctx, struct gl_texture_object *tObj)
     }
     convertPalette(fxMesa->glbPalette.data, &ctx->Texture.Palette);
     fxMesa->new_state |= FX_NEW_TEXTURING;
-    ctx->Driver.RenderStart = fxSetupFXUnits;
   }
 }
 
@@ -460,9 +451,9 @@ void fxDDTexUseGlbPalette(GLcontext *ctx, GLboolean state)
   else {
     fxMesa->haveGlobalPaletteTexture = 0;
 
-    if ((ctx->Texture.Unit[0].Current == ctx->Texture.Unit[0].CurrentD[2]) &&
-        (ctx->Texture.Unit[0].Current != NULL)) {
-      struct gl_texture_object *tObj = ctx->Texture.Unit[0].Current;
+    if ((ctx->Texture.Unit[0]._Current == ctx->Texture.Unit[0].Current2D) &&
+        (ctx->Texture.Unit[0]._Current != NULL)) {
+      struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current;
 
       if (!tObj->DriverData)
         tObj->DriverData = fxAllocTexObjData(fxMesa);
@@ -828,6 +819,23 @@ static GLboolean fxIsTexSupported(GLenum target, GLint internalFormat,
 /**** NEW TEXTURE IMAGE FUNCTIONS                                  ****/
 /**********************************************************************/
 
+
+static void PrintTexture(int w, int h, int c, const GLubyte *data)
+{
+  int i, j;
+  for (i = 0; i < h; i++) {
+    for (j = 0; j < w; j++) {
+      if (c==2)
+        printf("%02x %02x  ", data[0], data[1]);
+      else if (c==3)
+        printf("%02x %02x %02x  ", data[0], data[1], data[2]);
+      data += c;
+    }
+    printf("\n");
+  }
+}
+
+
 GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
                          GLenum format, GLenum type, const GLvoid *pixels,
                          const struct gl_pixelstore_attrib *packing,
@@ -964,6 +972,7 @@ GLboolean fxDDTexImage2D(GLcontext *ctx, GLenum target, GLint level,
       return GL_FALSE;
     }
     
+
     if (ti->validated && ti->isInTM) {
       /*printf("reloadmipmaplevels\n");*/
       fxTMReloadMipMapLevel(fxMesa, texObj, level);
@@ -1086,21 +1095,6 @@ GLboolean fxDDTexSubImage2D(GLcontext *ctx, GLenum target, GLint level,
 }
 
 
-static void PrintTexture(int w, int h, int c, const GLubyte *data)
-{
-  int i, j;
-  for (i = 0; i < h; i++) {
-    for (j = 0; j < w; j++) {
-      if (c==2)
-        printf("%02x %02x  ", data[0], data[1]);
-      else if (c==3)
-        printf("%02x %02x %02x  ", data[0], data[1], data[2]);
-      data += c;
-    }
-    printf("\n");
-  }
-}
-
 
 GLvoid *fxDDGetTexImage(GLcontext *ctx, GLenum target, GLint level,
                         const struct gl_texture_object *texObj,
@@ -1189,6 +1183,7 @@ GLvoid *fxDDGetTexImage(GLcontext *ctx, GLenum target, GLint level,
  * Need this to provide at least one external definition.
  */
 
+extern int gl_fx_dummy_function_ddtex(void);
 int gl_fx_dummy_function_ddtex(void)
 {
   return 0;