From d10223254ab9363eb1b6f8cc7aa6b99965940cee Mon Sep 17 00:00:00 2001 From: kwolekr Date: Mon, 11 Mar 2013 21:32:52 -0400 Subject: Clean up Mapgen --- src/mapgen.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mapgen.h') diff --git a/src/mapgen.h b/src/mapgen.h index 911e87537..67ea9fbd4 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -72,6 +72,11 @@ public: int water_level; bool generating; int id; + ManualMapVoxelManipulator *vm; + INodeDefManager *ndef; + + void updateLiquid(UniqueQueue *trans_liquid, v3s16 nmin, v3s16 nmax); + void updateLighting(v3s16 nmin, v3s16 nmax); virtual void makeChunk(BlockMakeData *data) {}; virtual int getGroundLevelAtPoint(v2s16 p) = 0; -- cgit v1.2.3 From 1f1ad9fd23b07a1c1b5477ee0dbf2c4fdaabccef Mon Sep 17 00:00:00 2001 From: kwolekr Date: Fri, 15 Mar 2013 22:43:35 -0400 Subject: Optimize Mapgen::updateLighting(), add setLighting() --- src/mapgen.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mapgen.h') diff --git a/src/mapgen.h b/src/mapgen.h index 67ea9fbd4..e5b0b6399 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -46,6 +46,7 @@ class ManualMapVoxelManipulator; class VoxelManipulator; class INodeDefManager; class BlockMakeData; +class VoxelArea; struct MapgenParams { std::string mg_name; @@ -76,7 +77,10 @@ public: INodeDefManager *ndef; void updateLiquid(UniqueQueue *trans_liquid, v3s16 nmin, v3s16 nmax); + void setLighting(v3s16 nmin, v3s16 nmax, u8 light); + void lightSpread(VoxelArea &a, v3s16 p, u8 light); void updateLighting(v3s16 nmin, v3s16 nmax); + void updateLightingOld(v3s16 nmin, v3s16 nmax); virtual void makeChunk(BlockMakeData *data) {}; virtual int getGroundLevelAtPoint(v2s16 p) = 0; -- cgit v1.2.3 From 6823ce99a7deabe410dd8b143b688cd364490cec Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 16 Mar 2013 17:06:11 -0400 Subject: Re-add jungles, apple trees --- src/mapgen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mapgen.h') diff --git a/src/mapgen.h b/src/mapgen.h index e5b0b6399..3f3cd424d 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define MG_TREES 0x01 #define MG_CAVES 0x02 #define MG_DUNGEONS 0x04 -#define MGV6_FORESTS 0x08 +#define MGV6_JUNGLES 0x08 #define MGV6_BIOME_BLEND 0x10 #define MG_FLAT 0x20 -- cgit v1.2.3 From 939397dd6e9cf26358b7e7f07aa58b72b175691f Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 17 Mar 2013 23:07:51 -0400 Subject: Add jungle grass to jungles --- src/mapgen.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mapgen.h') diff --git a/src/mapgen.h b/src/mapgen.h index 3f3cd424d..f4bd659fb 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -79,8 +79,8 @@ public: void updateLiquid(UniqueQueue *trans_liquid, v3s16 nmin, v3s16 nmax); void setLighting(v3s16 nmin, v3s16 nmax, u8 light); void lightSpread(VoxelArea &a, v3s16 p, u8 light); - void updateLighting(v3s16 nmin, v3s16 nmax); - void updateLightingOld(v3s16 nmin, v3s16 nmax); + void calcLighting(v3s16 nmin, v3s16 nmax); + void calcLightingOld(v3s16 nmin, v3s16 nmax); virtual void makeChunk(BlockMakeData *data) {}; virtual int getGroundLevelAtPoint(v2s16 p) = 0; -- cgit v1.2.3 From ca7043e52d6a5d0ee1b91f287371fbe7f216697e Mon Sep 17 00:00:00 2001 From: Mukul Sati Date: Sat, 23 Mar 2013 02:24:31 -0400 Subject: Set of changes to build mineTest using Visual Studio 11.0. These affect the following: 1. String concatenation in guiMainMenu.cpp - it is required for all individual strings to be of the same type ; adding explicit L qualifier before the other strings. 2. Correcting type of BlockMakeData to struct in place of class forward declarations. This information is used for name decoration by Visual Studio, leading to linker errors in case of mismatches. 3. Windows headers define max as a macro somewhere, leading to a compile time error in profiler.h; using () around function to prevent macro match from occurring. --- src/mapgen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mapgen.h') diff --git a/src/mapgen.h b/src/mapgen.h index f4bd659fb..2e917a3aa 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -45,7 +45,7 @@ class MapBlock; class ManualMapVoxelManipulator; class VoxelManipulator; class INodeDefManager; -class BlockMakeData; +struct BlockMakeData; class VoxelArea; struct MapgenParams { -- cgit v1.2.3 From 57cbb8bfd8daaa1b8b1aa876723ff6355d21f7fc Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 24 Mar 2013 01:43:38 -0400 Subject: Add Ore infrastructure and l_register_ore() --- src/mapgen.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/mapgen.h') diff --git a/src/mapgen.h b/src/mapgen.h index 2e917a3aa..a900985da 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -97,5 +97,48 @@ struct MapgenFactory { virtual MapgenParams *createMapgenParams() = 0; }; +enum OreType { + ORE_SCATTER, + ORE_SHEET, + ORE_CLAYLIKE +}; + +class Ore { +public: + std::string ore_name; + std::string wherein_name; + + content_t ore; + content_t wherein; // the node to be replaced + s16 clust_scarcity; // + s16 clust_num_ores; // how many ore nodes are in a chunk + s16 clust_size; // how large (in nodes) a chunk of ore is + s16 height_min; + s16 height_max; + float nthresh; // threshhold for noise at which an ore is placed + NoiseParams *np; // noise for distribution of clusters (NULL for uniform scattering) + Noise *noise; + + Ore() { + ore = CONTENT_IGNORE; + wherein = CONTENT_IGNORE; + np = NULL; + noise = NULL; + } + + void resolveNodeNames(INodeDefManager *ndef); + virtual void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) = 0; +}; + +class OreScatter : public Ore { + void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); +}; + +class OreSheet : public Ore { + void generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax); +}; + +Ore *createOre(OreType type); + #endif -- cgit v1.2.3