aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v100he.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-04-14 06:06:59 +0000
committerTravis Howell2005-04-14 06:06:59 +0000
commita3882f3af779c5b5726b24734fc74a702f199be4 (patch)
treedd6fe0e6a03f4a8e55201aa2aeb9e2592ac9d4e0 /scumm/script_v100he.cpp
parent50bf840b9fad86724863e0c323fc3e0d873e9acb (diff)
downloadscummvm-rg350-a3882f3af779c5b5726b24734fc74a702f199be4.tar.gz
scummvm-rg350-a3882f3af779c5b5726b24734fc74a702f199be4.tar.bz2
scummvm-rg350-a3882f3af779c5b5726b24734fc74a702f199be4.zip
Add HE7.2 difference in o_getResourceSize().
Add support for checking size of music resource. svn-id: r17595
Diffstat (limited to 'scumm/script_v100he.cpp')
-rw-r--r--scumm/script_v100he.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp
index c76d859354..b6e6a93bd3 100644
--- a/scumm/script_v100he.cpp
+++ b/scumm/script_v100he.cpp
@@ -2191,9 +2191,9 @@ void ScummEngine_v100he::o100_writeFile() {
}
void ScummEngine_v100he::o100_getResourceSize() {
- int size = 0, type;
+ int size, type;
- int idx = pop();
+ int resid = pop();
byte subOp = fetchScriptByte();
switch (subOp) {
@@ -2210,9 +2210,8 @@ void ScummEngine_v100he::o100_getResourceSize() {
type = rtScript;
break;
case 72:
- if (idx > _numSounds) {
- // TODO Music resource size
- push(100);
+ if (resid > _numSounds) {
+ push(getMusicResourceSize(resid));
return;
}
type = rtSound;
@@ -2221,9 +2220,9 @@ void ScummEngine_v100he::o100_getResourceSize() {
error("o100_getResourceSize: default type %d", subOp);
}
- const byte *ptr = getResourceAddress(type, idx);
- if (ptr)
- size = READ_BE_UINT32(ptr + 4) - 8;
+ const byte *ptr = getResourceAddress(type, resid);
+ assert(ptr);
+ size = READ_BE_UINT32(ptr + 4) - 8;
push(size);
}