From 4e249fb3fbf75f0359758760d88e22aa5b14533c Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 27 Nov 2010 01:02:21 +0200 Subject: Initial files --- src/light.cpp | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/light.cpp (limited to 'src/light.cpp') diff --git a/src/light.cpp b/src/light.cpp new file mode 100644 index 000000000..95bb37a8d --- /dev/null +++ b/src/light.cpp @@ -0,0 +1,85 @@ +#include "light.h" + +/* + +#!/usr/bin/python + +from math import * +from sys import stdout + +# We want 0 at light=0 and 255 at light=LIGHT_MAX +LIGHT_MAX = 15 + +L = [] +for i in range(1,LIGHT_MAX+1): + L.append(int(round(255.0 * 0.69 ** (i-1)))) + L.append(0) + +L.reverse() +for i in L: + stdout.write(str(i)+",\n") + +*/ + +/* + The first value should be 0, the last value should be 255. +*/ +/*u8 light_decode_table[LIGHT_MAX+1] = +{ +0, +2, +3, +4, +6, +9, +13, +19, +28, +40, +58, +84, +121, +176, +255, +};*/ + +/* +#!/usr/bin/python + +from math import * +from sys import stdout + +# We want 0 at light=0 and 255 at light=LIGHT_MAX +LIGHT_MAX = 14 +#FACTOR = 0.69 +FACTOR = 0.75 + +L = [] +for i in range(1,LIGHT_MAX+1): + L.append(int(round(255.0 * FACTOR ** (i-1)))) +L.append(0) + +L.reverse() +for i in L: + stdout.write(str(i)+",\n") +*/ +u8 light_decode_table[LIGHT_MAX+1] = +{ +0, +6, +8, +11, +14, +19, +26, +34, +45, +61, +81, +108, +143, +191, +255, +}; + + -- cgit v1.2.3