mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00:00
Pause shader animation timer in singleplayer pause menu (#12766)
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
6ac38aa2c8
commit
0251b01da6
3 changed files with 36 additions and 24 deletions
|
@ -519,7 +519,12 @@ void ClientEnvironment::getSelectedActiveObjects(
|
|||
}
|
||||
}
|
||||
|
||||
void ClientEnvironment::updateFrameTime()
|
||||
void ClientEnvironment::updateFrameTime(bool is_paused)
|
||||
{
|
||||
m_frame_time = porting::getTimeMs();
|
||||
// if paused, m_frame_time_pause_accumulator increases by dtime,
|
||||
// otherwise, m_frame_time increases by dtime
|
||||
if (is_paused)
|
||||
m_frame_time_pause_accumulator = porting::getTimeMs() - m_frame_time;
|
||||
else
|
||||
m_frame_time = porting::getTimeMs() - m_frame_time_pause_accumulator;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue