aboutsummaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
authorRob Blanckaert <rob@withpiper.com>2017-09-01 23:12:15 -0700
committerparamat <mat.gregory@virginmedia.com>2017-09-14 04:06:05 +0100
commita9d43a04713dd0342d675f3bbb5cbacd863b4118 (patch)
treedde4ca88964a67c1a27211eca6f6fcf96fc246d0 /src/content_cao.cpp
parent604fe2083d70fea92b6c53c9a9d1c1ffdcb36610 (diff)
downloadhax-minetest-server-a9d43a04713dd0342d675f3bbb5cbacd863b4118.tar.gz
hax-minetest-server-a9d43a04713dd0342d675f3bbb5cbacd863b4118.zip
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.
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 7659871b6..9a493daff 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -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") {