From f6f5b41b76727026e826e46d00dd3612540ede63 Mon Sep 17 00:00:00 2001 From: zrowny Date: Thu, 13 May 2021 10:30:35 -0400 Subject: [PATCH] Correct palette indexes of remap colors in image importer The codes that finds the closest entry that isn't used for remapping has the indices of remappable colors slightly off, and would make some colors in the imported image remappable even though they shouldn't have been. Comment in header file describing the standard palette corrected as well. --- contributors.md | 1 + src/openrct2/drawing/ImageImporter.cpp | 4 ++-- src/openrct2/drawing/ImageImporter.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contributors.md b/contributors.md index 2365a73ae9..0a04899ff0 100644 --- a/contributors.md +++ b/contributors.md @@ -166,6 +166,7 @@ The following people are not part of the development team, but have been contrib * Adam Bloom (adam-bloom) * Geoff B. (geoff-B) * Ryan D. (rctdude2) +* (zrowny) ## Toolchain * (Balletie) - macOS diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index b537255fbc..fe7b313872 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -312,11 +312,11 @@ bool ImageImporter::IsChangablePixel(int32_t paletteIndex) return true; if (paletteIndex == 0) return false; - if (paletteIndex >= 203 && paletteIndex < 214) + if (paletteIndex >= 202 && paletteIndex <= 213) return false; if (paletteIndex == 226) return false; - if (paletteIndex >= 227 && paletteIndex < 229) + if (paletteIndex >= 227 && paletteIndex <= 229) return false; if (paletteIndex >= 243) return false; diff --git a/src/openrct2/drawing/ImageImporter.h b/src/openrct2/drawing/ImageImporter.h index fa507fc4e7..e121414259 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -273,7 +273,7 @@ constexpr const GamePalette StandardPalette = { { { 231, 231, 171, 255 }, { 255, 255, 207, 255 }, - // 203 - 214 (Secondary remap) + // 202 - 213 (Secondary remap) { 27, 0, 63, 255 }, { 51, 0, 103, 255 }, { 63, 11, 123, 255 },