summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2016-09-04 12:57:20 +0000
committeralberth <alberth@openttd.org>2016-09-04 12:57:20 +0000
commitdf9a9f074a55a839a5f311e5c0837342192e720d (patch)
tree3cf68517d98ae01eea8e74db9569b6e09b8905cb /src/saveload
parent88bdf482c0dc96661e3c8e89df44dcacea0199d7 (diff)
downloadopenttd-df9a9f074a55a839a5f311e5c0837342192e720d.tar.xz
(svn r27649) -Codechange: Introduce detailed file type enum, rebuild FiosType with it.
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/saveload.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index a0d15938a..b5fdda27a 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -2924,30 +2924,8 @@ void FileToSaveLoad::SetMode(FiosType ft)
break;
}
- switch (ft) {
- case FIOS_TYPE_OLDFILE:
- case FIOS_TYPE_FILE:
- this->filetype = FT_SAVEGAME;
- break;
-
- case FIOS_TYPE_OLD_SCENARIO:
- case FIOS_TYPE_SCENARIO:
- this->filetype = FT_SCENARIO;
- break;
-
-#ifdef WITH_PNG
- case FIOS_TYPE_PNG:
- /* FALL THROUGH */
-#endif /* WITH_PNG */
-
- case FIOS_TYPE_BMP:
- this->filetype = FT_HEIGHTMAP;
- break;
-
- default:
- this->filetype = FT_INVALID;
- break;
- }
+ this->filetype = GetAbstractFileType(ft);
+ if (this->filetype == FT_NONE) this->filetype = FT_INVALID;
}
#if 0