diff options
| author | John Peterson <jpeterson57@gmail.com> | 2009-09-07 13:33:40 +0000 |
|---|---|---|
| committer | John Peterson <jpeterson57@gmail.com> | 2009-09-07 13:33:40 +0000 |
| commit | 24d68da653b6def668ff6946586e60f94aa082af (patch) | |
| tree | 3eb228e226d3f76fa29772f45f3d2714aa58ad11 /Source/Core | |
| parent | 7dffe43eaa148720f78f8b35709c226f5c1b3ef8 (diff) | |
GUI/OpenGL: Video debugging window crash fix
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4225 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DebuggerWX/Src/CodeWindow.h | 3 | ||||
| -rw-r--r-- | Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp | 131 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/Frame.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/FrameAui.cpp | 4 |
4 files changed, 35 insertions, 105 deletions
diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.h b/Source/Core/DebuggerWX/Src/CodeWindow.h index 897d63553b..fc60662972 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.h +++ b/Source/Core/DebuggerWX/Src/CodeWindow.h @@ -102,8 +102,7 @@ class CCodeWindow void OnToggleBreakPointWindow(bool,int); void OnToggleMemoryWindow(bool,int); void OnToggleJitWindow(bool,int); - void OnToggleSoundWindow(bool,int); - void OnToggleVideoWindow(bool,int); + void OnToggleDLLWindow(int,bool,int); void OnChangeFont(wxCommandEvent& event); void OnCodeStep(wxCommandEvent& event); diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index 4f05ade5e3..19b4923789 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -552,54 +552,62 @@ Notice: This windows docking for plugin windows will produce several wx debuggin */ -//Toggle Sound Debugging Window -void CCodeWindow::OnToggleSoundWindow(bool _Show, int i) +// Toggle Sound Debugging Window +void CCodeWindow::OnToggleDLLWindow(int Id, bool _Show, int i) { #ifdef _WIN32 // ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); + std::string DLLName; + wxString Title; + int PLUGINTYPE; + + switch(Id) + { + case IDM_SOUNDWINDOW: + DLLName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(); + PLUGINTYPE = PLUGIN_TYPE_DSP; + Title = wxT("Sound"); + break; + case IDM_VIDEOWINDOW: + DLLName = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(); + PLUGINTYPE = PLUGIN_TYPE_VIDEO; + Title = wxT("Video"); + break; + } + if (_Show) { if (Parent->GetNotebookCount() == 0) return; if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0; - wxWindow *Win = Parent->GetWxWindow(wxT("Sound")); + wxWindow *Win = Parent->GetWxWindow(Title); if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return; - CPluginManager::GetInstance().OpenDebug( - Parent->GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(), - PLUGIN_TYPE_DSP, true // DSP, show - ); + // Show window + CPluginManager::GetInstance().OpenDebug(Parent->GetHandle(), DLLName.c_str(), (PLUGIN_TYPE)PLUGINTYPE, _Show); - Win = Parent->GetWxWindow(wxT("Sound")); + Win = Parent->GetWxWindow(Title); if (Win) { - Win->SetName(wxT("Sound")); + Win->SetName(Title); Win->Reparent(Parent); Win->SetId(IDM_SOUNDWINDOW); - Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Sound"), true, Parent->aNormalFile); + Parent->GetNotebookFromId(i)->AddPage(Win, Title, true, Parent->aNormalFile); } else { //Console->Log(LogTypes::LNOTICE, StringFromFormat("OpenDebug: Win not found\n").c_str()); - } - + } } else { - wxWindow *Win = Parent->GetWxWindow(wxT("Sound")); + wxWindow *Win = Parent->GetWxWindow(Title); if (Win) { Parent->DoRemovePage(Win, false); //Win->Reparent(NULL); - // Destroy - CPluginManager::GetInstance().OpenDebug( - GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(), - PLUGIN_TYPE_DSP, false - ); - + CPluginManager::GetInstance().OpenDebug(Parent->GetHandle(), DLLName.c_str(), (PLUGIN_TYPE)PLUGINTYPE, _Show); //WARN_LOG(CONSOLE, "Sound removed from NB"); } else @@ -609,83 +617,6 @@ void CCodeWindow::OnToggleSoundWindow(bool _Show, int i) } #else - if (_Show) - { - CPluginManager::GetInstance().OpenDebug( - Parent->GetHandle(), - //GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(), - PLUGIN_TYPE_DSP, true // DSP, show - ); - } - else - { - CPluginManager::GetInstance().OpenDebug( - GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str(), - PLUGIN_TYPE_DSP, false // DSP, hide - ); - } -#endif -} - -// Toggle Video Debugging Window -void CCodeWindow::OnToggleVideoWindow(bool _Show, int i) -{ -#ifdef _WIN32 - //GetMenuBar()->Check(event.GetId(), false); // Turn off - - if (_Show) - { - if (Parent->GetNotebookCount() == 0) return; - if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0; - - wxWindow *Win = Parent->GetWxWindow(wxT("Video")); - Win->SetId(IDM_VIDEOWINDOW); - if (Win && Parent->GetNotebookFromId(i)->GetPageIndex(Win) != wxNOT_FOUND) return; - - // Show and/or create the window - CPluginManager::GetInstance().OpenDebug( - Parent->GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(), - PLUGIN_TYPE_VIDEO, true // Video, show - ); - - Win = Parent->GetWxWindow(wxT("Video")); - if (Win) Parent->GetNotebookFromId(i)->AddPage(Win, wxT("Video"), true, Parent->aNormalFile ); - } - else // hide - { - wxWindow *Win = Parent->GetWxWindow(wxT("Video")); - if (Win) - { - Parent->DoRemovePage (Win, false); - Win->Reparent(NULL); - CPluginManager::GetInstance().OpenDebug( - GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(), - PLUGIN_TYPE_VIDEO, false // Video, hide - ); - } - } -#else - if (_Show) - { - CPluginManager::GetInstance().OpenDebug( - Parent->GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(), - PLUGIN_TYPE_VIDEO, true // Video, show - ); - } - else - { - CPluginManager::GetInstance().OpenDebug( - GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin.c_str(), - PLUGIN_TYPE_VIDEO, false // Video, hide - ); - } + CPluginManager::GetInstance().OpenDebug(Parent->GetHandle(), DLLName.c_str(), (PLUGIN_TYPE)PLUGINTYPE, _Show); #endif -} - - +}
\ No newline at end of file diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 1eeb0ec928..511f1599af 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -648,7 +648,7 @@ void CFrame::OnCustomHostMessage(int Id) ); //Win->Reparent(NULL); - //g_pCodeWindow->OnToggleSoundWindow(false, 0); + //g_pCodeWindow->OnToggleDLLWindow(false, 0); GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(false); NOTICE_LOG(CONSOLE, "%s", Core::StopMessage(true, "Sound debugging window closed").c_str()); } diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index cac8cc5933..411ca2fcbb 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -215,8 +215,8 @@ void CFrame::DoToggleWindow(int Id, bool bShow) case IDM_BREAKPOINTWINDOW: g_pCodeWindow->OnToggleBreakPointWindow(bShow, g_pCodeWindow->iBreakpointWindow); break; case IDM_MEMORYWINDOW: g_pCodeWindow->OnToggleMemoryWindow(bShow, g_pCodeWindow->iMemoryWindow); break; case IDM_JITWINDOW: g_pCodeWindow->OnToggleJitWindow(bShow, g_pCodeWindow->iJitWindow); break; - case IDM_SOUNDWINDOW: g_pCodeWindow->OnToggleSoundWindow(bShow, g_pCodeWindow->iSoundWindow); break; - case IDM_VIDEOWINDOW: g_pCodeWindow->OnToggleVideoWindow(bShow, g_pCodeWindow->iVideoWindow); break; + case IDM_SOUNDWINDOW: g_pCodeWindow->OnToggleDLLWindow(IDM_SOUNDWINDOW, bShow, g_pCodeWindow->iSoundWindow); break; + case IDM_VIDEOWINDOW: g_pCodeWindow->OnToggleDLLWindow(IDM_VIDEOWINDOW, bShow, g_pCodeWindow->iVideoWindow); break; } } void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event) |
