Skip to content

Commit

Permalink
Fix veins' palette in YR
Browse files Browse the repository at this point in the history
  • Loading branch information
ZivDero committed May 7, 2024
1 parent bd6e00d commit 0f20548
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/TSMapEditor/Rendering/TheaterGraphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,7 @@ public TheaterGraphics(GraphicsDevice graphicsDevice, Theater theater, CCFileMan
theaterPalette = GetPaletteOrFail(theater.TerrainPaletteName, false);
unitPalette = GetPaletteOrFail(Theater.UnitPaletteName, true);
animPalette = GetPaletteOrFail("anim.pal", true);
if (!string.IsNullOrEmpty(Theater.TiberiumPaletteName))
tiberiumPalette = GetPaletteOrFail(Theater.TiberiumPaletteName, false);
tiberiumPalette = string.IsNullOrEmpty(Theater.TiberiumPaletteName) ? theaterPalette : GetPaletteOrFail(Theater.TiberiumPaletteName, false);
vplFile = GetVplFile();

if (UserSettings.Instance.MultithreadedTextureLoading)
Expand Down Expand Up @@ -1295,17 +1294,11 @@ public void ReadOverlayTextures(List<OverlayType> overlayTypes)
var shpFile = new ShpFile(loadedShpName);
shpFile.ParseFromBuffer(shpData);
XNAPalette palette = theaterPalette;

if (overlayType.Tiberium)
{
palette = unitPalette;

if (Constants.TheaterPaletteForTiberium)
palette = tiberiumPalette ?? theaterPalette;
}

if (overlayType.Wall || overlayType.IsVeins)

if (overlayType.Wall || overlayType.IsVeinholeMonster)
palette = unitPalette;
else if (overlayType.Tiberium || overlayType.IsVeins)
palette = Constants.TheaterPaletteForTiberium ? tiberiumPalette : unitPalette;

// Palette override for wall overlays in Phobos
if (overlayType.Wall && !string.IsNullOrWhiteSpace(overlayType.ArtConfig.Palette))
Expand Down

0 comments on commit 0f20548

Please sign in to comment.