All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allows
[mesa.git] / src / mesa / drivers / dri / mga / mga_texstate.c
index e22a69e052c1bd8f4ac75f5cfd60b743092b0217..8c28254cbf43671d38046ab6e8115c5b23706508 100644 (file)
@@ -28,6 +28,7 @@
  */
 /* $XFree86:$ */
 
+#include <stdlib.h>
 #include "mm.h"
 #include "mgacontext.h"
 #include "mgatex.h"
@@ -65,7 +66,7 @@ mgaSetTexImages( mgaContextPtr mmesa,
                 const struct gl_texture_object * tObj )
 {
     mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
-    struct gl_texture_image *baseImage = tObj->Image[ tObj->BaseLevel ];
+    struct gl_texture_image *baseImage = tObj->Image[0][ tObj->BaseLevel ];
     GLint totalSize;
     GLint width, height;
     GLint i;
@@ -110,12 +111,12 @@ mgaSetTexImages( mgaContextPtr mmesa,
       log2Width = 0;
       log2Height = 0;
    } else {
-      log2Width  = tObj->Image[t->base.firstLevel]->WidthLog2;
-      log2Height = tObj->Image[t->base.firstLevel]->HeightLog2;
+      log2Width  = tObj->Image[0][t->base.firstLevel]->WidthLog2;
+      log2Height = tObj->Image[0][t->base.firstLevel]->HeightLog2;
    }
 
-   width = tObj->Image[t->base.firstLevel]->Width;
-   height = tObj->Image[t->base.firstLevel]->Height;
+   width = tObj->Image[0][t->base.firstLevel]->Width;
+   height = tObj->Image[0][t->base.firstLevel]->Height;
 
    numLevels = MIN2( t->base.lastLevel - t->base.firstLevel + 1,
                      MGA_IS_G200(mmesa) ? G200_TEX_MAXLEVELS : G400_TEX_MAXLEVELS);
@@ -124,7 +125,7 @@ mgaSetTexImages( mgaContextPtr mmesa,
    totalSize = 0;
    for ( i = 0 ; i < numLevels ; i++ ) {
       const struct gl_texture_image * const texImage = 
-         tObj->Image[ i + t->base.firstLevel ];
+         tObj->Image[0][ i + t->base.firstLevel ];
       int size;
 
       if (texImage == NULL)
@@ -204,7 +205,7 @@ static void mgaUpdateTextureEnvG200( GLcontext *ctx, GLuint unit )
    mgaContextPtr mmesa = MGA_CONTEXT(ctx);
    struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current;
    mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
-   GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+   GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
 
    if (tObj != ctx->Texture.Unit[0].Current2D &&
        tObj != ctx->Texture.Unit[0].CurrentRect)
@@ -536,7 +537,7 @@ static GLboolean mgaUpdateTextureEnvBlend( GLcontext *ctx, int unit )
    const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
    const struct gl_texture_object *tObj = texUnit->_Current;
    GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
-   GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+   GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
 
    *reg = 0;
 
@@ -633,7 +634,7 @@ static void mgaUpdateTextureEnvG400( GLcontext *ctx, GLuint unit )
    const struct gl_texture_object *tObj = texUnit->_Current;
    GLuint *reg = ((GLuint *)&mmesa->setup.tdualstage0 + unit);
    mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
-   GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+   GLenum format = tObj->Image[0][tObj->BaseLevel]->Format;
 
    if (tObj != ctx->Texture.Unit[source].Current2D &&
        tObj != ctx->Texture.Unit[source].CurrentRect)
@@ -780,7 +781,7 @@ static GLboolean update_tex_common( GLcontext *ctx, int unit )
    mgaTextureObjectPtr t = (mgaTextureObjectPtr) tObj->DriverData;
 
    /* Fallback if there's a texture border */
-   if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) {
+   if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
       return GL_FALSE;
    }