diff options
author | Sylvain Dupont | 2010-10-10 15:47:05 +0000 |
---|---|---|
committer | Sylvain Dupont | 2010-10-10 15:47:05 +0000 |
commit | c952f7aa58e74437b1d8257409a782174b337f83 (patch) | |
tree | 092312884a6145f7521b7fbeda50736b7a202028 /engines/toon/toon.cpp | |
parent | 010fb9825ac9384402fb744713f0955922d727f1 (diff) | |
download | scummvm-rg350-c952f7aa58e74437b1d8257409a782174b337f83.tar.gz scummvm-rg350-c952f7aa58e74437b1d8257409a782174b337f83.tar.bz2 scummvm-rg350-c952f7aa58e74437b1d8257409a782174b337f83.zip |
TOON: Added special conversation musics
svn-id: r53124
Diffstat (limited to 'engines/toon/toon.cpp')
-rw-r--r-- | engines/toon/toon.cpp | 92 |
1 files changed, 88 insertions, 4 deletions
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 4843d39add..8cf62a8dff 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -962,7 +962,7 @@ void ToonEngine::loadScene(int32 SceneId, bool forGameLoad) { SoundManager.PlayMusic(); #endif - _audioManager->playMusic(_gameState->_locations[SceneId]._name, _gameState->_locations[SceneId]._music); + playRoomMusic(); _lastProcessedSceneScript = 0; _gameState->_locations[SceneId]._visited = true; @@ -1838,11 +1838,12 @@ void ToonEngine::haveAConversation(int32 convId) { _gameState->_showConversationIcons = false; _gameState->_exitConversation = false; _gameState->_sackVisible = false; - - // in conversation = 12 - // exit conversation state = 0 Conversation *conv = &state()->_conversationState[convId]; _gameState->_currentConversationId = convId; + + // change the music to the "conversation" music if needed. + playRoomMusic(); + if (conv->_enable) { // fix dialog script based on new flags for (int32 i = 0; i < 10; i++) { @@ -1920,6 +1921,9 @@ void ToonEngine::haveAConversation(int32 convId) { _gameState->_mouseHidden = false; _gameState->_sackVisible = true; + // switch back to original music + playRoomMusic(); + } void ToonEngine::drawConversationIcons() { @@ -2975,6 +2979,74 @@ void ToonEngine::restorePalette() { flushPalette(); } +const char* ToonEngine::getSpecialConversationMusic(int32 conversationId) { + const char* specialMusic[] = { "BR091013", "BR091013", + 0, 0, + "NET1214", "NET1214", + 0, 0, + "CAR1365B", "CAR1365B", + 0, 0, + 0, 0, + "CAR14431", "CAR14431", + 0, 0, + "SCD16520", "SCD16520", + "SCD16520", "SCD16520", + "SCD16522", "SCD16522", + 0, 0, + "KPM8719", "KPM8719", + 0, 0, + "CAR1368B", "CAR1368B", + 0, 0, + 0, 0, + "KPM6337", "KPM6337", + "CAR20471", "CAR20471", + "CAR136_1", "KPM87_57", + 0, 0, + "CAR13648", "CAR13648", + 0, 0, + 0, 0, + 0, 0, + 0, 0, + "SCD16526", "SCD16526", + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0, + 0, 0 }; + return specialMusic[randRange(0, 1) + conversationId * 2]; +} + void ToonEngine::viewInventoryItem(Common::String str, int32 lineId, int32 itemDest) { storePalette(); fadeOut(5); @@ -4207,6 +4279,18 @@ void ToonEngine::makeLineWalkable(int32 x, int32 y, int32 x2, int32 y2) { _currentMask->drawLineOnMask(x, y, x2, y2, true); } +void ToonEngine::playRoomMusic() { + if(_gameState->_inConversation) { + const char* music = getSpecialConversationMusic(_gameState->_currentConversationId); + if (music) { + _audioManager->playMusic(_gameState->_locations[_gameState->_currentScene]._name, music); + return; + } + } + + _audioManager->playMusic(_gameState->_locations[_gameState->_currentScene]._name, _gameState->_locations[_gameState->_currentScene]._music); +} + void SceneAnimation::save(ToonEngine *vm, Common::WriteStream *stream) { stream->writeByte(_active); stream->writeSint32BE(_id); |