diff options
author | alberth <alberth@openttd.org> | 2016-09-04 12:47:07 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2016-09-04 12:47:07 +0000 |
commit | 2fa0fdb1768f45ffaf4fe14fbdbdb73d501d6c36 (patch) | |
tree | ffe7234137f524ab7c0ebf484c9d383e56311333 /src/saveload/saveload.cpp | |
parent | 3b8ede5ebe74bafba528f0bf40942c1367cbcaee (diff) | |
download | openttd-2fa0fdb1768f45ffaf4fe14fbdbdb73d501d6c36.tar.xz |
(svn r27638) -Codechange: Move FiosType enum, move and rename SetFiosType function.
Diffstat (limited to 'src/saveload/saveload.cpp')
-rw-r--r-- | src/saveload/saveload.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 03c0cb8c8..007b22f01 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -2892,6 +2892,39 @@ void GenerateDefaultSaveName(char *buf, const char *last) SanitizeFilename(buf); } +/** + * Set the mode of the file to save or load based on the type of file entry at the file system. + * @param ft Type of file entry of the file system. + */ +void FileToSaveLoad::SetMode(FiosType ft) +{ + switch (ft) { + case FIOS_TYPE_FILE: + case FIOS_TYPE_SCENARIO: + this->mode = SL_LOAD; + break; + + case FIOS_TYPE_OLDFILE: + case FIOS_TYPE_OLD_SCENARIO: + this->mode = SL_OLD_LOAD; + break; + +#ifdef WITH_PNG + case FIOS_TYPE_PNG: + this->mode = SL_PNG; + break; +#endif /* WITH_PNG */ + + case FIOS_TYPE_BMP: + this->mode = SL_BMP; + break; + + default: + this->mode = SL_INVALID; + break; + } +} + #if 0 /** * Function to get the type of the savegame by looking at the file header. |