aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/resource.cpp
diff options
context:
space:
mode:
authorMax Horn2006-02-26 21:59:44 +0000
committerMax Horn2006-02-26 21:59:44 +0000
commit52970c9936f82c727eecbd8e64a8a162e3ca4ec2 (patch)
tree727f677c337369f698487570075a707204464aa6 /engines/scumm/resource.cpp
parent90c916de4be8aa44226d826ad3d40f8a0c0e3e3e (diff)
downloadscummvm-rg350-52970c9936f82c727eecbd8e64a8a162e3ca4ec2.tar.gz
scummvm-rg350-52970c9936f82c727eecbd8e64a8a162e3ca4ec2.tar.bz2
scummvm-rg350-52970c9936f82c727eecbd8e64a8a162e3ca4ec2.zip
Cleanup
svn-id: r20949
Diffstat (limited to 'engines/scumm/resource.cpp')
-rw-r--r--engines/scumm/resource.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp
index cd51174170..e1ebbc9746 100644
--- a/engines/scumm/resource.cpp
+++ b/engines/scumm/resource.cpp
@@ -63,7 +63,6 @@ static bool checkTryMedia(BaseScummFile *handle);
/* Open a room */
void ScummEngine::openRoom(const int room) {
- int room_offs;
bool result;
char buf[128];
char buf2[128] = "";
@@ -85,18 +84,16 @@ void ScummEngine::openRoom(const int room) {
}
const int diskNumber = (room == 0 ? 0 : res.roomno[rtRoom][room]);
+ const int room_offs = room ? res.roomoffs[rtRoom][room] : 0;
- /* Either xxx.lfl or monkey.xxx file name */
- while (1) {
- room_offs = room ? res.roomoffs[rtRoom][room] : 0;
-
- if (room_offs == -1)
- break;
+ while (room_offs != -1) {
if (room_offs != 0 && room != 0 && _game.heversion < 98) {
_fileOffset = res.roomoffs[rtRoom][room];
return;
}
+
+ /* Either xxx.lfl or monkey.xxx file name */
if (_game.version <= 3) {
sprintf(buf, "%.2d.lfl", room);
// Maniac Mansion demo has .man instead of .lfl
@@ -164,8 +161,10 @@ void ScummEngine::openRoom(const int room) {
}
}
+ // Try to open the file with name 'buf'. If that fails, try buf2 (if
+ // specified).
result = openResourceFile(buf, encByte);
- if ((result == false) && (buf2[0])) {
+ if (!result && buf2[0]) {
result = openResourceFile(buf2, encByte);
// We have .man files so set demo mode
if (_game.id == GID_MANIAC)