SDL2: fix color cycling

This commit is contained in:
Thomas Bernard 2018-09-17 00:04:53 +02:00
parent d0864d5fbf
commit c4159247c8

View File

@ -478,7 +478,12 @@ int SetPalette(const T_Components * colors, int firstcolor, int ncolors)
#if defined(USE_SDL) #if defined(USE_SDL)
return SDL_SetPalette(Screen_SDL, SDL_PHYSPAL | SDL_LOGPAL, PaletteSDL, firstcolor, ncolors); return SDL_SetPalette(Screen_SDL, SDL_PHYSPAL | SDL_LOGPAL, PaletteSDL, firstcolor, ncolors);
#else #else
return SDL_SetPaletteColors(Screen_SDL->format->palette, PaletteSDL, firstcolor, ncolors); // When using SDL2, we need to force screen update so the
// 8bit => True color conversion will be performed
i = SDL_SetPaletteColors(Screen_SDL->format->palette, PaletteSDL, firstcolor, ncolors);
if (i == 0)
Update_rect(0, 0, Screen_SDL->w, Screen_SDL->h);
return i;
#endif #endif
} }