Skip to content

Commit 7504cdc

Browse files
committedOct 9, 2015
Mapgen: Use mapgen-specific names for constants in headers
Update copyright years in all mapgens Add myself to copyright notices in mgv5 and mgv7
1 parent 706e7ce commit 7504cdc

8 files changed

+30
-26
lines changed
 

Diff for: ‎src/mapgen_singlenode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
3+
Copyright (C) 2010-2015 celeron55, Perttu Ahola <celeron55@gmail.com>
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU Lesser General Public License as published by

Diff for: ‎src/mapgen_singlenode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
3+
Copyright (C) 2010-2015 celeron55, Perttu Ahola <celeron55@gmail.com>
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU Lesser General Public License as published by

Diff for: ‎src/mapgen_v5.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
3+
Copyright (C) 2010-2015 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4+
Copyright (C) 2010-2015 paramat, Matt Gregory
45
56
This program is free software; you can redistribute it and/or modify
67
it under the terms of the GNU Lesser General Public License as published by
@@ -527,7 +528,7 @@ void MapgenV5::generateCaves(int max_stone_y)
527528
}
528529
}
529530

530-
if (node_max.Y > LARGE_CAVE_DEPTH)
531+
if (node_max.Y > MGV5_LARGE_CAVE_DEPTH)
531532
return;
532533

533534
PseudoRandom ps(blockseed + 21343);

Diff for: ‎src/mapgen_v5.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
3+
Copyright (C) 2010-2015 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4+
Copyright (C) 2010-2015 paramat, Matt Gregory
45
56
This program is free software; you can redistribute it and/or modify
67
it under the terms of the GNU Lesser General Public License as published by
@@ -22,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2223

2324
#include "mapgen.h"
2425

25-
#define LARGE_CAVE_DEPTH -256
26+
#define MGV5_LARGE_CAVE_DEPTH -256
2627

2728
class BiomeManager;
2829

Diff for: ‎src/mapgen_v6.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
3+
Copyright (C) 2010-2015 celeron55, Perttu Ahola <celeron55@gmail.com>
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU Lesser General Public License as published by
@@ -304,13 +304,13 @@ float MapgenV6::baseTerrainLevelFromMap(int index)
304304

305305
s16 MapgenV6::find_ground_level_from_noise(u64 seed, v2s16 p2d, s16 precision)
306306
{
307-
return baseTerrainLevelFromNoise(p2d) + AVERAGE_MUD_AMOUNT;
307+
return baseTerrainLevelFromNoise(p2d) + MGV6_AVERAGE_MUD_AMOUNT;
308308
}
309309

310310

311311
int MapgenV6::getGroundLevelAtPoint(v2s16 p)
312312
{
313-
return baseTerrainLevelFromNoise(p) + AVERAGE_MUD_AMOUNT;
313+
return baseTerrainLevelFromNoise(p) + MGV6_AVERAGE_MUD_AMOUNT;
314314
}
315315

316316

@@ -387,7 +387,7 @@ bool MapgenV6::getHaveAppleTree(v2s16 p)
387387
float MapgenV6::getMudAmount(int index)
388388
{
389389
if (flags & MG_FLAT)
390-
return AVERAGE_MUD_AMOUNT;
390+
return MGV6_AVERAGE_MUD_AMOUNT;
391391

392392
/*return ((float)AVERAGE_MUD_AMOUNT + 2.0 * noise2d_perlin(
393393
0.5+(float)p.X/200, 0.5+(float)p.Y/200,
@@ -422,13 +422,13 @@ BiomeV6Type MapgenV6::getBiome(int index, v2s16 p)
422422
if (spflags & MGV6_SNOWBIOMES) {
423423
float blend = (spflags & MGV6_BIOMEBLEND) ? noise2d(p.X, p.Y, seed) / 40 : 0;
424424

425-
if (d > FREQ_HOT + blend) {
426-
if (h > FREQ_JUNGLE + blend)
425+
if (d > MGV6_FREQ_HOT + blend) {
426+
if (h > MGV6_FREQ_JUNGLE + blend)
427427
return BT_JUNGLE;
428428
else
429429
return BT_DESERT;
430-
} else if (d < FREQ_SNOW + blend) {
431-
if (h > FREQ_TAIGA + blend)
430+
} else if (d < MGV6_FREQ_SNOW + blend) {
431+
if (h > MGV6_FREQ_TAIGA + blend)
432432
return BT_TAIGA;
433433
else
434434
return BT_TUNDRA;
@@ -646,11 +646,11 @@ int MapgenV6::generateGround()
646646
for (s16 y = node_min.Y; y <= node_max.Y; y++) {
647647
if (vm->m_data[i].getContent() == CONTENT_IGNORE) {
648648
if (y <= surface_y) {
649-
vm->m_data[i] = (y >= DESERT_STONE_BASE
649+
vm->m_data[i] = (y >= MGV6_DESERT_STONE_BASE
650650
&& bt == BT_DESERT) ?
651651
n_desert_stone : n_stone;
652652
} else if (y <= water_level) {
653-
vm->m_data[i] = (y >= ICE_BASE
653+
vm->m_data[i] = (y >= MGV6_ICE_BASE
654654
&& bt == BT_TUNDRA) ?
655655
n_ice : n_water_source;
656656
} else {

Diff for: ‎src/mapgen_v6.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
3+
Copyright (C) 2010-2015 celeron55, Perttu Ahola <celeron55@gmail.com>
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU Lesser General Public License as published by
@@ -23,13 +23,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2323
#include "mapgen.h"
2424
#include "noise.h"
2525

26-
#define AVERAGE_MUD_AMOUNT 4
27-
#define DESERT_STONE_BASE -32
28-
#define ICE_BASE 0
29-
#define FREQ_HOT 0.4
30-
#define FREQ_SNOW -0.4
31-
#define FREQ_TAIGA 0.5
32-
#define FREQ_JUNGLE 0.5
26+
#define MGV6_AVERAGE_MUD_AMOUNT 4
27+
#define MGV6_DESERT_STONE_BASE -32
28+
#define MGV6_ICE_BASE 0
29+
#define MGV6_FREQ_HOT 0.4
30+
#define MGV6_FREQ_SNOW -0.4
31+
#define MGV6_FREQ_TAIGA 0.5
32+
#define MGV6_FREQ_JUNGLE 0.5
3333

3434
//////////// Mapgen V6 flags
3535
#define MGV6_JUNGLES 0x01

Diff for: ‎src/mapgen_v7.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
3+
Copyright (C) 2010-2015 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4+
Copyright (C) 2010-2015 paramat, Matt Gregory
45
56
This program is free software; you can redistribute it and/or modify
67
it under the terms of the GNU Lesser General Public License as published by

Diff for: ‎src/mapgen_v7.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
Minetest
3-
Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
3+
Copyright (C) 2010-2015 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4+
Copyright (C) 2010-2015 paramat, Matt Gregory
45
56
This program is free software; you can redistribute it and/or modify
67
it under the terms of the GNU Lesser General Public License as published by

0 commit comments

Comments
 (0)
Please sign in to comment.