From 82367c9b4083b52288caece983413c373c84d9ed Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 2 Jan 2014 22:32:41 +0200 Subject: FULLPIPE: Implement sceneHandler22() --- engines/fullpipe/constants.h | 8 +++ engines/fullpipe/objectnames.h | 2 +- engines/fullpipe/scenes/scene15.cpp | 2 +- engines/fullpipe/scenes/scene22.cpp | 119 ++++++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 0ac3cad222..6b82165f33 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -742,7 +742,15 @@ namespace Fullpipe { // Scene 22 #define ANI_GIRAFFE_MIDDLE 1981 #define ANI_MESHOK 1754 +#define MSG_SC22_CHECKGMABOOT 4782 +#define MSG_SC22_CRANEOUT_GMA 5218 +#define MSG_SC22_FROMSTOOL 1799 +#define MSG_SC22_HANDLEDOWN 1796 +#define MSG_SC22_HIDESTOOL 2503 +#define MSG_SC22_ONSTOOL 1798 +#define MSG_SC22_SHOWSTOOL 2495 #define QU_MSH_CRANEOUT 1811 +#define QU_MSH_CRANEOUT_GMA 5219 #define QU_MSH_MOVE 1812 #define ST_GRFM_AFTER 3472 #define ST_GRFM_NORM 1983 diff --git a/engines/fullpipe/objectnames.h b/engines/fullpipe/objectnames.h index 06888b6b91..594f0a6a3f 100644 --- a/engines/fullpipe/objectnames.h +++ b/engines/fullpipe/objectnames.h @@ -166,7 +166,7 @@ namespace Fullpipe { #define sO_FullPipe "\xcf\xee\xeb\xed\xe0\xff \xd2\xf0\xf3\xe1\xe0" // "Полная Труба" #define sO_RightStairs_9 "\xcf\xf0\xe0\xe2\xe0\xff \xeb\xe5\xf1\xf2\xed\xe8\xf6\xe0_9" // "Правая лестница_9" #define sO_RightPipe_17 "\xcf\xf0\xe0\xe2\xe0\xff \xf2\xf0\xf3\xe1\xe0_17" // "Правая труба_17" -#define sO_Available "\xcf\xf0\xe8\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Присутствует" +#define sO_IsPresent "\xcf\xf0\xe8\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Присутствует" #define sO_GulpedEgg "\xcf\xf0\xee\xe3\xeb\xee\xf7\xe5\xed\xed\xee\xe5 \xff\xe9\xf6\xee" // "Проглоченное яйцо" #define sO_GulpedEggs "\xcf\xf0\xee\xe3\xeb\xee\xf7\xe5\xed\xed\xfb\xe5 \xff\xe9\xf6\xe0" // "Проглоченные яйца" #define sO_BellyInflater "\xcf\xf3\xe7\xee\xe4\xf3\xe2" // "Пузодув" diff --git a/engines/fullpipe/scenes/scene15.cpp b/engines/fullpipe/scenes/scene15.cpp index 8310fc8607..fa8db64497 100644 --- a/engines/fullpipe/scenes/scene15.cpp +++ b/engines/fullpipe/scenes/scene15.cpp @@ -82,7 +82,7 @@ void scene15_initScene(Scene *sc) { g_vars->scene15_ladder = sc->getPictureObjectById(PIC_SC15_LADDER, 0); g_vars->scene15_boot = sc->getStaticANIObject1ById(ANI_BOOT_15, -1); - if (g_fp->getObjectState(sO_Boot_15) != g_fp->getObjectEnumState(sO_Boot_15, sO_Available)) + if (g_fp->getObjectState(sO_Boot_15) != g_fp->getObjectEnumState(sO_Boot_15, sO_IsPresent)) g_vars->scene15_boot->_flags &= 0xFFFB; g_fp->_currentScene = oldsc; diff --git a/engines/fullpipe/scenes/scene22.cpp b/engines/fullpipe/scenes/scene22.cpp index d28ea922f3..b57cf9399b 100644 --- a/engines/fullpipe/scenes/scene22.cpp +++ b/engines/fullpipe/scenes/scene22.cpp @@ -105,4 +105,123 @@ void scene22_setBagState() { } } +void sceneHandler22_showStool() { + warning("STUB: sceneHandler22_showStool()"); +} + +void sceneHandler22and23_hideStool() { + warning("STUB: sceneHandler22and23_hideStool()"); +} + +void sceneHandler22_handleDown() { + warning("STUB: sceneHandler22_handleDown()"); +} + +void sceneHandler22_sub01(ExCommand *cmd) { + warning("STUB: sceneHandler22_sub01(cmd)"); +} + +void sceneHandler22_sub02(ExCommand *cmd) { + warning("STUB: sceneHandler22_sub02(cmd)"); +} + + +int sceneHandler22(ExCommand *cmd) { + if (cmd->_messageKind != 17) + return 0; + + switch (cmd->_messageNum) { + case MSG_SC22_CRANEOUT_GMA: + chainQueue(QU_MSH_CRANEOUT_GMA, 1); + break; + + case MSG_SC22_CHECKGMABOOT: + if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_In_15)) + g_fp->setObjectState(sO_Boot_15, g_fp->getObjectEnumState(sO_Boot_15, sO_IsPresent)); + + break; + + case MSG_SC22_SHOWSTOOL: + sceneHandler22_showStool(); + break; + + case MSG_SC22_HIDESTOOL: + sceneHandler22and23_hideStool(); + break; + + case MSG_SC22_FROMSTOOL: + g_vars->scene22_var07 = 0; + g_vars->scene22_var08 = 0; + + getCurrSceneSc2MotionController()->setEnabled(); + g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1); + break; + + case MSG_SC22_ONSTOOL: + g_vars->scene22_var07 = 1; + getCurrSceneSc2MotionController()->clearEnabled(); + g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0); + break; + + case MSG_SC22_HANDLEDOWN: + sceneHandler22_handleDown(); + break; + + case 29: + if (!g_vars->scene22_var08) { + StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY); + if (ani && ani->_id == ANI_HANDLE_L) { + sceneHandler22_sub02(cmd); + return 0; + } + if (!g_vars->scene22_var07) { + 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); + return 0; + } + } + } + return 0; + } + if (g_fp->_aniMan->_statics->_staticsId == ST_MAN_RIGHT && !g_fp->_aniMan->_movement) { + sceneHandler22_sub01(cmd); + + return 0; + } + } + + cmd->_messageKind = 0; + break; + + case 33: + if (g_fp->_aniMan2) { + int x = g_fp->_aniMan2->_ox; + + if (x <= g_fp->_sceneWidth - 460) { + if (x < g_fp->_sceneRect.left + g_vars->scene22_var01) + g_fp->_currentScene->_x = x - g_vars->scene22_var03 - g_fp->_sceneRect.left; + } else { + g_fp->_currentScene->_x = g_fp->_sceneWidth - x; + } + + if (x > g_fp->_sceneRect.right - g_vars->scene22_var01 ) + g_fp->_currentScene->_x = x + g_vars->scene22_var03 - g_fp->_sceneRect.right; + + g_fp->_behaviorManager->updateBehaviors(); + + g_fp->startSceneTrack(); + } + + break; + } + + return 0; +} + } // End of namespace Fullpipe -- cgit v1.2.3