aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/constants.h4
-rw-r--r--engines/fullpipe/scenes.cpp3
-rw-r--r--engines/fullpipe/scenes.h3
-rw-r--r--engines/fullpipe/scenes/scene37.cpp103
4 files changed, 112 insertions, 1 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index b1d0809ae1..13c1da6830 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -1287,7 +1287,11 @@ namespace Fullpipe {
// Scene 37
#define ANI_GUARD_37 2588
#define ANI_RING 2604
+#define MSG_SC37_EXITLEFT 5006
+#define MSG_SC37_PULL 2945
+#define MV_GRD37_PULL 2589
#define PIC_SC37_MASK 2608
+#define SND_37_007 4547
#define ST_RNG_CLOSED2 4865
#define ST_RNG_OPEN 2606
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index de7ddfe154..e8df272c1a 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -366,6 +366,9 @@ Vars::Vars() {
scene37_plusMinus1 = 0;
scene37_plusMinus2 = 0;
scene37_plusMinus3 = 0;
+ scene37_var07 = 0;
+ scene37_var09 = 0;
+ scene37_var10 = 0;
selector = 0;
}
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 0137df3416..34218e4e0c 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -513,7 +513,8 @@ public:
StaticANIObject *scene37_plusMinus1;
StaticANIObject *scene37_plusMinus2;
StaticANIObject *scene37_plusMinus3;
-
+ int scene37_var09;
+ int scene37_var10;
PictureObject *selector;
};
diff --git a/engines/fullpipe/scenes/scene37.cpp b/engines/fullpipe/scenes/scene37.cpp
index 0383212b84..9bbc6ea901 100644
--- a/engines/fullpipe/scenes/scene37.cpp
+++ b/engines/fullpipe/scenes/scene37.cpp
@@ -160,4 +160,107 @@ int scene37_updateCursor() {
return g_fp->_cursorId;
}
+void sceneHandler37_updateRing(int num) {
+ warning("STUB: sceneHandler37_updateRing()");
+}
+
+void sceneHandler37_setRingsState() {
+ warning("STUB: sceneHandler37_setRingsState()");
+}
+
+int sceneHandler37(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch(cmd->_messageNum) {
+ case MSG_SC37_EXITLEFT:
+ sceneHandler37_updateRing(0);
+ sceneHandler37_updateRing(1);
+ sceneHandler37_updateRing(2);
+
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ 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;
+ }
+ }
+ }
+ }
+
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ g_vars->scene37_var10 = x;
+
+ if (x >= 500) {
+ if (x < g_fp->_sceneRect.left + g_vars->scene37_var01)
+ g_fp->_currentScene->_x = x - g_vars->scene37_var03 - g_fp->_sceneRect.left;
+ } else {
+ g_fp->_currentScene->_x = -g_fp->_sceneRect.left;
+ }
+ x = g_vars->scene37_var10;
+
+ if (x > g_fp->_sceneRect.right - g_vars->scene37_var01)
+ g_fp->_currentScene->_x = x + g_vars->scene37_var03 - g_fp->_sceneRect.right;
+ }
+
+ sceneHandler37_setRingsState();
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ ++g_vars->scene37_var09;
+
+ break;
+
+ case MSG_SC37_PULL:
+ if (g_vars->scene37_var05[0]->ani->_movement && g_vars->scene37_var05[0]->ani->_movement->_id == MV_GRD37_PULL) {
+ if ((g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_On) && !g_vars->scene37_var05[0]->state)
+ || (g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_Off) && g_vars->scene37_var05[0]->state)) {
+ g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_PLUS);
+ } else {
+ g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_MINUS);
+ }
+ } else if (g_vars->scene37_var05[1]->ani->_movement && g_vars->scene37_var05[1]->ani->_movement->_id == MV_GRD37_PULL) {
+ if ((g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_On) && !g_vars->scene37_var05[1]->state)
+ || (g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_Off) && g_vars->scene37_var05[1]->state)) {
+ g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_PLUS);
+ } else {
+ g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_MINUS);
+ }
+ } else if (g_vars->scene37_var05[2]->ani->_movement && g_vars->scene37_var05[2]->ani->_movement->_id == MV_GRD37_PULL) {
+ if ((g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_On) && !g_vars->scene37_var05[2]->state)
+ || (g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_Off) && g_vars->scene37_var05[2]->state)) {
+ g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_PLUS);
+ } else {
+ g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_MINUS);
+ }
+ }
+
+ if (g_vars->scene37_var09) {
+ g_fp->playSound(SND_37_007, 0);
+
+ g_vars->scene37_var09 = 0;
+ }
+
+ break;
+ }
+
+ return 0;
+}
+
} // End of namespace Fullpipe