mirror of https://github.com/OpenRCT2/OpenRCT2.git
remove pseudo-test from code
This commit is contained in:
parent
9e30512cb9
commit
8da2c36ea5
|
@ -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<uint8_t>(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);
|
||||
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue