diff options
author | Paul Gilbert | 2016-03-16 21:01:01 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-16 21:01:01 -0400 |
commit | 6be64df2f0c0bf50e551187c2ba989d756f2dd36 (patch) | |
tree | 0d5286ac9a8e50b34fa25a3f4bb6eb9fcf53af9f /engines/titanic/string.cpp | |
parent | 8ec499c177d88e11930b8550c47c352d65dc603a (diff) | |
download | scummvm-rg350-6be64df2f0c0bf50e551187c2ba989d756f2dd36.tar.gz scummvm-rg350-6be64df2f0c0bf50e551187c2ba989d756f2dd36.tar.bz2 scummvm-rg350-6be64df2f0c0bf50e551187c2ba989d756f2dd36.zip |
TITANIC: Implemented overall surface loading method
Diffstat (limited to 'engines/titanic/string.cpp')
-rw-r--r-- | engines/titanic/string.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp index c1afb4ff52..dbe0617f06 100644 --- a/engines/titanic/string.cpp +++ b/engines/titanic/string.cpp @@ -56,4 +56,42 @@ int CString::lastIndexOf(char c) { return charP ? charP - c_str() : -1; } +FileType CString::fileTypeSuffix() const { + CString ext = right(1); + if (ext == "0" || ext == "4") + return FILETYPE_IMAGE; + else if (ext == "1") + return FILETYPE_WAV; + else if (ext == "2" || ext == "3") + return FILETYPE_MOVIE; + + ext = right(3); + if (ext == "tga" || ext == "jpg") + return FILETYPE_IMAGE; + else if (ext == "wav") + return FILETYPE_WAV; + else if (ext == "avi" || ext == "mov") + return FILETYPE_MOVIE; + else if (ext == "dlg") + return FILETYPE_DLG; + else + return FILETYPE_UNKNOWN; +} + +ImageType CString::imageTypeSuffix() const { + CString ext = right(1); + if (ext == "0") + return IMAGETYPE_TARGA; + else if (ext == "4") + return IMAGETYPE_JPEG; + + ext = right(3); + if (ext == "tga") + return IMAGETYPE_TARGA; + else if (ext == "jpg") + return IMAGETYPE_JPEG; + else + return IMAGETYPE_UNKNOWN; +} + } // End of namespace Titanic |