diff options
author | Minetest-j45 <55553015+Minetest-j45@users.noreply.github.com> | 2021-08-30 15:22:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-30 15:22:40 +0100 |
commit | 7824a4956bf489b4e2cc35e0c97272eee06be6ba (patch) | |
tree | 70243765dc1743a83596f9c6eec122fb417ef92c /src/voxelalgorithms.cpp | |
parent | 607add326feb44e078b843464ce4a8de09f28743 (diff) | |
parent | 35445d24f425c6291a0580b468919ca83de716fd (diff) | |
download | dragonfireclient-7824a4956bf489b4e2cc35e0c97272eee06be6ba.tar.xz |
Merge pull request #1 from EliasFleckenstein03/master
update
Diffstat (limited to 'src/voxelalgorithms.cpp')
-rw-r--r-- | src/voxelalgorithms.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/voxelalgorithms.cpp b/src/voxelalgorithms.cpp index 62fd68890..ffb70aa71 100644 --- a/src/voxelalgorithms.cpp +++ b/src/voxelalgorithms.cpp @@ -65,7 +65,7 @@ struct ChangingLight { ChangingLight() = default; - ChangingLight(const relative_v3 &rel_pos, const mapblock_v3 &block_pos, + ChangingLight(relative_v3 rel_pos, mapblock_v3 block_pos, MapBlock *b, direction source_dir) : rel_position(rel_pos), block_position(block_pos), @@ -125,8 +125,8 @@ struct LightQueue { * The parameters are the same as in ChangingLight's constructor. * \param light light level of the ChangingLight */ - inline void push(u8 light, const relative_v3 &rel_pos, - const mapblock_v3 &block_pos, MapBlock *block, + inline void push(u8 light, relative_v3 rel_pos, + mapblock_v3 block_pos, MapBlock *block, direction source_dir) { assert(light <= LIGHT_SUN); @@ -467,7 +467,7 @@ bool is_sunlight_above(Map *map, v3s16 pos, const NodeDefManager *ndef) static const LightBank banks[] = { LIGHTBANK_DAY, LIGHTBANK_NIGHT }; void update_lighting_nodes(Map *map, - std::vector<std::pair<v3s16, MapNode> > &oldnodes, + const std::vector<std::pair<v3s16, MapNode>> &oldnodes, std::map<v3s16, MapBlock*> &modified_blocks) { const NodeDefManager *ndef = map->getNodeDefManager(); @@ -482,8 +482,7 @@ void update_lighting_nodes(Map *map, // won't change, since they didn't get their light from a // modified node. u8 min_safe_light = 0; - for (std::vector<std::pair<v3s16, MapNode> >::iterator it = - oldnodes.begin(); it < oldnodes.end(); ++it) { + for (auto it = oldnodes.cbegin(); it < oldnodes.cend(); ++it) { u8 old_light = it->second.getLight(bank, ndef); if (old_light > min_safe_light) { min_safe_light = old_light; @@ -495,8 +494,7 @@ void update_lighting_nodes(Map *map, min_safe_light++; } // For each changed node process sunlight and initialize - for (std::vector<std::pair<v3s16, MapNode> >::iterator it = - oldnodes.begin(); it < oldnodes.end(); ++it) { + for (auto it = oldnodes.cbegin(); it < oldnodes.cend(); ++it) { // Get position and block of the changed node v3s16 p = it->first; relative_v3 rel_pos; |