From fa8027203c0e3aea23e3b15f6a2382d0fbfc56b5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 9 Sep 2013 23:23:33 +0300 Subject: FULLPIPE: Started debug scene --- engines/fullpipe/constants.h | 1 + engines/fullpipe/gameloader.cpp | 3 +++ engines/fullpipe/scenes.cpp | 59 ++++++++++++++++++++++++++++++++++++++++- engines/fullpipe/scenes.h | 2 ++ 4 files changed, 64 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 5048bf9795..f99e679e4e 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -90,6 +90,7 @@ namespace Fullpipe { #define PIC_SC1_LADDER 1091 #define PIC_SC1_OSK 1018 #define PIC_SC1_OSK2 2932 +#define PIC_SCD_SEL 734 #define SC_1 301 #define SC_10 653 #define SC_11 654 diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index f48c407a57..a44501b17d 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -173,6 +173,9 @@ bool CGameLoader::gotoScene(int sceneId, int entranceId) { if (_sc2array[sc2idx]._entranceDataCount <= 0) return false; + if (sceneId == 726) + return true; + int entranceIdx; for (entranceIdx = 0; _sc2array[sc2idx]._entranceData[entranceIdx]->_field_4 != entranceId; entranceIdx++) { if (entranceIdx >= _sc2array[sc2idx]._entranceDataCount) diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index f4e771af56..bedfa4c80e 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -53,6 +53,9 @@ void scene01_fixEntrance(); void scene01_initScene(Scene *sc, int entrance); int sceneHandler01(ExCommand *cmd); +void sceneDbgMenu_initScene(Scene *sc); +int sceneHandlerDbgMenu(ExCommand *cmd); + Vars::Vars() { sceneIntro_aniin1man = 0; sceneIntro_needSleep = true; @@ -632,6 +635,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { addMessageHandler(sceneHandlerFinal1, 2); _updateCursorCallback = sceneFinal1_updateCursor; break; +#endif case SC_DBGMENU: sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_DBGMENU"); @@ -641,7 +645,6 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_DBGMENU"); addMessageHandler(sceneHandlerDbgMenu, 2); break; -#endif default: _behaviorManager->initBehavior(0, 0); @@ -847,6 +850,7 @@ int global_messageHandler2(ExCommand *cmd) { switch (cmd->_messageNum) { case 0x44c8: + error("0x44c8"); // Unk3_sub_4477A0(&unk3, _parentId, _field_14 != 0); break; @@ -1430,4 +1434,57 @@ int sceneHandler01(ExCommand *cmd) { return res; } +void sceneDbgMenu_initScene(Scene *sc) { + g_vars->selector = sc->getPictureObjectById(PIC_SCD_SEL, 0); + getGameLoaderInteractionController()->disableFlag24(); + setInputDisabled(0); +} + +int sceneHandlerDbgMenu(ExCommand *ex) { + if (ex->_messageKind != 17) + return 0; +#if 0 + int mx = g_fullpipe->_mouseScreenPos.x + g_sceneRect.left; + int my = g_fullpipe->_mouseScreenPos.y + g_sceneRect.top; + + if (ex->_messageNum == 29) { + GameObject *obj = sceneHandlerDbgMenu_getObjectAtXY(mx, my); + if (obj && GameObject_canInteractAny(0, obj, -3) ) { + getGameLoaderInteractionController()->enableFlag24(); + handleObjectInteraction(0, obj, 0); + } + return 0; + } + if (ex->_messageNum != 33) { + if (ex->_messageNum == MSG_RESTARTGAME) { + g_fullpipe->_needRestart = true; + return 0; + } + return 0; + } + + g_fullpipe->_cursorId = PIC_CSR_DEFAULT; + GameObject *obj = g_fullpipe->_currentScene->getStaticANIObjectAtPos(mx, my); + if (obj) { + if (GameObject_canInteractAny(0, obj, -3)) { + g_cursorId = PIC_CSR_DEFAULT; + input_setCursor(PIC_CSR_DEFAULT); + return 0; + } + } else { + obj = sceneHandlerDbgMenu_getObjectAtXY(mx, my); + if (obj && GameObject_canInteractAny(0, obj, -3) ) { + g_vars->selector->_flags |= 4; + g_vars->selector->setOXY(obj->_ox, obj->_oy); + g_fullpipe->_cursorId = PIC_CSR_DEFAULT; + input_setCursor(PIC_CSR_DEFAULT); + return 0; + } + g_vars->selector->_flags &= 0xFFFB; + } + input_setCursor(g_cursorId); +#endif + return 0; +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index ae5f2dafb1..be42838920 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -44,6 +44,8 @@ class Vars { PictureObject *scene01_picSc01Osk; PictureObject *scene01_picSc01Osk2; + + GameObject *selector; }; } // End of namespace Fullpipe -- cgit v1.2.3