aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen_fractal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapgen_fractal.h')
-rw-r--r--src/mapgen_fractal.h70
1 files changed, 12 insertions, 58 deletions
diff --git a/src/mapgen_fractal.h b/src/mapgen_fractal.h
index dd96045e2..3331848bc 100644
--- a/src/mapgen_fractal.h
+++ b/src/mapgen_fractal.h
@@ -33,7 +33,7 @@ class BiomeManager;
extern FlagDesc flagdesc_mapgen_fractal[];
-struct MapgenFractalParams : public MapgenSpecificParams {
+struct MapgenFractalParams : public MapgenParams {
u32 spflags;
float cave_width;
u16 fractal;
@@ -57,23 +57,22 @@ struct MapgenFractalParams : public MapgenSpecificParams {
void writeParams(Settings *settings) const;
};
-class MapgenFractal : public Mapgen {
+class MapgenFractal : public MapgenBasic {
public:
- EmergeManager *m_emerge;
- BiomeManager *bmgr;
+ MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeManager *emerge);
+ ~MapgenFractal();
+
+ virtual MapgenType getType() const { return MAPGEN_FRACTAL; }
+
+ virtual void makeChunk(BlockMakeData *data);
+ int getSpawnLevelAtPoint(v2s16 p);
+ bool getFractalAtPoint(s16 x, s16 y, s16 z);
+ s16 generateTerrain();
- int ystride;
- int zstride_1d;
+private:
u16 formula;
bool julia;
- v3s16 node_min;
- v3s16 node_max;
- v3s16 full_node_min;
- v3s16 full_node_max;
-
- u32 spflags;
- float cave_width;
u16 fractal;
u16 iterations;
v3f scale;
@@ -84,51 +83,6 @@ public:
float julia_z;
float julia_w;
Noise *noise_seabed;
- Noise *noise_filler_depth;
- Noise *noise_cave1;
- Noise *noise_cave2;
-
- Noise *noise_heat;
- Noise *noise_humidity;
- Noise *noise_heat_blend;
- Noise *noise_humidity_blend;
-
- content_t c_stone;
- content_t c_water_source;
- content_t c_lava_source;
- content_t c_desert_stone;
- content_t c_ice;
- content_t c_sandstone;
-
- content_t c_cobble;
- content_t c_stair_cobble;
- content_t c_mossycobble;
- content_t c_sandstonebrick;
- content_t c_stair_sandstonebrick;
-
- MapgenFractal(int mapgenid, MapgenParams *params, EmergeManager *emerge);
- ~MapgenFractal();
-
- virtual void makeChunk(BlockMakeData *data);
- int getSpawnLevelAtPoint(v2s16 p);
- void calculateNoise();
- bool getFractalAtPoint(s16 x, s16 y, s16 z);
- s16 generateTerrain();
- MgStoneType generateBiomes(float *heat_map, float *humidity_map);
- void dustTopNodes();
- void generateCaves(s16 max_stone_y);
-};
-
-struct MapgenFactoryFractal : public MapgenFactory {
- Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge)
- {
- return new MapgenFractal(mgid, params, emerge);
- };
-
- MapgenSpecificParams *createMapgenParams()
- {
- return new MapgenFractalParams();
- };
};
#endif