Fixed bug #912
authorSam Lantinga <slouken@libsdl.org>
Wed, 23 Dec 2009 06:39:18 +0000
changeset 35977dec3fe9b580
parent 3596 f638ded38b8a
child 3598 427ff6d745df
Fixed bug #912

SDL_MasksToPixelFormatEnum() wasn't correctly returning RGB24 formats
src/video/SDL_pixels.c
     1.1 --- a/src/video/SDL_pixels.c	Wed Dec 23 01:55:00 2009 +0000
     1.2 +++ b/src/video/SDL_pixels.c	Wed Dec 23 06:39:18 2009 +0000
     1.3 @@ -239,9 +239,17 @@
     1.4      case 24:
     1.5          switch (Rmask) {
     1.6          case 0x00FF0000:
     1.7 -            return SDL_PIXELFORMAT_RGB888;
     1.8 +#if SDL_BYTEORDER == SDL_BIG_ENDIAN
     1.9 +            return SDL_PIXELFORMAT_RGB24;
    1.10 +#else
    1.11 +            return SDL_PIXELFORMAT_BGR24;
    1.12 +#endif
    1.13          case 0x000000FF:
    1.14 -            return SDL_PIXELFORMAT_BGR888;
    1.15 +#if SDL_BYTEORDER == SDL_BIG_ENDIAN
    1.16 +            return SDL_PIXELFORMAT_BGR24;
    1.17 +#else
    1.18 +            return SDL_PIXELFORMAT_RGB24;
    1.19 +#endif
    1.20          case 0x00000000:
    1.21              /* FIXME: At this point we can't distinguish */
    1.22              /* if this format is RGB24 or BGR24          */