diff options
author | Paul Gilbert | 2016-08-09 21:51:19 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-09 21:51:19 -0400 |
commit | 668c486f4fdf270a88cfd799ba54871d5a314383 (patch) | |
tree | e7c48a32fb9ff2ce2aa7b739faa3311c9cd52e70 /engines/titanic/sound/room_trigger_auto_music_player.cpp | |
parent | 30936a6115160e8e79b3c768c2ee97aae9cbd554 (diff) | |
download | scummvm-rg350-668c486f4fdf270a88cfd799ba54871d5a314383.tar.gz scummvm-rg350-668c486f4fdf270a88cfd799ba54871d5a314383.tar.bz2 scummvm-rg350-668c486f4fdf270a88cfd799ba54871d5a314383.zip |
TITANIC: Implemented more sound related classes
Diffstat (limited to 'engines/titanic/sound/room_trigger_auto_music_player.cpp')
-rw-r--r-- | engines/titanic/sound/room_trigger_auto_music_player.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.cpp b/engines/titanic/sound/room_trigger_auto_music_player.cpp index 4506dfd7d4..7782cef0e2 100644 --- a/engines/titanic/sound/room_trigger_auto_music_player.cpp +++ b/engines/titanic/sound/room_trigger_auto_music_player.cpp @@ -24,6 +24,11 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CRoomTriggerAutoMusicPlayer, CTriggerAutoMusicPlayer) + ON_MESSAGE(LeaveRoomMsg) + ON_MESSAGE(EnterRoomMsg) +END_MESSAGE_MAP() + void CRoomTriggerAutoMusicPlayer::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CTriggerAutoMusicPlayer::save(file, indent); @@ -34,8 +39,23 @@ void CRoomTriggerAutoMusicPlayer::load(SimpleFile *file) { CTriggerAutoMusicPlayer::load(file); } +bool CRoomTriggerAutoMusicPlayer::LeaveRoomMsg(CLeaveRoomMsg *msg) { + if (msg->_oldRoom == findRoom()) { + CTriggerAutoMusicPlayerMsg triggerMsg; + triggerMsg._value = 1; + triggerMsg.execute(this); + } + + return true; +} + bool CRoomTriggerAutoMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) { - warning("CRoomTriggerAutoMusicPlayer::handleEvent"); + if (msg->_newRoom == findRoom()) { + CTriggerAutoMusicPlayerMsg triggerMsg; + triggerMsg._value = 2; + triggerMsg.execute(this); + } + return true; } |