Mapgen v5/6/7: Cleanup node resolver and aliases
authorparamat <mat.gregory@virginmedia.com>
Tue, 12 May 2015 01:20:18 +0000 (02:20 +0100)
committerparamat <mat.gregory@virginmedia.com>
Tue, 12 May 2015 03:40:53 +0000 (04:40 +0100)
src/mapgen_v5.cpp
src/mapgen_v5.h
src/mapgen_v6.cpp
src/mapgen_v6.h
src/mapgen_v7.cpp
src/mapgen_v7.h

index 887ce2a5d43e42098ebe3a73b85e1ec4ca4f4f27..6985e0a1a086db070eed9273a18809ed61768db2 100644 (file)
@@ -79,30 +79,28 @@ MapgenV5::MapgenV5(int mapgenid, MapgenParams *params, EmergeManager *emerge)
        //// Resolve nodes to be used
        INodeDefManager *ndef = emerge->ndef;
 
-       c_stone           = ndef->getId("mapgen_stone");
-       c_dirt            = ndef->getId("mapgen_dirt");
-       c_dirt_with_grass = ndef->getId("mapgen_dirt_with_grass");
-       c_sand            = ndef->getId("mapgen_sand");
-       c_water_source    = ndef->getId("mapgen_water_source");
-       c_lava_source     = ndef->getId("mapgen_lava_source");
-       c_gravel          = ndef->getId("mapgen_gravel");
-       c_cobble          = ndef->getId("mapgen_cobble");
-       c_ice             = ndef->getId("default:ice");
-       c_desert_stone    = ndef->getId("mapgen_desert_stone");
-       c_mossycobble     = ndef->getId("mapgen_mossycobble");
-       c_sandbrick       = ndef->getId("mapgen_sandstonebrick");
-       c_stair_cobble    = ndef->getId("mapgen_stair_cobble");
-       c_stair_sandstone = ndef->getId("mapgen_stair_sandstone");
+       c_stone                = ndef->getId("mapgen_stone");
+       c_water_source         = ndef->getId("mapgen_water_source");
+       c_lava_source          = ndef->getId("mapgen_lava_source");
+       c_desert_stone         = ndef->getId("mapgen_desert_stone");
+       c_ice                  = ndef->getId("mapgen_ice");
+
+       c_cobble               = ndef->getId("mapgen_cobble");
+       c_stair_cobble         = ndef->getId("mapgen_stair_cobble");
+       c_mossycobble          = ndef->getId("mapgen_mossycobble");
+       c_sandstonebrick       = ndef->getId("mapgen_sandstonebrick");
+       c_stair_sandstonebrick = ndef->getId("mapgen_stair_sandstonebrick");
+
        if (c_ice == CONTENT_IGNORE)
                c_ice = CONTENT_AIR;
        if (c_mossycobble == CONTENT_IGNORE)
                c_mossycobble = c_cobble;
-       if (c_sandbrick == CONTENT_IGNORE)
-               c_sandbrick = c_desert_stone;
        if (c_stair_cobble == CONTENT_IGNORE)
                c_stair_cobble = c_cobble;
-       if (c_stair_sandstone == CONTENT_IGNORE)
-               c_stair_sandstone = c_sandbrick;
+       if (c_sandstonebrick == CONTENT_IGNORE)
+               c_sandstonebrick = c_desert_stone;
+       if (c_stair_sandstonebrick == CONTENT_IGNORE)
+               c_stair_sandstonebrick = c_sandstonebrick;
 }
 
 
@@ -251,27 +249,27 @@ void MapgenV5::makeChunk(BlockMakeData *data)
                dp.np_rarity  = nparams_dungeon_rarity;
                dp.np_density = nparams_dungeon_density;
                dp.np_wetness = nparams_dungeon_wetness;
-               dp.c_water = c_water_source;
+               dp.c_water    = c_water_source;
                if (desert_stone) {
-                       dp.c_cobble  = c_sandbrick;
-                       dp.c_moss    = c_sandbrick; // should make this 'cracked sandstone' later
-                       dp.c_stair   = c_stair_sandstone;
+                       dp.c_cobble = c_desert_stone;
+                       dp.c_moss   = c_desert_stone;
+                       dp.c_stair  = c_desert_stone;
 
                        dp.diagonal_dirs = true;
-                       dp.mossratio  = 0.0;
-                       dp.holesize   = v3s16(2, 3, 2);
-                       dp.roomsize   = v3s16(2, 5, 2);
-                       dp.notifytype = GENNOTIFY_TEMPLE;
+                       dp.mossratio     = 0.0;
+                       dp.holesize      = v3s16(2, 3, 2);
+                       dp.roomsize      = v3s16(2, 5, 2);
+                       dp.notifytype    = GENNOTIFY_TEMPLE;
                } else {
-                       dp.c_cobble  = c_cobble;
-                       dp.c_moss    = c_mossycobble;
-                       dp.c_stair   = c_stair_cobble;
+                       dp.c_cobble = c_cobble;
+                       dp.c_moss   = c_mossycobble;
+                       dp.c_stair  = c_stair_cobble;
 
                        dp.diagonal_dirs = false;
-                       dp.mossratio  = 3.0;
-                       dp.holesize   = v3s16(1, 2, 1);
-                       dp.roomsize   = v3s16(0, 0, 0);
-                       dp.notifytype = GENNOTIFY_DUNGEON;
+                       dp.mossratio     = 3.0;
+                       dp.holesize      = v3s16(1, 2, 1);
+                       dp.roomsize      = v3s16(0, 0, 0);
+                       dp.notifytype    = GENNOTIFY_DUNGEON;
                }
 
                DungeonGen dgen(this, &dp);
index e679bdec244ee4a9527fe97c768081097363be0e..8ef9d0c64b45830ed07a366d1cc60b703dc4021e 100644 (file)
@@ -73,20 +73,16 @@ public:
        Noise *noise_humidity;
 
        content_t c_stone;
-       content_t c_dirt;
-       content_t c_dirt_with_grass;
-       content_t c_sand;
        content_t c_water_source;
        content_t c_lava_source;
+       content_t c_desert_stone;
        content_t c_ice;
-       content_t c_gravel;
+
        content_t c_cobble;
-       content_t c_desert_sand;
-       content_t c_desert_stone;
-       content_t c_mossycobble;
-       content_t c_sandbrick;
        content_t c_stair_cobble;
-       content_t c_stair_sandstone;
+       content_t c_mossycobble;
+       content_t c_sandstonebrick;
+       content_t c_stair_sandstonebrick;
 
        MapgenV5(int mapgenid, MapgenParams *params, EmergeManager *emerge);
        ~MapgenV5();
index 6fcd457fb688921c369a4d9b431f8865c0baef23..a6beb710b6ca5d9f991e5b168484367389ec5966 100644 (file)
@@ -89,30 +89,25 @@ MapgenV6::MapgenV6(int mapgenid, MapgenParams *params, EmergeManager *emerge)
        c_water_source    = ndef->getId("mapgen_water_source");
        c_lava_source     = ndef->getId("mapgen_lava_source");
        c_gravel          = ndef->getId("mapgen_gravel");
-       c_cobble          = ndef->getId("mapgen_cobble");
-       c_desert_sand     = ndef->getId("mapgen_desert_sand");
        c_desert_stone    = ndef->getId("mapgen_desert_stone");
+       c_desert_sand     = ndef->getId("mapgen_desert_sand");
        c_dirt_with_snow  = ndef->getId("mapgen_dirt_with_snow");
        c_snow            = ndef->getId("mapgen_snow");
        c_snowblock       = ndef->getId("mapgen_snowblock");
        c_ice             = ndef->getId("mapgen_ice");
 
-       c_mossycobble     = ndef->getId("mapgen_mossycobble");
-       c_sandbrick       = ndef->getId("mapgen_sandstonebrick");
+       c_cobble          = ndef->getId("mapgen_cobble");
        c_stair_cobble    = ndef->getId("mapgen_stair_cobble");
-       c_stair_sandstone = ndef->getId("mapgen_stair_sandstone");
+       c_mossycobble     = ndef->getId("mapgen_mossycobble");
+
        if (c_desert_sand == CONTENT_IGNORE)
                c_desert_sand = c_sand;
        if (c_desert_stone == CONTENT_IGNORE)
                c_desert_stone = c_stone;
        if (c_mossycobble == CONTENT_IGNORE)
                c_mossycobble = c_cobble;
-       if (c_sandbrick == CONTENT_IGNORE)
-               c_sandbrick = c_desert_stone;
        if (c_stair_cobble == CONTENT_IGNORE)
                c_stair_cobble = c_cobble;
-       if (c_stair_sandstone == CONTENT_IGNORE)
-               c_stair_sandstone = c_sandbrick;
 }
 
 
@@ -543,27 +538,27 @@ void MapgenV6::makeChunk(BlockMakeData *data)
                dp.np_rarity  = nparams_dungeon_rarity;
                dp.np_density = nparams_dungeon_density;
                dp.np_wetness = nparams_dungeon_wetness;
-               dp.c_water = c_water_source;
+               dp.c_water    = c_water_source;
                if (getBiome(0, v2s16(node_min.X, node_min.Z)) == BT_DESERT) {
-                       dp.c_cobble  = c_sandbrick;
-                       dp.c_moss    = c_sandbrick; // should make this 'cracked sandstone' later
-                       dp.c_stair   = c_stair_sandstone;
+                       dp.c_cobble = c_desert_stone;
+                       dp.c_moss   = c_desert_stone;
+                       dp.c_stair  = c_desert_stone;
 
                        dp.diagonal_dirs = true;
-                       dp.mossratio  = 0.0;
-                       dp.holesize   = v3s16(2, 3, 2);
-                       dp.roomsize   = v3s16(2, 5, 2);
-                       dp.notifytype = GENNOTIFY_TEMPLE;
+                       dp.mossratio     = 0.0;
+                       dp.holesize      = v3s16(2, 3, 2);
+                       dp.roomsize      = v3s16(2, 5, 2);
+                       dp.notifytype    = GENNOTIFY_TEMPLE;
                } else {
-                       dp.c_cobble  = c_cobble;
-                       dp.c_moss    = c_mossycobble;
-                       dp.c_stair   = c_stair_cobble;
+                       dp.c_cobble = c_cobble;
+                       dp.c_moss   = c_mossycobble;
+                       dp.c_stair  = c_stair_cobble;
 
                        dp.diagonal_dirs = false;
-                       dp.mossratio  = 3.0;
-                       dp.holesize   = v3s16(1, 2, 1);
-                       dp.roomsize   = v3s16(0, 0, 0);
-                       dp.notifytype = GENNOTIFY_DUNGEON;
+                       dp.mossratio     = 3.0;
+                       dp.holesize      = v3s16(1, 2, 1);
+                       dp.roomsize      = v3s16(0, 0, 0);
+                       dp.notifytype    = GENNOTIFY_DUNGEON;
                }
 
                DungeonGen dgen(this, &dp);
index c729c04e7360a600b88305b05459cb051f9c0a4c..a540c4b0216eed8d86c37be8b1ce91d5b7205672 100644 (file)
@@ -111,18 +111,16 @@ public:
        content_t c_water_source;
        content_t c_lava_source;
        content_t c_gravel;
-       content_t c_cobble;
-       content_t c_desert_sand;
        content_t c_desert_stone;
+       content_t c_desert_sand;
        content_t c_dirt_with_snow;
        content_t c_snow;
        content_t c_snowblock;
        content_t c_ice;
 
+       content_t c_cobble;
        content_t c_mossycobble;
-       content_t c_sandbrick;
        content_t c_stair_cobble;
-       content_t c_stair_sandstone;
 
        MapgenV6(int mapgenid, MapgenParams *params, EmergeManager *emerge);
        ~MapgenV6();
index 443aea2815b19bf8eda4bbc61ac97331e0a14e5c..640ad10f4a48c143828bb3e871d64886b1cb53e0 100644 (file)
@@ -88,29 +88,28 @@ MapgenV7::MapgenV7(int mapgenid, MapgenParams *params, EmergeManager *emerge)
        //// Resolve nodes to be used
        INodeDefManager *ndef = emerge->ndef;
 
-       c_stone           = ndef->getId("mapgen_stone");
-       c_dirt            = ndef->getId("mapgen_dirt");
-       c_dirt_with_grass = ndef->getId("mapgen_dirt_with_grass");
-       c_sand            = ndef->getId("mapgen_sand");
-       c_water_source    = ndef->getId("mapgen_water_source");
-       c_lava_source     = ndef->getId("mapgen_lava_source");
-       c_ice             = ndef->getId("default:ice");
-       c_cobble          = ndef->getId("mapgen_cobble");
-       c_desert_stone    = ndef->getId("mapgen_desert_stone");
-       c_mossycobble     = ndef->getId("mapgen_mossycobble");
-       c_sandbrick       = ndef->getId("mapgen_sandstonebrick");
-       c_stair_cobble    = ndef->getId("mapgen_stair_cobble");
-       c_stair_sandstone = ndef->getId("mapgen_stair_sandstone");
+       c_stone                = ndef->getId("mapgen_stone");
+       c_water_source         = ndef->getId("mapgen_water_source");
+       c_lava_source          = ndef->getId("mapgen_lava_source");
+       c_desert_stone         = ndef->getId("mapgen_desert_stone");
+       c_ice                  = ndef->getId("mapgen_ice");
+
+       c_cobble               = ndef->getId("mapgen_cobble");
+       c_stair_cobble         = ndef->getId("mapgen_stair_cobble");
+       c_mossycobble          = ndef->getId("mapgen_mossycobble");
+       c_sandstonebrick       = ndef->getId("mapgen_sandstonebrick");
+       c_stair_sandstonebrick = ndef->getId("mapgen_stair_sandstonebrick");
+
        if (c_ice == CONTENT_IGNORE)
                c_ice = CONTENT_AIR;
        if (c_mossycobble == CONTENT_IGNORE)
                c_mossycobble = c_cobble;
-       if (c_sandbrick == CONTENT_IGNORE)
-               c_sandbrick = c_desert_stone;
        if (c_stair_cobble == CONTENT_IGNORE)
                c_stair_cobble = c_cobble;
-       if (c_stair_sandstone == CONTENT_IGNORE)
-               c_stair_sandstone = c_sandbrick;
+       if (c_sandstonebrick == CONTENT_IGNORE)
+               c_sandstonebrick = c_desert_stone;
+       if (c_stair_sandstonebrick == CONTENT_IGNORE)
+               c_stair_sandstonebrick = c_sandstonebrick;
 }
 
 
@@ -272,27 +271,27 @@ void MapgenV7::makeChunk(BlockMakeData *data)
                dp.np_rarity  = nparams_dungeon_rarity;
                dp.np_density = nparams_dungeon_density;
                dp.np_wetness = nparams_dungeon_wetness;
-               dp.c_water = c_water_source;
+               dp.c_water    = c_water_source;
                if (desert_stone) {
-                       dp.c_cobble  = c_sandbrick;
-                       dp.c_moss    = c_sandbrick; // should make this 'cracked sandstone' later
-                       dp.c_stair   = c_stair_sandstone;
+                       dp.c_cobble = c_desert_stone;
+                       dp.c_moss   = c_desert_stone;
+                       dp.c_stair  = c_desert_stone;
 
                        dp.diagonal_dirs = true;
-                       dp.mossratio  = 0.0;
-                       dp.holesize   = v3s16(2, 3, 2);
-                       dp.roomsize   = v3s16(2, 5, 2);
-                       dp.notifytype = GENNOTIFY_TEMPLE;
+                       dp.mossratio     = 0.0;
+                       dp.holesize      = v3s16(2, 3, 2);
+                       dp.roomsize      = v3s16(2, 5, 2);
+                       dp.notifytype    = GENNOTIFY_TEMPLE;
                } else {
-                       dp.c_cobble  = c_cobble;
-                       dp.c_moss    = c_mossycobble;
-                       dp.c_stair   = c_stair_cobble;
+                       dp.c_cobble = c_cobble;
+                       dp.c_moss   = c_mossycobble;
+                       dp.c_stair  = c_stair_cobble;
 
                        dp.diagonal_dirs = false;
-                       dp.mossratio  = 3.0;
-                       dp.holesize   = v3s16(1, 2, 1);
-                       dp.roomsize   = v3s16(0, 0, 0);
-                       dp.notifytype = GENNOTIFY_DUNGEON;
+                       dp.mossratio     = 3.0;
+                       dp.holesize      = v3s16(1, 2, 1);
+                       dp.roomsize      = v3s16(0, 0, 0);
+                       dp.notifytype    = GENNOTIFY_DUNGEON;
                }
 
                DungeonGen dgen(this, &dp);
index f5dc4ff2b80975bc03f9fdbdb44cb0baff1e48a1..46dd79b6671a388f2d6daaba3df0cf9280cb7bf8 100644 (file)
@@ -84,20 +84,16 @@ public:
        Noise *noise_humidity;
 
        content_t c_stone;
-       content_t c_dirt;
-       content_t c_dirt_with_grass;
-       content_t c_sand;
        content_t c_water_source;
        content_t c_lava_source;
+       content_t c_desert_stone;
        content_t c_ice;
-       content_t c_gravel;
+
        content_t c_cobble;
-       content_t c_desert_sand;
-       content_t c_desert_stone;
-       content_t c_mossycobble;
-       content_t c_sandbrick;
        content_t c_stair_cobble;
-       content_t c_stair_sandstone;
+       content_t c_mossycobble;
+       content_t c_sandstonebrick;
+       content_t c_stair_sandstonebrick;
 
        MapgenV7(int mapgenid, MapgenParams *params, EmergeManager *emerge);
        ~MapgenV7();