@@ -760,6 +760,43 @@ bool CMinecraftApp::LoadBeaconMenu(int iPad ,shared_ptr<Inventory> inventory, sh
760760// ////////////////////////////////////////////
761761// GAME SETTINGS
762762// ////////////////////////////////////////////
763+
764+ #ifdef _WINDOWS64
765+ static void Win64_GetSettingsPath (char *outPath, DWORD size)
766+ {
767+ GetModuleFileNameA (NULL , outPath, size);
768+ char *lastSlash = strrchr (outPath, ' \\ ' );
769+ if (lastSlash) *(lastSlash + 1 ) = ' \0 ' ;
770+ strncat_s (outPath, size, " settings.dat" , _TRUNCATE);
771+ }
772+ static void Win64_SaveSettings (GAME_SETTINGS *gs)
773+ {
774+ if (!gs) return ;
775+ char filePath[MAX_PATH] = {};
776+ Win64_GetSettingsPath (filePath, MAX_PATH);
777+ FILE *f = NULL ;
778+ if (fopen_s (&f, filePath, " wb" ) == 0 && f)
779+ {
780+ fwrite (gs, sizeof (GAME_SETTINGS), 1 , f);
781+ fclose (f);
782+ }
783+ }
784+ static void Win64_LoadSettings (GAME_SETTINGS *gs)
785+ {
786+ if (!gs) return ;
787+ char filePath[MAX_PATH] = {};
788+ Win64_GetSettingsPath (filePath, MAX_PATH);
789+ FILE *f = NULL ;
790+ if (fopen_s (&f, filePath, " rb" ) == 0 && f)
791+ {
792+ GAME_SETTINGS temp = {};
793+ if (fread (&temp, sizeof (GAME_SETTINGS), 1 , f) == 1 )
794+ memcpy (gs, &temp, sizeof (GAME_SETTINGS));
795+ fclose (f);
796+ }
797+ }
798+ #endif
799+
763800void CMinecraftApp::InitGameSettings ()
764801{
765802 for (int i=0 ;i<XUSER_MAX_COUNT;i++)
@@ -780,6 +817,8 @@ void CMinecraftApp::InitGameSettings()
780817 // clear this for now - it will come from reading the system values
781818 memset (pProfileSettings,0 ,sizeof (C_4JProfile::PROFILESETTINGS));
782819 SetDefaultOptions (pProfileSettings,i);
820+ Win64_LoadSettings (GameSettingsA[i]);
821+ ApplyGameSettingsChanged (i);
783822#elif defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__
784823 C4JStorage::PROFILESETTINGS *pProfileSettings=StorageManager.GetDashboardProfileSettings (i);
785824 // 4J-PB - don't cause an options write to happen here
@@ -2372,6 +2411,9 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa
23722411 StorageManager.WriteToProfile (i,true , bOverride5MinuteTimer);
23732412#else
23742413 ProfileManager.WriteToProfile (i,true , bOverride5MinuteTimer);
2414+ #ifdef _WINDOWS64
2415+ Win64_SaveSettings (GameSettingsA[i]);
2416+ #endif
23752417#endif
23762418 GameSettingsA[i]->bSettingsChanged =false ;
23772419 }
@@ -2385,6 +2427,9 @@ void CMinecraftApp::CheckGameSettingsChanged(bool bOverride5MinuteTimer, int iPa
23852427 StorageManager.WriteToProfile (iPad,true , bOverride5MinuteTimer);
23862428#else
23872429 ProfileManager.WriteToProfile (iPad,true , bOverride5MinuteTimer);
2430+ #ifdef _WINDOWS64
2431+ Win64_SaveSettings (GameSettingsA[iPad]);
2432+ #endif
23882433#endif
23892434 GameSettingsA[iPad]->bSettingsChanged =false ;
23902435 }
0 commit comments