GIMP wrote bmp files in RGBX format. Huh.
authorSam Lantinga <slouken@libsdl.org>
Wed, 09 Nov 2011 22:53:44 -0500
changeset 60743e1323cbb807
parent 6073 9738f2a8eee4
child 6075 a682a5c9a941
GIMP wrote bmp files in RGBX format. Huh.
include/SDL_pixels.h
src/video/SDL_pixels.c
     1.1 --- a/include/SDL_pixels.h	Wed Nov 09 02:35:49 2011 -0500
     1.2 +++ b/include/SDL_pixels.h	Wed Nov 09 22:53:44 2011 -0500
     1.3 @@ -212,9 +212,15 @@
     1.4      SDL_PIXELFORMAT_RGB888 =
     1.5          SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
     1.6                                 SDL_PACKEDLAYOUT_8888, 24, 4),
     1.7 +    SDL_PIXELFORMAT_RGBX8888 =
     1.8 +        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
     1.9 +                               SDL_PACKEDLAYOUT_8888, 24, 4),
    1.10      SDL_PIXELFORMAT_BGR888 =
    1.11          SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
    1.12                                 SDL_PACKEDLAYOUT_8888, 24, 4),
    1.13 +    SDL_PIXELFORMAT_BGRX8888 =
    1.14 +        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
    1.15 +                               SDL_PACKEDLAYOUT_8888, 24, 4),
    1.16      SDL_PIXELFORMAT_ARGB8888 =
    1.17          SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
    1.18                                 SDL_PACKEDLAYOUT_8888, 32, 4),
     2.1 --- a/src/video/SDL_pixels.c	Wed Nov 09 02:35:49 2011 -0500
     2.2 +++ b/src/video/SDL_pixels.c	Wed Nov 09 22:53:44 2011 -0500
     2.3 @@ -109,7 +109,9 @@
     2.4      CASE(SDL_PIXELFORMAT_RGB24)
     2.5      CASE(SDL_PIXELFORMAT_BGR24)
     2.6      CASE(SDL_PIXELFORMAT_RGB888)
     2.7 +    CASE(SDL_PIXELFORMAT_RGBX8888)
     2.8      CASE(SDL_PIXELFORMAT_BGR888)
     2.9 +    CASE(SDL_PIXELFORMAT_BGRX8888)
    2.10      CASE(SDL_PIXELFORMAT_ARGB8888)
    2.11      CASE(SDL_PIXELFORMAT_RGBA8888)
    2.12      CASE(SDL_PIXELFORMAT_ABGR8888)
    2.13 @@ -426,12 +428,24 @@
    2.14              Amask == 0x00000000) {
    2.15              return SDL_PIXELFORMAT_RGB888;
    2.16          }
    2.17 +        if (Rmask == 0xFF000000 &&
    2.18 +            Gmask == 0x00FF0000 &&
    2.19 +            Bmask == 0x0000FF00 &&
    2.20 +            Amask == 0x00000000) {
    2.21 +            return SDL_PIXELFORMAT_RGBX8888;
    2.22 +        }
    2.23          if (Rmask == 0x000000FF &&
    2.24              Gmask == 0x0000FF00 &&
    2.25              Bmask == 0x00FF0000 &&
    2.26              Amask == 0x00000000) {
    2.27              return SDL_PIXELFORMAT_BGR888;
    2.28          }
    2.29 +        if (Rmask == 0x0000FF00 &&
    2.30 +            Gmask == 0x00FF0000 &&
    2.31 +            Bmask == 0xFF000000 &&
    2.32 +            Amask == 0x00000000) {
    2.33 +            return SDL_PIXELFORMAT_BGRX8888;
    2.34 +        }
    2.35          if (Rmask == 0x00FF0000 &&
    2.36              Gmask == 0x0000FF00 &&
    2.37              Bmask == 0x000000FF &&