From 6968137bbcf58789a8ce2354fe47c57fa2bdc2db Mon Sep 17 00:00:00 2001 From: Sacha Date: Mon, 17 Mar 2014 23:41:15 +1000 Subject: [PATCH] Fix slashes for Linux --- rpcs3/Emu/FS/VFS.cpp | 13 ++++++------- rpcs3/Emu/FS/vfsDevice.cpp | 10 +++++----- rpcs3/Emu/FS/vfsLocalFile.cpp | 4 ++-- rpcs3/Emu/GS/GL/GLGSRender.h | 2 +- rpcs3/Emu/HDD/HDD.h | 2 +- rpcs3/Emu/System.cpp | 8 ++++---- rpcs3/Gui/MainFrame.cpp | 2 +- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index 48174ebe77..fc2c69f7e5 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -226,7 +226,6 @@ vfsDevice* VFS::GetDevice(const wxString& ps3_path, wxString& path) const } if(max_i < 0) return nullptr; - path = vfsDevice::GetWinPath(m_devices[max_i].GetLocalPath(), ps3_path(max_eq, ps3_path.Len() - max_eq)); return &m_devices[max_i]; } @@ -303,27 +302,27 @@ void VFS::SaveLoadDevices(Array& res, bool is_load) { int idx; idx = res.Move(new VFSManagerEntry()); - res[idx].path = "$(EmulatorDir)\\dev_hdd0\\"; + res[idx].path = "$(EmulatorDir)/dev_hdd0/"; res[idx].mount = "/dev_hdd0/"; res[idx].device = vfsDevice_LocalFile; idx = res.Move(new VFSManagerEntry()); - res[idx].path = "$(EmulatorDir)\\dev_hdd1\\"; + res[idx].path = "$(EmulatorDir)/dev_hdd1/"; res[idx].mount = "/dev_hdd1/"; res[idx].device = vfsDevice_LocalFile; idx = res.Move(new VFSManagerEntry()); - res[idx].path = "$(EmulatorDir)\\dev_flash\\"; + res[idx].path = "$(EmulatorDir)/dev_flash/"; res[idx].mount = "/dev_flash/"; res[idx].device = vfsDevice_LocalFile; idx = res.Move(new VFSManagerEntry()); - res[idx].path = "$(EmulatorDir)\\dev_usb000\\"; + res[idx].path = "$(EmulatorDir)/dev_usb000/"; res[idx].mount = "/dev_usb000/"; res[idx].device = vfsDevice_LocalFile; idx = res.Move(new VFSManagerEntry()); - res[idx].path = "$(EmulatorDir)\\dev_usb000\\"; + res[idx].path = "$(EmulatorDir)/dev_usb000/"; res[idx].mount = "/dev_usb/"; res[idx].device = vfsDevice_LocalFile; @@ -333,7 +332,7 @@ void VFS::SaveLoadDevices(Array& res, bool is_load) res[idx].device = vfsDevice_LocalFile; idx = res.Move(new VFSManagerEntry()); - res[idx].path = "$(GameDir)\\..\\"; + res[idx].path = "$(GameDir)/../"; res[idx].mount = "/dev_bdvd/"; res[idx].device = vfsDevice_LocalFile; diff --git a/rpcs3/Emu/FS/vfsDevice.cpp b/rpcs3/Emu/FS/vfsDevice.cpp index df79fcdfb4..bc1014607b 100644 --- a/rpcs3/Emu/FS/vfsDevice.cpp +++ b/rpcs3/Emu/FS/vfsDevice.cpp @@ -48,8 +48,8 @@ u32 vfsDevice::CmpLocalPath(const wxString& local_path) wxFileName path0(m_local_path); path0.Normalize(); - wxArrayString arr0 = wxSplit(path0.GetFullPath(), '\\'); - wxArrayString arr1 = wxSplit(local_path, '\\'); + wxArrayString arr0 = wxSplit(path0.GetFullPath(), '/'); + wxArrayString arr1 = wxSplit(local_path, '/'); const u32 lim = min(arr0.GetCount(), arr1.GetCount()); u32 ret = 0; @@ -168,7 +168,7 @@ wxString vfsDevice::GetWinPath(const wxString& p, bool is_dir) { if(!is_ls) { - ret += '\\'; + ret += '/'; is_ls = true; } @@ -179,7 +179,7 @@ wxString vfsDevice::GetWinPath(const wxString& p, bool is_dir) ret += p[i]; } - if(is_dir && ret[ret.Len() - 1] != '\\') ret += '\\'; + if(is_dir && ret[ret.Len() - 1] != '/') ret += '/'; wxFileName res(ret); res.Normalize(); @@ -191,7 +191,7 @@ wxString vfsDevice::GetWinPath(const wxString& l, const wxString& r) if(l.IsEmpty()) return GetWinPath(r, false); if(r.IsEmpty()) return GetWinPath(l); - return GetWinPath(l + '\\' + r, false); + return GetWinPath(l + '/' + r, false); } wxString vfsDevice::GetPs3Path(const wxString& p, bool is_dir) diff --git a/rpcs3/Emu/FS/vfsLocalFile.cpp b/rpcs3/Emu/FS/vfsLocalFile.cpp index 3746f94f41..ef953b4f49 100644 --- a/rpcs3/Emu/FS/vfsLocalFile.cpp +++ b/rpcs3/Emu/FS/vfsLocalFile.cpp @@ -56,7 +56,7 @@ bool vfsLocalFile::Create(const wxString& path) for(uint p=1; p < path.Len() && path[p] != '\0' ; p++) { for(; p < path.Len() && path[p] != '\0'; p++) - if(path[p] == '\\') break; + if(path[p] == '/') break; if(p == path.Len() || path[p] == '\0') break; @@ -70,7 +70,7 @@ bool vfsLocalFile::Create(const wxString& path) } //create file - if(path(path.Len() - 1, 1) != '\\' && !wxFileExists(path)) + if(path(path.Len() - 1, 1) != '/' && !wxFileExists(path)) { wxFile f; return f.Create(path); diff --git a/rpcs3/Emu/GS/GL/GLGSRender.h b/rpcs3/Emu/GS/GL/GLGSRender.h index 4bd83f26e0..3f8dc8ac39 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.h +++ b/rpcs3/Emu/GS/GL/GLGSRender.h @@ -302,7 +302,7 @@ public: void Save(RSXTexture& tex) { static const wxString& dir_path = "textures"; - static const wxString& file_fmt = dir_path + "\\" + "tex[%d].png"; + static const wxString& file_fmt = dir_path + "/" + "tex[%d].png"; if(!wxDirExists(dir_path)) wxMkdir(dir_path); diff --git a/rpcs3/Emu/HDD/HDD.h b/rpcs3/Emu/HDD/HDD.h index ed3650ed54..0535a018c0 100644 --- a/rpcs3/Emu/HDD/HDD.h +++ b/rpcs3/Emu/HDD/HDD.h @@ -695,7 +695,7 @@ public: do { - if(s[pos] == '\\' || s[pos] == '\0') + if(s[pos] == '/' || s[pos] == '\0') { if(file_pos != -1) { diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 7c92cb7e3d..9e73da3995 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -141,7 +141,7 @@ void Emulator::Load() m_path = elf_path; } - ConLog.Write("Loading '%s'...", m_path.wx_str()); + ConLog.Write("Loading '%s'...", m_path.ToStdString().c_str()); GetInfo().Reset(); m_vfs.Init(m_path); @@ -149,7 +149,7 @@ void Emulator::Load() ConLog.Write("Mount info:"); for(uint i=0; i %s", m_vfs.m_devices[i].GetPs3Path().wx_str(), m_vfs.m_devices[i].GetLocalPath().wx_str()); + ConLog.Write("%s -> %s", m_vfs.m_devices[i].GetPs3Path().ToStdString().c_str(), m_vfs.m_devices[i].GetLocalPath().ToStdString().c_str()); } ConLog.SkipLn(); @@ -162,7 +162,7 @@ void Emulator::Load() if(!f.IsOpened()) { - ConLog.Error("Elf not found! (%s - %s)", m_path.wx_str(), m_elf_path.wx_str()); + ConLog.Error("Elf not found! (%s - %s)", m_path.ToStdString().c_str(), m_elf_path.ToStdString().c_str()); return; } @@ -441,7 +441,7 @@ void Emulator::LoadPoints(const std::string& path) if(version != bpdb_version || (sizeof(u16) + break_count * sizeof(u64) + sizeof(u32) + marked_count * sizeof(u64) + sizeof(u32)) != length) { - ConLog.Error("'%s' is broken", wxString(path).wx_str()); + ConLog.Error("'%s' is broken", path.c_str()); return; } diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index fc6ac9f582..80941fbaf8 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -202,7 +202,7 @@ void MainFrame::BootGame(wxCommandEvent& WXUNUSED(event)) } else { - ConLog.Error("Ps3 executable not found in selected folder (%s)", ctrl.GetPath().wx_str()); + ConLog.Error("Ps3 executable not found in selected folder (%s)", ctrl.GetPath().ToStdString().c_str()); } }