comparison src/video/SDL_pixels.c @ 3597:7dec3fe9b580

Fixed bug #912 SDL_MasksToPixelFormatEnum() wasn't correctly returning RGB24 formats
author Sam Lantinga <slouken@libsdl.org>
date Wed, 23 Dec 2009 06:39:18 +0000
parents 7184580ab756
children f7b03b6838cb
comparison
equal deleted inserted replaced
3596:f638ded38b8a 3597:7dec3fe9b580
237 } 237 }
238 break; 238 break;
239 case 24: 239 case 24:
240 switch (Rmask) { 240 switch (Rmask) {
241 case 0x00FF0000: 241 case 0x00FF0000:
242 return SDL_PIXELFORMAT_RGB888; 242 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
243 return SDL_PIXELFORMAT_RGB24;
244 #else
245 return SDL_PIXELFORMAT_BGR24;
246 #endif
243 case 0x000000FF: 247 case 0x000000FF:
244 return SDL_PIXELFORMAT_BGR888; 248 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
249 return SDL_PIXELFORMAT_BGR24;
250 #else
251 return SDL_PIXELFORMAT_RGB24;
252 #endif
245 case 0x00000000: 253 case 0x00000000:
246 /* FIXME: At this point we can't distinguish */ 254 /* FIXME: At this point we can't distinguish */
247 /* if this format is RGB24 or BGR24 */ 255 /* if this format is RGB24 or BGR24 */
248 return SDL_PIXELFORMAT_RGB24; 256 return SDL_PIXELFORMAT_RGB24;
249 } 257 }