diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-17 22:41:17 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-17 22:41:17 +0000 |
commit | be44b930402c7d6cc8818bb209eed8a155b25e1b (patch) | |
tree | 16052d489a2de027c8a5303104fd3bd80aeee18d | |
parent | 94808d9f6c958106176f891b35cb7d59f63c56c7 (diff) | |
download | mana-be44b930402c7d6cc8818bb209eed8a155b25e1b.tar.gz mana-be44b930402c7d6cc8818bb209eed8a155b25e1b.tar.bz2 mana-be44b930402c7d6cc8818bb209eed8a155b25e1b.tar.xz mana-be44b930402c7d6cc8818bb209eed8a155b25e1b.zip |
More standard way of converting surface.
-rw-r--r-- | src/resources/image.cpp | 7 |
1 files 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) { |