aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-01-06 22:15:47 +0200
committerEugene Sandulenko2014-01-06 22:36:16 +0200
commit2e84bb24dfb70719c489f6c8e01fcdecfbe7825d (patch)
tree90db3891b4a49151c0e5c1363e8714ac72ead320
parentac0b27f25f9da389be89b511bc25d169f6a38a10 (diff)
downloadscummvm-rg350-2e84bb24dfb70719c489f6c8e01fcdecfbe7825d.tar.gz
scummvm-rg350-2e84bb24dfb70719c489f6c8e01fcdecfbe7825d.tar.bz2
scummvm-rg350-2e84bb24dfb70719c489f6c8e01fcdecfbe7825d.zip
FULLPIPE: Implement sceneHandler28()
-rw-r--r--engines/fullpipe/constants.h31
-rw-r--r--engines/fullpipe/scenes.h4
-rw-r--r--engines/fullpipe/scenes/scene28.cpp228
3 files changed, 261 insertions, 2 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 7ff270345f..9e0b0c135d 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -980,6 +980,37 @@ namespace Fullpipe {
// Scene 28
#define ANI_LIFT 982
#define ANI_LIFT_28 4238
+#define MSG_SC28_CLICKLIFT 4258
+#define MSG_SC28_ENDCABIN 3456
+#define MSG_SC28_ENDLIFT1 4259
+#define MSG_SC28_ENDLIFT6 4244
+#define MSG_SC28_LIFT1_SHOWAFTER 4261
+#define MSG_SC28_LIFT6INSIDE 5354
+#define MSG_SC28_LIFT6MUSIC 5355
+#define MSG_SC28_MAKEFACES 4684
+#define MSG_SC28_STARTWORK1 4255
+#define MSG_SC28_TRYVTORPERS 4961
+#define MSG_SC28_TURNOFF_0 4678
+#define MSG_SC28_TURNOFF_1 4279
+#define MSG_SC28_TURNOFF_2 4277
+#define MSG_SC28_TURNOFF_3 4275
+#define MSG_SC28_TURNOFF_4 4282
+#define MSG_SC28_TURNOFF_6 4273
+#define MSG_SC28_TURNON4 4280
+#define MSG_SC28_TURNON_0 4677
+#define MSG_SC28_TURNON_1 4278
+#define MSG_SC28_TURNON_2 4276
+#define MSG_SC28_TURNON_3 4274
+#define MSG_SC28_TURNON_4 4281
+#define MSG_SC28_TURNON_6 4272
+#define PIC_SC28_DARK0 4675
+#define PIC_SC28_DARK1 4266
+#define PIC_SC28_DARK2 4267
+#define PIC_SC28_DARK3 4268
+#define PIC_SC28_DARK4 4269
+#define PIC_SC28_DARK5 4270
+#define PIC_SC28_DARK6 4271
+#define QU_SC28_LIFT6_END 3563
// Scene 30
#define ANI_LEG 2322
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 7d7bb6e48d..e1b05d98b0 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -428,8 +428,8 @@ public:
int scene28_var04;
int scene28_var05;
int scene28_var06;
- int scene28_var07;
- int scene28_var08;
+ PictureObject *scene28_var07;
+ PictureObject *scene28_var08;
int scene28_var09;
int scene28_var10;
int scene28_var11;
diff --git a/engines/fullpipe/scenes/scene28.cpp b/engines/fullpipe/scenes/scene28.cpp
index 10139a911e..f9e9a03ae3 100644
--- a/engines/fullpipe/scenes/scene28.cpp
+++ b/engines/fullpipe/scenes/scene28.cpp
@@ -63,4 +63,232 @@ int scene28_updateCursor() {
return g_fp->_cursorId;
}
+void sceneHandler28_lift1ShowAfter() {
+ warning("STUB: sceneHandler28_lift1ShowAfter()");
+}
+
+void sceneHandler28_makeFaces(ExCommand *cmd, int entranceId) {
+ warning("STUB: sceneHandler28_makeFaces()");
+}
+
+void sceneHandler28_trySecondaryPers() {
+ warning("STUB: sceneHandler28_trySecondaryPers()");
+}
+
+void sceneHandler28_turnOn2() {
+ warning("STUB: sceneHandler28_turnOn2()");
+}
+
+void sceneHandler28_startWork1() {
+ warning("STUB: sceneHandler28_startWork1()");
+}
+
+void sceneHandler28_clickLift(int keyCode) {
+ warning("STUB: sceneHandler28_clickLift()");
+}
+
+void sceneHandler28_lift0Start() {
+ warning("STUB: sceneHandler28_lift0Start()");
+}
+
+void sceneHandler28_lift1Start() {
+ warning("STUB: sceneHandler28_lift1Start()");
+}
+
+void sceneHandler28_lift2Start() {
+ warning("STUB: sceneHandler28_lift2Start()");
+}
+
+void sceneHandler28_lift3Start() {
+ warning("STUB: sceneHandler28_lift3Start()");
+}
+
+void sceneHandler28_lift4Start() {
+ warning("STUB: sceneHandler28_lift4Start()");
+}
+
+void sceneHandler28_lift5Start() {
+ warning("STUB: sceneHandler28_lift5Start()");
+}
+
+void sceneHandler28_lift6Start() {
+ warning("STUB: sceneHandler28_lift6Start()");
+}
+
+
+int sceneHandler28(ExCommand *cmd, int entranceId) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC28_LIFT6MUSIC:
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_28"), "MUSIC_TIOTIA", 1);
+ break;
+
+ case MSG_SC28_LIFT6INSIDE:
+ g_vars->scene28_var11 = 1;
+ break;
+
+ case MSG_SC28_LIFT1_SHOWAFTER:
+ sceneHandler28_lift1ShowAfter();
+ break;
+
+ case MSG_SC28_MAKEFACES:
+ sceneHandler28_makeFaces(cmd, entranceId);
+ break;
+
+ case MSG_SC28_TRYVTORPERS:
+ sceneHandler28_trySecondaryPers();
+ break;
+
+ case MSG_SC28_TURNOFF_0:
+ g_vars->scene28_var08 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK0, 0);
+ g_vars->scene28_var08->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_0:
+ g_vars->scene28_var07 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK0, 0);
+ break;
+
+ case MSG_SC28_TURNON_1:
+ g_vars->scene28_var07 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK1, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_1:
+ g_vars->scene28_var08 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK1, 0);
+ g_vars->scene28_var08->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_2:
+ g_vars->scene28_var07 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK2, 0);
+ sceneHandler28_turnOn2();
+ break;
+
+ case MSG_SC28_TURNOFF_2:
+ g_vars->scene28_var08 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK2, 0);
+ g_vars->scene28_var08->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_3:
+ g_vars->scene28_var07 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK3, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_3:
+ g_vars->scene28_var08 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK3, 0);
+ g_vars->scene28_var08->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_4:
+ g_vars->scene28_var07 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK4, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_4:
+ g_vars->scene28_var08 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK4, 0);
+ g_vars->scene28_var08->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_6:
+ g_vars->scene28_var07 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK6, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_6:
+ g_vars->scene28_var08 = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK6, 0);
+ g_vars->scene28_var08->_flags |= 4;
+ break;
+
+ case MSG_SC28_STARTWORK1:
+ sceneHandler28_startWork1();
+ break;
+
+ case MSG_SC28_CLICKLIFT:
+ sceneHandler28_clickLift(cmd->_keyCode);
+ break;
+
+ case MSG_SC28_ENDLIFT1:
+ case MSG_SC28_ENDLIFT6:
+ case MSG_SC28_ENDCABIN:
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+ g_fp->_aniMan->_flags &= 0xFEFF;
+ break;
+
+ case 29:
+ {
+ if (g_vars->scene28_var11) {
+ chainObjQueue(g_fp->_aniMan, QU_SC28_LIFT6_END, 1);
+
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_28"), "MUSIC", 1);
+
+ g_vars->scene28_var11 = 0;
+ }
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani)
+ if (ani->_id == ANI_LIFT || ani->_id == ANI_LIFT_28 ) {
+ sceneHandler28_clickLift(ani->_okeyCode);
+
+ cmd->_messageKind = 0;
+ break;
+ }
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0))
+ g_fp->processArcade(cmd);
+ }
+ }
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + g_vars->scene28_var01)
+ g_fp->_currentScene->_x = x - g_vars->scene28_var03 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - g_vars->scene28_var01)
+ g_fp->_currentScene->_x = x + g_vars->scene28_var03 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene28_var07) {
+ if (g_vars->scene28_var07->_picture->getAlpha() > 10) {
+ g_vars->scene28_var07->_picture->setAlpha(g_vars->scene28_var07->_picture->getAlpha() - 10);
+ } else {
+ g_vars->scene28_var07->_flags &= 0xFFFB;
+
+ g_vars->scene28_var07 = 0;
+ }
+ }
+
+ if (g_vars->scene28_var08) {
+ if (g_vars->scene28_var08->_picture->getAlpha() < 0xF9u ) {
+ g_vars->scene28_var08->_picture->setAlpha(g_vars->scene28_var08->_picture->getAlpha() + 6);
+ } else {
+ g_vars->scene28_var08->_picture->setAlpha(0xff);
+
+ g_vars->scene28_var08 = 0;
+ }
+ }
+
+ g_fp->_floaters->update();
+
+ for (uint i = 0; i < g_fp->_floaters->_array2.size(); i++)
+ if (g_fp->_floaters->_array2[i]->val13 == 1)
+ g_fp->_floaters->_array2[i]->ani->_priority = 15;
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
} // End of namespace Fullpipe