summaryrefslogtreecommitdiff
path: root/src/voxelalgorithms.h
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2016-12-10 19:02:44 +0100
committerparamat <mat.gregory@virginmedia.com>2017-03-11 02:06:18 +0000
commitab371cc93491baf0973ecc94b96c3a1fdb4abfd5 (patch)
treeea9eedcef115258714163ef3927a095847c35d7b /src/voxelalgorithms.h
parentd785456b3fa35faf47cb972fde9e8668382c5e22 (diff)
downloadminetest-ab371cc93491baf0973ecc94b96c3a1fdb4abfd5.tar.gz
minetest-ab371cc93491baf0973ecc94b96c3a1fdb4abfd5.tar.bz2
minetest-ab371cc93491baf0973ecc94b96c3a1fdb4abfd5.zip
Light calculation: New bulk node lighting code
This commit introduces a new bulk node lighting algorithm to minimize lighting bugs during l-system tree generation, schematic placement and non-mapgen-object lua voxelmanip light calculation. If the block above the changed area is not loaded, it gets loaded to avoid lighting bugs. Light is updated as soon as write_to_map is called on a voxel manipulator, therefore update_map does nothing.
Diffstat (limited to 'src/voxelalgorithms.h')
-rw-r--r--src/voxelalgorithms.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/voxelalgorithms.h b/src/voxelalgorithms.h
index bf1638fa3..cdffe86c8 100644
--- a/src/voxelalgorithms.h
+++ b/src/voxelalgorithms.h
@@ -26,7 +26,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/cpp11_container.h"
class Map;
+class ServerMap;
class MapBlock;
+class MMVManip;
namespace voxalgo
{
@@ -85,6 +87,17 @@ void update_block_border_lighting(Map *map, MapBlock *block,
std::map<v3s16, MapBlock*> &modified_blocks);
/*!
+ * Copies back nodes from a voxel manipulator
+ * to the map and updates lighting.
+ * For server use only.
+ *
+ * \param modified_blocks output, contains all map blocks that
+ * the function modified
+ */
+void blit_back_with_light(ServerMap *map, MMVManip *vm,
+ std::map<v3s16, MapBlock*> *modified_blocks);
+
+/*!
* This class iterates trough voxels that intersect with
* a line. The collision detection does not see nodeboxes,
* every voxel is a cube and is returned.