diff options
author | whiterandrek | 2018-06-09 20:26:32 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | cf04fb20c76f4c0ce52939e074cb79c40367f93a (patch) | |
tree | 134120264f1de871f3ecffadb003ae27bb4a001e /engines/pink/objects/sequences | |
parent | 4fd0ec3ff71614ecbf66ec7f8b414d99c74b1e32 (diff) | |
download | scummvm-rg350-cf04fb20c76f4c0ce52939e074cb79c40367f93a.tar.gz scummvm-rg350-cf04fb20c76f4c0ce52939e074cb79c40367f93a.tar.bz2 scummvm-rg350-cf04fb20c76f4c0ce52939e074cb79c40367f93a.zip |
PINK: rework sound system
Diffstat (limited to 'engines/pink/objects/sequences')
-rw-r--r-- | engines/pink/objects/sequences/sequence.cpp | 12 | ||||
-rw-r--r-- | engines/pink/objects/sequences/sequence.h | 3 |
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; }; |