aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-08 08:13:05 -0400
committerPaul Gilbert2016-08-08 08:13:05 -0400
commit3bece5f4788779b2c0af3a2bb422e05a183b6d6b (patch)
tree515a6eca684830bb6b3b2b05238695a557152ab8 /engines/titanic/core
parenta1affaa698516e93763e812281e7d9609f098193 (diff)
downloadscummvm-rg350-3bece5f4788779b2c0af3a2bb422e05a183b6d6b.tar.gz
scummvm-rg350-3bece5f4788779b2c0af3a2bb422e05a183b6d6b.tar.bz2
scummvm-rg350-3bece5f4788779b2c0af3a2bb422e05a183b6d6b.zip
TITANIC: Implemented CSeasonalMusicPlayer class
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/game_object.cpp9
-rw-r--r--engines/titanic/core/game_object.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 897eab88f4..ecaa415e31 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -38,11 +38,12 @@ namespace Titanic {
EMPTY_MESSAGE_MAP(CGameObject, CNamedItem);
CCreditText *CGameObject::_credits;
-int CGameObject::_soundHandles[3];
+int CGameObject::_soundHandles[4];
void CGameObject::init() {
_credits = nullptr;
- _soundHandles[0] = _soundHandles[1] = _soundHandles[2] = -1;
+ _soundHandles[0] = _soundHandles[1] = 0;
+ _soundHandles[2] = _soundHandles[3] = -1;
}
void CGameObject::deinit() {
@@ -501,7 +502,7 @@ void CGameObject::stopGlobalSound(bool transition, int handleIndex) {
CSound &sound = gameManager->_sound;
if (handleIndex == -1) {
- for (int idx = 0; idx < 3; ++idx) {
+ for (int idx = 0; idx < 4; ++idx) {
if (_soundHandles[idx] != -1) {
sound.setVolume(_soundHandles[idx], 0, transition ? 1 : 0);
sound.setCanFree(_soundHandles[idx]);
@@ -531,7 +532,7 @@ void CGameObject::setGlobalSoundVolume(int mode, uint seconds, int handleIndex)
// Iterate through calling the method for each handle
for (int idx = 0; idx < 3; ++idx)
setGlobalSoundVolume(mode, seconds, idx);
- } else if (handleIndex >= 0 && handleIndex <= 2 && _soundHandles[handleIndex] != -1) {
+ } else if (handleIndex >= 0 && handleIndex <= 3 && _soundHandles[handleIndex] != -1) {
uint newVolume = sound._soundManager.getModeVolume(mode);
sound.setVolume(_soundHandles[handleIndex], newVolume, seconds);
}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index e446cc3251..799cbccbed 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -53,7 +53,7 @@ class CGameObject : public CNamedItem {
DECLARE_MESSAGE_MAP;
private:
static CCreditText *_credits;
- static int _soundHandles[3];
+ static int _soundHandles[4];
private:
/**
* Load a visual resource for the object