mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 23:33:04 +01:00
Move tile invalidation to the action
This commit is contained in:
@@ -240,6 +240,7 @@ GameActions::Result TileModifyAction::QueryExecute(bool isExecuting) const
|
|||||||
|
|
||||||
if (isExecuting)
|
if (isExecuting)
|
||||||
{
|
{
|
||||||
|
MapInvalidateTileFull(_loc);
|
||||||
auto intent = Intent(INTENT_ACTION_TILE_MODIFY);
|
auto intent = Intent(INTENT_ACTION_TILE_MODIFY);
|
||||||
// TODO: add location data to intent.
|
// TODO: add location data to intent.
|
||||||
ContextBroadcastIntent(&intent);
|
ContextBroadcastIntent(&intent);
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
}
|
}
|
||||||
|
|
||||||
TileElementRemove(tileElement);
|
TileElementRemove(tileElement);
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
|
|
||||||
if (IsTileSelected(loc))
|
if (IsTileSelected(loc))
|
||||||
{
|
{
|
||||||
@@ -189,7 +188,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
{
|
{
|
||||||
return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE);
|
return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
|
|
||||||
if (IsTileSelected(loc))
|
if (IsTileSelected(loc))
|
||||||
{
|
{
|
||||||
@@ -277,8 +275,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
case TileElementType::LargeScenery:
|
case TileElementType::LargeScenery:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -298,12 +294,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
bool currentlyInvisible = tileElement->IsInvisible();
|
bool currentlyInvisible = tileElement->IsInvisible();
|
||||||
tileElement->SetInvisible(!currentlyInvisible);
|
tileElement->SetInvisible(!currentlyInvisible);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
if (loc == windowTileInspectorTile.ToCoordsXY())
|
|
||||||
{
|
|
||||||
WindowInvalidateByClass(WindowClass::TileInspector);
|
|
||||||
}
|
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +346,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
pastedElement->SetLastForTile(lastForTile);
|
pastedElement->SetLastForTile(lastForTile);
|
||||||
|
|
||||||
MapAnimationAutoCreateAtTileElement(tileLoc, pastedElement);
|
MapAnimationAutoCreateAtTileElement(tileLoc, pastedElement);
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
|
|
||||||
if (IsTileSelected(loc))
|
if (IsTileSelected(loc))
|
||||||
{
|
{
|
||||||
@@ -418,8 +407,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
|
|
||||||
if (IsTileSelected(loc))
|
if (IsTileSelected(loc))
|
||||||
{
|
{
|
||||||
// Deselect tile for clients who had it selected
|
// Deselect tile for clients who had it selected
|
||||||
@@ -491,8 +478,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
|
|
||||||
tileElement->BaseHeight += heightOffset;
|
tileElement->BaseHeight += heightOffset;
|
||||||
tileElement->ClearanceHeight += heightOffset;
|
tileElement->ClearanceHeight += heightOffset;
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -512,8 +497,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
surfaceelement->SetParkFences(0);
|
surfaceelement->SetParkFences(0);
|
||||||
else
|
else
|
||||||
ParkUpdateFences(loc);
|
ParkUpdateFences(loc);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -560,8 +543,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
}
|
}
|
||||||
|
|
||||||
surfaceElement->SetSlope(newSlope);
|
surfaceElement->SetSlope(newSlope);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -579,8 +560,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
{
|
{
|
||||||
uint8_t newSlope = surfaceElement->GetSlope() ^ TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT;
|
uint8_t newSlope = surfaceElement->GetSlope() ^ TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT;
|
||||||
surfaceElement->SetSlope(newSlope);
|
surfaceElement->SetSlope(newSlope);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -595,8 +574,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
if (isExecuting)
|
if (isExecuting)
|
||||||
{
|
{
|
||||||
pathElement->AsPath()->SetSloped(sloped);
|
pathElement->AsPath()->SetSloped(sloped);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -612,8 +589,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
if (isExecuting)
|
if (isExecuting)
|
||||||
{
|
{
|
||||||
pathElement->AsPath()->SetJunctionRailings(hasJunctionRailings);
|
pathElement->AsPath()->SetJunctionRailings(hasJunctionRailings);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -628,8 +603,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
if (isExecuting)
|
if (isExecuting)
|
||||||
{
|
{
|
||||||
pathElement->AsPath()->SetIsBroken(broken);
|
pathElement->AsPath()->SetIsBroken(broken);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -645,8 +618,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
{
|
{
|
||||||
uint8_t newEdges = pathElement->AsPath()->GetEdgesAndCorners() ^ (1 << edgeIndex);
|
uint8_t newEdges = pathElement->AsPath()->GetEdgesAndCorners() ^ (1 << edgeIndex);
|
||||||
pathElement->AsPath()->SetEdgesAndCorners(newEdges);
|
pathElement->AsPath()->SetEdgesAndCorners(newEdges);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -691,8 +662,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
{
|
{
|
||||||
// Set new slope value
|
// Set new slope value
|
||||||
wallElement->AsWall()->SetSlope(slopeValue);
|
wallElement->AsWall()->SetSlope(slopeValue);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -709,8 +678,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
{
|
{
|
||||||
uint8_t animationFrame = wallElement->AsWall()->GetAnimationFrame();
|
uint8_t animationFrame = wallElement->AsWall()->GetAnimationFrame();
|
||||||
wallElement->AsWall()->SetAnimationFrame(animationFrame + animationFrameOffset);
|
wallElement->AsWall()->SetAnimationFrame(animationFrame + animationFrameOffset);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -772,8 +739,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
// for when you decrease the map size.
|
// for when you decrease the map size.
|
||||||
Guard::Assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5);
|
Guard::Assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5);
|
||||||
|
|
||||||
MapInvalidateTileFull(elem);
|
|
||||||
|
|
||||||
// Keep?
|
// Keep?
|
||||||
// invalidate_test_results(ride);
|
// invalidate_test_results(ride);
|
||||||
|
|
||||||
@@ -851,8 +816,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
// for when you decrease the map size.
|
// for when you decrease the map size.
|
||||||
Guard::Assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5);
|
Guard::Assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5);
|
||||||
|
|
||||||
MapInvalidateTileFull(elem);
|
|
||||||
|
|
||||||
// Keep?
|
// Keep?
|
||||||
// invalidate_test_results(ride);
|
// invalidate_test_results(ride);
|
||||||
|
|
||||||
@@ -875,8 +838,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
if (isExecuting)
|
if (isExecuting)
|
||||||
{
|
{
|
||||||
trackElement->AsTrack()->SetBrakeClosed(isClosed);
|
trackElement->AsTrack()->SetBrakeClosed(isClosed);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -892,8 +853,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
if (isExecuting)
|
if (isExecuting)
|
||||||
{
|
{
|
||||||
trackElement->AsTrack()->SetIsIndestructible(isIndestructible);
|
trackElement->AsTrack()->SetIsIndestructible(isIndestructible);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -913,8 +872,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
|
|
||||||
// Update collision
|
// Update collision
|
||||||
tileElement->SetOccupiedQuadrants(1 << ((quarterIndex + 2) & 3));
|
tileElement->SetOccupiedQuadrants(1 << ((quarterIndex + 2) & 3));
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
@@ -932,8 +889,6 @@ namespace OpenRCT2::TileInspector
|
|||||||
auto occupiedQuadrants = tileElement->GetOccupiedQuadrants();
|
auto occupiedQuadrants = tileElement->GetOccupiedQuadrants();
|
||||||
occupiedQuadrants ^= 1 << quarterIndex;
|
occupiedQuadrants ^= 1 << quarterIndex;
|
||||||
tileElement->SetOccupiedQuadrants(occupiedQuadrants);
|
tileElement->SetOccupiedQuadrants(occupiedQuadrants);
|
||||||
|
|
||||||
MapInvalidateTileFull(loc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
|
|||||||
Reference in New Issue
Block a user