mesa: replace gl_texture_format with gl_format
[mesa.git] / src / mesa / drivers / dri / r128 / r128_texmem.c
index af510a38c95119fa479d214b7ff2c63426419d16..84f8563b89d08e3f280e694c90e36618f3aeeb90 100644 (file)
@@ -38,11 +38,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r128_tris.h"
 #include "r128_tex.h"
 
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/simple_list.h"
+#include "main/texformat.h"
+#include "main/imports.h"
 
 #define TEX_0  1
 #define TEX_1  2
@@ -95,7 +95,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
    if ( !image )
       return;
 
-   switch ( image->TexFormat->TexelBytes ) {
+   switch ( _mesa_get_format_bytes(image->TexFormat) ) {
    case 1: texelsPerDword = 4; break;
    case 2: texelsPerDword = 2; break;
    case 4: texelsPerDword = 1; break;
@@ -215,9 +215,11 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
 
       /* Copy the next chunck of the texture image into the blit buffer */
       {
+         const GLuint texelBytes =
+            _mesa_get_format_bytes(image->TexFormat);
          const GLubyte *src = (const GLubyte *) image->Data +
-            (y * image->Width + x) * image->TexFormat->TexelBytes;
-         const GLuint bytes = width * height * image->TexFormat->TexelBytes;
+            (y * image->Width + x) * texelBytes;            
+         const GLuint bytes = width * height * texelBytes;
          memcpy(dst, src, bytes);
       }