diff options
author | Paul Gilbert | 2018-11-06 19:43:16 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | c5234c9f727a23c435f03c0cbab85e0fd88e5a94 (patch) | |
tree | d1533c722f07032de87d3baed6b8db7694f7a59d /engines | |
parent | 135c3adc94fdb29241b8bf6b4828a68136ca4a40 (diff) | |
download | scummvm-rg350-c5234c9f727a23c435f03c0cbab85e0fd88e5a94.tar.gz scummvm-rg350-c5234c9f727a23c435f03c0cbab85e0fd88e5a94.tar.bz2 scummvm-rg350-c5234c9f727a23c435f03c0cbab85e0fd88e5a94.zip |
GLK: Fix display of mouse cursor
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gargoyle/events.cpp | 45 | ||||
-rw-r--r-- | engines/gargoyle/events.h | 8 |
2 files changed, 31 insertions, 22 deletions
diff --git a/engines/gargoyle/events.cpp b/engines/gargoyle/events.cpp index db5d8a68f8..4c5fb10361 100644 --- a/engines/gargoyle/events.cpp +++ b/engines/gargoyle/events.cpp @@ -34,22 +34,23 @@ const byte ARROW[] = { // byte 1: number of skipped pixels // byte 2: number of plotted pixels // then, pixels - 0, 2, 0xF7, 5, - 0, 3, 0xF7, 0xF7, 5, - 0, 3, 0xF7, 0xF7, 5, - 0, 4, 0xF7, 0xF7, 0xF7, 5, - 0, 4, 0xF7, 0xF7, 0xF7, 5, - 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, - 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, - 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, - 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, - 0, 7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, - 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, - 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, - 2, 3, 0xF7, 0xF7, 5, - 3, 3, 0xF7, 0xF7, 5, - 3, 3, 0xF7, 0xF7, 5, - 4, 2, 0xF7, 5 + 0, 1, 5, + 0, 2, 5, 5, + 0, 3, 5, 0xF7, 5, + 0, 3, 5, 0xF7, 5, + 0, 4, 5, 0xF7, 0xF7, 5, + 0, 4, 5, 0xF7, 0xF7, 5, + 0, 5, 5, 0xF7, 0xF7, 0xF7, 5, + 0, 5, 5, 0xF7, 0xF7, 0xF7, 5, + 0, 6, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 6, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 7, 5, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 6, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5, + 0, 5, 5, 0xF7, 0xF7, 0xF7, 5, + 2, 3, 5, 0xF7, 5, + 3, 3, 5, 0xF7, 5, + 3, 3, 5, 0xF7, 5, + 4, 2, 5, 5 }; Events::Events() : _forceClick(false), _currentEvent(nullptr), _timeouts(false), @@ -84,13 +85,15 @@ void Events::initializeCursors() { } // Setup selection cusor sized to the vertical line size - Surface &sel = _cursors[CURSOR_SELECTION]; + Surface &sel = _cursors[CURSOR_IBEAM]; sel.create(5, g_conf->_leading, g_system->getScreenFormat()); sel.fillRect(Common::Rect(0, 0, sel.w, sel.h), TRANSPARENT); sel.hLine(0, 0, 4, 0); sel.hLine(0, sel.h - 1, 4, 0); sel.vLine(2, 1, sel.h - 1, 0); sel._hotspot = Common::Point(2, sel.h - 1); + + // TODO: Hyperlink hand cursor } void Events::checkForNextFrameCounter() { @@ -169,9 +172,9 @@ void Events::dispatchEvent(Event &ev, bool polled) { void Events::pollEvents() { Common::Event event; - checkForNextFrameCounter(); do { + checkForNextFrameCounter(); g_system->getEventManager()->pollEvent(event); switch (event.type) { @@ -192,8 +195,7 @@ void Events::pollEvents() { return; case Common::EVENT_MOUSEMOVE: - if (_cursorId == CURSOR_NONE) - setCursor(CURSOR_ARROW); + handleMouseMove(event.mouse); break; default: @@ -267,6 +269,9 @@ void Events::handleScroll(bool wheelUp) { } void Events::handleMouseMove(const Point &pos) { + if (_cursorId == CURSOR_NONE) + setCursor(CURSOR_ARROW); + // hyperlinks and selection // TODO: Properly handle commented out lines if (g_vm->_copySelect) { diff --git a/engines/gargoyle/events.h b/engines/gargoyle/events.h index 5406e3ccb6..5da4e53a14 100644 --- a/engines/gargoyle/events.h +++ b/engines/gargoyle/events.h @@ -94,10 +94,14 @@ enum Keycode { keycode_MAXVAL = 28U }; +/** + * List of cursors + */ enum CursorId { CURSOR_NONE = 0, CURSOR_ARROW = 1, - CURSOR_SELECTION = 2 + CURSOR_IBEAM = 2, + CURSOR_HAND = 3 }; /** @@ -165,7 +169,7 @@ private: uint32 _frameCounter; ///< Frame counter bool _redraw; ///< Screen needed redrawing CursorId _cursorId; ///< Current cursor Id - Surface _cursors[3]; ///< Cursor pixel data + Surface _cursors[4]; ///< Cursor pixel data private: /** * Initialize the cursor graphics |