Be explicit that we support the MSB variants of the 1bpp and 4bpp surface formats
Fixes https://github.com/libsdl-org/SDL/issues/6242main
parent
4f5e9fd5bd
commit
62f4fc6f35
|
@ -525,7 +525,7 @@ SDL_CalculateBlit0(SDL_Surface * surface)
|
||||||
int which;
|
int which;
|
||||||
|
|
||||||
/* 4bits to 32bits */
|
/* 4bits to 32bits */
|
||||||
if (surface->format->BitsPerPixel == 4) {
|
if (surface->format->format == SDL_PIXELFORMAT_INDEX4MSB) {
|
||||||
if (surface->map->dst->format->BytesPerPixel == 4) {
|
if (surface->map->dst->format->BytesPerPixel == 4) {
|
||||||
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
|
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -535,33 +535,32 @@ SDL_CalculateBlit0(SDL_Surface * surface)
|
||||||
return Blit4bto4Key;
|
return Blit4bto4Key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* We don't fully support 4-bit packed pixel modes */
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (surface->format->BitsPerPixel != 1) {
|
if (surface->format->format == SDL_PIXELFORMAT_INDEX1MSB) {
|
||||||
/* We don't support sub 8-bit packed pixel modes */
|
if (surface->map->dst->format->BitsPerPixel < 8) {
|
||||||
return (SDL_BlitFunc) NULL;
|
which = 0;
|
||||||
}
|
} else {
|
||||||
if (surface->map->dst->format->BitsPerPixel < 8) {
|
which = surface->map->dst->format->BytesPerPixel;
|
||||||
which = 0;
|
}
|
||||||
} else {
|
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
|
||||||
which = surface->map->dst->format->BytesPerPixel;
|
case 0:
|
||||||
}
|
return bitmap_blit[which];
|
||||||
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
|
|
||||||
case 0:
|
|
||||||
return bitmap_blit[which];
|
|
||||||
|
|
||||||
case SDL_COPY_COLORKEY:
|
case SDL_COPY_COLORKEY:
|
||||||
return colorkey_blit[which];
|
return colorkey_blit[which];
|
||||||
|
|
||||||
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
|
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
|
||||||
return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
|
return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
|
||||||
|
|
||||||
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
|
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
|
||||||
return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
|
return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
return (SDL_BlitFunc) NULL;
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SDL_HAVE_BLIT_0 */
|
#endif /* SDL_HAVE_BLIT_0 */
|
||||||
|
|
Loading…
Reference in New Issue