diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index c5fc730faa91..170664d6f31d 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -11,6 +11,7 @@ #include "../core/Imaging.h" #include "../core/Json.hpp" +#include "../util/Util.h" #include #include @@ -49,6 +50,7 @@ namespace OpenRCT2::Drawing outElement.x_offset = meta.offset.x; outElement.y_offset = meta.offset.y; outElement.zoomed_offset = meta.zoomedOffset; + outElement.flags |= meta.importFlags & ImportFlags::NoDrawOnZoom ? G1_FLAG_NO_ZOOM_DRAW : 0; ImageImporter::ImportResult result; result.Element = outElement; @@ -388,17 +390,23 @@ namespace OpenRCT2::Drawing auto yOffset = Json::GetNumber(input["y"]); auto keepPalette = Json::GetString(input["palette"]) == "keep"; auto palette = keepPalette ? Palette::KeepIndices : Palette::OpenRCT2; - + auto flags = EnumValue(ImportFlags::None); auto raw = Json::GetString(input["format"]) == "raw"; - auto flags = raw ? ImportFlags::None : ImportFlags::RLE; - + if (raw) + flags |= EnumValue(ImportFlags::RLE); + flags |= Json::GetFlags( + input, + { + { "noDrawOnZoom", ImportFlags::NoDrawOnZoom }, + }); auto srcX = Json::GetNumber(input["srcX"]); auto srcY = Json::GetNumber(input["srcY"]); auto srcWidth = Json::GetNumber(input["srcWidth"]); auto srcHeight = Json::GetNumber(input["srcHeight"]); auto zoomedOffset = Json::GetNumber(input["zoom"]); - return ImageImportMeta{ { xOffset, yOffset }, palette, flags, ImportMode::Default, { srcX, srcY }, - { srcWidth, srcHeight }, zoomedOffset }; + return ImageImportMeta{ { xOffset, yOffset }, palette, static_cast(flags), + ImportMode::Default, { srcX, srcY }, { srcWidth, srcHeight }, + zoomedOffset }; }; } // namespace OpenRCT2::Drawing diff --git a/src/openrct2/drawing/ImageImporter.h b/src/openrct2/drawing/ImageImporter.h index e9ec90feb79d..0bf6ab054afe 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -31,6 +31,7 @@ namespace OpenRCT2::Drawing { None = 0, RLE = 1 << 1, + NoDrawOnZoom = 1 << 2, }; enum class Palette : uint8_t