From 437bcf3cfe4aabe99359d3b6db3cd8e13f3e8763 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 18 May 2015 18:43:29 -0400 Subject: SHERLOCK: Simplify Events not to need it's own copy of the mouse pos --- engines/sherlock/events.cpp | 10 +++++++--- engines/sherlock/events.h | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index 7f57625a3b..84794e6e6a 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -154,9 +154,6 @@ void Events::pollEvents() { case Common::EVENT_RBUTTONUP: _mouseButtons &= ~2; return; - case Common::EVENT_MOUSEMOVE: - _mousePos = event.mouse; - break; default: break; } @@ -194,6 +191,13 @@ bool Events::checkForNextFrameCounter() { return false; } +/** + * Get the current mouse position + */ +Common::Point Events::mousePos() const { + return g_system->getEventManager()->getMousePos(); +} + /** * Get a pending keypress */ diff --git a/engines/sherlock/events.h b/engines/sherlock/events.h index 199e14f03a..c6d155e472 100644 --- a/engines/sherlock/events.h +++ b/engines/sherlock/events.h @@ -42,7 +42,6 @@ private: SherlockEngine *_vm; uint32 _frameCounter; uint32 _priorFrameTime; - Common::Point _mousePos; ImageFile *_cursorImages; int _mouseButtons; @@ -79,7 +78,7 @@ public: void pollEventsAndWait(); - Common::Point mousePos() const { return _mousePos; } + Common::Point mousePos() const; uint32 getFrameCounter() const { return _frameCounter; } -- cgit v1.2.3