diff options
author | Travis Howell | 2005-04-14 06:06:59 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-14 06:06:59 +0000 |
commit | a3882f3af779c5b5726b24734fc74a702f199be4 (patch) | |
tree | dd6fe0e6a03f4a8e55201aa2aeb9e2592ac9d4e0 /scumm/script_v72he.cpp | |
parent | 50bf840b9fad86724863e0c323fc3e0d873e9acb (diff) | |
download | scummvm-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_v72he.cpp')
-rw-r--r-- | scumm/script_v72he.cpp | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 891cf9af45..8159edf1bc 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -2151,41 +2151,17 @@ void ScummEngine_v72he::o72_writeINI() { } void ScummEngine_v72he::o72_getResourceSize() { - int size = 0, type; + int resid, size; - int idx = pop(); - byte subOp = fetchScriptByte(); - - switch (subOp) { - case 13: - if (idx > _numSounds) { - // TODO Music resource size - push(100); - return; - } - type = rtSound; - break; - case 14: - type = rtRoomImage; - break; - case 15: - type = rtImage; - break; - case 16: - type = rtCostume; - break; - case 17: - type = rtScript; - break; - default: - warning("o72_getResourceSize: default type %d", subOp); - push(0); + resid = pop(); + if (resid > _numSounds) { + push(getMusicResourceSize(resid)); return; } - const byte *ptr = getResourceAddress(type, idx); - if (ptr) - size = READ_BE_UINT32(ptr + 4) - 8; + const byte *ptr = getResourceAddress(rtSound, resid); + assert(ptr); + size = READ_BE_UINT32(ptr + 4) - 8; push(size); } |