aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/data/snd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/lastexpress/data/snd.cpp')
-rw-r--r--engines/lastexpress/data/snd.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp
index 5010d6e763..6d64f6b82c 100644
--- a/engines/lastexpress/data/snd.cpp
+++ b/engines/lastexpress/data/snd.cpp
@@ -356,6 +356,8 @@ public:
Audio::ADPCMStream(stream, disposeAfterUse, size, 44100, 1, blockSize) {
_currentFilterId = -1;
_nextFilterId = filterId;
+ _stepAdjust1 = 0;
+ _stepAdjust2 = 0;
}
int readBuffer(int16 *buffer, const int numSamples) {
@@ -453,7 +455,9 @@ void SimpleSound::play(Audio::AudioStream *as) {
//////////////////////////////////////////////////////////////////////////
StreamedSound::StreamedSound() : _as(NULL), _loaded(false) {}
-StreamedSound::~StreamedSound() {}
+StreamedSound::~StreamedSound() {
+ _as = NULL;
+}
bool StreamedSound::load(Common::SeekableReadStream *stream, int32 filterId) {
if (!stream)
@@ -482,6 +486,9 @@ bool StreamedSound::isFinished() {
}
void StreamedSound::setFilterId(int32 filterId) {
+ if (_as == NULL)
+ return;
+
((LastExpress_ADPCMStream *)_as)->setFilterId(filterId);
}