summaryrefslogtreecommitdiff
path: root/src/saveload/saveload.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/saveload.h')
-rw-r--r--src/saveload/saveload.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 43b9d5d3c..7b0ae8f48 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -22,25 +22,16 @@ enum SaveOrLoadResult {
SL_REINIT = 2, ///< error that was caught in the middle of updating game state, need to clear it. (can only happen during load)
};
-/** Save or load mode. @see SaveOrLoad */
-enum SaveOrLoadMode {
- SL_INVALID = -1, ///< Invalid mode.
- SL_LOAD = 0, ///< Load game.
- SL_SAVE = 1, ///< Save game.
- SL_OLD_LOAD = 2, ///< Load old game.
- SL_PNG = 3, ///< Load PNG file (height map).
- SL_BMP = 4, ///< Load BMP file (height map).
- SL_LOAD_CHECK = 5, ///< Load for game preview.
-};
-
/** Deals with the type of the savegame, independent of extension */
struct FileToSaveLoad {
- SaveOrLoadMode mode; ///< savegame/scenario type (old, new)
- AbstractFileType filetype; ///< what type of file are we dealing with
- char name[MAX_PATH]; ///< name
- char title[255]; ///< internal name of the game
+ FileOperation file_op; ///< File operation to perform.
+ DetailedFileType detail_ftype; ///< Concrete file type (PNG, BMP, old save, etc).
+ AbstractFileType abstract_ftype; ///< Abstract type of file (scenario, heightmap, etc).
+ char name[MAX_PATH]; ///< Name of the file.
+ char title[255]; ///< Internal name of the game.
void SetMode(FiosType ft);
+ void SetMode(FileOperation fop, AbstractFileType aft, DetailedFileType dft);
};
/** Types of save games. */
@@ -58,7 +49,7 @@ extern FileToSaveLoad _file_to_saveload;
void GenerateDefaultSaveName(char *buf, const char *last);
void SetSaveLoadError(uint16 str);
const char *GetSaveLoadErrorString();
-SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, bool threaded = true);
+SaveOrLoadResult SaveOrLoad(const char *filename, FileOperation fop, DetailedFileType dft, Subdirectory sb, bool threaded = true);
void WaitTillSaved();
void ProcessAsyncSaveFinish();
void DoExitSave();