Linux global build. At least the basic footwork is done here.

Basic usage:  "sudo scons install=global install"
Hopefully this doesn't break builds on Macs.  I have tested this on linux and windows.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4994 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2010-02-02 21:56:29 +00:00
parent a090876bbd
commit feba09f7a3
79 changed files with 652 additions and 403 deletions

View File

@ -20,6 +20,7 @@
#include "IniFile.h"
#include "Config.h"
#include "AudioCommon.h"
#include "FileUtil.h"
CConfig g_Config;
@ -32,7 +33,7 @@ void CConfig::Load()
{
// first load defaults
IniFile file;
file.Load(FULL_CONFIG_DIR "DSP.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "DSP.ini").c_str());
file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true); // Sound Settings
file.Get("Config", "EnableRE0AudioFix", &m_EnableRE0Fix, false); // RE0 Hack
ac_Config.Load(file);
@ -41,12 +42,12 @@ void CConfig::Load()
void CConfig::Save()
{
IniFile file;
file.Load(FULL_CONFIG_DIR "DSP.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "DSP.ini").c_str());
file.Set("Config", "EnableHLEAudio", m_EnableHLEAudio); // Sound Settings
file.Set("Config", "EnableRE0AudioFix", m_EnableRE0Fix); // RE0 Hack
ac_Config.Set(file);
file.Save(FULL_CONFIG_DIR "DSP.ini");
file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "DSP.ini").c_str());
}
void CConfig::GameIniLoad(const char *game_ini)

View File

@ -96,7 +96,7 @@ DSPDebuggerHLE::DSPDebuggerHLE(wxWindow *parent, wxWindowID id, const wxString &
// load ini...
IniFile file;
file.Load(DEBUGGER_CONFIG_FILE);
file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
this->Load(file);
// append block names
@ -150,9 +150,9 @@ DSPDebuggerHLE::~DSPDebuggerHLE()
/*
// empty
IniFile file;
file.Load(DEBUGGER_CONFIG_FILE);
file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
this->Save(file);
file.Save(DEBUGGER_CONFIG_FILE);
file.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
*/
// Reset
@ -173,9 +173,9 @@ void DSPDebuggerHLE::OnClose(wxCloseEvent& event)
// Save the window position
IniFile file;
file.Load(DEBUGGER_CONFIG_FILE);
file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
this->Save(file);
file.Save(DEBUGGER_CONFIG_FILE);
file.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
//EndModal(0);
//Close(true);

View File

@ -95,7 +95,7 @@ void DSPDebuggerHLE::ReadDir()
{
CFileSearch::XStringVector Directories;
//Directories.push_back("Logs/Mail");
Directories.push_back(FULL_MAIL_LOGS_DIR);
Directories.push_back(File::GetUserPath(D_MAILLOGS_IDX));
CFileSearch::XStringVector Extensions;
Extensions.push_back("*.log");
@ -241,8 +241,8 @@ void DSPDebuggerHLE::Readfile(std::string FileName, bool GC)
std::string sz = "";
std::ostringstream ci;
ci << i;
std::string f0 = FULL_MAIL_LOGS_DIR + FileName + "_sep" + ci.str() + "_sep" + "0_sep" + (GC ? "GC" : "Wii") + "_sep.log";
std::string f1 = FULL_MAIL_LOGS_DIR + FileName + "_sep" + ci.str() + "_sep" + "1_sep" + (GC ? "GC" : "Wii") + "_sep.log";
std::string f0 = std::string(File::GetUserPath(D_MAILLOGS_IDX)) + FileName + "_sep" + ci.str() + "_sep" + "0_sep" + (GC ? "GC" : "Wii") + "_sep.log";
std::string f1 = std::string(File::GetUserPath(D_MAILLOGS_IDX)) + FileName + "_sep" + ci.str() + "_sep" + "1_sep" + (GC ? "GC" : "Wii") + "_sep.log";
//Console::Print("ifstream %s %s\n", f0.c_str(), f1.c_str());

View File

@ -77,7 +77,7 @@ void CUCode_AX::SaveLogFile(std::string f, int resizeTo, bool type, bool Wii)
ci << (resizeTo - 1); // write ci
cType << type; // write cType
std::string FileName = FULL_MAIL_LOGS_DIR + std::string(globals->unique_id);
std::string FileName = std::string(File::GetUserPath(D_MAILLOGS_IDX)) + std::string(globals->unique_id);
FileName += "_sep"; FileName += ci.str(); FileName += "_sep"; FileName += cType.str();
FileName += Wii ? "_sepWii_sep" : "_sepGC_sep"; FileName += ".log";

View File

@ -19,6 +19,7 @@
#include "IniFile.h"
#include "Config.h"
#include "AudioCommon.h"
#include "FileUtil.h"
#define LLE_CONFIG_FILE "DSPLLE.ini"
@ -33,15 +34,15 @@ void CConfig::Load()
{
// first load defaults
IniFile file;
file.Load(FULL_CONFIG_DIR LLE_CONFIG_FILE);
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + LLE_CONFIG_FILE).c_str());
ac_Config.Load(file);
}
void CConfig::Save()
{
IniFile file;
file.Load(FULL_CONFIG_DIR LLE_CONFIG_FILE);
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + LLE_CONFIG_FILE).c_str());
ac_Config.Set(file);
file.Save(FULL_CONFIG_DIR LLE_CONFIG_FILE);
file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + LLE_CONFIG_FILE).c_str());
}

View File

@ -32,8 +32,8 @@ bool DumpDSPCode(const u8 *code_be, int size_in_bytes, u32 crc)
{
char binFile[MAX_PATH];
char txtFile[MAX_PATH];
sprintf(binFile, "%sDSP_UC_%08X.bin", FULL_DSP_DUMP_DIR, crc);
sprintf(txtFile, "%sDSP_UC_%08X.txt", FULL_DSP_DUMP_DIR, crc);
sprintf(binFile, "%sDSP_UC_%08X.bin", File::GetUserPath(D_DUMPDSP_IDX), crc);
sprintf(txtFile, "%sDSP_UC_%08X.txt", File::GetUserPath(D_DUMPDSP_IDX), crc);
FILE* pFile = fopen(binFile, "wb");
if (pFile)
@ -93,7 +93,7 @@ u32 GenerateCRC(const unsigned char* _pBuffer, int _pLength)
bool DumpCWCode(u32 _Address, u32 _Length)
{
char filename[256];
sprintf(filename, "%sDSP_UCode.bin", FULL_DSP_DUMP_DIR);
sprintf(filename, "%sDSP_UCode.bin", File::GetUserPath(D_DUMPDSP_IDX));
FILE* pFile = fopen(filename, "wb");
if (pFile != NULL)

View File

@ -22,6 +22,7 @@
#include "IniFile.h"
#include "Config.h"
#include "GCPad.h"
#include "FileUtil.h"
static const char* gcControlNames[] =
{
@ -156,7 +157,7 @@ void Config::Save()
{
// Load ini file
IniFile file;
file.Load(FULL_CONFIG_DIR "GCPad.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "GCPad.ini").c_str());
// ==================================================================
// Global settings
@ -199,7 +200,7 @@ void Config::Save()
file.Set(SectionName.c_str(), gcControlNames[x], GCMapping[i].Button[x]);
}
file.Save(FULL_CONFIG_DIR "GCPad.ini");
file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "GCPad.ini").c_str());
}
// Load settings from file
@ -208,7 +209,7 @@ void Config::Load()
{
// Load file
IniFile file;
file.Load(FULL_CONFIG_DIR "GCPad.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "GCPad.ini").c_str());
// ==================================================================
// Global settings

View File

@ -18,6 +18,7 @@
#include "IniFile.h"
#include "Debugger.h"
#include "FileUtil.h"
#include "VideoConfig.h"
#include "../Globals.h"
@ -75,7 +76,7 @@ void GFXDebuggerDX9::OnClose(wxCloseEvent& event)
void GFXDebuggerDX9::SaveSettings() const
{
IniFile file;
file.Load(DEBUGGER_CONFIG_FILE);
file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
// TODO: make this work when we close the entire program too, currently on total close we get
// weird values, perhaps because of some conflict with the rendering window
@ -100,13 +101,13 @@ void GFXDebuggerDX9::SaveSettings() const
//file.Set("VideoWindow", "ConfBits", g_Config.iLog);
file.Save(DEBUGGER_CONFIG_FILE);
file.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
}
void GFXDebuggerDX9::LoadSettings()
{
IniFile file;
file.Load(DEBUGGER_CONFIG_FILE);
file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
int x = 100, y = 100, w = 100, h = 100;
file.Get("VideoWindow", "x", &x, GetPosition().x);

View File

@ -20,6 +20,7 @@
#include "resource.h"
#include "W32Util/PropertySheet.h"
#include "W32Util/ShellUtil.h"
#include "FileUtil.h"
#include "D3DBase.h"
@ -137,7 +138,7 @@ struct TabDirect3D : public W32Util::Tab
g_Config.bFullscreen = Button_GetCheck(GetDlgItem(hDlg, IDC_FULLSCREENENABLE)) ? true : false;
g_Config.bVSync = Button_GetCheck(GetDlgItem(hDlg, IDC_VSYNC)) ? true : false;
g_Config.RenderToMainframe = Button_GetCheck(GetDlgItem(hDlg, IDC_RENDER_TO_MAINWINDOW)) ? true : false;
g_Config.Save(FULL_CONFIG_DIR "gfx_dx9.ini");
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
}
};
@ -211,7 +212,7 @@ struct TabAdvanced : public W32Util::Tab
g_Config.bEFBCopyDisable = Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? false : true;
g_Config.bCopyEFBToTexture = Button_GetCheck(GetDlgItem(hDlg,IDC_EFBTORAM)) ? false : true;
g_Config.Save(FULL_CONFIG_DIR "gfx_dx9.ini");
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
if( D3D::dev != NULL ) {
D3D::SetRenderState( D3DRS_FILLMODE, g_Config.bWireFrame ? D3DFILL_WIREFRAME : D3DFILL_SOLID );
@ -264,7 +265,7 @@ struct TabEnhancements : public W32Util::Tab
g_Config.bForceFiltering = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEFILTERING)) ? true : false;
g_Config.bHiresTextures = Button_GetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE)) ? true : false;
g_Config.bCopyEFBScaled = Button_GetCheck(GetDlgItem(hDlg,IDC_EFBSCALEDCOPY)) ? true : false;
g_Config.Save(FULL_CONFIG_DIR "gfx_dx9.ini");
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
}
};
@ -274,7 +275,7 @@ void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
bool tfoe = g_Config.bTexFmtOverlayEnable;
bool tfoc = g_Config.bTexFmtOverlayCenter;
g_Config.Load(FULL_CONFIG_DIR "gfx_dx9.ini");
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
W32Util::PropSheet sheet;
sheet.Add(new TabDirect3D, (LPCTSTR)IDD_SETTINGS,_T("Direct3D"));
sheet.Add(new TabEnhancements, (LPCTSTR)IDD_ENHANCEMENTS,_T("Enhancements"));
@ -295,4 +296,4 @@ void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
{
TextureCache::Invalidate(false);
}
}
}

View File

@ -150,11 +150,11 @@ void PixelShaderCache::Init()
s_DepthMatrixProgram = D3D::CompileAndCreatePixelShader(pprog, (int)strlen(pprog));
Clear();
if (!File::Exists(FULL_SHADERCACHE_DIR))
File::CreateDir(FULL_SHADERCACHE_DIR);
if (!File::Exists(File::GetUserPath(D_SHADERCACHE_IDX)))
File::CreateDir(File::GetUserPath(D_SHADERCACHE_IDX));
char cache_filename[MAX_PATH];
sprintf(cache_filename, "%s%s-ps.cache", FULL_SHADERCACHE_DIR, globals->unique_id);
sprintf(cache_filename, "%s%s-ps.cache", File::GetUserPath(D_SHADERCACHE_IDX), globals->unique_id);
PixelShaderCacheInserter inserter;
int read_items = g_ps_disk_cache.OpenAndRead(cache_filename, &inserter);
}
@ -231,7 +231,7 @@ bool PixelShaderCache::SetShader(bool dstAlpha)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && code) {
static int counter = 0;
char szTemp[MAX_PATH];
sprintf(szTemp, "%s/ps_%04i.txt", FULL_DUMP_DIR, counter++);
sprintf(szTemp, "%sps_%04i.txt", File::GetUserPath(D_DUMP_IDX), counter++);
SaveData(szTemp, code);
}
@ -290,4 +290,4 @@ std::string PixelShaderCache::GetCurrentShaderCode()
else
return "(no shader)\n";
}
#endif
#endif

View File

@ -21,6 +21,7 @@
#include "StringUtil.h"
#include "Common.h"
#include "FileUtil.h"
#include "Thread.h"
#include "Timer.h"
#include "Statistics.h"
@ -616,7 +617,7 @@ static void EFBTextureToD3DBackBuffer(const EFBRectangle& sourceRc)
else
{
char msg [255];
sprintf(msg, "Dumping Frames to \"%s/framedump0.avi\" (%dx%d RGB24)", FULL_FRAMES_DIR, s_recordWidth, s_recordHeight);
sprintf(msg, "Dumping Frames to \"%sframedump0.avi\" (%dx%d RGB24)", File::GetUserPath(D_DUMPFRAMES_IDX), s_recordWidth, s_recordHeight);
OSD::AddMessage(msg, 2000);
}
}

View File

@ -293,7 +293,7 @@ TextureCache::TCacheEntry *TextureCache::Load(int stage, u32 address, int width,
const char* uniqueId = globals->unique_id;
bool bCheckedDumpDir = false;
sprintf(szDir, "%s/%s", FULL_DUMP_TEXTURES_DIR, uniqueId);
sprintf(szDir, "%s%s", File::GetUserPath(D_DUMPTEXTURES_IDX), uniqueId);
if (!bCheckedDumpDir)
{

View File

@ -34,6 +34,7 @@
#include "D3DShader.h"
#include "TextureCache.h"
#include "Math.h"
#include "FileUtil.h"
namespace TextureConverter
{
@ -124,7 +125,7 @@ LPDIRECT3DPIXELSHADER9 GetOrCreateEncodingShader(u32 format)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && shader) {
static int counter = 0;
char szTemp[MAX_PATH];
sprintf(szTemp, "%s/enc_%04i.txt", FULL_DUMP_DIR, counter++);
sprintf(szTemp, "%senc_%04i.txt", File::GetUserPath(D_DUMP_IDX), counter++);
SaveData(szTemp, shader);
}

View File

@ -170,11 +170,11 @@ void VertexShaderCache::Init()
Clear();
delete [] vSimpleProg;
if (!File::Exists(FULL_SHADERCACHE_DIR))
File::CreateDir(FULL_SHADERCACHE_DIR);
if (!File::Exists(File::GetUserPath(D_SHADERCACHE_IDX)))
File::CreateDir(File::GetUserPath(D_SHADERCACHE_IDX));
char cache_filename[MAX_PATH];
sprintf(cache_filename, "%s%s-vs.cache", FULL_SHADERCACHE_DIR, globals->unique_id);
sprintf(cache_filename, "%s%s-vs.cache", File::GetUserPath(D_SHADERCACHE_IDX), globals->unique_id);
VertexShaderCacheInserter inserter;
int read_items = g_vs_disk_cache.OpenAndRead(cache_filename, &inserter);
}
@ -280,4 +280,4 @@ std::string VertexShaderCache::GetCurrentShaderCode()
{
return "(N/A)\n";
}
#endif
#endif

View File

@ -232,7 +232,7 @@ void Initialize(void *init)
g_VideoInitialize = *_pVideoInitialize;
InitXFBConvTables();
g_Config.Load(FULL_CONFIG_DIR "gfx_dx9.ini");
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
g_Config.GameIniLoad(globals->game_ini);
UpdateProjectionHack(g_Config.iPhackvalue); // DX9 projection hack could be disabled by commenting out this line
UpdateActiveConfig();

View File

@ -21,6 +21,7 @@
#include "VideoConfig.h"
#include "../Globals.h"
#include "FileUtil.h"
extern int g_Preset;
@ -65,7 +66,7 @@ void GFXDebuggerOGL::OnClose(wxCloseEvent& event)
void GFXDebuggerOGL::SaveSettings() const
{
IniFile file;
file.Load(DEBUGGER_CONFIG_FILE);
file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
// TODO: make this work when we close the entire program too, currently on total close we get
// weird values, perhaps because of some conflict with the rendering window
@ -90,13 +91,13 @@ void GFXDebuggerOGL::SaveSettings() const
file.Set("VideoWindow", "ConfBits", g_Config.iLog);
file.Save(DEBUGGER_CONFIG_FILE);
file.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
}
void GFXDebuggerOGL::LoadSettings()
{
IniFile file;
file.Load(DEBUGGER_CONFIG_FILE);
file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
int x = 100, y = 100, w = 100, h = 100;
file.Get("VideoWindow", "x", &x, GetPosition().x);

View File

@ -292,10 +292,10 @@ void GFXConfigDialogOGL::CreateGUIControls()
m_ReloadShader = new wxButton(m_PageGeneral, ID_RELOADSHADER, wxT("&Reload"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_EditShader = new wxButton(m_PageGeneral, ID_EDITSHADER, wxT("&Edit"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
if (File::IsDirectory("User/Shaders"))
if (File::IsDirectory(File::GetUserPath(D_SHADERS_IDX)))
{
File::FSTEntry entry;
File::ScanDirectoryTree("User/Shaders", entry);
File::ScanDirectoryTree(File::GetUserPath(D_SHADERS_IDX), entry);
for (u32 i = 0; i < entry.children.size(); i++)
{
std::string name = entry.children[i].virtualName.c_str();
@ -306,7 +306,7 @@ void GFXConfigDialogOGL::CreateGUIControls()
}
else
{
File::CreateDir("User/Shaders");
File::CreateDir(File::GetUserPath(D_SHADERS_IDX));
}
wxString shader= wxString::FromAscii(g_Config.sPostProcessingShader.c_str());
@ -547,7 +547,7 @@ void GFXConfigDialogOGL::EditShaderClick(wxCommandEvent& WXUNUSED (event))
{
if (m_PostShaderCB->GetStringSelection() == wxT("(off)"))
return;
wxString shader = wxT("User/Shaders/") + m_PostShaderCB->GetStringSelection() + _(".txt");
wxString shader = wxString::FromAscii(File::GetUserPath(D_SHADERS_IDX)) + m_PostShaderCB->GetStringSelection() + _(".txt");
if (wxFileExists(shader))
{
wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_("txt"));
@ -737,7 +737,7 @@ void GFXConfigDialogOGL::AdvancedSettingsChanged(wxCommandEvent& event)
void GFXConfigDialogOGL::CloseWindow()
{
// Save the config to INI
g_Config.Save(FULL_CONFIG_DIR "gfx_opengl.ini");
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
EndModal(1);
}

View File

@ -528,7 +528,7 @@ void Show()
/*
bool bVideoWindow = false;
IniFile ini;
ini.Load(DEBUGGER_CONFIG_FILE);
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
ini.Get("ShowOnStart", "VideoWindow", &bVideoWindow, false);
if(bVideoWindow) DoDllDebugger();
*/

View File

@ -33,6 +33,7 @@
#include "VertexShaderGen.h"
#include "PixelShaderCache.h"
#include "PixelShaderManager.h"
#include "FileUtil.h"
static int s_nMaxPixelInstructions;
static GLuint s_ColorMatrixProgram = 0;
@ -204,7 +205,7 @@ FRAGMENTSHADER* PixelShaderCache::GetShader(bool dstAlphaEnable)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && code) {
static int counter = 0;
char szTemp[MAX_PATH];
sprintf(szTemp, "%s/ps_%04i.txt", FULL_DUMP_DIR, counter++);
sprintf(szTemp, "%sps_%04i.txt", File::GetUserPath(D_DUMP_IDX), counter++);
SaveData(szTemp, code);
}

View File

@ -45,11 +45,11 @@ void ReloadShader()
bool ApplyShader()
{
if (s_currentShader != "User/Shaders/" + g_ActiveConfig.sPostProcessingShader + ".txt")
if (s_currentShader != std::string(File::GetUserPath(D_SHADERS_IDX)) + g_ActiveConfig.sPostProcessingShader + ".txt")
{
// Set immediately to prevent endless recompiles on failure.
if (!g_ActiveConfig.sPostProcessingShader.empty())
s_currentShader = "User/Shaders/" + g_ActiveConfig.sPostProcessingShader + ".txt";
s_currentShader = std::string(File::GetUserPath(D_SHADERS_IDX)) + g_ActiveConfig.sPostProcessingShader + ".txt";
else
s_currentShader.clear();

View File

@ -29,6 +29,8 @@
#include <Cg/cg.h>
#include <Cg/cgGL.h>
#include "FileUtil.h"
#ifdef _WIN32
#include <mmsystem.h>
#endif
@ -942,7 +944,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
else
{
OSD::AddMessage(StringFromFormat(
"Dumping Frames to \"%s/framedump0.avi\" (%dx%d RGB24)", FULL_FRAMES_DIR, w, h).c_str(), 2000);
"Dumping Frames to \"%sframedump0.avi\" (%dx%d RGB24)", File::GetUserPath(D_DUMPFRAMES_IDX), w, h).c_str(), 2000);
}
}
if (s_bAVIDumping)
@ -981,7 +983,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
glReadPixels(0, Renderer::GetTargetHeight() - h, w, h, GL_RGB, GL_UNSIGNED_BYTE, data);
if (glGetError() == GL_NO_ERROR) {
if (!s_bLastFrameDumped) {
sprintf(movie_file_name, "%s/framedump.raw", FULL_FRAMES_DIR);
sprintf(movie_file_name, "%sframedump.raw", File::GetUserPath(D_DUMPFRAMES_IDX));
f_pFrameDump = fopen(movie_file_name, "wb");
if (f_pFrameDump == NULL) {
PanicAlert("Error opening framedump.raw for writing.");

View File

@ -29,6 +29,7 @@
#include "ImageWrite.h"
#include "Render.h"
#include <math.h>
#include "FileUtil.h"
namespace TextureConverter
{
@ -117,7 +118,7 @@ FRAGMENTSHADER &GetOrCreateEncodingShader(u32 format)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && shader) {
static int counter = 0;
char szTemp[MAX_PATH];
sprintf(szTemp, "%s/enc_%04i.txt", FULL_DUMP_DIR, counter++);
sprintf(szTemp, "%senc_%04i.txt", File::GetUserPath(D_DUMP_IDX), counter++);
SaveData(szTemp, shader);
}

View File

@ -474,7 +474,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width
const char* uniqueId = globals->unique_id;
bool bCheckedDumpDir = false;
sprintf(szDir,"%s/%s",FULL_DUMP_TEXTURES_DIR,uniqueId);
sprintf(szDir,"%s%s",File::GetUserPath(D_DUMPTEXTURES_IDX), uniqueId);
if(!bCheckedDumpDir)
{
@ -728,7 +728,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool
if (g_ActiveConfig.bDumpEFBTarget)
{
static int count = 0;
SaveTexture(StringFromFormat("%s/efb_frame_%i.tga", FULL_DUMP_TEXTURES_DIR, count++).c_str(), GL_TEXTURE_RECTANGLE_ARB, entry.texture, entry.w, entry.h);
SaveTexture(StringFromFormat("%sefb_frame_%i.tga", File::GetUserPath(D_DUMPTEXTURES_IDX), count++).c_str(), GL_TEXTURE_RECTANGLE_ARB, entry.texture, entry.w, entry.h);
}
}

View File

@ -39,6 +39,7 @@
#include "VertexManager.h"
#include "IndexGenerator.h"
#include "OpcodeDecoding.h"
#include "FileUtil.h"
// internal state for loading vertices
extern NativeVertexFormat *g_nativeVertexFmt;
@ -278,7 +279,7 @@ void Flush()
{
// save the textures
char strfile[255];
sprintf(strfile, "%sframes/tex%.3d_%d.tga", FULL_DUMP_DIR, g_Config.iSaveTargetId, i);
sprintf(strfile, "%stex%.3d_%d.tga", File::GetUserPath(D_DUMPFRAMES_IDX), g_Config.iSaveTargetId, i);
SaveTexture(strfile, tentry->isRectangle?GL_TEXTURE_RECTANGLE_ARB:GL_TEXTURE_2D, tentry->texture, tentry->w, tentry->h);
}
}
@ -332,10 +333,10 @@ void Flush()
{
// save the shaders
char strfile[255];
sprintf(strfile, "%sframes/ps%.3d.txt", FULL_DUMP_DIR, g_ActiveConfig.iSaveTargetId);
sprintf(strfile, "%sps%.3d.txt", File::GetUserPath(D_DUMPFRAMES_IDX), g_ActiveConfig.iSaveTargetId);
std::ofstream fps(strfile);
fps << ps->strprog.c_str();
sprintf(strfile, "%sframes/vs%.3d.txt", FULL_DUMP_DIR, g_ActiveConfig.iSaveTargetId);
sprintf(strfile, "%svs%.3d.txt", File::GetUserPath(D_DUMPFRAMES_IDX), g_ActiveConfig.iSaveTargetId);
std::ofstream fvs(strfile);
fvs << vs->strprog.c_str();
}
@ -343,7 +344,7 @@ void Flush()
if (g_ActiveConfig.iLog & CONF_SAVETARGETS)
{
char str[128];
sprintf(str, "%sframes/targ%.3d.tga", FULL_DUMP_DIR, g_ActiveConfig.iSaveTargetId);
sprintf(str, "%starg%.3d.tga", File::GetUserPath(D_DUMPFRAMES_IDX), g_ActiveConfig.iSaveTargetId);
Renderer::SaveRenderTarget(str, Renderer::GetTargetWidth(), Renderer::GetTargetHeight());
}
#endif

View File

@ -35,6 +35,7 @@
#include "VertexLoader.h"
#include "XFMemory.h"
#include "ImageWrite.h"
#include "FileUtil.h"
VertexShaderCache::VSCache VertexShaderCache::vshaders;
bool VertexShaderCache::s_displayCompileAlert;
@ -169,7 +170,7 @@ VERTEXSHADER* VertexShaderCache::GetShader(u32 components)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS && code) {
static int counter = 0;
char szTemp[MAX_PATH];
sprintf(szTemp, "%s/vs_%04i.txt", FULL_DUMP_DIR, counter++);
sprintf(szTemp, "%svs_%04i.txt", File::GetUserPath(D_DUMP_IDX), counter++);
SaveData(szTemp, code);
}

View File

@ -291,7 +291,7 @@ void CocaAddResolutions() {
void DllConfig(HWND _hParent)
{
g_Config.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
g_Config.GameIniLoad(globals->game_ini);
g_Config.UpdateProjectionHack();
UpdateActiveConfig();
@ -333,7 +333,7 @@ void Initialize(void *init)
g_VideoInitialize = *(_pVideoInitialize);
InitXFBConvTables();
g_Config.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
g_Config.GameIniLoad(globals->game_ini);
g_Config.UpdateProjectionHack();

View File

@ -28,6 +28,7 @@
#include "StringUtil.h"
#include "CommandProcessor.h"
#include "../../../Core/VideoCommon/Src/ImageWrite.h"
#include "FileUtil.h"
namespace DebugUtil
{
@ -92,7 +93,7 @@ void DumpActiveTextures()
{
u32 texmap = bpmem.tevindref.getTexMap(stageNum);
SaveTexture(StringFromFormat("%s/tar%i_ind%i_map%i.tga", FULL_DUMP_TEXTURES_DIR, stats.thisFrame.numDrawnObjects, stageNum, texmap).c_str(), texmap);
SaveTexture(StringFromFormat("%star%i_ind%i_map%i.tga", File::GetUserPath(D_DUMPTEXTURES_IDX), stats.thisFrame.numDrawnObjects, stageNum, texmap).c_str(), texmap);
}
for (unsigned int stageNum = 0; stageNum <= bpmem.genMode.numtevstages; stageNum++)
@ -103,7 +104,7 @@ void DumpActiveTextures()
int texmap = order.getTexMap(stageOdd);
SaveTexture(StringFromFormat("%s/tar%i_stage%i_map%i.tga", FULL_DUMP_TEXTURES_DIR, stats.thisFrame.numDrawnObjects, stageNum, texmap).c_str(), texmap);
SaveTexture(StringFromFormat("%star%i_stage%i_map%i.tga", File::GetUserPath(D_DUMPTEXTURES_IDX), stats.thisFrame.numDrawnObjects, stageNum, texmap).c_str(), texmap);
}
}
@ -178,7 +179,7 @@ void OnObjectEnd()
if (!g_bSkipCurrentFrame)
{
if (g_Config.bDumpObjects && stats.thisFrame.numDrawnObjects >= g_Config.drawStart && stats.thisFrame.numDrawnObjects < g_Config.drawEnd)
DumpEfb(StringFromFormat("%s/object%i.tga", FULL_FRAMES_DIR, stats.thisFrame.numDrawnObjects).c_str());
DumpEfb(StringFromFormat("%sobject%i.tga", File::GetUserPath(D_DUMPFRAMES_IDX), stats.thisFrame.numDrawnObjects).c_str());
if (g_Config.bHwRasterizer)
HwRasterizer::EndTriangles();
@ -188,7 +189,7 @@ void OnObjectEnd()
if (DrawnToBuffer[i])
{
DrawnToBuffer[i] = false;
SaveTGA(StringFromFormat("%s/object%i_%s(%i).tga", FULL_FRAMES_DIR,
SaveTGA(StringFromFormat("%sobject%i_%s(%i).tga", File::GetUserPath(D_DUMPFRAMES_IDX),
stats.thisFrame.numDrawnObjects, ObjectBufferName[i], i).c_str(), EFB_WIDTH, EFB_HEIGHT, ObjectBuffer[i]);
memset(ObjectBuffer[i], 0, sizeof(ObjectBuffer[i]));
}
@ -204,8 +205,8 @@ void OnFrameEnd()
{
if (g_Config.bDumpFrames)
{
DumpEfb(StringFromFormat("%s/frame%i_color.tga", FULL_FRAMES_DIR, stats.frameCount).c_str());
DumpDepth(StringFromFormat("%s/frame%i_depth.tga", FULL_FRAMES_DIR, stats.frameCount).c_str());
DumpEfb(StringFromFormat("%sframe%i_color.tga", File::GetUserPath(D_DUMPFRAMES_IDX), stats.frameCount).c_str());
DumpDepth(StringFromFormat("%sframe%i_depth.tga", File::GetUserPath(D_DUMPFRAMES_IDX), stats.frameCount).c_str());
}
}
}

View File

@ -44,7 +44,7 @@ void Config::Load()
{
std::string temp;
IniFile iniFile;
iniFile.Load(FULL_CONFIG_DIR "gfx_software.ini");
iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_software.ini").c_str());
iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); // Hardware
iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, false);
@ -55,11 +55,11 @@ void Config::Load()
void Config::Save()
{
IniFile iniFile;
iniFile.Load(FULL_CONFIG_DIR "gfx_software.ini");
iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_software.ini").c_str());
iniFile.Set("Hardware", "Fullscreen", bFullscreen);
iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe);
iniFile.Save(FULL_CONFIG_DIR "gfx_opengl.ini");
iniFile.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
}

View File

@ -25,6 +25,7 @@
#include "Config.h"
#include "EmuDefinitions.h" // for PadMapping
#include "main.h"
#include "FileUtil.h"
// Configuration file control names
// Do not change the order unless you change the related arrays
@ -259,7 +260,7 @@ void Config::Load()
{
std::string temp;
IniFile iniFile;
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "Wiimote.ini").c_str());
// Real Wiimote
iniFile.Get("Real", "UpdateStatus", &bUpdateRealWiimote, true);
@ -329,7 +330,7 @@ void Config::Load()
// Load a few screen settings to. If these are added to the DirectX plugin it's probably
// better to place them in the main Dolphin.ini file
iniFile.Load(FULL_CONFIG_DIR "gfx_opengl.ini");
iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_opengl.ini").c_str());
iniFile.Get("Settings", "KeepAR_4_3", &bKeepAR43, false);
iniFile.Get("Settings", "KeepAR_16_9", &bKeepAR169, false);
iniFile.Get("Settings", "Crop", &bCrop, false);
@ -345,7 +346,7 @@ void Config::LoadIR()
int defaultLeft, defaultTop, defaultWidth, defaultHeight;
sprintf(TmpSection, "%s", g_ISOId ? Hex2Ascii(g_ISOId).c_str() : "Default");
iniFile.Load(FULL_CONFIG_DIR "IR Pointer.ini");
iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "IR Pointer.ini").c_str());
//Load defaults first...
iniFile.Get("Default", "IRLeft", &defaultLeft, LEFT);
iniFile.Get("Default", "IRTop", &defaultTop, TOP);
@ -362,7 +363,7 @@ void Config::LoadIR()
void Config::Save()
{
IniFile iniFile;
iniFile.Load(FULL_CONFIG_DIR "Wiimote.ini");
iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "Wiimote.ini").c_str());
iniFile.Set("Real", "UpdateStatus", bUpdateRealWiimote);
iniFile.Set("Real", "AccNeutralX", iAccNeutralX);
@ -422,17 +423,17 @@ void Config::Save()
iniFile.Set(SectionName, "TriggerType", WiiMoteEmu::WiiMapping[i].TriggerType);
}
iniFile.Save(FULL_CONFIG_DIR "Wiimote.ini");
iniFile.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "Wiimote.ini").c_str());
// Save the IR cursor settings if it's avaliable for the GameId, if not save the default settings
iniFile.Load(FULL_CONFIG_DIR "IR Pointer.ini");
iniFile.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "IR Pointer.ini").c_str());
char TmpSection[32];
sprintf(TmpSection, "%s", g_ISOId ? Hex2Ascii(g_ISOId).c_str() : "Default");
iniFile.Set(TmpSection, "IRLeft", iIRLeft);
iniFile.Set(TmpSection, "IRTop", iIRTop);
iniFile.Set(TmpSection, "IRWidth", iIRWidth);
iniFile.Set(TmpSection, "IRHeight", iIRHeight);
iniFile.Save(FULL_CONFIG_DIR "IR Pointer.ini");
iniFile.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "IR Pointer.ini").c_str());
//DEBUG_LOG(WIIMOTE, "Save()");
}

View File

@ -32,7 +32,7 @@ void WiimoteRecordingConfigDialog::LoadFile()
DEBUG_LOG(WIIMOTE, "LoadFile()");
IniFile file;
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "WiimoteMovement.ini").c_str());
for (int i = 1; i < (RECORDING_ROWS + 1); i++)
{
@ -75,7 +75,7 @@ void WiimoteRecordingConfigDialog::SaveFile()
DEBUG_LOG(WIIMOTE, "SaveFile");
IniFile file;
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "WiimoteMovement.ini").c_str());
for(int i = 1; i < (RECORDING_ROWS + 1); i++)
{
@ -107,7 +107,7 @@ void WiimoteRecordingConfigDialog::SaveFile()
file.Set(SaveName.c_str(), "PlaybackSpeed", m_RecordPlayBackSpeed[i]->GetSelection());
}
file.Save(FULL_CONFIG_DIR "WiimoteMovement.ini");
file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "WiimoteMovement.ini").c_str());
DEBUG_LOG(WIIMOTE, "SaveFile()");
}
@ -369,7 +369,7 @@ void WiimoteRecordingConfigDialog::CreateGUIControlsRecording()
void WiimoteRecordingConfigDialog::ConvertToString()
{
IniFile file;
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "WiimoteMovement.ini").c_str());
std::string TmpStr = "", TmpIR = "", TmpTime = "";
for (int i = 0; i < (int)m_vRecording.size(); i++)
@ -433,7 +433,7 @@ void WiimoteRecordingConfigDialog::ConvertToString()
m_RecordPlayBackSpeed[m_iRecordTo]->SetSelection(3);
}
file.Save(FULL_CONFIG_DIR "WiimoteMovement.ini");
file.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "WiimoteMovement.ini").c_str());
DEBUG_LOG(WIIMOTE, "Save recording to WiimoteMovement.ini");
}

View File

@ -93,7 +93,7 @@ void LoadRecordedMovements()
INFO_LOG(WIIMOTE, "LoadRecordedMovements()");
IniFile file;
file.Load(FULL_CONFIG_DIR "WiimoteMovement.ini");
file.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "WiimoteMovement.ini").c_str());
for(int i = 0; i < RECORDING_ROWS; i++)
{