mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 13:55:38 +00:00
Frontend: Fix invalid FPS values when loading state
This commit is contained in:
parent
20a011a074
commit
73ab741d4c
|
@ -302,11 +302,11 @@ bool SDLInterface::HandleSDLEvent(const SDL_Event* event)
|
|||
{
|
||||
if (!pressed)
|
||||
{
|
||||
auto filename = GetSaveStateFilename(event->key.keysym.scancode - SDL_SCANCODE_F1 + 1);
|
||||
const u32 index = event->key.keysym.scancode - SDL_SCANCODE_F1 + 1;
|
||||
if (event->key.keysym.mod & (KMOD_LSHIFT | KMOD_RSHIFT))
|
||||
SaveState(filename);
|
||||
DoSaveState(index);
|
||||
else
|
||||
LoadState(filename);
|
||||
DoLoadState(index);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -667,6 +667,10 @@ void SDLInterface::DoReset()
|
|||
void SDLInterface::DoLoadState(u32 index)
|
||||
{
|
||||
LoadState(GetSaveStateFilename(index));
|
||||
m_last_frame_number = m_system->GetFrameNumber();
|
||||
m_last_internal_frame_number = m_system->GetInternalFrameNumber();
|
||||
m_last_global_tick_counter = m_system->GetGlobalTickCounter();
|
||||
m_fps_timer.Reset();
|
||||
}
|
||||
|
||||
void SDLInterface::DoSaveState(u32 index)
|
||||
|
|
Loading…
Reference in a new issue