use ApplyHotPinkColorKey
This commit is contained in:
@@ -325,9 +325,8 @@ void BannerCache::CacheBannerInternal( CString BannerPath )
|
|||||||
* This also makes the banner take less memory, though that could also be
|
* This also makes the banner take less memory, though that could also be
|
||||||
* done by RLEing the surface.
|
* done by RLEing the surface.
|
||||||
*/
|
*/
|
||||||
int color = mySDL_MapRGBExact(img->format, 0xFF, 0, 0xFF);
|
ApplyHotPinkColorKey( img );
|
||||||
if( color != -1 )
|
|
||||||
SDL_SetColorKey( img, SDL_SRCCOLORKEY, color );
|
|
||||||
ConvertSDLSurface(img, img->w, img->h, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
|
ConvertSDLSurface(img, img->w, img->h, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
|
||||||
|
|
||||||
SDL_Surface *dst = SDL_CreateRGBSurface(
|
SDL_Surface *dst = SDL_CreateRGBSurface(
|
||||||
@@ -339,8 +338,6 @@ void BannerCache::CacheBannerInternal( CString BannerPath )
|
|||||||
ASSERT( img->format->palette );
|
ASSERT( img->format->palette );
|
||||||
mySDL_SetPalette(dst, img->format->palette->colors, 0, 256);
|
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] = {
|
const float fCustomImageCoords[8] = {
|
||||||
0.02f, 0.78f, // top left
|
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)) );
|
width = max( width, min(32, power_of_two(src_width)) );
|
||||||
height = max( height, min(32, power_of_two(src_height)) );
|
height = max( height, min(32, power_of_two(src_height)) );
|
||||||
|
|
||||||
{
|
ApplyHotPinkColorKey( img );
|
||||||
const int color = mySDL_MapRGBExact(img->format, 0xFF, 0, 0xFF);
|
|
||||||
if( color != -1 )
|
|
||||||
SDL_SetColorKey( img, SDL_SRCCOLORKEY, color );
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ConvertSDLSurface(img, img->w, img->h, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
|
ConvertSDLSurface(img, img->w, img->h, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
|
||||||
|
|||||||
Reference in New Issue
Block a user