aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/scenes.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-19 23:19:00 +0300
committerEugene Sandulenko2013-09-06 14:51:16 +0300
commitf0795656929e09e74f85c427cbf506e35eefc44f (patch)
tree3e32cce13cd75e6b8bdcf28790f11a2521da4d9a /engines/fullpipe/scenes.cpp
parent5e21cefa72c25fa8695b3be323367411e1e7bd28 (diff)
downloadscummvm-rg350-f0795656929e09e74f85c427cbf506e35eefc44f.tar.gz
scummvm-rg350-f0795656929e09e74f85c427cbf506e35eefc44f.tar.bz2
scummvm-rg350-f0795656929e09e74f85c427cbf506e35eefc44f.zip
FULLPIPE: Implement global_messageHandler2()
Diffstat (limited to 'engines/fullpipe/scenes.cpp')
-rw-r--r--engines/fullpipe/scenes.cpp71
1 files changed, 69 insertions, 2 deletions
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 843b098aab..09fc158fa8 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -822,10 +822,77 @@ int global_messageHandler1(ExCommand *cmd) {
return 0;
}
+void staticANIObjectCallback(int *arg) {
+ *arg--;
+}
+
int global_messageHandler2(ExCommand *cmd) {
- warning("STUB: global_messageHandler2()");
+ debug(0, "global_messageHandler2()");
- return 0;
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ int res = 0;
+ StaticANIObject *ani;
+
+ switch (cmd->_messageNum) {
+ case 0x44c8:
+ // Unk3_sub_4477A0(&unk3, _parentId, _field_14 != 0);
+ break;
+
+ case 28:
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (ani)
+ ani->_priority = cmd->_field_14;
+ break;
+
+ case 25:
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (ani) {
+ if (cmd->_field_14) {
+ ani->setFlags40(true);
+ ani->_callback2 = staticANIObjectCallback;
+ } else {
+ ani->setFlags40(false);
+ ani->_callback2 = 0;
+ }
+ }
+ break;
+
+ case 26:
+ ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (ani) {
+ Movement *mov = ani->_movement;
+ if (mov)
+ mov->_currDynamicPhase->_field_68 = 0;
+ }
+ break;
+
+ default:
+#if 0
+ // We never put anything into _defMsgArray
+ while (::iterator it = g_fullpipe->_defMsgArray.begin(); it != g_fullpipe->_defMsgArray.end(); ++it)
+ if (((ExCommand *)*it)->_field_24 == _messageNum) {
+ ((ExCommand *)*it)->firef34(v13);
+ res = 1;
+ }
+#endif
+
+ //debug_msg(_messageNum);
+
+ if (!g_fullpipe->_soundEnabled || cmd->_messageNum != 33 || g_fullpipe->_currSoundListCount <= 0)
+ return res;
+
+ for (int snd = 0; snd < g_fullpipe->_currSoundListCount; snd++) {
+ SoundList *s = g_fullpipe->_currSoundList1[snd];
+ int ms = s->getCount();
+ for (int i = 0; i < ms; i++) {
+ s->getSoundByIndex(i)->setPanAndVolumeByStaticAni();
+ }
+ }
+ }
+
+ return res;
}
int global_messageHandler3(ExCommand *cmd) {