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

Fixed bug #912

SDL_MasksToPixelFormatEnum() wasn't correctly returning RGB24 formats
  • Loading branch information
slouken committed Dec 23, 2009
1 parent 404e0cd commit 6db5b783fe5ee33de6df15e19e795d4ae3045af6
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/video/SDL_pixels.c
@@ -239,9 +239,17 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
case 24:
switch (Rmask) {
case 0x00FF0000:
return SDL_PIXELFORMAT_RGB888;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
return SDL_PIXELFORMAT_RGB24;
#else
return SDL_PIXELFORMAT_BGR24;
#endif
case 0x000000FF:
return SDL_PIXELFORMAT_BGR888;
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
return SDL_PIXELFORMAT_BGR24;
#else
return SDL_PIXELFORMAT_RGB24;
#endif
case 0x00000000:
/* FIXME: At this point we can't distinguish */
/* if this format is RGB24 or BGR24 */

0 comments on commit 6db5b78

Please sign in to comment.