diff options
Diffstat (limited to 'engines/gob/sound')
-rw-r--r-- | engines/gob/sound/cdrom.cpp | 2 | ||||
-rw-r--r-- | engines/gob/sound/cdrom.h | 4 | ||||
-rw-r--r-- | engines/gob/sound/sound.cpp | 29 |
3 files changed, 11 insertions, 24 deletions
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp index 2e1673b12a..cfd26e6bed 100644 --- a/engines/gob/sound/cdrom.cpp +++ b/engines/gob/sound/cdrom.cpp @@ -49,7 +49,7 @@ CDROM::~CDROM() { stop(); } -void CDROM::readLIC(DataStream &stream) { +void CDROM::readLIC(Common::SeekableReadStream &stream) { uint16 version, startChunk, pos; freeLICBuffer(); diff --git a/engines/gob/sound/cdrom.h b/engines/gob/sound/cdrom.h index 6f01e6f90a..894744ca15 100644 --- a/engines/gob/sound/cdrom.h +++ b/engines/gob/sound/cdrom.h @@ -28,14 +28,12 @@ namespace Gob { -class DataStream; - class CDROM { public: CDROM(); ~CDROM(); - void readLIC(DataStream &stream); + void readLIC(Common::SeekableReadStream &stream); void freeLICBuffer(); void startTrack(const char *trackName); diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index bc4495fafd..dc80699ce0 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -114,19 +114,13 @@ bool Sound::sampleLoad(SoundDesc *sndDesc, SoundType type, const char *fileName, debugC(2, kDebugSound, "Loading sample \"%s\"", fileName); - if (!_vm->_dataIO->existData(fileName)) { + int32 size; + byte *data = _vm->_dataIO->getFile(fileName, size); + if (!data) { warning("Can't open sample file \"%s\"", fileName); return false; } - byte *data; - uint32 size; - - data = (byte *)_vm->_dataIO->getData(fileName); - if (!data) - return false; - - size = _vm->_dataIO->getDataSize(fileName); return sndDesc->load(type, data, size); } @@ -279,13 +273,12 @@ bool Sound::adlibLoadMDY(const char *fileName) { debugC(1, kDebugSound, "AdLib: Loading MDY data (\"%s\")", fileName); - if (!_vm->_dataIO->existData(fileName)) { + Common::SeekableReadStream *stream = _vm->_dataIO->getFile(fileName); + if (!stream) { warning("Can't open MDY file \"%s\"", fileName); return false; } - DataStream *stream = _vm->_dataIO->getDataStream(fileName); - bool loaded = _mdyPlayer->loadMDY(*stream); delete stream; @@ -300,15 +293,14 @@ bool Sound::adlibLoadTBR(const char *fileName) { if (!_mdyPlayer) _mdyPlayer = new MDYPlayer(*_vm->_mixer); - if (!_vm->_dataIO->existData(fileName)) { + Common::SeekableReadStream *stream = _vm->_dataIO->getFile(fileName); + if (!stream) { warning("Can't open TBR file \"%s\"", fileName); return false; } debugC(1, kDebugSound, "AdLib: Loading MDY instruments (\"%s\")", fileName); - DataStream *stream = _vm->_dataIO->getDataStream(fileName); - bool loaded = _mdyPlayer->loadTBR(*stream); delete stream; @@ -522,13 +514,10 @@ void Sound::cdLoadLIC(const char *fname) { debugC(1, kDebugSound, "CDROM: Loading LIC \"%s\"", fname); - if (!_vm->_dataIO->existData(fname)) + Common::SeekableReadStream *stream = _vm->_dataIO->getFile(fname); + if (!stream) return; - _vm->_dataIO->getUnpackedData(fname); - - DataStream *stream = _vm->_dataIO->getDataStream(fname); - _cdrom->readLIC(*stream); delete stream; |