aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-03-29 21:19:46 +0200
committerAlyssa Milburn2011-03-29 21:19:46 +0200
commit01b7a2c774cdda3dd0640c37cc41124e4c80743d (patch)
tree030cc1d95459aec977480aa2450dc472c8ec58c2 /engines/mohawk
parentfeefced3ce98232c6c31a4ae482949c99ad6764c (diff)
downloadscummvm-rg350-01b7a2c774cdda3dd0640c37cc41124e4c80743d.tar.gz
scummvm-rg350-01b7a2c774cdda3dd0640c37cc41124e4c80743d.tar.bz2
scummvm-rg350-01b7a2c774cdda3dd0640c37cc41124e4c80743d.zip
MOHAWK: Check isAmbient in LB sound priority code.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks.cpp29
-rw-r--r--engines/mohawk/livingbooks.h1
2 files changed, 17 insertions, 13 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 356ad94fa6..6a820f52bb 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -562,22 +562,25 @@ bool MohawkEngine_LivingBooks::playSound(LBItem *source, uint16 resourceId) {
if (_lastSoundId && !_sound->isPlaying(_lastSoundId))
_lastSoundId = 0;
- if (!_soundLockOwner) {
- if (_lastSoundId && _lastSoundOwner != source->getId())
- if (source->getSoundPriority() >= _lastSoundPriority)
+ if (!source->isAmbient() || !_sound->isPlaying()) {
+ if (!_soundLockOwner) {
+ if (_lastSoundId && _lastSoundOwner != source->getId())
+ if (source->getSoundPriority() >= _lastSoundPriority)
+ return false;
+ } else {
+ if (_soundLockOwner != source->getId() && source->getSoundPriority() >= _maxSoundPriority)
return false;
- } else {
- if (_soundLockOwner != source->getId() && source->getSoundPriority() >= _maxSoundPriority)
- return false;
- }
+ }
- if (_lastSoundId)
- _sound->stopSound(_lastSoundId);
+ if (_lastSoundId)
+ _sound->stopSound(_lastSoundId);
+
+ _lastSoundOwner = source->getId();
+ _lastSoundPriority = source->getSoundPriority();
+ }
- _sound->playSound(resourceId);
_lastSoundId = resourceId;
- _lastSoundOwner = source->getId();
- _lastSoundPriority = source->getSoundPriority();
+ _sound->playSound(resourceId);
return true;
}
@@ -588,7 +591,7 @@ void MohawkEngine_LivingBooks::lockSound(LBItem *owner, bool lock) {
return;
}
- if (_soundLockOwner)
+ if (_soundLockOwner || (owner->isAmbient() && _sound->isPlaying()))
return;
if (_lastSoundId && !_sound->isPlaying(_lastSoundId))
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 74bf520451..3db71eb66f 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -366,6 +366,7 @@ public:
uint16 getId() { return _itemId; }
uint16 getSoundPriority() { return _soundMode; }
+ bool isAmbient() { return _isAmbient; }
protected:
MohawkEngine_LivingBooks *_vm;