mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Add Generator Element Management framework
Add BiomeManager, OreManager, DecorationManager, and SchematicManager
This commit is contained in:
parent
f25cc0dbae
commit
7616537bc0
22 changed files with 620 additions and 464 deletions
32
src/emerge.h
32
src/emerge.h
|
@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <map>
|
||||
#include "irr_v3d.h"
|
||||
#include "util/container.h"
|
||||
#include "map.h" // for ManualMapVoxelManipulator
|
||||
#include "mapgen.h" // for MapgenParams
|
||||
#include "map.h"
|
||||
|
||||
#define MGPARAMS_SET_MGNAME 1
|
||||
#define MGPARAMS_SET_SEED 2
|
||||
|
@ -34,16 +34,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define BLOCK_EMERGE_ALLOWGEN (1<<0)
|
||||
|
||||
#define EMERGE_DBG_OUT(x) \
|
||||
{ if (enable_mapgen_debug_info) \
|
||||
infostream << "EmergeThread: " x << std::endl; }
|
||||
do { \
|
||||
if (enable_mapgen_debug_info) \
|
||||
infostream << "EmergeThread: " x << std::endl; \
|
||||
} while (0)
|
||||
|
||||
class EmergeThread;
|
||||
class Biome;
|
||||
class BiomeDefManager;
|
||||
class Decoration;
|
||||
class Ore;
|
||||
class INodeDefManager;
|
||||
class Settings;
|
||||
//class ManualMapVoxelManipulator;
|
||||
|
||||
class BiomeManager;
|
||||
class OreManager;
|
||||
class DecorationManager;
|
||||
class SchematicManager;
|
||||
|
||||
struct BlockMakeData {
|
||||
ManualMapVoxelManipulator *vmanip;
|
||||
|
@ -88,16 +92,18 @@ public:
|
|||
|
||||
u32 gennotify;
|
||||
|
||||
//block emerge queue data structures
|
||||
//// Block emerge queue data structures
|
||||
JMutex queuemutex;
|
||||
std::map<v3s16, BlockEmergeData *> blocks_enqueued;
|
||||
std::map<u16, u16> peer_queue_count;
|
||||
|
||||
//Mapgen-related structures
|
||||
BiomeDefManager *biomedef;
|
||||
std::vector<Ore *> ores;
|
||||
std::vector<Decoration *> decorations;
|
||||
//// Managers of map generation-related components
|
||||
BiomeManager *biomemgr;
|
||||
OreManager *oremgr;
|
||||
DecorationManager *decomgr;
|
||||
SchematicManager *schemmgr;
|
||||
|
||||
//// Methods
|
||||
EmergeManager(IGameDef *gamedef);
|
||||
~EmergeManager();
|
||||
|
||||
|
@ -105,7 +111,7 @@ public:
|
|||
void initMapgens();
|
||||
Mapgen *getCurrentMapgen();
|
||||
Mapgen *createMapgen(std::string mgname, int mgid,
|
||||
MapgenParams *mgparams);
|
||||
MapgenParams *mgparams);
|
||||
MapgenSpecificParams *createMapgenParams(std::string mgname);
|
||||
void startThreads();
|
||||
void stopThreads();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue