comparison test/testpalette.c @ 2855:422452508c76

Fixed palette sharing
author Sam Lantinga <slouken@libsdl.org>
date Sun, 07 Dec 2008 22:56:18 +0000
parents 6c3fbeb04eca
children 06f0768a904c
comparison
equal deleted inserted replaced
2854:e92d58afcbda 2855:422452508c76
80 if (!bg) 80 if (!bg)
81 sdlerr("creating background surface"); 81 sdlerr("creating background surface");
82 82
83 /* set the palette to the logical screen palette so that blits 83 /* set the palette to the logical screen palette so that blits
84 won't be translated */ 84 won't be translated */
85 SDL_SetColors(bg, screen->format->palette->colors, 0, 256); 85 SDL_SetSurfacePalette(bg, screen->format->palette);
86 86
87 /* Make a wavy background pattern using colours 0-63 */ 87 /* Make a wavy background pattern using colours 0-63 */
88 if (SDL_LockSurface(bg) < 0) 88 if (SDL_LockSurface(bg) < 0)
89 sdlerr("locking background"); 89 sdlerr("locking background");
90 for (i = 0; i < SCRH; i++) { 90 for (i = 0; i < SCRH; i++) {