From be44b930402c7d6cc8818bb209eed8a155b25e1b Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 17 Jan 2005 22:41:17 +0000 Subject: More standard way of converting surface. --- src/resources/image.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 624036cf..7a06a4cc 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -44,11 +44,10 @@ Image* Image::load(const std::string &filePath) #endif // Attempt to use SDL_Image to load the file. SDL_Surface *tmpImage = IMG_Load(filePath.c_str()); - SDL_Surface *image = SDL_ConvertSurface( - tmpImage, screen->format, SDL_SWSURFACE); + SDL_SetColorKey(tmpImage, SDL_SRCCOLORKEY | SDL_RLEACCEL, + SDL_MapRGB(tmpImage->format, 255, 0, 255)); + SDL_Surface *image = SDL_DisplayFormat(tmpImage); SDL_FreeSurface(tmpImage); - SDL_SetColorKey(image, SDL_SRCCOLORKEY | SDL_RLEACCEL, - SDL_MapRGB(image->format, 255, 0, 255)); // Check if the file was opened and return the appropriate value. if (!image) { -- cgit v1.2.3-70-g09d2