summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/texutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/src/texutil.c')
-rw-r--r--xc/extras/Mesa/src/texutil.c50
1 files changed, 14 insertions, 36 deletions
diff --git a/xc/extras/Mesa/src/texutil.c b/xc/extras/Mesa/src/texutil.c
index 4143830c1..13f6c7a3a 100644
--- a/xc/extras/Mesa/src/texutil.c
+++ b/xc/extras/Mesa/src/texutil.c
@@ -39,7 +39,7 @@
#include "types.h"
#endif
-#define DBG 0
+#define DEBUG_TEXUTIL 0
struct gl_texture_convert {
@@ -63,20 +63,6 @@ typedef void (*unconvert_func)( struct gl_texture_convert *convert );
#define CONVERT_STRIDE_BIT 0x1
#define CONVERT_PACKING_BIT 0x2
-#ifdef __GNUC__
-#define ERROR_STRING __FUNCTION__
-#else
-#define ERROR_STRING __FILE__ ":" __LINE__
-#endif
-#define UNCONVERT_ERROR( format ) \
-do { \
- static char buffer[128]; \
- sprintf( buffer, "illegal format %s in " ERROR_STRING "\n", \
- gl_lookup_enum_by_nr( format ) ); \
- gl_problem( NULL, buffer ); \
-} while (0)
-
-
/* ================================================================
* RGBA8888 textures:
@@ -184,8 +170,7 @@ unconvert_teximage_rgba8888( struct gl_texture_convert *convert )
break;
}
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -274,8 +259,7 @@ unconvert_teximage_abgr8888( struct gl_texture_convert *convert )
break;
}
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -386,8 +370,7 @@ unconvert_teximage_argb8888( struct gl_texture_convert *convert )
break;
}
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -417,7 +400,7 @@ convert_texsubimage3d_rgb888( struct gl_texture_convert *convert )
static void
unconvert_teximage_rgb888( struct gl_texture_convert *convert )
{
- UNCONVERT_ERROR( convert->format );
+ gl_problem(NULL, "texture unconvert error");
}
@@ -446,7 +429,7 @@ convert_texsubimage3d_bgr888( struct gl_texture_convert *convert )
static void
unconvert_teximage_bgr888( struct gl_texture_convert *convert )
{
- UNCONVERT_ERROR( convert->format );
+ gl_problem(NULL, "texture unconvert error");
}
@@ -560,8 +543,7 @@ unconvert_teximage_rgb565( struct gl_texture_convert *convert )
}
break;
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -649,8 +631,7 @@ unconvert_teximage_argb4444( struct gl_texture_convert *convert )
}
break;
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -738,8 +719,7 @@ unconvert_teximage_argb1555( struct gl_texture_convert *convert )
}
break;
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -855,8 +835,7 @@ unconvert_teximage_al88( struct gl_texture_convert *convert )
break;
}
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -886,7 +865,7 @@ convert_texsubimage3d_rgb332( struct gl_texture_convert *convert )
static void
unconvert_teximage_rgb332( struct gl_texture_convert *convert )
{
- UNCONVERT_ERROR( convert->format );
+ gl_problem(NULL, "texture unconvert error");
}
@@ -952,8 +931,7 @@ unconvert_teximage_ci8( struct gl_texture_convert *convert )
MEMCPY( convert->dstImage, src, texels );
break;
default:
- UNCONVERT_ERROR( convert->format );
- break;
+ gl_problem(NULL, "texture unconvert error");
}
}
@@ -1244,7 +1222,7 @@ void _mesa_unconvert_teximage3d( GLint mesaFormat, GLenum format,
* all aspect ratios). This can be made a lot faster, but I don't
* really care enough...
*/
-void _mesa_rescale_teximage2d( const struct gl_texture_format *texFormat,
+void _mesa_rescale_teximage2d( GLint texelBytes,
GLint srcWidth, GLint srcHeight,
GLint dstWidth, GLint dstHeight,
const GLvoid *srcImage, GLvoid *dstImage )
@@ -1289,7 +1267,7 @@ do { \
} \
} while (0)
- switch ( texFormat->TexelBytes ) {
+ switch ( texelBytes ) {
case 4:
RESCALE_IMAGE( GLuint );
break;