diff --git a/src/openrct2-ui/scripting/ScTileSelection.hpp b/src/openrct2-ui/scripting/ScTileSelection.hpp index bc9b058993..90204844a1 100644 --- a/src/openrct2-ui/scripting/ScTileSelection.hpp +++ b/src/openrct2-ui/scripting/ScTileSelection.hpp @@ -51,7 +51,6 @@ namespace OpenRCT2::Scripting void range_set(DukValue value) { - MapInvalidateSelectionRect(); if (value.type() == DukValue::Type::OBJECT) { auto range = GetMapRange(value); @@ -69,7 +68,6 @@ namespace OpenRCT2::Scripting { gMapSelectFlags.unset(MapSelectFlag::enable); } - MapInvalidateSelectionRect(); } DukValue tiles_get() const @@ -94,7 +92,6 @@ namespace OpenRCT2::Scripting void tiles_set(DukValue value) { - MapInvalidateMapSelectionTiles(); gMapSelectionTiles.clear(); if (value.is_array()) { @@ -124,7 +121,6 @@ namespace OpenRCT2::Scripting { gMapSelectFlags.set(MapSelectFlag::enableConstruct); } - MapInvalidateMapSelectionTiles(); } static void Register(duk_context* ctx) diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 6cddde3b3f..f0d221372c 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -218,7 +218,6 @@ namespace OpenRCT2::Ui::Windows { uint8_t state_changed = 0; - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable); auto mapTile = ScreenGetMapXY(screenPos, nullptr); @@ -275,7 +274,6 @@ namespace OpenRCT2::Ui::Windows state_changed++; } - MapInvalidateSelectionRect(); return state_changed; } @@ -347,7 +345,6 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_BACKGROUND: - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable); gCurrentToolId = Tool::bulldozer; break; diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 18d9c01020..653b727d73 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -166,8 +166,6 @@ namespace OpenRCT2::Ui::Windows void PlaceParkEntranceToolUpdate(const ScreenCoordsXY& screenCoords) { - MapInvalidateSelectionRect(); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enable, MapSelectFlag::enableArrow, MapSelectFlag::enableConstruct); CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); if (parkEntrancePosition.IsNull()) @@ -190,7 +188,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectArrowDirection = parkEntrancePosition.direction; gMapSelectFlags.set(MapSelectFlag::enableConstruct, MapSelectFlag::enableArrow); - MapInvalidateMapSelectionTiles(); if (gParkEntranceGhostExists && parkEntrancePosition == gParkEntranceGhostPosition) { return; diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index fad523809c..488b00cef4 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -254,7 +254,6 @@ namespace OpenRCT2::Ui::Windows { FootpathUpdateProvisional(); ViewportSetVisibility(ViewportVisibility::standard); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); auto* windowMgr = Ui::GetWindowManager(); @@ -345,7 +344,6 @@ namespace OpenRCT2::Ui::Windows _windowFootpathCost = kMoney64Undefined; ToolCancel(); FootpathUpdateProvisional(); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); _footpathConstructionMode = PathConstructionMode::dragArea; ToolSet(*this, WIDX_CONSTRUCT_DRAG_AREA, Tool::pathDown); @@ -370,7 +368,6 @@ namespace OpenRCT2::Ui::Windows _windowFootpathCost = kMoney64Undefined; ToolCancel(); FootpathUpdateProvisional(); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); _footpathConstructionMode = PathConstructionMode::onLand; ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::pathDown); @@ -395,7 +392,6 @@ namespace OpenRCT2::Ui::Windows _windowFootpathCost = kMoney64Undefined; ToolCancel(); FootpathUpdateProvisional(); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); _footpathConstructionMode = PathConstructionMode::bridgeOrTunnelPick; ToolSet(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::crosshair); @@ -670,7 +666,6 @@ namespace OpenRCT2::Ui::Windows { gMapSelectFlags.unset(MapSelectFlag::enableArrow); } - MapInvalidateTileFull(footpathLoc); } } @@ -1040,7 +1035,6 @@ namespace OpenRCT2::Ui::Windows */ void WindowFootpathSetProvisionalPathAtPoint(const ScreenCoordsXY& screenCoords) { - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enableArrow); // Get current map pos and handle key modifier state @@ -1107,7 +1101,6 @@ namespace OpenRCT2::Ui::Windows void WindowFootpathSetProvisionalPathDragArea(MapRange range, int32_t baseZ) { - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enableArrow); // Check for change @@ -1146,7 +1139,6 @@ namespace OpenRCT2::Ui::Windows int32_t direction; TileElement* tileElement; - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable, MapSelectFlag::enableArrow); auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); @@ -1174,8 +1166,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectArrowPosition = CoordsXYZ{ mapCoords, z }; gMapSelectArrowDirection = direction; - - MapInvalidateSelectionRect(); } FootpathPlacementResult WindowFootpathGetPlacementFromScreenCoords(const ScreenCoordsXY& screenCoords) @@ -1602,7 +1592,6 @@ namespace OpenRCT2::Ui::Windows { if (_footpathConstructionMode == PathConstructionMode::bridgeOrTunnel) { - MapInvalidateMapSelectionTiles(); gMapSelectFlags.set(MapSelectFlag::enableConstruct, MapSelectFlag::green); int32_t direction = _footpathConstructDirection; @@ -1610,7 +1599,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectionTiles.push_back( { _footpathConstructFromPosition.x + CoordsDirectionDelta[direction].x, _footpathConstructFromPosition.y + CoordsDirectionDelta[direction].y }); - MapInvalidateMapSelectionTiles(); } uint64_t newPressedWidgets = pressedWidgets @@ -2036,7 +2024,6 @@ namespace OpenRCT2::Ui::Windows _provisionalFootpath.flags.unset(ProvisionalPathFlag::showArrow); gMapSelectFlags.unset(MapSelectFlag::enableArrow); - MapInvalidateTileFull(_footpathConstructFromPosition); } FootpathRemoveProvisional(); } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 90af298993..7b211c5971 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -977,8 +977,6 @@ namespace OpenRCT2::Ui::Windows if (widgetIndex != WIDX_PICKUP) return; - MapInvalidateSelectionRect(); - gMapSelectFlags.unset(MapSelectFlag::enable); auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); @@ -988,7 +986,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectType = MapSelectType::full; gMapSelectPositionA = mapCoords; gMapSelectPositionB = mapCoords; - MapInvalidateSelectionRect(); } gPickupPeepImage = ImageId(); diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 0e2de599f5..9b7cac4c8a 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -444,7 +444,6 @@ namespace OpenRCT2::Ui::Windows { uint8_t state_changed = 0; - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable); auto mapTile = ScreenGetMapXY(screenPos, nullptr); @@ -501,7 +500,6 @@ namespace OpenRCT2::Ui::Windows state_changed++; } - MapInvalidateSelectionRect(); return state_changed; } @@ -582,7 +580,6 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_BACKGROUND: - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable); gCurrentToolId = Tool::digDown; break; @@ -609,8 +606,6 @@ namespace OpenRCT2::Ui::Windows const bool mapCtrlPressed = GetInputManager().isModifierKeyPressed(ModifierKey::ctrl); auto* windowMgr = Ui::GetWindowManager(); - MapInvalidateSelectionRect(); - if (gCurrentToolId == Tool::upDownArrow) { if (!(gMapSelectFlags.has(MapSelectFlag::enable))) @@ -700,7 +695,6 @@ namespace OpenRCT2::Ui::Windows state_changed++; } - MapInvalidateSelectionRect(); if (!state_changed) return; @@ -827,7 +821,6 @@ namespace OpenRCT2::Ui::Windows state_changed++; } - MapInvalidateSelectionRect(); if (!state_changed) return; diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index cfbf37b184..e10b49ac0e 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -459,7 +459,6 @@ namespace OpenRCT2::Ui::Windows void onToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable); auto info = GetMapCoordinatesFromPos( @@ -529,7 +528,6 @@ namespace OpenRCT2::Ui::Windows state_changed++; } - MapInvalidateSelectionRect(); if (!state_changed) return; diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 880f37b405..be4fe99028 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -449,7 +449,6 @@ namespace OpenRCT2::Ui::Windows { int32_t direction; TileElement* tileElement; - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable, MapSelectFlag::enableArrow); auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); if (mapCoords.IsNull()) @@ -470,7 +469,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectPositionB = mapCoords; gMapSelectArrowPosition = CoordsXYZ{ mapCoords, mapZ }; gMapSelectArrowDirection = DirectionReverse(direction); - MapInvalidateSelectionRect(); } void SetPeepSpawnToolDown(const ScreenCoordsXY& screenCoords) diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 4113495335..97b1644907 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -118,7 +118,6 @@ namespace OpenRCT2::Ui::Windows RideConstructionInvalidateCurrentTrack(); ViewportSetVisibility(ViewportVisibility::standard); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); gMapSelectFlags.unset(MapSelectFlag::enableArrow); @@ -344,8 +343,6 @@ namespace OpenRCT2::Ui::Windows { RideConstructionInvalidateCurrentTrack(); - MapInvalidateSelectionRect(); - gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectFlags.unset(MapSelectFlag::enableArrow); diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index dab5a095d4..8c8f88ae61 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -181,15 +181,10 @@ namespace OpenRCT2::Ui::Windows if (stateChanged) { - // Invalidate previous area - MapInvalidateSelectionRect(); - - // Update and invalidate new area gMapSelectFlags.set(MapSelectFlag::enable); gMapSelectType = MapSelectType::full; gMapSelectPositionA = posA; gMapSelectPositionB = posB; - MapInvalidateSelectionRect(); } } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index a405657754..0ae144c313 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -286,7 +286,6 @@ namespace OpenRCT2::Ui::Windows RideConstructionInvalidateCurrentTrack(); ViewportSetVisibility(ViewportVisibility::standard); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); gMapSelectFlags.unset(MapSelectFlag::enableArrow); @@ -2242,7 +2241,6 @@ namespace OpenRCT2::Ui::Windows int32_t trackDirection; CoordsXYZ trackPos{}; - MapInvalidateMapSelectionTiles(); gMapSelectFlags.set(MapSelectFlag::enableConstruct); gMapSelectFlags.set(MapSelectFlag::green); @@ -2274,7 +2272,6 @@ namespace OpenRCT2::Ui::Windows if (GetRide(_currentRideIndex)) { selectMapTiles(trackType, trackDirection, trackPos); - MapInvalidateMapSelectionTiles(); } } @@ -2653,7 +2650,6 @@ namespace OpenRCT2::Ui::Windows void ToolDownEntranceExit(const ScreenCoordsXY& screenCoords) { RideConstructionInvalidateCurrentTrack(); - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectFlags.unset(MapSelectFlag::enableArrow); @@ -3288,7 +3284,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectFlags.unset(MapSelectFlag::enableArrow); if (_currentTrackSelectionFlags.has(TrackSelectionFlag::arrow)) gMapSelectFlags.set(MapSelectFlag::enableArrow); - MapInvalidateTileFull(_currentTrackBegin); break; } case RideConstructionState::Selected: @@ -3338,7 +3333,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectFlags.unset(MapSelectFlag::enableArrow); if (_currentTrackSelectionFlags.has(TrackSelectionFlag::arrow)) gMapSelectFlags.set(MapSelectFlag::enableArrow); - MapInvalidateTileFull(trackPos); break; } default: @@ -3354,7 +3348,6 @@ namespace OpenRCT2::Ui::Windows { int32_t z; - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); gMapSelectFlags.unset(MapSelectFlag::enableArrow); @@ -3362,7 +3355,6 @@ namespace OpenRCT2::Ui::Windows if (!mapCoords) { RideConstructionInvalidateCurrentTrack(); - MapInvalidateMapSelectionTiles(); return; } @@ -3386,7 +3378,6 @@ namespace OpenRCT2::Ui::Windows &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr)) { RideConstructionInvalidateCurrentTrack(); - MapInvalidateMapSelectionTiles(); return; } _currentTrackPieceType = trackType; @@ -3446,7 +3437,6 @@ namespace OpenRCT2::Ui::Windows _currentTrackBegin.z = z; if (_currentTrackSelectionFlags.has(TrackSelectionFlag::track) && _currentTrackBegin == _previousTrackPiece) { - MapInvalidateMapSelectionTiles(); return; } @@ -3475,7 +3465,6 @@ namespace OpenRCT2::Ui::Windows auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); ContextBroadcastIntent(&intent); - MapInvalidateMapSelectionTiles(); return; } @@ -3564,7 +3553,6 @@ namespace OpenRCT2::Ui::Windows } WindowRideConstructionUpdateActiveElements(); - MapInvalidateMapSelectionTiles(); } /** @@ -3573,8 +3561,6 @@ namespace OpenRCT2::Ui::Windows */ void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords) { - MapInvalidateSelectionRect(); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); gMapSelectFlags.unset(MapSelectFlag::enableArrow); @@ -3591,7 +3577,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectPositionB = entranceOrExitCoords; gMapSelectArrowPosition = entranceOrExitCoords; gMapSelectArrowDirection = DirectionReverse(entranceOrExitCoords.direction); - MapInvalidateSelectionRect(); entranceOrExitCoords.direction = DirectionReverse(gRideEntranceExitPlaceDirection); StationIndex stationNum = gRideEntranceExitPlaceStationIndex; @@ -3619,7 +3604,6 @@ namespace OpenRCT2::Ui::Windows WindowBase* w; - MapInvalidateMapSelectionTiles(); RideConstructionInvalidateCurrentTrack(); CoordsXYZ mapCoords{}; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index c3d3892c06..7b834ac7cc 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -1761,8 +1761,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectType = getMapSelectQuarter((quadrant ^ 2)); } - MapInvalidateSelectionRect(); - // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_0) && mapTile == gSceneryGhostPosition && quadrant == _unkF64F0E && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_SMALL @@ -1817,8 +1815,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectPositionB.y = mapTile.y; gMapSelectType = MapSelectType::full; - MapInvalidateSelectionRect(); - // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_1) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z) { @@ -1856,8 +1852,6 @@ namespace OpenRCT2::Ui::Windows setMapSelectRange(mapTile); gMapSelectType = getMapSelectEdge(edge); - MapInvalidateSelectionRect(); - // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_2) && mapTile == gSceneryGhostPosition && edge == gSceneryGhostWallRotation && gSceneryPlaceZ == _unkF64F0A) @@ -1919,7 +1913,6 @@ namespace OpenRCT2::Ui::Windows } gMapSelectFlags.set(MapSelectFlag::enableConstruct); - MapInvalidateMapSelectionTiles(); // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_3) && mapTile == gSceneryGhostPosition && gSceneryPlaceZ == _unkF64F0A @@ -1977,8 +1970,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectPositionB.y = mapTile.y; gMapSelectType = MapSelectType::full; - MapInvalidateSelectionRect(); - // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_4) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z && direction == gSceneryPlaceRotation) @@ -1999,9 +1990,6 @@ namespace OpenRCT2::Ui::Windows */ void onToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenPos) override { - MapInvalidateSelectionRect(); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index d62cfd78f6..450ca15550 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -668,8 +668,6 @@ namespace OpenRCT2::Ui::Windows if (widgetIndex != WIDX_PICKUP) return; - MapInvalidateSelectionRect(); - gMapSelectFlags.unset(MapSelectFlag::enable); auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); @@ -679,7 +677,6 @@ namespace OpenRCT2::Ui::Windows gMapSelectType = MapSelectType::full; gMapSelectPositionA = mapCoords; gMapSelectPositionB = mapCoords; - MapInvalidateSelectionRect(); } gPickupPeepImage = ImageId(); diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 51a12de56c..e79042f0b8 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -969,7 +969,6 @@ static uint64_t PageDisabledWidgets[] = { void onToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - MapInvalidateSelectionRect(); gMapSelectFlags.set(MapSelectFlag::enable); CoordsXY mapCoords; @@ -999,7 +998,6 @@ static uint64_t PageDisabledWidgets[] = { gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectType = MapSelectType::full; - MapInvalidateSelectionRect(); } void onToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index cc08d55099..c194b9bf04 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -121,7 +121,6 @@ namespace OpenRCT2::Ui::Windows { ClearProvisional(); ViewportSetVisibility(ViewportVisibility::standard); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); gMapSelectFlags.unset(MapSelectFlag::enableArrow); HideGridlines(); @@ -172,7 +171,6 @@ namespace OpenRCT2::Ui::Windows { TrackDesignState tds{}; - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); gMapSelectFlags.unset(MapSelectFlag::enableArrow); @@ -256,7 +254,6 @@ namespace OpenRCT2::Ui::Windows void onToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { ClearProvisional(); - MapInvalidateMapSelectionTiles(); gMapSelectFlags.unset(MapSelectFlag::enable); gMapSelectFlags.unset(MapSelectFlag::enableConstruct); gMapSelectFlags.unset(MapSelectFlag::enableArrow); diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index f6f0b320ee..46966210f4 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -248,14 +248,12 @@ namespace OpenRCT2::Ui::Windows auto mapCoords = ScreenPosToMapPos(screenCoords, &direction); if (mapCoords) { - MapInvalidateSelectionRect(); gMapSelectFlags.set(MapSelectFlag::enable); gMapSelectPositionA.x = std::min(_selectionStart.x, mapCoords->x); gMapSelectPositionB.x = std::max(_selectionStart.x, mapCoords->x); gMapSelectPositionA.y = std::min(_selectionStart.y, mapCoords->y); gMapSelectPositionB.y = std::max(_selectionStart.y, mapCoords->y); gMapSelectType = MapSelectType::full; - MapInvalidateSelectionRect(); } } diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index b8af23f4ad..e28ee615e4 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -224,7 +224,6 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_BACKGROUND: - MapInvalidateSelectionRect(); gMapSelectFlags.unset(MapSelectFlag::enable); gCurrentToolId = Tool::waterDown; break; @@ -295,8 +294,6 @@ namespace OpenRCT2::Ui::Windows */ void ToolUpdateWater(const ScreenCoordsXY& screenPos) { - MapInvalidateSelectionRect(); - auto* windowMgr = Ui::GetWindowManager(); auto& gameState = getGameState(); @@ -392,7 +389,6 @@ namespace OpenRCT2::Ui::Windows state_changed++; } - MapInvalidateSelectionRect(); if (!state_changed) return; diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index f69a50ab42..907f4b40e5 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -696,9 +696,6 @@ static constexpr float kWindowScrollLocations[][2] = { { gInputFlags.unset(InputFlag::toolActive); - MapInvalidateSelectionRect(); - MapInvalidateMapSelectionTiles(); - // Reset map selection gMapSelectFlags.clearAll(); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 589a0899d3..8e6925e3ca 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -533,7 +533,6 @@ void RideConstructionInvalidateCurrentTrack() { _currentTrackSelectionFlags.unset(TrackSelectionFlag::arrow); gMapSelectFlags.unset(MapSelectFlag::enableArrow); - MapInvalidateTileFull(_currentTrackBegin); } RideConstructionRemoveGhosts(); break; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index a4efaadd5e..6345f9ba11 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1816,7 +1816,6 @@ static GameActions::Result TrackDesignPlaceVirtual( gMapSelectFlags.set(MapSelectFlag::enableConstruct); gMapSelectFlags.set(MapSelectFlag::enableArrow); gMapSelectFlags.unset(MapSelectFlag::green); - MapInvalidateMapSelectionTiles(); } auto res = GameActions::Result(); diff --git a/src/openrct2/world/MapSelection.cpp b/src/openrct2/world/MapSelection.cpp index fa0138906f..72dc5eea9b 100644 --- a/src/openrct2/world/MapSelection.cpp +++ b/src/openrct2/world/MapSelection.cpp @@ -21,43 +21,6 @@ uint8_t gMapSelectArrowDirection; std::vector gMapSelectionTiles; -/** - * - * rct2: 0x0068AB1B - */ -void MapInvalidateMapSelectionTiles() -{ - if (!(gMapSelectFlags.has(MapSelectFlag::enableConstruct))) - return; - - for (const auto& position : gMapSelectionTiles) - MapInvalidateTileFull(position); -} - -/** - * - * rct2: 0x0068AAE1 - */ -void MapInvalidateSelectionRect() -{ - int32_t x0, y0, x1, y1, left, right, top, bottom; - - if (!(gMapSelectFlags.has(MapSelectFlag::enable))) - return; - - x0 = gMapSelectPositionA.x + 16; - y0 = gMapSelectPositionA.y + 16; - x1 = gMapSelectPositionB.x + 16; - y1 = gMapSelectPositionB.y + 16; - MapGetBoundingBox({ x0, y0, x1, y1 }, &left, &top, &right, &bottom); - left -= 32; - right += 32; - bottom += 32; - top -= 32 + 2080; - - OpenRCT2::ViewportsInvalidate({ { left, top }, { right, bottom } }); -} - MapRange getMapSelectRange() { return MapRange(gMapSelectPositionA, gMapSelectPositionB); diff --git a/src/openrct2/world/MapSelection.h b/src/openrct2/world/MapSelection.h index 8899b8c76c..f266d235ff 100644 --- a/src/openrct2/world/MapSelection.h +++ b/src/openrct2/world/MapSelection.h @@ -63,8 +63,6 @@ extern uint8_t gMapSelectArrowDirection; extern std::vector gMapSelectionTiles; -void MapInvalidateMapSelectionTiles(); -void MapInvalidateSelectionRect(); MapRange getMapSelectRange(); void setMapSelectRange(const MapRange& range); void setMapSelectRange(const CoordsXY coords);