ZeroSPU2: Fix saving options in the Windows version.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@649 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2009-01-28 11:17:38 +00:00 committed by Gregory Hainaut
parent c09f69f242
commit 4575351e36
1 changed files with 5 additions and 3 deletions

View File

@ -303,12 +303,12 @@ void SaveConfig()
if(!szTemp) return; if(!szTemp) return;
szTemp[0] = 0; // this modifies szInitFile also. szTemp[0] = 0; // this modifies szInitFile also.
strcat_s(szIniFile, "\\inis\\zerospu2.ini"); strcat_s(szIniFile, "\\inis\\zerospu2.ini");
sprintf_s(szValue,"%u",Conf1->Log); sprintf_s(szValue,"%u",Conf1->Log);
WritePrivateProfileString("Interface", "Logging",szValue,szIniFile); WritePrivateProfileString("Interface", "Logging",szValue,szIniFile);
sprintf_s(szValue,"%u",Conf1->options); sprintf_s(szValue,"%u",Conf1->options);
WritePrivateProfileString("Interface", "Options",szValue,szIniFile); WritePrivateProfileString("Interface", "Options",szValue,szIniFile);
} }
void LoadConfig() void LoadConfig()
@ -317,14 +317,16 @@ void LoadConfig()
Config *Conf1 = &conf; Config *Conf1 = &conf;
char *szTemp; char *szTemp;
char szIniFile[256], szValue[256]; char szIniFile[256], szValue[256];
int err;
GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256); GetModuleFileName(GetModuleHandle((LPCSTR)hInst), szIniFile, 256);
szTemp = strrchr(szIniFile, '\\'); szTemp = strrchr(szIniFile, '\\');
if(!szTemp) return ; if(!szTemp) return ;
szTemp[0] = 0; szTemp[0] = 0;
strcpy_s(szIniFile, "\\inis\\zerospu2.ini");
fopen_s(&fp, "inis\\zerospu2.ini","rt");//check if usbnull.ini really exists strcat_s(szIniFile, "\\inis\\zerospu2.ini");
fopen_s(&fp, "inis\\zerospu2.ini","rt");//check if zerospu2.ini really exists
if (!fp) if (!fp)
{ {
CreateDirectory("inis",NULL); CreateDirectory("inis",NULL);