diff options
author | Sven Hesse | 2010-10-31 20:07:14 +0000 |
---|---|---|
committer | Sven Hesse | 2010-10-31 20:07:14 +0000 |
commit | 16a3cc8a8440c4ca6b45b6408d7baf7e9c001553 (patch) | |
tree | c1c208521c0098bbec5fc3a19e5ad27076a66e2d /engines/gob/sound/sound.cpp | |
parent | 88892dc982362cdaae8fa67fec7600041375fbd9 (diff) | |
download | scummvm-rg350-16a3cc8a8440c4ca6b45b6408d7baf7e9c001553.tar.gz scummvm-rg350-16a3cc8a8440c4ca6b45b6408d7baf7e9c001553.tar.bz2 scummvm-rg350-16a3cc8a8440c4ca6b45b6408d7baf7e9c001553.zip |
GOB: Clean up class DataIO
Removing the need for class DataStream and that handle mess.
svn-id: r53984
Diffstat (limited to 'engines/gob/sound/sound.cpp')
-rw-r--r-- | engines/gob/sound/sound.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
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; |