Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug #912
Browse files Browse the repository at this point in the history
SDL_MasksToPixelFormatEnum() wasn't correctly returning RGB24 formats
  • Loading branch information
slouken committed Dec 23, 2009
1 parent 404e0cd commit 6db5b78
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/video/SDL_pixels.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 6db5b78

Please sign in to comment.