95bb37a8d55e58975f787e492c5b5a632b9dd8f8
[oweals/minetest.git] / src / light.cpp
1 #include "light.h"
2
3 /*
4
5 #!/usr/bin/python
6
7 from math import *
8 from sys import stdout
9
10 # We want 0 at light=0 and 255 at light=LIGHT_MAX
11 LIGHT_MAX = 15
12
13 L = []
14 for i in range(1,LIGHT_MAX+1):
15     L.append(int(round(255.0 * 0.69 ** (i-1))))
16         L.append(0)
17
18 L.reverse()
19 for i in L:
20         stdout.write(str(i)+",\n")
21
22 */
23
24 /*
25         The first value should be 0, the last value should be 255.
26 */
27 /*u8 light_decode_table[LIGHT_MAX+1] = 
28 {
29 0,
30 2,
31 3,
32 4,
33 6,
34 9,
35 13,
36 19,
37 28,
38 40,
39 58,
40 84,
41 121,
42 176,
43 255,
44 };*/
45
46 /*
47 #!/usr/bin/python
48
49 from math import *
50 from sys import stdout
51
52 # We want 0 at light=0 and 255 at light=LIGHT_MAX
53 LIGHT_MAX = 14
54 #FACTOR = 0.69
55 FACTOR = 0.75
56
57 L = []
58 for i in range(1,LIGHT_MAX+1):
59     L.append(int(round(255.0 * FACTOR ** (i-1))))
60 L.append(0)
61
62 L.reverse()
63 for i in L:
64     stdout.write(str(i)+",\n")
65 */
66 u8 light_decode_table[LIGHT_MAX+1] = 
67 {
68 0,
69 6,
70 8,
71 11,
72 14,
73 19,
74 26,
75 34,
76 45,
77 61,
78 81,
79 108,
80 143,
81 191,
82 255,
83 };
84
85