diff options
author | Eugene Sandulenko | 2014-01-10 21:25:56 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-01-10 21:31:18 +0200 |
commit | f710418ae5dbbc8cda485ab493ea6f6b596ade72 (patch) | |
tree | 53c3bcf1a65697843ee5c578755084e90cd0de19 /engines/fullpipe | |
parent | dd84867997b515e2e95b383b68ebc27b9cc45b42 (diff) | |
download | scummvm-rg350-f710418ae5dbbc8cda485ab493ea6f6b596ade72.tar.gz scummvm-rg350-f710418ae5dbbc8cda485ab493ea6f6b596ade72.tar.bz2 scummvm-rg350-f710418ae5dbbc8cda485ab493ea6f6b596ade72.zip |
FULLPIPE: Implement preloadCallback()
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/constants.h | 5 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 4 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 45 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.h | 4 | ||||
-rw-r--r-- | engines/fullpipe/module.mk | 1 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes.h | 5 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene18and19.cpp | 49 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 5 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/statics.h | 1 |
12 files changed, 101 insertions, 26 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 93d8fda6df..4f8e33c111 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -30,6 +30,7 @@ namespace Fullpipe { #define ANI_INV_MAP 5321 #define ANI_LIFTBUTTON 2751 #define ANI_MAN 322 +#define ANI_PBAR 896 #define MSG_CMN_WINARCADE 4778 #define MSG_DISABLESAVES 5201 #define MSG_ENABLESAVES 5202 @@ -49,6 +50,7 @@ namespace Fullpipe { #define MV_MAN_STOPLADDER 454 #define MV_MAN_STOPLADDER2 2845 #define MV_MAN_TURN_LU 486 +#define MV_PBAR_RUN 897 #define PIC_CSR_DEFAULT 4891 #define PIC_CSR_DEFAULT_INV 4892 #define PIC_CSR_ITN 4893 @@ -127,6 +129,7 @@ namespace Fullpipe { #define SC_38 2072 #define SC_COMMON 321 #define SC_DBGMENU 726 +#define SC_LDR 635 #define SC_FINAL1 4999 #define SC_FINAL2 5000 #define SC_FINAL3 5001 @@ -139,6 +142,7 @@ namespace Fullpipe { #define SND_CMN_061 4922 #define SND_CMN_070 5199 #define SND_INTR_019 5220 +#define ST_EGTR_SLIMSORROW 340 #define ST_FLY_FLY 4918 #define ST_LBN_0N 2832 #define ST_LBN_0P 2833 @@ -161,6 +165,7 @@ namespace Fullpipe { #define ST_LBN_9N 2777 #define ST_LBN_9P 2778 #define ST_MAN_EMPTY 476 +#define ST_MAN_GOU 459 #define ST_MAN_RIGHT 325 #define TrubaDown 697 #define TrubaLeft 474 diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 674dada0b9..4cfa330a09 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -99,7 +99,9 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _aniMan = 0; _aniMan2 = 0; _currentScene = 0; + _loaderScene = 0; _scene2 = 0; + _scene3 = 0; _movTable = 0; _floaters = 0; _mgm = 0; diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 824ea084f6..ecf3c12982 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -64,6 +64,7 @@ struct MovTable; class MGM; class NGIArchive; class PictureObject; +struct PreloadItem; class Scene; class SoundList; class StaticANIObject; @@ -128,7 +129,9 @@ public: int _sceneWidth; int _sceneHeight; Scene *_currentScene; + Scene *_loaderScene; Scene *_scene2; + Scene *_scene3; StaticANIObject *_aniMan; StaticANIObject *_aniMan2; byte *_globalPalette; @@ -182,6 +185,7 @@ public: Common::Array<Common::Point *> _arcadeKeys; void initMap(); + void updateMap(PreloadItem *pre); void updateMapPiece(int mapId, int update); void updateScreen(); diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index c2bb34eb0d..845655dded 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -28,6 +28,9 @@ #include "fullpipe/statics.h" #include "fullpipe/interaction.h" #include "fullpipe/motion.h" +#include "fullpipe/constants.h" +#include "fullpipe/scenes.h" +#include "fullpipe/floaters.h" namespace Fullpipe { @@ -230,8 +233,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) { return true; } -bool preloadCallback(const PreloadItem &pre, int flag) { -#if 0 +bool preloadCallback(PreloadItem &pre, int flag) { if (flag) { if (flag == 50) g_fp->_aniMan->preloadMovements(g_fp->_movTable); @@ -249,13 +251,13 @@ bool preloadCallback(const PreloadItem &pre, int flag) { pbar->_movement->setDynamicPhaseIndex(flag * (sz - 1) / 100); } - updateMap(pre); + g_fp->updateMap(&pre); g_fp->_currentScene = g_fp->_loaderScene; g_fp->_loaderScene->draw(); - _system->updateScreen(); + g_fp->_system->updateScreen(); } else { if (g_fp->_scene2) { g_fp->_aniMan = g_fp->_scene2->getAniMan(); @@ -267,40 +269,38 @@ bool preloadCallback(const PreloadItem &pre, int flag) { if (g_fp->_soundEnabled) { g_fp->_currSoundListCount = 1; - g_fp->_currSoundList1 = accessScene(SC_COMMON)->soundList; + g_fp->_currSoundList1[0] = g_fp->accessScene(SC_COMMON)->_soundList; } g_vars->scene18_var01 = 0; - v4 = ; - - if ((pre->preloadId1 != SC_18 || pre->sceneId != SC_19) && (pre->preloadId1 != SC_19 || (v5 = pre->sceneId, v5 != SC_18) && v5 != SC_19)) { + if ((pre.preloadId1 != SC_18 || pre.sceneId != SC_19) && (pre.preloadId1 != SC_19 || (pre.sceneId != SC_18 && pre.sceneId != SC_19))) { if (g_fp->_scene3) { - if (pre->preloadId1 != SC_18) - v9 = getGameLoader()->unloadScene(SC_18); + if (pre.preloadId1 != SC_18) + g_fp->_gameLoader->unloadScene(SC_18); g_fp->_scene3 = 0; } } else { - scene19_preload(accessScene(pre->preloadId1), pre->_keyCode); + scene19_preload(g_fp->accessScene(pre.preloadId1), pre.keyCode); g_vars->scene18_var01 = 1; - if (pre->preloadId1 == SC_18) { - getGameLoader()->saveScenePicAniInfos(SC_18); + if (pre.preloadId1 == SC_18) { + g_fp->_gameLoader->saveScenePicAniInfos(SC_18); scene18_preload(); } } - if (((pre->sceneId == SC_19 && pre->keyCode == TrubaRight) || pre->sceneId == SC_18 && pre->keyCode == TrubaRight) && !pre->preloadId2) { - pre->sceneId = SC_18; - pre->keyCode = TrubaLeft; + if (((pre.sceneId == SC_19 && pre.keyCode == TrubaRight) || (pre.sceneId == SC_18 && pre.keyCode == TrubaRight)) && !pre.preloadId2) { + pre.sceneId = SC_18; + pre.keyCode = TrubaLeft; } if (!g_fp->_loaderScene) { - getGameLoader()->loadScene(SC_LDR); - g_fp->_loaderScene = accessScene(SC_LDR);; + g_fp->_gameLoader->loadScene(SC_LDR); + g_fp->_loaderScene = g_fp->accessScene(SC_LDR);; } StaticANIObject *pbar = g_fp->_loaderScene->getStaticANIObject1ById(ANI_PBAR, -1); @@ -313,9 +313,9 @@ bool preloadCallback(const PreloadItem &pre, int flag) { g_fp->_inventoryScene = 0; g_fp->_updateCursorCallback = 0; - g_fp->_sceneRect.trans(-g_sceneRect.left, -g_sceneRect.top); + g_fp->_sceneRect.translate(-g_fp->_sceneRect.left, -g_fp->_sceneRect.top); - _system->delayMillis(10); + g_fp->_system->delayMillis(10); Scene *oldsc = g_fp->_currentScene; @@ -323,13 +323,10 @@ bool preloadCallback(const PreloadItem &pre, int flag) { g_fp->_loaderScene->draw(); - _system->updateScreen(); + g_fp->_system->updateScreen(); g_fp->_currentScene = oldsc; } -#endif - - warning("STUB: preloadCallback"); return true; } diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index 4cfb803d8e..85bd6ab0fb 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -65,7 +65,7 @@ struct PreloadItem { int keyCode; }; -bool preloadCallback(const PreloadItem &pre, int flag); +bool preloadCallback(PreloadItem &pre, int flag); class PreloadItems : public Common::Array<PreloadItem *>, public CObject { public: @@ -95,7 +95,7 @@ class GameLoader : public CObject { Inventory2 _inventory; Sc2Array _sc2array; void *_sceneSwitcher; - bool (*_preloadCallback)(const PreloadItem &pre, int flag); + bool (*_preloadCallback)(PreloadItem &pre, int flag); void *_readSavegameCallback; int16 _field_F8; int16 _field_FA; diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk index e90283ab41..af4e614559 100644 --- a/engines/fullpipe/module.mk +++ b/engines/fullpipe/module.mk @@ -41,6 +41,7 @@ MODULE_OBJS = \ scenes/scene15.o \ scenes/scene16.o \ scenes/scene17.o \ + scenes/scene18and19.o \ scenes/scene20.o \ scenes/scene21.o \ scenes/scene22.o \ diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index a1696c4653..4b0a3a1a7e 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -247,6 +247,8 @@ Vars::Vars() { scene17_handPhase = false; scene17_sceneEdgeX = 0; + scene18_var01 = 0; + scene20_fliesCountdown = 0; scene20_grandma = 0; diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h index edc5d13190..cd614ed1a8 100644 --- a/engines/fullpipe/scenes.h +++ b/engines/fullpipe/scenes.h @@ -101,6 +101,9 @@ void scene17_restoreState(); int sceneHandler17(ExCommand *cmd); int scene17_updateCursor(); +void scene18_preload(); +void scene19_preload(Scene *sc, int key); + void scene20_initScene(Scene *sc); int sceneHandler20(ExCommand *ex); @@ -385,6 +388,8 @@ public: bool scene17_handPhase; int scene17_sceneEdgeX; + int scene18_var01; + int scene20_fliesCountdown; StaticANIObject *scene20_grandma; diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp new file mode 100644 index 0000000000..a965cfb98e --- /dev/null +++ b/engines/fullpipe/scenes/scene18and19.cpp @@ -0,0 +1,49 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "fullpipe/fullpipe.h" + +#include "fullpipe/objectnames.h" +#include "fullpipe/constants.h" + +#include "fullpipe/gameloader.h" +#include "fullpipe/motion.h" +#include "fullpipe/scenes.h" +#include "fullpipe/statics.h" + +#include "fullpipe/interaction.h" +#include "fullpipe/behavior.h" + + +namespace Fullpipe { + +void scene18_preload() { + warning("WARNING: scene18_preload()"); +} + +void scene19_preload(Scene *sc, int key) { + warning("WARNING: scene19_preload()"); +} + + + +} // End of namespace Fullpipe diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 6e2df2c593..fdf38ada1f 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -31,6 +31,7 @@ #include "fullpipe/scene.h" #include "fullpipe/statics.h" #include "fullpipe/interaction.h" +#include "fullpipe/gameloader.h" #include "fullpipe/constants.h" @@ -327,4 +328,8 @@ bool PicAniInfo::load(MfcArchive &file) { return true; } +void FullpipeEngine::updateMap(PreloadItem *pre) { + warning("STUB: FullpipeEngine::updateMap()"); +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index e5464ebfd3..87b308007b 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -663,6 +663,10 @@ void StaticANIObject::initMovements() { ((Movement *)_movements[i])->removeFirstPhase(); } +void StaticANIObject::preloadMovements(MovTable *mt) { + warning("STUB: StaticANIObject::preloadMovements()"); +} + Common::Point *StaticANIObject::getCurrDimensions(Common::Point &p) { Picture *pic; diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 50001e84e4..b021f5383d 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -223,6 +223,7 @@ public: void initMovements(); void loadMovementsPixelData(); + void preloadMovements(MovTable *mt); void setSomeDynamicPhaseIndex(int val) { _someDynamicPhaseIndex = val; } void adjustSomeXY(); |