diff options
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 5 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 8 | ||||
-rw-r--r-- | engines/fullpipe/lift.cpp | 49 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene03.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene06.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene10.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene14.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene15.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene30.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene32.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene34.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene35.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene38.cpp | 2 |
13 files changed, 69 insertions, 13 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 578a40f492..b1e366c3a1 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -82,7 +82,12 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _modalObject = 0; + _liftEnterMQ = 0; + _liftExitMQ = 0; + _lift = 0; _lastLiftButton = 0; + _liftX = 0; + _liftY = 0; _gameContinue = true; _needRestart = false; diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 09160db65f..1e583279f5 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -60,6 +60,7 @@ class GameProject; class GameObject; class GlobalMessageQueueList; struct MessageHandler; +class MessageQueue; struct MovTable; class MGM; class NGIArchive; @@ -270,12 +271,17 @@ public: void getAllInventory(); StaticANIObject *_lastLiftButton; + MessageQueue *_liftEnterMQ; + MessageQueue *_liftExitMQ; + StaticANIObject *_lift; + int _liftX; + int _liftY; int lift_getButtonIdP(int objid); int lift_getButtonIdH(int objid); int lift_getButtonIdN(int objid); void lift_setButton(const char *name, int state); - void lift_sub5(Scene *sc, int qu1, int qu2); + void lift_init(Scene *sc, int qu1, int qu2); void lift_setButtonStatics(Scene *sc, int buttonId); void lift_exitSeq(ExCommand *ex); void lift_closedoorSeq(); diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp index 81d7d2dc1c..4a5b124d02 100644 --- a/engines/fullpipe/lift.cpp +++ b/engines/fullpipe/lift.cpp @@ -25,8 +25,10 @@ #include "fullpipe/objects.h" #include "fullpipe/objectnames.h" #include "fullpipe/constants.h" + #include "fullpipe/scene.h" #include "fullpipe/statics.h" +#include "fullpipe/messages.h" namespace Fullpipe { @@ -168,8 +170,51 @@ void FullpipeEngine::lift_setButton(const char *name, int state) { var->setSubVarAsInt(name, state); } -void FullpipeEngine::lift_sub5(Scene *sc, int qu1, int qu2) { - warning("STUB: FullpipeEngine::lift_sub5()"); +void FullpipeEngine::lift_init(Scene *sc, int enterSeq, int exitSeq) { + _lastLiftButton = 0; + + _liftEnterMQ = sc->getMessageQueueById(enterSeq); + if (!_liftEnterMQ) + return; + + _liftExitMQ = sc->getMessageQueueById(exitSeq); + + if (!_liftExitMQ) + return; + + ExCommand *ex = _liftEnterMQ->getExCommandByIndex(0); + + if (!ex) + return; + + _liftX = ex->_x; + _liftY = ex->_y; + + _lift = sc->getStaticANIObject1ById(ANI_LIFT, -1); + + for (uint i = 0; i < sc->_staticANIObjectList1.size(); i++) { + StaticANIObject *ani = (StaticANIObject *)sc->_staticANIObjectList1[i]; + + if (ani->_id == ANI_LIFTBUTTON) + ani->_statics = ani->getStaticsById(lift_getButtonIdP(ani->_statics->_staticsId)); + } + + GameVar *var = getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons); + if (var) { + for (var = var->_subVars; var; var = var->_nextVarObj) { + for (uint i = 0; i < sc->_staticANIObjectList1.size(); i++) { + StaticANIObject *ani = (StaticANIObject *)sc->_staticANIObjectList1[i]; + + if (ani->_id == ANI_LIFTBUTTON) { + int id = lift_getButtonIdN(ani->_statics->_staticsId); + + if (id == var->_value.intValue) + ani->_statics = ani->getStaticsById(id); + } + + } + } + } } void FullpipeEngine::lift_exitSeq(ExCommand *ex) { diff --git a/engines/fullpipe/scenes/scene03.cpp b/engines/fullpipe/scenes/scene03.cpp index c706dadc99..9ba84a540a 100644 --- a/engines/fullpipe/scenes/scene03.cpp +++ b/engines/fullpipe/scenes/scene03.cpp @@ -59,7 +59,7 @@ void scene03_initScene(Scene *sc) { g_fp->lift_setButton(sO_Level2, ST_LBN_2N); - g_fp->lift_sub5(sc, QU_SC3_ENTERLIFT, QU_SC3_EXITLIFT); + g_fp->lift_init(sc, QU_SC3_ENTERLIFT, QU_SC3_EXITLIFT); } void scene03_setEaterState() { diff --git a/engines/fullpipe/scenes/scene06.cpp b/engines/fullpipe/scenes/scene06.cpp index 0c271519ec..7d637d8306 100644 --- a/engines/fullpipe/scenes/scene06.cpp +++ b/engines/fullpipe/scenes/scene06.cpp @@ -531,7 +531,7 @@ void scene06_initScene(Scene *sc) { g_vars->scene06_mumsy->hide(); g_fp->lift_setButton(sO_Level3, ST_LBN_3N); - g_fp->lift_sub5(sc, QU_SC6_ENTERLIFT, QU_SC6_EXITLIFT); + g_fp->lift_init(sc, QU_SC6_ENTERLIFT, QU_SC6_EXITLIFT); g_fp->initArcadeKeys("SC_6"); sceneHandler06_setExits(sc); diff --git a/engines/fullpipe/scenes/scene10.cpp b/engines/fullpipe/scenes/scene10.cpp index 6836cd6f76..9c00902bba 100644 --- a/engines/fullpipe/scenes/scene10.cpp +++ b/engines/fullpipe/scenes/scene10.cpp @@ -43,7 +43,7 @@ void scene10_initScene(Scene *sc) { g_vars->scene10_ladder = sc->getPictureObjectById(PIC_SC10_LADDER, 0); g_fp->lift_setButton(sO_Level1, ST_LBN_1N); - g_fp->lift_sub5(sc, QU_SC10_ENTERLIFT, QU_SC10_EXITLIFT); + g_fp->lift_init(sc, QU_SC10_ENTERLIFT, QU_SC10_EXITLIFT); if (g_fp->getObjectState(sO_Inflater) == g_fp->getObjectEnumState(sO_Inflater, sO_WithGum)) { g_vars->scene10_hasGum = 1; diff --git a/engines/fullpipe/scenes/scene14.cpp b/engines/fullpipe/scenes/scene14.cpp index e0618ee6a1..ab0487974a 100644 --- a/engines/fullpipe/scenes/scene14.cpp +++ b/engines/fullpipe/scenes/scene14.cpp @@ -72,7 +72,7 @@ void scene14_initScene(Scene *sc) { } g_fp->lift_setButton(sO_Level4, ST_LBN_4N); - g_fp->lift_sub5(sc, QU_SC14_ENTERLIFT, QU_SC14_EXITLIFT); + g_fp->lift_init(sc, QU_SC14_ENTERLIFT, QU_SC14_EXITLIFT); g_fp->initArcadeKeys("SC_14"); g_fp->setArcadeOverlay(PIC_CSR_ARCADE6); diff --git a/engines/fullpipe/scenes/scene15.cpp b/engines/fullpipe/scenes/scene15.cpp index ece260de02..155897619f 100644 --- a/engines/fullpipe/scenes/scene15.cpp +++ b/engines/fullpipe/scenes/scene15.cpp @@ -88,7 +88,7 @@ void scene15_initScene(Scene *sc) { g_fp->_currentScene = oldsc; g_fp->lift_setButton(sO_Level5, ST_LBN_5N); - g_fp->lift_sub5(sc, QU_SC15_ENTERLIFT, QU_SC15_EXITLIFT); + g_fp->lift_init(sc, QU_SC15_ENTERLIFT, QU_SC15_EXITLIFT); } int scene15_updateCursor() { diff --git a/engines/fullpipe/scenes/scene30.cpp b/engines/fullpipe/scenes/scene30.cpp index d115a70bc6..a807e692a7 100644 --- a/engines/fullpipe/scenes/scene30.cpp +++ b/engines/fullpipe/scenes/scene30.cpp @@ -73,7 +73,7 @@ void scene30_initScene(Scene *sc, int flag) { g_fp->lift_setButton(sO_Level8, ST_LBN_8N); - g_fp->lift_sub5(sc, QU_SC30_ENTERLIFT, QU_SC30_EXITLIFT); + g_fp->lift_init(sc, QU_SC30_ENTERLIFT, QU_SC30_EXITLIFT); } int scene30_updateCursor() { diff --git a/engines/fullpipe/scenes/scene32.cpp b/engines/fullpipe/scenes/scene32.cpp index 87ecf220b8..597d3422f6 100644 --- a/engines/fullpipe/scenes/scene32.cpp +++ b/engines/fullpipe/scenes/scene32.cpp @@ -88,7 +88,7 @@ void scene32_initScene(Scene *sc) { } g_fp->lift_setButton(sO_Level9, ST_LBN_9N); - g_fp->lift_sub5(sc, QU_SC32_ENTERLIFT, QU_SC32_EXITLIFT); + g_fp->lift_init(sc, QU_SC32_ENTERLIFT, QU_SC32_EXITLIFT); g_fp->initArcadeKeys("SC_32"); } diff --git a/engines/fullpipe/scenes/scene34.cpp b/engines/fullpipe/scenes/scene34.cpp index 72a289a405..b3e0db75af 100644 --- a/engines/fullpipe/scenes/scene34.cpp +++ b/engines/fullpipe/scenes/scene34.cpp @@ -92,7 +92,7 @@ void scene34_initScene(Scene *sc) { g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_34")); g_fp->lift_setButton(sO_Level7, ST_LBN_7N); - g_fp->lift_sub5(sc, QU_SC34_ENTERLIFT, QU_SC34_EXITLIFT); + g_fp->lift_init(sc, QU_SC34_ENTERLIFT, QU_SC34_EXITLIFT); g_fp->initArcadeKeys("SC_34"); } diff --git a/engines/fullpipe/scenes/scene35.cpp b/engines/fullpipe/scenes/scene35.cpp index ac8ed714d6..f10786b821 100644 --- a/engines/fullpipe/scenes/scene35.cpp +++ b/engines/fullpipe/scenes/scene35.cpp @@ -64,7 +64,7 @@ void scene35_initScene(Scene *sc) { g_fp->playSound(sndId, 1); g_fp->lift_setButton(sO_Level6, ST_LBN_6N); - g_fp->lift_sub5(sc, QU_SC35_ENTERLIFT, QU_SC35_EXITLIFT); + g_fp->lift_init(sc, QU_SC35_ENTERLIFT, QU_SC35_EXITLIFT); g_fp->initArcadeKeys("SC_35"); diff --git a/engines/fullpipe/scenes/scene38.cpp b/engines/fullpipe/scenes/scene38.cpp index 2c863f6c34..016dc83c1b 100644 --- a/engines/fullpipe/scenes/scene38.cpp +++ b/engines/fullpipe/scenes/scene38.cpp @@ -82,7 +82,7 @@ void scene38_initScene(Scene *sc) { g_vars->scene38_domino1->_flags &= 0xFFFB; } - g_fp->lift_sub5(sc, QU_SC38_ENTERLIFT, QU_SC38_EXITLIFT); + g_fp->lift_init(sc, QU_SC38_ENTERLIFT, QU_SC38_EXITLIFT); g_fp->lift_setButtonStatics(sc, ST_LBN_0N); } |