aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/fullpipe.cpp5
-rw-r--r--engines/fullpipe/fullpipe.h11
-rw-r--r--engines/fullpipe/gameloader.cpp17
-rw-r--r--engines/fullpipe/scenes.cpp24
-rw-r--r--engines/fullpipe/stateloader.cpp74
5 files changed, 85 insertions, 46 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index ddbae7ac07..efecffa552 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -77,6 +77,11 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_updateScreenCallback = 0;
_updateCursorCallback = 0;
+ _msgX = 0;
+ _msgY = 0;
+ _msgObjectId2 = 0;
+ _msgId = 0;
+
_behaviorManager = 0;
_cursorId = 0;
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index ba4b3171de..760bd4e9cc 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -50,6 +50,7 @@ class CInputController;
class CInventory2;
struct CursorInfo;
class EntranceInfo;
+class ExCommand;
class GameProject;
class GlobalMessageQueueList;
class MessageHandler;
@@ -59,6 +60,11 @@ class Scene;
class SoundList;
class StaticANIObject;
+int global_messageHandler1(ExCommand *cmd);
+int global_messageHandler2(ExCommand *cmd);
+int global_messageHandler3(ExCommand *cmd);
+int global_messageHandler4(ExCommand *cmd);
+
class FullpipeEngine : public ::Engine {
protected:
@@ -121,6 +127,11 @@ public:
GlobalMessageQueueList *_globalMessageQueueList;
MessageHandler *_messageHandlers;
+ int _msgX;
+ int _msgY;
+ int _msgObjectId2;
+ int _msgId;
+
BehaviorManager *_behaviorManager;
MovTable *_movTable;
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index 72b2827568..61a4915fa7 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -51,9 +51,9 @@ CGameLoader::CGameLoader() {
_gameProject = 0;
//_gameName = "untitled";
- //addMessageHandler2(CGameLoader_messageHandler1, 0, 0);
- //insertMessageHandler(CGameLoader_messageHandler2, 0, 128);
- //insertMessageHandler(CGameLoader_messageHandler3, 0, 1);
+ addMessageHandlerByIndex(global_messageHandler2, 0, 0);
+ insertMessageHandler(global_messageHandler3, 0, 128);
+ insertMessageHandler(global_messageHandler4, 0, 1);
_field_FA = 0;
_field_F8 = 0;
@@ -65,13 +65,10 @@ CGameLoader::CGameLoader() {
_preloadId2 = 0;
_updateCounter = 0;
- //g_x = 0;
- //g_y = 0;
- //dword_478480 = 0;
- //g_objectId2 = 0;
- //g_id = 0;
-
- warning("STUB: CGameLoader::CGameLoader()");
+ g_fullpipe->_msgX = 0;
+ g_fullpipe->_msgY = 0;
+ g_fullpipe->_msgObjectId2 = 0;
+ g_fullpipe->_msgId = 0;
}
CGameLoader::~CGameLoader() {
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 6e033a08f3..8a7d7805b5 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -624,6 +624,30 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
return true;
}
+int global_messageHandler1(ExCommand *cmd) {
+ warning("STUB: global_messageHandler1()");
+
+ return 0;
+}
+
+int global_messageHandler2(ExCommand *cmd) {
+ warning("STUB: global_messageHandler2()");
+
+ return 0;
+}
+
+int global_messageHandler3(ExCommand *cmd) {
+ warning("STUB: global_messageHandler3()");
+
+ return 0;
+}
+
+int global_messageHandler4(ExCommand *cmd) {
+ warning("STUB: global_messageHandler4()");
+
+ return 0;
+}
+
int sceneIntro_updateCursor() {
g_fullpipe->_cursorId = 0;
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 859e6eac15..d4c4948f21 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -38,55 +38,57 @@ namespace Fullpipe {
bool FullpipeEngine::loadGam(const char *fname) {
_gameLoader = new CGameLoader();
- if (_gameLoader->loadFile(fname)) {
- g_fullpipe->_currSoundListCount = 0;
- initObjectStates();
+ if (!_gameLoader->loadFile(fname))
+ return false;
- //set_g_messageQueueCallback1(messageQueueCallback1);
- //addMessageHandler2(global_messageHandler, 0, 4);
- _inventory = getGameLoaderInventory();
- _inventory->setItemFlags(ANI_INV_MAP, 0x10003);
- _inventory->addItem(ANI_INV_MAP, 1);
+ _currSoundListCount = 0;
+ initObjectStates();
+ // set_g_messageQueueCallback1(messageQueueCallback1);
- _inventory->rebuildItemRects();
+ addMessageHandlerByIndex(global_messageHandler1, 0, 4);
- for (CPtrList::iterator p = _inventory->getScene()->_picObjList.begin(); p != _inventory->getScene()->_picObjList.end(); ++p) {
- ((MemoryObject *)((PictureObject *)*p)->_picture)->load();
- }
+ _inventory = getGameLoaderInventory();
+ _inventory->setItemFlags(ANI_INV_MAP, 0x10003);
+ _inventory->addItem(ANI_INV_MAP, 1);
- //_sceneSwitcher = sceneSwitcher;
- //_preloadCallback = gameLoaderPreloadCallback
- //_readSavegameCallback = gameLoaderReadSavegameCallback;
- _aniMan = accessScene(SC_COMMON)->getAniMan();
- _scene2 = 0;
+ _inventory->rebuildItemRects();
- _movTable = _aniMan->countMovements();
+ for (CPtrList::iterator p = _inventory->getScene()->_picObjList.begin(); p != _inventory->getScene()->_picObjList.end(); ++p) {
+ ((MemoryObject *)((PictureObject *)*p)->_picture)->load();
+ }
- _aniMan->setSpeed(1);
+ // _sceneSwitcher = sceneSwitcher;
+ // _preloadCallback = gameLoaderPreloadCallback
+ // _readSavegameCallback = gameLoaderReadSavegameCallback;
- PictureObject *pic = accessScene(SC_INV)->getPictureObjectById(PIC_INV_MENU, 0);
+ _aniMan = accessScene(SC_COMMON)->getAniMan();
+ _scene2 = 0;
- pic->setFlags(pic->_flags & 0xFFFB);
+ _movTable = _aniMan->countMovements();
- // Not used in full game
- //_evalVersionPic = accessScene(SC_COMMON)->getPictureObjectById(PIC_CMN_EVAL, 0);
+ _aniMan->setSpeed(1);
- initMap();
- initCursors();
+ PictureObject *pic = accessScene(SC_INV)->getPictureObjectById(PIC_INV_MENU, 0);
- setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED"));
+ pic->setFlags(pic->_flags & 0xFFFB);
- if (_flgPlayIntro) {
- _gameLoader->loadScene(SC_INTRO1);
- _gameLoader->gotoScene(SC_INTRO1, TrubaUp);
- } else {
- _gameLoader->loadScene(SC_1);
- _gameLoader->gotoScene(SC_1, TrubaLeft);
- }
+ // Not used in full game
+ //_evalVersionPic = accessScene(SC_COMMON)->getPictureObjectById(PIC_CMN_EVAL, 0);
+
+ initMap();
+ initCursors();
+
+ setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED"));
+
+ if (_flgPlayIntro) {
+ _gameLoader->loadScene(SC_INTRO1);
+ _gameLoader->gotoScene(SC_INTRO1, TrubaUp);
+ } else {
+ _gameLoader->loadScene(SC_1);
+ _gameLoader->gotoScene(SC_1, TrubaLeft);
+ }
- if (!_currentScene)
- return false;
- } else
+ if (!_currentScene)
return false;
return true;