diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 76936fbcd5..8ef18bbc30 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -520,7 +520,7 @@ static void ShortcutToggleVisibility() return; extern TileCoordsXY windowTileInspectorTile; - TileElement* tileElement = map_get_nth_element_at(windowTileInspectorTile.ToCoordsXY(), windowTileInspectorSelectedIndex); + TileElement* tileElement = MapGetNthElementAt(windowTileInspectorTile.ToCoordsXY(), windowTileInspectorSelectedIndex); if (tileElement != nullptr) { tileElement->SetInvisible(!tileElement->IsInvisible()); diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 610fd3aba7..8fdd2296e9 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -622,7 +622,7 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co if (w != nullptr) FootpathProvisionalUpdate(); - tileElement2 = map_get_first_element_at(mapCoords); + tileElement2 = MapGetFirstElementAt(mapCoords); if (tileElement2 == nullptr) return; do diff --git a/src/openrct2-ui/scripting/CustomMenu.cpp b/src/openrct2-ui/scripting/CustomMenu.cpp index b95d2eea3b..3351f5d79b 100644 --- a/src/openrct2-ui/scripting/CustomMenu.cpp +++ b/src/openrct2-ui/scripting/CustomMenu.cpp @@ -199,7 +199,7 @@ namespace OpenRCT2::Scripting else if (info.Element != nullptr) { int32_t index = 0; - auto el = map_get_first_element_at(info.Loc); + auto el = MapGetFirstElementAt(info.Loc); if (el != nullptr) { do diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index f671d73a36..13417b93c6 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -100,7 +100,7 @@ private: return nullptr; } - TileElement* tileElement = map_get_first_element_at(banner->position); + TileElement* tileElement = MapGetFirstElementAt(banner->position); if (tileElement == nullptr) { return nullptr; diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 9f508c216b..4bb3c8b880 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1123,7 +1123,7 @@ private: z = std::min(255 * COORDS_Z_STEP, gFootpathConstructFromPosition.z); zLow = z - PATH_HEIGHT_STEP; - tileElement = map_get_first_element_at(gFootpathConstructFromPosition); + tileElement = MapGetFirstElementAt(gFootpathConstructFromPosition); do { if (tileElement == nullptr) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b789d42a0e..d11dce0195 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -458,7 +458,7 @@ public: if (parkEntranceMapPosition.IsNull()) return parkEntranceMapPosition; - auto surfaceElement = map_get_surface_element_at(mapCoords); + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); if (surfaceElement == nullptr) { parkEntranceMapPosition.SetNull(); @@ -1066,7 +1066,7 @@ private: uint16_t GetPixelColourPeep(const CoordsXY& c) { - auto* surfaceElement = map_get_surface_element_at(c); + auto* surfaceElement = MapGetSurfaceElementAt(c); if (surfaceElement == nullptr) return 0; @@ -1109,7 +1109,7 @@ private: uint16_t colourB = MapColour(PALETTE_INDEX_13); // surface colour (dark grey) // as an improvement we could use first_element to show underground stuff? - TileElement* tileElement = reinterpret_cast(map_get_surface_element_at(c)); + TileElement* tileElement = reinterpret_cast(MapGetSurfaceElementAt(c)); do { if (tileElement == nullptr) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 3ba8acfa61..9f88598f4e 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2673,16 +2673,16 @@ private: auto southTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_SOUTH]; // Replace map elements with temporary ones containing track - backupTileElementArrays[0] = map_get_first_element_at(centreTileCoords); - backupTileElementArrays[1] = map_get_first_element_at(eastTileCoords); - backupTileElementArrays[2] = map_get_first_element_at(westTileCoords); - backupTileElementArrays[3] = map_get_first_element_at(northTileCoords); - backupTileElementArrays[4] = map_get_first_element_at(southTileCoords); - map_set_tile_element(centreTileCoords, &tempTrackTileElement); - map_set_tile_element(eastTileCoords, &tempSideTrackTileElement); - map_set_tile_element(westTileCoords, &tempSideTrackTileElement); - map_set_tile_element(northTileCoords, &tempSideTrackTileElement); - map_set_tile_element(southTileCoords, &tempSideTrackTileElement); + backupTileElementArrays[0] = MapGetFirstElementAt(centreTileCoords); + backupTileElementArrays[1] = MapGetFirstElementAt(eastTileCoords); + backupTileElementArrays[2] = MapGetFirstElementAt(westTileCoords); + backupTileElementArrays[3] = MapGetFirstElementAt(northTileCoords); + backupTileElementArrays[4] = MapGetFirstElementAt(southTileCoords); + MapSetTileElement(centreTileCoords, &tempTrackTileElement); + MapSetTileElement(eastTileCoords, &tempSideTrackTileElement); + MapSetTileElement(westTileCoords, &tempSideTrackTileElement); + MapSetTileElement(northTileCoords, &tempSideTrackTileElement); + MapSetTileElement(southTileCoords, &tempSideTrackTileElement); // Set the temporary track element tempTrackTileElement.SetOccupiedQuadrants(quarterTile.GetBaseQuarterOccupied()); @@ -2694,11 +2694,11 @@ private: TileElementPaintSetup(*session, coords, true); // Restore map elements - map_set_tile_element(centreTileCoords, backupTileElementArrays[0]); - map_set_tile_element(eastTileCoords, backupTileElementArrays[1]); - map_set_tile_element(westTileCoords, backupTileElementArrays[2]); - map_set_tile_element(northTileCoords, backupTileElementArrays[3]); - map_set_tile_element(southTileCoords, backupTileElementArrays[4]); + MapSetTileElement(centreTileCoords, backupTileElementArrays[0]); + MapSetTileElement(eastTileCoords, backupTileElementArrays[1]); + MapSetTileElement(westTileCoords, backupTileElementArrays[2]); + MapSetTileElement(northTileCoords, backupTileElementArrays[3]); + MapSetTileElement(southTileCoords, backupTileElementArrays[4]); trackBlock++; } @@ -2982,7 +2982,7 @@ static std::optional RideGetPlacePositionFromScreenPosition(ScreenCoor _trackPlaceZ = 0; if (_trackPlaceShiftState) { - auto surfaceElement = map_get_surface_element_at(mapCoords); + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); if (surfaceElement == nullptr) return std::nullopt; auto mapZ = floor2(surfaceElement->GetBaseZ(), 16); diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 0f73ae6c51..43b1f036c7 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -428,7 +428,7 @@ public: } else { // small scenery - gCurrentToolId = static_cast(get_small_scenery_entry(tabSelectedScenery.EntryIndex)->tool_id); + gCurrentToolId = static_cast(GetSmallSceneryEntry(tabSelectedScenery.EntryIndex)->tool_id); } } } @@ -530,7 +530,7 @@ public: widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; } - auto* sceneryEntry = get_small_scenery_entry(tabSelectedScenery.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(tabSelectedScenery.EntryIndex); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) { widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; @@ -601,7 +601,7 @@ public: } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) { - auto* sceneryEntry = get_small_scenery_entry(tabSelectedScenery.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(tabSelectedScenery.EntryIndex); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) { @@ -775,7 +775,7 @@ public: // small scenery for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_SMALL_SCENERY_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_small_scenery_entry(sceneryId); + const auto* sceneryEntry = GetSmallSceneryEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_SMALL, sceneryId }, sceneryEntry->scenery_tab_id); @@ -1121,7 +1121,7 @@ private: { case SCENERY_TYPE_SMALL: { - auto* sceneryEntry = get_small_scenery_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1254,7 +1254,7 @@ private: } else { - auto sceneryEntry = get_small_scenery_entry(scenerySelection.EntryIndex); + auto sceneryEntry = GetSmallSceneryEntry(scenerySelection.EntryIndex); auto imageId = ImageId(sceneryEntry->image + gWindowSceneryRotation); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) { diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index ca8d1a14cc..cba0dd1e23 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1551,7 +1551,7 @@ public: int32_t i = 0; char buffer[256]; - const TileElement* tileElement = map_get_first_element_at(_toolMap); + const TileElement* tileElement = MapGetFirstElementAt(_toolMap); do { @@ -1775,7 +1775,7 @@ private: windowTileInspectorSelectedIndex = -1; scrolls[0].v_top = 0; - TileElement* element = map_get_first_element_at(_toolMap); + TileElement* element = MapGetFirstElementAt(_toolMap); int16_t numItems = 0; do { @@ -1967,7 +1967,7 @@ private: openrct2_assert( windowTileInspectorSelectedIndex >= 0 && windowTileInspectorSelectedIndex < windowTileInspectorElementCount, "Selected list item out of range"); - return map_get_first_element_at(_toolMap) + windowTileInspectorSelectedIndex; + return MapGetFirstElementAt(_toolMap) + windowTileInspectorSelectedIndex; } void OnPrepareDraw() override diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 06523811dd..b3e3593155 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1103,7 +1103,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd { SmallSceneryElement* sceneryElement = info.Element->AsSmallScenery(); auto entryIndex = sceneryElement->GetEntryIndex(); - auto* sceneryEntry = get_small_scenery_entry(entryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(entryIndex); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1256,7 +1256,7 @@ static void Sub6E1F34SmallScenery( uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); bool can_raise_item = false; - const auto* sceneryEntry = get_small_scenery_entry(sceneryIndex); + const auto* sceneryEntry = GetSmallSceneryEntry(sceneryIndex); if (sceneryEntry == nullptr) { gridPos.SetNull(); @@ -1292,7 +1292,7 @@ static void Sub6E1F34SmallScenery( // If SHIFT pressed if (gSceneryShiftPressed) { - auto* surfaceElement = map_get_surface_element_at(gridPos); + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1375,7 +1375,7 @@ static void Sub6E1F34SmallScenery( // If SHIFT pressed if (gSceneryShiftPressed) { - auto surfaceElement = map_get_surface_element_at(gridPos); + auto surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1510,7 +1510,7 @@ static void Sub6E1F34Wall( // If SHIFT pressed if (gSceneryShiftPressed) { - auto* surfaceElement = map_get_surface_element_at(gridPos); + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1601,7 +1601,7 @@ static void Sub6E1F34LargeScenery( // If SHIFT pressed if (gSceneryShiftPressed) { - auto* surfaceElement = map_get_surface_element_at(gridPos); + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1768,7 +1768,7 @@ static void WindowTopToolbarSceneryToolDown(const ScreenCoordsXY& windowPos, rct for (int32_t q = 0; q < quantity; q++) { int32_t zCoordinate = gSceneryPlaceZ; - auto* sceneryEntry = get_small_scenery_entry(selectedScenery); + auto* sceneryEntry = GetSmallSceneryEntry(selectedScenery); int16_t cur_grid_x = gridPos.x; int16_t cur_grid_y = gridPos.y; @@ -2671,7 +2671,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) gMapSelectPositionB.y = mapTile.y; } - auto* sceneryEntry = get_small_scenery_entry(selection.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(selection.EntryIndex); gMapSelectType = MAP_SELECT_TYPE_FULL; if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index c3300a8efd..19aaeb1d32 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -402,7 +402,7 @@ private: int32_t GetBaseZ(const CoordsXY& loc) { - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) return 0; diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 764d2d680a..6c03bf0d01 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -413,7 +413,7 @@ void game_fix_save_vars() { for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - auto* surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto* surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) { diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index c07bf704c3..7e0c79fffe 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -63,7 +63,7 @@ void GameState::InitAll(const TileCoordsXY& mapSize) gInMapInitCode = true; gCurrentTicks = 0; - map_init(mapSize); + MapInit(mapSize); _park->Initialise(); finance_init(); BannerInit(); diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 3e2628dea9..f70e3eaf1f 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -79,7 +79,7 @@ GameActions::Result BannerPlaceAction::Query() const } auto baseHeight = _loc.z + PATH_HEIGHT_STEP; - BannerElement* existingBannerElement = map_get_banner_element_at({ _loc.x, _loc.y, baseHeight }, _loc.direction); + BannerElement* existingBannerElement = MapGetBannerElementAt({ _loc.x, _loc.y, baseHeight }, _loc.direction); if (existingBannerElement != nullptr) { return GameActions::Result( diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 56a60f91d6..a6445a2bd4 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -75,7 +75,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - auto bannerElement = map_get_banner_element_at(_loc, _loc.direction); + auto bannerElement = MapGetBannerElementAt(_loc, _loc.direction); if (bannerElement == nullptr) { diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index c73479cb6e..047e9808cf 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -116,7 +116,7 @@ money32 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin do { tileEdited = false; - tileElement = map_get_first_element_at(tilePos); + tileElement = MapGetFirstElementAt(tilePos); if (tileElement == nullptr) return totalCost; do @@ -211,7 +211,7 @@ void ClearAction::ResetClearLargeSceneryFlag() { for (int32_t x = 0; x < gMapSize.x; x++) { - auto tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + auto tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); do { if (tileElement == nullptr) diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index b812b6b80c..a1ee0aae52 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -135,10 +135,10 @@ GameActions::Result FootpathPlaceAction::Execute() const // It is possible, let's remove walls between the old and new piece of path auto zLow = _loc.z; auto zHigh = zLow + PATH_CLEARANCE; - wall_remove_intersecting_walls( + WallRemoveIntersectingWalls( { _loc, zLow, zHigh + ((_slope & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) ? 16 : 0) }, DirectionReverse(_direction)); - wall_remove_intersecting_walls( + WallRemoveIntersectingWalls( { _loc.x - CoordsDirectionDelta[_direction].x, _loc.y - CoordsDirectionDelta[_direction].y, zLow, zHigh }, _direction); } @@ -318,7 +318,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); @@ -381,7 +381,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul const auto clearanceData = canBuild.GetData(); gFootpathGroundFlags = clearanceData.GroundFlags; - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); @@ -489,8 +489,8 @@ void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) cons { auto direction = pathElement->GetSlopeDirection(); int32_t z = pathElement->GetBaseZ(); - wall_remove_intersecting_walls({ _loc, z, z + (6 * COORDS_Z_STEP) }, DirectionReverse(direction)); - wall_remove_intersecting_walls({ _loc, z, z + (6 * COORDS_Z_STEP) }, direction); + WallRemoveIntersectingWalls({ _loc, z, z + (6 * COORDS_Z_STEP) }, DirectionReverse(direction)); + WallRemoveIntersectingWalls({ _loc, z, z + (6 * COORDS_Z_STEP) }, direction); // Removing walls may have made the pointer invalid, so find it again auto tileElement = MapGetFootpathElement(CoordsXYZ(_loc, z)); if (tileElement == nullptr) diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index d4f7dedf12..4cb05966ff 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -160,7 +160,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertQuery(GameActions GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result( @@ -224,7 +224,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertExecute(GameActio const auto clearanceData = canBuild.GetData(); gFootpathGroundFlags = clearanceData.GroundFlags; - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result( diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index e6fcc32223..001779f3aa 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -95,7 +95,7 @@ GameActions::Result LandBuyRightsAction::QueryExecute(bool isExecuting) const } if (isExecuting) { - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); } return res; } @@ -108,7 +108,7 @@ GameActions::Result LandBuyRightsAction::map_buy_land_rights_for_tile(const Coor return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } - SurfaceElement* surfaceElement = map_get_surface_element_at(loc); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { log_error("Could not find surface. x = %d, y = %d", loc.x, loc.y); diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 3781cee0bd..2dc5690670 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -81,7 +81,7 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const { if (!LocationValid({ x, y })) continue; - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 21ad54fd94..8d50c08627 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -82,7 +82,7 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const { if (!LocationValid({ x, y })) continue; - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 2286941b7c..a965ebcc01 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -93,7 +93,7 @@ GameActions::Result LandSetHeightAction::Query() const } } - auto* surfaceElement = map_get_surface_element_at(_coords); + auto* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -149,12 +149,12 @@ GameActions::Result LandSetHeightAction::Execute() const if (!gCheatsDisableClearanceChecks) { - wall_remove_at({ _coords, _height * 8 - 16, _height * 8 + 32 }); + WallRemoveAt({ _coords, _height * 8 - 16, _height * 8 + 32 }); cost += GetSmallSceneryRemovalCost(); SmallSceneryRemoval(); } - auto* surfaceElement = map_get_surface_element_at(_coords); + auto* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -246,7 +246,7 @@ money32 LandSetHeightAction::GetSmallSceneryRemovalCost() const void LandSetHeightAction::SmallSceneryRemoval() const { - TileElement* tileElement = map_get_first_element_at(_coords); + TileElement* tileElement = MapGetFirstElementAt(_coords); do { if (tileElement == nullptr) diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 8cc8b2dbfc..cd5d86365c 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -97,7 +97,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const if (isExecuting) { - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, centre); } return res; @@ -105,7 +105,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const { - SurfaceElement* surfaceElement = map_get_surface_element_at(loc); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { log_error("Could not find surface. x = %d, y = %d", loc.x, loc.y); diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 0cfcc36d89..04cabecc17 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -99,8 +99,8 @@ money32 LandSmoothAction::SmoothLandRowByEdge( { return 0; } - auto surfaceElement = map_get_surface_element_at(loc); - auto nextSurfaceElement = map_get_surface_element_at(CoordsXY{ loc.x + stepX, loc.y + stepY }); + auto surfaceElement = MapGetSurfaceElementAt(loc); + auto nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ loc.x + stepX, loc.y + stepY }); if (surfaceElement == nullptr || nextSurfaceElement == nullptr) { return 0; @@ -138,7 +138,7 @@ money32 LandSmoothAction::SmoothLandRowByEdge( else { surfaceElement = nextSurfaceElement; - nextSurfaceElement = map_get_surface_element_at(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); + nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); if (nextSurfaceElement == nullptr) { shouldContinue &= ~0x3; @@ -251,8 +251,8 @@ money32 LandSmoothAction::SmoothLandRowByCorner( { return 0; } - auto surfaceElement = map_get_surface_element_at(loc); - auto nextSurfaceElement = map_get_surface_element_at(CoordsXY{ loc.x + stepX, loc.y + stepY }); + auto surfaceElement = MapGetSurfaceElementAt(loc); + auto nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ loc.x + stepX, loc.y + stepY }); if (surfaceElement == nullptr || nextSurfaceElement == nullptr) { return 0; @@ -281,7 +281,7 @@ money32 LandSmoothAction::SmoothLandRowByCorner( else { surfaceElement = nextSurfaceElement; - nextSurfaceElement = map_get_surface_element_at(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); + nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); if (nextSurfaceElement == nullptr) { shouldContinue = false; @@ -347,7 +347,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const // Smooth the 4 corners { // top-left - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( @@ -357,7 +357,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const } } { // bottom-left - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetBottom() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetBottom() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( @@ -367,7 +367,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const } } { // bottom-right - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetRight(), validRange.GetBottom() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetBottom() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( @@ -377,7 +377,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const } } { // top-right - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetRight(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetTop() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( @@ -391,7 +391,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const int32_t z1, z2; for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += COORDS_XY_STEP) { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), y }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -401,7 +401,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const res.Cost += SmoothLandRowByEdge(isExecuting, { validRange.GetLeft(), y }, z1, z2, -32, 0, 0, 1, 3, 2); } - surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetRight(), y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), y }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -414,7 +414,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += COORDS_XY_STEP) { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetTop() }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -424,7 +424,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const res.Cost += SmoothLandRowByEdge(isExecuting, { x, validRange.GetTop() }, z1, z2, 0, -32, 0, 3, 1, 2); } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, validRange.GetBottom() }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetBottom() }); if (surfaceElement != nullptr) { z1 = std::clamp( @@ -441,7 +441,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const case MAP_SELECT_TYPE_CORNER_2: case MAP_SELECT_TYPE_CORNER_3: { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement == nullptr) break; uint8_t newBaseZ = surfaceElement->base_height; @@ -537,7 +537,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const { // TODO: Handle smoothing by edge // Get the two corners to raise - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement == nullptr) break; uint8_t newBaseZ = surfaceElement->base_height; diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index ab89a2448d..b88d8f88e2 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -277,7 +277,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const FootpathRemoveLitter({ curTile, zLow }); if (!gCheatsDisableClearanceChecks) { - wall_remove_at({ curTile, zLow, zHigh }); + WallRemoveAt({ curTile, zLow, zHigh }); } } @@ -351,7 +351,7 @@ int16_t LargeSceneryPlaceAction::GetMaxSurfaceHeight(rct_large_scenery_tile* til continue; } - auto* surfaceElement = map_get_surface_element_at(curTile); + auto* surfaceElement = MapGetSurfaceElementAt(curTile); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 37a8047e3c..fdf1f04945 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -63,7 +63,7 @@ GameActions::Result MazePlaceTrackAction::Query() const res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED; return res; } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { res.Error = GameActions::Status::Unknown; @@ -145,7 +145,7 @@ GameActions::Result MazePlaceTrackAction::Execute() const if (!(flags & GAME_COMMAND_FLAG_GHOST)) { FootpathRemoveLitter(_loc); - wall_remove_at({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); + WallRemoveAt({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); } auto baseHeight = _loc.z; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index a6528c46dc..1827a24fb2 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -74,7 +74,7 @@ GameActions::Result MazeSetTrackAction::Query() const res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED; return res; } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { res.Error = GameActions::Status::Unknown; @@ -167,7 +167,7 @@ GameActions::Result MazeSetTrackAction::Execute() const if (!(flags & GAME_COMMAND_FLAG_GHOST)) { FootpathRemoveLitter(_loc); - wall_remove_at({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); + WallRemoveAt({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); } auto tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex); diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index dece2c0878..d6e88a989a 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -131,7 +131,7 @@ GameActions::Result PlaceParkEntranceAction::Execute() const if (!(flags & GAME_COMMAND_FLAG_GHOST)) { - SurfaceElement* surfaceElement = map_get_surface_element_at(entranceLoc); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(entranceLoc); if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); diff --git a/src/openrct2/actions/PlacePeepSpawnAction.cpp b/src/openrct2/actions/PlacePeepSpawnAction.cpp index a69627b1b8..5ea989e475 100644 --- a/src/openrct2/actions/PlacePeepSpawnAction.cpp +++ b/src/openrct2/actions/PlacePeepSpawnAction.cpp @@ -63,7 +63,7 @@ GameActions::Result PlacePeepSpawnAction::Query() const } // Verify location is unowned - auto surfaceMapElement = map_get_surface_element_at(_location); + auto surfaceMapElement = MapGetSurfaceElementAt(_location); if (surfaceMapElement == nullptr) { return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 244b95bc7e..8cfb2a6be2 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -206,7 +206,7 @@ money32 RideDemolishAction::DemolishTracks() const while (!lastForTileReached) { offset++; - auto* tileElement = map_get_first_element_at(tileCoords) + offset; + auto* tileElement = MapGetFirstElementAt(tileCoords) + offset; if (tileElement == nullptr) break; diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 3469d13409..92450ad7bc 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -165,7 +165,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { FootpathRemoveLitter({ _loc, z }); - wall_remove_at_z({ _loc, z }); + WallRemoveAtZ({ _loc, z }); } auto clear_z = z + (_isExit ? RideExitHeight : RideEntranceHeight); diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index ce2c1cee2f..395fc453bb 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -361,7 +361,7 @@ void SetCheatAction::SetGrassLength(int32_t length) const { for (int32_t x = 0; x < gMapSize.x; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) continue; @@ -690,7 +690,7 @@ void SetCheatAction::OwnAllLand() const { for (coords.x = min.x; coords.x <= max.x; coords.x += COORDS_XY_STEP) { - auto* surfaceElement = map_get_surface_element_at(coords); + auto* surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) continue; @@ -714,7 +714,7 @@ void SetCheatAction::OwnAllLand() const // Completely unown peep spawn points for (const auto& spawn : gPeepSpawns) { - auto* surfaceElement = map_get_surface_element_at(spawn); + auto* surfaceElement = MapGetSurfaceElementAt(spawn); if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); @@ -724,7 +724,7 @@ void SetCheatAction::OwnAllLand() const } } - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); } void SetCheatAction::ParkSetOpen(bool isOpen) const diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 3eb5ef3bbc..23ddf93140 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -111,7 +111,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } - auto* sceneryEntry = get_small_scenery_entry(_sceneryType); + auto* sceneryEntry = GetSmallSceneryEntry(_sceneryType); if (sceneryEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -164,7 +164,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement != nullptr && !gCheatsDisableClearanceChecks && surfaceElement->GetWaterHeight() > 0) { @@ -303,7 +303,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const res.Position.z = surfaceHeight; } - auto* sceneryEntry = get_small_scenery_entry(_sceneryType); + auto* sceneryEntry = GetSmallSceneryEntry(_sceneryType); if (sceneryEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -353,7 +353,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const FootpathRemoveLitter({ _loc, targetHeight }); if (!gCheatsDisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS))) { - wall_remove_at({ _loc, targetHeight, targetHeight + sceneryEntry->height }); + WallRemoveAt({ _loc, targetHeight, targetHeight + sceneryEntry->height }); } } diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index 33e5922cce..fe3d38021f 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -61,7 +61,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - auto* entry = get_small_scenery_entry(_sceneryType); + auto* entry = GetSmallSceneryEntry(_sceneryType); if (entry == nullptr) { return GameActions::Result( @@ -110,7 +110,7 @@ GameActions::Result SmallSceneryRemoveAction::Execute() const { GameActions::Result res = GameActions::Result(); - auto* entry = get_small_scenery_entry(_sceneryType); + auto* entry = GetSmallSceneryEntry(_sceneryType); if (entry == nullptr) { return GameActions::Result( diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 909a0c04ba..7434731f5d 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -108,7 +108,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const continue; } - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) { continue; @@ -176,7 +176,7 @@ GameActions::Result SurfaceSetStyleAction::Execute() const continue; } - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) { continue; diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 45f85a6d19..7f2322971b 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -307,7 +307,7 @@ GameActions::Result TrackPlaceAction::Query() const if ((rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) && !_trackDesignDrawingPreview) { - auto surfaceElement = map_get_surface_element_at(mapLoc); + auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { return GameActions::Result( @@ -355,7 +355,7 @@ GameActions::Result TrackPlaceAction::Query() const } // 6c5648 12 push - auto surfaceElement = map_get_surface_element_at(mapLoc); + auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); @@ -481,7 +481,7 @@ GameActions::Result TrackPlaceAction::Execute() const FootpathRemoveLitter(mapLoc); if (rideTypeFlags & RIDE_TYPE_FLAG_TRACK_NO_WALLS) { - wall_remove_at(mapLocWithClearance); + WallRemoveAt(mapLocWithClearance); } else { @@ -493,7 +493,7 @@ GameActions::Result TrackPlaceAction::Execute() const { if (intersectingDirections & (1 << i)) { - wall_remove_intersecting_walls(mapLocWithClearance, i); + WallRemoveIntersectingWalls(mapLocWithClearance, i); } } } @@ -511,7 +511,7 @@ GameActions::Result TrackPlaceAction::Execute() const resultData.GroundFlags = mapGroundFlags; // 6c5648 12 push - auto surfaceElement = map_get_surface_element_at(mapLoc); + auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); @@ -663,7 +663,7 @@ GameActions::Result TrackPlaceAction::Execute() const tempLoc.x += CoordsDirectionDelta[tempDirection].x; tempLoc.y += CoordsDirectionDelta[tempDirection].y; tempDirection = DirectionReverse(tempDirection); - wall_remove_intersecting_walls({ tempLoc, baseZ, clearanceZ }, tempDirection & 3); + WallRemoveIntersectingWalls({ tempLoc, baseZ, clearanceZ }, tempDirection & 3); } } } @@ -686,7 +686,7 @@ GameActions::Result TrackPlaceAction::Execute() const if (rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) { - auto* waterSurfaceElement = map_get_surface_element_at(mapLoc); + auto* waterSurfaceElement = MapGetSurfaceElementAt(mapLoc); if (waterSurfaceElement != nullptr) { waterSurfaceElement->SetHasTrackThatNeedsWater(true); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 1bc1e019e6..e19bb8c253 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -68,7 +68,7 @@ GameActions::Result TrackRemoveAction::Query() const bool found = false; bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; - TileElement* tileElement = map_get_first_element_at(_origin); + TileElement* tileElement = MapGetFirstElementAt(_origin); do { @@ -167,7 +167,7 @@ GameActions::Result TrackRemoveAction::Query() const map_invalidate_tile_full(mapLoc); found = false; - tileElement = map_get_first_element_at(mapLoc); + tileElement = MapGetFirstElementAt(mapLoc); do { if (tileElement == nullptr) @@ -214,7 +214,7 @@ GameActions::Result TrackRemoveAction::Query() const } } - auto* surfaceElement = map_get_surface_element_at(mapLoc); + auto* surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); @@ -264,7 +264,7 @@ GameActions::Result TrackRemoveAction::Execute() const bool found = false; bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; - TileElement* tileElement = map_get_first_element_at(_origin); + TileElement* tileElement = MapGetFirstElementAt(_origin); do { @@ -346,7 +346,7 @@ GameActions::Result TrackRemoveAction::Execute() const map_invalidate_tile_full(mapLoc); found = false; - tileElement = map_get_first_element_at(mapLoc); + tileElement = MapGetFirstElementAt(mapLoc); do { if (tileElement == nullptr) @@ -393,7 +393,7 @@ GameActions::Result TrackRemoveAction::Execute() const } } - auto* surfaceElement = map_get_surface_element_at(mapLoc); + auto* surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 1497d24167..2b093a764c 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -108,7 +108,7 @@ GameActions::Result WallPlaceAction::Query() const auto targetHeight = _loc.z; if (targetHeight == 0) { - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -125,7 +125,7 @@ GameActions::Result WallPlaceAction::Query() const } } - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -287,7 +287,7 @@ GameActions::Result WallPlaceAction::Execute() const auto targetHeight = _loc.z; if (targetHeight == 0) { - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -501,7 +501,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - TileElement* tileElement = map_get_first_element_at(_loc); + TileElement* tileElement = MapGetFirstElementAt(_loc); do { if (tileElement == nullptr) diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index 35fce61f97..2aed4cdb3c 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -67,7 +67,7 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const if (!LocationValid({ x, y })) continue; - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; @@ -138,7 +138,7 @@ uint8_t WaterLowerAction::GetLowestHeight(const MapRange& validRange) const } } - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 8b5a3bbe11..54dcfc5288 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -67,7 +67,7 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const if (!LocationValid({ x, y })) continue; - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; @@ -144,7 +144,7 @@ uint16_t WaterRaiseAction::GetHighestHeight(const MapRange& validRange) const } } - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index b7d636544c..52237d21a7 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -64,7 +64,7 @@ GameActions::Result WaterSetHeightAction::Query() const } } - SurfaceElement* surfaceElement = map_get_surface_element_at(_coords); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) { log_error("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); @@ -107,9 +107,9 @@ GameActions::Result WaterSetHeightAction::Execute() const int32_t surfaceHeight = tile_element_height(_coords); FootpathRemoveLitter({ _coords, surfaceHeight }); if (!gCheatsDisableClearanceChecks) - wall_remove_at_z({ _coords, surfaceHeight }); + WallRemoveAtZ({ _coords, surfaceHeight }); - SurfaceElement* surfaceElement = map_get_surface_element_at(_coords); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) { log_error("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 645946fdbc..0eafb44791 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -163,7 +163,7 @@ namespace OpenRCT2::Audio params.volume = 0; params.pan = 0; - auto element = map_get_surface_element_at(location); + auto element = MapGetSurfaceElementAt(location); if (element != nullptr && (element->GetBaseZ()) - 5 > location.z) { volumeDown = 10; diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index 097a82ceb8..d489fdace4 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -103,7 +103,7 @@ void Duck::UpdateFlyToWater() auto destination = CoordsXYZ{ CoordsXY{ x, y } + DuckMoveOffset[direction], 0 }; int32_t manhattanDistanceN = abs(target_x - destination.x) + abs(target_y - destination.y); - auto surfaceElement = map_get_surface_element_at(CoordsXY{ target_x, target_y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ target_x, target_y }); int32_t waterHeight = surfaceElement != nullptr ? surfaceElement->GetWaterHeight() : 0; if (waterHeight == 0) { diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index c0f785a675..3296e8f4d9 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -250,7 +250,7 @@ bool JumpingFountain::IsJumpingFountain(const JumpingFountainType newType, const const int32_t pathBitFlagMask = newType == JumpingFountainType::Snow ? PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW : PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER; - TileElement* tileElement = map_get_first_element_at(newLoc); + TileElement* tileElement = MapGetFirstElementAt(newLoc); if (tileElement == nullptr) return false; do diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 9411da9991..109ed2eaf3 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -4872,7 +4872,7 @@ void Guest::UpdateRideMazePathfinding() }; maze_type mazeType = maze_type::invalid; - auto tileElement = map_get_first_element_at(targetLoc); + auto tileElement = MapGetFirstElementAt(targetLoc); if (tileElement == nullptr) return; do @@ -4967,7 +4967,7 @@ void Guest::UpdateRideLeaveExit() // Find the station track element for (auto* pathElement : TileElementsView(targetLoc)) { - int16_t height = map_height_from_slope(targetLoc, pathElement->GetSlopeDirection(), pathElement->IsSloped()); + int16_t height = MapHeightFromSlope(targetLoc, pathElement->GetSlopeDirection(), pathElement->IsSloped()); height += pathElement->GetBaseZ(); int16_t z_diff = z - height; @@ -5302,7 +5302,7 @@ void Guest::UpdateWalking() if (GetNextIsSurface()) { - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr) { @@ -5351,7 +5351,7 @@ void Guest::UpdateWalking() if (GetNextIsSurface() || GetNextIsSloped()) return; - TileElement* tileElement = map_get_first_element_at(NextLoc); + TileElement* tileElement = MapGetFirstElementAt(NextLoc); if (tileElement == nullptr) return; @@ -6242,7 +6242,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi { TileElement* tileElement; - auto surfaceElement = map_get_surface_element_at(peep->NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(peep->NextLoc); tileElement = reinterpret_cast(surfaceElement); if (tileElement == nullptr) @@ -6281,7 +6281,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi return false; } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); tileElement = reinterpret_cast(surfaceElement); if (tileElement == nullptr) @@ -6398,7 +6398,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi return false; } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // TODO: extract loop A tileElement = reinterpret_cast(surfaceElement); @@ -6515,7 +6515,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi return false; } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // TODO: extract loop A tileElement = reinterpret_cast(surfaceElement); @@ -6701,7 +6701,7 @@ void Guest::UpdateSpriteType() CoordsXY loc = { x, y }; if (map_is_location_valid(loc.ToTileStart())) { - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); while (true) { if (tileElement == nullptr) diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index d8c74208b2..17d9f25b8e 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -23,7 +23,7 @@ static bool isLocationLitterable(const CoordsXYZ& mapPos) if (!map_is_location_owned(mapPos)) return false; - tileElement = map_get_first_element_at(mapPos); + tileElement = MapGetFirstElementAt(mapPos); if (tileElement == nullptr) return false; do @@ -35,7 +35,7 @@ static bool isLocationLitterable(const CoordsXYZ& mapPos) if (pathZ < mapPos.z || pathZ >= mapPos.z + PATH_CLEARANCE) continue; - return !tile_element_is_underground(tileElement); + return !TileElementIsUnderground(tileElement); } while (!(tileElement++)->IsLastForTile()); return false; } diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index c98ffa5b9c..a726b2af78 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -218,7 +218,7 @@ void CrashSplashParticle::Paint(paint_session& session, int32_t imageDirection) */ void SteamParticle::Create(const CoordsXYZ& coords) { - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement != nullptr && coords.z > surfaceElement->GetBaseZ()) { SteamParticle* steam = CreateEntity(); diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index d922168124..caa5089eeb 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -294,7 +294,7 @@ bool Peep::CheckForPath() return true; } - TileElement* tile_element = map_get_first_element_at(NextLoc); + TileElement* tile_element = MapGetFirstElementAt(NextLoc); auto mapType = TileElementType::Path; if (GetNextIsSurface()) @@ -624,7 +624,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) TileElement* tileElement = reinterpret_cast(pathElement); if (pathElement == nullptr) { - tileElement = reinterpret_cast(map_get_surface_element_at(location.ToCoordsXYZ())); + tileElement = reinterpret_cast(MapGetSurfaceElementAt(location.ToCoordsXYZ())); } if (tileElement == nullptr) { @@ -759,7 +759,7 @@ void Peep::UpdateFalling() } // If not drowning then falling. Note: peeps 'fall' after leaving a ride/enter the park. - TileElement* tile_element = map_get_first_element_at(CoordsXY{ x, y }); + TileElement* tile_element = MapGetFirstElementAt(CoordsXY{ x, y }); TileElement* saved_map = nullptr; int32_t saved_height = 0; @@ -770,7 +770,7 @@ void Peep::UpdateFalling() // If a path check if we are on it if (tile_element->GetType() == TileElementType::Path) { - int32_t height = map_height_from_slope( + int32_t height = MapHeightFromSlope( { x, y }, tile_element->AsPath()->GetSlopeDirection(), tile_element->AsPath()->IsSloped()) + tile_element->GetBaseZ(); @@ -1886,7 +1886,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin auto nextLoc = coords.ToTileStart() + CoordsDirectionDelta[entranceDirection]; // Make sure there is a path right behind the entrance, otherwise turn around - TileElement* nextTileElement = map_get_first_element_at(nextLoc); + TileElement* nextTileElement = MapGetFirstElementAt(nextLoc); do { if (nextTileElement == nullptr) @@ -2420,7 +2420,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) return; } - TileElement* tileElement = map_get_first_element_at(newLoc); + TileElement* tileElement = MapGetFirstElementAt(newLoc); if (tileElement == nullptr) return; int16_t base_z = std::max(0, (z / 8) - 2); @@ -2478,7 +2478,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) return; } - auto surfaceElement = map_get_surface_element_at(newLoc); + auto surfaceElement = MapGetSurfaceElementAt(newLoc); if (surfaceElement == nullptr) { peep_return_to_centre_of_tile(this); @@ -2532,7 +2532,7 @@ int32_t Peep::GetZOnSlope(int32_t tile_x, int32_t tile_y) } uint8_t slope = GetNextDirection(); - return NextLoc.z + map_height_from_slope({ tile_x, tile_y }, slope, GetNextIsSloped()); + return NextLoc.z + MapHeightFromSlope({ tile_x, tile_y }, slope, GetNextIsSloped()); } StringId get_real_name_string_id_from_id(uint32_t id) diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 147ca180b2..da5baa0bc0 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -168,7 +168,7 @@ bool Staff::CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) cons } /* Search through all adjacent map elements */ - TileElement* test_element = map_get_first_element_at(adjacPos); + TileElement* test_element = MapGetFirstElementAt(adjacPos); if (test_element == nullptr) return false; bool pathfound = false; @@ -360,7 +360,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const int16_t nextZ = ((z + COORDS_Z_STEP) & 0xFFF0) / COORDS_Z_STEP; - TileElement* tileElement = map_get_first_element_at(nextTile); + TileElement* tileElement = MapGetFirstElementAt(nextTile); if (tileElement == nullptr) return INVALID_DIRECTION; do @@ -375,7 +375,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const nextTile = CoordsXY(x, y).ToTileStart() + CoordsDirectionDelta[nextDirection]; - tileElement = map_get_first_element_at(nextTile); + tileElement = MapGetFirstElementAt(nextTile); if (tileElement == nullptr) return INVALID_DIRECTION; @@ -400,7 +400,7 @@ uint8_t Staff::HandymanDirectionToUncutGrass(uint8_t valid_directions) const { if (!(GetNextIsSurface())) { - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement == nullptr) return INVALID_DIRECTION; @@ -431,7 +431,7 @@ uint8_t Staff::HandymanDirectionToUncutGrass(uint8_t valid_directions) const if (!map_is_location_valid(chosenTile)) continue; - auto surfaceElement = map_get_surface_element_at(chosenTile); + auto surfaceElement = MapGetSurfaceElementAt(chosenTile); if (surfaceElement != nullptr) { if (std::abs(surfaceElement->GetBaseZ() - NextLoc.z) <= 2 * COORDS_Z_STEP) @@ -1098,7 +1098,7 @@ void Staff::UpdateMowing() if (Var37 != 7) continue; - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr && surfaceElement->CanGrassGrow()) { surfaceElement->SetGrassLength(GRASS_LENGTH_MOWED); @@ -1145,7 +1145,7 @@ void Staff::UpdateWatering() auto actionLoc = CoordsXY{ NextLoc } + CoordsDirectionDelta[Var37]; - TileElement* tile_element = map_get_first_element_at(actionLoc); + TileElement* tile_element = MapGetFirstElementAt(actionLoc); if (tile_element == nullptr) return; @@ -1212,7 +1212,7 @@ void Staff::UpdateEmptyingBin() if (ActionFrame != 11) return; - TileElement* tile_element = map_get_first_element_at(NextLoc); + TileElement* tile_element = MapGetFirstElementAt(NextLoc); if (tile_element == nullptr) return; @@ -1524,7 +1524,7 @@ bool Staff::UpdatePatrollingFindWatering() auto chosenLoc = CoordsXY{ NextLoc } + CoordsDirectionDelta[chosen_position]; - TileElement* tile_element = map_get_first_element_at(chosenLoc); + TileElement* tile_element = MapGetFirstElementAt(chosenLoc); // This seems to happen in some SV4 files. if (tile_element == nullptr) @@ -1591,7 +1591,7 @@ bool Staff::UpdatePatrollingFindBin() if (GetNextIsSurface()) return false; - TileElement* tileElement = map_get_first_element_at(NextLoc); + TileElement* tileElement = MapGetFirstElementAt(NextLoc); if (tileElement == nullptr) return false; @@ -1658,7 +1658,7 @@ bool Staff::UpdatePatrollingFindGrass() if (!(GetNextIsSurface())) return false; - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr && surfaceElement->CanGrassGrow()) { if ((surfaceElement->GetGrassLength() & 0x7) >= GRASS_LENGTH_CLEAR_1) @@ -1791,7 +1791,7 @@ void Staff::UpdatePatrolling() if (GetNextIsSurface()) { - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr) { diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 774385801e..f5e48dd4ba 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -215,7 +215,7 @@ std::string screenshot_dump_png_32bpp(int32_t width, int32_t height, const void* static int32_t GetHighestBaseClearanceZ(const CoordsXY& location, const bool useViewClipping) { int32_t z = 0; - auto element = map_get_first_element_at(location); + auto element = MapGetFirstElementAt(location); if (element != nullptr) { do diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 79296e4c9f..45d8c2821c 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -868,7 +868,7 @@ static FootpathPaintInfo GetFootpathPaintInfo(const PathElement& pathEl) static bool ShouldDrawSupports(paint_session& session, const PathElement& pathEl, uint16_t height) { - auto surface = map_get_surface_element_at(session.MapPosition); + auto surface = MapGetSurfaceElementAt(session.MapPosition); if (surface == nullptr) { return true; diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index d809d49f70..838e60e4a6 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1060,7 +1060,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co continue; } - auto surfaceElement = map_get_surface_element_at(position); + auto surfaceElement = MapGetSurfaceElementAt(position); if (surfaceElement == nullptr) { continue; diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 04c89beaa2..e007d0346d 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -136,7 +136,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo session.MapPosition.x = coords.x; session.MapPosition.y = coords.y; - auto* tile_element = map_get_first_element_at(session.MapPosition); + auto* tile_element = MapGetFirstElementAt(session.MapPosition); if (tile_element == nullptr) return; uint8_t rotation = session.CurrentRotation; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 5f30b7aa60..e6a7b46d29 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1034,7 +1034,7 @@ namespace OpenRCT2 { for (int32_t x = 0; x < gMapSize.x; x++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index ef263a154b..459fd4d5d0 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -280,7 +280,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, PathElement } loc += TileDirectionDelta[chosenDirection]; - nextTileElement = map_get_first_element_at(loc); + nextTileElement = MapGetFirstElementAt(loc); do { if (nextTileElement == nullptr) @@ -330,7 +330,7 @@ static uint8_t footpath_element_dest_in_dir(TileCoordsXYZ loc, Direction chosenD return PATH_SEARCH_LIMIT_REACHED; loc += TileDirectionDelta[chosenDirection]; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { return PATH_SEARCH_FAILED; @@ -742,7 +742,7 @@ static void peep_pathfind_heuristic_search( /* Get the next map element of interest in the direction of test_edge. */ bool found = false; - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { return; @@ -1286,7 +1286,7 @@ Direction OriginalPathfinding::ChooseDirection(const TileCoordsXYZ& loc, Peep& p #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 // Get the path element at this location - TileElement* dest_tile_element = map_get_first_element_at(loc); + TileElement* dest_tile_element = MapGetFirstElementAt(loc); /* Where there are multiple matching map elements placed with zero * clearance, save the first one for later use to determine the path * slope - this maintains the original behaviour (which only processes @@ -1797,7 +1797,7 @@ int32_t OriginalPathfinding::GuestPathFindParkEntranceLeaving(Peep& peep, uint8_ static void get_ride_queue_end(TileCoordsXYZ& loc) { TileCoordsXY queueEnd = { 0, 0 }; - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { @@ -1845,7 +1845,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) } nextTile += TileDirectionDelta[direction]; - tileElement = map_get_first_element_at(nextTile); + tileElement = MapGetFirstElementAt(nextTile); found = false; if (tileElement == nullptr) break; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index a7caf46107..5a88d57530 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -196,7 +196,7 @@ namespace RCT1 SetDefaultNames(); determine_ride_entrance_and_exit_locations(); - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); research_determine_first_of_type(); CheatsReset(); @@ -1519,7 +1519,7 @@ namespace RCT1 auto tileAdded = false; if (coords.x < maxSize && coords.y < maxSize) { - // This is the equivalent of map_get_first_element_at(x, y), but on S4 data. + // This is the equivalent of MapGetFirstElementAt(x, y), but on S4 data. RCT12TileElement* srcElement = tilePointerIndex.GetFirstElementAt(coords); do { @@ -2563,7 +2563,7 @@ namespace RCT1 { for (int32_t y = 0; y < Limits::MaxMapSize; y++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 5cf7117d0e..b81822ee65 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -499,9 +499,9 @@ namespace RCT2 // pad_13CE778 // Fix and set dynamic variables - map_strip_ghost_flag_from_elements(); + MapStripGhostFlagFromElements(); ConvertScenarioStringsToUTF8(); - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); determine_ride_entrance_and_exit_locations(); park.Name = GetUserString(_s6.park_name); @@ -653,7 +653,7 @@ namespace RCT2 }; for (const auto& tile : tilesToUncovered) { - auto* tileElement = map_get_first_element_at(tile); + auto* tileElement = MapGetFirstElementAt(tile); if (tileElement == nullptr) continue; @@ -678,7 +678,7 @@ namespace RCT2 }; for (const auto& tile : tilesToCovered) { - auto* tileElement = map_get_first_element_at(tile); + auto* tileElement = MapGetFirstElementAt(tile); if (tileElement == nullptr) continue; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index febdcf4ced..042a3b8bc2 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -479,7 +479,7 @@ bool track_block_get_next_from_zero( trackPos += CoordsDirectionDelta[direction_start]; } - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) { output->element = nullptr; @@ -611,7 +611,7 @@ bool track_block_get_previous_from_zero( trackPos += CoordsDirectionDelta[direction]; } - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) { outTrackBeginEnd->end_x = trackPos.x; @@ -2308,7 +2308,7 @@ static void ride_shop_connected(Ride* ride) return; TrackElement* trackElement = nullptr; - TileElement* tileElement = map_get_first_element_at(shopLoc); + TileElement* tileElement = MapGetFirstElementAt(shopLoc); do { if (tileElement == nullptr) @@ -2653,7 +2653,7 @@ void Ride::ChainQueues() const // This will fire for every entrance on this x, y and z, regardless whether that actually belongs to // the ride or not. - TileElement* tileElement = map_get_first_element_at(station.Entrance); + TileElement* tileElement = MapGetFirstElementAt(station.Entrance); if (tileElement != nullptr) { do @@ -2994,7 +2994,7 @@ static void ride_set_maze_entrance_exit_points(Ride* ride) { auto entranceExitMapPos = position->ToCoordsXYZ(); - TileElement* tileElement = map_get_first_element_at(*position); + TileElement* tileElement = MapGetFirstElementAt(*position); do { if (tileElement == nullptr) @@ -3626,7 +3626,7 @@ static ResultWithMessage ride_initialise_cable_lift_track(Ride* ride, bool isApp } bool success = false; - TileElement* tileElement = map_get_first_element_at(location); + TileElement* tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) return { false }; do @@ -3864,7 +3864,7 @@ static void ride_scroll_to_track_error(const CoordsXYE& trackElement) TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const { auto stationLoc = GetStation(stationIndex).Start; - TileElement* tileElement = map_get_first_element_at(stationLoc); + TileElement* tileElement = MapGetFirstElementAt(stationLoc); if (tileElement == nullptr) return nullptr; do @@ -5039,7 +5039,7 @@ static int32_t ride_get_track_length(Ride* ride) if (trackStart.IsNull()) continue; - tileElement = map_get_first_element_at(trackStart); + tileElement = MapGetFirstElementAt(trackStart); if (tileElement == nullptr) continue; do @@ -5412,7 +5412,7 @@ money16 ride_get_price(const Ride* ride) TileElement* get_station_platform(const CoordsXYRangedZ& coords) { bool foundTileElement = false; - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement != nullptr) { do @@ -5683,7 +5683,7 @@ void determine_ride_entrance_and_exit_locations() { for (int32_t x = 1; x < gMapSize.x - 1; x++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement != nullptr) { @@ -5847,7 +5847,7 @@ void Ride::UpdateRideTypeForAllPieces() { for (int32_t x = 0; x < gMapSize.x; x++) { - auto* tileElement = map_get_first_element_at(TileCoordsXY(x, y)); + auto* tileElement = MapGetFirstElementAt(TileCoordsXY(x, y)); if (tileElement == nullptr) continue; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 060c3472e5..54ffabf74d 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -1291,7 +1291,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC if (map_is_location_valid(nextLocation)) { // iterate over every element in the tile until we find what we want - auto* tileElement = map_get_first_element_at(nextLocation); + auto* tileElement = MapGetFirstElementAt(nextLocation); if (tileElement == nullptr) continue; do @@ -1361,7 +1361,7 @@ void Ride::ValidateStations() location.x -= CoordsDirectionDelta[direction].x; location.y -= CoordsDirectionDelta[direction].y; } - tileElement = map_get_first_element_at(location); + tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) break; @@ -1418,7 +1418,7 @@ void Ride::ValidateStations() CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 }; bool trackFound = false; - tileElement = map_get_first_element_at(blockLocation); + tileElement = MapGetFirstElementAt(blockLocation); if (tileElement == nullptr) break; // find the target TrackElement on the tile it's supposed to appear on @@ -1490,7 +1490,7 @@ void Ride::ValidateStations() // if it's not a duplicate location CoordsXY location = locationCoords.ToCoordsXY(); - TileElement* tileElement = map_get_first_element_at(location); + TileElement* tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) continue; do @@ -1512,7 +1512,7 @@ void Ride::ValidateStations() // if there's no connected station, remove the ride entrance (see below) bool shouldRemove = true; - TileElement* trackElement = map_get_first_element_at(nextLocation); + TileElement* trackElement = MapGetFirstElementAt(nextLocation); if (trackElement == nullptr) continue; do diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 407f730df2..087f7fb581 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -209,7 +209,7 @@ static void ride_ratings_update_state_2(RideRatingUpdateState& state) auto loc = state.Proximity; track_type_t trackType = state.ProximityTrackType; - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; @@ -315,7 +315,7 @@ static void ride_ratings_update_state_5(RideRatingUpdateState& state) auto loc = state.Proximity; track_type_t trackType = state.ProximityTrackType; - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; @@ -420,7 +420,7 @@ static void ride_ratings_score_close_proximity_in_direction( if (!map_is_location_valid(scorePos)) return; - TileElement* tileElement = map_get_first_element_at(scorePos); + TileElement* tileElement = MapGetFirstElementAt(scorePos); if (tileElement == nullptr) return; do @@ -476,7 +476,7 @@ static void ride_ratings_score_close_proximity_in_direction( static void ride_ratings_score_close_proximity_loops_helper(RideRatingUpdateState& state, const CoordsXYE& coordsElement) { - TileElement* tileElement = map_get_first_element_at(coordsElement); + TileElement* tileElement = MapGetFirstElementAt(coordsElement); if (tileElement == nullptr) return; do @@ -544,7 +544,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til } state.ProximityTotal++; - TileElement* tileElement = map_get_first_element_at(state.Proximity); + TileElement* tileElement = MapGetFirstElementAt(state.Proximity); if (tileElement == nullptr) return; do @@ -1461,7 +1461,7 @@ static int32_t ride_ratings_get_scenery_score(Ride* ride) for (int32_t xx = std::max(tileLocation.x - 5, 0); xx <= std::min(tileLocation.x + 5, gMapSize.x - 1); xx++) { // Count scenery items on this tile - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ xx, yy }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ xx, yy }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 63053f47eb..dd7bc97ea8 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -338,7 +338,7 @@ TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex auto stationStart = ride->GetStation(stationIndex).GetStart(); // Find the station track element - TileElement* tileElement = map_get_first_element_at(stationStart); + TileElement* tileElement = MapGetFirstElementAt(stationStart); if (tileElement == nullptr) return nullptr; do @@ -354,7 +354,7 @@ TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex TileElement* ride_get_station_exit_element(const CoordsXYZ& elementPos) { // Find the station track element - TileElement* tileElement = map_get_first_element_at(elementPos); + TileElement* tileElement = MapGetFirstElementAt(elementPos); if (tileElement == nullptr) return nullptr; do diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index e6ad66c6ab..861acd973f 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -72,7 +72,7 @@ int32_t track_is_connected_by_shape(TileElement* a, TileElement* b) static TileElement* find_station_element(const CoordsXYZD& loc, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return nullptr; do diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 148a49f532..86c262c6a4 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -289,7 +289,7 @@ StringId TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const Ride& CoordsXY mapLocation = location.ToCoordsXY(); - TileElement* tileElement = map_get_first_element_at(mapLocation); + TileElement* tileElement = MapGetFirstElementAt(mapLocation); if (tileElement == nullptr) continue; @@ -368,7 +368,7 @@ StringId TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& r { for (; x < MAXIMUM_MAP_SIZE_BIG; x += COORDS_XY_STEP) { - auto tileElement = map_get_first_element_at(CoordsXY{ x, y }); + auto tileElement = MapGetFirstElementAt(CoordsXY{ x, y }); do { if (tileElement == nullptr) @@ -402,7 +402,7 @@ StringId TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& r } CoordsXY entranceLoc = location.ToCoordsXY(); - auto tileElement = map_get_first_element_at(entranceLoc); + auto tileElement = MapGetFirstElementAt(entranceLoc); do { if (tileElement == nullptr) @@ -431,7 +431,7 @@ StringId TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& r } CoordsXY exitLoc = location.ToCoordsXY(); - tileElement = map_get_first_element_at(exitLoc); + tileElement = MapGetFirstElementAt(exitLoc); if (tileElement == nullptr) return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; do @@ -474,7 +474,7 @@ CoordsXYE TrackDesign::MazeGetFirstElement(const Ride& ride) { for (tile.x = 0; tile.x < MAXIMUM_MAP_SIZE_BIG; tile.x += COORDS_XY_STEP) { - tile.element = map_get_first_element_at(CoordsXY{ tile.x, tile.y }); + tile.element = MapGetFirstElementAt(CoordsXY{ tile.x, tile.y }); do { if (tile.element == nullptr) @@ -990,7 +990,7 @@ static GameActions::Result TrackDesignPlaceSceneryElementRemoveGhost( uint8_t quadrant = (scenery.flags >> 2) + _currentTrackPieceDirection; quadrant &= 3; - auto* sceneryEntry = get_small_scenery_entry(entryInfo->Index); + auto* sceneryEntry = GetSmallSceneryEntry(entryInfo->Index); if (!(!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_DIAGONAL)) && sceneryEntry->HasFlag( SMALL_SCENERY_FLAG_DIAGONAL | SMALL_SCENERY_FLAG_HALF_SPACE | SMALL_SCENERY_FLAG_THREE_QUARTERS)) @@ -1516,7 +1516,7 @@ static GameActions::Result TrackDesignPlaceMaze(TrackDesignState& tds, TrackDesi continue; } - auto surfaceElement = map_get_surface_element_at(mapCoord); + auto surfaceElement = MapGetSurfaceElementAt(mapCoord); if (surfaceElement == nullptr) continue; int16_t surfaceZ = surfaceElement->GetBaseZ(); @@ -1673,7 +1673,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi continue; } - auto surfaceElement = map_get_surface_element_at(tile); + auto surfaceElement = MapGetSurfaceElementAt(tile); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); @@ -1744,7 +1744,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi if (tds.PlaceOperation != PTD_OPERATION_PLACE_QUERY) { auto tile = CoordsXY{ newCoords } + CoordsDirectionDelta[rotation]; - TileElement* tile_element = map_get_first_element_at(tile); + TileElement* tile_element = MapGetFirstElementAt(tile); newCoords.z = tds.Origin.z / COORDS_Z_STEP; newCoords.z += entrance.z; if (tile_element == nullptr) diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index f6a3c36bf3..afb28f5d93 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -618,7 +618,7 @@ static void track_design_save_select_nearby_scenery_for_tile(RideId rideIndex, i { for (int32_t x = cx - TRACK_NEARBY_SCENERY_DISTANCE; x <= cx + TRACK_NEARBY_SCENERY_DISTANCE; x++) { - tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index ab0ad59af6..a0a77dbe62 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -898,7 +898,7 @@ OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) if (x != LOCATION_NULL) { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // vehicle underground if (surfaceElement != nullptr && surfaceElement->GetBaseZ() > z) @@ -1737,13 +1737,13 @@ void Vehicle::UpdateMeasurements() return; } - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // If vehicle above ground. if (surfaceElement != nullptr && surfaceElement->GetBaseZ() <= z) { // Set tile_element to first element. Since elements aren't always ordered by base height, // we must start at the first element and iterate through each tile element. - auto tileElement = map_get_first_element_at(CoordsXY{ x, y }); + auto tileElement = MapGetFirstElementAt(CoordsXY{ x, y }); if (tileElement == nullptr) return; @@ -4615,7 +4615,7 @@ void Vehicle::UpdateBoatLocation() */ static bool vehicle_boat_is_location_accessible(const CoordsXYZ& location) { - TileElement* tileElement = map_get_first_element_at(location); + TileElement* tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) return false; do @@ -5121,7 +5121,7 @@ void Vehicle::UpdateDoingCircusShow() */ static TileElement* vehicle_check_collision(const CoordsXYZ& vehiclePosition) { - TileElement* tileElement = map_get_first_element_at(vehiclePosition); + TileElement* tileElement = MapGetFirstElementAt(vehiclePosition); if (tileElement == nullptr) { return nullptr; diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index cd943f7648..cf107612d6 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -202,7 +202,7 @@ money64 MazeCalculateCost(money32 constructionCost, const Ride& ride, const Coor const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); money64 price = (ride.GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.PriceModifier) >> 16; - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); auto heightDifference = (loc.z - surfaceElement->GetBaseZ()) / COORDS_Z_PER_TINY_Z; money64 supportCost = heightDifference * ride.GetRideTypeDescriptor().BuildCosts.SupportPrice; diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index a1ce81fe06..9da4c1124e 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -114,7 +114,7 @@ static void chairlift_paint_util_draw_supports(paint_session& session, int32_t s static const TrackElement* chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( int32_t x, int32_t y, int32_t z, const Ride& ride) { - const TileElement* tileElement = map_get_first_element_at(CoordsXY{ x, y }); + const TileElement* tileElement = MapGetFirstElementAt(CoordsXY{ x, y }); if (tileElement == nullptr) { return nullptr; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 45741b1c8b..7e2387cdad 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -161,7 +161,7 @@ void scenario_reset() date_reset(); Duck::RemoveAll(); ParkCalculateSize(); - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); Staff::ResetStats(); auto& objManager = GetContext()->GetObjectManager(); diff --git a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp index e1953fe07d..60d69af49c 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp +++ b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp @@ -22,7 +22,7 @@ using namespace OpenRCT2::TrackMetaData; std::shared_ptr ScTrackIterator::FromElement(const CoordsXY& position, int32_t elementIndex) { - auto el = map_get_nth_element_at(position, elementIndex); + auto el = MapGetNthElementAt(position, elementIndex); auto origin = GetTrackSegmentOrigin(CoordsXYE(position, el)); if (!origin) return nullptr; diff --git a/src/openrct2/scripting/bindings/world/ScTile.cpp b/src/openrct2/scripting/bindings/world/ScTile.cpp index 07ecc2c290..e5b6a08536 100644 --- a/src/openrct2/scripting/bindings/world/ScTile.cpp +++ b/src/openrct2/scripting/bindings/world/ScTile.cpp @@ -69,7 +69,7 @@ namespace OpenRCT2::Scripting DukValue ScTile::data_get() const { auto ctx = GetDukContext(); - auto first = map_get_first_element_at(_coords); + auto first = MapGetFirstElementAt(_coords); auto dataLen = GetNumElements(first) * sizeof(TileElement); auto data = duk_push_fixed_buffer(ctx, dataLen); if (first != nullptr) @@ -92,7 +92,7 @@ namespace OpenRCT2::Scripting auto numElements = dataLen / sizeof(TileElement); if (numElements == 0) { - map_set_tile_element(TileCoordsXY(_coords), nullptr); + MapSetTileElement(TileCoordsXY(_coords), nullptr); } else { @@ -109,7 +109,7 @@ namespace OpenRCT2::Scripting } // Copy data to element span - first = map_get_first_element_at(_coords); + first = MapGetFirstElementAt(_coords); currentNumElements = GetNumElements(first); if (currentNumElements != 0) { @@ -202,7 +202,7 @@ namespace OpenRCT2::Scripting TileElement* ScTile::GetFirstElement() const { - return map_get_first_element_at(_coords); + return MapGetFirstElementAt(_coords); } size_t ScTile::GetNumElements(const TileElement* first) diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index e4fea0e9eb..e4ed12b95f 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -89,7 +89,7 @@ void Banner::FormatTextTo(Formatter& ft) const */ static RideId BannerGetRideIndexAt(const CoordsXYZ& bannerCoords) { - TileElement* tileElement = map_get_first_element_at(bannerCoords); + TileElement* tileElement = MapGetFirstElementAt(bannerCoords); RideId resultRideIndex = RideId::GetNull(); if (tileElement == nullptr) return resultRideIndex; @@ -146,7 +146,7 @@ TileElement* BannerGetTileElement(BannerIndex bannerIndex) auto banner = GetBanner(bannerIndex); if (banner != nullptr) { - auto tileElement = map_get_first_element_at(banner->position); + auto tileElement = MapGetFirstElementAt(banner->position); if (tileElement != nullptr) { do @@ -167,7 +167,7 @@ WallElement* BannerGetScrollingWallTileElement(BannerIndex bannerIndex) if (banner == nullptr) return nullptr; - auto tileElement = map_get_first_element_at(banner->position); + auto tileElement = MapGetFirstElementAt(banner->position); if (tileElement == nullptr) return nullptr; diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index e1faec8277..6647c197c3 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -137,7 +137,7 @@ GameActions::Result MapCanConstructWithClearAt( return res; } - TileElement* tileElement = map_get_first_element_at(pos); + TileElement* tileElement = MapGetFirstElementAt(pos); if (tileElement == nullptr) { res.Error = GameActions::Status::Unknown; diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index b9aa959370..96b1b34b9b 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -139,7 +139,7 @@ void MazeEntranceHedgeReplacement(const CoordsXYE& entrance) int32_t z = entrance.element->GetBaseZ(); RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex(); - auto tileElement = map_get_first_element_at(hedgePos); + auto tileElement = MapGetFirstElementAt(hedgePos); if (tileElement == nullptr) return; do @@ -176,7 +176,7 @@ void MazeEntranceHedgeRemoval(const CoordsXYE& entrance) int32_t z = entrance.element->GetBaseZ(); RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex(); - auto tileElement = map_get_first_element_at(hedgePos); + auto tileElement = MapGetFirstElementAt(hedgePos); if (tileElement == nullptr) return; do diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index e9ce139fb9..cbcd93d28a 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -118,7 +118,7 @@ static bool entrance_has_direction(const EntranceElement& entranceElement, int32 TileElement* MapGetFootpathElement(const CoordsXYZ& coords) { - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); do { if (tileElement == nullptr) @@ -440,7 +440,7 @@ bool WallInTheWay(const CoordsXYRangedZ& fencePos, int32_t direction) { TileElement* tileElement; - tileElement = map_get_first_element_at(fencePos); + tileElement = MapGetFirstElementAt(fencePos); if (tileElement == nullptr) return false; do @@ -468,7 +468,7 @@ static PathElement* FootpathConnectCornersGetNeighbour(const CoordsXYZ& footpath return nullptr; } - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return nullptr; do @@ -641,7 +641,7 @@ static void FoopathNeighbourListSort(rct_neighbour_list* neighbourList) static TileElement* FootpathGetElement(const CoordsXYRangedZ& footpathPos, int32_t direction) { - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return nullptr; do @@ -835,7 +835,7 @@ static void loc_6A6D7E( } else { - TileElement* tileElement = map_get_first_element_at(targetPos); + TileElement* tileElement = MapGetFirstElementAt(targetPos); if (tileElement == nullptr) return; do @@ -1093,7 +1093,7 @@ void FootpathChainRideQueue( } auto targetQueuePos = curQueuePos + CoordsDirectionDelta[direction]; - tileElement = map_get_first_element_at(targetQueuePos); + tileElement = MapGetFirstElementAt(targetQueuePos); bool foundQueue = false; if (tileElement != nullptr) { @@ -1223,7 +1223,7 @@ void FootpathUpdateQueueChains() if (station.Entrance.IsNull()) continue; - TileElement* tileElement = map_get_first_element_at(station.Entrance); + TileElement* tileElement = MapGetFirstElementAt(station.Entrance); if (tileElement != nullptr) { do @@ -1250,7 +1250,7 @@ void FootpathUpdateQueueChains() */ static void FootpathFixOwnership(const CoordsXY& mapPos) { - const auto* surfaceElement = map_get_surface_element_at(mapPos); + const auto* surfaceElement = MapGetSurfaceElementAt(mapPos); uint16_t ownership; // Unlikely to be NULL unless deliberate. @@ -1402,7 +1402,7 @@ static int32_t FootpathIsConnectedToMapEdgeHelper(CoordsXYZ footpathPos, int32_t return FOOTPATH_SEARCH_SUCCESS; } - tileElement = map_get_first_element_at(targetPos); + tileElement = MapGetFirstElementAt(targetPos); if (tileElement == nullptr) return currentTile.level == 1 ? FOOTPATH_SEARCH_NOT_FOUND : FOOTPATH_SEARCH_INCOMPLETE; @@ -1778,7 +1778,7 @@ void PathElement::SetShouldDrawPathOverSupports(bool on) */ static void FootpathClearWide(const CoordsXY& footpathPos) { - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return; do @@ -1797,7 +1797,7 @@ static void FootpathClearWide(const CoordsXY& footpathPos) */ static TileElement* FootpathCanBeWide(const CoordsXYZ& footpathPos) { - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return nullptr; do @@ -1844,7 +1844,7 @@ void FootpathUpdatePathWideFlags(const CoordsXY& footpathPos) // FootpathClearWide(x, y); // y -= 0x20; - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return; do @@ -2083,7 +2083,7 @@ static void FootpathRemoveEdgesTowardsHere( Direction shiftedDirection = (direction + 1) & 3; auto targetFootPathPos = CoordsXYZ{ CoordsXY{ footpathPos } + CoordsDirectionDelta[shiftedDirection], footpathPos.z }; - tileElement = map_get_first_element_at(targetFootPathPos); + tileElement = MapGetFirstElementAt(targetFootPathPos); if (tileElement == nullptr) return; do @@ -2114,7 +2114,7 @@ static void FootpathRemoveEdgesTowards(const CoordsXYRangedZ& footPathPos, int32 return; } - TileElement* tileElement = map_get_first_element_at(footPathPos); + TileElement* tileElement = MapGetFirstElementAt(footPathPos); if (tileElement == nullptr) return; do @@ -2153,7 +2153,7 @@ static void FootpathRemoveEdgesTowards(const CoordsXYRangedZ& footPathPos, int32 // entrances and exits, shops, paths). bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved) { - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement == nullptr) return false; do @@ -2245,7 +2245,7 @@ static void FootpathFixCornersAround(const TileCoordsXY& footpathPos, TileElemen if (xOffset == 0 && yOffset == 0) continue; - TileElement* tileElement = map_get_first_element_at( + TileElement* tileElement = MapGetFirstElementAt( TileCoordsXY{ footpathPos.x + xOffset, footpathPos.y + yOffset }.ToCoordsXY()); if (tileElement == nullptr) continue; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 95a94f3879..43609e31c8 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -174,7 +174,7 @@ std::vector GetReorganisedTileElementsWithoutGhosts() auto oldSize = newElements.size(); // Add all non-ghost elements - const auto* element = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + const auto* element = MapGetFirstElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (element != nullptr) { do @@ -211,7 +211,7 @@ static void ReorganiseTileElements(size_t capacity) { for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - const auto* element = map_get_first_element_at(TileCoordsXY{ x, y }); + const auto* element = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (element == nullptr) { newElements.push_back(GetDefaultSurfaceElement()); @@ -282,14 +282,14 @@ void tile_element_iterator_begin(tile_element_iterator* it) { it->x = 0; it->y = 0; - it->element = map_get_first_element_at(TileCoordsXY{ 0, 0 }); + it->element = MapGetFirstElementAt(TileCoordsXY{ 0, 0 }); } int32_t tile_element_iterator_next(tile_element_iterator* it) { if (it->element == nullptr) { - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); + it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y }); return 1; } @@ -302,7 +302,7 @@ int32_t tile_element_iterator_next(tile_element_iterator* it) if (it->y < (MAXIMUM_MAP_SIZE_TECHNICAL - 1)) { it->y++; - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); + it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y }); return 1; } @@ -310,7 +310,7 @@ int32_t tile_element_iterator_next(tile_element_iterator* it) { it->y = 0; it->x++; - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); + it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y }); return 1; } @@ -329,7 +329,7 @@ static bool IsTileLocationValid(const TileCoordsXY& coords) return is_x_valid && is_y_valid; } -TileElement* map_get_first_element_at(const TileCoordsXY& tilePos) +TileElement* MapGetFirstElementAt(const TileCoordsXY& tilePos) { if (!IsTileLocationValid(tilePos)) { @@ -339,14 +339,14 @@ TileElement* map_get_first_element_at(const TileCoordsXY& tilePos) return _tileIndex.GetFirstElementAt(tilePos); } -TileElement* map_get_first_element_at(const CoordsXY& elementPos) +TileElement* MapGetFirstElementAt(const CoordsXY& elementPos) { - return map_get_first_element_at(TileCoordsXY{ elementPos }); + return MapGetFirstElementAt(TileCoordsXY{ elementPos }); } -TileElement* map_get_nth_element_at(const CoordsXY& coords, int32_t n) +TileElement* MapGetNthElementAt(const CoordsXY& coords, int32_t n) { - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement == nullptr) { return nullptr; @@ -373,7 +373,7 @@ TileElement* map_get_nth_element_at(const CoordsXY& coords, int32_t n) TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRangedZ& loc, TileElementType type) { - TileElement* tileElement = map_get_first_element_at(loc.ToCoordsXY()); + TileElement* tileElement = MapGetFirstElementAt(loc.ToCoordsXY()); if (tileElement == nullptr) return nullptr; do @@ -387,7 +387,7 @@ TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRange return nullptr; } -void map_set_tile_element(const TileCoordsXY& tilePos, TileElement* elements) +void MapSetTileElement(const TileCoordsXY& tilePos, TileElement* elements) { if (!map_is_location_valid(tilePos.ToCoordsXY())) { @@ -397,7 +397,7 @@ void map_set_tile_element(const TileCoordsXY& tilePos, TileElement* elements) _tileIndex.SetTile(tilePos, elements); } -SurfaceElement* map_get_surface_element_at(const CoordsXY& coords) +SurfaceElement* MapGetSurfaceElementAt(const CoordsXY& coords) { auto view = TileElementsView(coords); @@ -417,7 +417,7 @@ PathElement* map_get_path_element_at(const TileCoordsXYZ& loc) return nullptr; } -BannerElement* map_get_banner_element_at(const CoordsXYZ& bannerPos, uint8_t position) +BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t position) { const auto bannerTilePos = TileCoordsXYZ{ bannerPos }; for (auto* element : TileElementsView(bannerPos)) @@ -435,7 +435,7 @@ BannerElement* map_get_banner_element_at(const CoordsXYZ& bannerPos, uint8_t pos * * rct2: 0x0068AB4C */ -void map_init(const TileCoordsXY& size) +void MapInit(const TileCoordsXY& size) { auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL; SetTileElements(std::vector(numTiles, GetDefaultSurfaceElement())); @@ -456,7 +456,7 @@ void map_init(const TileCoordsXY& size) * but haven't been bought yet. It updates gLandRemainingOwnershipSales and * gLandRemainingConstructionSales. */ -void map_count_remaining_land_rights() +void MapCountRemainingLandRights() { gLandRemainingOwnershipSales = 0; gLandRemainingConstructionSales = 0; @@ -465,7 +465,7 @@ void map_count_remaining_land_rights() { for (int32_t x = 0; x < gMapSize.x; x++) { - auto* surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto* surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); // Surface elements are sometimes hacked out to save some space for other map elements if (surfaceElement == nullptr) { @@ -501,7 +501,7 @@ void map_count_remaining_land_rights() * This is less invasive than removing ghost elements themselves, as they can * contain valid data. */ -void map_strip_ghost_flag_from_elements() +void MapStripGhostFlagFromElements() { for (auto& element : _tileElements) { @@ -524,7 +524,7 @@ int16_t tile_element_height(const CoordsXY& loc) return MINIMUM_LAND_HEIGHT_BIG; // Get the surface element for the tile - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { @@ -661,7 +661,7 @@ int16_t tile_element_water_height(const CoordsXY& loc) return 0; // Get the surface element for the tile - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { @@ -677,7 +677,7 @@ int16_t tile_element_water_height(const CoordsXY& loc) */ bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection) { - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return false; @@ -753,7 +753,7 @@ void map_update_path_wide_flags() * * rct2: 0x006A7B84 */ -int32_t map_height_from_slope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped) +int32_t MapHeightFromSlope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped) { if (!isSloped) return 0; @@ -805,7 +805,7 @@ bool map_is_location_owned(const CoordsXYZ& loc) // This check is to avoid throwing lots of messages in logs. if (map_is_location_valid(loc)) { - auto* surfaceElement = map_get_surface_element_at(loc); + auto* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement != nullptr) { if (surfaceElement->GetOwnership() & OWNERSHIP_OWNED) @@ -829,7 +829,7 @@ bool map_is_location_in_park(const CoordsXY& coords) { if (map_is_location_valid(coords)) { - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) return false; if (surfaceElement->GetOwnership() & OWNERSHIP_OWNED) @@ -842,7 +842,7 @@ bool map_is_location_owned_or_has_rights(const CoordsXY& loc) { if (map_is_location_valid(loc)) { - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { return false; @@ -1008,7 +1008,7 @@ uint8_t map_get_lowest_land_height(const MapRange& range) { for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += COORDS_XY_STEP) { - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ xi, yi }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); if (surfaceElement != nullptr && min_height > surfaceElement->base_height) { @@ -1038,7 +1038,7 @@ uint8_t map_get_highest_land_height(const MapRange& range) { for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += COORDS_XY_STEP) { - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ xi, yi }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); if (surfaceElement != nullptr) { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) @@ -1330,7 +1330,7 @@ void map_update_tiles() for (int32_t blockX = 0; blockX < gMapSize.x; blockX += 256) { auto mapPos = TileCoordsXY{ blockX + x, blockY + y }.ToCoordsXY(); - auto* surfaceElement = map_get_surface_element_at(mapPos); + auto* surfaceElement = MapGetSurfaceElementAt(mapPos); if (surfaceElement != nullptr) { surfaceElement->UpdateGrassLength(mapPos); @@ -1415,7 +1415,7 @@ void map_remove_out_of_range_elements() if (x == 0 || y == 0 || x >= mapSizeMax.x || y >= mapSizeMax.y) { // Note this purposely does not use LandSetRightsAction as X Y coordinates are outside of normal range. - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); @@ -1475,8 +1475,8 @@ void map_extend_boundary_surface_y() auto y = gMapSize.y - 2; for (auto x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - auto existingTileElement = map_get_surface_element_at(TileCoordsXY{ x, y - 1 }.ToCoordsXY()); - auto newTileElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y - 1 }.ToCoordsXY()); + auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (existingTileElement != nullptr && newTileElement != nullptr) { @@ -1495,8 +1495,8 @@ void map_extend_boundary_surface_x() auto x = gMapSize.x - 2; for (auto y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { - auto existingTileElement = map_get_surface_element_at(TileCoordsXY{ x - 1, y }.ToCoordsXY()); - auto newTileElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y }.ToCoordsXY()); + auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (existingTileElement != nullptr && newTileElement != nullptr) { map_extend_boundary_surface_extend_tile(*existingTileElement, *newTileElement); @@ -1606,7 +1606,7 @@ static void clear_elements_at(const CoordsXY& loc) [loc](const CoordsXY& spawn) { return spawn.ToTileStart() == loc.ToTileStart(); }), gPeepSpawns.end()); - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return; @@ -1620,7 +1620,7 @@ static void clear_elements_at(const CoordsXY& loc) int32_t map_get_highest_z(const CoordsXY& loc) { - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) return -1; @@ -1638,7 +1638,7 @@ int32_t map_get_highest_z(const CoordsXY& loc) LargeSceneryElement* map_get_large_scenery_segment(const CoordsXYZD& sceneryPos, int32_t sequence) { - TileElement* tileElement = map_get_first_element_at(sceneryPos); + TileElement* tileElement = MapGetFirstElementAt(sceneryPos); if (tileElement == nullptr) { return nullptr; @@ -1663,7 +1663,7 @@ LargeSceneryElement* map_get_large_scenery_segment(const CoordsXYZD& sceneryPos, EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost) { auto entranceTileCoords = TileCoordsXYZ(entranceCoords); - TileElement* tileElement = map_get_first_element_at(entranceCoords); + TileElement* tileElement = MapGetFirstElementAt(entranceCoords); if (tileElement != nullptr) { do @@ -1689,7 +1689,7 @@ EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoord EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost) { auto entranceTileCoords = TileCoordsXYZ{ entranceCoords }; - TileElement* tileElement = map_get_first_element_at(entranceCoords); + TileElement* tileElement = MapGetFirstElementAt(entranceCoords); if (tileElement != nullptr) { do @@ -1715,7 +1715,7 @@ EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoord EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool ghost) { auto exitTileCoords = TileCoordsXYZ{ exitCoords }; - TileElement* tileElement = map_get_first_element_at(exitCoords); + TileElement* tileElement = MapGetFirstElementAt(exitCoords); if (tileElement != nullptr) { do @@ -1741,7 +1741,7 @@ EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant) { auto sceneryTileCoords = TileCoordsXYZ{ sceneryCoords }; - TileElement* tileElement = map_get_first_element_at(sceneryCoords); + TileElement* tileElement = MapGetFirstElementAt(sceneryCoords); if (tileElement != nullptr) { do @@ -1938,7 +1938,7 @@ bool map_surface_is_blocked(const CoordsXY& mapCoords) if (!map_is_location_valid(mapCoords)) return true; - auto surfaceElement = map_get_surface_element_at(mapCoords); + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); if (surfaceElement == nullptr) { @@ -1999,7 +1999,7 @@ void map_clear_all_elements() */ TrackElement* map_get_track_element_at(const CoordsXYZ& trackPos) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; do @@ -2023,7 +2023,7 @@ TrackElement* map_get_track_element_at(const CoordsXYZ& trackPos) */ TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_type_t trackType) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2050,7 +2050,7 @@ TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_t */ TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); auto trackTilePos = TileCoordsXYZ{ trackPos }; do { @@ -2073,7 +2073,7 @@ TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, tra TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track_type_t trackType) { - auto tileElement = map_get_first_element_at(location); + auto tileElement = MapGetFirstElementAt(location); if (tileElement != nullptr) { do @@ -2096,7 +2096,7 @@ TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence) { - auto tileElement = map_get_first_element_at(location); + auto tileElement = MapGetFirstElementAt(location); if (tileElement != nullptr) { do @@ -2127,7 +2127,7 @@ TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, t */ TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2156,7 +2156,7 @@ TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPo */ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2184,7 +2184,7 @@ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideI */ TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2207,7 +2207,7 @@ TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords) { - auto tileElement = map_get_first_element_at(coords); + auto tileElement = MapGetFirstElementAt(coords); if (tileElement != nullptr) { @@ -2227,7 +2227,7 @@ WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords) WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords) { auto tileWallCoords = TileCoordsXYZ(wallCoords); - TileElement* tileElement = map_get_first_element_at(wallCoords); + TileElement* tileElement = MapGetFirstElementAt(wallCoords); if (tileElement == nullptr) return nullptr; do @@ -2246,7 +2246,7 @@ WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords) uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos) { - TileElement* tileElement = map_get_first_element_at(tileMapPos); + TileElement* tileElement = MapGetFirstElementAt(tileMapPos); uint16_t destOwnership = OWNERSHIP_OWNED; // Sometimes done deliberately. @@ -2285,7 +2285,7 @@ void FixLandOwnershipTilesWithOwnership(std::initializer_list tile { for (const TileCoordsXY* tile = tiles.begin(); tile != tiles.end(); ++tile) { - auto surfaceElement = map_get_surface_element_at(tile->ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(tile->ToCoordsXY()); if (surfaceElement != nullptr) { if (doNotDowngrade && surfaceElement->GetOwnership() == OWNERSHIP_OWNED) diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 040207403d..d06b202c0c 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -157,18 +157,18 @@ void StashMap(); void UnstashMap(); std::vector GetReorganisedTileElementsWithoutGhosts(); -void map_init(const TileCoordsXY& size); +void MapInit(const TileCoordsXY& size); -void map_count_remaining_land_rights(); -void map_strip_ghost_flag_from_elements(); -TileElement* map_get_first_element_at(const CoordsXY& tilePos); -TileElement* map_get_first_element_at(const TileCoordsXY& tilePos); -TileElement* map_get_nth_element_at(const CoordsXY& coords, int32_t n); +void MapCountRemainingLandRights(); +void MapStripGhostFlagFromElements(); +TileElement* MapGetFirstElementAt(const CoordsXY& tilePos); +TileElement* MapGetFirstElementAt(const TileCoordsXY& tilePos); +TileElement* MapGetNthElementAt(const CoordsXY& coords, int32_t n); TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRangedZ& loc, TileElementType type); -void map_set_tile_element(const TileCoordsXY& tilePos, TileElement* elements); -int32_t map_height_from_slope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped); -BannerElement* map_get_banner_element_at(const CoordsXYZ& bannerPos, uint8_t direction); -SurfaceElement* map_get_surface_element_at(const CoordsXY& coords); +void MapSetTileElement(const TileCoordsXY& tilePos, TileElement* elements); +int32_t MapHeightFromSlope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped); +BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t direction); +SurfaceElement* MapGetSurfaceElementAt(const CoordsXY& coords); PathElement* map_get_path_element_at(const TileCoordsXYZ& loc); WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords); WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords); @@ -234,9 +234,9 @@ void map_extend_boundary_surface_x(); void map_extend_boundary_surface_y(); bool map_large_scenery_sign_set_colour(const CoordsXYZD& signPos, int32_t sequence, uint8_t mainColour, uint8_t textColour); -void wall_remove_at(const CoordsXYRangedZ& wallPos); -void wall_remove_at_z(const CoordsXYZ& wallPos); -void wall_remove_intersecting_walls(const CoordsXYRangedZ& wallPos, Direction direction); +void WallRemoveAt(const CoordsXYRangedZ& wallPos); +void WallRemoveAtZ(const CoordsXYZ& wallPos); +void WallRemoveIntersectingWalls(const CoordsXYRangedZ& wallPos, Direction direction); void map_invalidate_tile(const CoordsXYRangedZ& tilePos); void map_invalidate_tile_zoom1(const CoordsXYRangedZ& tilePos); diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 2bffa9e149..589087ab9b 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -94,7 +94,7 @@ void MapAnimationInvalidateAll() static bool MapAnimationInvalidateRideEntrance(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; - auto tileElement = map_get_first_element_at(loc); + auto tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -131,7 +131,7 @@ static bool MapAnimationInvalidateQueueBanner(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -164,7 +164,7 @@ static bool MapAnimationInvalidateSmallScenery(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; - auto tileElement = map_get_first_element_at(loc); + auto tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -229,7 +229,7 @@ static bool MapAnimationInvalidateParkEntrance(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -259,7 +259,7 @@ static bool MapAnimationInvalidateTrackWaterfall(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -288,7 +288,7 @@ static bool MapAnimationInvalidateTrackRapids(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -317,7 +317,7 @@ static bool MapAnimationInvalidateTrackOnRidePhoto(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -356,7 +356,7 @@ static bool MapAnimationInvalidateTrackWhirlpool(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -385,7 +385,7 @@ static bool MapAnimationInvalidateTrackSpinningTunnel(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -423,7 +423,7 @@ static bool MapAnimationInvalidateBanner(const CoordsXYZ& loc) TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -449,7 +449,7 @@ static bool MapAnimationInvalidateLargeScenery(const CoordsXYZ& loc) TileElement* tileElement; bool wasInvalidated = false; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -483,7 +483,7 @@ static bool MapAnimationInvalidateWallDoor(const CoordsXYZ& loc) return false; bool removeAnimation = true; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return removeAnimation; do @@ -544,7 +544,7 @@ static bool MapAnimationInvalidateWall(const CoordsXYZ& loc) TileElement* tileElement; bool wasInvalidated = false; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index 9950f4dc5f..1a9b049ef4 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -120,12 +120,12 @@ void MapGenGenerateBlank(mapgen_settings* settings) int32_t x, y; map_clear_all_elements(); - map_init(settings->mapSize); + MapInit(settings->mapSize); for (y = 1; y < settings->mapSize.y - 1; y++) { for (x = 1; x < settings->mapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr) { surfaceElement->SetSurfaceStyle(settings->floor); @@ -184,12 +184,12 @@ void MapGenGenerate(mapgen_settings* settings) map_clear_all_elements(); // Initialise the base map - map_init(mapSize); + MapInit(mapSize); for (auto y = 1; y < mapSize.y - 1; y++) { for (auto x = 1; x < mapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr) { surfaceElement->SetSurfaceStyle(floorTextureId); @@ -239,7 +239,7 @@ void MapGenGenerate(mapgen_settings* settings) { for (auto x = 1; x < mapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr && surfaceElement->base_height < waterLevel + 6) surfaceElement->SetSurfaceStyle(beachTextureId); @@ -253,7 +253,7 @@ void MapGenGenerate(mapgen_settings* settings) static void MapGenPlaceTree(ObjectEntryIndex type, const CoordsXY& loc) { - auto* sceneryEntry = get_small_scenery_entry(type); + auto* sceneryEntry = GetSmallSceneryEntry(type); if (sceneryEntry == nullptr) { return; @@ -311,7 +311,7 @@ static void MapGenPlaceTrees() for (int32_t i = 0; i < object_entry_group_counts[EnumValue(ObjectType::SmallScenery)]; i++) { - auto* sceneryEntry = get_small_scenery_entry(i); + auto* sceneryEntry = GetSmallSceneryEntry(i); auto entry = object_entry_get_object(ObjectType::SmallScenery, i); if (sceneryEntry == nullptr) @@ -341,7 +341,7 @@ static void MapGenPlaceTrees() pos.x = x * COORDS_XY_STEP; pos.y = y * COORDS_XY_STEP; - auto* surfaceElement = map_get_surface_element_at(pos); + auto* surfaceElement = MapGetSurfaceElementAt(pos); if (surfaceElement == nullptr) continue; @@ -368,7 +368,7 @@ static void MapGenPlaceTrees() neighbourPos.x = std::clamp(neighbourPos.x, COORDS_XY_STEP, COORDS_XY_STEP * (gMapSize.x - 1)); neighbourPos.y = std::clamp(neighbourPos.y, COORDS_XY_STEP, COORDS_XY_STEP * (gMapSize.y - 1)); - const auto neighboutSurface = map_get_surface_element_at(neighbourPos); + const auto neighboutSurface = MapGetSurfaceElementAt(neighbourPos); if (neighboutSurface->GetWaterHeight() > 0) { float distance = std::sqrt(offsetX * offsetX + offsetY * offsetY); @@ -418,7 +418,7 @@ static void MapGenSetWaterLevel(int32_t waterLevel) { for (int32_t x = 1; x < gMapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr && surfaceElement->base_height < waterLevel) surfaceElement->SetWaterHeight(waterLevel * COORDS_Z_STEP); } @@ -479,7 +479,7 @@ static void MapGenSetHeight(mapgen_settings* settings) uint8_t baseHeight = (q00 + q01 + q10 + q11) / 4; - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) continue; surfaceElement->base_height = std::max(2, baseHeight * 2); @@ -802,7 +802,7 @@ void MapGenGenerateFromHeightmap(mapgen_settings* settings) // Get technical map size, +2 for the black tiles around the map auto maxWidth = static_cast(_heightMapData.width + 2); auto maxHeight = static_cast(_heightMapData.height + 2); - map_init({ maxHeight, maxWidth }); + MapInit({ maxHeight, maxWidth }); if (settings->smooth_height_map) { @@ -846,7 +846,7 @@ void MapGenGenerateFromHeightmap(mapgen_settings* settings) { // The x and y axis are flipped in the world, so this uses y for x and x for y. auto tileCoords = MapgenHeightmapCoordToTileCoordsXY(x, y); - auto* const surfaceElement = map_get_surface_element_at(tileCoords.ToCoordsXY()); + auto* const surfaceElement = MapGetSurfaceElementAt(tileCoords.ToCoordsXY()); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/world/MapHelpers.cpp b/src/openrct2/world/MapHelpers.cpp index e7d8590cdf..4a44a1d1ad 100644 --- a/src/openrct2/world/MapHelpers.cpp +++ b/src/openrct2/world/MapHelpers.cpp @@ -16,7 +16,7 @@ static uint8_t GetBaseHeightOrZero(int32_t x, int32_t y) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); return surfaceElement != nullptr ? surfaceElement->base_height : 0; } @@ -31,7 +31,7 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) { for (x = l; x < r; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) continue; surfaceElement->SetSlope(TILE_ELEMENT_SLOPE_FLAT); @@ -146,36 +146,36 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) { uint8_t slope = surfaceElement->GetSlope(); // Corners - auto surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 1, y + 1 }.ToCoordsXY()); + auto surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y + 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_N_CORNER_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x - 1, y + 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y + 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_W_CORNER_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 1, y - 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y - 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_E_CORNER_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x - 1, y - 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y - 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_S_CORNER_UP; // Sides - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 1, y + 0 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y + 0 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_NE_SIDE_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x - 1, y + 0 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y + 0 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_SW_SIDE_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 0, y - 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 0, y - 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_SE_SIDE_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 0, y + 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 0, y + 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_NW_SIDE_UP; @@ -200,7 +200,7 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) */ int32_t TileSmooth(const TileCoordsXY& tileCoords) { - auto* const surfaceElement = map_get_surface_element_at(tileCoords.ToCoordsXY()); + auto* const surfaceElement = MapGetSurfaceElementAt(tileCoords.ToCoordsXY()); if (surfaceElement == nullptr) return 0; @@ -241,7 +241,7 @@ int32_t TileSmooth(const TileCoordsXY& tileCoords) continue; // Get neighbour height. If the element is not valid (outside of map) assume the same height - auto* neighbourSurfaceElement = map_get_surface_element_at( + auto* neighbourSurfaceElement = MapGetSurfaceElementAt( (tileCoords + TileCoordsXY{ x_offset, y_offset }).ToCoordsXY()); neighbourHeightOffset.baseheight[index] = neighbourSurfaceElement != nullptr ? neighbourSurfaceElement->base_height : surfaceElement->base_height; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 04992531d6..b599deddb4 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -107,7 +107,7 @@ void ParkUpdateFences(const CoordsXY& coords) if (map_is_edge(coords)) return; - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) return; @@ -116,7 +116,7 @@ void ParkUpdateFences(const CoordsXY& coords) { bool fenceRequired = true; - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement == nullptr) return; // If an entrance element do not place flags around surface diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 7a862ceb9d..0508dc9aef 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -124,7 +124,7 @@ void SceneryUpdateTile(const CoordsXY& sceneryPos) { TileElement* tileElement; - tileElement = map_get_first_element_at(sceneryPos); + tileElement = MapGetFirstElementAt(sceneryPos); if (tileElement == nullptr) return; do @@ -243,7 +243,7 @@ void SceneryRemoveGhostToolPlacement() if (gSceneryGhostType & SCENERY_GHOST_FLAG_1) { gSceneryGhostType &= ~SCENERY_GHOST_FLAG_1; - TileElement* tileElement = map_get_first_element_at(gSceneryGhostPosition); + TileElement* tileElement = MapGetFirstElementAt(gSceneryGhostPosition); do { @@ -399,7 +399,7 @@ static SceneryEntryBase* GetSceneryEntry(const ScenerySelection& item) switch (item.SceneryType) { case SCENERY_TYPE_SMALL: - return get_small_scenery_entry(item.EntryIndex); + return GetSmallSceneryEntry(item.EntryIndex); case SCENERY_TYPE_PATH_ITEM: return GetFootpathItemEntry(item.EntryIndex); case SCENERY_TYPE_WALL: diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index fe6e6678c0..50cfd66290 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -125,10 +125,10 @@ void SmallSceneryElement::SetNeedsSupports() SmallSceneryEntry* SmallSceneryElement::GetEntry() const { - return get_small_scenery_entry(entryIndex); + return GetSmallSceneryEntry(entryIndex); } -SmallSceneryEntry* get_small_scenery_entry(ObjectEntryIndex entryIndex) +SmallSceneryEntry* GetSmallSceneryEntry(ObjectEntryIndex entryIndex) { SmallSceneryEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); diff --git a/src/openrct2/world/SmallScenery.h b/src/openrct2/world/SmallScenery.h index 89e0010aac..938f53d8d2 100644 --- a/src/openrct2/world/SmallScenery.h +++ b/src/openrct2/world/SmallScenery.h @@ -55,4 +55,4 @@ enum MAP_ELEM_SMALL_SCENERY_COLOUR_FLAG_NEEDS_SUPPORTS = (1 << 5), }; -SmallSceneryEntry* get_small_scenery_entry(ObjectEntryIndex entryIndex); +SmallSceneryEntry* GetSmallSceneryEntry(ObjectEntryIndex entryIndex); diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 118970623b..b18f61748b 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -18,7 +18,7 @@ #include "Location.hpp" #include "Scenery.h" -bool tile_element_is_underground(TileElement* tileElement) +bool TileElementIsUnderground(TileElement* tileElement) { do { diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 17b628e830..b4e73e66ef 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -708,4 +708,4 @@ enum LANDSCAPE_DOOR_OPEN = 3, }; -bool tile_element_is_underground(TileElement* tileElement); +bool TileElementIsUnderground(TileElement* tileElement); diff --git a/src/openrct2/world/TileElementsView.h b/src/openrct2/world/TileElementsView.h index 08c44ee8bc..7fa0c49f74 100644 --- a/src/openrct2/world/TileElementsView.h +++ b/src/openrct2/world/TileElementsView.h @@ -111,7 +111,7 @@ namespace OpenRCT2 Iterator begin() noexcept { - T* element = reinterpret_cast(map_get_first_element_at(_loc)); + T* element = reinterpret_cast(MapGetFirstElementAt(_loc)); if constexpr (!std::is_same_v) { diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 2c8a969105..b149d56930 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -43,8 +43,8 @@ namespace OpenRCT2::TileInspector { static bool SwapTileElements(const CoordsXY& loc, int16_t first, int16_t second) { - TileElement* const firstElement = map_get_nth_element_at(loc, first); - TileElement* const secondElement = map_get_nth_element_at(loc, second); + TileElement* const firstElement = MapGetNthElementAt(loc, first); + TileElement* const secondElement = MapGetNthElementAt(loc, second); if (firstElement == nullptr) { @@ -86,7 +86,7 @@ namespace OpenRCT2::TileInspector return nullptr; } - static int32_t numLargeScenerySequences(const CoordsXY& loc, const LargeSceneryElement* const largeScenery) + static int32_t NumLargeScenerySequences(const CoordsXY& loc, const LargeSceneryElement* const largeScenery) { const auto* const largeEntry = largeScenery->GetEntry(); const auto direction = largeScenery->GetDirection(); @@ -107,7 +107,7 @@ namespace OpenRCT2::TileInspector const auto currentTile = firstTile + rotatedCurrentTile; - const TileElement* tileElement = map_get_first_element_at(currentTile); + const TileElement* tileElement = MapGetFirstElementAt(currentTile); if (tileElement != nullptr) { do @@ -140,7 +140,7 @@ namespace OpenRCT2::TileInspector */ GameActions::Result RemoveElementAt(const CoordsXY& loc, int16_t elementIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -151,7 +151,7 @@ namespace OpenRCT2::TileInspector if (largeScenery != nullptr) { // Only delete the banner entry if there are no other parts of the large scenery to delete - if (numLargeScenerySequences(loc, largeScenery) == 1) + if (NumLargeScenerySequences(loc, largeScenery) == 1) { tileElement->RemoveBannerEntry(); } @@ -213,7 +213,7 @@ namespace OpenRCT2::TileInspector GameActions::Result RotateElementAt(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -298,7 +298,7 @@ namespace OpenRCT2::TileInspector GameActions::Result ToggleInvisibilityOfElementAt(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -367,7 +367,7 @@ namespace OpenRCT2::TileInspector windowTileInspectorElementCount++; // Select new element if there was none selected already - int16_t newIndex = static_cast((pastedElement - map_get_first_element_at(loc))); + int16_t newIndex = static_cast((pastedElement - MapGetFirstElementAt(loc))); if (windowTileInspectorSelectedIndex == -1) windowTileInspectorSelectedIndex = newIndex; else if (windowTileInspectorSelectedIndex >= newIndex) @@ -384,7 +384,7 @@ namespace OpenRCT2::TileInspector { if (isExecuting) { - const TileElement* const firstElement = map_get_first_element_at(loc); + const TileElement* const firstElement = MapGetFirstElementAt(loc); if (firstElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -463,7 +463,7 @@ namespace OpenRCT2::TileInspector GameActions::Result AnyBaseHeightOffset(const CoordsXY& loc, int16_t elementIndex, int8_t heightOffset, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -513,7 +513,7 @@ namespace OpenRCT2::TileInspector GameActions::Result SurfaceShowParkFences(const CoordsXY& loc, bool showFences, bool isExecuting) { - auto* const surfaceelement = map_get_surface_element_at(loc); + auto* const surfaceelement = MapGetSurfaceElementAt(loc); // No surface element on tile if (surfaceelement == nullptr) @@ -539,7 +539,7 @@ namespace OpenRCT2::TileInspector GameActions::Result SurfaceToggleCorner(const CoordsXY& loc, int32_t cornerIndex, bool isExecuting) { - auto* const surfaceElement = map_get_surface_element_at(loc); + auto* const surfaceElement = MapGetSurfaceElementAt(loc); // No surface element on tile if (surfaceElement == nullptr) @@ -592,7 +592,7 @@ namespace OpenRCT2::TileInspector GameActions::Result SurfaceToggleDiagonal(const CoordsXY& loc, bool isExecuting) { - auto* const surfaceElement = map_get_surface_element_at(loc); + auto* const surfaceElement = MapGetSurfaceElementAt(loc); // No surface element on tile if (surfaceElement == nullptr) @@ -616,7 +616,7 @@ namespace OpenRCT2::TileInspector GameActions::Result PathSetSloped(const CoordsXY& loc, int32_t elementIndex, bool sloped, bool isExecuting) { - TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -637,7 +637,7 @@ namespace OpenRCT2::TileInspector GameActions::Result PathSetBroken(const CoordsXY& loc, int32_t elementIndex, bool broken, bool isExecuting) { - TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -658,7 +658,7 @@ namespace OpenRCT2::TileInspector GameActions::Result PathToggleEdge(const CoordsXY& loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) { - TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -680,7 +680,7 @@ namespace OpenRCT2::TileInspector GameActions::Result EntranceMakeUsable(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { - TileElement* const entranceElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const entranceElement = MapGetNthElementAt(loc, elementIndex); if (entranceElement == nullptr || entranceElement->GetType() != TileElementType::Entrance) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -714,7 +714,7 @@ namespace OpenRCT2::TileInspector GameActions::Result WallSetSlope(const CoordsXY& loc, int32_t elementIndex, int32_t slopeValue, bool isExecuting) { - TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const wallElement = MapGetNthElementAt(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TileElementType::Wall) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -737,7 +737,7 @@ namespace OpenRCT2::TileInspector GameActions::Result WallAnimationFrameOffset( const CoordsXY& loc, int16_t elementIndex, int8_t animationFrameOffset, bool isExecuting) { - TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const wallElement = MapGetNthElementAt(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TileElementType::Wall) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -764,7 +764,7 @@ namespace OpenRCT2::TileInspector if (offset == 0) return GameActions::Result(); - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -810,7 +810,7 @@ namespace OpenRCT2::TileInspector // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is // for when you decrease the map size. - openrct2_assert(map_get_surface_element_at(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); + openrct2_assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); map_invalidate_tile_full(elem); @@ -836,7 +836,7 @@ namespace OpenRCT2::TileInspector GameActions::Result TrackSetChain( const CoordsXY& loc, int32_t elementIndex, bool entireTrackBlock, bool setChain, bool isExecuting) { - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -893,7 +893,7 @@ namespace OpenRCT2::TileInspector // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is // for when you decrease the map size. - openrct2_assert(map_get_surface_element_at(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); + openrct2_assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); map_invalidate_tile_full(elem); @@ -917,7 +917,7 @@ namespace OpenRCT2::TileInspector GameActions::Result TrackSetBlockBrake(const CoordsXY& loc, int32_t elementIndex, bool blockBrake, bool isExecuting) { - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -939,7 +939,7 @@ namespace OpenRCT2::TileInspector GameActions::Result TrackSetIndestructible( const CoordsXY& loc, int32_t elementIndex, bool isIndestructible, bool isExecuting) { - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -961,7 +961,7 @@ namespace OpenRCT2::TileInspector GameActions::Result ScenerySetQuarterLocation( const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TileElementType::SmallScenery) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -987,7 +987,7 @@ namespace OpenRCT2::TileInspector GameActions::Result ScenerySetQuarterCollision( const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TileElementType::SmallScenery) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -1010,7 +1010,7 @@ namespace OpenRCT2::TileInspector GameActions::Result BannerToggleBlockingEdge(const CoordsXY& loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) { - TileElement* const bannerElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const bannerElement = MapGetNthElementAt(loc, elementIndex); if (bannerElement == nullptr || bannerElement->GetType() != TileElementType::Banner) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index 927ef0c9ec..a92fa46923 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -32,7 +32,7 @@ * * rct2: 0x006E588E */ -void wall_remove_at(const CoordsXYRangedZ& wallPos) +void WallRemoveAt(const CoordsXYRangedZ& wallPos) { for (auto wallElement = map_get_wall_element_at(wallPos); wallElement != nullptr; wallElement = map_get_wall_element_at(wallPos)) @@ -47,20 +47,20 @@ void wall_remove_at(const CoordsXYRangedZ& wallPos) * * rct2: 0x006E57E6 */ -void wall_remove_at_z(const CoordsXYZ& wallPos) +void WallRemoveAtZ(const CoordsXYZ& wallPos) { - wall_remove_at({ wallPos, wallPos.z, wallPos.z + 48 }); + WallRemoveAt({ wallPos, wallPos.z, wallPos.z + 48 }); } /** * * rct2: 0x006E5935 */ -void wall_remove_intersecting_walls(const CoordsXYRangedZ& wallPos, Direction direction) +void WallRemoveIntersectingWalls(const CoordsXYRangedZ& wallPos, Direction direction) { TileElement* tileElement; - tileElement = map_get_first_element_at(wallPos); + tileElement = MapGetFirstElementAt(wallPos); if (tileElement == nullptr) return; do diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index 65397c101e..814589626f 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -137,7 +137,7 @@ protected: static ::testing::AssertionResult AssertIsStartPosition(const char*, const TileCoordsXYZ& location) { const uint32_t expectedSurfaceStyle = 11u; - const uint32_t style = map_get_surface_element_at(location.ToCoordsXYZ())->GetSurfaceStyle(); + const uint32_t style = MapGetSurfaceElementAt(location.ToCoordsXYZ())->GetSurfaceStyle(); if (style != expectedSurfaceStyle) return ::testing::AssertionFailure() @@ -152,7 +152,7 @@ protected: { const uint32_t forbiddenSurfaceStyle = 8u; - const uint32_t style = map_get_surface_element_at(location.ToCoordsXYZ())->GetSurfaceStyle(); + const uint32_t style = MapGetSurfaceElementAt(location.ToCoordsXYZ())->GetSurfaceStyle(); if (style == forbiddenSurfaceStyle) return ::testing::AssertionFailure() diff --git a/test/tests/TileElementsView.cpp b/test/tests/TileElementsView.cpp index 05d910fa2e..32bedf194d 100644 --- a/test/tests/TileElementsView.cpp +++ b/test/tests/TileElementsView.cpp @@ -61,7 +61,7 @@ template std::vector BuildListManual(const CoordsXY& pos) { std::vector res; - TileElement* element = map_get_first_element_at(pos); + TileElement* element = MapGetFirstElementAt(pos); if (element == nullptr) return res;