diff options
author | random-geek <35757396+random-geek@users.noreply.github.com> | 2019-02-15 11:44:21 -0800 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-02-15 20:44:21 +0100 |
commit | 2153163cbd0a57783e646523c62e83bfe1be2277 (patch) | |
tree | 2467639af77dff6398c877bfc5db20a6c5d92622 | |
parent | 3dafc007a95ae89904e0e92dc86ed27205de05c5 (diff) | |
download | minetest-2153163cbd0a57783e646523c62e83bfe1be2277.tar.gz minetest-2153163cbd0a57783e646523c62e83bfe1be2277.tar.bz2 minetest-2153163cbd0a57783e646523c62e83bfe1be2277.zip |
Fix coloured fog in main menu (#8181)
Fixes #4727. The issue was due to the video driver fog colour never getting reset after closing the game.
-rw-r--r-- | src/gui/guiEngine.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index 241c85aa8..6030a5bfb 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -242,6 +242,24 @@ void GUIEngine::run() irr::core::dimension2d<u32> previous_screen_size(g_settings->getU16("screen_w"), g_settings->getU16("screen_h")); + static const video::SColor sky_color(255, 140, 186, 250); + + // Reset fog color + { + video::SColor fog_color; + video::E_FOG_TYPE fog_type = video::EFT_FOG_LINEAR; + f32 fog_start = 0; + f32 fog_end = 0; + f32 fog_density = 0; + bool fog_pixelfog = false; + bool fog_rangefog = false; + driver->getFog(fog_color, fog_type, fog_start, fog_end, fog_density, + fog_pixelfog, fog_rangefog); + + driver->setFog(sky_color, fog_type, fog_start, fog_end, fog_density, + fog_pixelfog, fog_rangefog); + } + while (RenderingEngine::run() && (!m_startgame) && (!m_kill)) { const irr::core::dimension2d<u32> ¤t_screen_size = @@ -263,7 +281,7 @@ void GUIEngine::run() text_height = g_fontengine->getTextHeight(); } - driver->beginScene(true, true, video::SColor(255,140,186,250)); + driver->beginScene(true, true, sky_color); if (m_clouds_enabled) { |