diff options
-rw-r--r-- | engines/fullpipe/constants.h | 5 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 12 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/gfx.cpp | 11 | ||||
-rw-r--r-- | engines/fullpipe/init.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/objectnames.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/scene.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 85 | ||||
-rw-r--r-- | engines/fullpipe/scenes.h | 4 | ||||
-rw-r--r-- | engines/fullpipe/utils.h | 1 |
10 files changed, 107 insertions, 19 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index f578d0c708..53a0831f1b 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -25,6 +25,7 @@ namespace Fullpipe { +#define ANI_BOOT_1 4231 #define ANI_IN1MAN 5110 #define ANI_INV_MAP 5321 #define ANI_MAN 322 @@ -60,6 +61,9 @@ namespace Fullpipe { #define PIC_INV_MENU 991 #define PIC_MAP_A13 5275 #define PIC_MAP_S01 5223 +#define PIC_SC1_KUCHKA 1321 +#define PIC_SC1_OSK 1018 +#define PIC_SC1_OSK2 2932 #define SC_1 301 #define SC_10 653 #define SC_11 654 @@ -112,6 +116,7 @@ namespace Fullpipe { #define SC_MAP 5222 #define SC_TEST 903 #define SC_TITLES 5166 +#define ST_LBN_2N 2756 #define ST_MAN_EMPTY 476 #define TrubaDown 697 #define TrubaLeft 474 diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 9585f07836..2a5ceb1671 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -55,6 +55,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _pictureScale = 8; _scrollSpeed = 0; _currSoundListCount = 0; + _globalPalette = 0; _updateTicks = 0; @@ -72,7 +73,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _gameContinue = true; _needRestart = false; - _flgPlayIntro = true; + _flgPlayIntro = false; _flgSavegameMenuRequested = false; _isProcessingMessages = false; @@ -275,6 +276,15 @@ int FullpipeEngine::getObjectEnumState(const char *name, const char *state) { return 0; } +int FullpipeEngine::getObjectState(const char *objname) { + CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); + + if (var) + return var->getSubVarAsInt(objname); + + return 0; +} + void FullpipeEngine::setObjectState(const char *name, int state) { CGameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index c76236e43f..85538e7cb2 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -118,6 +118,7 @@ public: Scene *_scene2; StaticANIObject *_aniMan; StaticANIObject *_aniMan2; + byte *_globalPalette; CInputController *_inputController; bool _inputDisabled; @@ -185,6 +186,7 @@ public: int _cursorId; + int getObjectState(const char *objname); void setObjectState(const char *name, int state); int getObjectEnumState(const char *name, const char *state); diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index c677d0e378..8996337e2f 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -427,6 +427,15 @@ void Picture::draw(int x, int y, int style, int angle) { warning("Picture:draw: alpha = %0x", _alpha); } + byte *pal = _paletteData; + + if (!pal) { + pal = g_fullpipe->_globalPalette; + + if (!pal) + error("Picture::draw(): Both global and local palettes are empty"); + } + switch (style) { case 1: //flip @@ -439,7 +448,7 @@ void Picture::draw(int x, int y, int style, int angle) { if (angle) drawRotated(x1, y1, angle); else - _bitmap->putDib(x1, y1, (int32 *)_paletteData); + _bitmap->putDib(x1, y1, (int32 *)pal); } } diff --git a/engines/fullpipe/init.cpp b/engines/fullpipe/init.cpp index 4e3520997a..f4a62aabb3 100644 --- a/engines/fullpipe/init.cpp +++ b/engines/fullpipe/init.cpp @@ -35,7 +35,7 @@ void FullpipeEngine::initObjectStates() { setLevelStates(); setObjectState(sO_Dude, getObjectEnumState(sO_Dude, sO_NotCarryingEgg)); - setObjectState(sO_EggCracker, getObjectEnumState(sO_EggCracker, sO_NotCrackedEggs)); + setObjectState(sO_EggCracker, getObjectEnumState(sO_EggCracker, sO_DidNotCrackEgg)); setObjectState(sO_GuvTheDrawer, getObjectEnumState(sO_GuvTheDrawer, sO_Awaken)); setObjectState(sO_EggGulper, getObjectEnumState(sO_EggGulper, sO_First)); setObjectState(sO_EggGulperGaveCoin, getObjectEnumState(sO_EggGulperGaveCoin, sO_No)); diff --git a/engines/fullpipe/objectnames.h b/engines/fullpipe/objectnames.h index 39c4e5dd76..3eaaf7046f 100644 --- a/engines/fullpipe/objectnames.h +++ b/engines/fullpipe/objectnames.h @@ -128,7 +128,7 @@ #define sO_NotTaken "\xcd\xe5 \xe2\xe7\xff\xf2" // "Не взят" #define sO_NotHanging "\xcd\xe5 \xe2\xe8\xf1\xe8\xf2" // "Не висит" #define sO_NotGrown "\xcd\xe5 \xe2\xfb\xf0\xee\xf1" // "Не вырос" -#define sO_NotCrackedEggs "\xcd\xe5 \xea\xee\xeb\xee\xeb \xff\xe9\xf6\xee" // "Не колол яйцо" +#define sO_DidNotCrackEgg "\xcd\xe5 \xea\xee\xeb\xee\xeb \xff\xe9\xf6\xee" // "Не колол яйцо" #define sO_NotFallen "\xcd\xe5 \xef\xe0\xe4\xe0\xeb" // "Не падал" #define sO_NotAvailable "\xcd\xe5\xe4\xee\xf1\xf2\xf3\xef\xed\xe0" // "Недоступна" #define sO_CannotTake "\xcd\xe5\xeb\xfc\xe7\xff \xe2\xe7\xff\xf2\xfc" // "Нельзя взять" diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index 80130f9a3a..13a25b78e5 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -416,7 +416,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) { return; if (_palette) { - warning("Scene palette is ignored"); + g_fullpipe->_globalPalette = _palette->_data; } debug(0, "Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg); diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index 5af9d98b01..d2a75c150d 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -35,15 +35,23 @@ #include "fullpipe/behavior.h" #include "fullpipe/constants.h" +#include "fullpipe/objectnames.h" #include "fullpipe/scenes.h" #include "fullpipe/modal.h" namespace Fullpipe { +int defaultUpdateCursor(); +void setElevatorButton(const char *name, int state); + int sceneIntro_updateCursor(); void sceneIntro_initScene(Scene *sc); int sceneHandlerIntro(ExCommand *cmd); +void scene01_fixEntrance(); +void scene01_initScene(Scene *sc, int entrance); +int sceneHandler01(ExCommand *cmd); + Vars::Vars() { sceneIntro_aniin1man = 0; sceneIntro_needSleep = true; @@ -153,19 +161,19 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { _updateCursorCallback = sceneIntro_updateCursor; break; -#if 0 case SC_1: - scene01_sub_40E160(); + scene01_fixEntrance(); sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_1"); scene->preloadMovements(sceneVar); - scene01_initScene(scene, entrance->field_4); + scene01_initScene(scene, entrance->_field_4); _behaviorManager->initBehavior(scene, sceneVar); scene->initObjectCursors("SC_1"); setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler01, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; +#if 0 case SC_2: sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_2"); scene->preloadMovements(sceneVar); @@ -174,7 +182,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_2"); setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler02, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_3: @@ -208,7 +216,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_5"); setSceneMusicParameters(sceneVar); insertMessageHandler(sceneHandler05, 2, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_6: @@ -231,7 +239,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_7"); setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler07, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_8: @@ -288,7 +296,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_12"); setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler12, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_13: @@ -299,7 +307,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_13"); setSceneMusicParameters(sceneVar); insertMessageHandler(sceneHandler13, 2, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_14: @@ -397,7 +405,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_20"); setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler20, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_21: @@ -444,7 +452,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler24, 2); scene24_sub_423DD0(); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_25: @@ -523,7 +531,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_31"); setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler31, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_32: @@ -570,7 +578,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_35"); setSceneMusicParameters(sceneVar); insertMessageHandler(sceneHandler35, 2, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_36: @@ -603,7 +611,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { scene->initObjectCursors("SC_38"); setSceneMusicParameters(sceneVar); addMessageHandler(sceneHandler38, 2); - _updateCursorCallback = defaultUpdateCursorCallback; + _updateCursorCallback = defaultUpdateCursor; break; case SC_FINAL1: @@ -635,6 +643,13 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) { return true; } +void setElevatorButton(const char *name, int state) { + CGameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons); + + if (var) + var->setSubVarAsInt(name, state); +} + int global_messageHandler1(ExCommand *cmd) { warning("STUB: global_messageHandler1()"); @@ -659,6 +674,12 @@ int global_messageHandler4(ExCommand *cmd) { return 0; } +int defaultUpdateCursor() { + warning("STUB: defaultUpdateCursor"); + + return g_fullpipe->_cursorId; +} + int sceneIntro_updateCursor() { g_fullpipe->_cursorId = 0; @@ -688,4 +709,40 @@ int sceneHandlerIntro(ExCommand *cmd) { return 0; } +void scene01_fixEntrance() { + CGameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME"); + if (var->getSubVarAsInt("Entrance") == TrubaLeft) + var->setSubVarAsInt("Entrance", TrubaRight); +} + +void scene01_initScene(Scene *sc, int entrance) { + g_vars->scene01_unused = 0; + + g_vars->scene01_picSc01Osk = sc->getPictureObjectById(PIC_SC1_OSK, 0); + g_vars->scene01_picSc01Osk->_flags &= 0xFFFB; + + g_vars->scene01_picSc01Osk2 = sc->getPictureObjectById(PIC_SC1_OSK2, 0); + g_vars->scene01_picSc01Osk2->_flags &= 0xFFFB; + + if (g_fullpipe->getObjectState(sO_EggCracker) == g_fullpipe->getObjectEnumState(sO_EggCracker, sO_DidNotCrackEgg)) { + PictureObject *pic = sc->getPictureObjectById(PIC_SC1_KUCHKA, 0); + if (pic) + pic->_flags &= 0xFFFB; + } + + if (entrance != TrubaLeft ) { + StaticANIObject *bootAnim = sc->getStaticANIObject1ById(ANI_BOOT_1, -1); + if (bootAnim) + bootAnim->_flags &= 0xFFFB; + } + + setElevatorButton(sO_Level2, ST_LBN_2N); +} + +int sceneHandler01(ExCommand *cmd) { + warning("STUB: sceneHandler01()"); + + return 0; +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index 9466e14b96..da3ac5162c 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -37,6 +37,10 @@ class Vars { bool sceneIntro_skipIntro; bool sceneIntro_playing; bool sceneIntro_needBlackout; + + int scene01_unused; + PictureObject *scene01_picSc01Osk; + PictureObject *scene01_picSc01Osk2; }; } // End of namespace Fullpipe diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h index 70a057c82a..00ae76eac7 100644 --- a/engines/fullpipe/utils.h +++ b/engines/fullpipe/utils.h @@ -79,6 +79,7 @@ class CObList : public Common::List<CObject>, public CObject { class MemoryObject : CObject { friend class Picture; + friend class Scene; protected: char *_memfilename; |