use ApplyHotPinkColorKey

This commit is contained in:
Glenn Maynard
2004-05-17 01:50:07 +00:00
parent bf8b43ab92
commit 7534fada15
+3 -10
View File
@@ -325,9 +325,8 @@ void BannerCache::CacheBannerInternal( CString BannerPath )
* This also makes the banner take less memory, though that could also be
* done by RLEing the surface.
*/
int color = mySDL_MapRGBExact(img->format, 0xFF, 0, 0xFF);
if( color != -1 )
SDL_SetColorKey( img, SDL_SRCCOLORKEY, color );
ApplyHotPinkColorKey( img );
ConvertSDLSurface(img, img->w, img->h, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
SDL_Surface *dst = SDL_CreateRGBSurface(
@@ -339,8 +338,6 @@ void BannerCache::CacheBannerInternal( CString BannerPath )
ASSERT( img->format->palette );
mySDL_SetPalette(dst, img->format->palette->colors, 0, 256);
}
if( img->flags & SDL_SRCCOLORKEY )
SDL_SetColorKey( dst, SDL_SRCCOLORKEY, img->format->colorkey);
const float fCustomImageCoords[8] = {
0.02f, 0.78f, // top left
@@ -374,11 +371,7 @@ void BannerCache::CacheBannerInternal( CString BannerPath )
width = max( width, min(32, power_of_two(src_width)) );
height = max( height, min(32, power_of_two(src_height)) );
{
const int color = mySDL_MapRGBExact(img->format, 0xFF, 0, 0xFF);
if( color != -1 )
SDL_SetColorKey( img, SDL_SRCCOLORKEY, color );
}
ApplyHotPinkColorKey( img );
{
ConvertSDLSurface(img, img->w, img->h, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);