src/video/SDL_pixels.c
changeset 5438 b705640cb34a
parent 5437 ce10653e370c
child 5439 3a778c6c0269
equal deleted inserted replaced
5437:ce10653e370c 5438:b705640cb34a
   240 SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
   240 SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
   241                            Uint32 Amask)
   241                            Uint32 Amask)
   242 {
   242 {
   243     switch (bpp) {
   243     switch (bpp) {
   244     case 1:
   244     case 1:
       
   245         /* SDL defaults to MSB ordering */
       
   246         return SDL_PIXELFORMAT_INDEX1MSB;
   245     case 4:
   247     case 4:
   246         /* Can't tell if this is LSB or MSB bitmap ordering... */
   248         /* SDL defaults to MSB ordering */
   247         break;
   249         return SDL_PIXELFORMAT_INDEX4MSB;
   248     case 8:
   250     case 8:
   249         if (Rmask == 0) {
   251         if (Rmask == 0) {
   250             return SDL_PIXELFORMAT_INDEX8;
   252             return SDL_PIXELFORMAT_INDEX8;
   251         }
   253         }
   252         if (Rmask == 0xE0 &&
   254         if (Rmask == 0xE0 &&