2014-10-16 13:45:55 +02:00
|
|
|
/*
|
|
|
|
Minetest
|
2018-01-15 03:26:15 +01:00
|
|
|
Copyright (C) 2014-2018 paramat
|
|
|
|
Copyright (C) 2014-2018 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
|
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.
|
|
|
|
*/
|
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2014-10-16 13:45:55 +02:00
|
|
|
|
|
|
|
#include "mapgen.h"
|
|
|
|
|
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[];
|
|
|
|
|
2017-04-23 09:52:40 +02:00
|
|
|
struct MapgenV5Params : public MapgenParams
|
|
|
|
{
|
2017-06-17 19:11:28 +02:00
|
|
|
u32 spflags = MGV5_CAVERNS;
|
|
|
|
float cave_width = 0.125f;
|
2017-06-20 05:55:32 +02:00
|
|
|
s16 large_cave_depth = -256;
|
2017-06-21 05:20:18 +02:00
|
|
|
s16 lava_depth = -256;
|
2017-06-17 19:11:28 +02:00
|
|
|
s16 cavern_limit = -256;
|
|
|
|
s16 cavern_taper = 256;
|
|
|
|
float cavern_threshold = 0.7f;
|
2018-02-17 18:43:13 +01:00
|
|
|
s16 dungeon_ymin = -31000;
|
|
|
|
s16 dungeon_ymax = 31000;
|
2017-03-12 14:26:09 +01:00
|
|
|
|
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();
|
2017-08-19 09:12:54 +02:00
|
|
|
~MapgenV5Params() = default;
|
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
|
|
|
};
|
|
|
|
|
2017-04-23 09:52:40 +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:
|
2017-06-20 05:55:32 +02:00
|
|
|
s16 large_cave_depth;
|
2018-02-17 18:43:13 +01:00
|
|
|
s16 dungeon_ymin;
|
|
|
|
s16 dungeon_ymax;
|
|
|
|
|
2014-10-16 13:45:55 +02:00
|
|
|
Noise *noise_factor;
|
|
|
|
Noise *noise_height;
|
|
|
|
Noise *noise_ground;
|
|
|
|
};
|