Define the "unused" bit in SDL surfaces.

This commit is contained in:
Glenn Maynard
2003-10-08 01:21:36 +00:00
parent d5cc663bea
commit fba49abc0d
+8
View File
@@ -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))