1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Object properties: Add 'glow', disables light's effect if negative

The 'glow' value is added to the ambient light value.
Negative 'glow' disables light's effect on object colour, for faking
self-lighting, UI-style entities, or programmatic colouring in mods.
This commit is contained in:
Rob Blanckaert 2017-09-01 23:12:15 -07:00 committed by paramat
parent 604fe2083d
commit a9d43a0471
9 changed files with 52 additions and 20 deletions

View file

@ -659,7 +659,10 @@ void GenericCAO::updateLight(u8 light_at_pos)
void GenericCAO::updateLightNoCheck(u8 light_at_pos)
{
u8 li = decode_light(light_at_pos);
if (m_glow < 0)
return;
u8 li = decode_light(light_at_pos + m_glow);
if (li != m_last_light) {
m_last_light = li;
video::SColor color(255,li,li,li);
@ -978,6 +981,7 @@ void GenericCAO::updateTextures(std::string mod)
m_previous_texture_modifier = m_current_texture_modifier;
m_current_texture_modifier = mod;
m_glow = m_prop.glow;
if (m_spritenode) {
if (m_prop.visual == "sprite") {