aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJonathan Gray2003-03-01 12:44:52 +0000
committerJonathan Gray2003-03-01 12:44:52 +0000
commit88906b03609cc210b9436936998b2798743c7898 (patch)
tree9eea70a4223a35b472d078754986b00c691ce7fb /scumm
parent4fd68d63b667834d4e415cafdb5b82de7e37588c (diff)
downloadscummvm-rg350-88906b03609cc210b9436936998b2798743c7898.tar.gz
scummvm-rg350-88906b03609cc210b9436936998b2798743c7898.tar.bz2
scummvm-rg350-88906b03609cc210b9436936998b2798743c7898.zip
hacky support for humongous talkie format
svn-id: r6646
Diffstat (limited to 'scumm')
-rw-r--r--scumm/sound.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index ea641c382f..2045a9c18f 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -466,12 +466,26 @@ int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
int num = 0, i;
byte file_byte, file_byte_2;
int size;
+ byte* sound;
if (_sfxFile->isOpen() == false) {
warning("startTalkSound: SFX file is not open");
return -1;
}
+ // FIXME hack until more is known
+ // the size of the data after the sample isn't known
+ // 64 is just a guess
+ if (_scumm->_features & GF_HUMONGOUS) {
+ // SKIP TLKB (8) TALK (8) HSHD (24) and SDAT (8)
+ _sfxFile->seek(offset + 48, SEEK_SET);
+ sound = (byte*)malloc(b - 64);
+ _sfxFile->read(sound, b - 64);
+ _scumm->_mixer->playRaw(NULL, sound, b - 64, 11025, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+ return -1;
+ }
+
+
// Some games frequently assume that starting one sound effect will
// automatically stop any other that may be playing at that time. So
// that is what we do here, but we make an exception for speech.
@@ -910,6 +924,11 @@ File * Sound::openSfxFile() {
if (!file->open(buf, _scumm->getGameDataPath())) {
file->open("monster.sou", _scumm->getGameDataPath());
}
+
+ if (!file->isOpen()) {
+ sprintf(buf, "%s.tlk", _scumm->getExeName());
+ file->open(buf, _scumm->getGameDataPath(), 1, 0x69);
+ }
return file;
}