aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/sound.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2010-02-08 16:14:04 +0000
committerNicola Mettifogo2010-02-08 16:14:04 +0000
commitb658c61155ff189fe4381ba774993a69a3f572ea (patch)
treef1253fedfa1acdf0f4e71b13cfb78cc552809847 /engines/drascula/sound.cpp
parenta9a0fdc69474f0491aa2662cb83ff8b7661ebd1a (diff)
downloadscummvm-rg350-b658c61155ff189fe4381ba774993a69a3f572ea.tar.gz
scummvm-rg350-b658c61155ff189fe4381ba774993a69a3f572ea.tar.bz2
scummvm-rg350-b658c61155ff189fe4381ba774993a69a3f572ea.zip
Let ArjFile return a SeekableReadStream instead of implementing
the same interface itself. The caller is now responsible for deleting the returned streams. svn-id: r47994
Diffstat (limited to 'engines/drascula/sound.cpp')
-rw-r--r--engines/drascula/sound.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp
index 17d7b88d4c..d8cd838b21 100644
--- a/engines/drascula/sound.cpp
+++ b/engines/drascula/sound.cpp
@@ -163,23 +163,24 @@ void DrasculaEngine::MusicFadeout() {
}
void DrasculaEngine::playFile(const char *fname) {
- if (_arj.open(fname)) {
- int soundSize = _arj.size();
+ Common::SeekableReadStream *stream = _arj.open(fname);
+ if (stream) {
+ int soundSize = stream->size();
byte *soundData = (byte *)malloc(soundSize);
if (!(!strcmp(fname, "3.als") && soundSize == 145166 && _lang != kSpanish)) {
- _arj.seek(32);
+ stream->seek(32);
} else {
// WORKAROUND: File 3.als with English speech files has a big silence at
// its beginning and end. We seek past the silence at the beginning,
// and ignore the silence at the end
// Fixes bug #2111815 - "DRASCULA: Voice delayed"
- _arj.seek(73959, SEEK_SET);
+ stream->seek(73959, SEEK_SET);
soundSize = 117158 - 73959;
}
- _arj.read(soundData, soundSize);
- _arj.close();
+ stream->read(soundData, soundSize);
+ delete stream;
_subtitlesDisabled = !ConfMan.getBool("subtitles");
if (ConfMan.getBool("speech_mute"))