added wrapper function for loading and saving all setup files
authorHolger Schemel <info@artsoft.org>
Wed, 29 Sep 2021 21:50:31 +0000 (23:50 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 29 Sep 2021 22:04:07 +0000 (00:04 +0200)
src/files.c
src/files.h
src/init.c

index d6c9b5733668fe966c88d957568c9c9516720ad0..4efaa553b090521489388493b5cf1a8b9e06bdd9 100644 (file)
@@ -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)
 {
index 6d01aa47511c448ffdd9ff2704dc8a9a25aa8469..eb8ddc526f0ef94155bbd652ff1c1409864fc121 100644 (file)
@@ -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 *);
index 6adf67db99c57c5a005bbe4185c52b1bfe68714c..4b8753ff6c7494a7aa20a2ee7b7b5ad550d6d955 100644 (file)
@@ -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