From c39201efcd0d3d4ee1200c39952c9cd2991cf88f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 13 Mar 2004 06:42:07 +0000 Subject: [PATCH] improve CheckPalettedTextures output --- stepmania/src/RageDisplay_OGL.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 8abb3d0498..f823bc9c3e 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -453,8 +453,19 @@ bool HasExtension(CString ext) static void CheckPalettedTextures( bool LowColor ) { - if( !GLExt::glColorTableEXT || !GLExt::glGetColorTableParameterivEXT ) - return; + CString error; + + if( GLExt::glColorTableEXT == NULL ) + { + error = "glColorTableEXT missing"; + goto fail; + } + + if( GLExt::glGetColorTableParameterivEXT == NULL ) + { + error = "glGetColorTableParameterivEXT missing"; + goto fail; + } /* Check to see if paletted textures really work. */ GLenum glTexFormat = GL_PIXFMT_INFO[RageDisplay::FMT_PAL].internalfmt; @@ -470,7 +481,6 @@ static void CheckPalettedTextures( bool LowColor ) } FlushGLErrors(); - CString error; #define GL_CHECK_ERROR(f) \ { \ GLenum glError = glGetError(); \ @@ -506,6 +516,7 @@ static void CheckPalettedTextures( bool LowColor ) { // in brackets to hush VC6 error GLint size = 0; glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GLenum(GL_TEXTURE_INDEX_SIZE_EXT), &size); + GL_CHECK_ERROR( "glGetTexLevelParameteriv(GL_TEXTURE_INDEX_SIZE_EXT)" ); if( bits > size || size > 8 ) { error = ssprintf("Expected %i-bit palette, got a %i-bit one instead", bits, int(size));