mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-22 20:21:06 +00:00
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
This commit is contained in:
parent
43283ff561
commit
08db684864
@ -28,6 +28,7 @@
|
||||
* - cge
|
||||
* - cge2
|
||||
* - fullpipe
|
||||
* - glk
|
||||
* - gob
|
||||
* - hopkins
|
||||
* - mohawk
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user