src/fios.h
branchnoai
changeset 9723 eee46cb39750
parent 9722 ebf0ece7d8f6
child 9724 b39bc69bb2f2
equal deleted inserted replaced
9722:ebf0ece7d8f6 9723:eee46cb39750
    21 	LAST_GRF_SLOT  = 63,
    21 	LAST_GRF_SLOT  = 63,
    22 	/** Maximum number of slots. */
    22 	/** Maximum number of slots. */
    23 	MAX_FILE_SLOTS = 64
    23 	MAX_FILE_SLOTS = 64
    24 };
    24 };
    25 
    25 
    26 /* Deals with finding savegames */
    26 enum SaveLoadDialogMode{
    27 struct FiosItem {
    27 	SLD_LOAD_GAME,
    28 	byte type;
    28 	SLD_LOAD_SCENARIO,
    29 	uint64 mtime;
    29 	SLD_SAVE_GAME,
    30 	char title[64];
    30 	SLD_SAVE_SCENARIO,
    31 	char name[256 - 12 - 64];
    31 	SLD_LOAD_HEIGHTMAP,
       
    32 	SLD_NEW_GAME,
       
    33 };
       
    34 
       
    35 /* The different types of files been handled by the system */
       
    36 enum FileType {
       
    37 	FT_NONE,      ///< nothing to do
       
    38 	FT_SAVEGAME,  ///< old or new savegame
       
    39 	FT_SCENARIO,  ///< old or new scenario
       
    40 	FT_HEIGHTMAP, ///< heightmap file
    32 };
    41 };
    33 
    42 
    34 enum {
    43 enum {
    35 	FIOS_TYPE_DRIVE        =   0,
    44 	FIOS_TYPE_DRIVE        =   0,
    36 	FIOS_TYPE_PARENT       =   1,
    45 	FIOS_TYPE_PARENT       =   1,
    43 	FIOS_TYPE_PNG          =   8,
    52 	FIOS_TYPE_PNG          =   8,
    44 	FIOS_TYPE_BMP          =   9,
    53 	FIOS_TYPE_BMP          =   9,
    45 	FIOS_TYPE_INVALID      = 255,
    54 	FIOS_TYPE_INVALID      = 255,
    46 };
    55 };
    47 
    56 
       
    57 /* Deals with finding savegames */
       
    58 struct FiosItem {
       
    59 	byte type;
       
    60 	uint64 mtime;
       
    61 	char title[64];
       
    62 	char name[256 - 12 - 64];
       
    63 };
       
    64 
       
    65 /* Deals with the type of the savegame, independent of extension */
       
    66 struct SmallFiosItem {
       
    67 	int mode;             ///< savegame/scenario type (old, new)
       
    68 	FileType filetype;    ///< what type of file are we dealing with
       
    69 	char name[MAX_PATH];  ///< name
       
    70 	char title[255];      ///< internal name of the game
       
    71 };
       
    72 
    48 /* Variables to display file lists */
    73 /* Variables to display file lists */
    49 extern FiosItem *_fios_list; ///< defined in misc_gui.cpp
    74 extern FiosItem *_fios_list; ///< defined in misc_gui.cpp
    50 extern int _fios_num;        ///< defined in fios.cpp, read_only version of _fios_count
    75 extern int _fios_num;        ///< defined in fios.cpp, read_only version of _fios_count
    51 extern int _saveload_mode;   ///< defined in misc_gui.cpp
    76 extern SmallFiosItem _file_to_saveload;
       
    77 extern SaveLoadDialogMode _saveload_mode;   ///< defined in misc_gui.cpp
       
    78 
       
    79 /* Launch save/load dialog */
       
    80 void ShowSaveLoadDialog(SaveLoadDialogMode mode);
    52 
    81 
    53 /* Get a list of savegames */
    82 /* Get a list of savegames */
    54 FiosItem *FiosGetSavegameList(int mode);
    83 FiosItem *FiosGetSavegameList(int mode);
    55 /* Get a list of scenarios */
    84 /* Get a list of scenarios */
    56 FiosItem *FiosGetScenarioList(int mode);
    85 FiosItem *FiosGetScenarioList(int mode);