From 01ed84e315247b414575cca4e010f333f2702243 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 28 Aug 2004 09:06:04 +0000 Subject: [PATCH] finish choosing the pixel format before optionally running dithering --- stepmania/src/RageBitmapTexture.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 8fdee6a426..4e6dcfd4c4 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -213,6 +213,14 @@ void RageBitmapTexture::Create() } } + /* Make we're using a supported format. Every card supports either RGBA8 or RGBA4. */ + if( !DISPLAY->SupportsTextureFormat(pixfmt) ) + { + pixfmt = RageDisplay::FMT_RGBA8; + if( !DISPLAY->SupportsTextureFormat(pixfmt) ) + pixfmt = RageDisplay::FMT_RGBA4; + } + /* Dither if appropriate. XXX: This is a special case: don't bother dithering to * RGBA8888. We actually want to dither only if the destination has greater color * depth on at least one color channel than the source. For example, it doesn't @@ -235,16 +243,6 @@ void RageBitmapTexture::Create() * done *before* we set up the palette, since it might change it. */ RageSurfaceUtils::FixHiddenAlpha(img); - /* Make we're using a supported format. - * Every card supports either RGBA8 or RGBA4. */ - if( !DISPLAY->SupportsTextureFormat(pixfmt) ) - { - pixfmt = RageDisplay::FMT_RGBA8; - if( !DISPLAY->SupportsTextureFormat(pixfmt) ) - pixfmt = RageDisplay::FMT_RGBA4; - } - - /* Convert the data to the destination format and dimensions * required by OpenGL if it's not in it already. */ const RageDisplay::PixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc(pixfmt);