Add an on screen lag counter.

This commit is contained in:
rog
2012-11-11 17:57:06 -05:00
parent 35e5a1e592
commit a5d210129d
9 changed files with 43 additions and 7 deletions

View File

@ -132,6 +132,7 @@ void SConfig::SaveSettings()
// General
ini.Set("General", "LastFilename", m_LastFilename);
ini.Set("General", "PauseMovie", m_pauseMovie);
ini.Set("General", "ShowLag", m_showLag);
// ISO folders
// clear removed folders
@ -262,6 +263,7 @@ void SConfig::LoadSettings()
{
ini.Get("General", "LastFilename", &m_LastFilename);
ini.Get("General", "PauseMovie", &m_pauseMovie, false);
ini.Get("General", "ShowLag", &m_showLag, false);
m_ISOFolder.clear();
int numGCMPaths;

View File

@ -76,6 +76,7 @@ struct SConfig : NonCopyable
bool m_ListTaiwan;
bool m_ListUnknown;
bool m_pauseMovie;
bool m_showLag;
SysConf* m_SYSCONF;

View File

@ -245,6 +245,7 @@ EVT_MENU(IDM_RECORDEXPORT, CFrame::OnRecordExport)
EVT_MENU(IDM_RECORDREADONLY, CFrame::OnRecordReadOnly)
EVT_MENU(IDM_TASINPUT, CFrame::OnTASInput)
EVT_MENU(IDM_TOGGLE_PAUSEMOVIE, CFrame::OnTogglePauseMovie)
EVT_MENU(IDM_SHOWLAG, CFrame::OnShowLag)
EVT_MENU(IDM_FRAMESTEP, CFrame::OnFrameStep)
EVT_MENU(IDM_SCREENSHOT, CFrame::OnScreenshot)
EVT_MENU(wxID_PREFERENCES, CFrame::OnConfigMain)

View File

@ -298,6 +298,7 @@ private:
void OnRecordReadOnly(wxCommandEvent& event);
void OnTASInput(wxCommandEvent& event);
void OnTogglePauseMovie(wxCommandEvent& event);
void OnShowLag(wxCommandEvent& event);
void OnChangeDisc(wxCommandEvent& event);
void OnScreenshot(wxCommandEvent& event);
void OnActive(wxActivateEvent& event);

View File

@ -144,9 +144,11 @@ void CFrame::CreateMenu()
emulationMenu->Append(IDM_TASINPUT, _("TAS Input"));
emulationMenu->AppendCheckItem(IDM_TOGGLE_PAUSEMOVIE, _("Pause at end of movie"));
emulationMenu->Check(IDM_TOGGLE_PAUSEMOVIE, SConfig::GetInstance().m_pauseMovie);
emulationMenu->AppendCheckItem(IDM_SHOWLAG, _("Show lag counter"));
emulationMenu->Check(IDM_SHOWLAG, SConfig::GetInstance().m_showLag);
emulationMenu->Check(IDM_RECORDREADONLY, true);
emulationMenu->AppendSeparator();
emulationMenu->Append(IDM_FRAMESTEP, GetMenuLabel(HK_FRAME_ADVANCE), wxEmptyString);
wxMenu *skippingMenu = new wxMenu;
@ -709,6 +711,13 @@ void CFrame::OnTogglePauseMovie(wxCommandEvent& WXUNUSED (event))
SConfig::GetInstance().m_pauseMovie = !SConfig::GetInstance().m_pauseMovie;
SConfig::GetInstance().SaveSettings();
}
void CFrame::OnShowLag(wxCommandEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_showLag = !SConfig::GetInstance().m_showLag;
SConfig::GetInstance().SaveSettings();
}
void CFrame::OnFrameStep(wxCommandEvent& event)
{
bool wasPaused = (Core::GetState() == Core::CORE_PAUSE);

View File

@ -81,6 +81,7 @@ enum
IDM_RECORDREADONLY,
IDM_TASINPUT,
IDM_TOGGLE_PAUSEMOVIE,
IDM_SHOWLAG,
IDM_FRAMESTEP,
IDM_SCREENSHOT,
IDM_BROWSE,