(svn r27650) -Codechange: Replace SaveOrLoadMode by FileOperation and DetailedFileType.
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user