diff options
-rw-r--r-- | engines/fullpipe/behavior.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/behavior.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/constants.h | 4 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 1 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/gfx.h | 3 | ||||
-rw-r--r-- | engines/fullpipe/interaction.cpp | 99 | ||||
-rw-r--r-- | engines/fullpipe/interaction.h | 88 | ||||
-rw-r--r-- | engines/fullpipe/messages.cpp | 3 | ||||
-rw-r--r-- | engines/fullpipe/module.mk | 1 | ||||
-rw-r--r-- | engines/fullpipe/objects.h | 48 | ||||
-rw-r--r-- | engines/fullpipe/scenes.cpp | 52 | ||||
-rw-r--r-- | engines/fullpipe/sound.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/sound.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 60 | ||||
-rw-r--r-- | engines/fullpipe/utils.cpp | 1 |
16 files changed, 256 insertions, 116 deletions
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp index e7d1bc9858..4f9e50d96b 100644 --- a/engines/fullpipe/behavior.cpp +++ b/engines/fullpipe/behavior.cpp @@ -36,4 +36,8 @@ void BehaviorManager::initBehavior(Scene *scene, CGameVar *var) { warning("STUB: BehaviorManager::initBehavior()"); } +void BehaviorManager::updateBehaviors() { + warning("STUB: BehaviorManager::updateBehaviors()"); +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/behavior.h b/engines/fullpipe/behavior.h index 5e3b09086d..ea618fdfd6 100644 --- a/engines/fullpipe/behavior.h +++ b/engines/fullpipe/behavior.h @@ -34,6 +34,7 @@ class BehaviorManager : public CObject { BehaviorManager(); void initBehavior(Scene *scene, CGameVar *var); + void updateBehaviors(); }; struct BehaviorEntryInfo { diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 53a0831f1b..b1a7565fea 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -29,6 +29,9 @@ namespace Fullpipe { #define ANI_IN1MAN 5110 #define ANI_INV_MAP 5321 #define ANI_MAN 322 +#define MSG_SC1_SHOWOSK 1019 +#define MSG_SC1_SHOWOSK2 468 +#define MSG_SC1_UTRUBACLICK 1100 #define MV_MAN_TURN_LU 486 #define PIC_CMN_EVAL 3468 #define PIC_CSR_ARCADE1 4901 @@ -62,6 +65,7 @@ namespace Fullpipe { #define PIC_MAP_A13 5275 #define PIC_MAP_S01 5223 #define PIC_SC1_KUCHKA 1321 +#define PIC_SC1_LADDER 1091 #define PIC_SC1_OSK 1018 #define PIC_SC1_OSK2 2932 #define SC_1 301 diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 205a84ee41..0b431975e1 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -26,6 +26,7 @@ #include "fullpipe/scene.h" #include "fullpipe/input.h" #include "fullpipe/statics.h" +#include "fullpipe/interaction.h" namespace Fullpipe { diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index e1a0bac95e..cc41855dba 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -32,6 +32,7 @@ namespace Fullpipe { class SceneTag; class CMctlCompound; class CInputController; + class CInteractionController; class CGameLoader : public CObject { public: diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h index 2ee34e1a1a..98dfa20a06 100644 --- a/engines/fullpipe/gfx.h +++ b/engines/fullpipe/gfx.h @@ -151,12 +151,9 @@ class PictureObject : public GameObject { }; class Background : public CObject { - friend class FullpipeEngine; - public: CPtrList _picObjList; - protected: char *_bgname; int _x; int _y; diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp new file mode 100644 index 0000000000..8942d5dc6d --- /dev/null +++ b/engines/fullpipe/interaction.cpp @@ -0,0 +1,99 @@ +/* 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/interaction.h" +#include "fullpipe/gameloader.h" + +namespace Fullpipe { + +int handleObjectInteraction(GameObject *subject, GameObject *object, int invId) { + return getGameLoaderInteractionController()->handleInteraction(subject, object, invId); +} + +bool CInteractionController::load(MfcArchive &file) { + debug(5, "CInteractionController::load()"); + + return _interactions.load(file); +} + +void CInteractionController::sortInteractions(int sceneId) { + warning("STUB: CInteractionController::sortInteractions(%d)", sceneId); +} + +int CInteractionController::handleInteraction(GameObject *subject, GameObject *object, int invId) { + warning("STUB: CInteractionController::handleInteraction()"); + + return 0; +} + +CInteraction::CInteraction() { + _objectId1 = 0; + _objectId2 = 0; + _staticsId1 = 0; + _objectId3 = 0; + _objectState2 = 0; + _objectState1 = 0; + _messageQueue = 0; + _flags = 0; + _yOffs = 0; + _xOffs = 0; + _staticsId2 = 0; + _field_28 = 0; + _sceneId = -1; +} + +bool CInteraction::load(MfcArchive &file) { + debug(5, "CInteraction::load()"); + + _objectId1 = file.readUint16LE(); + _objectId2 = file.readUint16LE(); + _staticsId1 = file.readUint16LE(); + _staticsId2 = file.readUint16LE(); + _objectId3 = file.readUint16LE(); + _objectState2 = file.readUint32LE(); + _objectState1 = file.readUint32LE(); + _xOffs = file.readUint32LE(); + _yOffs = file.readUint32LE(); + _sceneId = file.readUint32LE(); + _flags = file.readUint32LE(); + _actionName = file.readPascalString(); + + _messageQueue = (MessageQueue *)file.readClass(); + + return true; +} + +bool EntranceInfo::load(MfcArchive &file) { + debug(5, "EntranceInfo::load()"); + + _sceneId = file.readUint32LE(); + _field_4 = file.readUint32LE(); + _messageQueueId = file.readUint32LE(); + file.read(_gap_C, 292); // FIXME, Ugh + _field_130 = file.readUint32LE(); + + return true; +} + +} // End of namespace Fullpipe diff --git a/engines/fullpipe/interaction.h b/engines/fullpipe/interaction.h new file mode 100644 index 0000000000..5931f1a388 --- /dev/null +++ b/engines/fullpipe/interaction.h @@ -0,0 +1,88 @@ +/* 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. + * + */ + +#ifndef FULLPIPE_INTERACTION_H +#define FULLPIPE_INTERACTION_H + +#include "fullpipe/utils.h" + +namespace Fullpipe { + +class GameObject; +class MessageQueue; +class StaticANIObject; + +int handleObjectInteraction(GameObject *subject, GameObject *object, int invId); + +class CInteraction : public CObject { + int16 _objectId1; + int16 _objectId2; + int16 _objectId3; + int16 _staticsId1; + int16 _staticsId2; + int16 _field_E; + int _objectState1; + int _objectState2; + int _xOffs; + int _yOffs; + MessageQueue *_messageQueue; + int _sceneId; + int _field_28; + int _flags; + char *_actionName; + + public: + CInteraction(); + virtual bool load(MfcArchive &file); +}; + +class CInteractionController : public CObject { + CObList _interactions; + int16 _field_20; + bool _flag24; + + public: + CInteractionController() : _field_20(0), _flag24(true) {} + + virtual bool load(MfcArchive &file); + + void enableFlag24() { _flag24 = true; } + void disableFlag24() { _flag24 = false; } + + void sortInteractions(int sceneId); + + int handleInteraction(GameObject *subject, GameObject *object, int invId); +}; + +struct EntranceInfo { + int32 _sceneId; + int32 _field_4; + int32 _messageQueueId; + byte _gap_C[292]; // FIXME + int32 _field_130; + + bool load(MfcArchive &file); +}; + +} // End of namespace Fullpipe + +#endif /* FULLPIPE_INTERACTION_H */ diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp index 40cd35530a..fe9ca51811 100644 --- a/engines/fullpipe/messages.cpp +++ b/engines/fullpipe/messages.cpp @@ -507,8 +507,7 @@ void addMessageHandler(int (*callback)(ExCommand *), int16 id) { allocMessageHandler(curItem, id, callback, index); if (curItem) - updateMessageHandlerIndex(curItem->nextItem->nextItem, 1); - + updateMessageHandlerIndex(curItem->nextItem->nextItem, 1); } MessageHandler *getMessageHandlerById(int16 id) { diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk index 602478cbb7..81cb0f990f 100644 --- a/engines/fullpipe/module.mk +++ b/engines/fullpipe/module.mk @@ -8,6 +8,7 @@ MODULE_OBJS = \ gfx.o \ init.o \ input.o \ + interaction.o \ inventory.o \ messages.o \ modal.o \ diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h index 133320f326..33406bb217 100644 --- a/engines/fullpipe/objects.h +++ b/engines/fullpipe/objects.h @@ -43,44 +43,6 @@ class GameProject : public CObject { virtual bool load(MfcArchive &file); }; -class CInteraction : public CObject { - int16 _objectId1; - int16 _objectId2; - int16 _objectId3; - int16 _staticsId1; - int16 _staticsId2; - int16 _field_E; - int _objectState1; - int _objectState2; - int _xOffs; - int _yOffs; - MessageQueue *_messageQueue; - int _sceneId; - int _field_28; - int _flags; - char *_actionName; - - public: - CInteraction(); - virtual bool load(MfcArchive &file); -}; - -class CInteractionController : public CObject { - CObList _interactions; - int16 _field_20; - bool _flag24; - - public: - CInteractionController() : _field_20(0), _flag24(true) {} - - virtual bool load(MfcArchive &file); - - void enableFlag24() { _flag24 = true; } - void disableFlag24() { _flag24 = false; } - - void sortInteractions(int sceneId); -}; - struct PicAniInfo { int32 type; int16 objectId; @@ -101,16 +63,6 @@ struct PicAniInfo { bool load(MfcArchive &file); }; -struct EntranceInfo { - int32 _sceneId; - int32 _field_4; - int32 _messageQueueId; - byte _gap_C[292]; // FIXME - int32 _field_130; - - bool load(MfcArchive &file); -}; - class CMotionController; class Sc2 : public CObject { diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index d2a75c150d..5663fc2446 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -38,6 +38,7 @@ #include "fullpipe/objectnames.h" #include "fullpipe/scenes.h" #include "fullpipe/modal.h" +#include "fullpipe/interaction.h" namespace Fullpipe { @@ -695,10 +696,8 @@ void sceneIntro_initScene(Scene *sc) { g_vars->sceneIntro_playing = true; g_vars->sceneIntro_needBlackout = false; -#if 0 if (g_fullpipe->_recordEvents || g_fullpipe->_inputArFlag) g_vars->sceneIntro_skipIntro = false; -#endif g_fullpipe->_modalObject = new CModalIntro; } @@ -740,9 +739,54 @@ void scene01_initScene(Scene *sc, int entrance) { } int sceneHandler01(ExCommand *cmd) { - warning("STUB: sceneHandler01()"); + int res = 0; - return 0; + if (cmd->_messageKind != 17) + return 0; + + if (cmd->_messageNum > MSG_SC1_SHOWOSK) { + if (cmd->_messageNum == MSG_SC1_UTRUBACLICK) + handleObjectInteraction(g_fullpipe->_aniMan, g_fullpipe->_currentScene->getPictureObjectById(PIC_SC1_LADDER, 0), 0); + + return 0; + } + + if (cmd->_messageNum == MSG_SC1_SHOWOSK) { + g_vars->scene01_picSc01Osk->_flags |= 4; + + g_vars->scene01_picSc01Osk->_priority = 20; + g_vars->scene01_picSc01Osk2->_priority = 21; + + return 0; + } + + if (cmd->_messageNum != 0x21) { + if (cmd->_messageNum == MSG_SC1_SHOWOSK2) { + g_vars->scene01_picSc01Osk2->_flags |= 4; + g_vars->scene01_picSc01Osk2->_priority = 20; + g_vars->scene01_picSc01Osk->_priority = 21; + + return 0; + } + + return 0; + } + + if (g_fullpipe->_aniMan2) { + if (g_fullpipe->_aniMan2->_ox < g_fullpipe->_sceneRect.left + 200) { + g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.left - 300; + } + + if (g_fullpipe->_aniMan2->_ox > g_fullpipe->_sceneRect.right - 200) + g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.right + 300; + + res = 1; + } + g_fullpipe->_behaviorManager->updateBehaviors(); + + startSceneTrack(); + + return res; } } // End of namespace Fullpipe diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index ced3bf1c11..996bf5b1a4 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -110,4 +110,8 @@ void FullpipeEngine::setSceneMusicParameters(CGameVar *var) { warning("STUB: FullpipeEngine::setSceneMusicParameters()"); } +void startSceneTrack() { + warning("STUB: startSceneTrack()"); +} + } // End of namespace Fullpipe diff --git a/engines/fullpipe/sound.h b/engines/fullpipe/sound.h index 93e994a720..775086774c 100644 --- a/engines/fullpipe/sound.h +++ b/engines/fullpipe/sound.h @@ -25,6 +25,8 @@ namespace Fullpipe { +void startSceneTrack(); + class Sound : public MemoryObject { int _id; char *_description; diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index bdfeb92b36..3cc4d0046f 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -30,6 +30,7 @@ #include "fullpipe/gameloader.h" #include "fullpipe/scene.h" #include "fullpipe/statics.h" +#include "fullpipe/interaction.h" #include "fullpipe/constants.h" @@ -142,53 +143,6 @@ GameProject::~GameProject() { free(_headerFilename); } -bool CInteractionController::load(MfcArchive &file) { - debug(5, "CInteractionController::load()"); - - return _interactions.load(file); -} - -void CInteractionController::sortInteractions(int sceneId) { - warning("STUB: CInteractionController::sortInteractions(%d)", sceneId); -} - -CInteraction::CInteraction() { - _objectId1 = 0; - _objectId2 = 0; - _staticsId1 = 0; - _objectId3 = 0; - _objectState2 = 0; - _objectState1 = 0; - _messageQueue = 0; - _flags = 0; - _yOffs = 0; - _xOffs = 0; - _staticsId2 = 0; - _field_28 = 0; - _sceneId = -1; -} - -bool CInteraction::load(MfcArchive &file) { - debug(5, "CInteraction::load()"); - - _objectId1 = file.readUint16LE(); - _objectId2 = file.readUint16LE(); - _staticsId1 = file.readUint16LE(); - _staticsId2 = file.readUint16LE(); - _objectId3 = file.readUint16LE(); - _objectState2 = file.readUint32LE(); - _objectState1 = file.readUint32LE(); - _xOffs = file.readUint32LE(); - _yOffs = file.readUint32LE(); - _sceneId = file.readUint32LE(); - _flags = file.readUint32LE(); - _actionName = file.readPascalString(); - - _messageQueue = (MessageQueue *)file.readClass(); - - return true; -} - bool PreloadItems::load(MfcArchive &file) { debug(5, "PreloadItems::load()"); @@ -440,16 +394,4 @@ bool PicAniInfo::load(MfcArchive &file) { return true; } -bool EntranceInfo::load(MfcArchive &file) { - debug(5, "EntranceInfo::load()"); - - _sceneId = file.readUint32LE(); - _field_4 = file.readUint32LE(); - _messageQueueId = file.readUint32LE(); - file.read(_gap_C, 292); // FIXME, Ugh - _field_130 = file.readUint32LE(); - - return true; -} - } // End of namespace Fullpipe diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 3684d3ccf5..042afd28df 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -29,6 +29,7 @@ #include "fullpipe/motion.h" #include "fullpipe/ngiarchive.h" #include "fullpipe/messages.h" +#include "fullpipe/interaction.h" namespace Fullpipe { |