Frontend: Fix invalid FPS showing when reset

This commit is contained in:
Connor McLaughlin 2019-10-05 14:50:23 +10:00
parent ae260b924c
commit e80775ed82
2 changed files with 12 additions and 1 deletions

View file

@ -489,7 +489,7 @@ void SDLInterface::DrawMainMenuBar()
if (ImGui::BeginMenu("System")) if (ImGui::BeginMenu("System"))
{ {
if (ImGui::MenuItem("Reset")) if (ImGui::MenuItem("Reset"))
m_system->Reset(); DoReset();
ImGui::Separator(); ImGui::Separator();
@ -654,6 +654,16 @@ void SDLInterface::DrawOSDMessages()
} }
} }
void SDLInterface::DoReset()
{
m_system->Reset();
m_last_frame_number = 0;
m_last_internal_frame_number = 0;
m_last_global_tick_counter = 0;
m_fps_timer.Reset();
AddOSDMessage("System reset.");
}
void SDLInterface::DoLoadState(u32 index) void SDLInterface::DoLoadState(u32 index)
{ {
LoadState(GetSaveStateFilename(index)); LoadState(GetSaveStateFilename(index));

View file

@ -51,6 +51,7 @@ private:
// We only pass mouse input through if it's grabbed // We only pass mouse input through if it's grabbed
bool IsWindowFullscreen() const; bool IsWindowFullscreen() const;
void DrawImGui(); void DrawImGui();
void DoReset();
void DoLoadState(u32 index); void DoLoadState(u32 index);
void DoSaveState(u32 index); void DoSaveState(u32 index);