aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorKamil Zbróg2013-11-04 11:40:22 +0000
committerKamil Zbróg2013-11-04 11:40:22 +0000
commit85694ec1f5793eb4025f4153ef4bf71d3769d699 (patch)
treec93fab58eb2f52eca244895a9867d28134dbd7f5 /engines/fullpipe
parent026390145b0e947be7cccf3d9ba329eb2270a2ed (diff)
parent9dc35033f523c9c694f24e15ed45ba6194786a25 (diff)
downloadscummvm-rg350-85694ec1f5793eb4025f4153ef4bf71d3769d699.tar.gz
scummvm-rg350-85694ec1f5793eb4025f4153ef4bf71d3769d699.tar.bz2
scummvm-rg350-85694ec1f5793eb4025f4153ef4bf71d3769d699.zip
Merge remote-tracking branch 'own/prince' into prince-malik
Conflicts: engines/prince/debugger.cpp engines/prince/debugger.h engines/prince/detection.cpp engines/prince/font.cpp engines/prince/graphics.cpp engines/prince/prince.cpp engines/prince/prince.h engines/prince/script.cpp engines/prince/script.h
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.h23
-rw-r--r--engines/fullpipe/fullpipe.cpp2
-rw-r--r--engines/fullpipe/fullpipe.h3
-rw-r--r--engines/fullpipe/gameloader.cpp2
-rw-r--r--engines/fullpipe/input.cpp2
-rw-r--r--engines/fullpipe/lift.cpp4
-rw-r--r--engines/fullpipe/messages.cpp19
-rw-r--r--engines/fullpipe/messages.h2
-rw-r--r--engines/fullpipe/modal.cpp181
-rw-r--r--engines/fullpipe/modal.h30
-rw-r--r--engines/fullpipe/motion.cpp50
-rw-r--r--engines/fullpipe/scene.cpp2
-rw-r--r--engines/fullpipe/scenes.cpp107
-rw-r--r--engines/fullpipe/scenes.h7
-rw-r--r--engines/fullpipe/statics.cpp54
-rw-r--r--engines/fullpipe/statics.h6
18 files changed, 454 insertions, 48 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 796764d0a9..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
@@ -35,12 +37,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
@@ -84,6 +91,7 @@ namespace Fullpipe {
#define PIC_CSR_ITN_RED 5329
#define PIC_CSR_LIFT 5176
#define PIC_CSR_MAP 5339
+#define PIC_IN1_GAMETITLE 5169
#define PIC_IN1_PIPETITLE 5167
#define PIC_INV_MENU 991
#define PIC_MAP_A13 5275
@@ -92,7 +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
@@ -147,6 +165,11 @@ namespace Fullpipe {
#define SC_TITLES 5166
#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
#define ST_LBN_1N 2753
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index a0db6aa08c..2f49a41c17 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -80,7 +80,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_gameContinue = true;
_needRestart = false;
- _flgPlayIntro = false;
+ _flgPlayIntro = true;
_gamePaused = false;
_inputArFlag = false;
_recordEvents = false;
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/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index f8ede5cff2..a2ab71d7e3 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -481,7 +481,7 @@ bool PreloadItems::load(MfcArchive &file) {
int count = file.readCount();
- resize(count);
+ clear();
for (int i = 0; i < count; i++) {
PreloadItem *t = new PreloadItem();
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/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/modal.cpp b/engines/fullpipe/modal.cpp
index 26048ced13..44e7b46184 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -25,36 +25,15 @@
#include "fullpipe/messages.h"
#include "fullpipe/constants.h"
#include "fullpipe/scenes.h"
+#include "fullpipe/gameloader.h"
namespace Fullpipe {
-bool BaseModalObject::handleMessage(ExCommand *message) {
- warning("STUB: BaseModalObject::handleMessage()");
-
- return true;
-}
-
-bool BaseModalObject::init(int counterdiff) {
- warning("STUB: BaseModalObject::init(%d)", counterdiff);
-
- return true;
-}
-
-bool BaseModalObject::update() {
- warning("STUB: BaseModalObject::update()");
-
- return true;
-}
-
-void BaseModalObject::saveload() {
- warning("STUB: BaseModalObject::saveload()");
-}
-
-
ModalIntro::ModalIntro() {
_field_8 = 0;
_countDown = 0;
- _needRedraw = 0;
+ _stillRunning = 0;
+
if (g_vars->sceneIntro_skipIntro) {
_introFlags = 4;
} else {
@@ -64,6 +43,7 @@ ModalIntro::ModalIntro() {
PictureObject *pict = g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0);
pict->setFlags(pict->_flags & 0xFFFB);
}
+
g_vars->sceneIntro_skipIntro = false;
_sfxVolume = g_fullpipe->_sfxVolume;
}
@@ -78,7 +58,7 @@ bool ModalIntro::handleMessage(ExCommand *message) {
if (message->_keyCode != 13 && message->_keyCode != 27 && message->_keyCode != 32)
return false;
- if (_needRedraw) {
+ if (_stillRunning) {
if (!(_introFlags & 0x10)) {
_countDown = 0;
g_vars->sceneIntro_needBlackout = true;
@@ -91,6 +71,157 @@ bool ModalIntro::handleMessage(ExCommand *message) {
return true;
}
+bool ModalIntro::init(int counterdiff) {
+ if (!g_vars->sceneIntro_playing) {
+ if (!_stillRunning) {
+ finish();
+ return false;
+ }
+
+ if (_introFlags & 0x10)
+ g_fullpipe->_gameLoader->updateSystems(42);
+
+ _introFlags |= 2;
+
+ return true;
+ }
+
+ if (_introFlags & 4) {
+ ModalVideoPlayer *player = new ModalVideoPlayer();
+
+ g_fullpipe->_modalObject = player;
+ player->_parentObj = this;
+ player->play("intro.avi");
+
+ _countDown--;
+
+ if (_countDown > 0 )
+ return true;
+
+ if (_stillRunning <= 0) {
+ _countDown = 0;
+ _stillRunning = 0;
+ _introFlags = (_introFlags & 0xfb) | 0x40;
+
+ return true;
+ }
+
+ _introFlags |= 2;
+ return true;
+ }
+
+ if (_introFlags & 0x40) {
+ ModalVideoPlayer *player = new ModalVideoPlayer();
+
+ g_fullpipe->_modalObject = player;
+ player->_parentObj = this;
+ player->play("intro2.avi");
+
+ _countDown--;
+ if (_countDown > 0)
+ return true;
+
+ if (_stillRunning <= 0) {
+ _countDown = 50;
+ _stillRunning = 0;
+ _introFlags = (_introFlags & 0xbf) | 9;
+
+ return true;
+ }
+
+ _introFlags |= 2;
+ return true;
+ }
+
+ if (_introFlags & 8) {
+ _countDown--;
+
+ if (_countDown > 0 )
+ return true;
+
+ if (_stillRunning > 0) {
+ _introFlags |= 2;
+ return true;
+ }
+
+ _countDown = 150;
+ _introFlags = (_introFlags & 0xf7) | 0x21;
+ g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0)->_flags &= 0xfffb;
+ }
+
+ if (!(_introFlags & 0x20)) {
+ if (_introFlags & 0x10) {
+ if (!_stillRunning) {
+ _introFlags |= 1;
+
+ g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0)->_flags &= 0xfffb;
+ g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_GAMETITLE, 0)->_flags &= 0xfffb;
+
+ chainQueue(QU_INTR_STARTINTRO, 1);
+ }
+ g_fullpipe->_gameLoader->updateSystems(42);
+ }
+ return true;
+ }
+
+ _countDown--;
+
+ if (_countDown <= 0) {
+ if (_stillRunning > 0) {
+ _introFlags |= 2;
+
+ return true;
+ }
+
+ _introFlags = (_introFlags & 0xdf) | 0x10;
+
+ g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_GAMETITLE, 0)->_flags &= 0xfffb;
+
+ _stillRunning = 0;
+ }
+
+ return true;
+}
+
+void ModalIntro::update() {
+ if (g_fullpipe->_currentScene) {
+ if (_introFlags & 1) {
+ //sceneFade(virt, g_currentScene, 1);
+ _stillRunning = 255;
+ _introFlags &= 0xfe;
+
+ if (_introFlags & 0x20)
+ g_fullpipe->playSound(SND_INTR_019, 0);
+ } else if (_introFlags & 2) {
+ if (g_vars->sceneIntro_needBlackout) {
+ //vrtRectangle(*(_DWORD *)virt, 0, 0, 0, 800, 600);
+ g_vars->sceneIntro_needBlackout = 0;
+ _stillRunning = 0;
+ _introFlags &= 0xfd;
+ } else {
+ //sceneFade(virt, g_currentScene, 0);
+ _stillRunning = 0;
+ _introFlags &= 0xfd;
+ }
+ } else if (_stillRunning) {
+ g_fullpipe->_currentScene->draw();
+ }
+ }
+}
+
+void ModalIntro::finish() {
+ g_fullpipe->_gameLoader->unloadScene(SC_INTRO2);
+ g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO1);
+ g_fullpipe->_gameLoader->preloadScene(SC_INTRO1, TrubaDown);
+
+ if (g_fullpipe->_currentScene)
+ g_fullpipe->_gameLoader->updateSystems(42);
+}
+
+void ModalVideoPlayer::play(const char *fname) {
+ warning("STUB: ModalVideoPlayer::play(%s)", fname);
+}
+
void FullpipeEngine::openMap() {
warning("STUB: FullpipeEngine::openMap()");
}
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index 7d98427e20..f3f571e2a9 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -34,24 +34,44 @@ class BaseModalObject {
BaseModalObject() : _parentObj(0) {}
virtual ~BaseModalObject() {}
- virtual bool handleMessage(ExCommand *message);
- virtual bool init(int counterdiff);
- virtual bool update();
- void saveload();
+ virtual bool pollEvent() = 0;
+ virtual bool handleMessage(ExCommand *message) = 0;
+ virtual bool init(int counterdiff) = 0;
+ virtual void update() = 0;
+
+ virtual void saveload() = 0;
};
class ModalIntro : public BaseModalObject {
int _field_8;
int _introFlags;
int _countDown;
- int _needRedraw;
+ int _stillRunning;
int _sfxVolume;
public:
ModalIntro();
+ virtual bool pollEvent() { return true; }
virtual bool handleMessage(ExCommand *message);
+ virtual bool init(int counterdiff);
+ virtual void update();
+ virtual void saveload() {}
+
+ void finish();
+};
+
+class ModalVideoPlayer : public BaseModalObject {
+public:
+
+ virtual bool pollEvent() { return true; }
+ virtual bool handleMessage(ExCommand *message) { return true; }
+ virtual bool init(int counterdiff) { return false; }
+ virtual void update() {}
+ virtual void saveload() {}
+
+ void play(const char *fname);
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 750c2de5ea..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) {
@@ -672,10 +673,45 @@ void MovGraph2::freeItems() {
warning("STUB: MovGraph2::freeItems()");
}
-MessageQueue *MovGraph2::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
- warning("STUB: MovGraph2::method34()");
+MessageQueue *MovGraph2::method34(StaticANIObject *ani, int xpos, int ypos, int fuzzyMatch, int staticsId) {
+ if (!ani->isIdle())
+ return 0;
- return 0;
+ if (ani->_flags & 0x100)
+ return 0;
+
+ MessageQueue *mq = doWalkTo(ani, xpos, ypos, fuzzyMatch, staticsId);
+
+ if (!mq)
+ return 0;
+
+ if (ani->_movement) {
+ if (mq->getCount() <= 1 || mq->getExCommandByIndex(0)->_messageKind != 22) {
+ PicAniInfo picAniInfo;
+
+ ani->getPicAniInfo(&picAniInfo);
+ ani->updateStepPos();
+ MessageQueue *mq1 = doWalkTo(ani, xpos, ypos, fuzzyMatch, staticsId);
+
+ ani->setPicAniInfo(&picAniInfo);
+
+ if (mq1) {
+ delete mq;
+
+ mq = mq1;
+ }
+ } else {
+ ani->_movement = 0;
+ }
+ }
+
+ if (!mq->chain(ani)) {
+ delete mq;
+
+ return 0;
+ }
+
+ return mq;
}
MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
@@ -815,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;
@@ -967,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) {
@@ -1032,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/scene.cpp b/engines/fullpipe/scene.cpp
index cc93363786..3831831866 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -328,7 +328,7 @@ void Scene::setPictureObjectsFlag4() {
}
PictureObject *Scene::getPictureObjectById(int objId, int flags) {
- for (uint i = 1; i < _picObjList.size(); i++) {
+ for (uint i = 0; i < _picObjList.size(); i++) {
if (((PictureObject *)_picObjList[i])->_id == objId && ((PictureObject *)_picObjList[i])->_okeyCode == flags)
return (PictureObject *)_picObjList[i];
}
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 40d9f21afb..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;
}
@@ -1422,8 +1432,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 through
+ 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;
}
@@ -1507,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 5597612aa6..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,7 +45,10 @@ class Vars {
PictureObject *scene01_picSc01Osk;
PictureObject *scene01_picSc01Osk2;
- GameObject *selector;
+ StaticANIObject *scene03_eggeater;
+ StaticANIObject *scene03_domino;
+
+ PictureObject *selector;
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 0e9daadd45..0599125269 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -73,6 +73,27 @@ Common::Point *StepArray::getCurrPoint(Common::Point *point) {
return point;
}
+Common::Point *StepArray::getPoint(Common::Point *point, int index, int offset) {
+ if (index == -1)
+ index = _currPointIndex;
+
+ if (index + offset > _maxPointIndex - 1)
+ offset = _maxPointIndex - index;
+
+ point->x = 0;
+ point->y = 0;
+
+ while (offset >= 1) {
+ point->x += _points[index]->x;
+ point->y += _points[index]->y;
+
+ index++;
+ offset--;
+ }
+
+ return point;
+}
+
bool StepArray::gotoNextPoint() {
if (_currPointIndex < _maxPointIndex) {
_currPointIndex++;
@@ -628,6 +649,19 @@ Common::Point *StaticANIObject::getCurrDimensions(Common::Point &p) {
return &p;
}
+Common::Point *StaticANIObject::getSomeXY(Common::Point &p) {
+ if (_movement) {
+ _movement->getCurrDynamicPhaseXY(p);
+
+ return &p;
+ }
+
+ if (_statics)
+ _statics->getSomeXY(p);
+
+ return &p;
+}
+
void StaticANIObject::update(int counterdiff) {
int mqid;
@@ -744,6 +778,26 @@ void StaticANIObject::update(int counterdiff) {
}
}
+void StaticANIObject::updateStepPos() {
+ Common::Point point;
+
+ int ox = _movement->_ox;
+ int oy = _movement->_oy;
+
+ _movement->calcSomeXY(point, 1);
+ int x = point.x;
+ int y = point.y;
+
+ _stepArray.getPoint(&point, -1, _stepArray.getPointsCount());
+ x += point.x;
+ y += point.y;
+
+ _statics = _movement->_staticsObj2;
+ _movement = 0;
+
+ setOXY(ox + x, oy + y);
+}
+
void StaticANIObject::stopAnim_maybe() {
debug(6, "StaticANIObject::stopAnim_maybe()");
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 2879edd8e1..49ebc8edf7 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -42,7 +42,10 @@ class StepArray : public CObject {
void clear();
int getCurrPointIndex() { return _currPointIndex; }
+ int getPointsCount() { return _maxPointIndex; }
+
Common::Point *getCurrPoint(Common::Point *point);
+ Common::Point *getPoint(Common::Point *point, int index, int offset);
bool gotoNextPoint();
};
@@ -201,6 +204,8 @@ class StaticANIObject : public GameObject {
Movement *getMovementByName(char *name);
Common::Point *getCurrDimensions(Common::Point &p);
+ Common::Point *getSomeXY(Common::Point &p);
+
void clearFlags();
void setFlags40(bool state);
bool isIdle();
@@ -234,6 +239,7 @@ class StaticANIObject : public GameObject {
MovTable *countMovements();
void setSpeed(int speed);
+ void updateStepPos();
void stopAnim_maybe();
MessageQueue *changeStatics1(int msgNum);