diff options
author | Paul Gilbert | 2016-08-08 23:19:42 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-08 23:19:42 -0400 |
commit | 5b8fdfe366b9acb2fd1d80cd0839e2af61238f08 (patch) | |
tree | 32960daa44d203e39fbcbbed801fd517040a771a /engines/titanic/sound/trigger_auto_music_player.cpp | |
parent | 0b952c3ceded860f2051c77fefb17593dfb5ff05 (diff) | |
download | scummvm-rg350-5b8fdfe366b9acb2fd1d80cd0839e2af61238f08.tar.gz scummvm-rg350-5b8fdfe366b9acb2fd1d80cd0839e2af61238f08.tar.bz2 scummvm-rg350-5b8fdfe366b9acb2fd1d80cd0839e2af61238f08.zip |
TITANIC: Implemented more sound classes
Diffstat (limited to 'engines/titanic/sound/trigger_auto_music_player.cpp')
-rw-r--r-- | engines/titanic/sound/trigger_auto_music_player.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/engines/titanic/sound/trigger_auto_music_player.cpp b/engines/titanic/sound/trigger_auto_music_player.cpp index 21050e0877..a332570aba 100644 --- a/engines/titanic/sound/trigger_auto_music_player.cpp +++ b/engines/titanic/sound/trigger_auto_music_player.cpp @@ -21,19 +21,41 @@ */ #include "titanic/sound/trigger_auto_music_player.h" +#include "titanic/sound/auto_music_player.h" +#include "titanic/core/room_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CTriggerAutoMusicPlayer, CGameObject) + ON_MESSAGE(TriggerAutoMusicPlayerMsg) +END_MESSAGE_MAP() + void CTriggerAutoMusicPlayer::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_fieldBC, indent); + file->writeQuotedLine(_roomName, indent); CGameObject::save(file, indent); } void CTriggerAutoMusicPlayer::load(SimpleFile *file) { file->readNumber(); - _fieldBC = file->readString(); + _roomName = file->readString(); CGameObject::load(file); } +bool CTriggerAutoMusicPlayer::TriggerAutoMusicPlayerMsg(CTriggerAutoMusicPlayerMsg *msg) { + CRoomItem *room1 = msg->_value == 1 ? locateRoom(_roomName) : findRoom(); + CRoomItem *room2 = msg->_value == 2 ? locateRoom(_roomName) : findRoom(); + + CChangeMusicMsg changeMsg; + changeMsg._flags = 1; + changeMsg.execute(room1, CAutoMusicPlayer::_type, + MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN); + + changeMsg._flags = 2; + changeMsg.execute(room2, CAutoMusicPlayer::_type, + MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN); + + return true; +} + } // End of namespace Titanic |