mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-05 19:31:04 +00:00
Mgvalleys: Code cleanup
Split some long lines. Edit comments. Remove unnecessary comments and unnecessary commented-out code. Use std::fmax/fmin instead of MYMAX/MYMIN. Remove scope-limiting braces. Consistently define literals as floats, except in noise parameters. Cleanup literals in noise parameters. Remove unnecessary 'near_cavern' line. Reduce max spawn y to be consistent with other mapgens.
This commit is contained in:
parent
06dd7c051c
commit
534971ccd0
2 changed files with 122 additions and 160 deletions
|
@ -32,23 +32,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define MGVALLEYS_ALT_CHILL 0x01
|
||||
#define MGVALLEYS_HUMID_RIVERS 0x02
|
||||
|
||||
// Feed only one variable into these.
|
||||
// Feed only one variable into these
|
||||
#define MYSQUARE(x) (x) * (x)
|
||||
#define MYCUBE(x) (x) * (x) * (x)
|
||||
|
||||
class BiomeManager;
|
||||
class BiomeGenOriginal;
|
||||
|
||||
// Global profiler
|
||||
//class Profiler;
|
||||
//extern Profiler *mapgen_profiler;
|
||||
|
||||
|
||||
struct MapgenValleysParams : public MapgenParams {
|
||||
u32 spflags = MGVALLEYS_HUMID_RIVERS | MGVALLEYS_ALT_CHILL;
|
||||
u16 altitude_chill = 90; // The altitude at which temperature drops by 20C.
|
||||
u16 river_depth = 4; // How deep to carve river channels.
|
||||
u16 river_size = 5; // How wide to make rivers.
|
||||
u16 altitude_chill = 90; // The altitude at which temperature drops by 20C
|
||||
u16 river_depth = 4; // How deep to carve river channels
|
||||
u16 river_size = 5; // How wide to make rivers
|
||||
|
||||
float cave_width = 0.09f;
|
||||
s16 large_cave_depth = -33;
|
||||
|
@ -122,9 +118,7 @@ private:
|
|||
Noise *noise_valley_profile;
|
||||
|
||||
float terrainLevelAtPoint(s16 x, s16 z);
|
||||
|
||||
void calculateNoise();
|
||||
|
||||
virtual int generateTerrain();
|
||||
float terrainLevelFromNoise(TerrainNoise *tn);
|
||||
float adjustedTerrainLevelFromNoise(TerrainNoise *tn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue