diff options
author | Bastien Bouclet | 2010-11-29 20:51:35 +0000 |
---|---|---|
committer | Bastien Bouclet | 2010-11-29 20:51:35 +0000 |
commit | 536c6b6ef41478c76d3325fcd6d03c83c6fe985f (patch) | |
tree | 49f60734b965ea5c72db88009b7300e0894c4ca7 /engines | |
parent | a85346cb16a006b82116d3022ad8536bae0a3c75 (diff) | |
download | scummvm-rg350-536c6b6ef41478c76d3325fcd6d03c83c6fe985f.tar.gz scummvm-rg350-536c6b6ef41478c76d3325fcd6d03c83c6fe985f.tar.bz2 scummvm-rg350-536c6b6ef41478c76d3325fcd6d03c83c6fe985f.zip |
MOHAWK: Rename some fields for type 11 areas
svn-id: r54600
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/myst.cpp | 7 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 1 | ||||
-rw-r--r-- | engines/mohawk/myst_areas.cpp | 50 | ||||
-rw-r--r-- | engines/mohawk/myst_areas.h | 19 |
4 files changed, 33 insertions, 44 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 6844f9bca7..74fe466d7c 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -241,6 +241,7 @@ Common::Error MohawkEngine_Myst::run() { _loadDialog->setSaveMode(false); _optionsDialog = new MystOptionsDialog(this); _cursor = new MystCursorManager(this); + _mouseClicked = false; // Start us on the first stack. if (getGameType() == GType_MAKINGOF) @@ -295,12 +296,13 @@ Common::Error MohawkEngine_Myst::run() { _mousePos = event.mouse; _needsUpdate = true; checkCurrentResource(); - if (_curResource >= 0) { + if (_curResource >= 0 && _mouseClicked) { debug(2, "Sending mouse move event to resource %d\n", _curResource); - _resources[_curResource]->handleMouseMove(); + _resources[_curResource]->handleMouseDrag(); } break; case Common::EVENT_LBUTTONUP: + _mouseClicked = false; if (_curResource >= 0) { debug(2, "Sending mouse up event to resource %d\n", _curResource); _resources[_curResource]->handleMouseUp(); @@ -309,6 +311,7 @@ Common::Error MohawkEngine_Myst::run() { drawResourceImages(); break; case Common::EVENT_LBUTTONDOWN: + _mouseClicked = true; if (_curResource >= 0) { debug(2, "Sending mouse up event to resource %d\n", _curResource); _resources[_curResource]->handleMouseDown(); diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 4c87b45659..eba741ddd2 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -236,6 +236,7 @@ private: void loadCursorHints(); void checkCursorHints(); Common::Point _mousePos; + bool _mouseClicked; uint16 _currentCursor; uint16 _mainCursor; // Also defines the current page being held (white, blue, red, or none) }; diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index 28627e55a9..d155843f74 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -460,6 +460,7 @@ uint16 MystResourceType8::getType8Var() { MystResourceType10::MystResourceType10(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType11(vm, rlstStream, parent) { _unk10 = rlstStream->readUint16LE(); + debugC(kDebugResource, "\tunk10: %d", _unk10); warning("TODO: Card contains Type 10 Resource - Function not yet implemented"); } @@ -468,37 +469,28 @@ MystResourceType10::~MystResourceType10() { } MystResourceType11::MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType8(vm, rlstStream, parent) { - _kind = rlstStream->readUint16LE(); - // NOTE: l,r,t,b differs from standard l,t,r,b order - _rect11.left = rlstStream->readUint16LE(); - _rect11.right = rlstStream->readUint16LE(); - _rect11.top = rlstStream->readUint16LE(); - _rect11.bottom = rlstStream->readUint16LE(); - _u0 = rlstStream->readUint16LE(); - _u1 = rlstStream->readUint16LE(); + _flagHV = rlstStream->readUint16LE(); + _minH = rlstStream->readUint16LE(); + _maxH = rlstStream->readUint16LE(); + _minV = rlstStream->readUint16LE(); + _maxV = rlstStream->readUint16LE(); + _posH = rlstStream->readUint16LE(); + _posV = rlstStream->readUint16LE(); _mouseDownOpcode = rlstStream->readUint16LE(); _mouseDragOpcode = rlstStream->readUint16LE(); _mouseUpOpcode = rlstStream->readUint16LE(); - debugC(kDebugResource, "\tkind: %d", _kind); - debugC(kDebugResource, "\trect11.left: %d", _rect11.left); - debugC(kDebugResource, "\trect11.right: %d", _rect11.right); - debugC(kDebugResource, "\trect11.top: %d", _rect11.top); - debugC(kDebugResource, "\trect11.bottom: %d", _rect11.bottom); - debugC(kDebugResource, "\tu0: %d", _u0); - debugC(kDebugResource, "\tu1: %d", _u1); + debugC(kDebugResource, "\tdirection: %d", _flagHV); + debugC(kDebugResource, "\thorizontal min: %d", _minH); + debugC(kDebugResource, "\thorizontal max: %d", _maxH); + debugC(kDebugResource, "\tvertical min: %d", _minV); + debugC(kDebugResource, "\tvertical max: %d", _maxV); + debugC(kDebugResource, "\thorizontal position: %d", _posH); + debugC(kDebugResource, "\tvertical position: %d", _posV); debugC(kDebugResource, "\t_mouseDownOpcode: %d", _mouseDownOpcode); debugC(kDebugResource, "\t_mouseDragOpcode: %d", _mouseDragOpcode); debugC(kDebugResource, "\t_mouseUpOpcode: %d", _mouseUpOpcode); - // TODO: Think that u0 and u1 are unused in Type 11 - if (_u0) - warning("Type 11 u0 non-zero"); - if (_u1) - warning("Type 11 u1 non-zero"); - - // TODO: Not sure about order of Mouse Down, Mouse Drag and Mouse Up - // Or whether this is slightly different... debugCN(kDebugResource, "Type 11 _mouseDownOpcode: %d\n", _mouseDownOpcode); debugCN(kDebugResource, "Type 11 _mouseDragOpcode: %d\n", _mouseDragOpcode); debugCN(kDebugResource, "Type 11 _mouseUpOpcode: %d\n", _mouseUpOpcode); @@ -515,8 +507,6 @@ MystResourceType11::MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableRe debugC(kDebugResource, "\tValue %d: %d", j, _lists[i].list[j]); } } - - _mouseDown = false; } MystResourceType11::~MystResourceType11() { @@ -525,21 +515,15 @@ MystResourceType11::~MystResourceType11() { } void MystResourceType11::handleMouseDown() { - _mouseDown = true; - _vm->_scriptParser->runOpcode(_mouseDownOpcode); } void MystResourceType11::handleMouseUp() { - _mouseDown = false; - _vm->_scriptParser->runOpcode(_mouseUpOpcode); } -void MystResourceType11::handleMouseMove() { - if (_mouseDown) { - _vm->_scriptParser->runOpcode(_mouseDragOpcode); - } +void MystResourceType11::handleMouseDrag() { + _vm->_scriptParser->runOpcode(_mouseDragOpcode); } MystResourceType12::MystResourceType12(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType11(vm, rlstStream, parent) { diff --git a/engines/mohawk/myst_areas.h b/engines/mohawk/myst_areas.h index 780f99ff69..be960425f6 100644 --- a/engines/mohawk/myst_areas.h +++ b/engines/mohawk/myst_areas.h @@ -52,7 +52,7 @@ public: // Mouse interface virtual void handleMouseUp(); virtual void handleMouseDown() {} - virtual void handleMouseMove() {} + virtual void handleMouseDrag() {} virtual void handleMouseEnter() {} virtual void handleMouseLeave() {} @@ -94,7 +94,7 @@ private: bool _videoRunning; }; -struct MystResourceType7 : public MystResource { +class MystResourceType7 : public MystResource { public: MystResourceType7(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent); virtual ~MystResourceType7(); @@ -139,13 +139,16 @@ public: virtual ~MystResourceType11(); void handleMouseDown(); void handleMouseUp(); - void handleMouseMove(); + void handleMouseDrag(); protected: - uint16 _kind; - Common::Rect _rect11; - uint16 _u0; - uint16 _u1; + uint16 _flagHV; + uint16 _minH; + uint16 _maxH; + uint16 _minV; + uint16 _maxV; + uint16 _posH; + uint16 _posV; uint16 _mouseDownOpcode; uint16 _mouseDragOpcode; uint16 _mouseUpOpcode; @@ -153,8 +156,6 @@ protected: uint16 listCount; uint16 *list; } _lists[3]; - - bool _mouseDown; }; class MystResourceType10 : public MystResourceType11 { |