From 8da2c36ea5b3b2a48ba0f67d4eb181ed669b56d5 Mon Sep 17 00:00:00 2001 From: Spacek531 Date: Sat, 20 Apr 2024 23:54:16 -0700 Subject: [PATCH] remove pseudo-test from code --- .../paint/tile_element/Paint.LargeScenery.cpp | 43 ----------- .../paint/tile_element/Paint.SmallScenery.cpp | 73 ------------------- 2 files changed, 116 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 91eeca6e14..f4b78d71da 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -33,28 +33,6 @@ using namespace OpenRCT2; -// clang-format off -static constexpr BoundBoxXY LargeSceneryBoundBoxes[] = { - { { 3, 3 }, { 26, 26 } }, - { { 17, 17 }, { 12, 12 } }, - { { 17, 3 }, { 12, 12 } }, - { { 17, 3 }, { 12, 26 } }, - { { 3, 3 }, { 12, 12 } }, - { { 3, 3 }, { 26, 26 } }, - { { 3, 3 }, { 28, 12 } }, - { { 3, 3 }, { 26, 26 } }, - { { 3, 17 }, { 12, 12 } }, - { { 3, 17 }, { 26, 12 } }, - { { 3, 3 }, { 26, 26 } }, - { { 3, 3 }, { 26, 26 } }, - { { 3, 3 }, { 12, 28 } }, - { { 3, 3 }, { 26, 26 } }, - { { 3, 3 }, { 26, 26 } }, - { { 3, 3 }, { 26, 26 } }, - { { 1, 1 }, { 30, 30 } }, -}; -// clang-format on - static void PaintLargeScenerySupports( PaintSession& session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement, ImageId imageTemplate, const LargeSceneryTile& tile) @@ -392,27 +370,6 @@ void PaintLargeScenery(PaintSession& session, uint8_t direction, uint16_t height boundBox.offset.z += height; offset.z += height; -#pragma region LegacyVerification - auto boxlengthZ = std::min(tile->z_clearance, 128) - 3; - auto flags = tile->flags; - auto bbIndex = 16; - if (flags & 0xF00) - { - flags &= 0xF000; - flags = Numerics::rol16(flags, direction); - bbIndex = (flags & 0xF) | (flags >> 12); - } - const CoordsXYZ& bbOffset = { LargeSceneryBoundBoxes[bbIndex].offset, height }; - const CoordsXYZ& bbLength = { LargeSceneryBoundBoxes[bbIndex].length, boxlengthZ }; - - auto boxOffsetDelta = bbOffset - boundBox.offset; - auto boxLengthDelta = bbLength - boundBox.length; - auto offsetDelta = CoordsXYZ(0, 0, height) - offset; - assert(boxOffsetDelta.x == 0 && boxOffsetDelta.y == 0 && boxOffsetDelta.z == 0); - assert(boxLengthDelta.x == 0 && boxLengthDelta.y == 0 && boxLengthDelta.z == 0); - assert(offsetDelta.x == 0 && offsetDelta.y == 0 && offsetDelta.z == 0); -#pragma endregion - auto imageIndex = sceneryEntry->image + 4 + (sequenceNum << 2) + direction; PaintAddImageAsParent(session, imageTemplate.WithIndex(imageIndex), offset, boundBox); diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 4d70986973..dab5529dbb 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -33,13 +33,6 @@ static constexpr CoordsXY newQuadrantOffsets[NumOrthogonalDirections] = { { 16, 0 }, }; -static constexpr CoordsXY lengths[] = { - { 12, 26 }, - { 26, 12 }, - { 12, 26 }, - { 26, 12 }, -}; - static void PaintSmallScenerySupports( PaintSession& session, const SmallSceneryEntry& sceneryEntry, const SmallSceneryElement& sceneryElement, Direction direction, int32_t height, ImageId imageTemplate) @@ -138,72 +131,6 @@ static void PaintSmallSceneryBody( offset += newQuadrantOffsets[quadrant]; } -#pragma region LegacyVerification - BoundBoxXYZ boundBoxLegacy = { { 0, 0, height }, { 2, 2, 0 } }; - CoordsXYZ offsetLegacy = { 0, 0, height }; - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) - { - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HALF_SPACE)) - { - static constexpr CoordsXY sceneryHalfTileOffsets[] = { - { 3, 3 }, - { 3, 17 }, - { 17, 3 }, - { 3, 3 }, - }; - boundBoxLegacy.offset.x = sceneryHalfTileOffsets[direction].x; - boundBoxLegacy.offset.y = sceneryHalfTileOffsets[direction].y; - boundBoxLegacy.length.x = lengths[direction].x; - boundBoxLegacy.length.y = lengths[direction].y; - offsetLegacy.x = 3; - offsetLegacy.y = 3; - } - else - { - offsetLegacy.x = 15; - offsetLegacy.y = 15; - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) - { - offsetLegacy.x = 3; - offsetLegacy.y = 3; - boundBoxLegacy.length.x = 26; - boundBoxLegacy.length.y = 26; - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)) - { - offsetLegacy.x = 1; - offsetLegacy.y = 1; - boundBoxLegacy.length.x = 30; - boundBoxLegacy.length.y = 30; - } - } - boundBoxLegacy.offset.x = offset.x; - boundBoxLegacy.offset.y = offset.y; - } - } - else - { - uint8_t quadrant = (sceneryElement.GetSceneryQuadrant() + session.CurrentRotation) & 3; - // -1 to maintain compatibility with existing CSOs in context of issue #17616 - offsetLegacy.x = SceneryQuadrantOffsets[quadrant].x - 1; - offsetLegacy.y = SceneryQuadrantOffsets[quadrant].y - 1; - boundBoxLegacy.offset.x = offsetLegacy.x; - boundBoxLegacy.offset.y = offsetLegacy.y; - } - boundBoxLegacy.length.z = sceneryEntry->height - 4; - if (boundBoxLegacy.length.z > 128 || boundBoxLegacy.length.z < 0) - { - boundBoxLegacy.length.z = 128; - } - boundBoxLegacy.length.z--; - - auto boxOffsetDelta = boundBoxLegacy.offset - boundBox.offset; - auto boxLengthDelta = boundBoxLegacy.length - boundBox.length; - auto offsetDelta = offsetLegacy - offset; - assert(boxOffsetDelta.x == 0 && boxOffsetDelta.y == 0 && boxOffsetDelta.z == 0); - assert(boxLengthDelta.x == 0 && boxLengthDelta.y == 0 && boxLengthDelta.z == 0); - assert(offsetDelta.x == 0 && offsetDelta.y == 0 && offsetDelta.z == 0); -#pragma endregion - ImageIndex baseImageIndex = sceneryEntry->image + direction; if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_WITHER)) {