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

Support the new 16-bit formats in SDL_MasksToPixelFormatEnum()

  • Loading branch information
slouken committed Jan 12, 2011
1 parent 2e10259 commit 5c8b5beea18db9dc569028bbda5af53518cfe9e6
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/video/SDL_pixels.c
@@ -265,19 +265,26 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
break;
case 16:
switch (Rmask) {
case 0xF000:
return SDL_PIXELFORMAT_RGBA4444;
case 0x0F00:
return SDL_PIXELFORMAT_ARGB4444;
case 0x00F0:
return SDL_PIXELFORMAT_BGRA4444;
case 0x000F:
return SDL_PIXELFORMAT_ABGR4444;
case 0x001F:
if (Gmask == 0x07E0) {
return SDL_PIXELFORMAT_BGR565;
}
return SDL_PIXELFORMAT_ABGR1555;
case 0x0F00:
return SDL_PIXELFORMAT_ARGB4444;
case 0x7C00:
return SDL_PIXELFORMAT_ARGB1555;
case 0xF800:
return SDL_PIXELFORMAT_RGB565;
if (Gmask == 0x07E0) {
return SDL_PIXELFORMAT_RGB565;
}
return SDL_PIXELFORMAT_RGBA5551;
}
break;
case 24:

0 comments on commit 5c8b5be

Please sign in to comment.