mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 06:23:04 +01:00
Code style: Remove snakes from everything world apart from Map.h (#18273)
* Remove remaining snakes from world (outside of map) * Initial few desnaking of Map.h
This commit is contained in:
@@ -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<int32_t>(_heightMapData.width + 2);
|
||||
auto maxHeight = static_cast<int32_t>(_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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user