diff options
author | sapier <sapier at gmx dot net> | 2012-02-04 12:41:25 +0100 |
---|---|---|
committer | sapier <sapier at gmx dot net> | 2012-02-04 12:41:25 +0100 |
commit | 77df09540c4d7eadef760779e123af88a48aafaa (patch) | |
tree | febf1009328d30c31a14a1a1ca1600e99b4c3e6b /src/light.cpp | |
parent | 3454e6779337d8523ae76c7fa16eb8c565aa2381 (diff) | |
parent | a1eb2836c0764829ebad1462432bb3c5f32750df (diff) | |
download | minetest-77df09540c4d7eadef760779e123af88a48aafaa.tar.xz |
Merge remote branch 'upstream/master' into sapier_experimental
Conflicts:
src/scriptapi.cpp
Diffstat (limited to 'src/light.cpp')
-rw-r--r-- | src/light.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/src/light.cpp b/src/light.cpp index f214d6ea0..93e498620 100644 --- a/src/light.cpp +++ b/src/light.cpp @@ -20,6 +20,56 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "light.h" #if 1 +/* +Made using this and adding 230 as the second last one: + +#!/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 +FACTOR = 0.83 +START_FROM_ZERO = False + +L = [] +if START_FROM_ZERO: + for i in range(1,LIGHT_MAX+1): + L.append(int(round(255.0 * FACTOR ** (i-1)))) + L.append(0) +else: + for i in range(1,LIGHT_MAX+1): + L.append(int(round(255.0 * FACTOR ** (i-1)))) + L.append(255) + +L.reverse() +for i in L: + stdout.write(str(i)+",\n") +*/ +u8 light_decode_table[LIGHT_MAX+1] = +{ +23, +27, +33, +40, +48, +57, +69, +83, +100, +121, +146, +176, +212, +230, +255, +}; +#endif + +#if 0 // This is good // a_n+1 = a_n * 0.786 // Length of LIGHT_MAX+1 means LIGHT_MAX is the last value. @@ -42,7 +92,9 @@ u8 light_decode_table[LIGHT_MAX+1] = 200, 255, }; -#else +#endif + +#if 0 // Use for debugging in dark u8 light_decode_table[LIGHT_MAX+1] = { |