From 14aa7150d9363ea7adafd9188feb7197e7ade2a6 Mon Sep 17 00:00:00 2001 From: rog Date: Wed, 14 Nov 2012 16:21:54 -0500 Subject: [PATCH] Add option for author name for movies. Also, minor cleanup for previous options i've added. --- Source/Core/Core/Src/ConfigManager.cpp | 14 ++++++++++---- Source/Core/Core/Src/ConfigManager.h | 5 +++-- Source/Core/Core/Src/Movie.cpp | 4 ++-- Source/Core/DolphinWX/Src/FrameTools.cpp | 8 ++++---- Source/Plugins/Plugin_VideoDX11/Src/Render.cpp | 2 +- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 2 +- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index df0ce1aa02..433be735c2 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -131,8 +131,7 @@ void SConfig::SaveSettings() // General ini.Set("General", "LastFilename", m_LastFilename); - ini.Set("General", "PauseMovie", m_pauseMovie); - ini.Set("General", "ShowLag", m_showLag); + ini.Set("General", "ShowLag", m_ShowLag); // ISO folders // clear removed folders @@ -248,6 +247,10 @@ void SConfig::SaveSettings() // GFX Backend ini.Set("Core", "GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend); + // Movie + ini.Set("Movie", "PauseMovie", m_PauseMovie); + ini.Set("Movie", "Author", m_strMovieAuthor); + ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX)); m_SYSCONF->Save(); } @@ -262,8 +265,7 @@ void SConfig::LoadSettings() // General { ini.Get("General", "LastFilename", &m_LastFilename); - ini.Get("General", "PauseMovie", &m_pauseMovie, false); - ini.Get("General", "ShowLag", &m_showLag, false); + ini.Get("General", "ShowLag", &m_ShowLag, false); m_ISOFolder.clear(); int numGCMPaths; @@ -388,6 +390,10 @@ void SConfig::LoadSettings() // GFX Backend ini.Get("Core", "GFXBackend", &m_LocalCoreStartupParameter.m_strVideoBackend, ""); + + // Movie + ini.Get("General", "PauseMovie", &m_PauseMovie, false); + ini.Get("Movie", "Author", &m_strMovieAuthor, ""); } m_SYSCONF = new SysConf(); diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h index 1235e23eac..f8733296b4 100644 --- a/Source/Core/Core/Src/ConfigManager.h +++ b/Source/Core/Core/Src/ConfigManager.h @@ -75,8 +75,9 @@ struct SConfig : NonCopyable bool m_ListKorea; bool m_ListTaiwan; bool m_ListUnknown; - bool m_pauseMovie; - bool m_showLag; + bool m_PauseMovie; + bool m_ShowLag; + std::string m_strMovieAuthor; SysConf* m_SYSCONF; diff --git a/Source/Core/Core/Src/Movie.cpp b/Source/Core/Core/Src/Movie.cpp index 189201a36a..a03f1a568e 100644 --- a/Source/Core/Core/Src/Movie.cpp +++ b/Source/Core/Core/Src/Movie.cpp @@ -92,7 +92,7 @@ std::string GetInputDisplay() void FrameUpdate() { - if (IsPlayingInput() && g_currentInputCount == g_totalInputCount -1 && SConfig::GetInstance().m_pauseMovie) + if (IsPlayingInput() && g_currentInputCount == g_totalInputCount -1 && SConfig::GetInstance().m_PauseMovie) { Core::SetState(Core::CORE_PAUSE); } @@ -400,7 +400,7 @@ bool BeginRecordingInput(int controllers) } g_playMode = MODE_RECORDING; GetSettings(); - + author = SConfig::GetInstance().m_strMovieAuthor; delete [] tmpInput; tmpInput = new u8[MAX_DTM_LENGTH]; g_currentByte = g_totalBytes = 0; diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index e4a7ed8986..2d2b308799 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -143,9 +143,9 @@ void CFrame::CreateMenu() emulationMenu->Append(IDM_RECORDREADONLY, GetMenuLabel(HK_READ_ONLY_MODE), wxEmptyString, wxITEM_CHECK); 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->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_SHOWLAG, SConfig::GetInstance().m_ShowLag); emulationMenu->Check(IDM_RECORDREADONLY, true); emulationMenu->AppendSeparator(); @@ -708,13 +708,13 @@ void CFrame::OnTASInput(wxCommandEvent& event) void CFrame::OnTogglePauseMovie(wxCommandEvent& WXUNUSED (event)) { - SConfig::GetInstance().m_pauseMovie = !SConfig::GetInstance().m_pauseMovie; + 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().m_ShowLag = !SConfig::GetInstance().m_ShowLag; SConfig::GetInstance().SaveSettings(); } diff --git a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp index 079692b76b..6a1a6c868c 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/Render.cpp @@ -1095,7 +1095,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons D3D::font.DrawTextScaled(0, 0, 20, 0.0f, 0xFF00FFFF, fps); } - if (SConfig::GetInstance().m_showLag) + if (SConfig::GetInstance().m_ShowLag) { char lag[10]; StringCchPrintfA(lag, 1000, "Lag: %d\n", Movie::g_currentLagCount); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 226b7227c3..b0997225cf 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -1092,7 +1092,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons D3D::font.DrawTextScaled(0, 0, 20, 20, 0.0f, 0xFF00FFFF, fps); } - if (SConfig::GetInstance().m_showLag) + if (SConfig::GetInstance().m_ShowLag) { char lag[10]; StringCchPrintfA(lag, 1000, "Lag: %d\n", Movie::g_currentLagCount); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 4f74454ece..cce93d2115 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -532,7 +532,7 @@ void Renderer::DrawDebugInfo() if (g_ActiveConfig.bShowFPS) p+=sprintf(p, "FPS: %d\n", s_fps); - if (SConfig::GetInstance().m_showLag) + if (SConfig::GetInstance().m_ShowLag) p+=sprintf(p, "Lag: %d\n", Movie::g_currentLagCount); if (g_ActiveConfig.bShowInputDisplay)