aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v80he.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-04-18 11:19:54 +0000
committerTravis Howell2005-04-18 11:19:54 +0000
commit8d01148b797f66af457434284b3a41bd18b86098 (patch)
tree206d028858ad6938e444a1cf1bcea8f6a69f2201 /scumm/script_v80he.cpp
parent769b2fed4625828e7572f96d95727f79ad34f79e (diff)
downloadscummvm-rg350-8d01148b797f66af457434284b3a41bd18b86098.tar.gz
scummvm-rg350-8d01148b797f66af457434284b3a41bd18b86098.tar.bz2
scummvm-rg350-8d01148b797f66af457434284b3a41bd18b86098.zip
Sound size should only include sound data.
svn-id: r17667
Diffstat (limited to 'scumm/script_v80he.cpp')
-rw-r--r--scumm/script_v80he.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp
index 875d900091..8e523d90dc 100644
--- a/scumm/script_v80he.cpp
+++ b/scumm/script_v80he.cpp
@@ -806,6 +806,7 @@ void ScummEngine_v80he::o80_pickVarRandom() {
}
void ScummEngine_v80he::o80_getResourceSize() {
+ const byte *ptr;
int size, type;
int resid = pop();
@@ -817,10 +818,13 @@ void ScummEngine_v80he::o80_getResourceSize() {
int offs;
_sound->getHEMusicDetails(resid, offs, size);
push(size);
- return;
+ } else {
+ ptr = getResourceAddress(rtSound, resid);
+ assert(ptr);
+ size = READ_BE_UINT32(ptr + 4) - 40;
+ push(size);
}
- type = rtSound;
- break;
+ return;
case 14:
type = rtRoomImage;
break;
@@ -837,14 +841,9 @@ void ScummEngine_v80he::o80_getResourceSize() {
error("o80_getResourceSize: default type %d", subOp);
}
- const byte *ptr = getResourceAddress(type, resid);
- if (ptr) {
- size = getResourceDataSize(ptr);
- } else {
- debug(0, "o80_getResourceSize: invalid resource type %d id %d", type, resid);
- size = 0;
- }
-
+ ptr = getResourceAddress(type, resid);
+ assert(ptr);
+ size = READ_BE_UINT32(ptr + 4) - 8;
push(size);
}