summaryrefslogtreecommitdiff
path: root/src/mapnode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapnode.h')
-rw-r--r--src/mapnode.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mapnode.h b/src/mapnode.h
index 0e746af48..f52bd52e7 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -399,6 +399,7 @@ struct MapNode
}
// 0 <= daylight_factor <= 1000
+ // 0 <= return value <= LIGHT_SUN
u8 getLightBlend(u32 daylight_factor)
{
u8 l = ((daylight_factor * getLight(LIGHTBANK_DAY)
@@ -411,6 +412,17 @@ struct MapNode
l = max;
return l;
}
+ /*// 0 <= daylight_factor <= 1000
+ // 0 <= return value <= 255
+ u8 getLightBlend(u32 daylight_factor)
+ {
+ u8 daylight = decode_light(getLight(LIGHTBANK_DAY));
+ u8 nightlight = decode_light(getLight(LIGHTBANK_NIGHT));
+ u8 mix = ((daylight_factor * daylight
+ + (1000-daylight_factor) * nightlight)
+ )/1000;
+ return mix;
+ }*/
void setLight(enum LightBank bank, u8 a_light)
{