summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-04-25 15:41:22 +0000
committerBrian Paul <[email protected]>2001-04-25 15:41:22 +0000
commit3bfd0e6f9fee39c00cdbaf03d843a997ef16e827 (patch)
tree0cdba1070f9387472b7f96714bf919399415e1b8 /src/mesa
parent31acab88f29deeccb30ec608634bad7e020b3f57 (diff)
minor simplification in glGetTexLevelParameter
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texstate.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index bc9ed8b77fb..1dd084a5070 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.47 2001/04/24 16:11:35 brianp Exp $ */
+/* $Id: texstate.c,v 1.48 2001/04/25 15:41:22 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1124,7 +1124,6 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
const struct gl_texture_image *img = NULL;
GLuint dimensions;
GLboolean isProxy;
- GLenum baseIntFormat;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (level < 0 || level >= ctx->Const.MaxTextureLevels) {
@@ -1148,8 +1147,6 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
return;
}
- baseIntFormat = _mesa_base_tex_format(ctx, img->IntFormat);
-
isProxy = (target == GL_PROXY_TEXTURE_1D) ||
(target == GL_PROXY_TEXTURE_2D) ||
(target == GL_PROXY_TEXTURE_3D) ||
@@ -1172,36 +1169,32 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = img->Border;
return;
case GL_TEXTURE_RED_SIZE:
- if (baseIntFormat == GL_RGB ||
- baseIntFormat == GL_RGBA)
+ if (img->Format == GL_RGB || img->Format == GL_RGBA)
*params = img->TexFormat->RedBits;
else
*params = 0;
return;
case GL_TEXTURE_GREEN_SIZE:
- if (baseIntFormat == GL_RGB ||
- baseIntFormat == GL_RGBA)
+ if (img->Format == GL_RGB || img->Format == GL_RGBA)
*params = img->TexFormat->GreenBits;
else
*params = 0;
return;
case GL_TEXTURE_BLUE_SIZE:
- if (baseIntFormat == GL_RGB ||
- baseIntFormat == GL_RGBA)
+ if (img->Format == GL_RGB || img->Format == GL_RGBA)
*params = img->TexFormat->BlueBits;
else
*params = 0;
return;
case GL_TEXTURE_ALPHA_SIZE:
- if (baseIntFormat == GL_ALPHA ||
- baseIntFormat == GL_LUMINANCE_ALPHA ||
- baseIntFormat == GL_RGBA)
+ if (img->Format == GL_ALPHA || img->Format == GL_LUMINANCE_ALPHA ||
+ img->Format == GL_RGBA)
*params = img->TexFormat->AlphaBits;
else
*params = 0;
return;
case GL_TEXTURE_INTENSITY_SIZE:
- if (baseIntFormat != GL_INTENSITY)
+ if (img->Format != GL_INTENSITY)
*params = 0;
else if (img->TexFormat->IntensityBits > 0)
*params = img->TexFormat->IntensityBits;
@@ -1209,8 +1202,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
return;
case GL_TEXTURE_LUMINANCE_SIZE:
- if (baseIntFormat != GL_LUMINANCE &&
- baseIntFormat != GL_LUMINANCE_ALPHA)
+ if (img->Format != GL_LUMINANCE &&
+ img->Format != GL_LUMINANCE_ALPHA)
*params = 0;
else if (img->TexFormat->LuminanceBits > 0)
*params = img->TexFormat->LuminanceBits;
@@ -1218,7 +1211,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
*params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits);
return;
case GL_TEXTURE_INDEX_SIZE_EXT:
- if (baseIntFormat == GL_COLOR_INDEX)
+ if (img->Format == GL_COLOR_INDEX)
*params = img->TexFormat->IndexBits;
else
*params = 0;