Commit 66dca33f authored by Mike Gorchak's avatar Mike Gorchak

Support for 24 bpp pixel formats has been added.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403640
parent 5424dfae
...@@ -39,7 +39,7 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask, ...@@ -39,7 +39,7 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask,
Uint32 masks[4]; Uint32 masks[4];
/* Initialize the values here */ /* Initialize the values here */
if (SDL_BITSPERPIXEL(format) == 24) { if (SDL_BYTESPERPIXEL(format) == 3) {
*bpp = SDL_BYTESPERPIXEL(format) * 8; *bpp = SDL_BYTESPERPIXEL(format) * 8;
} else { } else {
*bpp = SDL_BITSPERPIXEL(format); *bpp = SDL_BITSPERPIXEL(format);
...@@ -203,6 +203,17 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, ...@@ -203,6 +203,17 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
return SDL_PIXELFORMAT_RGB565; return SDL_PIXELFORMAT_RGB565;
} }
break; break;
case 24:
switch (Rmask) {
case 0x00FF0000:
return SDL_PIXELFORMAT_RGB888;
case 0x000000FF:
return SDL_PIXELFORMAT_BGR888;
case 0x00000000:
/* FIXME: At this point we can't distinguish */
/* if this format is RGB24 or BGR24 */
return SDL_PIXELFORMAT_RGB24;
}
case 32: case 32:
switch (Rmask) { switch (Rmask) {
case 0xFF000000: case 0xFF000000:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment