From ea549bbae3650d246db7b70a2b07485a4b404409 Mon Sep 17 00:00:00 2001 From: paramat Date: Wed, 29 Mar 2017 03:40:30 +0100 Subject: Paramtype2: Add missing type CPT2_GLASSLIKE_LIQUID_LEVEL Add the missing paramtype2 for param2 controlling the liquid level inside the glasslike_framed drawtype. Add missing documentation of the feature to lua_api.txt. Update and improve comments for drawtype enumerations in nodedef.h. --- src/content_mapblock.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/content_mapblock.cpp') diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index d0cb50db3..d18aff879 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -760,8 +760,11 @@ void MapblockMeshGenerator::drawGlasslikeFramedNode() drawAutoLightedCuboid(glass_faces[face]); } - if (param2 > 0 && f->special_tiles[0].texture) { - // Interior volume level is in range 0 .. 63, + // Optionally render internal liquid level defined by param2 + // Liquid is textured with 1 tile defined in nodedef 'special_tiles' + if (param2 > 0 && f->param_type_2 == CPT2_GLASSLIKE_LIQUID_LEVEL && + f->special_tiles[0].texture) { + // Internal liquid level has param2 range 0 .. 63, // convert it to -0.5 .. 0.5 float vlev = (param2 / 63.0) * 2.0 - 1.0; tile = getSpecialTile(*f, n, 0); -- cgit v1.2.3