aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects/sequences
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink/objects/sequences')
-rw-r--r--engines/pink/objects/sequences/sequence.cpp12
-rw-r--r--engines/pink/objects/sequences/sequence.h3
2 files changed, 7 insertions, 8 deletions
diff --git a/engines/pink/objects/sequences/sequence.cpp b/engines/pink/objects/sequences/sequence.cpp
index 8e2f38c549..e7d5783050 100644
--- a/engines/pink/objects/sequences/sequence.cpp
+++ b/engines/pink/objects/sequences/sequence.cpp
@@ -160,27 +160,25 @@ void SequenceAudio::start(int unk) {
}
void SequenceAudio::end() {
- delete _sound;
- _sound = nullptr;
+ _sound.stop();
Sequence::end();
}
void SequenceAudio::update() {
- if (!_sound->isPlaying())
+ if (!_sound.isPlaying())
end();
- else if (_sample <= _sound->getCurrentSample())
+ else if (_sample <= _sound.getCurrentSample())
start(0);
}
void SequenceAudio::init(int unk) {
_sample = 0;
- _sound = _sequencer->_page->loadSound(_soundName);
- _sound->play(Audio::Mixer::kMusicSoundType, 100, 0);
+ _sound.play(_sequencer->_page->getResourceStream(_soundName), Audio::Mixer::kMusicSoundType);
Sequence::init(unk);
}
void SequenceAudio::restart() {
- _sound->play(Audio::Mixer::kMusicSoundType, 100, 0);
+ _sound.play(_sequencer->_page->getResourceStream(_soundName), Audio::Mixer::kMusicSoundType);
Sequence::restart();
}
diff --git a/engines/pink/objects/sequences/sequence.h b/engines/pink/objects/sequences/sequence.h
index 34863256f2..93dcb25d26 100644
--- a/engines/pink/objects/sequences/sequence.h
+++ b/engines/pink/objects/sequences/sequence.h
@@ -23,6 +23,7 @@
#ifndef PINK_SEQUENCE_H
#define PINK_SEQUENCE_H
+#include "pink/sound.h"
#include "pink/objects/object.h"
namespace Pink {
@@ -79,7 +80,7 @@ public:
private:
Common::String _soundName;
- Sound *_sound;
+ Sound _sound;
uint _sample;
};