diff options
author | Paul Gilbert | 2016-11-05 19:12:39 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-11-05 19:12:39 -0400 |
commit | cf1efc84308ec763ea78d166a14057a95c379cab (patch) | |
tree | 08090cef67ab160b531f7b7a4dffd8f53d341b29 /engines | |
parent | db1ed6db3e44720a7efcfe62b77e166bb8809e1f (diff) | |
download | scummvm-rg350-cf1efc84308ec763ea78d166a14057a95c379cab.tar.gz scummvm-rg350-cf1efc84308ec763ea78d166a14057a95c379cab.tar.bz2 scummvm-rg350-cf1efc84308ec763ea78d166a14057a95c379cab.zip |
TITANIC: Fix replaying cached previously played sounds
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/sound/sound.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/sound/wave_file.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/sound/wave_file.h | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp index fb8cc299df..c28823148e 100644 --- a/engines/titanic/sound/sound.cpp +++ b/engines/titanic/sound/sound.cpp @@ -129,6 +129,7 @@ CWaveFile *CSound::loadSound(const CString &name) { // Found it, so move it to the front of the list and return _sounds.remove(soundItem); _sounds.push_front(soundItem); + soundItem->_waveFile->reset(); return soundItem->_waveFile; } } diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp index 2c583f2160..f2366d1dd5 100644 --- a/engines/titanic/sound/wave_file.cpp +++ b/engines/titanic/sound/wave_file.cpp @@ -106,4 +106,8 @@ uint CWaveFile::getFrequency() const { return _stream->getRate(); } +void CWaveFile::reset() { + _stream->rewind(); +} + } // End of namespace Titanic z diff --git a/engines/titanic/sound/wave_file.h b/engines/titanic/sound/wave_file.h index 19d367936f..e4bb71a0b6 100644 --- a/engines/titanic/sound/wave_file.h +++ b/engines/titanic/sound/wave_file.h @@ -81,6 +81,11 @@ public: * Return the frequency of the loaded wave file */ uint getFrequency() const; + + /** + * Resets the music stream + */ + void reset(); }; } // End of namespace Titanic |