diff options
author | Craig Robbins <kde.psych@gmail.com> | 2014-12-07 00:37:37 +1000 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2014-12-07 00:51:01 +1000 |
commit | 2b119e1e192ead701e69e261fe94ccb7382dbee7 (patch) | |
tree | 19613c0e9baae43b281861ceaa1ecc08b907dba6 /src/environment.cpp | |
parent | 2fd14e1bd53918b3c4fcdfbc81294ff8b7afe1fa (diff) | |
download | minetest-2b119e1e192ead701e69e261fe94ccb7382dbee7.tar.gz minetest-2b119e1e192ead701e69e261fe94ccb7382dbee7.tar.bz2 minetest-2b119e1e192ead701e69e261fe94ccb7382dbee7.zip |
Performance of main client loop up to 2x faster In places, up to 3 times faster
NOTE 1: This does not mean a 2x increase in framerate. Increase in fps may be up to 1-2fps
NOTE 2: This local 'caching' of settings is not optimal and an alternative solution will be worked on after 0.4.11 is released
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 3d525dad9..d7c8acee8 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -55,6 +55,7 @@ Environment::Environment(): m_enable_day_night_ratio_override(false), m_day_night_ratio_override(0.0f) { + m_cache_enable_shaders = g_settings->getBool("enable_shaders"); } Environment::~Environment() @@ -206,8 +207,7 @@ u32 Environment::getDayNightRatio() { if(m_enable_day_night_ratio_override) return m_day_night_ratio_override; - bool smooth = g_settings->getBool("enable_shaders"); - return time_to_daynight_ratio(m_time_of_day_f*24000, smooth); + return time_to_daynight_ratio(m_time_of_day_f*24000, m_cache_enable_shaders); } void Environment::setTimeOfDaySpeed(float speed) |