From ccced859f544e4b93d4e6e5347528725459a9e4b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 1 Oct 2024 14:28:16 +0100 Subject: [PATCH] Codechange: Mark some water region functions static. (#12964) These functions are not used elsewhere. This may affect how compilers generate code. --- src/pathfinder/water_regions.cpp | 10 +++++----- src/pathfinder/water_regions.h | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pathfinder/water_regions.cpp b/src/pathfinder/water_regions.cpp index cb5930d190..6ef8d2c998 100644 --- a/src/pathfinder/water_regions.cpp +++ b/src/pathfinder/water_regions.cpp @@ -222,14 +222,14 @@ public: std::vector _water_region_data; std::vector _is_water_region_valid; -TileIndex GetTileIndexFromLocalCoordinate(int region_x, int region_y, int local_x, int local_y) +static TileIndex GetTileIndexFromLocalCoordinate(int region_x, int region_y, int local_x, int local_y) { assert(local_x >= 0 && local_x < WATER_REGION_EDGE_LENGTH); assert(local_y >= 0 && local_y < WATER_REGION_EDGE_LENGTH); return TileXY(WATER_REGION_EDGE_LENGTH * region_x + local_x, WATER_REGION_EDGE_LENGTH * region_y + local_y); } -TileIndex GetEdgeTileCoordinate(int region_x, int region_y, DiagDirection side, int x_or_y) +static TileIndex GetEdgeTileCoordinate(int region_x, int region_y, DiagDirection side, int x_or_y) { assert(x_or_y >= 0 && x_or_y < WATER_REGION_EDGE_LENGTH); switch (side) { @@ -241,7 +241,7 @@ TileIndex GetEdgeTileCoordinate(int region_x, int region_y, DiagDirection side, } } -WaterRegion GetUpdatedWaterRegion(uint16_t region_x, uint16_t region_y) +static WaterRegion GetUpdatedWaterRegion(uint16_t region_x, uint16_t region_y) { const int index = GetWaterRegionIndex(region_x, region_y); WaterRegion water_region(region_x, region_y, _water_region_data[index]); @@ -252,7 +252,7 @@ WaterRegion GetUpdatedWaterRegion(uint16_t region_x, uint16_t region_y) return water_region; } -WaterRegion GetUpdatedWaterRegion(TileIndex tile) +static WaterRegion GetUpdatedWaterRegion(TileIndex tile) { return GetUpdatedWaterRegion(GetWaterRegionX(tile), GetWaterRegionY(tile)); } @@ -261,7 +261,7 @@ WaterRegion GetUpdatedWaterRegion(TileIndex tile) * Returns the index of the water region. * @param water_region The water region to return the index for. */ -TWaterRegionIndex GetWaterRegionIndex(const WaterRegionDesc &water_region) +static TWaterRegionIndex GetWaterRegionIndex(const WaterRegionDesc &water_region) { return GetWaterRegionIndex(water_region.x, water_region.y); } diff --git a/src/pathfinder/water_regions.h b/src/pathfinder/water_regions.h index 451514376b..bc278dd2aa 100644 --- a/src/pathfinder/water_regions.h +++ b/src/pathfinder/water_regions.h @@ -49,8 +49,6 @@ struct WaterRegionDesc bool operator!=(const WaterRegionDesc &other) const { return !(*this == other); } }; -TWaterRegionIndex GetWaterRegionIndex(const WaterRegionDesc &water_region); - int CalculateWaterRegionPatchHash(const WaterRegionPatchDesc &water_region_patch); TileIndex GetWaterRegionCenterTile(const WaterRegionDesc &water_region);