aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-12-08 12:18:10 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit08db684864f0734a2d93641dc7a23ce117073eb4 (patch)
treeb039d24f7ed4c63719a3eb1f905050d92f007e22
parent43283ff561233d5e67cc15d8f1c3da4489156c0c (diff)
downloadscummvm-rg350-08db684864f0734a2d93641dc7a23ce117073eb4.tar.gz
scummvm-rg350-08db684864f0734a2d93641dc7a23ce117073eb4.tar.bz2
scummvm-rg350-08db684864f0734a2d93641dc7a23ce117073eb4.zip
GLK: Add support for secondary Blorb files separate from the gamefile
It also hads further support for playing AIFF files. However, the Blorb files for Lurking Horror & Sherlock on the if-archive website don't seem to be valid AIFF files, so sound doesn't play using them
-rw-r--r--audio/decoders/wave.h1
-rw-r--r--engines/glk/blorb.cpp2
-rw-r--r--engines/glk/glk.cpp14
-rw-r--r--engines/glk/sound.cpp6
4 files changed, 22 insertions, 1 deletions
diff --git a/audio/decoders/wave.h b/audio/decoders/wave.h
index aaf4a01a3f..75581f189b 100644
--- a/audio/decoders/wave.h
+++ b/audio/decoders/wave.h
@@ -28,6 +28,7 @@
* - cge
* - cge2
* - fullpipe
+ * - glk
* - gob
* - hopkins
* - mohawk
diff --git a/engines/glk/blorb.cpp b/engines/glk/blorb.cpp
index 5ffd0b03b0..4a4cf8c531 100644
--- a/engines/glk/blorb.cpp
+++ b/engines/glk/blorb.cpp
@@ -153,7 +153,7 @@ Common::ErrorCode Blorb::load() {
ce._filename += ".mp3";
else if (ce._id == ID_WAVE)
ce._filename += ".wav";
- else if (ce._id == ID_AIFF)
+ else if (ce._id == ID_AIFF || ce._id == ID_FORM)
ce._filename += ".aiff";
else if (ce._id == ID_OGG)
ce._filename += ".ogg";
diff --git a/engines/glk/glk.cpp b/engines/glk/glk.cpp
index c8a63c5bd3..849de8d8f3 100644
--- a/engines/glk/glk.cpp
+++ b/engines/glk/glk.cpp
@@ -122,6 +122,20 @@ Common::Error GlkEngine::run() {
if (!f.open("game", *_blorb))
return Common::kNoGameDataFoundError;
} else {
+ // Check for a secondary blorb file with the same filename
+ Common::String baseName = filename;
+ while (baseName.contains('.'))
+ baseName.deleteLastChar();
+
+ if (f.exists(baseName + ".blorb")) {
+ _blorb = new Blorb(baseName + ".blorb", getInterpreterType());
+ SearchMan.add("blorb", _blorb, 99, false);
+ } else if (f.exists(baseName + ".blb")) {
+ _blorb = new Blorb(baseName + ".blb", getInterpreterType());
+ SearchMan.add("blorb", _blorb, 99, false);
+ }
+
+ // Open up the game file
if (!f.open(filename))
return Common::kNoGameDataFoundError;
}
diff --git a/engines/glk/sound.cpp b/engines/glk/sound.cpp
index 85f7e01702..02fb7f9253 100644
--- a/engines/glk/sound.cpp
+++ b/engines/glk/sound.cpp
@@ -25,6 +25,7 @@
#include "glk/events.h"
#include "common/file.h"
#include "audio/audiostream.h"
+#include "audio/decoders/aiff.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/mp3.h"
#include "audio/decoders/wave.h"
@@ -92,6 +93,7 @@ glui32 SoundChannel::play(glui32 soundNum, glui32 repeats, glui32 notify) {
Common::String nameSnd = Common::String::format("sound%u.snd", soundNum);
Common::String nameMp3 = Common::String::format("sound%u.mp3", soundNum);
Common::String nameWav = Common::String::format("sound%u.wav", soundNum);
+ Common::String nameAiff = Common::String::format("sound%u.aiff", soundNum);
if (f.exists(nameSnd) && f.open(nameSnd)) {
if (f.readUint16BE() != (f.size() - 2))
@@ -113,6 +115,10 @@ glui32 SoundChannel::play(glui32 soundNum, glui32 repeats, glui32 notify) {
Common::SeekableReadStream *s = f.readStream(f.size());
stream = Audio::makeWAVStream(s, DisposeAfterUse::YES);
+ } else if (f.exists(nameAiff) && f.open(nameAiff)) {
+ Common::SeekableReadStream *s = f.readStream(f.size());
+ stream = Audio::makeAIFFStream(s, DisposeAfterUse::YES);
+
} else {
warning("Could not find sound %u", soundNum);
return 1;