aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-09 22:16:17 -0400
committerPaul Gilbert2016-08-09 22:16:17 -0400
commit17a665e2aab9466d7362168ded8d870986120eca (patch)
treeaaccb3962a51c4676d39b6e3e97e612bde7918d5 /engines/titanic/sound
parent668c486f4fdf270a88cfd799ba54871d5a314383 (diff)
downloadscummvm-rg350-17a665e2aab9466d7362168ded8d870986120eca.tar.gz
scummvm-rg350-17a665e2aab9466d7362168ded8d870986120eca.tar.bz2
scummvm-rg350-17a665e2aab9466d7362168ded8d870986120eca.zip
TITANIC: Field renaming and warning fixes in sound code
Diffstat (limited to 'engines/titanic/sound')
-rw-r--r--engines/titanic/sound/proximity.cpp2
-rw-r--r--engines/titanic/sound/proximity.h2
-rw-r--r--engines/titanic/sound/sound.cpp4
-rw-r--r--engines/titanic/sound/sound_manager.cpp14
-rw-r--r--engines/titanic/sound/sound_manager.h8
5 files changed, 15 insertions, 15 deletions
diff --git a/engines/titanic/sound/proximity.cpp b/engines/titanic/sound/proximity.cpp
index ce91a0770f..7502eb3ef8 100644
--- a/engines/titanic/sound/proximity.cpp
+++ b/engines/titanic/sound/proximity.cpp
@@ -26,7 +26,7 @@
namespace Titanic {
CProximity::CProximity() : _field4(0), _channelVolume(100), _fieldC(0),
- _soundHandle((uint)-1), _field14(0), _frequencyMultiplier(0.0), _field1C(1.875),
+ _priorSoundHandle(-1), _field14(0), _frequencyMultiplier(0.0), _field1C(1.875),
_repeated(false), _channel(10), _field28(0), _azimuth(0.0),
_range(0.5), _elevation(0), _posX(0.0), _posY(0.0), _posZ(0.0),
_hasVelocity(false), _velocityX(0), _velocityY(0), _velocityZ(0),
diff --git a/engines/titanic/sound/proximity.h b/engines/titanic/sound/proximity.h
index d8eee4d9e5..7c1f8598e8 100644
--- a/engines/titanic/sound/proximity.h
+++ b/engines/titanic/sound/proximity.h
@@ -36,7 +36,7 @@ public:
int _field4;
int _channelVolume;
int _fieldC;
- uint _soundHandle;
+ int _priorSoundHandle;
int _field14;
double _frequencyMultiplier;
double _field1C;
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index d86262ae23..d14c628a78 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -48,16 +48,12 @@ void CSound::preLoad() {
void CSound::preEnterView(CViewItem *newView, bool isNewRoom) {
CNodeItem *node = newView->findNode();
- CRoomItem *room = node->findRoom();
double xp, yp, zp;
node->getPosition(xp, yp, zp);
double cosVal = cos(newView->_angle);
double sinVal = -sin(newView->_angle);
- // WORKAROUND: The original does a weird call below, doing the room's
- // (width + height) / 2 and passing it in the isNewRoom field, along with
- // two extra unused parameters that aren't used
_soundManager.setListenerPosition(xp, yp, zp, cosVal, sinVal, 0, isNewRoom);
}
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 7f0834ccb1..a8bd0dfbe9 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -151,11 +151,15 @@ int QSoundManager::playSound(CWaveFile &waveFile, CProximity &prox) {
int channel = -1;
uint flags = QMIX_CLEARQUEUE;
- for (uint idx = 0; idx < _slots.size(); ++idx) {
- if (_slots[idx]._handle == prox._soundHandle) {
- channel = _slots[idx]._channel;
- flags = QMIX_QUEUEWAVE;
- break;
+ if (prox._priorSoundHandle >= 1) {
+ // This sound should only be started after a prior one finishes,
+ // so scan the slots for the specified sound
+ for (uint idx = 0; idx < _slots.size(); ++idx) {
+ if (_slots[idx]._handle == prox._priorSoundHandle) {
+ channel = _slots[idx]._channel;
+ flags = QMIX_QUEUEWAVE;
+ break;
+ }
}
}
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 466607a1d5..2c9975ede4 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -191,17 +191,17 @@ public:
/**
* Returns the music volume percent
*/
- int getMusicVolume() const { return _musicPercent; }
+ double getMusicVolume() const { return _musicPercent; }
/**
* Returns the speech volume percent
*/
- int getSpeechVolume() const { return _speechPercent; }
+ double getSpeechVolume() const { return _speechPercent; }
/**
* Returns the parrot volume percent
*/
- int getParrotVolume() const { return _parrotPercent; }
+ double getParrotVolume() const { return _parrotPercent; }
/**
* Gets the volume for a given mode? value
@@ -255,7 +255,7 @@ class QSoundManager : public CSoundManager, public QMixer {
bool _isTimed;
uint _ticks;
int _channel;
- uint _handle;
+ int _handle;
uint _val3;
Slot() : _waveFile(0), _isTimed(0), _ticks(0), _channel(-1), _handle(0), _val3(0) {}