From 07c0617f2d5a70bd284936435df42e47d333e2c6 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 2 Oct 2005 03:35:56 +0000 Subject: [PATCH] fix GL_invalid_enum errror caused by my a mistake in my "PixelFormat cleanup" checkin --- stepmania/src/RageDisplay_OGL.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 9a2e00c65f..277f7a3c7e 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -1624,7 +1624,7 @@ PixelFormat RageDisplay_OGL::GetImgPixelFormat( RageSurface* &img, bool &FreeImg if( !bPalettedTexture && img->fmt.BytesPerPixel == 1 && !g_bColorIndexTableWorks ) bSupported = false; - if( pixfmt == NUM_PixelFormat || !SupportsSurfaceFormat(pixfmt) ) + if( pixfmt == PixelFormat_INVALID || !SupportsSurfaceFormat(pixfmt) ) bSupported = false; if( !bSupported ) @@ -1645,7 +1645,9 @@ PixelFormat RageDisplay_OGL::GetImgPixelFormat( RageSurface* &img, bool &FreeImg FreeImg = true; } else + { FreeImg = false; + } return pixfmt; } @@ -1692,6 +1694,7 @@ unsigned RageDisplay_OGL::CreateTexture( /* Find the pixel format of the image we've been given. */ bool FreeImg; PixelFormat imgpixfmt = GetImgPixelFormat( img, FreeImg, img->w, img->h, pixfmt == PixelFormat_PAL ); + ASSERT( imgpixfmt != PixelFormat_INVALID ); GLenum glTexFormat = g_GLPixFmtInfo[pixfmt].internalfmt; GLenum glImageFormat = g_GLPixFmtInfo[imgpixfmt].format;