mirror of
https://github.com/yawut/SDL.git
synced 2026-06-13 04:00:50 -05:00
Fixed compatibility with SDL 1.2 pixel format (24 bits per pixel of color data with 4 bytes per pixel == 32 bpp)
This commit is contained in:
parent
2d97efbd4d
commit
2bf654253f
|
|
@ -39,10 +39,10 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask,
|
|||
Uint32 masks[4];
|
||||
|
||||
/* Initialize the values here */
|
||||
if (SDL_BYTESPERPIXEL(format) == 3) {
|
||||
*bpp = SDL_BYTESPERPIXEL(format) * 8;
|
||||
} else {
|
||||
if (SDL_BYTESPERPIXEL(format) <= 2) {
|
||||
*bpp = SDL_BITSPERPIXEL(format);
|
||||
} else {
|
||||
*bpp = SDL_BYTESPERPIXEL(format) * 8;
|
||||
}
|
||||
*Rmask = *Gmask = *Bmask = *Amask = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user