summaryrefslogtreecommitdiff
path: root/src/emerge.h
diff options
context:
space:
mode:
authorkwolekr <mirrorisim@gmail.com>2013-02-17 01:47:49 -0500
committerkwolekr <mirrorisim@gmail.com>2013-02-25 23:08:26 -0500
commit5ec5b1cbd64a22e628be2cf03391883c44074811 (patch)
tree776d209306ce96d543e1b69a9726293e5f5f0fa5 /src/emerge.h
parent76217939e05bdd8d06fa7113902a74b02deeb915 (diff)
downloadminetest-5ec5b1cbd64a22e628be2cf03391883c44074811.tar.gz
minetest-5ec5b1cbd64a22e628be2cf03391883c44074811.tar.bz2
minetest-5ec5b1cbd64a22e628be2cf03391883c44074811.zip
Add multi-Emerge thread support
Diffstat (limited to 'src/emerge.h')
-rw-r--r--src/emerge.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/emerge.h b/src/emerge.h
index b4461ae61..7e0cc4850 100644
--- a/src/emerge.h
+++ b/src/emerge.h
@@ -46,8 +46,8 @@ class EmergeManager {
public:
std::map<std::string, MapgenFactory *> mglist;
- Mapgen *mapgen;
- EmergeThread *emergethread;
+ std::vector<Mapgen *> mapgen;
+ std::vector<EmergeThread *> emergethread;
//settings
MapgenParams *params;
@@ -68,11 +68,9 @@ public:
void initMapgens(MapgenParams *mgparams);
Mapgen *createMapgen(std::string mgname, int mgid,
- MapgenParams *mgparams, EmergeManager *emerge);
+ MapgenParams *mgparams);
MapgenParams *createMapgenParams(std::string mgname);
- Mapgen *getMapgen();
bool enqueueBlockEmerge(u16 peer_id, v3s16 p, bool allow_generate);
- bool popBlockEmerge(v3s16 *pos, u8 *flags);
bool registerMapgen(std::string name, MapgenFactory *mgfactory);
MapgenParams *getParamsFromSettings(Settings *settings);
@@ -92,17 +90,19 @@ class EmergeThread : public SimpleThread
EmergeManager *emerge;
Mapgen *mapgen;
bool enable_mapgen_debug_info;
+ int id;
public:
Event qevent;
std::queue<v3s16> blockqueue;
- EmergeThread(Server *server):
+ EmergeThread(Server *server, int ethreadid):
SimpleThread(),
m_server(server),
map(NULL),
emerge(NULL),
- mapgen(NULL)
+ mapgen(NULL),
+ id(ethreadid)
{
enable_mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info");
}
@@ -118,6 +118,7 @@ public:
}
}
+ bool popBlockEmerge(v3s16 *pos, u8 *flags);
bool getBlockOrStartGen(v3s16 p, MapBlock **b,
BlockMakeData *data, bool allow_generate);
};