aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-31 20:20:10 -0400
committerPaul Gilbert2016-08-31 20:20:10 -0400
commitdd4fee37e35fab40076b6e9070a9a0ab987750a9 (patch)
tree4f8c6d7b5ddf047686385223a4eca95ee601b72d /engines/titanic/sound
parent15ebf3a12aae014f5b6e3cd0125eab4e421aa46b (diff)
downloadscummvm-rg350-dd4fee37e35fab40076b6e9070a9a0ab987750a9.tar.gz
scummvm-rg350-dd4fee37e35fab40076b6e9070a9a0ab987750a9.tar.bz2
scummvm-rg350-dd4fee37e35fab40076b6e9070a9a0ab987750a9.zip
TITANIC: Add support for specifying a sound is music or SFX
Apart from the CMusicRoom music, the game doesn't differentiate between music and sound effects. This adds an optional _soundType field to the CProximity class, so I can manually specify which is which
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.cpp3
3 files changed, 6 insertions, 1 deletions
diff --git a/engines/titanic/sound/proximity.cpp b/engines/titanic/sound/proximity.cpp
index 7f4e6784f2..992e76a872 100644
--- a/engines/titanic/sound/proximity.cpp
+++ b/engines/titanic/sound/proximity.cpp
@@ -31,7 +31,7 @@ CProximity::CProximity() : _field4(0), _channelVolume(100), _fieldC(0),
_range(0.5), _elevation(0), _posX(0.0), _posY(0.0), _posZ(0.0),
_hasVelocity(false), _velocityX(0), _velocityY(0), _velocityZ(0),
_field54(0), _field58(0), _field5C(0), _freeSoundFlag(false), _endTalkerFn(nullptr),
- _talker(nullptr), _field6C(0) {
+ _talker(nullptr), _field6C(0), _soundType(Audio::Mixer::kPlainSoundType) {
}
} // End of namespace Titanic
diff --git a/engines/titanic/sound/proximity.h b/engines/titanic/sound/proximity.h
index b728f22c26..cedb4bd94a 100644
--- a/engines/titanic/sound/proximity.h
+++ b/engines/titanic/sound/proximity.h
@@ -23,6 +23,7 @@
#ifndef TITANIC_PROXIMITY_H
#define TITANIC_PROXIMITY_H
+#include "audio/mixer.h"
#include "common/scummsys.h"
namespace Titanic {
@@ -62,6 +63,7 @@ public:
CEndTalkerFn _endTalkerFn;
TTtalker *_talker;
int _field6C;
+ Audio::Mixer::SoundType _soundType;
public:
CProximity();
};
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 045f5aad91..30772e780c 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -158,6 +158,9 @@ int CSound::playSound(const CString &name, CProximity &prox) {
return -1;
prox._field6C = waveFile->fn1();
+ if (prox._soundType != Audio::Mixer::kPlainSoundType)
+ waveFile->_soundType = prox._soundType;
+
activateSound(waveFile, prox._freeSoundFlag);
return _soundManager.playSound(*waveFile, prox);