diff options
author | paramat <mat.gregory@virginmedia.com> | 2017-03-29 03:40:30 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-03-30 04:52:54 +0100 |
commit | ea549bbae3650d246db7b70a2b07485a4b404409 (patch) | |
tree | 0f70b68d6f5f26c83050549562d1077418dd72b0 /src/content_mapblock.cpp | |
parent | fbc1432fe8e821f58e97a5f35340efb2f46f93e4 (diff) | |
download | minetest-ea549bbae3650d246db7b70a2b07485a4b404409.tar.gz minetest-ea549bbae3650d246db7b70a2b07485a4b404409.tar.bz2 minetest-ea549bbae3650d246db7b70a2b07485a4b404409.zip |
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.
Diffstat (limited to 'src/content_mapblock.cpp')
-rw-r--r-- | src/content_mapblock.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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); |