From: Holger Schemel Date: Wed, 29 Sep 2021 21:50:31 +0000 (+0200) Subject: added wrapper function for loading and saving all setup files X-Git-Tag: 4.3.0.0~28 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=69c0ba1506ea3cdbb11e0190124229cf37e8b77a;p=rocksndiamonds.git added wrapper function for loading and saving all setup files --- diff --git a/src/files.c b/src/files.c index d6c9b573..4efaa553 100644 --- a/src/files.c +++ b/src/files.c @@ -10908,7 +10908,7 @@ static void setSetupInfoFromTokenInfo(SetupFileHash *setup_file_hash, token_info[token_nr].text); } -static void decodeSetupFileHash(SetupFileHash *setup_file_hash) +static void decodeSetupFileHash_Default(SetupFileHash *setup_file_hash) { int i, pnr; @@ -11064,7 +11064,7 @@ void LoadSetupFromFilename(char *filename) if (setup_file_hash) { - decodeSetupFileHash(setup_file_hash); + decodeSetupFileHash_Default(setup_file_hash); freeSetupFileHash(setup_file_hash); } @@ -11103,7 +11103,7 @@ static void LoadSetup_SpecialPostProcessing(void) } } -void LoadSetup(void) +void LoadSetup_Default(void) { char *filename; @@ -11164,6 +11164,13 @@ void LoadSetup_EditorCascade(void) free(filename); } +void LoadSetup(void) +{ + LoadSetup_Default(); + LoadSetup_AutoSetup(); + LoadSetup_EditorCascade(); +} + static void addGameControllerMappingToHash(SetupFileHash *mappings_hash, char *mapping_line) { @@ -11213,7 +11220,7 @@ static void LoadSetup_ReadGameControllerMappings(SetupFileHash *mappings_hash, fclose(file); } -void SaveSetup(void) +void SaveSetup_Default(void) { char *filename = getSetupFilename(); FILE *file; @@ -11374,6 +11381,13 @@ void SaveSetup_EditorCascade(void) free(filename); } +void SaveSetup(void) +{ + SaveSetup_Default(); + SaveSetup_AutoSetup(); + SaveSetup_EditorCascade(); +} + static void SaveSetup_WriteGameControllerMappings(SetupFileHash *mappings_hash, char *filename) { diff --git a/src/files.h b/src/files.h index 6d01aa47..eb8ddc52 100644 --- a/src/files.h +++ b/src/files.h @@ -76,8 +76,8 @@ void LoadLocalAndServerScore(int, boolean); void LoadUserNames(void); void LoadSetupFromFilename(char *); -void LoadSetup(void); -void SaveSetup(void); +void LoadSetup_Default(void); +void SaveSetup_Default(void); void LoadSetup_AutoSetup(void); void SaveSetup_AutoSetup(void); @@ -85,6 +85,9 @@ void SaveSetup_AutoSetup(void); void LoadSetup_EditorCascade(void); void SaveSetup_EditorCascade(void); +void LoadSetup(void); +void SaveSetup(void); + void SaveSetup_AddGameControllerMapping(char *); void setHideSetupEntry(void *); diff --git a/src/init.c b/src/init.c index 6adf67db..4b8753ff 100644 --- a/src/init.c +++ b/src/init.c @@ -5232,7 +5232,6 @@ static void InitSetup(void) LoadUserSetup(); // global user number LoadSetup(); // global setup info - LoadSetup_AutoSetup(); // global auto setup info // set some options from setup file