diff options
author | Eugene Sandulenko | 2013-10-28 00:49:26 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2013-10-28 01:00:06 +0200 |
commit | 0d4055fe7f68c7cff2d69b1a3d9340061434bafc (patch) | |
tree | fb8a2e90bc13923a8d69489c83d6f5edb212760f /engines | |
parent | 09128132c712d183875f62290f4683b1d3342791 (diff) | |
download | scummvm-rg350-0d4055fe7f68c7cff2d69b1a3d9340061434bafc.tar.gz scummvm-rg350-0d4055fe7f68c7cff2d69b1a3d9340061434bafc.tar.bz2 scummvm-rg350-0d4055fe7f68c7cff2d69b1a3d9340061434bafc.zip |
FULLPIPE: Implement sceneHandlerIntro()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/constants.h | 9 | ||||
-rw-r--r-- | engines/fullpipe/messages.cpp | 19 | ||||
-rw-r--r-- | engines/fullpipe/messages.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 53 |
4 files changed, 81 insertions, 2 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 796764d0a9..fe72238a02 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -35,12 +35,17 @@ namespace Fullpipe { #define MSG_ENABLESAVES 5202 #define MSG_HMRKICK_METAL 4764 #define MSG_HMRKICK_STUCCO 4765 +#define MSG_INTR_ENDINTRO 5139 +#define MSG_INTR_GETUPMAN 5135 +#define MSG_INTR_SWITCHTO1 5145 +#define MSG_INTR_SWITCHTO2 5134 #define MSG_MANSHADOWSOFF 5196 #define MSG_MANSHADOWSON 5197 #define MSG_RESTARTGAME 4767 #define MSG_SC1_SHOWOSK 1019 #define MSG_SC1_SHOWOSK2 468 #define MSG_SC1_UTRUBACLICK 1100 +#define MV_IN1MAN_SLEEP 5111 #define MV_MAN_GOLADDER 451 #define MV_MAN_GOLADDER2 2844 #define MV_MAN_LOOKUP 4773 @@ -93,6 +98,9 @@ namespace Fullpipe { #define PIC_SC1_OSK 1018 #define PIC_SC1_OSK2 2932 #define PIC_SCD_SEL 734 +#define QU_IN2_DO 5144 +#define QU_INTR_FINISH 5138 +#define QU_INTR_GETUPMAN 5136 #define SC_1 301 #define SC_10 653 #define SC_11 654 @@ -147,6 +155,7 @@ namespace Fullpipe { #define SC_TITLES 5166 #define SND_CMN_031 3516 #define SND_CMN_070 5199 +#define ST_IN1MAN_SLEEP 5112 #define ST_LBN_0N 2832 #define ST_LBN_0P 2833 #define ST_LBN_1N 2753 diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index b5f3c7fa65..cad1934c5f 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -756,4 +756,23 @@ void updateGlobalMessageQueue(int id, int objid) { } } +bool chainQueue(int queueId, int flags) { + MessageQueue *mq = g_fullpipe->_currentScene->getMessageQueueById(queueId); + + if (!mq) + return false; + + MessageQueue *nmq = new MessageQueue(mq, 0, 0); + + nmq->_flags |= flags; + + if (!mq->chain(0)) { + delete mq; + + return false; + } + + return true; +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h index 5238ba7db3..3e0da292d5 100644 --- a/engines/fullpipe/messages.h +++ b/engines/fullpipe/messages.h @@ -173,6 +173,8 @@ void processMessages(); void updateGlobalMessageQueue(int id, int objid); void clearGlobalMessageQueueList1(); +bool chainQueue(int queueId, int flags); + } // End of namespace Fullpipe #endif /* FULLPIPE_MESSAGEQUEUE_H */ diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 40d9f21afb..1793ffdc3a 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1422,8 +1422,57 @@ void sceneIntro_initScene(Scene *sc) { g_fullpipe->_modalObject = new ModalIntro; } -int sceneHandlerIntro(ExCommand *cmd) { - warning("STUB: sceneHandlerIntro()"); +void sceneHandlerIntro_part1() { + g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO1); + chainQueue(QU_INTR_FINISH, 0); +} + +void sceneHandlerIntro_part2() { + g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO2); + chainQueue(QU_IN2_DO, 0); +} + +int sceneHandlerIntro(ExCommand *ex) { + if (ex->_messageKind != 17) + return 0; + + switch (ex->_messageNum) { + case MSG_INTR_ENDINTRO: + g_vars->sceneIntro_playing = 0; + return 0; + + case MSG_INTR_SWITCHTO1: + sceneHandlerIntro_part1(); + return 0; + + case MSG_INTR_GETUPMAN: + g_vars->sceneIntro_needSleep = 0; + g_vars->sceneIntro_needGetup = 1; + return 0; + + case MSG_INTR_SWITCHTO2: + sceneHandlerIntro_part2(); + return 0; + + case 33: + // fall trhough + break; + + default: + return 0; + } + + if (g_vars->sceneIntro_needSleep) { + if (!g_vars->sceneIntro_aniin1man->_movement && g_vars->sceneIntro_aniin1man->_statics->_staticsId == ST_IN1MAN_SLEEP) + g_vars->sceneIntro_aniin1man->startAnim(MV_IN1MAN_SLEEP, 0, -1); + } else if (g_vars->sceneIntro_needGetup && !g_vars->sceneIntro_aniin1man->_movement && + g_vars->sceneIntro_aniin1man->_statics->_staticsId == ST_IN1MAN_SLEEP) { + g_vars->sceneIntro_needGetup = 0; + + chainQueue(QU_INTR_GETUPMAN, 0); + } + + g_fullpipe->startSceneTrack(); return 0; } |