changeset 2854:e92d58afcbda

Fixed updating the video surface when the palette changes
author Sam Lantinga <slouken@libsdl.org>
date Sun, 07 Dec 2008 22:48:06 +0000
parents 6258fa7cd300
children 422452508c76
files src/SDL_compat.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/SDL_compat.c	Sun Dec 07 22:37:40 2008 +0000
+++ b/src/SDL_compat.c	Sun Dec 07 22:48:06 2008 +0000
@@ -638,7 +638,7 @@
         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_DitherColors(SDL_ShadowSurface->format->palette->colors,
                                  SDL_ShadowSurface->format->BitsPerPixel);
             }
+            SDL_AddPaletteWatch(SDL_ShadowSurface->format->palette,
+                                SDL_VideoPaletteChanged, SDL_ShadowSurface);
         }
     }
     SDL_PublicSurface =