Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only warn when building Palette is missing #23

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TSMapEditor/Rendering/TheaterGraphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
// Get HSV value, change S = 0, convert back to RGB and assign
// With S = 0, the formula for converting HSV to RGB can be reduced to a quite simple form :)

System.Drawing.Color[] sdColorArray = colorData.Select(c => System.Drawing.Color.FromArgb(c.A, c.R, c.G, c.B)).ToArray();

Check warning on line 139 in src/TSMapEditor/Rendering/TheaterGraphics.cs

View workflow job for this annotation

GitHub Actions / build-editor

Unreachable code detected
for (int j = 0; j < sdColorArray.Length; j++)
{
if (colorData[j] == Color.Transparent)
Expand Down Expand Up @@ -370,7 +370,7 @@
{
return;

var buildingZData = fileManager.LoadFile("BUILDNGZ.SHP");

Check warning on line 373 in src/TSMapEditor/Rendering/TheaterGraphics.cs

View workflow job for this annotation

GitHub Actions / build-editor

Unreachable code detected

byte[] rgbBuffer = new byte[256 * 3];
for (int i = 0; i < 256; i++)
Expand Down Expand Up @@ -594,7 +594,7 @@
// Palette override in RA2/YR
Palette palette = buildingType.ArtConfig.TerrainPalette ? theaterPalette : unitPalette;
if (!string.IsNullOrWhiteSpace(buildingType.ArtConfig.Palette))
palette = GetPaletteOrFail(buildingType.ArtConfig.Palette + Theater.FileExtension[1..] + ".pal");
palette = GetPaletteOrDefault(buildingType.ArtConfig.Palette + Theater.FileExtension[1..] + ".pal", palette);

var shpFile = new ShpFile(loadedShpName);
shpFile.ParseFromBuffer(shpData);
Expand Down
Loading