From: Perttu Ahola Date: Wed, 29 Dec 2010 13:26:47 +0000 (+0200) Subject: A bit longer day and a bit shorter night. Client-side. X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=6d4cd2ea1acc07ad5a25a422f430fa1159a3e872;p=zefram%2Fminetest%2Fminetest_engine.git A bit longer day and a bit shorter night. Client-side. --- diff --git a/src/client.cpp b/src/client.cpp index 4792490f..b7a076c5 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -139,37 +139,6 @@ void Client::step(float dtime) if(dtime > 2.0) dtime = 2.0; - /* - Day/night - */ - { - s32 d = 8; - s32 t = (((m_time_of_day.get() + 24000/d/2)%24000)/(24000/d)); - s32 dn = 0; - if(t == d/4 || t == (d-d/4)) - dn = 1; - else if(t < d/4 || t > (d-d/4)) - dn = 2; - else - dn = 0; - - u32 dr = 1000; - if(dn == 0) - dr = 1000; - if(dn == 1) - dr = 600; - if(dn == 2) - dr = 300; - - if(dr != m_env.getDayNightRatio()) - { - //dstream<<"dr="<setAspectRatio((f32)screensize.X / (f32)screensize.Y); u32 daynight_ratio = client.getDayNightRatio(); - video::SColor bgcolor = video::SColor( + /*video::SColor bgcolor = video::SColor( 255, skycolor.getRed() * daynight_ratio / 1000, skycolor.getGreen() * daynight_ratio / 1000, - skycolor.getBlue() * daynight_ratio / 1000); + skycolor.getBlue() * daynight_ratio / 1000);*/ + + u8 l = decode_light((daynight_ratio * LIGHT_SUN) / 1000); + video::SColor bgcolor = video::SColor( + 255, + skycolor.getRed() * l / 255, + skycolor.getGreen() * l / 255, + skycolor.getBlue() * l / 255); /* Fog diff --git a/src/map.cpp b/src/map.cpp index 93c4d505..a3fe9922 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3178,9 +3178,12 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) /* This has to be done with the mesh_mutex unlocked */ - if(mesh_expired && mesh_update_count < 6 - && (d < faraway || mesh_update_count < 3)) - //if(mesh_expired && mesh_update_count < 4) + // Pretty random but this should work somewhat nicely + if(mesh_expired && mesh_update_count < 3 + && (d < faraway || mesh_update_count < 2 + || m_control.range_all)) + /*if(mesh_expired && mesh_update_count < 6 + && (d < faraway || mesh_update_count < 3))*/ { mesh_update_count++; diff --git a/src/server.cpp b/src/server.cpp index 05ef13d9..daf00b8e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -876,7 +876,7 @@ Server::Server( m_con(PROTOCOL_ID, 512, CONNECTION_TIMEOUT, this), m_thread(this), m_emergethread(this), - m_time_of_day(8000), + m_time_of_day(9000), m_time_counter(0), m_time_of_day_send_timer(0), m_uptime(0)