1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

OMG! Main Menu!

This commit is contained in:
Perttu Ahola 2011-01-23 17:29:15 +02:00
parent c0a1bcf473
commit c914cbb0a0
25 changed files with 897 additions and 272 deletions

View file

@ -141,6 +141,8 @@ MapNode MapBlock::getNodeParentNoEx(v3s16 p)
n: getNodeParent(p)
n2: getNodeParent(p + face_dir)
face_dir: axis oriented unit vector from p to p2
returns encoded light value.
*/
u8 MapBlock::getFaceLight(u32 daynight_ratio, MapNode n, MapNode n2,
v3s16 face_dir)
@ -721,6 +723,9 @@ void MapBlock::updateMesh(u32 daynight_ratio)
MapNode &n = getNodeRef(x,y,z);
/*
Add torches to mesh
*/
if(n.d == CONTENT_TORCH)
{
video::SColor c(255,255,255,255);
@ -779,6 +784,9 @@ void MapBlock::updateMesh(u32 daynight_ratio)
// Add to mesh collector
collector.append(material, vertices, 4, indices, 6);
}
/*
Add flowing water to mesh
*/
else if(n.d == CONTENT_WATER)
{
bool top_is_water = false;
@ -787,8 +795,9 @@ void MapBlock::updateMesh(u32 daynight_ratio)
if(n.d == CONTENT_WATER || n.d == CONTENT_WATERSOURCE)
top_is_water = true;
}catch(InvalidPositionException &e){}
video::SColor c(128,255,255,255);
u8 l = decode_light(n.getLightBlend(daynight_ratio));
video::SColor c(128,l,l,l);
// Neighbor water levels (key = relative position)
// Includes current node