diff src/video/dummy/SDL_nullrender.c @ 1683:396a35389351 SDL-1.3

Finished palettized display handling. Added support for surface palette sharing.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 17 Jun 2006 06:45:14 +0000
parents 7ae8018b2e5d
children 1577404809f0
line wrap: on
line diff
--- a/src/video/dummy/SDL_nullrender.c	Fri Jun 16 06:00:31 2006 +0000
+++ b/src/video/dummy/SDL_nullrender.c	Sat Jun 17 06:45:14 2006 +0000
@@ -106,16 +106,7 @@
         SDL_DUMMY_DestroyRenderer(renderer);
         return NULL;
     }
-
-    /* If the display has a palette, use it for the window surfaces */
-    if (window->display->palette.ncolors) {
-        SDL_PixelFormat *format = data->surface->format;
-        if (format->palette->colors) {
-            SDL_free(format->palette->colors);
-        }
-        SDL_free(format->palette);
-        format->palette = &window->display->palette;
-    }
+    SDL_SetSurfacePalette(data->surface, window->display->palette);
 
     return renderer;
 }
@@ -178,8 +169,8 @@
 
     if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) {
         char file[128];
-        SDL_snprintf(file, sizeof(file), "SDL_frame-%8.8d.bmp",
-                     ++frame_number);
+        SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp",
+                     renderer->window->id, ++frame_number);
         SDL_SaveBMP(surface, file);
     }
 }