summaryrefslogtreecommitdiff
path: root/src/voxelalgorithms.cpp
diff options
context:
space:
mode:
authorIlya Zhuravlev <zhuravlevilya@ya.ru>2012-12-20 21:19:49 +0400
committerkwolekr <kwolekr@minetest.net>2013-03-11 19:08:39 -0400
commit6a1670dbc31cc0e44178bbd9ad34ff0d5981a060 (patch)
treece32cd4be20e9be30367f2ad25d9dae6a0482898 /src/voxelalgorithms.cpp
parente204bedf1d781e43b8caa334a99319efc5b7ce46 (diff)
downloadminetest-6a1670dbc31cc0e44178bbd9ad34ff0d5981a060.tar.gz
minetest-6a1670dbc31cc0e44178bbd9ad34ff0d5981a060.tar.bz2
minetest-6a1670dbc31cc0e44178bbd9ad34ff0d5981a060.zip
Migrate to STL containers/algorithms.
Diffstat (limited to 'src/voxelalgorithms.cpp')
-rw-r--r--src/voxelalgorithms.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/voxelalgorithms.cpp b/src/voxelalgorithms.cpp
index bd8f816b8..14638a827 100644
--- a/src/voxelalgorithms.cpp
+++ b/src/voxelalgorithms.cpp
@@ -39,8 +39,8 @@ void setLight(VoxelManipulator &v, VoxelArea a, u8 light,
void clearLightAndCollectSources(VoxelManipulator &v, VoxelArea a,
enum LightBank bank, INodeDefManager *ndef,
- core::map<v3s16, bool> & light_sources,
- core::map<v3s16, u8> & unlight_from)
+ std::set<v3s16> & light_sources,
+ std::map<v3s16, u8> & unlight_from)
{
// The full area we shall touch
VoxelArea required_a = a;
@@ -60,7 +60,7 @@ void clearLightAndCollectSources(VoxelManipulator &v, VoxelArea a,
// If node sources light, add to list
u8 source = ndef->get(n).light_source;
if(source != 0)
- light_sources[p] = true;
+ light_sources.insert(p);
// Collect borders for unlighting
if((x==a.MinEdge.X || x == a.MaxEdge.X
@@ -68,14 +68,14 @@ void clearLightAndCollectSources(VoxelManipulator &v, VoxelArea a,
|| z==a.MinEdge.Z || z == a.MaxEdge.Z)
&& oldlight != 0)
{
- unlight_from.insert(p, oldlight);
+ unlight_from[p] = oldlight;
}
}
}
SunlightPropagateResult propagateSunlight(VoxelManipulator &v, VoxelArea a,
bool inexistent_top_provides_sunlight,
- core::map<v3s16, bool> & light_sources,
+ std::set<v3s16> & light_sources,
INodeDefManager *ndef)
{
// Return values
@@ -127,7 +127,7 @@ SunlightPropagateResult propagateSunlight(VoxelManipulator &v, VoxelArea a,
n.setLight(LIGHTBANK_DAY, incoming_light, ndef);
if(diminish_light(incoming_light) != 0)
- light_sources.insert(p, true);
+ light_sources.insert(p);
}
// Check validity of sunlight at top of block below if it