1
0
Fork 0
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:
Paramat 2018-04-24 01:34:48 +01:00 committed by GitHub
parent 06dd7c051c
commit 534971ccd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 122 additions and 160 deletions

View file

@ -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);