1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Map generation is now properly threaded and doesn't block block placement and other stuff.

This commit is contained in:
Perttu Ahola 2011-04-10 20:18:34 +03:00
parent 6fa85c8502
commit 10eedbc1d2
4 changed files with 153 additions and 116 deletions

View file

@ -318,6 +318,8 @@ protected:
This is the only map class that is able to generate map.
*/
struct ChunkMakeData;
class ServerMap : public Map
{
public:
@ -391,6 +393,10 @@ public:
return true;
}
void initChunkMake(ChunkMakeData &data, v2s16 chunkpos);
MapChunk* finishChunkMake(ChunkMakeData &data,
core::map<v3s16, MapBlock*> &changed_blocks);
/*
Generate a chunk.
@ -746,5 +752,25 @@ protected:
bool m_create_area;
};
struct ChunkMakeData
{
ManualMapVoxelManipulator vmanip;
u64 seed;
v2s16 chunkpos;
s16 y_blocks_min;
s16 y_blocks_max;
v2s16 sectorpos_base;
s16 sectorpos_base_size;
v2s16 sectorpos_bigbase;
s16 sectorpos_bigbase_size;
s16 max_spread_amount;
ChunkMakeData():
vmanip(NULL)
{}
};
void makeChunk(ChunkMakeData *data);
#endif