Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

GIMP wrote bmp files in RGBX format. Huh.

  • Loading branch information
slouken committed Nov 10, 2011
1 parent 0218b5a commit 1dad8d79e40f3f770a5c49832cd239435be8e6ae
Showing with 20 additions and 0 deletions.
  1. +6 −0 include/SDL_pixels.h
  2. +14 −0 src/video/SDL_pixels.c
@@ -212,9 +212,15 @@ enum
SDL_PIXELFORMAT_RGB888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_RGBX8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_BGR888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_BGRX8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
SDL_PACKEDLAYOUT_8888, 24, 4),
SDL_PIXELFORMAT_ARGB8888 =
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
SDL_PACKEDLAYOUT_8888, 32, 4),
@@ -109,7 +109,9 @@ SDL_GetPixelFormatName(Uint32 format)
CASE(SDL_PIXELFORMAT_RGB24)
CASE(SDL_PIXELFORMAT_BGR24)
CASE(SDL_PIXELFORMAT_RGB888)
CASE(SDL_PIXELFORMAT_RGBX8888)
CASE(SDL_PIXELFORMAT_BGR888)
CASE(SDL_PIXELFORMAT_BGRX8888)
CASE(SDL_PIXELFORMAT_ARGB8888)
CASE(SDL_PIXELFORMAT_RGBA8888)
CASE(SDL_PIXELFORMAT_ABGR8888)
@@ -426,12 +428,24 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
Amask == 0x00000000) {
return SDL_PIXELFORMAT_RGB888;
}
if (Rmask == 0xFF000000 &&
Gmask == 0x00FF0000 &&
Bmask == 0x0000FF00 &&
Amask == 0x00000000) {
return SDL_PIXELFORMAT_RGBX8888;
}
if (Rmask == 0x000000FF &&
Gmask == 0x0000FF00 &&
Bmask == 0x00FF0000 &&
Amask == 0x00000000) {
return SDL_PIXELFORMAT_BGR888;
}
if (Rmask == 0x0000FF00 &&
Gmask == 0x00FF0000 &&
Bmask == 0xFF000000 &&
Amask == 0x00000000) {
return SDL_PIXELFORMAT_BGRX8888;
}
if (Rmask == 0x00FF0000 &&
Gmask == 0x0000FF00 &&
Bmask == 0x000000FF &&

0 comments on commit 1dad8d7

Please sign in to comment.