aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
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/core
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/core')
-rw-r--r--engines/titanic/core/game_object.cpp4
-rw-r--r--engines/titanic/core/game_object.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 2c7b7db998..4b88f07478 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -438,7 +438,8 @@ bool CGameObject::isSoundActive(int handle) const {
return false;
}
-void CGameObject::playGlobalSound(const CString &resName, int mode, bool initialMute, bool repeated, int handleIndex) {
+void CGameObject::playGlobalSound(const CString &resName, int mode, bool initialMute, bool repeated,
+ int handleIndex, Audio::Mixer::SoundType soundType) {
if (handleIndex < 0 || handleIndex > 3)
return;
CGameManager *gameManager = getGameManager();
@@ -463,6 +464,7 @@ void CGameObject::playGlobalSound(const CString &resName, int mode, bool initial
CProximity prox;
prox._channelVolume = volume;
prox._repeated = repeated;
+ prox._soundType = soundType;
switch (handleIndex) {
case 0:
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 182d165e89..d72fd94ac4 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -23,6 +23,7 @@
#ifndef TITANIC_GAME_OBJECT_H
#define TITANIC_GAME_OBJECT_H
+#include "audio/mixer.h"
#include "common/stream.h"
#include "titanic/support/mouse_cursor.h"
#include "titanic/support/credit_text.h"
@@ -234,8 +235,10 @@ protected:
* @param initialMute If set, sound transitions in from mute over 2 seconds
* @param repeated Flag for repeating sounds
* @param handleIndex Slot 0 to 3 in the shared sound handle list to store the sound's handle
+ * @param soundType Specifies whether the sound is a sound effect or music
*/
- void playGlobalSound(const CString &resName, int mode, bool initialMute, bool repeated, int handleIndex);
+ void playGlobalSound(const CString &resName, int mode, bool initialMute, bool repeated,
+ int handleIndex, Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType);
/**
* Stops a sound saved in the global sound handle list