From fba49abc0d9a9dfa84709bf94793c903e0978791 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 8 Oct 2003 01:21:36 +0000 Subject: [PATCH] Define the "unused" bit in SDL surfaces. --- stepmania/src/RageBitmapTexture.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index 9c62d61b70..d7151fbf2c 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -196,6 +196,14 @@ apply_color_key: // Format of the image that we will pass to OpenGL and that we want OpenGL to use RageDisplay::PixelFormat pixfmt; + if( img->format->BitsPerPixel == 8 ) + { + /* Unless we set up the palette ourself, assume the "unused" bit is undefined, + * and set it to 255. We use it for alpha. */ + for( int index = 0; index < img->format->palette->ncolors; ++index ) + img->format->palette->colors[index].unused = 0xFF; + } + /* Figure out which texture format to use. */ // if the source is palleted, load palleted no matter what the prefs if(img->format->BitsPerPixel == 8 && DISPLAY->SupportsTextureFormat(RageDisplay::FMT_PAL))