mirror of
https://github.com/minetest/minetest.git
synced 2025-07-07 02:10:22 +02:00
Android: Pause rendering while the app is paused (#14058)
This commit is contained in:
@ -4010,31 +4010,6 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
|
||||
*/
|
||||
client->getParticleManager()->step(dtime);
|
||||
|
||||
/*
|
||||
Fog
|
||||
*/
|
||||
if (m_cache_enable_fog) {
|
||||
driver->setFog(
|
||||
sky->getBgColor(),
|
||||
video::EFT_FOG_LINEAR,
|
||||
runData.fog_range * sky->getFogStart(),
|
||||
runData.fog_range * 1.0,
|
||||
0.01,
|
||||
false, // pixel fog
|
||||
true // range fog
|
||||
);
|
||||
} else {
|
||||
driver->setFog(
|
||||
sky->getBgColor(),
|
||||
video::EFT_FOG_LINEAR,
|
||||
100000 * BS,
|
||||
110000 * BS,
|
||||
0.01f,
|
||||
false, // pixel fog
|
||||
false // range fog
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Damage camera tilt
|
||||
*/
|
||||
@ -4134,7 +4109,8 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
|
||||
/*
|
||||
==================== Drawing begins ====================
|
||||
*/
|
||||
drawScene(graph, stats);
|
||||
if (RenderingEngine::shouldRender())
|
||||
drawScene(graph, stats);
|
||||
/*
|
||||
==================== End scene ====================
|
||||
*/
|
||||
@ -4214,10 +4190,39 @@ void Game::updateShadows()
|
||||
|
||||
void Game::drawScene(ProfilerGraph *graph, RunStats *stats)
|
||||
{
|
||||
const video::SColor skycolor = this->sky->getSkyColor();
|
||||
const video::SColor bg_color = this->sky->getBgColor();
|
||||
const video::SColor sky_color = this->sky->getSkyColor();
|
||||
|
||||
/*
|
||||
Fog
|
||||
*/
|
||||
if (this->m_cache_enable_fog) {
|
||||
this->driver->setFog(
|
||||
bg_color,
|
||||
video::EFT_FOG_LINEAR,
|
||||
this->runData.fog_range * this->sky->getFogStart(),
|
||||
this->runData.fog_range * 1.0f,
|
||||
0.01f,
|
||||
false, // pixel fog
|
||||
true // range fog
|
||||
);
|
||||
} else {
|
||||
this->driver->setFog(
|
||||
bg_color,
|
||||
video::EFT_FOG_LINEAR,
|
||||
100000 * BS,
|
||||
110000 * BS,
|
||||
0.01f,
|
||||
false, // pixel fog
|
||||
false // range fog
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Drawing
|
||||
*/
|
||||
TimeTaker tt_draw("Draw scene", nullptr, PRECISION_MICRO);
|
||||
this->driver->beginScene(true, true, skycolor);
|
||||
this->driver->beginScene(true, true, sky_color);
|
||||
|
||||
const LocalPlayer *player = this->client->getEnv().getLocalPlayer();
|
||||
bool draw_wield_tool = (this->m_game_ui->m_flags.show_hud &&
|
||||
@ -4230,7 +4235,7 @@ void Game::drawScene(ProfilerGraph *graph, RunStats *stats)
|
||||
if (this->isNoCrosshairAllowed())
|
||||
draw_crosshair = false;
|
||||
#endif
|
||||
this->m_rendering_engine->draw_scene(skycolor, this->m_game_ui->m_flags.show_hud,
|
||||
this->m_rendering_engine->draw_scene(sky_color, this->m_game_ui->m_flags.show_hud,
|
||||
this->m_game_ui->m_flags.show_minimap, draw_wield_tool, draw_crosshair);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user