1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Add support for zoom offsets to parkobj

This commit is contained in:
Ted John
2021-05-29 18:32:36 +01:00
parent 87e7179650
commit 5b194974ef
2 changed files with 6 additions and 2 deletions

View File

@@ -54,7 +54,8 @@ namespace OpenRCT2::Drawing
private:
static std::vector<int32_t> GetPixels(
const uint8_t* pixels, uint32_t pitch, uint32_t srcX, uint32_t srcY, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode);
const uint8_t* pixels, uint32_t pitch, uint32_t srcX, uint32_t srcY, uint32_t width, uint32_t height,
IMPORT_FLAGS flags, IMPORT_MODE mode);
static std::vector<uint8_t> EncodeRaw(const int32_t* pixels, uint32_t width, uint32_t height);
static std::vector<uint8_t> EncodeRLE(const int32_t* pixels, uint32_t width, uint32_t height);

View File

@@ -163,6 +163,7 @@ std::vector<std::unique_ptr<ImageTable::RequiredImage>> ImageTable::ParseImages(
auto srcHeight = Json::GetNumber<int16_t>(el["srcHeight"]);
auto raw = Json::GetString(el["format"]) == "raw";
auto keepPalette = Json::GetString(el["palette"]) == "keep";
auto zoomOffset = Json::GetNumber<int32_t>(el["zoom"]);
std::vector<std::unique_ptr<RequiredImage>> result;
try
@@ -194,7 +195,9 @@ std::vector<std::unique_ptr<ImageTable::RequiredImage>> ImageTable::ParseImages(
ImageImporter importer;
auto importResult = importer.Import(image, srcX, srcY, srcWidth, srcHeight, x, y, flags);
result.push_back(std::make_unique<RequiredImage>(importResult.Element));
auto g1element = importResult.Element;
g1element.zoomed_offset = zoomOffset;
result.push_back(std::make_unique<RequiredImage>(g1element));
}
catch (const std::exception& e)
{