diff options
author | Kahrl <kahrl@gmx.net> | 2012-03-13 18:56:12 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-15 21:45:44 +0200 |
commit | 807a0d313ba667356ee8af8ef5ae82b6c4881d15 (patch) | |
tree | c4674e1c193cfcf8359c788ed5894d3cc1849648 /src/utility.h | |
parent | f9a66c5d46b225d0ddbbad939232348bc5ebf959 (diff) | |
download | minetest-807a0d313ba667356ee8af8ef5ae82b6c4881d15.tar.gz minetest-807a0d313ba667356ee8af8ef5ae82b6c4881d15.tar.bz2 minetest-807a0d313ba667356ee8af8ef5ae82b6c4881d15.zip |
MapBlockMesh, mesh animation system, urgent mesh updates, athmospheric light, removed footprints
Diffstat (limited to 'src/utility.h')
-rw-r--r-- | src/utility.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/utility.h b/src/utility.h index aa64c28bb..15c013735 100644 --- a/src/utility.h +++ b/src/utility.h @@ -1753,18 +1753,17 @@ std::string deSerializeJsonString(std::istream &is); inline u32 time_to_daynight_ratio(u32 time_of_day) { - const s32 daylength = 16; - const s32 nightlength = 6; - const s32 daytimelength = 8; - s32 d = daylength; - s32 t = (((time_of_day)%24000)/(24000/d)); - if(t < nightlength/2 || t >= d - nightlength/2) - //return 300; + s32 t = time_of_day%24000; + if(t < 4500 || t >= 19500) + return 150; + else if(t < 5000 || t >= 19000) return 350; - else if(t >= d/2 - daytimelength/2 && t < d/2 + daytimelength/2) - return 1000; - else + else if(t < 5500 || t >= 18500) + return 500; + else if(t < 6000 || t >= 18000) return 750; + else + return 1000; } // Random helper. Usually d=BS |