Skip to content

Commit 2153163

Browse files
random-geeksfan5
authored andcommittedFeb 15, 2019
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.
1 parent 3dafc00 commit 2153163

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
 

‎src/gui/guiEngine.cpp

+19-1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,24 @@ void GUIEngine::run()
242242
irr::core::dimension2d<u32> previous_screen_size(g_settings->getU16("screen_w"),
243243
g_settings->getU16("screen_h"));
244244

245+
static const video::SColor sky_color(255, 140, 186, 250);
246+
247+
// Reset fog color
248+
{
249+
video::SColor fog_color;
250+
video::E_FOG_TYPE fog_type = video::EFT_FOG_LINEAR;
251+
f32 fog_start = 0;
252+
f32 fog_end = 0;
253+
f32 fog_density = 0;
254+
bool fog_pixelfog = false;
255+
bool fog_rangefog = false;
256+
driver->getFog(fog_color, fog_type, fog_start, fog_end, fog_density,
257+
fog_pixelfog, fog_rangefog);
258+
259+
driver->setFog(sky_color, fog_type, fog_start, fog_end, fog_density,
260+
fog_pixelfog, fog_rangefog);
261+
}
262+
245263
while (RenderingEngine::run() && (!m_startgame) && (!m_kill)) {
246264

247265
const irr::core::dimension2d<u32> &current_screen_size =
@@ -263,7 +281,7 @@ void GUIEngine::run()
263281
text_height = g_fontengine->getTextHeight();
264282
}
265283

266-
driver->beginScene(true, true, video::SColor(255,140,186,250));
284+
driver->beginScene(true, true, sky_color);
267285

268286
if (m_clouds_enabled)
269287
{

0 commit comments

Comments
 (0)
Please sign in to comment.