1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

Only pause rendering if the Android activity is stopped (#14211)

This commit is contained in:
grorp
2024-01-27 14:37:00 +01:00
committed by GitHub
parent 89f3502b56
commit fbec168e91
3 changed files with 3 additions and 15 deletions

View File

@@ -231,6 +231,7 @@ bool GUIEngine::loadMainMenuScript()
/******************************************************************************/
void GUIEngine::run()
{
IrrlichtDevice *device = m_rendering_engine->get_raw_device();
// Always create clouds because they may or may not be
// needed based on the game selected
video::IVideoDriver *driver = m_rendering_engine->get_video_driver();
@@ -265,7 +266,7 @@ void GUIEngine::run()
f32 dtime = 0.0f;
while (m_rendering_engine->run() && (!m_startgame) && (!m_kill)) {
if (RenderingEngine::shouldRender()) {
if (device->isWindowVisible()) {
// check if we need to update the "upper left corner"-text
if (text_height != g_fontengine->getTextHeight()) {
updateTopLeftTextSize();
@@ -295,8 +296,6 @@ void GUIEngine::run()
driver->endScene();
}
IrrlichtDevice *device = m_rendering_engine->get_raw_device();
u32 frametime_min = 1000 / (device->isWindowFocused()
? g_settings->getFloat("fps_max")
: g_settings->getFloat("fps_max_unfocused"));