aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/res_snd.cpp
diff options
context:
space:
mode:
authorTravis Howell2007-05-28 11:22:53 +0000
committerTravis Howell2007-05-28 11:22:53 +0000
commit9d041cc0598212bb2ef95584f0213aa4d286e2a6 (patch)
tree6e46d52bf8521f66ff811981bbb425de6d8edc20 /engines/agos/res_snd.cpp
parent0d789e074e6ff1ed76e75619eae9d337d3faad29 (diff)
downloadscummvm-rg350-9d041cc0598212bb2ef95584f0213aa4d286e2a6.tar.gz
scummvm-rg350-9d041cc0598212bb2ef95584f0213aa4d286e2a6.tar.bz2
scummvm-rg350-9d041cc0598212bb2ef95584f0213aa4d286e2a6.zip
Add sound effects code for Amiga and AtariST versions of Elvira 2.
svn-id: r26989
Diffstat (limited to 'engines/agos/res_snd.cpp')
-rw-r--r--engines/agos/res_snd.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index 41c3dce075..73eab46cbf 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -397,6 +397,38 @@ void AGOSEngine::loadSoundFile(const char* filename) {
_sound->playSfxData(dst, 0, 0, 0);
}
+void AGOSEngine::loadSound(uint sound) {
+ byte *dst;
+ uint32 offs, size;
+
+ if (_curSfxFile == NULL)
+ return;
+
+ dst = _curSfxFile;
+ if (getGameType() == GType_WW) {
+ uint tmp = sound;
+ while (tmp--)
+ dst += READ_LE_UINT16(dst) + 4;
+
+ size = READ_LE_UINT16(dst);
+ offs = 4;
+ } else if (getGameType() == GType_ELVIRA2) {
+ while (READ_BE_UINT32(dst + 4) != sound)
+ dst += 12;
+
+ size = READ_BE_UINT32(dst);
+ offs = READ_BE_UINT32(dst + 8);
+ } else {
+ while (READ_BE_UINT16(dst + 6) != sound)
+ dst += 12;
+
+ size = READ_BE_UINT16(dst + 2);
+ offs = READ_BE_UINT32(dst + 8);
+ }
+
+ _sound->playRawData(dst + offs, sound, size);
+}
+
void AGOSEngine::loadSound(uint sound, int pan, int vol, uint type) {
byte *dst;