diff options
author | Einar Johan Trøan Sømåen | 2012-07-27 15:59:58 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-27 15:59:58 +0200 |
commit | df5943ae59350b37e6f811ec2e9a968d0660fcab (patch) | |
tree | 3e7eea2474598c68ab9e7ea4c7b675a01f8f68a1 /engines | |
parent | b3b86c440cb2a13a43ce6dd3102bf85f4211795b (diff) | |
download | scummvm-rg350-df5943ae59350b37e6f811ec2e9a968d0660fcab.tar.gz scummvm-rg350-df5943ae59350b37e6f811ec2e9a968d0660fcab.tar.bz2 scummvm-rg350-df5943ae59350b37e6f811ec2e9a968d0660fcab.zip |
WINTERMUTE: Start sounds again after loading a save.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/base/sound/base_sound_buffer.cpp | 15 | ||||
-rw-r--r-- | engines/wintermute/base/sound/base_sound_buffer.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/engines/wintermute/base/sound/base_sound_buffer.cpp b/engines/wintermute/base/sound/base_sound_buffer.cpp index aa03609177..25be117db2 100644 --- a/engines/wintermute/base/sound/base_sound_buffer.cpp +++ b/engines/wintermute/base/sound/base_sound_buffer.cpp @@ -63,6 +63,7 @@ BaseSoundBuffer::BaseSoundBuffer(BaseGame *inGame): BaseClass(inGame) { _looping = false;
_loopStart = 0;
+ _startPos = 0;
_type = Audio::Mixer::kSFXSoundType;
@@ -155,14 +156,21 @@ bool BaseSoundBuffer::play(bool looping, uint32 startSample) { //////////////////////////////////////////////////////////////////////////
void BaseSoundBuffer::setLooping(bool looping) {
- warning("BSoundBuffer::SetLooping(%d) - won't change a playing sound", looping); // TODO
+ if (isPlaying()) {
+ warning("BSoundBuffer::SetLooping(%d) - won't change a playing sound", looping); // TODO
+ }
_looping = looping;
}
//////////////////////////////////////////////////////////////////////////
bool BaseSoundBuffer::resume() {
+ // If the sound was paused while active:
if (_stream && _handle) {
g_system->getMixer()->pauseHandle(*_handle, false);
+ } else if (_stream) { // Otherwise we come from a savegame, and thus have no handle
+ play(_looping, _startPos);
+ } else {
+ warning("BaseSoundBuffer::resume - Called without a handle or a stream");
}
return STATUS_OK;
}
@@ -246,7 +254,10 @@ uint32 BaseSoundBuffer::getPosition() { //////////////////////////////////////////////////////////////////////////
bool BaseSoundBuffer::setPosition(uint32 pos) {
- warning("BaseSoundBuffer::SetPosition - not implemented yet");
+ if (isPlaying()) {
+ warning("BaseSoundBuffer::SetPosition - not implemented for playing sounds yet.");
+ }
+ _startPos = pos;
return STATUS_OK;
}
diff --git a/engines/wintermute/base/sound/base_sound_buffer.h b/engines/wintermute/base/sound/base_sound_buffer.h index c32f83eb1e..107ceb87d7 100644 --- a/engines/wintermute/base/sound/base_sound_buffer.h +++ b/engines/wintermute/base/sound/base_sound_buffer.h @@ -88,6 +88,7 @@ public: int _privateVolume;
private:
+ uint32 _startPos;
char *_filename;
bool _streamed;
Common::SeekableReadStream *_file;
|