[Scummvm-cvs-logs] SF.net SVN: scummvm:[53124] scummvm/trunk/engines/toon
sylvaintv at users.sourceforge.net
sylvaintv at users.sourceforge.net
Sun Oct 10 17:47:06 CEST 2010
Revision: 53124
http://scummvm.svn.sourceforge.net/scummvm/?rev=53124&view=rev
Author: sylvaintv
Date: 2010-10-10 15:47:05 +0000 (Sun, 10 Oct 2010)
Log Message:
-----------
TOON: Added special conversation musics
Modified Paths:
--------------
scummvm/trunk/engines/toon/toon.cpp
scummvm/trunk/engines/toon/toon.h
Modified: scummvm/trunk/engines/toon/toon.cpp
===================================================================
--- scummvm/trunk/engines/toon/toon.cpp 2010-10-10 15:27:39 UTC (rev 53123)
+++ scummvm/trunk/engines/toon/toon.cpp 2010-10-10 15:47:05 UTC (rev 53124)
@@ -962,7 +962,7 @@
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 @@
_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 @@
_gameState->_mouseHidden = false;
_gameState->_sackVisible = true;
+ // switch back to original music
+ playRoomMusic();
+
}
void ToonEngine::drawConversationIcons() {
@@ -2975,6 +2979,74 @@
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 @@
_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);
Modified: scummvm/trunk/engines/toon/toon.h
===================================================================
--- scummvm/trunk/engines/toon/toon.h 2010-10-10 15:27:39 UTC (rev 53123)
+++ scummvm/trunk/engines/toon/toon.h 2010-10-10 15:47:05 UTC (rev 53124)
@@ -183,8 +183,9 @@
virtual void viewInventoryItem(Common::String str, int32 lineId, int32 itemDest);
virtual void storePalette();
virtual void restorePalette();
+ virtual const char* getSpecialConversationMusic(int32 locationId);
+ virtual void playRoomMusic();
-
Resources *resources() {
return _resources;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list