diff options
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/events.cpp | 43 | ||||
-rw-r--r-- | engines/zvision/zvision.h | 17 |
2 files changed, 3 insertions, 57 deletions
diff --git a/engines/zvision/events.cpp b/engines/zvision/events.cpp index 94e8f088dd..9283328202 100644 --- a/engines/zvision/events.cpp +++ b/engines/zvision/events.cpp @@ -32,38 +32,10 @@ #include "zvision/cursor_manager.h" #include "zvision/render_manager.h" #include "zvision/script_manager.h" -#include "zvision/mouse_event.h" #include "zvision/rlf_animation.h" namespace ZVision { -void ZVision::registerMouseEvent(MouseEvent *event) { - _mouseEvents.push_back(event); -} - -bool ZVision::removeMouseEvent(const uint32 key) { - for (Common::List<MouseEvent *>::iterator iter = _mouseEvents.begin(); iter != _mouseEvents.end(); iter++) { - if ((*iter)->_key == key) { - _scriptManager->setStateValue((*iter)->_key, 0); - _mouseEvents.erase(iter); - return true; - } - } - - return false; -} - -void ZVision::clearAllMouseEvents() { - // Clear the state values of all the events - // Then delete the nodes - for (Common::List<MouseEvent *>::iterator iter = _mouseEvents.begin(); iter != _mouseEvents.end(); iter++) { - _scriptManager->setStateValue((*iter)->_key, 0); - delete (*iter); - } - - _mouseEvents.clear(); -} - void ZVision::processEvents() { while (_eventMan->pollEvent(_event)) { switch (_event.type) { @@ -121,29 +93,20 @@ void ZVision::onMouseDown(const Common::Point &pos) { _cursorManager->cursorDown(true); Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); - - for (Common::List<MouseEvent *>::iterator iter = _mouseEvents.begin(); iter != _mouseEvents.end(); iter++) { - (*iter)->onMouseDown(pos, imageCoord); - } + _scriptManager->onMouseDown(pos, imageCoord); } void ZVision::onMouseUp(const Common::Point &pos) { _cursorManager->cursorDown(false); Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); - - for (Common::List<MouseEvent *>::iterator iter = _mouseEvents.begin(); iter != _mouseEvents.end(); iter++) { - (*iter)->onMouseUp(pos, imageCoord); - } + _scriptManager->onMouseUp(pos, imageCoord); } void ZVision::onMouseMove(const Common::Point &pos) { Common::Point imageCoord(_renderManager->screenSpaceToImageSpace(pos)); - bool cursorWasChanged = false; - for (Common::List<MouseEvent *>::iterator iter = _mouseEvents.begin(); iter != _mouseEvents.end(); iter++) { - cursorWasChanged = cursorWasChanged || (*iter)->onMouseMove(pos, imageCoord); - } + bool cursorWasChanged = _scriptManager->onMouseMove(pos, imageCoord); // Graph of the function governing rotation velocity: // diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h index 84e4da9d20..6bf6d2acc0 100644 --- a/engines/zvision/zvision.h +++ b/engines/zvision/zvision.h @@ -33,7 +33,6 @@ #include "zvision/detection.h" #include "zvision/clock.h" -#include "zvision/mouse_event.h" #include "gui/debugger.h" @@ -100,9 +99,6 @@ private: // Clock Clock _clock; - // To store the current mouse events - Common::List<MouseEvent *> _mouseEvents; - // To prevent allocation every time we process events Common::Event _event; @@ -132,19 +128,6 @@ public: void playAnimation(RlfAnimation *animation, uint16 x, uint16 y, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES); /** - * Register a MouseEvent with the event system. These will be checked at every - * MOUSE_UP, MOUSE_DOWN, MOUSE_MOVE, etc. - * - * @param event The event to register - */ - void registerMouseEvent(MouseEvent *event); - - bool removeMouseEvent(const uint32 key); - - /** Remove all MouseEvents from the event system */ - void clearAllMouseEvents(); - - /** * Utility method to cycle through all the cursors in the game. After * calling, use Left and Right arrows to cycle. Esc to quit. This is a * blocking function call. |