changeset 3597:7dec3fe9b580

Fixed bug #912 SDL_MasksToPixelFormatEnum() wasn't correctly returning RGB24 formats
author Sam Lantinga <slouken@libsdl.org>
date Wed, 23 Dec 2009 06:39:18 +0000
parents f638ded38b8a
children 427ff6d745df
files src/video/SDL_pixels.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/SDL_pixels.c	Wed Dec 23 01:55:00 2009 +0000
+++ b/src/video/SDL_pixels.c	Wed Dec 23 06:39:18 2009 +0000
@@ -239,9 +239,17 @@
     case 24:
         switch (Rmask) {
         case 0x00FF0000:
-            return SDL_PIXELFORMAT_RGB888;
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+            return SDL_PIXELFORMAT_RGB24;
+#else
+            return SDL_PIXELFORMAT_BGR24;
+#endif
         case 0x000000FF:
-            return SDL_PIXELFORMAT_BGR888;
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+            return SDL_PIXELFORMAT_BGR24;
+#else
+            return SDL_PIXELFORMAT_RGB24;
+#endif
         case 0x00000000:
             /* FIXME: At this point we can't distinguish */
             /* if this format is RGB24 or BGR24          */