diff options
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 3 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 3 | ||||
-rw-r--r-- | engines/fullpipe/scene.cpp | 39 | ||||
-rw-r--r-- | engines/fullpipe/scene.h | 9 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 32 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 27 | ||||
-rw-r--r-- | engines/fullpipe/statics.h | 5 |
7 files changed, 116 insertions, 2 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index bbd43b63c2..bcaca93836 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -72,6 +72,9 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _messageHandlers = 0; _updateScreenCallback = 0; + _updateCursorCallback = 0; + + _cursorId = 0; g_fullpipe = this; } diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 4253499bdd..ecc2a0344a 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -127,6 +127,9 @@ public: CInventory2 *_inventory; int (*_updateScreenCallback)(void *); + int (*_updateCursorCallback)(); + + int _cursorId; void setObjectState(const char *name, int state); int getObjectEnumState(const char *name, const char *state); diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 3bc7c9d412..4409215ea5 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -255,6 +255,16 @@ StaticANIObject *Scene::getStaticANIObject1ById(int obj, int a3) { return 0; } +StaticANIObject *Scene::getStaticANIObject1ByName(char *name, int a3) { + for (CPtrList::iterator s = _staticANIObjectList1.begin(); s != _staticANIObjectList1.end(); ++s) { + StaticANIObject *o = (StaticANIObject *)s; + if (!strcmp(o->_objectName, name) && (a3 == -1 || o->_field_4 == a3)) + return o; + } + + return 0; +} + void Scene::deleteStaticANIObject(StaticANIObject *obj) { for (uint n = 0; n < _staticANIObjectList1.size(); n++) if ((StaticANIObject *)_staticANIObjectList1[n] == obj) { @@ -298,6 +308,35 @@ PictureObject *Scene::getPictureObjectById(int objId, int flags) { return 0; } +void Scene::preloadMovements(CGameVar *var) { + CGameVar *preload = var->getSubVarByName("PRELOAD"); + if (!preload) + return; + + for (CGameVar *i = preload->_subVars; i; i = i->_nextVarObj) { + StaticANIObject *ani = getStaticANIObject1ByName(i->_varName, -1); + + if (ani) { + CGameVar *subVars = i->_subVars; + + if (subVars) { + for (;subVars; subVars = subVars->_nextVarObj) { + Movement *mov = ani->getMovementByName(subVars->_varName); + + if (mov) + mov->loadPixelData(); + } + } else { + ani->loadMovementsPixelData(); + } + } + } +} + +void Scene::initObjectCursors(const char *name) { + warning("STUB: Scene::initObjectCursors(%s)", name); +} + void Scene::draw(int par) { updateScrolling(par); diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h index 4085b058a7..cc2e2edd4e 100644 --- a/engines/fullpipe/scene.h +++ b/engines/fullpipe/scene.h @@ -44,18 +44,27 @@ class Scene : public Background { public: Scene(); + virtual bool load(MfcArchive &file); + void initStaticANIObjects(); void init(); void draw(int par); void drawContent(int minPri, int maxPri, bool drawBG); void updateScrolling(int par); + StaticANIObject *getAniMan(); StaticANIObject *getStaticANIObject1ById(int obj, int a3); + StaticANIObject *getStaticANIObject1ByName(char *name, int a3); + void deleteStaticANIObject(StaticANIObject *obj); void addStaticANIObject(StaticANIObject *obj, bool addList2); + void setPictureObjectsFlag4(); PictureObject *getPictureObjectById(int objId, int flags); + void preloadMovements(CGameVar *var); + + void initObjectCursors(const char *name); }; class SceneTag : public CObject { diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 46ef73ad5e..c0a6a82ec4 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -37,6 +37,9 @@ namespace Fullpipe { +int sceneIntro_updateCursor(); +void sceneIntro_initScene(Scene *sc); + bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { CGameVar *sceneVar; Common::Point sceneDim; @@ -125,7 +128,6 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { removeMessageHandler(2, -1); _updateScreenCallback = 0; -#if 0 switch (entrance->_sceneId) { case SC_INTRO1: sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_INTRO1"); @@ -138,6 +140,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { _updateCursorCallback = sceneIntro_updateCursor; break; +#if 0 case SC_1: scene01_sub_40E160(); sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_1"); @@ -609,14 +612,39 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_DBGMENU"); addMessageHandler(sceneHandlerDbgMenu, 2); break; +#endif default: _behaviorManager->initBehavior(0, 0); break; } -#endif return true; } +int sceneIntro_updateCursor() { + g_fullpipe->_cursorId = 0; + + return 0; +} + +void sceneIntro_initScene(Scene *sc) { + g_fullpipe->_gameLoader->loadScene(SC_INTRO2); + + warning("STUB: FullpipeEngine::sceneIntro_initScene()"); + +#if 0 + sceneIntro_aniin1man = sc->_getStaticANIObject1ById(ANI_IN1MAN, -1); + sceneIntro_needSleep = 1; + sceneIntro_needGetup = 0; + sceneIntro_dword_477938 = 1; + sceneIntro_dword_477934 = 0; + + if (g_fullpipe->_recordEvents || g_fullpipe->_inputArFlag) + sceneIntro_skipIntro = 0; + + g_fullpipe->_modalObject = new CModalIntro; +#endif +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index d0abbb87e6..b84703eee3 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -187,6 +187,19 @@ Movement *StaticANIObject::getMovementById(int itemId) { return 0; } +Movement *StaticANIObject::getMovementByName(char *name) { + for (uint i = 0; i < _movements.size(); i++) + if (!strcmp(((Movement *)_movements[i])->_objectName, name)) + return (Movement *)_movements[i]; + + return 0; +} + +void StaticANIObject::loadMovementsPixelData() { + for (uint i = 0; i < _movements.size(); i++) + ((Movement *)_movements[i])->loadPixelData(); +} + Statics *StaticANIObject::addStatics(Statics *ani) { warning("STUB: StaticANIObject::addStatics"); @@ -351,6 +364,20 @@ void Movement::updateCurrDynamicPhase() { } } +void Movement::loadPixelData() { + Movement *mov = this; + for (Movement *i = _currMovementObj; i; i = i->_currMovementObj) + mov = i; + + for (uint i = 0; i < _dynamicPhases.size(); i++) { + if ((Statics *)_dynamicPhases[i] != mov->_staticsObj2 || !(mov->_staticsObj2->_staticsId & 0x4000) ) + ((Statics *)_dynamicPhases[i])->getPixelData(); + } + + if (!(mov->_staticsObj1->_staticsId & 0x4000)) + mov->_staticsObj1->getPixelData(); +} + DynamicPhase::DynamicPhase() { _someX = 0; _rect = 0; diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index f8df64ddc0..04a4863517 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -120,6 +120,8 @@ class Movement : public GameObject { void initStatics(StaticANIObject *ani); void updateCurrDynamicPhase(); + + void loadPixelData(); }; class StaticANIObject : public GameObject { @@ -155,12 +157,15 @@ class StaticANIObject : public GameObject { void setOXY(int x, int y); Statics *getStaticsById(int id); Movement *getMovementById(int id); + Movement *getMovementByName(char *name); void clearFlags(); bool isIdle(); void deleteFromGlobalMessageQueue(); + void loadMovementsPixelData(); + Statics *addStatics(Statics *ani); void draw(); void draw2(); |