mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Make Map::sign_set_colour() use CoordsXYZD (#10441)
* Make Map::sign_set_colour() use CoordsXYZD * Rename Map::sign_set_colour()
This commit is contained in:
@@ -98,8 +98,8 @@ public:
|
||||
if (_isLarge)
|
||||
{
|
||||
TileElement* tileElement = banner_get_tile_element((BannerIndex)_bannerIndex);
|
||||
if (!sign_set_colour(
|
||||
coords.x, coords.y, tileElement->base_height, tileElement->GetDirection(),
|
||||
if (!map_large_scenery_sign_set_colour(
|
||||
{ coords, tileElement->GetBaseZ(), tileElement->GetDirection() },
|
||||
tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour))
|
||||
{
|
||||
return MakeResult(GA_ERROR::UNKNOWN, STR_NONE);
|
||||
|
||||
@@ -1900,15 +1900,13 @@ std::optional<CoordsXYZ> map_large_scenery_get_origin(
|
||||
*
|
||||
* rct2: 0x006B9B05
|
||||
*/
|
||||
bool sign_set_colour(
|
||||
int32_t x, int32_t y, int32_t z, int32_t direction, int32_t sequence, uint8_t mainColour, uint8_t textColour)
|
||||
bool map_large_scenery_sign_set_colour(const CoordsXYZD& signPos, int32_t sequence, uint8_t mainColour, uint8_t textColour)
|
||||
{
|
||||
LargeSceneryElement* tileElement;
|
||||
rct_scenery_entry* sceneryEntry;
|
||||
rct_large_scenery_tile *sceneryTiles, *tile;
|
||||
|
||||
auto sceneryOrigin = map_large_scenery_get_origin(
|
||||
{ x, y, z << 3, static_cast<Direction>(direction) }, sequence, &tileElement);
|
||||
auto sceneryOrigin = map_large_scenery_get_origin(signPos, sequence, &tileElement);
|
||||
if (!sceneryOrigin)
|
||||
{
|
||||
return false;
|
||||
@@ -1922,18 +1920,17 @@ bool sign_set_colour(
|
||||
for (tile = sceneryTiles; tile->x_offset != -1; tile++, sequence++)
|
||||
{
|
||||
CoordsXY offsetPos{ tile->x_offset, tile->y_offset };
|
||||
auto rotatedOffsetPos = offsetPos.Rotate(direction);
|
||||
auto rotatedOffsetPos = offsetPos.Rotate(signPos.direction);
|
||||
|
||||
x = sceneryOrigin->x + rotatedOffsetPos.x;
|
||||
y = sceneryOrigin->y + rotatedOffsetPos.y;
|
||||
z = sceneryOrigin->z + tile->z_offset;
|
||||
tileElement = map_get_large_scenery_segment({ x, y, z, static_cast<Direction>(direction) }, sequence);
|
||||
auto tmpSignPos = CoordsXYZD{ sceneryOrigin->x + rotatedOffsetPos.x, sceneryOrigin->y + rotatedOffsetPos.y,
|
||||
sceneryOrigin->z + tile->z_offset, signPos.direction };
|
||||
tileElement = map_get_large_scenery_segment(tmpSignPos, sequence);
|
||||
if (tileElement != nullptr)
|
||||
{
|
||||
tileElement->SetPrimaryColour(mainColour);
|
||||
tileElement->SetSecondaryColour(textColour);
|
||||
|
||||
map_invalidate_tile(x, y, tileElement->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
map_invalidate_tile(tmpSignPos.x, tmpSignPos.y, tileElement->GetBaseZ(), tileElement->GetClearanceZ());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,8 +203,7 @@ bool tile_element_wants_path_connection_towards(TileCoordsXYZD coords, const Til
|
||||
void map_remove_out_of_range_elements();
|
||||
void map_extend_boundary_surface();
|
||||
|
||||
bool sign_set_colour(
|
||||
int32_t x, int32_t y, int32_t z, int32_t direction, int32_t sequence, uint8_t mainColour, uint8_t textColour);
|
||||
bool map_large_scenery_sign_set_colour(const CoordsXYZD& signPos, int32_t sequence, uint8_t mainColour, uint8_t textColour);
|
||||
void wall_remove_at(int32_t x, int32_t y, int32_t z0, int32_t z1);
|
||||
void wall_remove_at_z(int32_t x, int32_t y, int32_t z);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user