# HG changeset patch # User Sam Lantinga # Date 1294874472 28800 # Node ID b49d3869ebd246457775f8cf90bfc2507ec167eb # Parent 660d3a43210272bddf40c2ed8f4d778fca5eda44 Support the new 16-bit formats in SDL_MasksToPixelFormatEnum() diff -r 660d3a432102 -r b49d3869ebd2 src/video/SDL_pixels.c --- a/src/video/SDL_pixels.c Wed Jan 12 14:53:23 2011 -0800 +++ b/src/video/SDL_pixels.c Wed Jan 12 15:21:12 2011 -0800 @@ -265,6 +265,12 @@ break; case 16: switch (Rmask) { + case 0xF000: + return SDL_PIXELFORMAT_RGBA4444; + case 0x0F00: + return SDL_PIXELFORMAT_ARGB4444; + case 0x00F0: + return SDL_PIXELFORMAT_BGRA4444; case 0x000F: return SDL_PIXELFORMAT_ABGR4444; case 0x001F: @@ -272,12 +278,13 @@ return SDL_PIXELFORMAT_BGR565; } return SDL_PIXELFORMAT_ABGR1555; - case 0x0F00: - return SDL_PIXELFORMAT_ARGB4444; case 0x7C00: return SDL_PIXELFORMAT_ARGB1555; case 0xF800: - return SDL_PIXELFORMAT_RGB565; + if (Gmask == 0x07E0) { + return SDL_PIXELFORMAT_RGB565; + } + return SDL_PIXELFORMAT_RGBA5551; } break; case 24: