comparison src/SDL_compat.c @ 4896:d72e28642940

Code will never reach SDL_SetTexturePalette since SDL_SetDisplayPalette will fail if the display e.g. is RGB32 or RGB24. The patch will ignore errors in SDL_SetDislayPalette. This should also affect the opengl renderer on systems supporting paletted textures - mine does not (NVIDIA). With this patch the directfb drivers delivers the same results for test_palette like the software renderer. Kind regards, André
author Sam Lantinga <slouken@libsdl.org>
date Mon, 27 Sep 2010 00:48:56 -0700
parents 518d1679d2d0
children deadc1219bea
comparison
equal deleted inserted replaced
4895:fd27410a5db0 4896:d72e28642940
319 SDL_UpdateRect(SDL_ShadowSurface, 0, 0, 0, 0); 319 SDL_UpdateRect(SDL_ShadowSurface, 0, 0, 0, 0);
320 } 320 }
321 } 321 }
322 if (userdata == SDL_VideoSurface) { 322 if (userdata == SDL_VideoSurface) {
323 if (SDL_SetDisplayPalette(palette->colors, 0, palette->ncolors) < 0) { 323 if (SDL_SetDisplayPalette(palette->colors, 0, palette->ncolors) < 0) {
324 return -1; 324 /* The display surface not necessarily needs to have a palette.
325 * Just do nothing here and try to set the texture palette.
326 */
327 //return -1;
325 } 328 }
326 if (SDL_SetTexturePalette 329 if (SDL_SetTexturePalette
327 (SDL_VideoTexture, palette->colors, 0, palette->ncolors) < 0) { 330 (SDL_VideoTexture, palette->colors, 0, palette->ncolors) < 0) {
328 return -1; 331 return -1;
329 } 332 }