Skip to content

Commit

Permalink
Fix MgStoneType and BiomeType enum names
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed May 28, 2016
1 parent 87bc39d commit 9b5c492
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions src/mapgen.cpp
Expand Up @@ -384,7 +384,7 @@ MgStoneType MapgenBasic::generateBiomes()
{
v3s16 em = vm->m_area.getExtent();
u32 index = 0;
MgStoneType stone_type = STONE;
MgStoneType stone_type = MGSTONE_STONE;

for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
Expand Down Expand Up @@ -429,9 +429,9 @@ MgStoneType MapgenBasic::generateBiomes()
// This is more efficient than detecting per-node and will not
// miss any desert stone or sandstone biomes.
if (biome->c_stone == c_desert_stone)
stone_type = DESERT_STONE;
stone_type = MGSTONE_DESERT_STONE;
else if (biome->c_stone == c_sandstone)
stone_type = SANDSTONE;
stone_type = MGSTONE_SANDSTONE;
}

if (c == c_stone) {
Expand Down
6 changes: 3 additions & 3 deletions src/mapgen.h
Expand Up @@ -76,9 +76,9 @@ enum GenNotifyType {

// TODO(hmmmm/paramat): make stone type selection dynamic
enum MgStoneType {
STONE,
DESERT_STONE,
SANDSTONE,
MGSTONE_STONE,
MGSTONE_DESERT_STONE,
MGSTONE_SANDSTONE,
};

struct GenNotifyEvent {
Expand Down
6 changes: 3 additions & 3 deletions src/mapgen_flat.cpp
Expand Up @@ -257,7 +257,7 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
dp.np_density = nparams_dungeon_density;
dp.np_wetness = nparams_dungeon_wetness;
dp.c_water = c_water_source;
if (stone_type == STONE) {
if (stone_type == MGSTONE_STONE) {
dp.c_cobble = c_cobble;
dp.c_moss = c_mossycobble;
dp.c_stair = c_stair_cobble;
Expand All @@ -267,7 +267,7 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(1, 2, 1);
dp.roomsize = v3s16(0, 0, 0);
dp.notifytype = GENNOTIFY_DUNGEON;
} else if (stone_type == DESERT_STONE) {
} else if (stone_type == MGSTONE_DESERT_STONE) {
dp.c_cobble = c_desert_stone;
dp.c_moss = c_desert_stone;
dp.c_stair = c_desert_stone;
Expand All @@ -277,7 +277,7 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(2, 3, 2);
dp.roomsize = v3s16(2, 5, 2);
dp.notifytype = GENNOTIFY_TEMPLE;
} else if (stone_type == SANDSTONE) {
} else if (stone_type == MGSTONE_SANDSTONE) {
dp.c_cobble = c_sandstonebrick;
dp.c_moss = c_sandstonebrick;
dp.c_stair = c_sandstonebrick;
Expand Down
6 changes: 3 additions & 3 deletions src/mapgen_fractal.cpp
Expand Up @@ -273,7 +273,7 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
dp.np_density = nparams_dungeon_density;
dp.np_wetness = nparams_dungeon_wetness;
dp.c_water = c_water_source;
if (stone_type == STONE) {
if (stone_type == MGSTONE_STONE) {
dp.c_cobble = c_cobble;
dp.c_moss = c_mossycobble;
dp.c_stair = c_stair_cobble;
Expand All @@ -283,7 +283,7 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(1, 2, 1);
dp.roomsize = v3s16(0, 0, 0);
dp.notifytype = GENNOTIFY_DUNGEON;
} else if (stone_type == DESERT_STONE) {
} else if (stone_type == MGSTONE_DESERT_STONE) {
dp.c_cobble = c_desert_stone;
dp.c_moss = c_desert_stone;
dp.c_stair = c_desert_stone;
Expand All @@ -293,7 +293,7 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(2, 3, 2);
dp.roomsize = v3s16(2, 5, 2);
dp.notifytype = GENNOTIFY_TEMPLE;
} else if (stone_type == SANDSTONE) {
} else if (stone_type == MGSTONE_SANDSTONE) {
dp.c_cobble = c_sandstonebrick;
dp.c_moss = c_sandstonebrick;
dp.c_stair = c_sandstonebrick;
Expand Down
6 changes: 3 additions & 3 deletions src/mapgen_v5.cpp
Expand Up @@ -255,7 +255,7 @@ void MapgenV5::makeChunk(BlockMakeData *data)
dp.np_density = nparams_dungeon_density;
dp.np_wetness = nparams_dungeon_wetness;
dp.c_water = c_water_source;
if (stone_type == STONE) {
if (stone_type == MGSTONE_STONE) {
dp.c_cobble = c_cobble;
dp.c_moss = c_mossycobble;
dp.c_stair = c_stair_cobble;
Expand All @@ -265,7 +265,7 @@ void MapgenV5::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(1, 2, 1);
dp.roomsize = v3s16(0, 0, 0);
dp.notifytype = GENNOTIFY_DUNGEON;
} else if (stone_type == DESERT_STONE) {
} else if (stone_type == MGSTONE_DESERT_STONE) {
dp.c_cobble = c_desert_stone;
dp.c_moss = c_desert_stone;
dp.c_stair = c_desert_stone;
Expand All @@ -275,7 +275,7 @@ void MapgenV5::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(2, 3, 2);
dp.roomsize = v3s16(2, 5, 2);
dp.notifytype = GENNOTIFY_TEMPLE;
} else if (stone_type == SANDSTONE) {
} else if (stone_type == MGSTONE_SANDSTONE) {
dp.c_cobble = c_sandstonebrick;
dp.c_moss = c_sandstonebrick;
dp.c_stair = c_sandstonebrick;
Expand Down
6 changes: 3 additions & 3 deletions src/mapgen_v7.cpp
Expand Up @@ -285,7 +285,7 @@ void MapgenV7::makeChunk(BlockMakeData *data)
dp.np_density = nparams_dungeon_density;
dp.np_wetness = nparams_dungeon_wetness;
dp.c_water = c_water_source;
if (stone_type == STONE) {
if (stone_type == MGSTONE_STONE) {
dp.c_cobble = c_cobble;
dp.c_moss = c_mossycobble;
dp.c_stair = c_stair_cobble;
Expand All @@ -295,7 +295,7 @@ void MapgenV7::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(1, 2, 1);
dp.roomsize = v3s16(0, 0, 0);
dp.notifytype = GENNOTIFY_DUNGEON;
} else if (stone_type == DESERT_STONE) {
} else if (stone_type == MGSTONE_DESERT_STONE) {
dp.c_cobble = c_desert_stone;
dp.c_moss = c_desert_stone;
dp.c_stair = c_desert_stone;
Expand All @@ -305,7 +305,7 @@ void MapgenV7::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(2, 3, 2);
dp.roomsize = v3s16(2, 5, 2);
dp.notifytype = GENNOTIFY_TEMPLE;
} else if (stone_type == SANDSTONE) {
} else if (stone_type == MGSTONE_SANDSTONE) {
dp.c_cobble = c_sandstonebrick;
dp.c_moss = c_sandstonebrick;
dp.c_stair = c_sandstonebrick;
Expand Down
6 changes: 3 additions & 3 deletions src/mapgen_valleys.cpp
Expand Up @@ -312,7 +312,7 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
dp.np_density = nparams_dungeon_density;
dp.np_wetness = nparams_dungeon_wetness;
dp.c_water = c_water_source;
if (stone_type == STONE) {
if (stone_type == MGSTONE_STONE) {
dp.c_cobble = c_cobble;
dp.c_moss = c_mossycobble;
dp.c_stair = c_stair_cobble;
Expand All @@ -322,7 +322,7 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(1, 2, 1);
dp.roomsize = v3s16(0, 0, 0);
dp.notifytype = GENNOTIFY_DUNGEON;
} else if (stone_type == DESERT_STONE) {
} else if (stone_type == MGSTONE_DESERT_STONE) {
dp.c_cobble = c_desert_stone;
dp.c_moss = c_desert_stone;
dp.c_stair = c_desert_stone;
Expand All @@ -332,7 +332,7 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
dp.holesize = v3s16(2, 3, 2);
dp.roomsize = v3s16(2, 5, 2);
dp.notifytype = GENNOTIFY_TEMPLE;
} else if (stone_type == SANDSTONE) {
} else if (stone_type == MGSTONE_SANDSTONE) {
dp.c_cobble = c_sandstonebrick;
dp.c_moss = c_sandstonebrick;
dp.c_stair = c_sandstonebrick;
Expand Down
14 changes: 7 additions & 7 deletions src/mg_biome.h
Expand Up @@ -33,13 +33,13 @@ class BiomeManager;

#define BIOME_NONE ((u8)0)

enum BiomeType
{
BIOME_NORMAL,
BIOME_LIQUID,
BIOME_NETHER,
BIOME_AETHER,
BIOME_FLAT
// TODO(hmmmm): Decide whether this is obsolete or will be used in the future
enum BiomeType {
BIOMETYPE_NORMAL,
BIOMETYPE_LIQUID,
BIOMETYPE_NETHER,
BIOMETYPE_AETHER,
BIOMETYPE_FLAT,
};

class Biome : public ObjDef, public NodeResolver {
Expand Down
12 changes: 6 additions & 6 deletions src/script/lua_api/l_mapgen.cpp
Expand Up @@ -39,11 +39,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,

struct EnumString ModApiMapgen::es_BiomeTerrainType[] =
{
{BIOME_NORMAL, "normal"},
{BIOME_LIQUID, "liquid"},
{BIOME_NETHER, "nether"},
{BIOME_AETHER, "aether"},
{BIOME_FLAT, "flat"},
{BIOMETYPE_NORMAL, "normal"},
{BIOMETYPE_LIQUID, "liquid"},
{BIOMETYPE_NETHER, "nether"},
{BIOMETYPE_AETHER, "aether"},
{BIOMETYPE_FLAT, "flat"},
{0, NULL},
};

Expand Down Expand Up @@ -371,7 +371,7 @@ Biome *read_biome_def(lua_State *L, int index, INodeDefManager *ndef)
return NULL;

BiomeType biometype = (BiomeType)getenumfield(L, index, "type",
ModApiMapgen::es_BiomeTerrainType, BIOME_NORMAL);
ModApiMapgen::es_BiomeTerrainType, BIOMETYPE_NORMAL);
Biome *b = BiomeManager::create(biometype);

b->name = getstringfield_default(L, index, "name", "");
Expand Down

0 comments on commit 9b5c492

Please sign in to comment.