before adding day/night lighting
[oweals/minetest.git] / src / light.cpp
1 /*
2 Minetest-c55
3 Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #include "light.h"
21
22 // LIGHT_MAX is 15, 0-15 is 16 values
23 /*u8 light_decode_table[LIGHT_MAX+1] = 
24 {
25 0,
26 9,
27 12,
28 14,
29 16,
30 20,
31 26,
32 34,
33 45,
34 61,
35 81,
36 108,
37 143,
38 191,
39 255,
40 };*/
41 u8 light_decode_table[LIGHT_MAX+1] = 
42 {
43 0,
44 5,
45 12,
46 22,
47 35,
48 50,
49 65,
50 85,
51 100,
52 120,
53 140,
54 160,
55 185,
56 215,
57 255,
58 };
59
60 #if 0
61 /*
62 #!/usr/bin/python
63
64 from math import *
65 from sys import stdout
66
67 # We want 0 at light=0 and 255 at light=LIGHT_MAX
68 LIGHT_MAX = 14
69 #FACTOR = 0.69
70 FACTOR = 0.75
71
72 L = []
73 for i in range(1,LIGHT_MAX+1):
74     L.append(int(round(255.0 * FACTOR ** (i-1))))
75 L.append(0)
76
77 L.reverse()
78 for i in L:
79     stdout.write(str(i)+",\n")
80 */
81 u8 light_decode_table[LIGHT_MAX+1] = 
82 {
83 0,
84 6,
85 8,
86 11,
87 14,
88 19,
89 26,
90 34,
91 45,
92 61,
93 81,
94 108,
95 143,
96 191,
97 255,
98 };
99 #endif
100
101