- /*
- Do stuff in central blocks
- */
-
- /*
- Update lighting
- */
- {
-#if 0
- TimeTaker t("finishBlockMake lighting update");
-
- core::map<v3s16, MapBlock*> lighting_update_blocks;
-
- // Center blocks
- for(s16 x=blockpos_min.X-extra_borders.X;
- x<=blockpos_max.X+extra_borders.X; x++)
- for(s16 z=blockpos_min.Z-extra_borders.Z;
- z<=blockpos_max.Z+extra_borders.Z; z++)
- for(s16 y=blockpos_min.Y-extra_borders.Y;
- y<=blockpos_max.Y+extra_borders.Y; y++)
- {
- v3s16 p(x, y, z);
- MapBlock *block = getBlockNoCreateNoEx(p);
- assert(block);
- lighting_update_blocks.insert(block->getPos(), block);
- }
-
- updateLighting(lighting_update_blocks, changed_blocks);
-#endif
-
- /*
- Set lighting to non-expired state in all of them.
- This is cheating, but it is not fast enough if all of them
- would actually be updated.
- */
- for(s16 x=blockpos_min.X-extra_borders.X;
- x<=blockpos_max.X+extra_borders.X; x++)
- for(s16 z=blockpos_min.Z-extra_borders.Z;
- z<=blockpos_max.Z+extra_borders.Z; z++)
- for(s16 y=blockpos_min.Y-extra_borders.Y;
- y<=blockpos_max.Y+extra_borders.Y; y++)
- {
- v3s16 p(x, y, z);
- MapBlock * block = getBlockNoCreateNoEx(p);
- if (block != NULL)
- block->setLightingExpired(false);
- }
-
-#if 0
- if(enable_mapgen_debug_info == false)
- t.stop(true); // Hide output
-#endif
- }
-
- /*
- Go through changed blocks
- */
- for(std::map<v3s16, MapBlock*>::iterator i = changed_blocks.begin();
- i != changed_blocks.end(); ++i)
- {
- MapBlock *block = i->second;