From c303669dd0a45893f32f3b92082606b34b288f9e Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Fri, 28 Dec 2012 09:58:06 -0600 Subject: [PATCH] Clean up some messy code issues that have been annoying me. --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 2 +- .../Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 4 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.h | 2 +- .../Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 40 +++++++++---------- Source/Core/DolphinWX/Src/Frame.cpp | 2 - Source/Core/DolphinWX/Src/FrameTools.cpp | 5 +-- 6 files changed, 26 insertions(+), 29 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index db45802e6f..47737326f4 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -387,7 +387,7 @@ void ExecuteCommand(u32 _Address) INFO_LOG(WII_IPC_FILEIO, "IOP: Open File (Device=%s, ID=%08x, Mode=%i)", pDevice->GetDeviceName().c_str(), DeviceID, Mode); - if (Memory::Read_U32(_Address + 4) == DeviceID) + if (Memory::Read_U32(_Address + 4) == (u32)DeviceID) { g_FdMap[DeviceID] = pDevice; } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index f409c88c83..5e23819d7b 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -789,8 +789,8 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) { static CWII_IPC_HLE_Device_usb_oh1_57e_305* s_Usb = GetUsbPointer(); bool* wiiMoteConnected = new bool[s_Usb->m_WiiMotes.size()]; - for(unsigned int i = 0; i < s_Usb->m_WiiMotes.size(); - i++) wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected(); + for (unsigned int i = 0; i < s_Usb->m_WiiMotes.size(); i++) + wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected(); std::string tContentFile(m_ContentFile.c_str()); WII_IPC_HLE_Interface::Reset(true); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.h index 1afb01cf8d..c98338e39d 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_fs.h @@ -31,7 +31,7 @@ struct NANDStat }; enum { - FS_RESULT_OK = 0, + FS_RESULT_OK = 0, FS_INVALID = -4, FS_DIRFILE_NOT_FOUND = -6, FS_RESULT_FATAL = -101, diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index af10e98d60..29e3c64a7c 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -116,26 +116,26 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::DoState(PointerWrap &p) p.Do(m_EventQueue); m_acl_pool.DoState(p); - for (unsigned int i = 0; i < 4; i++) - m_WiiMotes[i].DoState(p); - - // Reset the connection of real and hybrid wiimotes - if (p.GetMode() == PointerWrap::MODE_READ && SConfig::GetInstance().m_WiimoteReconnectOnLoad) - { - for (unsigned int i = 0; i < 4; i++) - { - if (WIIMOTE_SRC_EMU == g_wiimote_sources[i] || WIIMOTE_SRC_NONE == g_wiimote_sources[i]) - continue; - // TODO: Selectively clear real wiimote messages if possible. Or create a real wiimote channel and reporting mode pre-setup to vacate the need for m_WiimoteReconnectOnLoad. - m_EventQueue.clear(); - if (!m_WiiMotes[i].IsInactive()) - { - m_WiiMotes[i].Activate(false); - m_WiiMotes[i].Activate(true); - } - else - m_WiiMotes[i].Activate(false); - } + for (unsigned int i = 0; i < 4; i++) + m_WiiMotes[i].DoState(p); + + // Reset the connection of real and hybrid wiimotes + if (p.GetMode() == PointerWrap::MODE_READ && SConfig::GetInstance().m_WiimoteReconnectOnLoad) + { + for (unsigned int i = 0; i < 4; i++) + { + if (WIIMOTE_SRC_EMU == g_wiimote_sources[i] || WIIMOTE_SRC_NONE == g_wiimote_sources[i]) + continue; + // TODO: Selectively clear real wiimote messages if possible. Or create a real wiimote channel and reporting mode pre-setup to vacate the need for m_WiimoteReconnectOnLoad. + m_EventQueue.clear(); + if (!m_WiiMotes[i].IsInactive()) + { + m_WiiMotes[i].Activate(false); + m_WiiMotes[i].Activate(true); + } + else + m_WiiMotes[i].Activate(false); + } } } diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index c9408203ea..750696f6c7 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -365,8 +365,6 @@ CFrame::CFrame(wxFrame* parent, // --------------- // Manager - // wxAUI_MGR_LIVE_RESIZE does not exist in the wxWidgets 2.8.9 that comes with Ubuntu 9.04 - // Could just check for wxWidgets version if it becomes a problem. m_Mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); m_Mgr->AddPane(m_Panel, wxAuiPaneInfo() diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 7f69631827..1a7743e8e6 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -1090,15 +1090,14 @@ void CFrame::DoStop() Core::EState state = Core::GetState(); confirmStop = true; Core::SetState(Core::CORE_PAUSE); - wxMessageDialog *m_StopDlg = new wxMessageDialog( + wxMessageDialog m_StopDlg( this, _("Do you want to stop the current emulation?"), _("Please confirm..."), wxYES_NO | wxSTAY_ON_TOP | wxICON_EXCLAMATION, wxDefaultPosition); - int Ret = m_StopDlg->ShowModal(); - m_StopDlg->Destroy(); + int Ret = m_StopDlg.ShowModal(); confirmStop = false; if (Ret != wxID_YES) {