forked from Mirrorlandia_minetest/minetest
master #7
@ -4207,7 +4207,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
|
|||||||
/*
|
/*
|
||||||
==================== Drawing begins ====================
|
==================== Drawing begins ====================
|
||||||
*/
|
*/
|
||||||
if (RenderingEngine::shouldRender())
|
if (device->isWindowVisible())
|
||||||
drawScene(graph, stats);
|
drawScene(graph, stats);
|
||||||
/*
|
/*
|
||||||
==================== End scene ====================
|
==================== End scene ====================
|
||||||
|
@ -141,17 +141,6 @@ public:
|
|||||||
const irr::core::dimension2d<u32> initial_screen_size,
|
const irr::core::dimension2d<u32> initial_screen_size,
|
||||||
const bool initial_window_maximized);
|
const bool initial_window_maximized);
|
||||||
|
|
||||||
static bool shouldRender()
|
|
||||||
{
|
|
||||||
// On Android, pause rendering while the app is in background (generally not visible).
|
|
||||||
// Don't do this on desktop because windows can be partially visible.
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
return get_raw_device()->isWindowActive();
|
|
||||||
#else
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
v2u32 _getWindowSize() const;
|
v2u32 _getWindowSize() const;
|
||||||
|
|
||||||
|
@ -231,6 +231,7 @@ bool GUIEngine::loadMainMenuScript()
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
void GUIEngine::run()
|
void GUIEngine::run()
|
||||||
{
|
{
|
||||||
|
IrrlichtDevice *device = m_rendering_engine->get_raw_device();
|
||||||
// Always create clouds because they may or may not be
|
// Always create clouds because they may or may not be
|
||||||
// needed based on the game selected
|
// needed based on the game selected
|
||||||
video::IVideoDriver *driver = m_rendering_engine->get_video_driver();
|
video::IVideoDriver *driver = m_rendering_engine->get_video_driver();
|
||||||
@ -265,7 +266,7 @@ void GUIEngine::run()
|
|||||||
f32 dtime = 0.0f;
|
f32 dtime = 0.0f;
|
||||||
|
|
||||||
while (m_rendering_engine->run() && (!m_startgame) && (!m_kill)) {
|
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
|
// check if we need to update the "upper left corner"-text
|
||||||
if (text_height != g_fontengine->getTextHeight()) {
|
if (text_height != g_fontengine->getTextHeight()) {
|
||||||
updateTopLeftTextSize();
|
updateTopLeftTextSize();
|
||||||
@ -295,8 +296,6 @@ void GUIEngine::run()
|
|||||||
driver->endScene();
|
driver->endScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
IrrlichtDevice *device = m_rendering_engine->get_raw_device();
|
|
||||||
|
|
||||||
u32 frametime_min = 1000 / (device->isWindowFocused()
|
u32 frametime_min = 1000 / (device->isWindowFocused()
|
||||||
? g_settings->getFloat("fps_max")
|
? g_settings->getFloat("fps_max")
|
||||||
: g_settings->getFloat("fps_max_unfocused"));
|
: g_settings->getFloat("fps_max_unfocused"));
|
||||||
|
Loading…
Reference in New Issue
Block a user