aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2003-04-29 03:32:08 +0000
committerJonathan Gray2003-04-29 03:32:08 +0000
commita8f140e7d884bc8f0f4319c87b2dba5aebd05780 (patch)
treef6035bff732ea47216280be5e22510b11df22945
parent89c425dc609f1f1042883e2b302d5aebcd1e7374 (diff)
downloadscummvm-rg350-a8f140e7d884bc8f0f4319c87b2dba5aebd05780.tar.gz
scummvm-rg350-a8f140e7d884bc8f0f4319c87b2dba5aebd05780.tar.bz2
scummvm-rg350-a8f140e7d884bc8f0f4319c87b2dba5aebd05780.zip
make all known file extensions of resource files work
svn-id: r7190
-rw-r--r--scumm/resource.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index c2726b74b7..657b1cc34f 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -36,7 +36,9 @@ uint16 newTag2Old(uint32 oldTag);
/* Open a room */
void Scumm::openRoom(int room) {
int room_offs, roomlimit;
- char buf[256];
+ bool result;
+ char buf[128];
+ char buf2[128] = "";
debug(9, "openRoom(%d)", room);
assert(room >= 0);
@@ -78,10 +80,14 @@ void Scumm::openRoom(int room) {
if (room > 0)
_vars[VAR_CURRENTDISK] = res.roomno[rtRoom][room];
sprintf(buf, "%s.la%d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
+ sprintf(buf2, "%s.%.3d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
} else if (_features & GF_HUMONGOUS)
sprintf(buf, "%s.he%.1d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
- else
+ else {
sprintf(buf, "%s.%.3d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
+ if (_gameId == GID_SAMNMAX)
+ sprintf(buf2, "%s.sm%.1d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
+ }
_encbyte = (_features & GF_USE_KEY) ? 0x69 : 0;
} else if (!(_features & GF_SMALL_NAMES)) {
@@ -102,7 +108,11 @@ void Scumm::openRoom(int room) {
_encbyte = (_features & GF_USE_KEY) ? 0xFF : 0;
}
- if (openResourceFile(buf)) {
+ result = openResourceFile(buf);
+ if ((result == false) && (buf2[0]))
+ result = openResourceFile(buf2);
+
+ if (result) {
if (room == 0)
return;
if (_features & GF_EXTERNAL_CHARSET && room >= roomlimit)