diff options
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/lever_control.cpp | 21 | ||||
-rw-r--r-- | engines/zvision/lever_control.h | 15 |
2 files changed, 9 insertions, 27 deletions
diff --git a/engines/zvision/lever_control.cpp b/engines/zvision/lever_control.cpp index 34877cd23f..5d9ea4db36 100644 --- a/engines/zvision/lever_control.cpp +++ b/engines/zvision/lever_control.cpp @@ -38,8 +38,7 @@ namespace ZVision { LeverControl::LeverControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream) - : MouseEvent(key), - _engine(engine), + : Control(engine, key), _frameInfo(0), _frameCount(0), _startFrame(0), @@ -69,8 +68,6 @@ LeverControl::LeverControl(ZVision *engine, uint32 key, Common::SeekableReadStre } renderFrame(_currentFrame); - - _engine->getScriptManager()->addActionNode(this); } LeverControl::~LeverControl() { @@ -175,14 +172,14 @@ void LeverControl::parseLevFile(const Common::String &fileName) { } } -void LeverControl::onMouseDown(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos) { +void LeverControl::onMouseDown(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) { if (_frameInfo[_currentFrame].hotspot.contains(backgroundImageSpacePos)) { _mouseIsCaptured = true; _lastMousePos = backgroundImageSpacePos; } } -void LeverControl::onMouseUp(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos) { +void LeverControl::onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) { _mouseIsCaptured = false; _engine->getScriptManager()->setStateValue(_key, _currentFrame); @@ -193,7 +190,7 @@ void LeverControl::onMouseUp(const Common::Point &screenSpacePos, const Common:: // TODO: Animation reversal back to origin } -bool LeverControl::onMouseMove(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos) { +bool LeverControl::onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) { bool cursorWasChanged = false; if (_mouseIsCaptured) { @@ -336,14 +333,4 @@ void LeverControl::renderFrame(uint frameNumber) { _engine->_system->copyRectToScreen(frameData, pitch, x + _engine->_workingWindow.left, y + _engine->_workingWindow.top, width, height); } -bool LeverControl::enable() { - // TODO: Implement - return true; -} - -bool LeverControl::disable() { - // TODO: Implement - return true; -} - } // End of namespace ZVision diff --git a/engines/zvision/lever_control.h b/engines/zvision/lever_control.h index dbfd172c45..42577a1776 100644 --- a/engines/zvision/lever_control.h +++ b/engines/zvision/lever_control.h @@ -26,10 +26,9 @@ #include "common/types.h" #include "common/list.h" +#include "common/rect.h" #include "zvision/control.h" -#include "zvision/mouse_event.h" -#include "zvision/action_node.h" namespace ZVision { @@ -37,7 +36,7 @@ namespace ZVision { class ZorkAVIDecoder; class RlfAnimation; -class LeverControl : public Control, public MouseEvent, public ActionNode { +class LeverControl : public Control { public: LeverControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream); ~LeverControl(); @@ -66,8 +65,6 @@ private: }; private: - ZVision *_engine; - union { RlfAnimation *rlf; ZorkAVIDecoder *avi; @@ -89,11 +86,9 @@ private: Common::List<uint>::iterator _returnRoutesCurrentProgress; public: - bool enable(); - bool disable(); - void onMouseDown(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos); - void onMouseUp(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos); - bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos); + void onMouseDown(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos); + void onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos); + bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos); bool process(uint32 deltaTimeInMillis); private: |