mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
CommonHostInterface: Add onscreen indicator for rewind
This commit is contained in:
parent
8bea6e1530
commit
50a09384e1
|
@ -2368,6 +2368,11 @@ bool LoadRewindState(u32 skip_saves /*= 0*/, bool consume_state /*=true */)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool IsRewinding()
|
||||
{
|
||||
return (s_rewind_load_frequency >= 0);
|
||||
}
|
||||
|
||||
void SetRewinding(bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
|
|
|
@ -237,6 +237,7 @@ void CalculateRewindMemoryUsage(u32 num_saves, u64* ram_usage, u64* vram_usage);
|
|||
void ClearMemorySaveStates();
|
||||
void UpdateMemorySaveStateSettings();
|
||||
bool LoadRewindState(u32 skip_saves = 0, bool consume_state = true);
|
||||
bool IsRewinding();
|
||||
void SetRewinding(bool enabled);
|
||||
void SetRunaheadReplayFlag();
|
||||
|
||||
|
|
|
@ -2069,9 +2069,13 @@ void CommonHostInterface::SetRewindState(bool enabled)
|
|||
return;
|
||||
}
|
||||
|
||||
AddOSDMessage(enabled ? TranslateStdString("OSDMessage", "Rewinding...") :
|
||||
TranslateStdString("OSDMessage", "Stopped rewinding."),
|
||||
5.0f);
|
||||
if (!m_fullscreen_ui_enabled)
|
||||
{
|
||||
AddOSDMessage(enabled ? TranslateStdString("OSDMessage", "Rewinding...") :
|
||||
TranslateStdString("OSDMessage", "Stopped rewinding."),
|
||||
5.0f);
|
||||
}
|
||||
|
||||
System::SetRewinding(enabled);
|
||||
UpdateSpeedLimiterState();
|
||||
}
|
||||
|
|
|
@ -3420,10 +3420,14 @@ void DrawStatsOverlay()
|
|||
DRAW_LINE(g_large_font, g_large_font->FontSize, 0.0f, IM_COL32(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if (s_show_status_indicators && (s_host_interface->IsFastForwardEnabled() || s_host_interface->IsTurboEnabled()))
|
||||
if (s_show_status_indicators)
|
||||
{
|
||||
text.Assign(ICON_FA_FAST_FORWARD);
|
||||
DRAW_LINE(g_large_font, g_large_font->FontSize * 2.0f, margin, IM_COL32(255, 255, 255, 255));
|
||||
const bool rewinding = System::IsRewinding();
|
||||
if (rewinding || s_host_interface->IsFastForwardEnabled() || s_host_interface->IsTurboEnabled())
|
||||
{
|
||||
text.Assign(rewinding ? ICON_FA_FAST_BACKWARD : ICON_FA_FAST_FORWARD);
|
||||
DRAW_LINE(g_large_font, g_large_font->FontSize * 2.0f, margin, IM_COL32(255, 255, 255, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s_show_status_indicators && state == System::State::Paused)
|
||||
|
|
Loading…
Reference in a new issue