diff options
Diffstat (limited to 'engines/mads/resources.cpp')
-rw-r--r-- | engines/mads/resources.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/engines/mads/resources.cpp b/engines/mads/resources.cpp index 8cfc1a290a..5e490c2719 100644 --- a/engines/mads/resources.cpp +++ b/engines/mads/resources.cpp @@ -303,6 +303,47 @@ Common::String Resources::formatName(RESPREFIX resType, int id, const Common::St return result; } +Common::String Resources::formatName(int prefix, char asciiCh, int id, EXTTYPE extType, + const Common::String &suffix) { + Common::String result; + if (prefix <= 0) { + result = "*"; + } + else { + result = Common::String::format("%s%.3d", + (prefix < 100) ? "*SC" : "*RM", prefix); + } + + result += Common::String::format("%c%d", asciiCh, id); + if (!suffix.empty()) + result += suffix; + + switch (extType) { + case EXT_SS: + result += ".SS"; + break; + case EXT_AA: + result += ".AA"; + break; + case EXT_DAT: + result += ".DAT"; + break; + case EXT_HH: + result += ".HH"; + break; + case EXT_ART: + result += ".ART"; + break; + case EXT_INT: + result += ".INT"; + break; + default: + break; + } + + return result; +} + Common::String Resources::formatResource(const Common::String &resName, const Common::String &hagFilename) { // int v1 = 0, v2 = 0; @@ -316,6 +357,10 @@ Common::String Resources::formatResource(const Common::String &resName, } } +Common::String Resources::formatAAName(int idx) { + return formatName(0, 'I', idx, EXT_AA, ""); +} + /*------------------------------------------------------------------------*/ void File::openFile(const Common::String &filename) { |