1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.
This commit is contained in:
paramat 2017-03-29 03:40:30 +01:00
parent fbc1432fe8
commit ea549bbae3
4 changed files with 47 additions and 17 deletions

View file

@ -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);