Fixed setting invalid bpp for FOURCC formats in SDL_GetMasksForPixelFormatEnum()
This commit is contained in:
parent
8fdebdd3e0
commit
79a190aa23
@ -140,6 +140,12 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask,
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
/* Partial support for SDL_Surface with FOURCC */
|
||||
if (SDL_ISPIXELFORMAT_FOURCC(format)) {
|
||||
/* Not a format that uses masks */
|
||||
*bpp = 0;
|
||||
*Rmask = *Gmask = *Bmask = *Amask = 0;
|
||||
return SDL_TRUE;
|
||||
}
|
||||
#else
|
||||
if (SDL_ISPIXELFORMAT_FOURCC(format)) {
|
||||
SDL_SetError("SDL not built with YUV support");
|
||||
@ -181,11 +187,6 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask,
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
if (SDL_ISPIXELFORMAT_FOURCC(format)) {
|
||||
/* Not a format that uses masks */
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
if (SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED8 &&
|
||||
SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED16 &&
|
||||
SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED32) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user