From 10eedbc1d233da36c244de67fcec555bcea87d5f Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 10 Apr 2011 20:18:34 +0300 Subject: Map generation is now properly threaded and doesn't block block placement and other stuff. --- src/map.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index 8a004ee64..e2cd432be 100644 --- a/src/map.h +++ b/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 &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 -- cgit v1.2.3