X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fvoxelalgorithms.cpp;h=14638a82776cc5b5264c0daadce1c0b24447105e;hb=5a34f40d80ea1a339b599bc11db549a6bd86912f;hp=bd8f816b854134d1cdd0682071770fdcdf1a750a;hpb=6d0ea26c2d62c3774ff384cf1bfc2a3372b49a3b;p=minetest.git 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 & light_sources, - core::map & unlight_from) + std::set & light_sources, + std::map & 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 & light_sources, + std::set & 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