mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
Simplify palette code
Each texture gets its own palette, the palette is updated when it is rendered if necessary, rendering is flushed if a texture render is already queued up. Trying to share palettes and handle the different cases of queued rendering and changing palettes in the middle of the frame ends up being very complicated, so we'll keep it simple for now.
This commit is contained in:
@@ -1900,17 +1900,6 @@ bool SDL_SetTexturePalette(SDL_Texture *texture, SDL_Palette *palette)
|
||||
}
|
||||
|
||||
if (palette != texture->palette) {
|
||||
if (!FlushRenderCommandsIfTextureNeeded(texture)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!texture->native) {
|
||||
SDL_Renderer *renderer = texture->renderer;
|
||||
if (!renderer->ChangeTexturePalette(renderer, texture, palette)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (texture->palette) {
|
||||
SDL_DestroyPalette(texture->palette);
|
||||
}
|
||||
|
Reference in New Issue
Block a user