aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2014-12-18 15:39:02 +1000
committerCraig Robbins <kde.psych@gmail.com>2014-12-18 20:28:14 +1000
commit815876e7097fcd1e317ecfd867db807681f9cb1a (patch)
tree7ce32fb405efb0a8afdcdbbb9f17ec55eb5e514d
parentf5211bbd59bd8f17e0a356900eb308db76368f43 (diff)
downloadminetest-815876e7097fcd1e317ecfd867db807681f9cb1a.tar.gz
minetest-815876e7097fcd1e317ecfd867db807681f9cb1a.tar.bz2
minetest-815876e7097fcd1e317ecfd867db807681f9cb1a.zip
Fix visual_scale for NDT_PLANTLIKE being set too small
-rw-r--r--src/content_mapblock.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index 378a344a4..165073e52 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -1162,15 +1162,16 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
u16 l = getInteriorLight(n, 1, nodedef);
video::SColor c = MapBlock_LightColor(255, l, f.light_source);
- float s = BS / 2;
- for(u32 j = 0; j < 2; j++)
+ float s = BS / 2 * f.visual_scale;
+
+ for (int j = 0; j < 2; j++)
{
video::S3DVertex vertices[4] =
{
- video::S3DVertex(-s,-s, 0, 0,0,0, c, 0,1),
- video::S3DVertex( s,-s, 0, 0,0,0, c, 1,1),
- video::S3DVertex( s, s, 0, 0,0,0, c, 1,0),
- video::S3DVertex(-s, s, 0, 0,0,0, c, 0,0),
+ video::S3DVertex(-s,-BS/2, 0, 0,0,0, c, 0,1),
+ video::S3DVertex( s,-BS/2, 0, 0,0,0, c, 1,1),
+ video::S3DVertex( s,-BS/2 + s*2,0, 0,0,0, c, 1,0),
+ video::S3DVertex(-s,-BS/2 + s*2,0, 0,0,0, c, 0,0),
};
if(j == 0)
@@ -1184,10 +1185,11 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
vertices[i].Pos.rotateXZBy(-44 + n.param2 * 2);
}
- for(u16 i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
{
vertices[i].Pos *= f.visual_scale;
- vertices[i].Pos.Y -= s * (1 - f.visual_scale);
+ if (f.visual_scale < 1)
+ vertices[i].Pos.Y -= BS/2 * (1 - f.visual_scale);
vertices[i].Pos += intToFloat(p, BS);
}