aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-01-02 13:15:55 +0200
committerEugene Sandulenko2014-01-02 13:15:55 +0200
commit1d865fd826339f17ce1f94f33e7f5ee9ac1a3f15 (patch)
tree1a1709979bb20540908460acffcfa97a69a81f4b
parenta4ff43d4173dd06fcc8cc4fe034e7d7928ba677e (diff)
downloadscummvm-rg350-1d865fd826339f17ce1f94f33e7f5ee9ac1a3f15.tar.gz
scummvm-rg350-1d865fd826339f17ce1f94f33e7f5ee9ac1a3f15.tar.bz2
scummvm-rg350-1d865fd826339f17ce1f94f33e7f5ee9ac1a3f15.zip
FULLPIPE: Implement sceneHandler31()
-rw-r--r--engines/fullpipe/constants.h3
-rw-r--r--engines/fullpipe/scenes/scene31.cpp53
2 files changed, 56 insertions, 0 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 63efe7cb7b..44f42adc3c 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -749,6 +749,9 @@ namespace Fullpipe {
// Scene 31
#define ANI_CACTUS_31 2456
+#define MSG_SC31_PULL 2944
+#define MSG_SC31_TESTCACTUS 5095
+#define SND_31_001 4377
#define ST_CTS31_GROWN2 2472
// Debug scene
diff --git a/engines/fullpipe/scenes/scene31.cpp b/engines/fullpipe/scenes/scene31.cpp
index b033b8870b..30763c04d5 100644
--- a/engines/fullpipe/scenes/scene31.cpp
+++ b/engines/fullpipe/scenes/scene31.cpp
@@ -64,4 +64,57 @@ void scene31_initScene(Scene *sc) {
g_vars->scene31_plusMinus->_statics = g_vars->scene31_plusMinus->getStaticsById(ST_PMS_PLUS);
}
+void sceneHandler31_testCactus(ExCommand *cmd) {
+ warning("STUB: sceneHandler31_testCactus");
+}
+
+int sceneHandler31(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC31_TESTCACTUS:
+ sceneHandler31_testCactus(cmd);
+ break;
+
+ case MSG_SC15_STOPCHANTING:
+ g_fp->stopAllSoundInstances(SND_31_001);
+
+ g_vars->scene31_var05 = 120;
+ break;
+
+ case MSG_SC31_PULL:
+ if ( g_vars->scene31_plusMinus->_statics->_staticsId == ST_PMS_MINUS)
+ g_vars->scene31_plusMinus->_statics = g_vars->scene31_plusMinus->getStaticsById(ST_PMS_PLUS);
+ else
+ g_vars->scene31_plusMinus->_statics = g_vars->scene31_plusMinus->getStaticsById(ST_PMS_MINUS);
+
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + g_vars->scene31_var01)
+ g_fp->_currentScene->_x = x - g_vars->scene31_var03 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - g_vars->scene31_var01)
+ g_fp->_currentScene->_x = x + g_vars->scene31_var03 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene31_var05 > 0) {
+ --g_vars->scene31_var05;
+
+ if (!g_vars->scene31_var05)
+ g_fp->playSound(SND_31_001, 1);
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ break;
+ }
+
+ return 0;
+}
+
} // End of namespace Fullpipe