Skip to content

Commit

Permalink
Mgv6: Move global mapgen flag 'flat' into mgv6 spflags
Browse files Browse the repository at this point in the history
Add mgv6 spflag 'flat'
Global flag is kept for backwards compatibility but is now undocumented
  • Loading branch information
paramat committed Nov 13, 2015
1 parent 657a16d commit 4434498
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions builtin/settingtypes.txt
Expand Up @@ -829,10 +829,10 @@ max_block_generate_distance (Max block generate distance) int 6
map_generation_limit (Map generation limit) int 31000 0 31000

# Global map generation attributes.
# The 'trees' flag only has effect in mgv6.
# Flags that are not specified in the flag string are not modified from the default.
# Flags starting with "no" are used to explicitly disable them.
# 'trees' and 'flat' flags only have effect in mgv6.
mg_flags (Mapgen flags) flags trees,caves,dungeons,light trees,caves,dungeons,light,flat,notrees,nocaves,nodungeons,nolight,noflat
mg_flags (Mapgen flags) flags trees,caves,dungeons,light trees,caves,dungeons,light,notrees,nocaves,nodungeons,nolight

[**Advanced]

Expand Down Expand Up @@ -889,7 +889,7 @@ mgv5_np_cave2 (Mapgen v5 cave2 noise parameters) noise_params 0, 12, (50, 50, 50
# When snowbiomes are enabled jungles are enabled and the jungles flag is ignored.
# Flags that are not specified in the flag string are not modified from the default.
# Flags starting with "no" are used to explicitly disable them.
mgv6_spflags (Mapgen v6 flags) flags jungles,biomeblend,mudflow,snowbiomes jungles,biomeblend,mudflow,snowbiomes,nojungles,nobiomeblend,nomudflow,nosnowbiomes
mgv6_spflags (Mapgen v6 flags) flags jungles,biomeblend,mudflow,snowbiomes jungles,biomeblend,mudflow,snowbiomes,flat,nojungles,nobiomeblend,nomudflow,nosnowbiomes,noflat

# Controls size of deserts and beaches in Mapgen v6.
# When snowbiomes are enabled 'mgv6_freq_desert' is ignored.
Expand Down
6 changes: 3 additions & 3 deletions minetest.conf.example
Expand Up @@ -1021,10 +1021,10 @@
# map_generation_limit = 31000

# Global map generation attributes.
# The 'trees' flag only has effect in mgv6.
# Flags that are not specified in the flag string are not modified from the default.
# Flags starting with "no" are used to explicitly disable them.
# 'trees' and 'flat' flags only have effect in mgv6.
# type: flags possible values: trees, caves, dungeons, light, flat, notrees, nocaves, nodungeons, nolight, noflat
# type: flags possible values: trees, caves, dungeons, light, notrees, nocaves, nodungeons, nolight
# mg_flags = trees,caves,dungeons,light

### Advanced
Expand Down Expand Up @@ -1093,7 +1093,7 @@
# When snowbiomes are enabled jungles are enabled and the jungles flag is ignored.
# Flags that are not specified in the flag string are not modified from the default.
# Flags starting with "no" are used to explicitly disable them.
# type: flags possible values: jungles, biomeblend, mudflow, snowbiomes, nojungles, nobiomeblend, nomudflow, nosnowbiomes
# type: flags possible values: jungles, biomeblend, mudflow, snowbiomes, flat, nojungles, nobiomeblend, nomudflow, nosnowbiomes, noflat
# mgv6_spflags = jungles,biomeblend,mudflow,snowbiomes

# Controls size of deserts and beaches in Mapgen v6.
Expand Down
9 changes: 5 additions & 4 deletions src/mapgen_v6.cpp
Expand Up @@ -42,6 +42,7 @@ FlagDesc flagdesc_mapgen_v6[] = {
{"biomeblend", MGV6_BIOMEBLEND},
{"mudflow", MGV6_MUDFLOW},
{"snowbiomes", MGV6_SNOWBIOMES},
{"flat", MGV6_FLAT},
{NULL, 0}
};

Expand Down Expand Up @@ -263,7 +264,7 @@ float MapgenV6::baseTerrainLevel(float terrain_base, float terrain_higher,

float MapgenV6::baseTerrainLevelFromNoise(v2s16 p)
{
if (flags & MG_FLAT)
if ((spflags & MGV6_FLAT) || (flags & MG_FLAT))
return water_level;

float terrain_base = NoisePerlin2D_PO(&noise_terrain_base->np,
Expand All @@ -289,7 +290,7 @@ float MapgenV6::baseTerrainLevelFromMap(v2s16 p)

float MapgenV6::baseTerrainLevelFromMap(int index)
{
if (flags & MG_FLAT)
if ((spflags & MGV6_FLAT) || (flags & MG_FLAT))
return water_level;

float terrain_base = noise_terrain_base->result[index];
Expand Down Expand Up @@ -386,7 +387,7 @@ bool MapgenV6::getHaveAppleTree(v2s16 p)

float MapgenV6::getMudAmount(int index)
{
if (flags & MG_FLAT)
if ((spflags & MGV6_FLAT) || (flags & MG_FLAT))
return MGV6_AVERAGE_MUD_AMOUNT;

/*return ((float)AVERAGE_MUD_AMOUNT + 2.0 * noise2d_perlin(
Expand Down Expand Up @@ -603,7 +604,7 @@ void MapgenV6::calculateNoise()
int fx = full_node_min.X;
int fz = full_node_min.Z;

if (!(flags & MG_FLAT)) {
if (!((spflags & MGV6_FLAT) || (flags & MG_FLAT))) {
noise_terrain_base->perlinMap2D_PO(x, 0.5, z, 0.5);
noise_terrain_higher->perlinMap2D_PO(x, 0.5, z, 0.5);
noise_steepness->perlinMap2D_PO(x, 0.5, z, 0.5);
Expand Down
1 change: 1 addition & 0 deletions src/mapgen_v6.h
Expand Up @@ -36,6 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define MGV6_BIOMEBLEND 0x02
#define MGV6_MUDFLOW 0x04
#define MGV6_SNOWBIOMES 0x08
#define MGV6_FLAT 0x10


extern FlagDesc flagdesc_mapgen_v6[];
Expand Down

0 comments on commit 4434498

Please sign in to comment.