mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Optimize lighting calculation (#12797)
This commit is contained in:
parent
440d966b93
commit
9676364c1f
18 changed files with 188 additions and 220 deletions
|
@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "clientenvironment.h"
|
||||
#include "client.h"
|
||||
#include "map.h"
|
||||
#include "nodedef.h"
|
||||
|
||||
class SmokePuffCSO: public ClientSimpleObject
|
||||
{
|
||||
|
@ -50,7 +51,7 @@ public:
|
|||
bool pos_ok;
|
||||
MapNode n = env->getMap().getNode(floatToInt(pos, BS), &pos_ok);
|
||||
light = pos_ok ? decode_light(n.getLightBlend(env->getDayNightRatio(),
|
||||
env->getGameDef()->ndef()))
|
||||
env->getGameDef()->ndef()->getLightingFlags(n)))
|
||||
: 64;
|
||||
video::SColor color(255,light,light,light);
|
||||
m_spritenode->setColor(color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue