diff options
| author | Mel <einebeere@gmail.com> | 2023-07-07 23:05:14 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-07-07 23:14:59 +0200 |
| commit | 129f2e421e16bd008cdca8713cc91f67d103d94e (patch) | |
| tree | a4d3e1005c57591b44fd57be4c1b00441512e36d /src/World/Generation/Generator.cpp | |
| parent | f1fc192ddc4c739fa8b4b376c759b7d3218a34eb (diff) | |
| download | meowcraft-129f2e421e16bd008cdca8713cc91f67d103d94e.tar.zst meowcraft-129f2e421e16bd008cdca8713cc91f67d103d94e.zip | |
Fix minor quality issues
Diffstat (limited to 'src/World/Generation/Generator.cpp')
| -rw-r--r-- | src/World/Generation/Generator.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/World/Generation/Generator.cpp b/src/World/Generation/Generator.cpp index af3c54d..19a3dc8 100644 --- a/src/World/Generation/Generator.cpp +++ b/src/World/Generation/Generator.cpp @@ -9,11 +9,11 @@ Chunk Generator::generate(int64_t chunk_x, int64_t chunk_y) { auto landmass_map = generate_landmass_map(chunk_x, chunk_y); auto hill_map = generate_hill_map(chunk_x, chunk_y); - auto height_map = generate_height_map(landmass_map, hill_map, chunk_x, chunk_y); + auto height_map = generate_height_map(landmass_map, hill_map); auto temperature_map = generate_temperature_map(chunk_x, chunk_y); auto humidity_map = generate_humidity_map(chunk_x, chunk_y); - auto biome_map = generate_biome_map(landmass_map, hill_map, temperature_map, humidity_map, chunk_x, chunk_y); + auto biome_map = generate_biome_map(landmass_map, hill_map, temperature_map, humidity_map); auto terrain_map = generate_terrain(height_map, chunk_x, chunk_y); decorate_soil(chunk, biome_map, terrain_map); @@ -38,7 +38,7 @@ Generator::Map2D<float> Generator::name(int64_t chunk_x, int64_t chunk_y) { SIMPLE_MAP_GENERATOR(generate_landmass_map, get_landmass) SIMPLE_MAP_GENERATOR(generate_hill_map, get_hill) -Generator::Map2D<float> Generator::generate_height_map(Map2D<float>& landmass_map, Map2D<float>& hill_map, int64_t chunk_x, int64_t chunk_y) { +Generator::Map2D<float> Generator::generate_height_map(Map2D<float>& landmass_map, Map2D<float>& hill_map) { Map2D<float> height_map{}; for (uint x = 0; x < Chunk::Width; x++) { @@ -63,8 +63,7 @@ SIMPLE_MAP_GENERATOR(generate_humidity_map, get_humidity) Generator::Map2D<BiomeType> Generator::generate_biome_map( Map2D<float>& landmass_map, Map2D<float>& hill_map, - Map2D<float>& temperature_map, Map2D<float>& humidity_map, - int64_t chunk_x, int64_t chunk_y + Map2D<float>& temperature_map, Map2D<float>& humidity_map ) { Map2D<BiomeType> biome_map{}; @@ -187,9 +186,9 @@ void Generator::decorate_soil(Chunk& chunk, Map2D<BiomeType>& biome_map, Map3D<b } } -#define CURVE_START(y) constexpr auto lerp = Math::linear_interpolation; float _py = y; float _px = 0.0f; -#define CURVE_POINT(x, y) if (v < x) return lerp({_py, y}, _px, x, v); _py = y; _px = x -#define CURVE_END(y) return lerp({_py, y}, _px, 1.0f, v); +#define CURVE_START(y) constexpr auto lerp = Math::linear_interpolation; float _py = (y); float _px = 0.0f; +#define CURVE_POINT(x, y) if (v < (x)) return lerp({_py, (y)}, _px, (x), v); _py = y; _px = (x) +#define CURVE_END(y) return lerp({_py, (y)}, _px, 1.0f, v); float Generator::get_landmass(Vector<2> pos) const { auto v = m_landmass_noise.at(pos); |
