fios.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef FIOS_H
00013 #define FIOS_H
00014
00015 #include "strings_type.h"
00016 #include "core/smallvec_type.hpp"
00017
00018 enum {
00025 CONFIG_SLOT = 0,
00027 SOUND_SLOT = 1,
00029 FIRST_GRF_SLOT = 2,
00031 LAST_GRF_SLOT = 63,
00033 MAX_FILE_SLOTS = 64
00034 };
00035
00036 enum SaveLoadDialogMode{
00037 SLD_LOAD_GAME,
00038 SLD_LOAD_SCENARIO,
00039 SLD_SAVE_GAME,
00040 SLD_SAVE_SCENARIO,
00041 SLD_LOAD_HEIGHTMAP,
00042 SLD_NEW_GAME,
00043 };
00044
00045
00046 enum FileType {
00047 FT_NONE,
00048 FT_SAVEGAME,
00049 FT_SCENARIO,
00050 FT_HEIGHTMAP,
00051 };
00052
00053 enum FiosType {
00054 FIOS_TYPE_DRIVE,
00055 FIOS_TYPE_PARENT,
00056 FIOS_TYPE_DIR,
00057 FIOS_TYPE_FILE,
00058 FIOS_TYPE_OLDFILE,
00059 FIOS_TYPE_SCENARIO,
00060 FIOS_TYPE_OLD_SCENARIO,
00061 FIOS_TYPE_DIRECT,
00062 FIOS_TYPE_PNG,
00063 FIOS_TYPE_BMP,
00064 FIOS_TYPE_INVALID = 255,
00065 };
00066
00067
00068 struct FiosItem {
00069 FiosType type;
00070 uint64 mtime;
00071 char title[64];
00072 char name[MAX_PATH];
00073 };
00074
00075
00076 struct SmallFiosItem {
00077 int mode;
00078 FileType filetype;
00079 char name[MAX_PATH];
00080 char title[255];
00081 };
00082
00083 enum {
00084 SORT_ASCENDING = 0,
00085 SORT_DESCENDING = 1,
00086 SORT_BY_DATE = 0,
00087 SORT_BY_NAME = 2
00088 };
00089
00090
00091 extern SmallVector<FiosItem, 32> _fios_items;
00092 extern SmallFiosItem _file_to_saveload;
00093 extern SaveLoadDialogMode _saveload_mode;
00094 extern byte _savegame_sort_order;
00095
00096
00097 void ShowSaveLoadDialog(SaveLoadDialogMode mode);
00098
00099
00100 void FiosGetSavegameList(SaveLoadDialogMode mode);
00101
00102 void FiosGetScenarioList(SaveLoadDialogMode mode);
00103
00104 void FiosGetHeightmapList(SaveLoadDialogMode mode);
00105
00106 void FiosFreeSavegameList();
00107
00108 const char *FiosBrowseTo(const FiosItem *item);
00109
00110 StringID FiosGetDescText(const char **path, uint64 *total_free);
00111
00112 bool FiosDelete(const char *name);
00113
00114 void FiosMakeSavegameName(char *buf, const char *name, size_t size);
00115
00116 FiosType FiosGetSavegameListCallback(SaveLoadDialogMode mode, const char *file, const char *ext, char *title, const char *last);
00117
00118 int CDECL CompareFiosItems(const FiosItem *a, const FiosItem *b);
00119
00120 #endif