summaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index e70cb39b7..5bf127a17 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -203,7 +203,8 @@ void Environment::printPlayers(std::ostream &o)
u32 Environment::getDayNightRatio()
{
- return time_to_daynight_ratio(m_time_of_day);
+ bool smooth = (g_settings->getS32("enable_shaders") != 0);
+ return time_to_daynight_ratio(m_time_of_day_f*24000, smooth);
}
void Environment::stepTimeOfDay(float dtime)
@@ -2132,15 +2133,15 @@ void ClientEnvironment::step(float dtime)
}
// Update lighting on all players on client
- u8 light = LIGHT_MAX;
+ float light = 1.0;
try{
// Get node at head
v3s16 p = player->getLightPosition();
MapNode n = m_map->getNode(p);
- light = n.getLightBlend(getDayNightRatio(), m_gamedef->ndef());
+ light = n.getLightBlendF1((float)getDayNightRatio()/1000, m_gamedef->ndef());
}
catch(InvalidPositionException &e){
- light = blend_light(getDayNightRatio(), LIGHT_SUN, 0);
+ light = blend_light_f1((float)getDayNightRatio()/1000, LIGHT_SUN, 0);
}
player->light = light;
}