From b2533a5ef28ba01005a7c70d99c8a520004bcd07 Mon Sep 17 00:00:00 2001 From: nakeee Date: Wed, 2 Sep 2009 07:59:06 +0000 Subject: [PATCH] Fixed various warning fixes and potencial POD/crash bugs git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4156 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/ConsoleListener.cpp | 2 +- Source/Core/Common/Src/Log.h | 2 - Source/Core/DebuggerWX/Src/CodeWindow.cpp | 6 +- .../DebuggerWX/Src/CodeWindowFunctions.cpp | 33 ++-- Source/Core/DolphinWX/Src/Frame.h | 4 +- Source/Core/DolphinWX/Src/FrameAui.cpp | 167 +++++++++--------- Source/Core/DolphinWX/Src/FrameTools.cpp | 4 +- Source/Core/DolphinWX/Src/ISOProperties.cpp | 2 +- Source/Core/DolphinWX/Src/NetFunctions.cpp | 2 +- Source/Core/DolphinWX/Src/NetSockets.cpp | 10 +- .../Core/VideoCommon/Src/VertexShaderGen.cpp | 14 +- 11 files changed, 119 insertions(+), 127 deletions(-) diff --git a/Source/Core/Common/Src/ConsoleListener.cpp b/Source/Core/Common/Src/ConsoleListener.cpp index fbe4c9fdaf..a976555282 100644 --- a/Source/Core/Common/Src/ConsoleListener.cpp +++ b/Source/Core/Common/Src/ConsoleListener.cpp @@ -288,7 +288,7 @@ void ConsoleListener::Log(LogTypes::LOG_LEVELS Level, const char *Text) Color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break; } - if (Level != CUSTOM_LEVEL && strlen(Text) > 10) + if (strlen(Text) > 10) { // First 10 chars white SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY); diff --git a/Source/Core/Common/Src/Log.h b/Source/Core/Common/Src/Log.h index 16c3ee9ed9..a24f7e65f0 100644 --- a/Source/Core/Common/Src/Log.h +++ b/Source/Core/Common/Src/Log.h @@ -23,7 +23,6 @@ #define WARNING_LEVEL 3 // Something is suspicious. #define INFO_LEVEL 4 // General information. #define DEBUG_LEVEL 5 // Detailed debugging - might make things slow. -#define CUSTOM_LEVEL 6 // Custom level, no text formatting namespace LogTypes { @@ -82,7 +81,6 @@ enum LOG_LEVELS { LWARNING = WARNING_LEVEL, LINFO = INFO_LEVEL, LDEBUG = DEBUG_LEVEL, - LCUSTOM = CUSTOM_LEVEL }; } // namespace diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index db31ea012d..fd22ae2e0e 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -625,7 +625,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam wxMenuItem* pVideo = pDebugDialogs->Append(IDM_VIDEOWINDOW, _T("&Video"), wxEmptyString, wxITEM_CHECK); pVideo->Check(bVideoWindow); pDebugDialogs->AppendSeparator(); - wxMenuItem* pFontPicker = pDebugDialogs->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL); + // wxMenuItem* pFontPicker = pDebugDialogs->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL); pMenuBar->Append(pDebugDialogs, _T("&Views")); @@ -787,7 +787,7 @@ void CCodeWindow::Update() void CCodeWindow::UpdateButtonStates() { bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED); - bool Running = (Core::GetState() == Core::CORE_RUN); + // bool Running = (Core::GetState() == Core::CORE_RUN); bool Pause = (Core::GetState() == Core::CORE_PAUSE); wxAuiToolBar* ToolBar = GetToolBar(); @@ -916,4 +916,4 @@ void CCodeWindow::OnStatusBar_(wxUpdateUIEvent& event) //if(event.GetId() != IDM_ADDRBOX) DoTip(wxEmptyString); #endif } -///////////////////////////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file +///////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index 21bda68a7f..987c4502cd 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -203,7 +203,6 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!f) return; - bool started = false; while (!feof(f)) { char line[512]; @@ -340,18 +339,18 @@ void CCodeWindow::OnToggleWindow(wxCommandEvent& event) { Parent->DoToggleWindow(event.GetId(), GetMenuBar()->IsChecked(event.GetId())); } -void CCodeWindow::OnToggleCodeWindow(bool Show, int i) +void CCodeWindow::OnToggleCodeWindow(bool _show, int i) { - if (Show) + if (_show) { Parent->DoAddPage(this, i, "Code"); } else // hide Parent->DoRemovePage (this); } -void CCodeWindow::OnToggleRegisterWindow(bool Show, int i) +void CCodeWindow::OnToggleRegisterWindow(bool _show, int i) { - if (Show) + if (_show) { if (!m_RegisterWindow) m_RegisterWindow = new CRegisterWindow(Parent); Parent->DoAddPage(m_RegisterWindow, i, "Registers"); @@ -360,9 +359,9 @@ void CCodeWindow::OnToggleRegisterWindow(bool Show, int i) Parent->DoRemovePage (m_RegisterWindow); } -void CCodeWindow::OnToggleBreakPointWindow(bool Show, int i) +void CCodeWindow::OnToggleBreakPointWindow(bool _show, int i) { - if (Show) + if (_show) { if (!m_BreakpointWindow) m_BreakpointWindow = new CBreakPointWindow(this, Parent); #ifdef _WIN32 @@ -379,9 +378,9 @@ void CCodeWindow::OnToggleBreakPointWindow(bool Show, int i) #endif } -void CCodeWindow::OnToggleJitWindow(bool Show, int i) +void CCodeWindow::OnToggleJitWindow(bool _show, int i) { - if (Show) + if (_show) { if (!m_JitWindow) m_JitWindow = new CJitWindow(Parent); #ifdef _WIN32 @@ -399,9 +398,9 @@ void CCodeWindow::OnToggleJitWindow(bool Show, int i) } -void CCodeWindow::OnToggleMemoryWindow(bool Show, int i) +void CCodeWindow::OnToggleMemoryWindow(bool _show, int i) { - if (Show) + if (_show) { if (!m_MemoryWindow) m_MemoryWindow = new CMemoryWindow(Parent); #ifdef _WIN32 @@ -433,11 +432,11 @@ Notice: This windows docking for plugin windows will produce several wx debuggin //Toggle Sound Debugging Window -void CCodeWindow::OnToggleSoundWindow(bool Show, int i) +void CCodeWindow::OnToggleSoundWindow(bool _show, int i) { - ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); + // ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - if (Show) + if (_show) { if (Parent->GetNotebookCount() == 0) return; if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0; @@ -497,11 +496,11 @@ void CCodeWindow::OnToggleSoundWindow(bool Show, int i) } // Toggle Video Debugging Window -void CCodeWindow::OnToggleVideoWindow(bool Show, int i) +void CCodeWindow::OnToggleVideoWindow(bool _show, int i) { //GetMenuBar()->Check(event.GetId(), false); // Turn off - if (Show) + if (_show) { if (Parent->GetNotebookCount() == 0) return; if (i < 0 || i > Parent->GetNotebookCount()-1) i = 0; @@ -539,4 +538,4 @@ void CCodeWindow::OnToggleVideoWindow(bool Show, int i) } } -///////////////////////////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file +///////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 6b2447c469..2546fb9df6 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -107,7 +107,7 @@ class CFrame : public wxFrame wxWindow * GetWxWindowHwnd(HWND); #endif wxWindow * GetNootebookPage(wxString); - wxAuiNotebook * GetNotebook(int); + wxAuiNotebook * GetNotebook(u32); void AddRemoveBlankPage(); void OnNotebookPageClose(wxAuiNotebookEvent& event); void OnAllowNotebookDnD(wxAuiNotebookEvent& event); @@ -140,7 +140,7 @@ class CFrame : public wxFrame std::vector Perspectives; wxString AuiFullscreen, AuiCurrent; wxArrayString AuiPerspective; - int ActivePerspective; + u32 ActivePerspective; int PercentageToPixels(int,int); int PixelsToPercentage(int,int); void NamePanes(); diff --git a/Source/Core/DolphinWX/Src/FrameAui.cpp b/Source/Core/DolphinWX/Src/FrameAui.cpp index c060e1d416..439f9c2dea 100644 --- a/Source/Core/DolphinWX/Src/FrameAui.cpp +++ b/Source/Core/DolphinWX/Src/FrameAui.cpp @@ -99,14 +99,14 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event) { /* ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LCUSTOM, StringFromFormat("GetNotebookCount before: %i\n", GetNotebookCount()).c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat("GetNotebookCount before: %i\n", GetNotebookCount()).c_str()); */ // Detach and delete the empty notebook event.pane->DestroyOnClose(true); m_Mgr->ClosePane(*event.pane); - //Console->Log(LogTypes::LCUSTOM, StringFromFormat("GetNotebookCount after: %i\n", GetNotebookCount()).c_str()); + //Console->Log(LogTypes::LNOTICE, StringFromFormat("GetNotebookCount after: %i\n", GetNotebookCount()).c_str()); } m_Mgr->Update(); @@ -119,9 +119,9 @@ void CFrame::OnToggleLogWindow(wxCommandEvent& event) SConfig::GetInstance().m_InterfaceLogWindow = event.IsChecked(); DoToggleWindow(event.GetId(), event.IsChecked()); } -void CFrame::ToggleLogWindow(bool Show, int i) +void CFrame::ToggleLogWindow(bool _show, int i) { - if (Show) + if (_show) { if (!m_LogWindow) m_LogWindow = new CLogWindow(this); #ifdef _WIN32 @@ -151,13 +151,13 @@ void CFrame::OnToggleConsole(wxCommandEvent& event) SConfig::GetInstance().m_InterfaceConsole = event.IsChecked(); DoToggleWindow(event.GetId(), event.IsChecked()); } -void CFrame::ToggleConsole(bool Show, int i) +void CFrame::ToggleConsole(bool _show, int i) { ConsoleListener *Console = LogManager::GetInstance()->getConsoleListener(); - if (Show) + if (_show) { - //Console->Log(LogTypes::LCUSTOM, StringFromFormat(" >>> Show\n").c_str()); + //Console->Log(LogTypes::LNOTICE, StringFromFormat(" >>> Show\n").c_str()); if (GetNotebookCount() == 0) return; if (i < 0 || i > GetNotebookCount()-1) i = 0; @@ -187,7 +187,7 @@ void CFrame::ToggleConsole(bool Show, int i) } else // hide { - //Console->Log(LogTypes::LCUSTOM, StringFromFormat(" >>> Show\n").c_str()); + //Console->Log(LogTypes::LNOTICE, StringFromFormat(" >>> Show\n").c_str()); #ifdef _WIN32 // Hide @@ -253,7 +253,7 @@ wxWindow * CFrame::GetWxWindow(wxString Name) } wxWindow * CFrame::GetNootebookPage(wxString Name) { - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; @@ -266,7 +266,7 @@ wxWindow * CFrame::GetNootebookPage(wxString Name) } void CFrame::AddRemoveBlankPage() { - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; @@ -279,7 +279,7 @@ void CFrame::AddRemoveBlankPage() } int CFrame::GetNootebookAffiliation(wxString Name) { - for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; @@ -303,25 +303,25 @@ void CFrame::ClosePages() DoToggleWindow(IDM_SOUNDWINDOW, false); DoToggleWindow(IDM_VIDEOWINDOW, false); } -void CFrame::DoToggleWindow(int Id, bool Show) +void CFrame::DoToggleWindow(int Id, bool _show) { switch (Id) { - case IDM_LOGWINDOW: ToggleLogWindow(Show, UseDebugger ? g_pCodeWindow->iLogWindow : 0); break; - case IDM_CONSOLEWINDOW: ToggleConsole(Show, UseDebugger ? g_pCodeWindow->iConsoleWindow : 0); break; + case IDM_LOGWINDOW: ToggleLogWindow(_show, UseDebugger ? g_pCodeWindow->iLogWindow : 0); break; + case IDM_CONSOLEWINDOW: ToggleConsole(_show, UseDebugger ? g_pCodeWindow->iConsoleWindow : 0); break; } if (!UseDebugger) return; switch (Id) { - case IDM_CODEWINDOW: g_pCodeWindow->OnToggleCodeWindow(Show, g_pCodeWindow->iCodeWindow); break; - case IDM_REGISTERWINDOW: g_pCodeWindow->OnToggleRegisterWindow(Show, g_pCodeWindow->iRegisterWindow); break; - case IDM_BREAKPOINTWINDOW: g_pCodeWindow->OnToggleBreakPointWindow(Show, g_pCodeWindow->iBreakpointWindow); break; - case IDM_MEMORYWINDOW: g_pCodeWindow->OnToggleMemoryWindow(Show, g_pCodeWindow->iMemoryWindow); break; - case IDM_JITWINDOW: g_pCodeWindow->OnToggleJitWindow(Show, g_pCodeWindow->iJitWindow); break; - case IDM_SOUNDWINDOW: g_pCodeWindow->OnToggleSoundWindow(Show, g_pCodeWindow->iSoundWindow); break; - case IDM_VIDEOWINDOW: g_pCodeWindow->OnToggleVideoWindow(Show, g_pCodeWindow->iVideoWindow); break; + case IDM_CODEWINDOW: g_pCodeWindow->OnToggleCodeWindow(_show, g_pCodeWindow->iCodeWindow); break; + case IDM_REGISTERWINDOW: g_pCodeWindow->OnToggleRegisterWindow(_show, g_pCodeWindow->iRegisterWindow); break; + case IDM_BREAKPOINTWINDOW: g_pCodeWindow->OnToggleBreakPointWindow(_show, g_pCodeWindow->iBreakpointWindow); break; + case IDM_MEMORYWINDOW: g_pCodeWindow->OnToggleMemoryWindow(_show, g_pCodeWindow->iMemoryWindow); break; + case IDM_JITWINDOW: g_pCodeWindow->OnToggleJitWindow(_show, g_pCodeWindow->iJitWindow); break; + case IDM_SOUNDWINDOW: g_pCodeWindow->OnToggleSoundWindow(_show, g_pCodeWindow->iSoundWindow); break; + case IDM_VIDEOWINDOW: g_pCodeWindow->OnToggleVideoWindow(_show, g_pCodeWindow->iVideoWindow); break; } } void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event) @@ -363,7 +363,7 @@ void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event) { event.Skip(); event.Allow(); - wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject(); + // wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject(); // If we drag away the last one the tab bar goes away and we can't add any panes to it //if (Ctrl->GetPageCount() == 1) Ctrl->AddPage(CreateEmptyPanel(), wxT("<>"), true); } @@ -371,7 +371,7 @@ void CFrame::HidePane() { // Get the first notebook wxAuiNotebook * NB; - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; @@ -384,17 +384,17 @@ void CFrame::HidePane() SetSimplePaneSize(); } -void CFrame::DoRemovePageString(wxString Str, bool Hide, bool Destroy) +void CFrame::DoRemovePageString(wxString Str, bool _hide, bool _destroy) { - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; - for (int j = 0; j < NB->GetPageCount(); j++) + for (u32 j = 0; j < NB->GetPageCount(); j++) { if (NB->GetPageText(j).IsSameAs(Str)) { - if (!Destroy) + if (!_destroy) { // Reparent to avoid destruction if the notebook is closed and destroyed wxWindow * Win = NB->GetPage(j); @@ -405,17 +405,16 @@ void CFrame::DoRemovePageString(wxString Str, bool Hide, bool Destroy) { NB->DeletePage(j); } - //if (Hide) Win->Hide(); + //if (_hide) Win->Hide(); break; } } } } -wxAuiNotebook * CFrame::GetNotebook(int NBId) +wxAuiNotebook * CFrame::GetNotebook(u32 NBId) { - int Ret = 0; - for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; if (j == NBId) return (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; @@ -425,7 +424,7 @@ wxAuiNotebook * CFrame::GetNotebook(int NBId) } void CFrame::ShowAllNotebooks(bool Window) { - for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) { @@ -439,7 +438,7 @@ void CFrame::ShowAllNotebooks(bool Window) } void CFrame::HideAllNotebooks(bool Window) { - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) { @@ -465,12 +464,12 @@ void CFrame::CloseAllNotebooks() //m_Mgr->DetachPane(m_Mgr->GetAllPanes().Item(i).window); i = 0; - //Console->Log(LogTypes::LCUSTOM, StringFromFormat(" %i Pane\n", i).c_str()); + //Console->Log(LogTypes::LNOTICE, StringFromFormat(" %i Pane\n", i).c_str()); } else { i++; - //Console->Log(LogTypes::LCUSTOM, StringFromFormat(" %i No pane\n", i).c_str()); + //Console->Log(LogTypes::LNOTICE, StringFromFormat(" %i No pane\n", i).c_str()); } } @@ -478,7 +477,7 @@ void CFrame::CloseAllNotebooks() int CFrame::GetNotebookCount() { int Ret = 0; - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) Ret++; } @@ -494,10 +493,10 @@ void CFrame::DoAddPage(wxWindow * Win, int i, std::string Name) /* ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LCUSTOM, StringFromFormat("Add: %s\n", Name.c_str()).c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat("Add: %s\n", Name.c_str()).c_str()); */ } -void CFrame::DoRemovePage(wxWindow * Win, bool Hide) +void CFrame::DoRemovePage(wxWindow * Win, bool _hide) { // If m_dialog is NULL, then possibly the system didn't report the checked menu item status correctly. // It should be true just after the menu item was selected, if there was no modeless dialog yet. @@ -512,17 +511,11 @@ void CFrame::DoRemovePage(wxWindow * Win, bool Hide) // Reparent to avoid destruction if the notebook is closed and destroyed Win->Reparent(this); - if (Hide) Win->Hide(); + if (_hide) Win->Hide(); } } -///////////////////////////////////////////////////////////////////////////////////////////////////////// - - - -///////////////////////////////////////////////////////////////////////////////////////////////////////// // Toolbar -// ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ void CFrame::OnDropDownSettingsToolbar(wxAuiToolBarEvent& event) { event.Skip(); @@ -574,11 +567,11 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event) if (Perspectives.size() > 0) { menuPopup.Append(new wxMenuItem(&menuPopup)); - for (int i = 0; i < Perspectives.size(); i++) + for (u32 i = 0; i < Perspectives.size(); i++) { - wxMenuItem* Item = new wxMenuItem(&menuPopup, IDM_PERSPECTIVES_0 + i, wxString::FromAscii(Perspectives.at(i).Name.c_str()), wxT(""), wxITEM_CHECK); - menuPopup.Append(Item); - if (i == ActivePerspective) Item->Check(true); + wxMenuItem* mItem = new wxMenuItem(&menuPopup, IDM_PERSPECTIVES_0 + i, wxString::FromAscii(Perspectives.at(i).Name.c_str()), wxT(""), wxITEM_CHECK); + menuPopup.Append(mItem); + if (i == ActivePerspective) mItem->Check(true); } } @@ -698,7 +691,7 @@ void CFrame::ResetToolbarStyle() void CFrame::TogglePaneStyle(bool On, int EventId) { wxAuiPaneInfoArray& AllPanes = m_Mgr->GetAllPanes(); - for (int i = 0; i < AllPanes.GetCount(); ++i) + for (u32 i = 0; i < AllPanes.GetCount(); ++i) { wxAuiPaneInfo& Pane = AllPanes.Item(i); if (Pane.window->IsKindOf(CLASSINFO(wxAuiNotebook))) @@ -746,7 +739,7 @@ void CFrame::ToggleNotebookStyle(long Style) } void CFrame::OnSelectPerspective(wxCommandEvent& event) { - int _Selection = event.GetId() - IDM_PERSPECTIVES_0; + u32 _Selection = event.GetId() - IDM_PERSPECTIVES_0; if (Perspectives.size() <= _Selection) _Selection = 0; ActivePerspective = _Selection; DoLoadPerspective(); @@ -754,7 +747,7 @@ void CFrame::OnSelectPerspective(wxCommandEvent& event) void CFrame::ResizeConsole() { - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; for(u32 j = 0; j <= wxDynamicCast(m_Mgr->GetAllPanes().Item(i).window, wxAuiNotebook)->GetPageCount(); j++) @@ -825,7 +818,7 @@ void CFrame::SetSimplePaneSize() int iClientSize = this->GetSize().GetX(); // Fix the pane sizes - for (int i = 0; i < Pane.size(); i++) + for (u32 i = 0; i < Pane.size(); i++) { // Check limits Size[i] = Limit(Size[i], 5, 95); @@ -835,7 +828,7 @@ void CFrame::SetSimplePaneSize() m_Mgr->GetPane(wxString::Format(wxT("Pane %i"), Pane[i])).BestSize(Size[i], -1).MinSize(Size[i], -1).MaxSize(Size[i], -1); } m_Mgr->Update(); - for (int i = 0; i < Pane.size(); i++) + for (u32 i = 0; i < Pane.size(); i++) { // Remove the size limits m_Mgr->GetPane(wxString::Format(wxT("Pane %i"), Pane[i])).MinSize(-1, -1).MaxSize(-1, -1); @@ -847,13 +840,13 @@ void CFrame::SetPaneSize() if (Perspectives.size() <= ActivePerspective) return; int iClientX = this->GetSize().GetX(), iClientY = this->GetSize().GetY(); - for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiToolBar))) { if (!m_Mgr->GetAllPanes().Item(i).IsOk()) return; if (Perspectives.at(ActivePerspective).Width.size() <= j || Perspectives.at(ActivePerspective).Height.size() <= j) continue; - int W = Perspectives.at(ActivePerspective).Width.at(j), H = Perspectives.at(ActivePerspective).Height.at(j); + u32 W = Perspectives.at(ActivePerspective).Width.at(j), H = Perspectives.at(ActivePerspective).Height.at(j); // Check limits W = Limit(W, 5, 95); H = Limit(H, 5, 95); // Produce pixel width from percentage width @@ -865,7 +858,7 @@ void CFrame::SetPaneSize() } m_Mgr->Update(); - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiToolBar))) { @@ -880,44 +873,44 @@ void CFrame::ListChildren() ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); wxAuiNotebook * NB = NULL; - Console->Log(LogTypes::LCUSTOM, "--------------------------------------------------------------------\n"); + Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n"); - for (int i = 0; i < this->GetChildren().size(); i++) + for (u32 i = 0; i < this->GetChildren().size(); i++) { wxWindow * Win = this->GetChildren().Item(i)->GetData(); - Console->Log(LogTypes::LCUSTOM, StringFromFormat( + Console->Log(LogTypes::LNOTICE, StringFromFormat( "%i: %s (%s) :: %s", i, - Win->GetName().mb_str(), Win->GetLabel().mb_str(), Win->GetParent()->GetName().mb_str()).c_str()); + (const char*)Win->GetName().mb_str(), (const char*)Win->GetLabel().mb_str(), (const char*)Win->GetParent()->GetName().mb_str()).c_str()); //if (Win->GetName().IsSameAs(wxT("control"))) if (Win->IsKindOf(CLASSINFO(wxAuiNotebook))) { NB = (wxAuiNotebook*)Win; - Console->Log(LogTypes::LCUSTOM, StringFromFormat(" :: NB", NB->GetName().mb_str()).c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat(" :: NB", (const char*)NB->GetName().mb_str()).c_str()); } else { NB = NULL; } - Console->Log(LogTypes::LCUSTOM, StringFromFormat("\n").c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat("\n").c_str()); Win = this->GetChildren().Item(i)->GetData(); - for (int j = 0; j < Win->GetChildren().size(); j++) + for (u32 j = 0; j < Win->GetChildren().size(); j++) { - Console->Log(LogTypes::LCUSTOM, StringFromFormat( - " %i.%i: %s (%s) :: %s", i, j, - Win->GetName().mb_str(), Win->GetLabel().mb_str(), Win->GetParent()->GetName().mb_str()).c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat( + " %i.%i: %s (%s) :: %s", i, j, + (const char*)Win->GetName().mb_str(), (const char*)Win->GetLabel().mb_str(), (const char*)Win->GetParent()->GetName().mb_str()).c_str()); if (NB) { if (j < NB->GetPageCount()) - Console->Log(LogTypes::LCUSTOM, StringFromFormat(" :: %s", NB->GetPage(j)->GetName().mb_str()).c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat(" :: %s", (const char*)NB->GetPage(j)->GetName().mb_str()).c_str()); } - Console->Log(LogTypes::LCUSTOM, StringFromFormat("\n").c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat("\n").c_str()); /* Win = this->GetChildren().Item(j)->GetData(); for (int k = 0; k < Win->GetChildren().size(); k++) { - Console->Log(LogTypes::LCUSTOM, StringFromFormat( + Console->Log(LogTypes::LNOTICE, StringFromFormat( " %i.%i.%i: %s (%s) :: %s\n", i, j, k, Win->GetName().mb_str(), Win->GetLabel().mb_str(), Win->GetParent()->GetName().mb_str()).c_str()); } @@ -925,21 +918,21 @@ void CFrame::ListChildren() } } - Console->Log(LogTypes::LCUSTOM, "--------------------------------------------------------------------\n"); + Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n"); - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiNotebook))) continue; - wxAuiNotebook * NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; - Console->Log(LogTypes::LCUSTOM, StringFromFormat("%i: %s\n", i, m_Mgr->GetAllPanes().Item(i).name.mb_str()).c_str()); + wxAuiNotebook * _NB = (wxAuiNotebook*)m_Mgr->GetAllPanes().Item(i).window; + Console->Log(LogTypes::LNOTICE, StringFromFormat("%i: %s\n", i, (const char *)m_Mgr->GetAllPanes().Item(i).name.mb_str()).c_str()); - for (int j = 0; j < NB->GetPageCount(); j++) + for (u32 j = 0; j < _NB->GetPageCount(); j++) { - Console->Log(LogTypes::LCUSTOM, StringFromFormat("%i.%i: %s\n", i, j, NB->GetPageText(j).mb_str()).c_str()); + Console->Log(LogTypes::LNOTICE, StringFromFormat("%i.%i: %s\n", i, j, (const char *)_NB->GetPageText(j).mb_str()).c_str()); } } - Console->Log(LogTypes::LCUSTOM, "--------------------------------------------------------------------\n"); + Console->Log(LogTypes::LNOTICE, "--------------------------------------------------------------------\n"); } void CFrame::ReloadPanes() @@ -968,7 +961,7 @@ void CFrame::ReloadPanes() //m_Mgr->Update(); // Create new panes with notebooks - for (int i = 0; i < Perspectives.at(ActivePerspective).Width.size() - 1; i++) + for (u32 i = 0; i < Perspectives.at(ActivePerspective).Width.size() - 1; i++) { m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo().Hide() .CaptionVisible(m_bEdit).Floatable(m_bFloatPane)); @@ -1015,7 +1008,7 @@ void CFrame::DoLoadPerspective() /* ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LCUSTOM, StringFromFormat( + Console->Log(LogTypes::LNOTICE, StringFromFormat( "Loaded: %s (%i panes, %i NBs)\n", Perspectives.at(ActivePerspective).Name.c_str(), m_Mgr->GetAllPanes().GetCount(), GetNotebookCount()).c_str()); */ @@ -1035,7 +1028,7 @@ void CFrame::SaveLocal() SplitString(_Perspectives, ",", VPerspectives); // - for (int i = 0; i < VPerspectives.size(); i++) + for (u32 i = 0; i < VPerspectives.size(); i++) { SPerspectives Tmp; std::string _Section, _Perspective, _Width, _Height; @@ -1054,12 +1047,12 @@ void CFrame::SaveLocal() SplitString(_Width, ",", _SWidth); SplitString(_Height, ",", _SHeight); - for (int j = 0; j < _SWidth.size(); j++) + for (u32 j = 0; j < _SWidth.size(); j++) { int _Tmp; if (TryParseInt(_SWidth.at(j).c_str(), &_Tmp)) Tmp.Width.push_back(_Tmp); } - for (int j = 0; j < _SHeight.size(); j++) + for (u32 j = 0; j < _SHeight.size(); j++) { int _Tmp; if (TryParseInt(_SHeight.at(j).c_str(), &_Tmp)) Tmp.Height.push_back(_Tmp); @@ -1087,7 +1080,7 @@ void CFrame::Save() ini.Set(_Section.c_str(), "Perspective", m_Mgr->SavePerspective().mb_str()); std::string SWidth = "", SHeight = ""; - for (int i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiToolBar))) { @@ -1104,7 +1097,7 @@ void CFrame::Save() // Save perspective names std::string STmp = ""; - for (int i = 0; i < Perspectives.size(); i++) + for (u32 i = 0; i < Perspectives.size(); i++) { STmp += Perspectives.at(i).Name + ","; } @@ -1121,7 +1114,7 @@ void CFrame::Save() /* ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener(); - Console->Log(LogTypes::LCUSTOM, StringFromFormat( + Console->Log(LogTypes::LNOTICE, StringFromFormat( "Saved: %s (%s, %i panes, %i NBs)\n", Perspectives.at(ActivePerspective).Name.c_str(), STmp.c_str(), m_Mgr->GetAllPanes().GetCount(), GetNotebookCount()).c_str()); */ @@ -1142,7 +1135,7 @@ int CFrame::PixelsToPercentage(int Pixels, int Total) void CFrame::NamePanes() { - for (int i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) + for (u32 i = 0, j = 0; i < m_Mgr->GetAllPanes().GetCount(); i++) { if (!m_Mgr->GetAllPanes().Item(i).window->IsKindOf(CLASSINFO(wxAuiToolBar))) { @@ -1162,4 +1155,4 @@ void CFrame::AddPane() } -///////////////////////////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file +///////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index f0d5453295..8395543c4a 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -983,9 +983,9 @@ void CFrame::OnToggleToolbar(wxCommandEvent& event) SConfig::GetInstance().m_InterfaceToolbar = event.IsChecked(); DoToggleToolbar(event.IsChecked()); } -void CFrame::DoToggleToolbar(bool Show) +void CFrame::DoToggleToolbar(bool _show) { - if (Show) + if (_show) { m_Mgr->GetPane(wxT("TBMain")).Show(); if (UseDebugger) { m_Mgr->GetPane(wxT("TBDebug")).Show(); m_Mgr->GetPane(wxT("TBAui")).Show(); } diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 11d7f2fb04..3d9156831e 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -526,7 +526,7 @@ void CISOProperties::CreateGUIControls(bool IsWad) void CISOProperties::OnClose(wxCloseEvent& WXUNUSED (event)) { if (!SaveGameConfig()) - wxMessageBox(wxString::Format(_("Could not save %s"), wxString::FromAscii(GameIniFile.c_str())), _("Error"), wxOK|wxICON_ERROR, this); + PanicYesNo("Could not save %s", GameIniFile.c_str()); EndModal(bRefreshList ? wxID_OK : wxID_CANCEL); } diff --git a/Source/Core/DolphinWX/Src/NetFunctions.cpp b/Source/Core/DolphinWX/Src/NetFunctions.cpp index 3a49805a47..b279f853c1 100644 --- a/Source/Core/DolphinWX/Src/NetFunctions.cpp +++ b/Source/Core/DolphinWX/Src/NetFunctions.cpp @@ -414,7 +414,7 @@ void NetPlay::ChangeSelectedGame(std::string game) m_selectedGame = game; UpdateNetWindow(false); - m_Logging->AppendText(wxString::Format( wxT(" *Game has been changed to : %s \r\n "), wxString(game.c_str(),wxConvUTF8 ))); + m_Logging->AppendText(wxString::Format( wxT(" *Game has been changed to : %s \r\n "), game.c_str())); NOTICE_LOG(NETPLAY,"Game has been changed to : %s \n",game.c_str()); } } diff --git a/Source/Core/DolphinWX/Src/NetSockets.cpp b/Source/Core/DolphinWX/Src/NetSockets.cpp index 3f6a607f94..3d5d18fd01 100644 --- a/Source/Core/DolphinWX/Src/NetSockets.cpp +++ b/Source/Core/DolphinWX/Src/NetSockets.cpp @@ -296,8 +296,8 @@ bool ServerSide::SyncValues(unsigned char socketnb, sf::IPAddress Address) m_client[i].socket.Send(m_client[socketnb].nick.c_str(), buffer_size + 1); } } - Event->AppendText( wxString::FromAscii((wxT("*Connection established to %s (%s:%d)\n"), - m_client[socketnb].nick.c_str(), Address.ToString().c_str(), m_client[m_numplayers].port)) ); + Event->AppendText( wxString::Format(wxT("*Connection established to %s (%s:%d)\n"), + m_client[socketnb].nick.c_str(), Address.ToString().c_str(), m_client[m_numplayers].port)); if (init_number != 0x1F) // Not Found //for (int i = 0; i < 4; i++) @@ -412,7 +412,7 @@ void *ClientSide::Entry() { Event->AppendText(_("Connection successful !\n")); Event->AppendText( wxString::Format( wxT("*Connection established to %s (%s)\n*Game is : %s\n "), - wxString(m_hostnick.c_str(),wxConvUTF8 ) , wxString(m_addr.c_str(),wxConvUTF8 ) , wxString(m_selectedgame.c_str() , wxConvUTF8) )); + m_hostnick.c_str(), m_addr.c_str(), m_selectedgame.c_str())); } else { @@ -561,8 +561,8 @@ void ClientSide::CheckGameFound() for (int i = 0; i < 2; i++) { - Event->AppendText(_("WARNING : You do not have the Selected Game !\n")); - NOTICE_LOG(NETPLAY,"Game '%s' not found!",m_selectedgame); + Event->AppendText(wxT("WARNING : You do not have the Selected Game !\n")); + NOTICE_LOG(NETPLAY, "Game '%s' not found!", m_selectedgame.c_str()); } } diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index aaf984074a..191435b1dd 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -137,16 +137,18 @@ const char *GenerateVertexShader(u32 components, bool D3D) // inputs if (components & VB_HAS_NRM0) WRITE(p, " float3 rawnorm0 : NORMAL0,\n"); - if (components & VB_HAS_NRM1) - if (D3D) + if (components & VB_HAS_NRM1) { + if (D3D) WRITE(p, " float3 rawnorm1 : NORMAL1,\n"); else WRITE(p, " float3 rawnorm1 : ATTR%d,\n", SHADER_NORM1_ATTRIB); - if (components & VB_HAS_NRM2) - if (D3D) + } + if (components & VB_HAS_NRM2) { + if (D3D) WRITE(p, " float3 rawnorm2 : NORMAL2,\n"); else WRITE(p, " float3 rawnorm2 : ATTR%d,\n", SHADER_NORM2_ATTRIB); + } if (components & VB_HAS_COL0) WRITE(p, " float4 color0 : COLOR0,\n"); if (components & VB_HAS_COL1) @@ -156,14 +158,14 @@ const char *GenerateVertexShader(u32 components, bool D3D) if ((components & (VB_HAS_UV0<