diff options
author | Sven Hesse | 2009-06-22 20:27:47 +0000 |
---|---|---|
committer | Sven Hesse | 2009-06-22 20:27:47 +0000 |
commit | 4ab45170163f70a85c400bc50d0e20501e0cd24c (patch) | |
tree | 4971a14c2e2810b93fbb6eb5b6135929fa85397d /engines/gob/sound/sound.cpp | |
parent | e9ffb841796d3a10c6f548ce073f797398d8d28c (diff) | |
download | scummvm-rg350-4ab45170163f70a85c400bc50d0e20501e0cd24c.tar.gz scummvm-rg350-4ab45170163f70a85c400bc50d0e20501e0cd24c.tar.bz2 scummvm-rg350-4ab45170163f70a85c400bc50d0e20501e0cd24c.zip |
Added stream-reading loading wrappers to MDYPlayer and added a workaround to fix TBR reading for the moment
svn-id: r41781
Diffstat (limited to 'engines/gob/sound/sound.cpp')
-rw-r--r-- | engines/gob/sound/sound.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 21e06e4700..d667a2d592 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -279,7 +279,18 @@ bool Sound::adlibLoadMDY(const char *fileName) { debugC(1, kDebugSound, "Adlib: Loading MDY data (\"%s\")", fileName); - return _mdyPlayer->loadMDY(fileName); + if (!_vm->_dataIO->existData(fileName)) { + warning("Can't open MDY file \"%s\"", fileName); + return false; + } + + DataStream *stream = _vm->_dataIO->getDataStream(fileName); + + bool loaded = _mdyPlayer->loadMDY(*stream); + + delete stream; + + return loaded; } bool Sound::adlibLoadTBR(const char *fileName) { @@ -289,9 +300,20 @@ bool Sound::adlibLoadTBR(const char *fileName) { if (!_mdyPlayer) _mdyPlayer = new MDYPlayer(*_vm->_mixer); + if (!_vm->_dataIO->existData(fileName)) { + warning("Can't open TBR file \"%s\"", fileName); + return false; + } + debugC(1, kDebugSound, "Adlib: Loading MDY instruments (\"%s\")", fileName); - return _mdyPlayer->loadTBR(fileName); + DataStream *stream = _vm->_dataIO->getDataStream(fileName); + + bool loaded = _mdyPlayer->loadTBR(*stream); + + delete stream; + + return loaded; } void Sound::adlibPlayTrack(const char *trackname) { |