Update Renderer.cs

Fix graphical error when adding mulitplayer spawn points in the map editor.
This commit is contained in:
Moritz Heller
2024-07-18 13:24:17 +02:00
committed by Gustas
parent 84f8c6a4c6
commit 62d1f002dd

View File

@@ -79,6 +79,7 @@ namespace OpenRA
Rectangle lastWorldViewport = Rectangle.Empty;
ITexture currentPaletteTexture;
int currentPaletteHeight = 0;
IBatchRenderer currentBatchRenderer;
RenderType renderType = RenderType.None;
@@ -309,11 +310,13 @@ namespace OpenRA
{
// Note: palette.Texture and palette.ColorShifts are updated at the same time
// so we only need to check one of the two to know whether we must update the textures
if (palette.Texture == currentPaletteTexture)
// also compare heights in case new palettes have been added
if (palette.Texture == currentPaletteTexture && palette.Height == currentPaletteHeight)
return;
Flush();
currentPaletteTexture = palette.Texture;
currentPaletteHeight = palette.Height;
SpriteRenderer.SetPalette(palette);
WorldSpriteRenderer.SetPalette(palette);