From 15b9112374600cb51d710fb8ba7275715f838681 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 7 Dec 2008 22:48:06 +0000 Subject: [PATCH] Fixed updating the video surface when the palette changes --- src/SDL_compat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SDL_compat.c b/src/SDL_compat.c index 922f96b2a..d94794825 100644 --- a/src/SDL_compat.c +++ b/src/SDL_compat.c @@ -638,7 +638,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) SDL_DitherColors(SDL_VideoSurface->format->palette->colors, SDL_VideoSurface->format->BitsPerPixel); SDL_AddPaletteWatch(SDL_VideoSurface->format->palette, - SDL_VideoPaletteChanged, NULL); + SDL_VideoPaletteChanged, SDL_VideoSurface); SDL_SetPaletteColors(SDL_VideoSurface->format->palette, SDL_VideoSurface->format->palette->colors, 0, SDL_VideoSurface->format->palette->ncolors); @@ -664,6 +664,8 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) SDL_DitherColors(SDL_ShadowSurface->format->palette->colors, SDL_ShadowSurface->format->BitsPerPixel); } + SDL_AddPaletteWatch(SDL_ShadowSurface->format->palette, + SDL_VideoPaletteChanged, SDL_ShadowSurface); } } SDL_PublicSurface =