diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp index 776028e7b3..e47da3bca4 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp @@ -173,7 +173,7 @@ void CDebugger::DoHide() void CDebugger::DoShow() { Show(); - DoShowHideConsole(); // The console goes with the wx window + DoShowConsole(); // The console goes with the wx window } void CDebugger::OnUpdate(wxCommandEvent& /*event*/) @@ -219,7 +219,7 @@ void CDebugger::Load(IniFile& _IniFile) bool Console; _IniFile.Get("SoundWindow", "Console", &Console, m_options->IsChecked(3)); m_options->Check(3, Console); - DoShowHideConsole(); + DoShowConsole(); // Show number base _IniFile.Get("SoundWindow", "ShowBase", &bShowBase, !m_RadioBox[0]->GetSelection()); @@ -560,12 +560,9 @@ SetTitle(wxT("Sound Debugging")); NotifyUpdate(); // -------------------------------------------------------------------- } -///////////////////////////// - // ======================================================================================= // Settings -// -------------- void CDebugger::OnSettingsCheck(wxCommandEvent& event) { gSSBM = m_settings->IsChecked(0); @@ -576,12 +573,9 @@ void CDebugger::OnSettingsCheck(wxCommandEvent& event) gReset = m_settings->IsChecked(5); } -// ======================================================================================= - // ======================================================================================= // Change preset -// -------------- void CDebugger::ChangePreset(wxCommandEvent& event) { DoChangePreset(); @@ -598,12 +592,9 @@ void CDebugger::DoChangePreset() else if(m_RadioBox[2]->GetSelection() == 3) gPreset = 3; } -// ============== - // ======================================================================================= // Show base -// -------------- void CDebugger::ShowBase(wxCommandEvent& event) { if(m_RadioBox[0]->GetSelection() == 0) @@ -611,12 +602,9 @@ void CDebugger::ShowBase(wxCommandEvent& event) else if(m_RadioBox[0]->GetSelection() == 1) bShowBase = false; } -// ============== - // ======================================================================================= // Change update frequency -// -------------- void CDebugger::ChangeFrequency(wxCommandEvent& event) { DoChangeFrequency(); @@ -633,12 +621,9 @@ void CDebugger::DoChangeFrequency() else if(m_RadioBox[1]->GetSelection() == 3) gUpdFreq = 30; } -// ============== - // ======================================================================================= // Options -// -------------- void CDebugger::OnOptions(wxCommandEvent& event) { gSaveFile = m_options->IsChecked(0); @@ -646,7 +631,7 @@ void CDebugger::OnOptions(wxCommandEvent& event) gShowAll = m_options->IsChecked(2); gSaveFile = m_options->IsChecked(3); - if(event.GetInt() == 3) DoShowHideConsole(); + if(event.GetInt() == 3) DoShowConsole(); } void CDebugger::OnShowAll(wxCommandEvent& event) @@ -667,24 +652,17 @@ void CDebugger::OnShowAll(wxCommandEvent& event) // ======================================================================================= // Show or hide console window -// -------------- void CDebugger::ShowHideConsole(wxCommandEvent& event) { - DoShowHideConsole(); + DoShowConsole(); } -void CDebugger::DoShowHideConsole() +void CDebugger::DoShowConsole() { -// #ifdef _WIN32 -// if(m_options->IsChecked(3)) -// OpenConsole(); -// else -// CloseConsole(); -// #endif - PanicAlert("oh crap"); + ConsoleListener* console = LogManager::GetInstance()->getConsoleListener(); + if(m_options->IsChecked(3) && !console->IsOpen()) + console->Open(); } -// ============== - void CDebugger::NotifyUpdate() { @@ -693,4 +671,3 @@ void CDebugger::NotifyUpdate() m_GPRListView->Update(); } } - diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h index 45e077c2c7..7d9ac23595 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h @@ -76,7 +76,7 @@ class CDebugger : public wxDialog void ShowHideConsole(wxCommandEvent& event); // options void ShowBase(wxCommandEvent& event); - void DoShowHideConsole(); + void DoShowConsole(); //void OnlyLooping(wxCommandEvent& event); void OnOptions(wxCommandEvent& event); void OnShowAll(wxCommandEvent& event); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/PBView.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/PBView.cpp index f0a52c9e84..62936e19b7 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/PBView.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/PBView.cpp @@ -102,9 +102,8 @@ CPBView::Update() } - -bool -CPBView::MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem) +// TODO wtf does this do? why is it windows only??? +bool CPBView::MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem) { bool Result = false; @@ -164,5 +163,3 @@ CPBView::MSWDrawSubItem(wxPaintDC& rPainDC, int item, int subitem) return(Result); } } - - diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp index 6947080798..8647b484ff 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.cpp @@ -42,7 +42,7 @@ CDebugger::CDebugger(wxWindow *parent, wxWindowID id, const wxString &title, CreateGUIControls(); LoadSettings(); - DoShowHideConsole(); + DoShowConsole(); } CDebugger::~CDebugger() @@ -56,21 +56,15 @@ void CDebugger::OnClose(wxCloseEvent& event) SaveSettings(); event.Skip(); // This means wxDialog's Destroy is used - // CloseConsole(); // The console goes with the wx window } -void CDebugger::DoShowHideConsole() +void CDebugger::DoShowConsole() { - /* if(m_Check[1]->IsChecked() -#ifdef _WIN32 - // Check to see if we already have a console -// && Console::GetHwnd() == NULL -#endif - ) - OpenConsole(); + ConsoleListener* console = LogManager::GetInstance()->getConsoleListener(); + if(m_Check[1]->IsChecked() && console->IsOpen()) + console->Open(); else - CloseConsole(); - */ + console->Close(); } void CDebugger::SaveSettings() const @@ -166,7 +160,7 @@ void CDebugger::GeneralSettings(wxCommandEvent& event) switch (event.GetId()) { case ID_SHOWCONSOLE: - DoShowHideConsole(); + DoShowConsole(); break; case ID_INFOLOG: bInfoLog = event.IsChecked(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h index e374b3095f..fd15338d37 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Debugger/Debugger.h @@ -39,7 +39,7 @@ public: void SaveSettings() const; void LoadSettings(); - void DoShowHideConsole(); + void DoShowConsole(); void DoShow(); void GeneralSettings(wxCommandEvent& event);