Skip to content

Commit

Permalink
Fix coloured fog in main menu (#8181)
Browse files Browse the repository at this point in the history
Fixes #4727. The issue was due to the video driver fog colour never getting reset after closing the game.
  • Loading branch information
random-geek authored and sfan5 committed Feb 15, 2019
1 parent 3dafc00 commit 2153163
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/gui/guiEngine.cpp
Expand Up @@ -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> &current_screen_size =
Expand All @@ -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)
{
Expand Down

0 comments on commit 2153163

Please sign in to comment.