Android: don't update frames in the background (in MainMenu only)

This commit is contained in:
Maksim 2020-07-06 13:55:59 +02:00
parent 8f7a8a96b8
commit 8853f579b1

View File

@ -285,6 +285,9 @@ void GUIEngine::run()
#ifdef __IOS__ #ifdef __IOS__
if (m_device->isWindowMinimized()) if (m_device->isWindowMinimized())
continue; continue;
#elif defined(__ANDROID__)
if (!m_device->isWindowFocused())
continue;
#endif #endif
const irr::core::dimension2d<u32> &current_screen_size = const irr::core::dimension2d<u32> &current_screen_size =
@ -327,10 +330,6 @@ void GUIEngine::run()
? g_settings->getFloat("pause_fps_max") ? g_settings->getFloat("pause_fps_max")
: g_settings->getFloat("fps_max")); : g_settings->getFloat("fps_max"));
#if defined(__ANDROID__) || defined(__IOS__)
if (!m_device->isWindowFocused())
frametime_min = 1000;
#endif
if (m_clouds_enabled) if (m_clouds_enabled)
cloudPostProcess(); cloudPostProcess();
else else