2014-10-16 13:45:55 +02:00
|
|
|
/*
|
|
|
|
Minetest
|
2015-10-08 06:17:25 +02:00
|
|
|
Copyright (C) 2010-2015 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
|
|
|
|
Copyright (C) 2010-2015 paramat, Matt Gregory
|
2014-10-16 13:45:55 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MAPGEN_V5_HEADER
|
|
|
|
#define MAPGEN_V5_HEADER
|
|
|
|
|
|
|
|
#include "mapgen.h"
|
|
|
|
|
2015-10-08 06:17:25 +02:00
|
|
|
#define MGV5_LARGE_CAVE_DEPTH -256
|
2015-03-16 02:22:37 +01:00
|
|
|
|
2017-03-12 14:26:09 +01:00
|
|
|
///////// Mapgen V5 flags
|
|
|
|
#define MGV5_CAVERNS 0x01
|
|
|
|
|
2015-01-21 14:24:11 +01:00
|
|
|
class BiomeManager;
|
2014-10-16 13:45:55 +02:00
|
|
|
|
|
|
|
extern FlagDesc flagdesc_mapgen_v5[];
|
|
|
|
|
|
|
|
|
2016-06-25 00:15:56 +02:00
|
|
|
struct MapgenV5Params : public MapgenParams {
|
2014-10-16 13:45:55 +02:00
|
|
|
u32 spflags;
|
2016-04-25 12:47:25 +02:00
|
|
|
float cave_width;
|
2017-03-12 14:26:09 +01:00
|
|
|
s16 cavern_limit;
|
|
|
|
s16 cavern_taper;
|
|
|
|
float cavern_threshold;
|
|
|
|
|
2014-10-16 13:45:55 +02:00
|
|
|
NoiseParams np_filler_depth;
|
|
|
|
NoiseParams np_factor;
|
|
|
|
NoiseParams np_height;
|
2017-03-12 14:26:09 +01:00
|
|
|
NoiseParams np_ground;
|
2014-10-16 13:45:55 +02:00
|
|
|
NoiseParams np_cave1;
|
|
|
|
NoiseParams np_cave2;
|
2017-03-12 14:26:09 +01:00
|
|
|
NoiseParams np_cavern;
|
2014-10-16 13:45:55 +02:00
|
|
|
|
|
|
|
MapgenV5Params();
|
|
|
|
~MapgenV5Params() {}
|
2014-12-06 10:18:04 +01:00
|
|
|
|
2015-01-26 12:44:49 +01:00
|
|
|
void readParams(const Settings *settings);
|
|
|
|
void writeParams(Settings *settings) const;
|
2014-10-16 13:45:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-05-02 08:24:57 +02:00
|
|
|
class MapgenV5 : public MapgenBasic {
|
2014-10-16 13:45:55 +02:00
|
|
|
public:
|
2016-06-25 00:15:56 +02:00
|
|
|
MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge);
|
2016-05-22 08:17:19 +02:00
|
|
|
~MapgenV5();
|
|
|
|
|
2016-06-14 06:10:55 +02:00
|
|
|
virtual MapgenType getType() const { return MAPGEN_V5; }
|
|
|
|
|
2016-05-22 08:17:19 +02:00
|
|
|
virtual void makeChunk(BlockMakeData *data);
|
|
|
|
int getSpawnLevelAtPoint(v2s16 p);
|
|
|
|
int generateBaseTerrain();
|
|
|
|
|
|
|
|
private:
|
2014-10-16 13:45:55 +02:00
|
|
|
Noise *noise_factor;
|
|
|
|
Noise *noise_height;
|
|
|
|
Noise *noise_ground;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|