aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress
diff options
context:
space:
mode:
authorMatthew Hoops2014-06-09 20:35:40 -0400
committerMatthew Hoops2015-08-30 19:53:53 -0400
commit030e4d06088cb75e871f1373b662d14262fbfc93 (patch)
tree1b2db83cfac8dd00056435058c830afb0ccba468 /engines/lastexpress
parent62973836e1ec7b32a9425fd65e976416d6b5e320 (diff)
downloadscummvm-rg350-030e4d06088cb75e871f1373b662d14262fbfc93.tar.gz
scummvm-rg350-030e4d06088cb75e871f1373b662d14262fbfc93.tar.bz2
scummvm-rg350-030e4d06088cb75e871f1373b662d14262fbfc93.zip
AUDIO: Make Rewindable- and SeekableAudioStream inherit virtually
Diffstat (limited to 'engines/lastexpress')
-rw-r--r--engines/lastexpress/data/snd.cpp8
-rw-r--r--engines/lastexpress/data/snd.h6
2 files changed, 8 insertions, 6 deletions
diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp
index 2a221afadc..e310bafd18 100644
--- a/engines/lastexpress/data/snd.cpp
+++ b/engines/lastexpress/data/snd.cpp
@@ -442,7 +442,7 @@ void SimpleSound::loadHeader(Common::SeekableReadStream *in) {
_blockSize = _size / _blocks;
}
-Audio::AudioStream *SimpleSound::makeDecoder(Common::SeekableReadStream *in, uint32 size, int32 filterId) const {
+LastExpress_ADPCMStream *SimpleSound::makeDecoder(Common::SeekableReadStream *in, uint32 size, int32 filterId) const {
return new LastExpress_ADPCMStream(in, DisposeAfterUse::YES, size, _blockSize, filterId);
}
@@ -489,7 +489,7 @@ void StreamedSound::setFilterId(int32 filterId) {
if (!_as)
return;
- ((LastExpress_ADPCMStream *)_as)->setFilterId(filterId);
+ _as->setFilterId(filterId);
}
//////////////////////////////////////////////////////////////////////////
@@ -525,8 +525,8 @@ void AppendableSound::queueBuffer(Common::SeekableReadStream *bufferIn) {
// Setup the ADPCM decoder
uint32 sizeIn = (uint32)bufferIn->size();
- Audio::AudioStream *adpcm = makeDecoder(bufferIn, sizeIn);
- ((LastExpress_ADPCMStream *)adpcm)->setFilterId(16);
+ LastExpress_ADPCMStream *adpcm = makeDecoder(bufferIn, sizeIn);
+ adpcm->setFilterId(16);
// Queue the stream
_as->queueAudioStream(adpcm);
diff --git a/engines/lastexpress/data/snd.h b/engines/lastexpress/data/snd.h
index f489304ff3..19e5fda9c9 100644
--- a/engines/lastexpress/data/snd.h
+++ b/engines/lastexpress/data/snd.h
@@ -49,6 +49,8 @@ class SeekableReadStream;
namespace LastExpress {
+class LastExpress_ADPCMStream;
+
class SimpleSound {
public:
SimpleSound();
@@ -59,7 +61,7 @@ public:
protected:
void loadHeader(Common::SeekableReadStream *in);
- Audio::AudioStream *makeDecoder(Common::SeekableReadStream *in, uint32 size, int32 filterId = -1) const;
+ LastExpress_ADPCMStream *makeDecoder(Common::SeekableReadStream *in, uint32 size, int32 filterId = -1) const;
void play(Audio::AudioStream *as);
uint32 _size; ///< data size
@@ -82,7 +84,7 @@ public:
void setFilterId(int32 filterId);
private:
- Audio::AudioStream *_as;
+ LastExpress_ADPCMStream *_as;
bool _loaded;
};