Fix enable_fog = false not having any effect when shaders are enabled
authorKahrl <kahrl@gmx.net>
Tue, 3 Sep 2013 11:21:04 +0000 (13:21 +0200)
committerKahrl <kahrl@gmx.net>
Tue, 3 Sep 2013 11:23:30 +0000 (13:23 +0200)
src/game.cpp

index 650b5e2f8fc7671842356ecbbd7a1f8c3834f6d1..d3d49d7b431142f4b8aa41ce5028a2db438930f8 100644 (file)
@@ -794,9 +794,9 @@ public:
                services->setPixelShaderConstant("skyBgColor", bgcolorfa, 4);
 
                // Fog distance
-               float fog_distance = *m_fog_range;
-               if(*m_force_fog_off)
-                       fog_distance = 10000*BS;
+               float fog_distance = 10000*BS;
+               if(g_settings->getBool("enable_fog") && !*m_force_fog_off)
+                       fog_distance = *m_fog_range;
                services->setPixelShaderConstant("fogDistance", &fog_distance, 1);
 
                // Day-night ratio
@@ -2928,7 +2928,7 @@ void the_game(
                        Fog
                */
                
-               if(g_settings->getBool("enable_fog") == true && !force_fog_off)
+               if(g_settings->getBool("enable_fog") && !force_fog_off)
                {
                        driver->setFog(
                                bgcolor,