mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Map generation is now properly threaded and doesn't block block placement and other stuff.
This commit is contained in:
26
src/map.h
26
src/map.h
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user