Switches to GCC's internal swaps for swap32 and swap64 in OSX. Changes CDIO from using char*** to std::vector<std::string>, which fixes a memory leak I was noticing and also makes it look cleaner. This is not tested much in Windows/Linux, please see if it compiles and doesn't fail out in some mysterious way

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5067 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1
2010-02-16 08:46:21 +00:00
parent 7c76d51c67
commit 215f1f74be
9 changed files with 51 additions and 92 deletions
+1 -1
View File
@@ -510,7 +510,7 @@ CFrame::~CFrame()
{
m_bControlsCreated = false;
cdio_free_device_list(drives);
drives.clear();
/* The statbar sample has this so I add this to, but I guess timer will be deleted after
this anyway */
#if wxUSE_TIMER
+3 -1
View File
@@ -29,6 +29,8 @@
#define id toolid
#endif
#include <wx/aui/aui.h>
#include <string>
#include <vector>
#include "CDUtils.h"
#include "CodeWindow.h"
@@ -202,7 +204,7 @@ class CFrame : public wxFrame
char newDiscpath[2048];
wxMessageDialog *m_StopDlg;
char **drives;
std::vector<std::string> drives;
enum EToolbar
{
+4 -3
View File
@@ -115,8 +115,9 @@ void CFrame::CreateMenu()
m_pSubMenuDrive = fileMenu->AppendSubMenu(externalDrive, _T("&Boot from DVD Drive..."));
drives = cdio_get_devices();
for (int i = 0; drives[i] != NULL && i < 24; i++) {
externalDrive->Append(IDM_DRIVE1 + i, wxString::FromAscii(drives[i]));
// Windows Limitation of 24 character drives
for (int i = 0; i < drives.size() && i < 24; i++) {
externalDrive->Append(IDM_DRIVE1 + i, wxString::FromAscii(drives[i].c_str()));
}
fileMenu->AppendSeparator();
@@ -666,7 +667,7 @@ void CFrame::StartGame(const std::string& filename)
void CFrame::OnBootDrive(wxCommandEvent& event)
{
BootManager::BootCore(drives[event.GetId()-IDM_DRIVE1]);
BootManager::BootCore(drives[event.GetId()-IDM_DRIVE1].c_str());
}
+4 -3
View File
@@ -559,11 +559,12 @@ void CGameListCtrl::ScanForISOs()
if (SConfig::GetInstance().m_ListDrives)
{
char **drives = cdio_get_devices();
std::vector<std::string> drives = cdio_get_devices();
GameListItem * Drive[24];
for (int i = 0; drives[i] != NULL && i < 24; i++)
// Another silly Windows limitation of 24 drive letters
for (int i = 0; i < drives.size() != NULL && i < 24; i++)
{
Drive[i] = new GameListItem(drives[i]);
Drive[i] = new GameListItem(drives[i].c_str());
if (Drive[i]->IsValid()) m_ISOFiles.push_back(*Drive[i]);
}
}