aboutsummaryrefslogtreecommitdiff
path: root/src/mapnode.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-21 18:08:24 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-21 18:08:24 +0200
commit3f5bad938a3fcb601ad41924a4707476b8b87241 (patch)
treeddf9d7d49a93c092c31fcbdd6bf1c2ad42e43bc8 /src/mapnode.h
parent3b0bff2f743a3abf100368f94efafa7c2843a9b7 (diff)
downloaddragonfireclient-3f5bad938a3fcb601ad41924a4707476b8b87241.tar.xz
organizing stuff.
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)
{