aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-04-21 15:34:59 +0200
committerZeno- <kde.psych@gmail.com>2017-04-21 23:34:59 +1000
commit1ffb180868ffcec6812cd3aac8f56ffefb91c8bc (patch)
tree2b7dc1d209bda384fbd995dc7f13ffdd3587818f /src/client.cpp
parent2ad74a9e8b9da48aef62346de6cd55f304c6440d (diff)
downloadminetest-1ffb180868ffcec6812cd3aac8f56ffefb91c8bc.tar.gz
minetest-1ffb180868ffcec6812cd3aac8f56ffefb91c8bc.tar.bz2
minetest-1ffb180868ffcec6812cd3aac8f56ffefb91c8bc.zip
Soft node overlay (#5186)
This commit adds node overlays, which are tiles that are drawn on top of other tiles.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 3cea4fbf4..ce42d025e 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -487,13 +487,17 @@ void Client::step(float dtime)
minimap_mapblock = r.mesh->moveMinimapMapblock();
if (minimap_mapblock == NULL)
do_mapper_update = false;
- }
- if (r.mesh && r.mesh->getMesh()->getMeshBufferCount() == 0) {
- delete r.mesh;
- } else {
- // Replace with the new mesh
- block->mesh = r.mesh;
+ bool is_empty = true;
+ for (int l = 0; l < MAX_TILE_LAYERS; l++)
+ if (r.mesh->getMesh(l)->getMeshBufferCount() != 0)
+ is_empty = false;
+
+ if (is_empty)
+ delete r.mesh;
+ else
+ // Replace with the new mesh
+ block->mesh = r.mesh;
}
} else {
delete r.mesh;