summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-20 19:37:29 +0200
committerGitHub <noreply@github.com>2017-08-20 19:37:29 +0200
commitae9b5e00989756bb676429530dfe81039009001c (patch)
tree119c9ac4b886c24d42f418e21e4175a942eb95ff /src/map.cpp
parentc8d3d1133945138108aa195e6b3c93b07c6e4fa0 (diff)
downloadminetest-ae9b5e00989756bb676429530dfe81039009001c.tar.gz
minetest-ae9b5e00989756bb676429530dfe81039009001c.tar.bz2
minetest-ae9b5e00989756bb676429530dfe81039009001c.zip
Modernize code: very last fixes (#6290)
Last modernization fixes
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/map.cpp b/src/map.cpp
index a12bbe54c..08e5c3990 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1109,7 +1109,6 @@ bool Map::isBlockOccluded(MapBlock *block, v3s16 cam_pos_nodes) {
// of a mapblock, because we must consider all view angles.
// sqrt(1^2 + 1^2 + 1^2) = 1.732
float endoff = -BS * MAP_BLOCKSIZE * 1.732050807569;
- v3s16 spn = cam_pos_nodes;
s16 bs2 = MAP_BLOCKSIZE / 2 + 1;
// to reduce the likelihood of falsely occluded blocks
// require at least two solid blocks
@@ -1118,23 +1117,23 @@ bool Map::isBlockOccluded(MapBlock *block, v3s16 cam_pos_nodes) {
return (
// For the central point of the mapblock 'endoff' can be halved
- isOccluded(spn, cpn,
+ isOccluded(cam_pos_nodes, cpn,
step, stepfac, startoff, endoff / 2.0f, needed_count) &&
- isOccluded(spn, cpn + v3s16(bs2,bs2,bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(bs2,bs2,bs2),
step, stepfac, startoff, endoff, needed_count) &&
- isOccluded(spn, cpn + v3s16(bs2,bs2,-bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(bs2,bs2,-bs2),
step, stepfac, startoff, endoff, needed_count) &&
- isOccluded(spn, cpn + v3s16(bs2,-bs2,bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(bs2,-bs2,bs2),
step, stepfac, startoff, endoff, needed_count) &&
- isOccluded(spn, cpn + v3s16(bs2,-bs2,-bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(bs2,-bs2,-bs2),
step, stepfac, startoff, endoff, needed_count) &&
- isOccluded(spn, cpn + v3s16(-bs2,bs2,bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(-bs2,bs2,bs2),
step, stepfac, startoff, endoff, needed_count) &&
- isOccluded(spn, cpn + v3s16(-bs2,bs2,-bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(-bs2,bs2,-bs2),
step, stepfac, startoff, endoff, needed_count) &&
- isOccluded(spn, cpn + v3s16(-bs2,-bs2,bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(-bs2,-bs2,bs2),
step, stepfac, startoff, endoff, needed_count) &&
- isOccluded(spn, cpn + v3s16(-bs2,-bs2,-bs2),
+ isOccluded(cam_pos_nodes, cpn + v3s16(-bs2,-bs2,-bs2),
step, stepfac, startoff, endoff, needed_count));
}