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

Simplistic wielded tool lighting, added setMeshVerticesColor to utility.h and refactored some other code into calls of that

This commit is contained in:
Kahrl 2011-09-21 18:37:29 +02:00
parent a4a2c34831
commit 3e012122d1
8 changed files with 66 additions and 145 deletions

View file

@ -1686,18 +1686,19 @@ void ClientEnvironment::step(float dtime)
// Move
player->move(dtime, *m_map, 100*BS);
// Update lighting on remote players on client
u8 light = LIGHT_MAX;
try{
// Get node at head
v3s16 p = player->getLightPosition();
MapNode n = m_map->getNode(p);
light = n.getLightBlend(getDayNightRatio());
}
catch(InvalidPositionException &e) {}
player->updateLight(light);
}
// Update lighting on all players on client
u8 light = LIGHT_MAX;
try{
// Get node at head
v3s16 p = player->getLightPosition();
MapNode n = m_map->getNode(p);
light = n.getLightBlend(getDayNightRatio());
}
catch(InvalidPositionException &e) {}
player->updateLight(light);
/*
Add footsteps to grass
*/