aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-04-05 13:43:54 +0200
committerMax Horn2011-04-05 15:18:08 +0200
commit55e65cee8099d91ae4797f7772cb5e459089892a (patch)
treef04db2406cc7441027ee10d08c488cce62fd36de
parenta12dada82249cb713e2a9162b26ad3207127726c (diff)
downloadscummvm-rg350-55e65cee8099d91ae4797f7772cb5e459089892a.tar.gz
scummvm-rg350-55e65cee8099d91ae4797f7772cb5e459089892a.tar.bz2
scummvm-rg350-55e65cee8099d91ae4797f7772cb5e459089892a.zip
SCUMM: Cleanup
-rw-r--r--engines/scumm/script.cpp22
-rw-r--r--engines/scumm/sound.cpp9
2 files changed, 12 insertions, 19 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index c481fb8a4e..c6c1f5f58f 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -261,8 +261,7 @@ void ScummEngine::stopScript(int script) {
/* Stop an object script 'script'*/
void ScummEngine::stopObjectScript(int script) {
ScriptSlot *ss;
- NestedScript *nest;
- int i, num;
+ int i;
if (script == 0)
return;
@@ -282,19 +281,14 @@ void ScummEngine::stopObjectScript(int script) {
}
}
- nest = vm.nest;
- num = vm.numNestedScripts;
-
- while (num > 0) {
- if (nest->number == script &&
- (nest->where == WIO_ROOM || nest->where == WIO_INVENTORY || nest->where == WIO_FLOBJECT)) {
- nukeArrays(nest->slot);
- nest->number = 0xFF;
- nest->slot = 0xFF;
- nest->where = 0xFF;
+ for (i = 0; i < vm.numNestedScripts; ++i) {
+ if (vm.nest[i].number == script &&
+ (vm.nest[i].where == WIO_ROOM || vm.nest[i].where == WIO_INVENTORY || vm.nest[i].where == WIO_FLOBJECT)) {
+ nukeArrays(vm.nest[i].slot);
+ vm.nest[i].number = 0xFF;
+ vm.nest[i].slot = 0xFF;
+ vm.nest[i].where = 0xFF;
}
- nest++;
- num--;
}
}
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index cff1618c18..0051319151 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -195,8 +195,7 @@ void Sound::playSound(int soundID) {
return;
}
- debugC(DEBUG_SOUND, "playSound #%d (room %d)", soundID,
- _vm->getResourceRoomNr(rtSound, soundID));
+ debugC(DEBUG_SOUND, "playSound #%d", soundID);
ptr = _vm->getResourceAddress(rtSound, soundID);
@@ -1223,7 +1222,7 @@ int ScummEngine::readSoundResource(int idx) {
if (!dmuFile.open(buffer)) {
error("Can't open music file %s", buffer);
- _res->roomoffs[rtSound][idx] = (uint32)RES_INVALID_OFFSET;
+ _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET;
return 0;
}
dmuFile.seek(4, SEEK_SET);
@@ -1247,7 +1246,7 @@ int ScummEngine::readSoundResource(int idx) {
}
error("Unrecognized base tag 0x%08x in sound %d", basetag, idx);
}
- _res->roomoffs[rtSound][idx] = (uint32)RES_INVALID_OFFSET;
+ _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET;
return 0;
}
@@ -2122,7 +2121,7 @@ int ScummEngine::readSoundResourceSmallHeader(int idx) {
_fileHandle->read(_res->createResource(rtSound, idx, ro_size - 4), ro_size - 4);
return 1;
}
- _res->roomoffs[rtSound][idx] = (uint32)RES_INVALID_OFFSET;
+ _res->roomoffs[rtSound][idx] = RES_INVALID_OFFSET;
return 0;
}