diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-10 20:18:34 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-10 20:18:34 +0300 |
commit | 10eedbc1d233da36c244de67fcec555bcea87d5f (patch) | |
tree | 2a404f4b68371dcb1e89a8b02d791f8d529df60b /src/map.h | |
parent | 6fa85c8502ced2293cd7f56d47dce9ce8add57dc (diff) | |
download | hax-minetest-server-10eedbc1d233da36c244de67fcec555bcea87d5f.tar.gz hax-minetest-server-10eedbc1d233da36c244de67fcec555bcea87d5f.zip |
Map generation is now properly threaded and doesn't block block placement and other stuff.
Diffstat (limited to '')
-rw-r--r-- | src/map.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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 |