diff options
Diffstat (limited to 'engines/m4/resource.cpp')
-rw-r--r-- | engines/m4/resource.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/engines/m4/resource.cpp b/engines/m4/resource.cpp index a1c5290afa..eee1214e7f 100644 --- a/engines/m4/resource.cpp +++ b/engines/m4/resource.cpp @@ -369,6 +369,34 @@ const char *MADSResourceManager::getResourceName(char asciiCh, int prefix, Exten } /** + * Another variation for forming resource names + */ +const char *MADSResourceManager::getResourceName(ResourcePrefixType prefixType, int idx, const char *extension) { + static char resourceName[100]; + + strcpy(resourceName, "*"); + + if (extension) { + switch (prefixType) { + case RESPREFIX_GL: + strcat(resourceName, "GL000"); + break; + case RESPREFIX_SC: + case RESPREFIX_RM: + strcat(resourceName, (prefixType == RESPREFIX_SC) ? "SC" : "RM"); + sprintf(resourceName + 3, "%.3d", idx); + break; + default: + break; + } + + strcat(resourceName, extension); + } + + return &resourceName[0]; +} + +/** * Forms an AA resource name based on the given passed index */ const char *MADSResourceManager::getAAName(int index) { |