From db72041d9104f6931049a4aba59a8fbc116648f3 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Mon, 25 Jan 2010 13:49:48 +0000 Subject: [PATCH] Convert images to the display format --- Src/gui/gui.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/gui/gui.cpp b/Src/gui/gui.cpp index 8b3766b..33fa3ed 100644 --- a/Src/gui/gui.cpp +++ b/Src/gui/gui.cpp @@ -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)