aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/behavior.cpp6
-rw-r--r--engines/fullpipe/behavior.h2
-rw-r--r--engines/fullpipe/constants.h11
-rw-r--r--engines/fullpipe/fullpipe.h3
-rw-r--r--engines/fullpipe/input.cpp2
-rw-r--r--engines/fullpipe/lift.cpp4
-rw-r--r--engines/fullpipe/motion.cpp9
-rw-r--r--engines/fullpipe/scenes.cpp56
-rw-r--r--engines/fullpipe/scenes.h5
9 files changed, 88 insertions, 10 deletions
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index c1fe835b81..c7b526d2c1 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -179,6 +179,12 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, B
}
}
+bool BehaviorManager::setBehaviorEnabled(StaticANIObject *obj, int aniId, int quId, int flag) {
+ warning("STUB: BehaviorManager::setBehaviorEnabled()");
+
+ return true;
+}
+
void BehaviorInfo::clear() {
_ani = 0;
_staticsId = 0;
diff --git a/engines/fullpipe/behavior.h b/engines/fullpipe/behavior.h
index 83a548f486..4fd1454351 100644
--- a/engines/fullpipe/behavior.h
+++ b/engines/fullpipe/behavior.h
@@ -77,6 +77,8 @@ class BehaviorManager : public CObject {
void updateBehaviors();
void updateBehavior(BehaviorInfo *behaviorInfo, BehaviorEntry *entry);
void updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorEntry *beh);
+
+ bool setBehaviorEnabled(StaticANIObject *obj, int aniId, int quId, int flag);
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 2cf7425de4..c0034e444d 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -26,6 +26,8 @@
namespace Fullpipe {
#define ANI_BOOT_1 4231
+#define ANI_DOMINO_3 2732
+#define ANI_EGGEATER 334
#define ANI_IN1MAN 5110
#define ANI_INV_MAP 5321
#define ANI_LIFTBUTTON 2751
@@ -98,11 +100,17 @@ namespace Fullpipe {
#define PIC_SC1_LADDER 1091
#define PIC_SC1_OSK 1018
#define PIC_SC1_OSK2 2932
+#define PIC_SC3_DOMIN 5182
#define PIC_SCD_SEL 734
+#define QU_EGTR_MD2_SHOW 4698
+#define QU_EGTR_MD1_SHOW 4697
+#define QU_EGTR_SLIMSHOW 4883
#define QU_IN2_DO 5144
#define QU_INTR_FINISH 5138
#define QU_INTR_GETUPMAN 5136
#define QU_INTR_STARTINTRO 5133
+#define QU_SC3_ENTERLIFT 2779
+#define QU_SC3_EXITLIFT 2808
#define SC_1 301
#define SC_10 653
#define SC_11 654
@@ -158,6 +166,9 @@ namespace Fullpipe {
#define SND_CMN_031 3516
#define SND_CMN_070 5199
#define SND_INTR_019 5220
+#define ST_EGTR_MID1 2863
+#define ST_EGTR_MID2 2869
+#define ST_EGTR_SLIM 336
#define ST_IN1MAN_SLEEP 5112
#define ST_LBN_0N 2832
#define ST_LBN_0P 2833
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 22e4f1d8f4..7f1c9baa9b 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -210,7 +210,7 @@ public:
int _objectIdAtCursor;
void setCursor(int id);
- void updateCursorsCommon();
+ void updateCursorCommon();
int getObjectState(const char *objname);
void setObjectState(const char *name, int state);
@@ -231,6 +231,7 @@ public:
void getAllInventory();
int lift_getButtonIdP(int objid);
+ void lift_sub5(Scene *sc, int qu1, int qu2);
public:
diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp
index ee826fd359..e98920c78a 100644
--- a/engines/fullpipe/input.cpp
+++ b/engines/fullpipe/input.cpp
@@ -211,7 +211,7 @@ void FullpipeEngine::winArcade() {
}
-void FullpipeEngine::updateCursorsCommon() {
+void FullpipeEngine::updateCursorCommon() {
GameObject *ani = _currentScene->getStaticANIObjectAtPos(_mouseVirtX, _mouseVirtY);
GameObject *pic = _currentScene->getPictureObjectAtPos(_mouseVirtX, _mouseVirtY);
diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp
index 25dd2613fe..8fa6cf744d 100644
--- a/engines/fullpipe/lift.cpp
+++ b/engines/fullpipe/lift.cpp
@@ -64,4 +64,8 @@ int FullpipeEngine::lift_getButtonIdP(int objid) {
}
}
+void FullpipeEngine::lift_sub5(Scene *sc, int qu1, int qu2) {
+ warning("STUB: FullpipeEngine::lift_sub5()");
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index aa7d02a405..8fecd8304e 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -113,7 +113,8 @@ void MctlCompound::initMovGraph2() {
}
void MctlCompound::freeItems() {
- warning("STUB: MctlCompound::freeItems()");
+ for (uint i = 0; i < _motionControllers.size(); i++)
+ _motionControllers[i]->_motionControllerObj->freeItems();
}
MessageQueue *MctlCompound::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
@@ -850,7 +851,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
Common::Array<MovGraphLink *> tempLinkList;
double minPath = findMinPath(&linkInfoSource, &linkInfoDest, &tempLinkList);
- debug(0, "MovGraph2::doWalkTo(): path: %lf parts: %d", minPath, tempLinkList.size());
+ debug(0, "MovGraph2::doWalkTo(): path: %g parts: %d", minPath, tempLinkList.size());
if (minPath < 0.0 || ((linkInfoSource.node != linkInfoDest.node || !linkInfoSource.node) && !tempLinkList.size()))
return 0;
@@ -1002,7 +1003,7 @@ int MovGraph2::findLink(Common::Array<MovGraphLink *> *linkList, int idx, Common
}
}
node3 = node1;
- } else if (idx != linkList->size() - 1) {
+ } else if (idx != (int)(linkList->size() - 1)) {
MovGraphLink *lnk = (*linkList)[idx + 1];
if (lnk->_movGraphNode1 == node1 || lnk->_movGraphNode1 == node1) {
@@ -1067,7 +1068,7 @@ MovGraphLink *MovGraph2::findLink1(int x, int y, int idx, int fuzzyMatch) {
MovGraphLink *MovGraph2::findLink2(int x, int y) {
double mindist = 1.0e20;
- MovGraphLink *res;
+ MovGraphLink *res = 0;
for (ObList::iterator i = _links.begin(); i != _links.end(); ++i) {
assert(((CObject *)*i)->_objtype == kObjTypeMovGraphLink);
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 1793ffdc3a..fdc28e8092 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -53,6 +53,11 @@ void scene01_fixEntrance();
void scene01_initScene(Scene *sc, int entrance);
int sceneHandler01(ExCommand *cmd);
+void scene03_setEaterState();
+int scene03_updateCursor();
+void scene03_initScene(Scene *sc);
+int sceneHandler03(ExCommand *cmd);
+
void sceneDbgMenu_initScene(Scene *sc);
int sceneHandlerDbgMenu(ExCommand *cmd);
@@ -71,6 +76,9 @@ Vars::Vars() {
scene01_picSc01Osk = 0;
scene01_picSc01Osk2 = 0;
+ scene03_eggeater = 0;
+ scene03_domino = 0;
+
selector = 0;
}
@@ -210,6 +218,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
addMessageHandler(sceneHandler02, 2);
_updateCursorCallback = defaultUpdateCursor;
break;
+#endif
case SC_3:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_3");
@@ -219,10 +228,11 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_3");
setSceneMusicParameters(sceneVar);
addMessageHandler(sceneHandler03, 2);
- j_Scene_sc03_sub_40F160(scene);
+ scene03_setEaterState();
_updateCursorCallback = scene03_updateCursor;
break;
+#if 0
case SC_4:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_4");
scene->preloadMovements(sceneVar);
@@ -1384,7 +1394,7 @@ int MovGraph_messageHandler(ExCommand *cmd) {
}
int defaultUpdateCursor() {
- g_fullpipe->updateCursorsCommon();
+ g_fullpipe->updateCursorCommon();
return g_fullpipe->_cursorId;
}
@@ -1455,7 +1465,7 @@ int sceneHandlerIntro(ExCommand *ex) {
return 0;
case 33:
- // fall trhough
+ // fall through
break;
default:
@@ -1556,6 +1566,46 @@ int sceneHandler01(ExCommand *cmd) {
return res;
}
+void scene03_initScene(Scene *sc) {
+ g_vars->scene03_eggeater = sc->getStaticANIObject1ById(ANI_EGGEATER, -1);
+ g_vars->scene03_domino = sc->getStaticANIObject1ById(ANI_DOMINO_3, -1);
+
+ GameVar *v = g_fullpipe->_gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_GulpedEggs);
+
+ g_vars->swallowedEgg1 = v->getSubVarByName(sO_Egg1);
+ g_vars->swallowedEgg2 = v->getSubVarByName(sO_Egg2);
+ g_vars->swallowedEgg3 = v->getSubVarByName(sO_Egg3);
+
+ setElevatorButton(sO_Level2, ST_LBN_2N);
+
+ g_fullpipe->lift_sub5(sc, QU_SC3_ENTERLIFT, QU_SC3_EXITLIFT);
+}
+
+void scene03_setEaterState() {
+ if (g_fullpipe->getObjectState(sO_EggGulperGaveCoin) == g_fullpipe->getObjectEnumState(sO_EggGulperGaveCoin, sO_Yes)) {
+ g_fullpipe->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_SLIM, QU_EGTR_SLIMSHOW, 0);
+ g_fullpipe->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_MID1, QU_EGTR_MD1_SHOW, 0);
+ g_fullpipe->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_MID2, QU_EGTR_MD2_SHOW, 0);
+ }
+}
+
+int scene03_updateCursor() {
+ g_fullpipe->updateCursorCommon();
+
+ if (g_fullpipe->_cursorId == PIC_CSR_DEFAULT && g_fullpipe->_objectIdAtCursor == PIC_SC3_DOMIN && g_vars->scene03_domino) {
+ if (g_vars->scene03_domino->_flags & 4)
+ g_fullpipe->_cursorId = PIC_CSR_ITN;
+ }
+
+ return g_fullpipe->_cursorId;
+}
+
+int sceneHandler03(ExCommand *ex) {
+ warning("STUB: sceneHandler03()");
+
+ return 0;
+}
+
void sceneDbgMenu_initScene(Scene *sc) {
g_vars->selector = sc->getPictureObjectById(PIC_SCD_SEL, 0);
getGameLoaderInteractionController()->disableFlag24();
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 9100fa6a0c..9d1dbd5e55 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -28,7 +28,7 @@ namespace Fullpipe {
class StaticANIObject;
class Vars {
- public:
+public:
Vars();
GameVar *swallowedEgg1;
@@ -45,6 +45,9 @@ class Vars {
PictureObject *scene01_picSc01Osk;
PictureObject *scene01_picSc01Osk2;
+ StaticANIObject *scene03_eggeater;
+ StaticANIObject *scene03_domino;
+
PictureObject *selector;
};