summaryrefslogtreecommitdiff
path: root/src/voxelalgorithms.h
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2016-10-27 23:25:44 +0200
committerparamat <mat.gregory@virginmedia.com>2017-02-13 00:05:49 +0000
commitf17c9c45dc30a388675d46418d278a4a029206e2 (patch)
tree8facf82b6c5b3fb3ff5e3632a738272de06c6952 /src/voxelalgorithms.h
parent2bd10022cb06850a404f180c455954ed2f817ce3 (diff)
downloadminetest-f17c9c45dc30a388675d46418d278a4a029206e2.tar.gz
minetest-f17c9c45dc30a388675d46418d278a4a029206e2.tar.bz2
minetest-f17c9c45dc30a388675d46418d278a4a029206e2.zip
Lighting: Update lighting at block loading
This commit updates mapblocks' light if necessary when they are loaded. This removes ghost lighting.
Diffstat (limited to 'src/voxelalgorithms.h')
-rw-r--r--src/voxelalgorithms.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/voxelalgorithms.h b/src/voxelalgorithms.h
index 5eff8f7ac..bf1638fa3 100644
--- a/src/voxelalgorithms.h
+++ b/src/voxelalgorithms.h
@@ -22,8 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "voxel.h"
#include "mapnode.h"
-#include <set>
-#include <map>
+#include "util/container.h"
+#include "util/cpp11_container.h"
class Map;
class MapBlock;
@@ -69,11 +69,22 @@ SunlightPropagateResult propagateSunlight(VoxelManipulator &v, VoxelArea a,
*/
void update_lighting_nodes(
Map *map,
- INodeDefManager *ndef,
std::vector<std::pair<v3s16, MapNode> > &oldnodes,
std::map<v3s16, MapBlock*> &modified_blocks);
/*!
+ * Updates borders of the given mapblock.
+ * Only updates if the block was marked with incomplete
+ * lighting and the neighbor is also loaded.
+ *
+ * \param block the block to update
+ * \param modified_blocks output, contains all map blocks that
+ * the function modified
+ */
+void update_block_border_lighting(Map *map, MapBlock *block,
+ 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.