SDL: use SDL_DisplayFormat instead of SDL_DisplayFormatAlpha for images that don...
authorTim Goya <tuxdev103@gmail.com>
Tue, 21 Aug 2007 00:28:52 +0000 (00:28 +0000)
committerTim Goya <tuxdev103@gmail.com>
Tue, 21 Aug 2007 00:28:52 +0000 (00:28 +0000)
SVN-Revision: 5148

src/video/sdl_texture.cpp

index 2f1bc97..5b4b61f 100644 (file)
@@ -406,7 +406,14 @@ namespace SDL
 {
   Texture::Texture(SDL_Surface* image)
   {
-    texture = SDL_DisplayFormatAlpha(image);
+    if(!(image->flags & SDL_SRCALPHA) || !image->format->Amask)
+    {
+      texture = SDL_DisplayFormat(image);
+    }
+    else
+    {
+      texture = SDL_DisplayFormatAlpha(image);
+    }
     //width = texture->w;
     //height = texture->h;
     int numerator, denominator;