mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-07 02:52:42 +08:00
give default RGBA masks for depth 32 when masks not specified
This commit is contained in:
@@ -76,6 +76,14 @@ GAL_PixelFormat *GAL_AllocFormat(int bpp,
|
||||
//memset(format, 0, sizeof(*format));
|
||||
format->alpha = GAL_ALPHA_OPAQUE;
|
||||
|
||||
/* Give defaults for the special case */
|
||||
if (bpp == 32 && Rmask == 0 && Gmask == 0 && Bmask == 0 && Amask == 0) {
|
||||
Amask = 0xFF000000;
|
||||
Rmask = 0x00FF0000;
|
||||
Gmask = 0x0000FF00;
|
||||
Bmask = 0x000000FF;
|
||||
}
|
||||
|
||||
/* Set up the format */
|
||||
format->BitsPerPixel = bpp;
|
||||
format->BytesPerPixel = (bpp+7)/8;
|
||||
|
||||
Reference in New Issue
Block a user