diff options
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/constants.h | 26 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.cpp | 5 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 5 | ||||
-rw-r--r-- | engines/fullpipe/input.cpp | 65 | ||||
-rw-r--r-- | engines/fullpipe/lift.cpp | 67 | ||||
-rw-r--r-- | engines/fullpipe/module.mk | 1 | ||||
-rw-r--r-- | engines/fullpipe/scene.cpp | 13 | ||||
-rw-r--r-- | engines/fullpipe/scene.h | 3 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 6 | ||||
-rw-r--r-- | engines/fullpipe/statics.h | 2 |
10 files changed, 191 insertions, 2 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 43f90edf3d..5048bf9795 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -28,6 +28,7 @@ namespace Fullpipe { #define ANI_BOOT_1 4231 #define ANI_IN1MAN 5110 #define ANI_INV_MAP 5321 +#define ANI_LIFTBUTTON 2751 #define ANI_MAN 322 #define MSG_DISABLESAVES 5201 #define MSG_ENABLESAVES 5202 @@ -49,6 +50,12 @@ namespace Fullpipe { #define MV_MAN_TOLADDER2 2841 #define MV_MAN_TURN_LU 486 #define PIC_CMN_EVAL 3468 +#define PIC_CSR_DEFAULT 4891 +#define PIC_CSR_DEFAULT_INV 4892 +#define PIC_CSR_ITN 4893 +#define PIC_CSR_ITN_INV 4894 +#define PIC_CSR_GOFAR_L 4895 +#define PIC_CSR_GOFAR_R 4896 #define PIC_CSR_ARCADE1 4901 #define PIC_CSR_ARCADE2 4902 #define PIC_CSR_ARCADE2_D 4903 @@ -137,7 +144,26 @@ namespace Fullpipe { #define SC_TITLES 5166 #define SND_CMN_031 3516 #define SND_CMN_070 5199 +#define ST_LBN_0N 2832 +#define ST_LBN_0P 2833 +#define ST_LBN_1N 2753 +#define ST_LBN_1P 2754 #define ST_LBN_2N 2756 +#define ST_LBN_2P 2757 +#define ST_LBN_3N 2759 +#define ST_LBN_3P 2760 +#define ST_LBN_4N 2762 +#define ST_LBN_4P 2763 +#define ST_LBN_5N 2765 +#define ST_LBN_5P 2766 +#define ST_LBN_6N 2768 +#define ST_LBN_6P 2769 +#define ST_LBN_7N 2771 +#define ST_LBN_7P 2772 +#define ST_LBN_8N 2774 +#define ST_LBN_8P 2775 +#define ST_LBN_9N 2777 +#define ST_LBN_9P 2778 #define ST_MAN_EMPTY 476 #define ST_MAN_RIGHT 325 #define TrubaDown 697 diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp index 6f4feee865..49abbabd26 100644 --- a/engines/fullpipe/fullpipe.cpp +++ b/engines/fullpipe/fullpipe.cpp @@ -132,7 +132,10 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) _inventoryScene = 0; _inventory = 0; - _minCursorId = 0; + _minCursorId = 0xffff; + _maxCursorId = 0; + _objectAtCursor = 0; + _objectIdAtCursor = 0; _isSaveAllowed = true; diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 5d4deedebf..5b0ea4437c 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -200,7 +200,10 @@ public: int _cursorId; int _minCursorId; + int _maxCursorId; Common::Array<int> _objectIdCursors; + GameObject *_objectAtCursor; + int _objectIdAtCursor; void setCursor(int id); void updateCursorsCommon(); @@ -219,6 +222,8 @@ public: void openHelp(); void openMainMenu(); + int lift_getButtonIdP(int objid); + public: bool _isSaveAllowed; diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp index 64fd0d5d15..7a210772f2 100644 --- a/engines/fullpipe/input.cpp +++ b/engines/fullpipe/input.cpp @@ -25,6 +25,10 @@ #include "fullpipe/objects.h" #include "fullpipe/input.h" #include "fullpipe/gfx.h" +#include "fullpipe/scene.h" +#include "fullpipe/gameloader.h" +#include "fullpipe/statics.h" +#include "fullpipe/constants.h" namespace Fullpipe { @@ -118,7 +122,66 @@ void FullpipeEngine::defHandleKeyDown(int key) { } void FullpipeEngine::updateCursorsCommon() { - + GameObject *ani = _currentScene->getStaticANIObjectAtPos(_mouseVirtX, _mouseVirtY); + + GameObject *pic = _currentScene->getPictureObjectAtPos(_mouseVirtX, _mouseVirtY); + if (!ani || pic && pic->_priority < ani->_priority ) + ani = pic; + + int selId = getGameLoaderInventory()->getSelectedItemId(); + + _objectAtCursor = ani; + + if (ani) { + _objectIdAtCursor = ani->_id; + + if (!selId && ani->_id >= _minCursorId && ani->_id <= _maxCursorId) { + selId = _objectIdCursors[ani->_id - _minCursorId]; + if (selId) { + _cursorId = selId; + return; + } + } + if (_aniMan->canInteractAny(ani, selId)) { + _cursorId = selId > 0 ? PIC_CSR_ITN_INV : PIC_CSR_ITN; + return; + } + if (selId) { + _cursorId = PIC_CSR_DEFAULT_INV; + return; + } + if (_objectIdAtCursor == ANI_LIFTBUTTON && lift_getButtonIdP(((StaticANIObject *)ani)->_statics->_staticsId)) { + _cursorId = PIC_CSR_LIFT; + return; + } + if (_sceneRect.right - _mouseVirtX < 47 && _sceneRect.right < _sceneWidth - 1) { + _cursorId = PIC_CSR_GOFAR_R; + return; + } + if (_mouseVirtX - _sceneRect.left < 47 && _sceneRect.left > 0) { + _cursorId = PIC_CSR_GOFAR_L; + return; + } + _cursorId = PIC_CSR_DEFAULT; + return; + } else { + _objectIdAtCursor = 0; + + if (selId) { + _cursorId = PIC_CSR_DEFAULT_INV; + return; + } + if (_sceneRect.right - _mouseVirtX < 47 && _sceneRect.right < _sceneWidth - 1) { + _cursorId = PIC_CSR_GOFAR_R; + return; + } + if (_mouseVirtX - _sceneRect.left < 47 && _sceneRect.left > 0 ) { + _cursorId = PIC_CSR_GOFAR_L; + return; + } + } + + _cursorId = PIC_CSR_DEFAULT_INV; } } // End of namespace Fullpipe diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp new file mode 100644 index 0000000000..25dd2613fe --- /dev/null +++ b/engines/fullpipe/lift.cpp @@ -0,0 +1,67 @@ +/* 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/constants.h" + +namespace Fullpipe { + +int FullpipeEngine::lift_getButtonIdP(int objid) { + switch (objid) { + case ST_LBN_0N: + return ST_LBN_0P; + break; + case ST_LBN_1N: + return ST_LBN_1P; + break; + case ST_LBN_2N: + return ST_LBN_2P; + break; + case ST_LBN_3N: + return ST_LBN_3P; + break; + case ST_LBN_4N: + return ST_LBN_4P; + break; + case ST_LBN_5N: + return ST_LBN_5P; + break; + case ST_LBN_6N: + return ST_LBN_6P; + break; + case ST_LBN_7N: + return ST_LBN_7P; + break; + case ST_LBN_8N: + return ST_LBN_8P; + break; + case ST_LBN_9N: + return ST_LBN_9P; + break; + default: + return 0; + break; + } +} + +} // End of namespace Fullpipe diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk index 81cb0f990f..41ed3e31f6 100644 --- a/engines/fullpipe/module.mk +++ b/engines/fullpipe/module.mk @@ -10,6 +10,7 @@ MODULE_OBJS = \ input.o \ interaction.o \ inventory.o \ + lift.o \ messages.o \ modal.o \ motion.o \ diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp index c413779963..0a7d035339 100644 --- a/engines/fullpipe/scene.cpp +++ b/engines/fullpipe/scene.cpp @@ -417,6 +417,7 @@ void Scene::initObjectCursors(const char *varname) { } g_fullpipe->_minCursorId = minId; + g_fullpipe->_maxCursorId = maxId; g_fullpipe->_objectIdCursors.resize(maxId - minId + 1); @@ -475,6 +476,18 @@ void Scene::updateScrolling2() { warning("STUB Scene::updateScrolling2()"); } +StaticANIObject *Scene::getStaticANIObjectAtPos(int x, int y) { + warning("STUB: Scene::getStaticANIObjectAtPos(%d, %d)", x, y); + + return 0; +} + +PictureObject *Scene::getPictureObjectAtPos(int x, int y) { + warning("STUB: Scene::getPictureObjectAtPos(%d, %d)", x, y); + + return 0; +} + void Scene::update(int counterdiff) { debug(0, "Scene::update(%d)", counterdiff); diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h index d1a5b39721..0f0854b059 100644 --- a/engines/fullpipe/scene.h +++ b/engines/fullpipe/scene.h @@ -71,6 +71,9 @@ class Scene : public Background { void deletePictureObject(PictureObject *obj); void preloadMovements(CGameVar *var); + StaticANIObject *getStaticANIObjectAtPos(int x, int y); + PictureObject *getPictureObjectAtPos(int x, int y); + void initObjectCursors(const char *name); private: diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index c4097386f9..9706a456ca 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -312,6 +312,12 @@ int StaticANIObject::getMovementIdById(int itemId) { return 0; } +bool StaticANIObject::canInteractAny(GameObject *obj2, int a3) { + warning("STUB: StaticANIObject::canInteractAny()"); + return false; +} + + Movement *StaticANIObject::getMovementByName(char *name) { for (uint i = 0; i < _movements.size(); i++) if (!strcmp(((Movement *)_movements[i])->_objectName, name)) diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 95030180c3..e4e2c1f602 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -230,6 +230,8 @@ class StaticANIObject : public GameObject { MessageQueue *changeStatics1(int msgNum); void changeStatics2(int objId); + + bool canInteractAny(GameObject *obj2, int a3); }; struct MovTable { |