From 0be51dd56574003f771b0abcb2ac9e54488d4a87 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 12 Sep 2024 18:17:19 +0200 Subject: [PATCH] Move default settings to MapGen header --- src/openrct2-ui/windows/MapGen.cpp | 30 +------------------------ src/openrct2/world/MapGen.h | 36 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 47 deletions(-) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index b3b9eb1522..5796c55df0 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -267,35 +267,7 @@ namespace OpenRCT2::Ui::Windows private: ResizeDirection _resizeDirection{ ResizeDirection::Both }; bool _mapWidthAndHeightLinked{ true }; - - MapGenSettings _settings{ - // Base - .algorithm = MapGenAlgorithm::blank, - .mapSize{ 150, 150 }, - .waterLevel = 6, - .landTexture = 0, - .edgeTexture = 0, - .heightmapLow = 14, - .heightmapHigh = 60, - .smoothTileEdges = true, - - // Features (e.g. tree, rivers, lakes etc.) - .trees = true, - .treeToLandRatio = 25, - .minTreeAltitude = 10, - .maxTreeAltitude = 50, - .beaches = true, - - // Simplex Noise Parameters - .simplex_base_freq = 175, - .simplex_octaves = 6, - - // Height map _settings - .smooth_height_map = false, - .smooth_strength = 1, - .normalize_height = false, - }; - + MapGenSettings _settings{}; bool _randomTerrain = true; bool _heightmapLoaded = false; diff --git a/src/openrct2/world/MapGen.h b/src/openrct2/world/MapGen.h index 5e56f8af4a..05c7456ae8 100644 --- a/src/openrct2/world/MapGen.h +++ b/src/openrct2/world/MapGen.h @@ -22,30 +22,30 @@ enum class MapGenAlgorithm : uint8_t struct MapGenSettings { // Base - MapGenAlgorithm algorithm; - TileCoordsXY mapSize; - int32_t waterLevel; - int32_t landTexture; - int32_t edgeTexture; - int32_t heightmapLow; - int32_t heightmapHigh; - bool smoothTileEdges; + MapGenAlgorithm algorithm = MapGenAlgorithm::blank; + TileCoordsXY mapSize{ 150, 150 }; + int32_t waterLevel = 6; + int32_t landTexture = 0; + int32_t edgeTexture = 0; + int32_t heightmapLow = 14; + int32_t heightmapHigh = 60; + bool smoothTileEdges = true; // Features (e.g. tree, rivers, lakes etc.) - bool trees; - int32_t treeToLandRatio; - int32_t minTreeAltitude; - int32_t maxTreeAltitude; - bool beaches; + bool trees = true; + int32_t treeToLandRatio = 25; + int32_t minTreeAltitude = 10; + int32_t maxTreeAltitude = 50; + bool beaches = true; // Simplex Noise Parameters - int32_t simplex_base_freq; - int32_t simplex_octaves; + int32_t simplex_base_freq = 175; + int32_t simplex_octaves = 6; // Height map settings - bool smooth_height_map; - uint32_t smooth_strength; - bool normalize_height; + bool smooth_height_map = true; + uint32_t smooth_strength = 1; + bool normalize_height = true; }; void MapGenGenerate(MapGenSettings* settings);