From 4e3a9b25ea249e6cd2efc9717dcfaaa5e58df4f7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 16 Nov 2016 19:21:25 -0500 Subject: TITANIC: Implement mouse scrolling for PET Remote --- engines/titanic/pet_control/pet_glyphs.h | 20 ++++++++++---------- engines/titanic/pet_control/pet_remote.cpp | 9 +++++++++ engines/titanic/pet_control/pet_remote.h | 1 + 3 files changed, 20 insertions(+), 10 deletions(-) (limited to 'engines') diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h index 79e032162c..ac008c5ab0 100644 --- a/engines/titanic/pet_control/pet_glyphs.h +++ b/engines/titanic/pet_control/pet_glyphs.h @@ -274,16 +274,6 @@ private: */ CPetGlyph *getGlyph(int index) const; - /** - * Scrolls the glyphs to the left - */ - void scrollLeft(); - - /** - * Scrolls the glyphs to the right - */ - void scrollRight(); - /** * Set the first visible glyph index */ @@ -455,6 +445,16 @@ public: */ void scrollToStart() { _firstVisibleIndex = 0; } + /** + * Scrolls the glyphs to the left + */ + void scrollLeft(); + + /** + * Scrolls the glyphs to the right + */ + void scrollRight(); + /** * Increment the currently selected index */ diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp index 46af55c4d3..f80403c573 100644 --- a/engines/titanic/pet_control/pet_remote.cpp +++ b/engines/titanic/pet_control/pet_remote.cpp @@ -161,6 +161,15 @@ bool CPetRemote::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return _items.VirtualKeyCharMsg(msg); } +bool CPetRemote::MouseWheelMsg(CMouseWheelMsg *msg) { + if (msg->_wheelUp) + _items.scrollLeft(); + else + _items.scrollRight(); + + return true; +} + bool CPetRemote::isValid(CPetControl *petControl) { return setupControl(petControl); } diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h index 22ea1e05ad..9cd9c1e9d7 100644 --- a/engines/titanic/pet_control/pet_remote.h +++ b/engines/titanic/pet_control/pet_remote.h @@ -112,6 +112,7 @@ public: virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg); virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg); virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg); + virtual bool MouseWheelMsg(CMouseWheelMsg *msg); /** * Returns true if the object is in a valid state -- cgit v1.2.3