aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorrichiesams2013-08-23 23:58:14 -0500
committerrichiesams2013-08-24 00:11:46 -0500
commitadb3bd7b711ba9daf62e06bbe55d2ca55e5219b4 (patch)
treed5787d482d0c15e65b4dc399a1620120995a05b2 /engines/zvision
parentb28d502288fe96657fadbf9679f67601583036b3 (diff)
downloadscummvm-rg350-adb3bd7b711ba9daf62e06bbe55d2ca55e5219b4.tar.gz
scummvm-rg350-adb3bd7b711ba9daf62e06bbe55d2ca55e5219b4.tar.bz2
scummvm-rg350-adb3bd7b711ba9daf62e06bbe55d2ca55e5219b4.zip
ZVISION: Make MouseEvent purely virtual
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/module.mk1
-rw-r--r--engines/zvision/mouse_event.cpp45
-rw-r--r--engines/zvision/mouse_event.h36
3 files changed, 17 insertions, 65 deletions
diff --git a/engines/zvision/module.mk b/engines/zvision/module.mk
index 317e4b11d4..a4b7c68cde 100644
--- a/engines/zvision/module.mk
+++ b/engines/zvision/module.mk
@@ -12,7 +12,6 @@ MODULE_OBJS := \
detection.o \
events.o \
lzss_read_stream.o \
- mouse_event.o \
render_manager.o \
render_table.o \
rlf_animation.o \
diff --git a/engines/zvision/mouse_event.cpp b/engines/zvision/mouse_event.cpp
deleted file mode 100644
index a7c9fe5573..0000000000
--- a/engines/zvision/mouse_event.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* 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 "common/scummsys.h"
-
-#include "zvision/zvision.h"
-#include "zvision/script_manager.h"
-#include "zvision/mouse_event.h"
-
-namespace ZVision {
-
-MouseEvent::MouseEvent(uint32 key, const Common::Rect &hotspot, const Common::String hoverCursor)
- : _key(key),
- _hotspot(hotspot),
- _hoverCursor(hoverCursor) {
-}
-
-bool MouseEvent::withinHotspot(const Common::Point &point) {
- return _hotspot.contains(point);
-}
-
-void MouseEvent::onClick(ZVision *engine) {
- engine->getScriptManager()->setStateValue(_key, 1);
-}
-
-} // End of namespace ZVision
diff --git a/engines/zvision/mouse_event.h b/engines/zvision/mouse_event.h
index 90a093f894..fe81adaf19 100644
--- a/engines/zvision/mouse_event.h
+++ b/engines/zvision/mouse_event.h
@@ -35,37 +35,35 @@ class ZVision;
class MouseEvent {
public:
MouseEvent() : _key(0) {}
- MouseEvent(uint32 key, const Common::Rect &hotspot, const Common::String hoverCursor);
+ MouseEvent(uint32 key) : _key(key) {}
+ virtual ~MouseEvent() {}
- /** The Control key */
+public:
uint32 _key;
- /**
- * The area that will trigger the event
- * This is in image space coordinates, NOT screen space
- */
- Common::Rect _hotspot;
- /** The cursor to use when hovering over _hotspot */
- Common::String _hoverCursor;
+public:
/**
- * Does a simple Rect::contains() using _hotspot
+ * Called when LeftMouse is pushed.
*
- * @param point The point to check against _hotspot
- * @return The point is inside _hotspot (true) or not (false)
+ * @param screenSpacePos The position of the mouse in screen space
+ * @param backgroundImageSpacePos The position of the mouse in background image space
*/
- bool withinHotspot(const Common::Point &point);
+ virtual void onMouseDown(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos) = 0;
/**
- * Calls ScriptManager::setStateValue(_key, 1)
+ * Called when LeftMouse is lifted.
*
- * @param engine The base engine
+ * @param screenSpacePos The position of the mouse in screen space
+ * @param backgroundImageSpacePos The position of the mouse in background image space
*/
- void onClick(ZVision *engine);
+ virtual void onMouseUp(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos) = 0;
/**
- * Gets the name of the cursor that should be displayed when withinHotspot returns true
+ * Called on every MouseMove.
*
- * @return The name of the cursor. This should correspond to one of the names in CursorManager::_cursorNames[]
+ * @param screenSpacePos The position of the mouse in screen space
+ * @param backgroundImageSpacePos The position of the mouse in background image space
+ * @return Was the cursor changed?
*/
- const Common::String getHoverCursor() { return _hoverCursor; }
+ virtual bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point backgroundImageSpacePos) = 0;
};
} // End of namespace ZVision