]> git.lizzy.rs Git - minetest.git/commitdiff
Enable negative values for sun/moon orbit tilt (Northern hemisphere) (#12904)
authorx2048 <codeforsmile@gmail.com>
Sun, 30 Oct 2022 15:54:06 +0000 (16:54 +0100)
committerGitHub <noreply@github.com>
Sun, 30 Oct 2022 15:54:06 +0000 (16:54 +0100)
builtin/settingtypes.txt
src/client/sky.cpp

index e4d345e2d91ae7d630360504b930b5ead818e9a8..eaaf749436b45b2b29dcec53a1a4920e6423afd3 100644 (file)
@@ -447,7 +447,7 @@ shadow_soft_radius (Soft shadow radius) float 5.0 1.0 15.0
 #    Set the tilt of Sun/Moon orbit in degrees.
 #    Value of 0 means no tilt / vertical orbit.
 #    Minimum value: 0.0; maximum value: 60.0
-shadow_sky_body_orbit_tilt (Sky Body Orbit Tilt) float 0.0 0.0 60.0
+shadow_sky_body_orbit_tilt (Sky Body Orbit Tilt) float 0.0 -60.0 60.0
 
 [**Post processing]
 
index e622a6a942d54eb7a8346660042a68f15ae177fa..dd1c33b3e88e9b9aa527fee71194519a57edeba2 100644 (file)
@@ -103,10 +103,8 @@ Sky::Sky(s32 id, RenderingEngine *rendering_engine, ITextureSource *tsrc, IShade
 
        m_directional_colored_fog = g_settings->getBool("directional_colored_fog");
 
-       if (g_settings->getBool("enable_dynamic_shadows")) {
-               float val = g_settings->getFloat("shadow_sky_body_orbit_tilt");
-               m_sky_body_orbit_tilt = rangelim(val, 0.0f, 60.0f);
-       }
+       if (g_settings->getBool("enable_dynamic_shadows"))
+               m_sky_body_orbit_tilt = g_settings->getFloat("shadow_sky_body_orbit_tilt", -60.0f, 60.0f);
 
        setStarCount(1000);
 }