diff src/SDL_compat.c @ 2807:365fe1a2aad5

The SDL_RLEACCEL flag is respected in SDL_ConvertSurface(), per the docs. Fixed saving BMP files of surfaces with an alpha channel.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 29 Nov 2008 11:26:01 +0000
parents 8fe261aae1bb
children 16fe3b867887
line wrap: on
line diff
--- a/src/SDL_compat.c	Sat Nov 29 11:24:18 2008 +0000
+++ b/src/SDL_compat.c	Sat Nov 29 11:26:01 2008 +0000
@@ -614,17 +614,16 @@
 SDL_Surface *
 SDL_DisplayFormat(SDL_Surface * surface)
 {
-    SDL_Surface *converted;
+    SDL_PixelFormat *format;
 
     if (!SDL_PublicSurface) {
         SDL_SetError("No video mode has been set");
         return NULL;
     }
+    format = SDL_PublicSurface->format;
 
     /* Set the flags appropriate for copying to display surface */
-    converted = SDL_ConvertSurface(surface, SDL_PublicSurface->format, 0);
-    SDL_SetSurfaceRLE(converted, 1);
-    return converted;
+    return SDL_ConvertSurface(surface, format, SDL_RLEACCEL);
 }
 
 SDL_Surface *
@@ -673,8 +672,7 @@
         break;
     }
     format = SDL_AllocFormat(32, rmask, gmask, bmask, amask);
-    converted = SDL_ConvertSurface(surface, format, 0);
-    SDL_SetSurfaceRLE(converted, 1);
+    converted = SDL_ConvertSurface(surface, format, SDL_RLEACCEL);
     SDL_FreeFormat(format);
     return converted;
 }