summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2016-09-04 12:45:40 +0000
committeralberth <alberth@openttd.org>2016-09-04 12:45:40 +0000
commit9135f7130ec5d542ec5187d10eb41920ade4d0c2 (patch)
tree4d3162b3bb4e470757f20a1d1e2470243356a21c
parentd6812947f3b793302dc1ad42a07767ab831e66e3 (diff)
downloadopenttd-9135f7130ec5d542ec5187d10eb41920ade4d0c2.tar.xz
(svn r27635) -Codechange: Move FileType and FileToSaveLoad structure definitions.
-rw-r--r--src/fios.cpp1
-rw-r--r--src/fios.h17
-rw-r--r--src/genworld_gui.cpp1
-rw-r--r--src/landscape.cpp1
-rw-r--r--src/saveload/saveload.cpp1
-rw-r--r--src/saveload/saveload.h18
6 files changed, 21 insertions, 18 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index 6ba913c09..631c88bf6 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -32,7 +32,6 @@
SmallVector<FiosItem, 32> _fios_items;
static char *_fios_path;
static const char *_fios_path_last;
-FileToSaveLoad _file_to_saveload; ///< File to save or load in the openttd loop.
SortingBits _savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING;
/* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
diff --git a/src/fios.h b/src/fios.h
index f25d5a7e2..6ef7783b6 100644
--- a/src/fios.h
+++ b/src/fios.h
@@ -107,14 +107,6 @@ enum SaveLoadDialogMode {
SLD_SAVE_HEIGHTMAP, ///< Save a heightmap.
};
-/** 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
-};
-
enum FiosType {
FIOS_TYPE_DRIVE,
FIOS_TYPE_PARENT,
@@ -137,14 +129,6 @@ struct FiosItem {
char name[MAX_PATH];
};
-/** Deals with the type of the savegame, independent of extension */
-struct FileToSaveLoad {
- int 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
-};
-
enum SortingBits {
SORT_ASCENDING = 0,
SORT_DESCENDING = 1,
@@ -155,7 +139,6 @@ DECLARE_ENUM_AS_BIT_SET(SortingBits)
/* Variables to display file lists */
extern SmallVector<FiosItem, 32> _fios_items;
-extern FileToSaveLoad _file_to_saveload;
extern SaveLoadDialogMode _saveload_mode;
extern SortingBits _savegame_sort_order;
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 741fd75d1..61e114311 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -26,6 +26,7 @@
#include "town.h"
#include "core/geometry_func.hpp"
#include "core/random_func.hpp"
+#include "saveload/saveload.h"
#include "progress.h"
#include "error.h"
diff --git a/src/landscape.cpp b/src/landscape.cpp
index d1c73fd42..d2b1b98cd 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -31,6 +31,7 @@
#include "object_base.h"
#include "company_func.h"
#include "pathfinder/npf/aystar.h"
+#include "saveload/saveload.h"
#include <list>
#include <set>
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();