diff options
author | kwolekr <kwolekr@minetest.net> | 2014-07-07 01:51:04 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-07-07 01:51:04 -0400 |
commit | a2e1b0fc7fa9a470f645e130115ce14a89aa2e02 (patch) | |
tree | 742904e94f288a680d237962228121ef81160262 | |
parent | 8b3ed78e53d8ad19d8dee3968430be258559214c (diff) | |
download | minetest-a2e1b0fc7fa9a470f645e130115ce14a89aa2e02.tar.gz minetest-a2e1b0fc7fa9a470f645e130115ce14a89aa2e02.tar.bz2 minetest-a2e1b0fc7fa9a470f645e130115ce14a89aa2e02.zip |
Don't copy back already generated blocks on map generation
-rw-r--r-- | src/map.cpp | 10 | ||||
-rw-r--r-- | src/map.h | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/map.cpp b/src/map.cpp index 9c06750b8..29bbbc0d9 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2312,7 +2312,7 @@ void ServerMap::finishBlockMake(BlockMakeData *data, { // 70ms @cs=8 //TimeTaker timer("finishBlockMake() blitBackAll"); - data->vmanip->blitBackAll(&changed_blocks); + data->vmanip->blitBackAll(&changed_blocks, false); } EMERGE_DBG_OUT("finishBlockMake: changed_blocks.size()=" << changed_blocks.size()); @@ -3586,7 +3586,8 @@ void ManualMapVoxelManipulator::initialEmerge(v3s16 blockpos_min, } void ManualMapVoxelManipulator::blitBackAll( - std::map<v3s16, MapBlock*> * modified_blocks) + std::map<v3s16, MapBlock*> *modified_blocks, + bool overwrite_generated) { if(m_area.getExtent() == v3s16(0,0,0)) return; @@ -3601,10 +3602,9 @@ void ManualMapVoxelManipulator::blitBackAll( v3s16 p = i->first; MapBlock *block = m_map->getBlockNoCreateNoEx(p); bool existed = !(i->second & VMANIP_BLOCK_DATA_INEXIST); - if((existed == false) || (block == NULL)) - { + if ((existed == false) || (block == NULL) || + (overwrite_generated == false && block->isGenerated() == true)) continue; - } block->copyFrom(*this); @@ -543,10 +543,11 @@ public: {m_map = map;} void initialEmerge(v3s16 blockpos_min, v3s16 blockpos_max, - bool load_if_inexistent = true); + bool load_if_inexistent = true); // This is much faster with big chunks of generated data - void blitBackAll(std::map<v3s16, MapBlock*> * modified_blocks); + void blitBackAll(std::map<v3s16, MapBlock*> * modified_blocks, + bool overwrite_generated = true); protected: bool m_create_area; |