aboutsummaryrefslogtreecommitdiff
path: root/scumm/resource_v7he.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-04-18 11:44:01 +0000
committerTravis Howell2005-04-18 11:44:01 +0000
commitd391c2f837199cfecb0c26c518bbf804d3da3d3c (patch)
treeebf6c68e575541c652eae9cb0e9e1c764671e064 /scumm/resource_v7he.cpp
parent8d01148b797f66af457434284b3a41bd18b86098 (diff)
downloadscummvm-rg350-d391c2f837199cfecb0c26c518bbf804d3da3d3c.tar.gz
scummvm-rg350-d391c2f837199cfecb0c26c518bbf804d3da3d3c.tar.bz2
scummvm-rg350-d391c2f837199cfecb0c26c518bbf804d3da3d3c.zip
Adjust again, for sound header differences.
svn-id: r17668
Diffstat (limited to 'scumm/resource_v7he.cpp')
-rw-r--r--scumm/resource_v7he.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp
index 52e92518b5..d5a2a1bc8f 100644
--- a/scumm/resource_v7he.cpp
+++ b/scumm/resource_v7he.cpp
@@ -28,6 +28,7 @@
#include "scumm/intern.h"
#include "scumm/resource.h"
#include "scumm/resource_v7he.h"
+#include "scumm/sound.h"
#include "scumm/util.h"
#include "common/stream.h"
@@ -1753,4 +1754,32 @@ byte *ScummEngine_v72he::getStringAddress(int i) {
return ((ScummEngine_v72he::ArrayHeader *)addr)->data;
}
+int ScummEngine_v72he::getSoundResourceSize(int id) {
+ const byte *ptr;
+ int offs, size;
+
+ if (id > _numSounds) {
+ _sound->getHEMusicDetails(id, offs, size);
+ } else {
+ ptr = getResourceAddress(rtSound, id);
+ if (!ptr)
+ return 0;
+
+ if (READ_UINT32(ptr) == MKID('HSHD')) {
+ ptr += READ_BE_UINT32(ptr + 4);
+ } else {
+ ptr += 8 + READ_BE_UINT32(ptr + 12);
+ }
+
+ if (READ_UINT32(ptr) == MKID('SBNG')) {
+ ptr += READ_BE_UINT32(ptr + 4);
+ }
+
+ assert(READ_UINT32(ptr) == MKID('SDAT'));
+ size = READ_BE_UINT32(ptr + 4) - 8;
+ }
+
+ return size;
+}
+
} // End of namespace Scumm