summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/saveload.cpp1
-rw-r--r--src/saveload/saveload.h18
2 files changed, 19 insertions, 0 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 3d6f3c494..03c0cb8c8 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -267,6 +267,7 @@
extern const uint16 SAVEGAME_VERSION = 195; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading
+FileToSaveLoad _file_to_saveload; ///< File to save or load in the openttd loop.
uint32 _ttdp_version; ///< version of TTDP savegame (if applicable)
uint16 _sl_version; ///< the major savegame version identifier
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 72c51fa69..c4472237c 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -33,6 +33,22 @@ enum SaveOrLoadMode {
SL_LOAD_CHECK = 5, ///< Load for game preview.
};
+/** The different types of files that the system knows about. */
+enum FileType {
+ FT_NONE, ///< nothing to do
+ FT_SAVEGAME, ///< old or new savegame
+ FT_SCENARIO, ///< old or new scenario
+ FT_HEIGHTMAP, ///< heightmap file
+};
+
+/** Deals with the type of the savegame, independent of extension */
+struct FileToSaveLoad {
+ SaveOrLoadMode mode; ///< savegame/scenario type (old, new)
+ FileType filetype; ///< what type of file are we dealing with
+ char name[MAX_PATH]; ///< name
+ char title[255]; ///< internal name of the game
+};
+
/** Types of save games. */
enum SavegameType {
SGT_TTD, ///< TTD savegame (can be detected incorrectly)
@@ -43,6 +59,8 @@ enum SavegameType {
SGT_INVALID = 0xFF, ///< broken savegame (used internally)
};
+extern FileToSaveLoad _file_to_saveload;
+
void GenerateDefaultSaveName(char *buf, const char *last);
void SetSaveLoadError(uint16 str);
const char *GetSaveLoadErrorString();