From 9434f1bc1376b148aac6b7064f3a88a4fed5d8b5 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 19 Feb 2019 16:40:38 -0500 Subject: [PATCH] Corrected default palette generation. --- src/SDL12_compat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c index b5807d7b8..123b97e3a 100644 --- a/src/SDL12_compat.c +++ b/src/SDL12_compat.c @@ -1935,9 +1935,9 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags12) int i; SDL_Color *color = VideoSurface12->format->palette->colors; for (i = 0; i < 256; i++, color++) { - { const int x = i & 0xe0; color->r = x >> 3 | x >> 6; } - { const int x = (i << 3) & 0xe0; color->g = x >> 3 | x >> 6; } - { const int x = (i & 0x3) | (i & 0x3 << 2); color->b = x | x << 4; } + { const int x = i & 0xe0; color->r = x | x >> 3 | x >> 6; } + { const int x = (i << 3) & 0xe0; color->g = x | x >> 3 | x >> 6; } + { const int x = (i & 0x3) | ((i & 0x3) << 2); color->b = x | x << 4; } color->a = 255; } }