3 Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "irrlichttypes_bloated.h"
24 #include "util/container.h" // UniqueQueue
31 #define DEFAULT_MAPGEN "v6"
33 /////////////////// Mapgen flags
36 #define MG_DUNGEONS 0x04
40 #define NUM_GEN_NOTIFY 6
43 extern FlagDesc flagdesc_mapgen[];
44 extern FlagDesc flagdesc_gennotify[];
46 class BiomeDefManager;
50 class ManualMapVoxelManipulator;
51 class VoxelManipulator;
71 GENNOTIFY_LARGECAVE_BEGIN,
72 GENNOTIFY_LARGECAVE_END
75 struct MapgenSpecificParams {
76 virtual void readParams(Settings *settings) = 0;
77 virtual void writeParams(Settings *settings) = 0;
78 virtual ~MapgenSpecificParams() {}
88 MapgenSpecificParams *sparams;
91 mg_name = DEFAULT_MAPGEN;
95 flags = MG_TREES | MG_CAVES | MG_LIGHT;
106 ManualMapVoxelManipulator *vm;
107 INodeDefManager *ndef;
114 std::vector<v3s16> *gen_notifications[NUM_GEN_NOTIFY];
119 s16 findGroundLevelFull(v2s16 p2d);
120 s16 findGroundLevel(v2s16 p2d, s16 ymin, s16 ymax);
121 void updateHeightmap(v3s16 nmin, v3s16 nmax);
122 void updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nmax);
123 void setLighting(v3s16 nmin, v3s16 nmax, u8 light);
124 void lightSpread(VoxelArea &a, v3s16 p, u8 light);
125 void calcLighting(v3s16 nmin, v3s16 nmax);
126 void calcLightingOld(v3s16 nmin, v3s16 nmax);
128 virtual void makeChunk(BlockMakeData *data) {}
129 virtual int getGroundLevelAtPoint(v2s16 p) { return 0; }
132 struct MapgenFactory {
133 virtual Mapgen *createMapgen(int mgid, MapgenParams *params,
134 EmergeManager *emerge) = 0;
135 virtual MapgenSpecificParams *createMapgenParams() = 0;
136 virtual ~MapgenFactory() {}