projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugfix: don't highlight air nodes.
[oweals/minetest.git]
/
src
/
voxelalgorithms.cpp
diff --git
a/src/voxelalgorithms.cpp
b/src/voxelalgorithms.cpp
index 795530d40eede907d58b2ac00ce14ec8922ff5c2..f067a221ac1504484bc5ff4cd9e6beb6618a022d 100644
(file)
--- a/
src/voxelalgorithms.cpp
+++ b/
src/voxelalgorithms.cpp
@@
-1,6
+1,6
@@
/*
/*
-Minetest
-c55
-Copyright (C) 2010-201
2
celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-201
3
celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@
-39,14
+39,14
@@
void setLight(VoxelManipulator &v, VoxelArea a, u8 light,
void clearLightAndCollectSources(VoxelManipulator &v, VoxelArea a,
enum LightBank bank, INodeDefManager *ndef,
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;
required_a.pad(v3s16(0,0,0));
// Make sure we have access to it
{
// The full area we shall touch
VoxelArea required_a = a;
required_a.pad(v3s16(0,0,0));
// Make sure we have access to it
- v.
emerge
(a);
+ v.
addArea
(a);
for(s32 x=a.MinEdge.X; x<=a.MaxEdge.X; x++)
for(s32 z=a.MinEdge.Z; z<=a.MaxEdge.Z; z++)
for(s32 x=a.MinEdge.X; x<=a.MaxEdge.X; x++)
for(s32 z=a.MinEdge.Z; z<=a.MaxEdge.Z; z++)
@@
-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)
// 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
// 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)
{
|| 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,
}
}
}
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
INodeDefManager *ndef)
{
// Return values
@@
-85,7
+85,7
@@
SunlightPropagateResult propagateSunlight(VoxelManipulator &v, VoxelArea a,
VoxelArea required_a = a;
required_a.pad(v3s16(0,1,0));
// Make sure we have access to it
VoxelArea required_a = a;
required_a.pad(v3s16(0,1,0));
// Make sure we have access to it
- v.
emerge
(a);
+ v.
addArea
(a);
s16 max_y = a.MaxEdge.Y;
s16 min_y = a.MinEdge.Y;
s16 max_y = a.MaxEdge.Y;
s16 min_y = a.MinEdge.Y;
@@
-127,7
+127,7
@@
SunlightPropagateResult propagateSunlight(VoxelManipulator &v, VoxelArea a,
n.setLight(LIGHTBANK_DAY, incoming_light, ndef);
if(diminish_light(incoming_light) != 0)
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
}
// Check validity of sunlight at top of block below if it