Commit 87672bbc authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #912

SDL_MasksToPixelFormatEnum() wasn't correctly returning RGB24 formats

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404347
parent 6da163ab
...@@ -239,9 +239,17 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, ...@@ -239,9 +239,17 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
case 24: case 24:
switch (Rmask) { switch (Rmask) {
case 0x00FF0000: case 0x00FF0000:
return SDL_PIXELFORMAT_RGB888; #if SDL_BYTEORDER == SDL_BIG_ENDIAN
return SDL_PIXELFORMAT_RGB24;
#else
return SDL_PIXELFORMAT_BGR24;
#endif
case 0x000000FF: case 0x000000FF:
return SDL_PIXELFORMAT_BGR888; #if SDL_BYTEORDER == SDL_BIG_ENDIAN
return SDL_PIXELFORMAT_BGR24;
#else
return SDL_PIXELFORMAT_RGB24;
#endif
case 0x00000000: case 0x00000000:
/* FIXME: At this point we can't distinguish */ /* FIXME: At this point we can't distinguish */
/* if this format is RGB24 or BGR24 */ /* if this format is RGB24 or BGR24 */
......
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