From e35282cc13acc61d1a789ab729ae6a0ea72aa17b Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Mon, 31 May 2004 06:24:36 +0000 Subject: reworked FXT1 minor fixes to fxMesa --- src/mesa/drivers/glide/fxdd.c | 2 +- src/mesa/drivers/glide/fxddtex.c | 16 ++++++++++++---- src/mesa/drivers/glide/fxtris.c | 3 --- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers/glide') diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 77b98793ec3..7d4c1681941 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -628,7 +628,7 @@ fxDDDrawBitmap4 (GLcontext *ctx, GLint px, GLint py, struct gl_pixelstore_attrib scissoredUnpack; /* check if there's any raster operations enabled which we can't handle */ - if ((swrast->_RasterMask & (ALPHATEST_BIT | + if ((swrast->_RasterMask & (/*ALPHATEST_BIT |*/ /*BLEND_BIT |*/ /* blending ok, through pixpipe */ DEPTH_BIT | /* could be done with RGB:DEPTH */ FOG_BIT | /* could be done with RGB:DEPTH */ diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 1fbeb8d252d..2a263798c5f 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -660,6 +660,9 @@ fxIsTexSupported(GLenum target, GLint internalFormat, /**********************************************************************/ /**** NEW TEXTURE IMAGE FUNCTIONS ****/ /**********************************************************************/ +extern void +fxt1_decode_1 (const void *texture, int width, + int i, int j, unsigned char *rgba); /* Texel-fetch functions for software texturing and glGetTexImage(). * We should have been able to use some "standard" fetch functions (which @@ -836,7 +839,8 @@ fetch_rgb_fxt1(const struct gl_texture_image *texImage, i = i * mml->wScale; j = j * mml->hScale; - _mesa_texformat_rgb_fxt1.FetchTexel2D(texImage, i, j, k, rgba); + fxt1_decode_1(texImage->Data, mml->width, i, j, rgba); + rgba[ACOMP] = 255; } @@ -849,7 +853,7 @@ fetch_rgba_fxt1(const struct gl_texture_image *texImage, i = i * mml->wScale; j = j * mml->hScale; - _mesa_texformat_rgba_fxt1.FetchTexel2D(texImage, i, j, k, rgba); + fxt1_decode_1(texImage->Data, mml->width, i, j, rgba); } @@ -1303,15 +1307,19 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, case GL_RGB4_S3TC: internalFormat = GL_COMPRESSED_RGB_FXT1_3DFX; break; + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - texImage->CompressedSize /= 2; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: internalFormat = GL_COMPRESSED_RGBA_FXT1_3DFX; } texImage->IntFormat = internalFormat; + texImage->CompressedSize = _mesa_compressed_texture_size(ctx, + mml->width, + mml->height, + 1, + internalFormat); } #endif #if FX_TC_NAPALM diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index c9441673a49..44f672cbb39 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -1387,9 +1387,6 @@ void fxDDInitTriFuncs( GLcontext *ctx ) } -/* [dBorca] Hack alert: - * does this approach work with multitex? - */ GLboolean fxMultipass_ColorSum (GLcontext *ctx, GLuint pass) { fxMesaContext fxMesa = FX_CONTEXT(ctx); -- cgit v1.2.3