Convert images to the display format

This commit is contained in:
simon.kagstrom 2010-01-25 13:49:48 +00:00
parent d9a1ce3de9
commit db72041d91

View File

@ -346,7 +346,15 @@ void Gui::activate()
SDL_Surface *Gui::loadThemeImage(const char *dir, const char *what)
{
return IMG_Load(get_theme_path(dir, what));
SDL_Surface *img = IMG_Load(get_theme_path(dir, what));
SDL_Surface *out;
if (!img)
return NULL;
out = SDL_DisplayFormatAlpha(img);
SDL_FreeSurface(img);
return out;
}
Font *Gui::loadThemeFont(const char *dir, const char *what, int size)