Revert "Win64: configurable username (username.txt) and persistent game setti…" (#234)
This reverts commit b8a7f816b5.
This commit is contained in:
@@ -760,43 +760,6 @@ bool CMinecraftApp::LoadBeaconMenu(int iPad ,shared_ptr<Inventory> inventory, sh
|
||||
//////////////////////////////////////////////
|
||||
// GAME SETTINGS
|
||||
//////////////////////////////////////////////
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
static void Win64_GetSettingsPath(char *outPath, DWORD size)
|
||||
{
|
||||
GetModuleFileNameA(NULL, outPath, size);
|
||||
char *lastSlash = strrchr(outPath, '\\');
|
||||
if (lastSlash) *(lastSlash + 1) = '\0';
|
||||
strncat_s(outPath, size, "settings.dat", _TRUNCATE);
|
||||
}
|
||||
static void Win64_SaveSettings(GAME_SETTINGS *gs)
|
||||
{
|
||||
if (!gs) return;
|
||||
char filePath[MAX_PATH] = {};
|
||||
Win64_GetSettingsPath(filePath, MAX_PATH);
|
||||
FILE *f = NULL;
|
||||
if (fopen_s(&f, filePath, "wb") == 0 && f)
|
||||
{
|
||||
fwrite(gs, sizeof(GAME_SETTINGS), 1, f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
static void Win64_LoadSettings(GAME_SETTINGS *gs)
|
||||
{
|
||||
if (!gs) return;
|
||||
char filePath[MAX_PATH] = {};
|
||||
Win64_GetSettingsPath(filePath, MAX_PATH);
|
||||
FILE *f = NULL;
|
||||
if (fopen_s(&f, filePath, "rb") == 0 && f)
|
||||
{
|
||||
GAME_SETTINGS temp = {};
|
||||
if (fread(&temp, sizeof(GAME_SETTINGS), 1, f) == 1)
|
||||
memcpy(gs, &temp, sizeof(GAME_SETTINGS));
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void CMinecraftApp::InitGameSettings()
|
||||
{
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
@@ -817,8 +780,6 @@ void CMinecraftApp::InitGameSettings()
|
||||
// clear this for now - it will come from reading the system values
|
||||
memset(pProfileSettings,0,sizeof(C_4JProfile::PROFILESETTINGS));
|
||||
SetDefaultOptions(pProfileSettings,i);
|
||||
Win64_LoadSettings(GameSettingsA[i]);
|
||||
ApplyGameSettingsChanged(i);
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__
|
||||
C4JStorage::PROFILESETTINGS *pProfileSettings=StorageManager.GetDashboardProfileSettings(i);
|
||||
// 4J-PB - don't cause an options write to happen here
|
||||
@@ -2411,9 +2372,6 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa
|
||||
StorageManager.WriteToProfile(i,true, bOverride5MinuteTimer);
|
||||
#else
|
||||
ProfileManager.WriteToProfile(i,true, bOverride5MinuteTimer);
|
||||
#ifdef _WINDOWS64
|
||||
Win64_SaveSettings(GameSettingsA[i]);
|
||||
#endif
|
||||
#endif
|
||||
GameSettingsA[i]->bSettingsChanged=false;
|
||||
}
|
||||
@@ -2427,9 +2385,6 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa
|
||||
StorageManager.WriteToProfile(iPad,true, bOverride5MinuteTimer);
|
||||
#else
|
||||
ProfileManager.WriteToProfile(iPad,true, bOverride5MinuteTimer);
|
||||
#ifdef _WINDOWS64
|
||||
Win64_SaveSettings(GameSettingsA[iPad]);
|
||||
#endif
|
||||
#endif
|
||||
GameSettingsA[iPad]->bSettingsChanged=false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user