[Scummvm-cvs-logs] scummvm master -> f0a03fcd1b0190e6527df1d51e5a86c77f0f5195
bluegr
bluegr at gmail.com
Thu Jul 9 11:12:38 CEST 2015
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a620632a5f ACCESS: Fix sound stream handling
f0a03fcd1b SHERLOCK: Rename variable to avoid shadowing
Commit: a620632a5f9dd97db3c0a2f5a44a2fe8ff41809a
https://github.com/scummvm/scummvm/commit/a620632a5f9dd97db3c0a2f5a44a2fe8ff41809a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-07-09T11:53:08+03:00
Commit Message:
ACCESS: Fix sound stream handling
Fixes stopSound(), and changes all sound streams to be deleted on the
next call of checkSoundQueue(), or when clearSounds() is called. This
avoids ending up with invalidated sound streams in the sound queue
Changed paths:
engines/access/sound.cpp
diff --git a/engines/access/sound.cpp b/engines/access/sound.cpp
index 61191aa..95f8367 100644
--- a/engines/access/sound.cpp
+++ b/engines/access/sound.cpp
@@ -50,9 +50,6 @@ void SoundManager::clearSounds() {
if (_mixer->isSoundHandleActive(_effectsHandle))
_mixer->stopHandle(_effectsHandle);
- if (_queue.size())
- _queue.remove_at(0);
-
while (_queue.size()) {
delete _queue[0];
_queue.remove_at(0);
@@ -146,7 +143,7 @@ void SoundManager::playSound(Resource *res, int priority) {
if (!_mixer->isSoundHandleActive(_effectsHandle))
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_effectsHandle,
_queue[0], -1, _mixer->kMaxChannelVolume, 0,
- DisposeAfterUse::YES);
+ DisposeAfterUse::NO);
}
void SoundManager::checkSoundQueue() {
@@ -155,12 +152,13 @@ void SoundManager::checkSoundQueue() {
if (_queue.empty() || _mixer->isSoundHandleActive(_effectsHandle))
return;
+ delete _queue[0];
_queue.remove_at(0);
- if (_queue.size())
+ if (_queue.size() && _queue[0])
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_effectsHandle,
_queue[0], -1, _mixer->kMaxChannelVolume, 0,
- DisposeAfterUse::YES);
+ DisposeAfterUse::NO);
}
bool SoundManager::isSFXPlaying() {
@@ -181,7 +179,7 @@ void SoundManager::loadSounds(Common::Array<RoomInfo::SoundIdent> &sounds) {
void SoundManager::stopSound() {
debugC(3, kDebugSound, "stopSound");
- _mixer->stopHandle(Audio::SoundHandle());
+ _mixer->stopHandle(_effectsHandle);
}
void SoundManager::freeSounds() {
Commit: f0a03fcd1b0190e6527df1d51e5a86c77f0f5195
https://github.com/scummvm/scummvm/commit/f0a03fcd1b0190e6527df1d51e5a86c77f0f5195
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-07-09T12:00:08+03:00
Commit Message:
SHERLOCK: Rename variable to avoid shadowing
Reported by eriktorbjorn
Changed paths:
engines/sherlock/scene.cpp
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 4e5cacb..2f8762e 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -1099,15 +1099,15 @@ void Scene::checkSceneFlags(bool flag) {
for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
Object &o = _bgShapes[idx];
- bool flag = true;
+ bool objectFlag = true;
if (o._requiredFlag[0] || o._requiredFlag[1]) {
if (o._requiredFlag[0] != 0)
- flag = _vm->readFlags(o._requiredFlag[0]);
+ objectFlag = _vm->readFlags(o._requiredFlag[0]);
if (o._requiredFlag[1] != 0)
- flag &= _vm->readFlags(o._requiredFlag[1]);
+ objectFlag &= _vm->readFlags(o._requiredFlag[1]);
- if (!flag) {
+ if (!objectFlag) {
// Kill object
if (o._type != HIDDEN && o._type != INVALID) {
if (o._images == nullptr || o._images->size() == 0)
More information about the Scummvm-git-logs
mailing list