mirror of https://github.com/encounter/SDL.git
Fixed bug #6287 - SDL_FillRect failed for SDL_Surface with BitsPerPixel == 4
This commit is contained in:
parent
1e1be0b954
commit
d71df6448b
|
@ -329,7 +329,7 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count,
|
||||||
if (dst->format->BitsPerPixel < 8) {
|
if (dst->format->BitsPerPixel < 8) {
|
||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
const SDL_Rect *r = &rects[0];
|
const SDL_Rect *r = &rects[0];
|
||||||
if (r->x == 0 && r->y == 0 && r->w == dst->w && r->w == dst->h) {
|
if (r->x == 0 && r->y == 0 && r->w == dst->w && r->h == dst->h) {
|
||||||
if (dst->format->BitsPerPixel == 4) {
|
if (dst->format->BitsPerPixel == 4) {
|
||||||
Uint8 b = (((Uint8) color << 4) | (Uint8) color);
|
Uint8 b = (((Uint8) color << 4) | (Uint8) color);
|
||||||
SDL_memset(dst->pixels, b, dst->h * dst->pitch);
|
SDL_memset(dst->pixels, b, dst->h * dst->pitch);
|
||||||
|
|
Loading…
Reference in New Issue