summaryrefslogtreecommitdiff
path: root/src/light.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-11-27 01:02:21 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-11-27 01:02:21 +0200
commit4e249fb3fbf75f0359758760d88e22aa5b14533c (patch)
tree323087d05efbd2ace27b316d4f017cf812a31992 /src/light.cpp
downloadminetest-4e249fb3fbf75f0359758760d88e22aa5b14533c.tar.gz
minetest-4e249fb3fbf75f0359758760d88e22aa5b14533c.tar.bz2
minetest-4e249fb3fbf75f0359758760d88e22aa5b14533c.zip
Initial files
Diffstat (limited to 'src/light.cpp')
-rw-r--r--src/light.cpp85
1 files changed, 85 insertions, 0 deletions
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,
+};
+
+