Convert GetUserPath to return a std::string instead of a const char *. This simplifies its usage in most cases.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7265 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2011-02-28 20:40:15 +00:00
parent 1b8f476024
commit ba54fac9eb
82 changed files with 408 additions and 449 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ wxCheatsWindow::wxCheatsWindow(wxWindow* const parent)
const DiscIO::IVolume* const vol = VolumeHandler::GetVolume();
if (vol)
{
m_gameini_path = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + vol->GetUniqueID() + ".ini";
m_gameini_path = File::GetUserPath(D_GAMECONFIG_IDX) + vol->GetUniqueID() + ".ini";
m_gameini.Load(m_gameini_path);
m_geckocode_panel->LoadCodes(m_gameini);
}
+1 -1
View File
@@ -1169,7 +1169,7 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
{
std::string filename = std::string(wxFileSelector(
_("Choose a file to open"),
wxString::FromUTF8(File::GetUserPath(D_GCUSER_IDX)),
wxString::FromUTF8(File::GetUserPath(D_GCUSER_IDX).c_str()),
isSlotA ? wxT(GC_MEMCARDA) : wxT(GC_MEMCARDB),
wxEmptyString,
_("Gamecube Memory Cards (*.raw,*.gcp)") + wxString(wxT("|*.raw;*.gcp"))).mb_str());
@@ -16,7 +16,6 @@
// http://code.google.com/p/dolphin-emu/
#include "BreakpointDlg.h"
//#include "Host.h"
#include "StringUtil.h"
#include "PowerPC/PowerPC.h"
#include "BreakpointWindow.h"
@@ -63,7 +62,6 @@ void BreakPointDlg::OnOK(wxCommandEvent& WXUNUSED(event))
{
PowerPC::breakpoints.Add(Address);
Parent->NotifyUpdate();
//Host_UpdateBreakPointView();
Close();
}
else
@@ -20,7 +20,6 @@
#include <wx/listctrl.h>
#include "Common.h"
#include "BreakpointWindow.h"
class CBreakPointView : public wxListCtrl
{
@@ -15,8 +15,7 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <wx/imaglist.h>
#include "BreakpointWindow.h"
#include "BreakpointView.h"
#include "CodeWindow.h"
#include "HW/Memmap.h"
@@ -99,7 +98,7 @@ private:
BEGIN_EVENT_TABLE(CBreakPointWindow, wxPanel)
EVT_CLOSE(CBreakPointWindow::OnClose)
EVT_LIST_ITEM_SELECTED(ID_BPS, CBreakPointWindow::OnSelectBP)
EVT_LIST_ITEM_SELECTED(wxID_ANY, CBreakPointWindow::OnSelectBP)
END_EVENT_TABLE()
CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent,
@@ -108,7 +107,15 @@ CBreakPointWindow::CBreakPointWindow(CCodeWindow* _pCodeWindow, wxWindow* parent
: wxPanel(parent, id, position, size, style, title)
, m_pCodeWindow(_pCodeWindow)
{
CreateGUIControls();
m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
m_BreakPointListView = new CBreakPointView(this, wxID_ANY);
m_mgr.AddPane(new CBreakPointBar(this, wxID_ANY), wxAuiPaneInfo().ToolbarPane().Top().
LeftDockable(false).RightDockable(false).BottomDockable(false).Floatable(false));
m_mgr.AddPane(m_BreakPointListView, wxAuiPaneInfo().CenterPane());
m_mgr.Update();
}
CBreakPointWindow::~CBreakPointWindow()
@@ -122,19 +129,6 @@ void CBreakPointWindow::OnClose(wxCloseEvent& event)
event.Skip();
}
void CBreakPointWindow::CreateGUIControls()
{
m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
m_BreakPointListView = new CBreakPointView(this, ID_BPS);
m_mgr.AddPane(new CBreakPointBar(this, wxID_ANY), wxAuiPaneInfo().ToolbarPane().Top().
LeftDockable(false).RightDockable(false).BottomDockable(false).Floatable(false));
m_mgr.AddPane(m_BreakPointListView, wxAuiPaneInfo().CenterPane());
m_mgr.Update();
}
void CBreakPointWindow::NotifyUpdate()
{
m_BreakPointListView->Update();
@@ -19,13 +19,11 @@
#define __BREAKPOINTWINDOW_h__
#include <wx/wx.h>
#include <wx/listctrl.h>
#include <wx/aui/aui.h>
class CBreakPointView;
class CBreakPointBar;
class CCodeWindow;
class wxListEvent;
class IniFile;
class CBreakPointWindow : public wxPanel
{
@@ -53,18 +51,12 @@ public:
private:
DECLARE_EVENT_TABLE();
enum
{
ID_BPS = 1002,
};
wxAuiManager m_mgr;
CBreakPointView* m_BreakPointListView;
CCodeWindow* m_pCodeWindow;
void OnClose(wxCloseEvent& event);
void OnSelectBP(wxListEvent& event);
void CreateGUIControls();
};
#endif
@@ -19,13 +19,6 @@
#include "Common.h"
#include <wx/wx.h>
#include <wx/button.h>
#include <wx/textctrl.h>
#include <wx/textdlg.h>
#include <wx/listctrl.h>
#include <wx/thread.h>
#include <wx/mstream.h>
#include <wx/tipwin.h>
#include "Host.h"
@@ -72,50 +65,14 @@ extern "C" // Bitmaps
BEGIN_EVENT_TABLE(CCodeWindow, wxPanel)
// Menu bar
EVT_MENU(IDM_AUTOMATICSTART, CCodeWindow::OnCPUMode) // Options
EVT_MENU(IDM_BOOTTOPAUSE, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont)
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnCPUMode) // Jit
EVT_MENU(IDM_JITNOBLOCKCACHE, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSLXZOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSLWZOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSLBZXOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSFOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITLSPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITFPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITIOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITPOFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_JITSROFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu)
EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_SCANFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_SAVEMAPFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_SAVEMAPFILEWITHCODES, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_CREATESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_RENAME_SYMBOLS, CCodeWindow::OnSymbolsMenu)
EVT_MENU(IDM_PROFILEBLOCKS, CCodeWindow::OnProfilerMenu)
EVT_MENU(IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
EVT_MENU_RANGE(IDM_INTERPRETER, IDM_JITSROFF, CCodeWindow::OnCPUMode)
EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont)
EVT_MENU_RANGE(IDM_CLEARCODECACHE, IDM_SEARCHINSTRUCTION, CCodeWindow::OnJitMenu)
EVT_MENU_RANGE(IDM_LOADMAPFILE, IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu)
EVT_MENU_RANGE(IDM_PROFILEBLOCKS, IDM_WRITEPROFILE, CCodeWindow::OnProfilerMenu)
// Toolbar
EVT_MENU(IDM_STEP, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_STEPOVER, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_TOGGLE_BREAKPOINT, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_SKIP, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_SETPC, CCodeWindow::OnCodeStep)
EVT_MENU(IDM_GOTOPC, CCodeWindow::OnCodeStep)
EVT_TEXT(IDM_ADDRBOX, CCodeWindow::OnAddrBoxChange)
EVT_MENU_RANGE(IDM_STEP, IDM_ADDRBOX, CCodeWindow::OnCodeStep)
// Other
EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
@@ -142,7 +99,30 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
{
InitBitmaps();
CreateGUIControls(_LocalCoreStartupParameter);
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
DebugInterface* di = &PowerPC::debug_interface;
codeview = new CCodeView(di, &g_symbolDB, this, ID_CODEVIEW);
sizerBig->Add(sizerLeft, 2, wxEXPAND);
sizerBig->Add(codeview, 5, wxEXPAND);
sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST,
wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST,
wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition,
wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition,
wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
SetSizer(sizerBig);
sizerLeft->Fit(this);
sizerBig->Fit(this);
sync_event.Init();
}
wxMenuBar *CCodeWindow::GetMenuBar()
@@ -376,35 +356,6 @@ void CCodeWindow::UpdateCallstack()
callstack->Append(wxString::FromAscii("invalid callstack"));
}
void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter)
{
// Configure the code window
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
DebugInterface* di = &PowerPC::debug_interface;
codeview = new CCodeView(di, &g_symbolDB, this, ID_CODEVIEW);
sizerBig->Add(sizerLeft, 2, wxEXPAND);
sizerBig->Add(codeview, 5, wxEXPAND);
sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST,
wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND);
sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST,
wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND);
sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition,
wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition,
wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND);
SetSizer(sizerBig);
sizerLeft->Fit(this);
sizerBig->Fit(this);
sync_event.Init();
}
// Create CPU Mode menus
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter,
wxMenuBar *pMenuBar)
@@ -28,8 +28,8 @@
#include "CoreParameter.h"
// GUI global
#include "../../DolphinWX/Src/Globals.h"
#include "../../DolphinWX/Src/Frame.h"
#include "../Globals.h"
#include "../Frame.h"
class CFrame;
class CRegisterWindow;
@@ -145,7 +145,6 @@ class CCodeWindow
void UpdateCallstack();
void InitBitmaps();
void CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter);
CCodeView* codeview;
wxListBox* callstack;
@@ -18,16 +18,8 @@
#include "Common.h"
#include "CommonPaths.h"
#include <wx/button.h>
#include <wx/textctrl.h>
#include <wx/textdlg.h>
#include <wx/listctrl.h>
#include <wx/thread.h>
#include <wx/mstream.h>
#include <wx/tipwin.h>
#include <wx/fontdlg.h>
#include "../../DolphinWX/Src/WxUtils.h"
#include <wx/mimetype.h>
#include "Host.h"
@@ -165,7 +157,6 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar)
{
wxMenu *pSymbolsMenu = new wxMenu;
pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _("&Clear symbols"));
// pSymbolsMenu->Append(IDM_CLEANSYMBOLS, _("&Clean symbols (zz)"));
pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _("&Generate symbol map"));
pSymbolsMenu->AppendSeparator();
pSymbolsMenu->Append(IDM_LOADMAPFILE, _("&Load symbol map"));
@@ -207,8 +198,25 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS);
break;
case IDM_WRITEPROFILE:
Profiler::WriteProfileResults("profiler.txt");
WxUtils::Launch("profiler.txt");
if (jit != NULL)
{
std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt";
File::CreateFullPath(filename.c_str());
Profiler::WriteProfileResults(filename.c_str());
wxFileType* filetype = NULL;
if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt"))))
{
// From extension failed, trying with MIME type now
if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_T("text/plain"))))
// MIME type failed, aborting mission
break;
}
wxString OpenCommand;
OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(filename.c_str()));
if(!OpenCommand.IsEmpty())
wxExecute(OpenCommand, wxEXEC_SYNC);
}
break;
}
}
@@ -227,10 +235,6 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
g_symbolDB.Clear();
Host_NotifyMapLoaded();
break;
case IDM_CLEANSYMBOLS:
g_symbolDB.Clear("zz");
Host_NotifyMapLoaded();
break;
case IDM_SCANFUNCTIONS:
{
PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB);
@@ -253,58 +253,58 @@ void GFXDebuggerPanel::OnPauseAtNextFrameButton(wxCommandEvent& event)
void GFXDebuggerPanel::OnDumpButton(wxCommandEvent& event)
{
char dump_path[MAX_PATH];
sprintf(dump_path, "%sDebug/%s/", File::GetUserPath(D_DUMP_IDX), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
if (!File::CreateFullPath(dump_path))
std::string dump_path = File::GetUserPath(D_DUMP_IDX) + "Debug/" +
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID + "/";
if (!File::CreateFullPath(dump_path.c_str()))
return;
switch (m_pDumpList->GetSelection())
{
case 0: // Pixel Shader
DumpPixelShader(dump_path);
DumpPixelShader(dump_path.c_str());
break;
case 1: // Vertex Shader
DumpVertexShader(dump_path);
DumpVertexShader(dump_path.c_str());
break;
case 2: // Pixel Shader Constants
DumpPixelShaderConstants(dump_path);
DumpPixelShaderConstants(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 3: // Vertex Shader Constants
DumpVertexShaderConstants(dump_path);
DumpVertexShaderConstants(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 4: // Textures
DumpTextures(dump_path);
DumpTextures(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 5: // Frame Buffer
DumpFrameBuffer(dump_path);
DumpFrameBuffer(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 6: // Geometry
DumpGeometry(dump_path);
DumpGeometry(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 7: // Vertex Description
DumpVertexDecl(dump_path);
DumpVertexDecl(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 8: // Vertex Matrices
DumpMatrices(dump_path);
DumpMatrices(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
case 9: // Statistics
DumpStats(dump_path);
DumpStats(dump_path.c_str());
wxMessageBox(_("Not implemented"), _("Error"), wxOK);
break;
}
@@ -18,8 +18,8 @@
#include "MemoryCheckDlg.h"
#include "Common.h"
#include "StringUtil.h"
#include "Host.h"
#include "PowerPC/PowerPC.h"
#include "BreakpointWindow.h"
#define TEXT_BOX(text) new wxStaticText(this, wxID_ANY, wxT(text), wxDefaultPosition, wxDefaultSize)
@@ -29,8 +29,9 @@ BEGIN_EVENT_TABLE(MemoryCheckDlg,wxDialog)
EVT_BUTTON(wxID_CANCEL, MemoryCheckDlg::OnCancel)
END_EVENT_TABLE()
MemoryCheckDlg::MemoryCheckDlg(wxWindow *parent)
MemoryCheckDlg::MemoryCheckDlg(CBreakPointWindow *parent)
: wxDialog(parent, wxID_ANY, _("Memory Check"), wxDefaultPosition, wxDefaultSize)
, m_parent(parent)
{
m_pEditStartAddress = new wxTextCtrl(this, wxID_ANY, wxT(""));
m_pEditEndAddress = new wxTextCtrl(this, wxID_ANY, wxT(""));
@@ -111,7 +112,7 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& WXUNUSED(event))
MemCheck.Break = Break;
PowerPC::memchecks.Add(MemCheck);
Host_UpdateBreakPointView();
m_parent->NotifyUpdate();
Close();
}
}
@@ -20,12 +20,15 @@
#include <wx/wx.h>
class CBreakPointWindow;
class MemoryCheckDlg : public wxDialog
{
public:
MemoryCheckDlg(wxWindow *parent);
MemoryCheckDlg(CBreakPointWindow *parent);
private:
CBreakPointWindow *m_parent;
wxCheckBox* m_pReadFlag;
wxCheckBox* m_pWriteFlag;
wxCheckBox* m_log_flag;
@@ -231,7 +231,7 @@ void CMemoryWindow::OnHostMessage(wxCommandEvent& event)
// Write mram to file
void CMemoryWindow::OnDumpMemory( wxCommandEvent& event )
{
FILE* f = fopen(File::GetUserPath(F_RAMDUMP_IDX), "wb");
FILE* f = fopen(File::GetUserPath(F_RAMDUMP_IDX).c_str(), "wb");
if (f && Memory::m_pRAM)
{
fwrite(Memory::m_pRAM, Memory::REALRAM_SIZE, 1, f);
@@ -246,7 +246,7 @@ void CMemoryWindow::OnDumpMem2( wxCommandEvent& event )
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
{
f = fopen(File::GetUserPath(F_ARAMDUMP_IDX), "wb");
f = fopen(File::GetUserPath(F_ARAMDUMP_IDX).c_str(), "wb");
if (f && Memory::m_pEXRAM)
{
fwrite(Memory::m_pEXRAM, Memory::EXRAM_SIZE, 1, f);
@@ -256,7 +256,7 @@ void CMemoryWindow::OnDumpMem2( wxCommandEvent& event )
else
{
u8* aram = DSP::GetARAMPtr();
f = fopen(File::GetUserPath(F_ARAMDUMP_IDX), "wb");
f = fopen(File::GetUserPath(F_ARAMDUMP_IDX).c_str(), "wb");
if (f && aram)
{
fwrite(aram, DSP::ARAM_SIZE, 1, f);
+1 -1
View File
@@ -1632,7 +1632,7 @@ void CFrame::GameListChanged(wxCommandEvent& event)
break;
case IDM_PURGECACHE:
CFileSearch::XStringVector Directories;
Directories.push_back(File::GetUserPath(D_CACHE_IDX));
Directories.push_back(File::GetUserPath(D_CACHE_IDX).c_str());
CFileSearch::XStringVector Extensions;
Extensions.push_back("*.cache");
+5 -8
View File
@@ -382,8 +382,7 @@ void CGameListCtrl::OnPaintDrawImages(wxPaintEvent& event)
m_imageListSmall->Draw(m_FlagImageIndex[rISOFile.GetCountry()],
dc, flagOffset, itemY);
ini.Load((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) +
(rISOFile.GetUniqueID()) + ".ini").c_str());
ini.Load(File::GetUserPath(D_GAMECONFIG_IDX) + rISOFile.GetUniqueID() + ".ini");
ini.Get("EmuState", "EmulationStateId", &nState);
m_imageListSmall->Draw(m_EmuStateImageIndex[nState],
dc, stateOffset, itemY);
@@ -490,8 +489,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
#ifndef _WIN32
// Load the INI file for columns that read from it
IniFile ini;
ini.Load((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) +
(rISOFile.GetUniqueID()) + ".ini").c_str());
ini.Load(File::GetUserPath(D_GAMECONFIG_IDX) + rISOFile.GetUniqueID() + ".ini");
// Emulation status
int nState;
@@ -780,9 +778,9 @@ int wxCALLBACK wxListCompare(long item1, long item2, long sortData)
case CGameListCtrl::COLUMN_EMULATION_STATE:
IniFile ini;
int nState1 = 0, nState2 = 0;
std::string GameIni1 = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) +
std::string GameIni1 = File::GetUserPath(D_GAMECONFIG_IDX) +
iso1->GetUniqueID() + ".ini";
std::string GameIni2 = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) +
std::string GameIni2 = File::GetUserPath(D_GAMECONFIG_IDX) +
iso2->GetUniqueID() + ".ini";
ini.Load(GameIni1.c_str());
@@ -908,8 +906,7 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
const GameListItem& rISO = m_ISOFiles[GetItemData(item)];
IniFile ini;
ini.Load((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) +
(rISO.GetUniqueID()) + ".ini").c_str());
ini.Load(File::GetUserPath(D_GAMECONFIG_IDX) + rISO.GetUniqueID() + ".ini");
// Emulation status
std::string emuState[5] = {
-3
View File
@@ -165,7 +165,6 @@ enum
// --------------------
// CPU Mode
IDM_INTERPRETER,
//IDM_DUALCORE, // not used
IDM_AUTOMATICSTART, IDM_BOOTTOPAUSE,
IDM_JITNOBLOCKCACHE, IDM_JITBLOCKLINKING, // JIT
IDM_JITOFF,
@@ -179,14 +178,12 @@ enum
// Symbols
IDM_CLEARSYMBOLS,
IDM_CLEANSYMBOLS, // not used
IDM_SCANFUNCTIONS,
IDM_LOADMAPFILE,
IDM_SAVEMAPFILE, IDM_SAVEMAPFILEWITHCODES,
IDM_CREATESIGNATUREFILE,
IDM_RENAME_SYMBOLS,
IDM_USESIGNATUREFILE,
//IDM_USESYMBOLFILE, // not used
IDM_PATCHHLEFUNCTIONS,
// JIT
+5 -4
View File
@@ -153,9 +153,9 @@ bool GameListItem::LoadFromCache()
void GameListItem::SaveToCache()
{
if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX)))
if (!File::IsDirectory(File::GetUserPath(D_CACHE_IDX).c_str()))
{
File::CreateDir(File::GetUserPath(D_CACHE_IDX));
File::CreateDir(File::GetUserPath(D_CACHE_IDX).c_str());
}
CChunkFileReader::Save<GameListItem>(CreateCacheFilename(), CACHE_REVISION, *this);
@@ -190,7 +190,7 @@ std::string GameListItem::CreateCacheFilename()
extension.c_str(), HashFletcher((const u8 *)LegalPathname.c_str(), LegalPathname.size()),
File::GetSize(m_FileName.c_str())));
std::string fullname(std::string(File::GetUserPath(D_CACHE_IDX)));
std::string fullname(File::GetUserPath(D_CACHE_IDX));
fullname += Filename;
return fullname;
}
@@ -229,7 +229,8 @@ const std::string GameListItem::GetWiiFSPath() const
Iso->GetTitleID((u8*)&Title);
Title = Common::swap64(Title);
sprintf(Path, "%stitle/%08x/%08x/data/", File::GetUserPath(D_WIIUSER_IDX), (u32)(Title>>32), (u32)Title);
sprintf(Path, "%stitle/%08x/%08x/data/",
File::GetUserPath(D_WIIUSER_IDX).c_str(), (u32)(Title>>32), (u32)Title);
if (!File::Exists(Path))
File::CreateFullPath(Path);
+1 -1
View File
@@ -130,7 +130,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
_iniFilename = tmp;
}
}
GameIniFile = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + _iniFilename + ".ini";
GameIniFile = File::GetUserPath(D_GAMECONFIG_IDX) + _iniFilename + ".ini";
if (GameIni.Load(GameIniFile.c_str()))
LoadGameConfig();
else
+25 -25
View File
@@ -202,7 +202,7 @@ bool DolphinApp::OnInit()
#ifdef _WIN32
// Keep the user config dir free unless user wants to save the working dir
if (!File::Exists((std::string(File::GetUserPath(D_CONFIG_IDX)) + "portable").c_str()))
if (!File::Exists((File::GetUserPath(D_CONFIG_IDX) + "portable").c_str()))
{
char tmp[1024];
sprintf(tmp, "%s/.dolphin%swd", (const char*)wxStandardPaths::Get().GetUserConfigDir().mb_str(),
@@ -216,7 +216,7 @@ bool DolphinApp::OnInit()
{
if (PanicYesNoT("Dolphin has not been configured with an install location,\nKeep Dolphin portable?"))
{
FILE* portable = fopen((std::string(File::GetUserPath(D_CONFIG_IDX)) + "portable").c_str(), "w");
FILE* portable = fopen((File::GetUserPath(D_CONFIG_IDX) + "portable").c_str(), "w");
if (!portable)
{
PanicAlertT("Portable Setting could not be saved\n Are you running Dolphin from read only media or from a directory that dolphin is not located in?");
@@ -264,34 +264,34 @@ bool DolphinApp::OnInit()
//create all necessary directories in user directory
//TODO : detect the revision and upgrade where necessary
File::CopyDir(std::string(SHARED_USER_DIR CONFIG_DIR DIR_SEP).c_str(),
File::GetUserPath(D_CONFIG_IDX));
File::GetUserPath(D_CONFIG_IDX).c_str());
File::CopyDir(std::string(SHARED_USER_DIR GAMECONFIG_DIR DIR_SEP).c_str(),
File::GetUserPath(D_GAMECONFIG_IDX));
File::GetUserPath(D_GAMECONFIG_IDX).c_str());
File::CopyDir(std::string(SHARED_USER_DIR MAPS_DIR DIR_SEP).c_str(),
File::GetUserPath(D_MAPS_IDX));
File::GetUserPath(D_MAPS_IDX).c_str());
File::CopyDir(std::string(SHARED_USER_DIR SHADERS_DIR DIR_SEP).c_str(),
File::GetUserPath(D_SHADERS_IDX));
File::GetUserPath(D_SHADERS_IDX).c_str());
File::CopyDir(std::string(SHARED_USER_DIR WII_USER_DIR DIR_SEP).c_str(),
File::GetUserPath(D_WIIUSER_IDX));
File::GetUserPath(D_WIIUSER_IDX).c_str());
File::CopyDir(std::string(SHARED_USER_DIR OPENCL_DIR DIR_SEP).c_str(),
File::GetUserPath(D_OPENCL_IDX));
File::GetUserPath(D_OPENCL_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_GCUSER_IDX)))
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
if (!File::Exists(File::GetUserPath(D_CACHE_IDX)))
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
if (!File::Exists(File::GetUserPath(D_DUMPDSP_IDX)))
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX));
if (!File::Exists(File::GetUserPath(D_DUMPTEXTURES_IDX)))
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
if (!File::Exists(File::GetUserPath(D_HIRESTEXTURES_IDX)))
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX));
if (!File::Exists(File::GetUserPath(D_SCREENSHOTS_IDX)))
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX));
if (!File::Exists(File::GetUserPath(D_STATESAVES_IDX)))
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX));
if (!File::Exists(File::GetUserPath(D_MAILLOGS_IDX)))
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX));
if (!File::Exists(File::GetUserPath(D_GCUSER_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_CACHE_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_DUMPDSP_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_DUMPTEXTURES_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_HIRESTEXTURES_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_SCREENSHOTS_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_STATESAVES_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX).c_str());
if (!File::Exists(File::GetUserPath(D_MAILLOGS_IDX).c_str()))
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX).c_str());
#endif
LogManager::Init();
@@ -394,7 +394,7 @@ void DolphinApp::InitLanguageSupport()
unsigned int language = 0;
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX).c_str());
ini.Get("Interface", "Language", &language, wxLANGUAGE_DEFAULT);
// Load language if possible, fall back to system default otherwise
+1 -1
View File
@@ -211,7 +211,7 @@ void CMemcardManager::CreateGUIControls()
sPages[slot]->Add(m_NextPage[slot], 0, wxEXPAND|wxALL, 1);
m_MemcardPath[slot] = new wxFilePickerCtrl(this, ID_MEMCARDPATH_A + slot,
wxString::From8BitData(File::GetUserPath(D_GCUSER_IDX)), _("Choose a memory card:"),
wxString::From8BitData(File::GetUserPath(D_GCUSER_IDX).c_str()), _("Choose a memory card:"),
_("Gamecube Memory Cards (*.raw,*.gcp)") + wxString(wxT("|*.raw;*.gcp")), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN);
m_MemcardList[slot] = new CMemcardListCtrl(this, ID_MEMCARDLIST_A + slot, wxDefaultPosition, wxSize(350,400),
@@ -1152,7 +1152,7 @@ bool GCMemcard::Format(bool sjis, bool New, int slot, u16 SizeMb, bool hdrOnly)
// Only Format 16MB memcards for now
if ((SizeMb != MemCard2043Mb) || (data_size != mc_data_size)) return false;
pStream = fopen(File::GetUserPath(F_GCSRAM_IDX), "rb");
pStream = fopen(File::GetUserPath(F_GCSRAM_IDX).c_str(), "rb");
if (pStream)
{
fread(&m_SRAM, 1, 64, pStream);
@@ -519,7 +519,9 @@ bool CWiiSaveCrypted::getPaths(bool forExport)
{
if (_saveGameTitle)
{
sprintf(pathSavedir, "%stitle/%08x/%08x/data/", File::GetUserPath(D_WIIUSER_IDX), (u32)(_saveGameTitle>>32), (u32)_saveGameTitle);
sprintf(pathSavedir, "%stitle/%08x/%08x/data/",
File::GetUserPath(D_WIIUSER_IDX).c_str(),
(u32)(_saveGameTitle>>32), (u32)_saveGameTitle);
sprintf(pathBanner_bin, "%sbanner.bin", pathSavedir);
sprintf(_saveGameString, "%c%c%c%c",
(u8)(_saveGameTitle >> 24) & 0xFF, (u8)(_saveGameTitle >> 16) & 0xFF,
+2 -2
View File
@@ -43,7 +43,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl*
, m_game_list(game_list)
{
IniFile inifile;
inifile.Load(std::string(File::GetUserPath(D_CONFIG_IDX)) + "Dolphin.ini");
inifile.Load(File::GetUserPath(D_CONFIG_IDX) + "Dolphin.ini");
IniFile::Section& netplay_section = *inifile.GetOrCreateSection("NetPlay");
wxPanel* const panel = new wxPanel(this);
@@ -167,7 +167,7 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl*
NetPlaySetupDiag::~NetPlaySetupDiag()
{
IniFile inifile;
const std::string dolphin_ini = std::string(File::GetUserPath(D_CONFIG_IDX)) + "Dolphin.ini";
const std::string dolphin_ini = File::GetUserPath(D_CONFIG_IDX) + "Dolphin.ini";
inifile.Load(dolphin_ini);
IniFile::Section& netplay_section = *inifile.GetOrCreateSection("NetPlay");
+1 -1
View File
@@ -31,7 +31,7 @@ CPHackSettings::CPHackSettings(wxWindow* parent, wxWindowID id, const wxString&
{
CreateGUIControls();
std::string _iniFilename;
_iniFilename = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + "PH_PRESETS.ini";
_iniFilename = File::GetUserPath(D_GAMECONFIG_IDX) + "PH_PRESETS.ini";
PHPresetsIni.Load(_iniFilename.c_str());
//PHPresetsIni.SortSections();
//PHPresetsIni.Save(_iniFilename.c_str());
@@ -73,7 +73,7 @@ void VideoConfigDiag::Event_Close(wxCloseEvent& ev)
{
const GameListItem* item = GameListCtrl->GetISO(GameListCtrl->GetItemData(cur_profile - 1));
vconfig.GameIniSave((File::GetUserPath(D_CONFIG_IDX) + ininame + ".ini").c_str(),
(std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + item->GetUniqueID() + ".ini").c_str());
(File::GetUserPath(D_GAMECONFIG_IDX) + item->GetUniqueID() + ".ini").c_str());
}
EndModal(wxID_OK);
@@ -156,7 +156,7 @@ void WiimoteConfigPage::RevertSource()
void WiimoteConfigDiag::Save(wxCommandEvent&)
{
std::string ini_filename = (std::string(File::GetUserPath(D_CONFIG_IDX)) + WIIMOTE_INI_NAME ".ini");
std::string ini_filename = File::GetUserPath(D_CONFIG_IDX) + WIIMOTE_INI_NAME ".ini";
IniFile inifile;
inifile.Load(ini_filename);