aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2019-01-19 19:28:37 -0800
committerPaul Gilbert2019-01-19 19:28:37 -0800
commit183d8319d30df9396e2970e92809b0f1bba7d57f (patch)
tree8563527d1384c98e10c676fde6242a6febe361c7 /engines
parente66930179a65fc71e652551c67d5f8a456f58105 (diff)
downloadscummvm-rg350-183d8319d30df9396e2970e92809b0f1bba7d57f.tar.gz
scummvm-rg350-183d8319d30df9396e2970e92809b0f1bba7d57f.tar.bz2
scummvm-rg350-183d8319d30df9396e2970e92809b0f1bba7d57f.zip
GLK: FROTZ: Implement setting mouse cursor visibility
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/events.cpp4
-rw-r--r--engines/glk/events.h7
-rw-r--r--engines/glk/frotz/processor_screen.cpp8
3 files changed, 18 insertions, 1 deletions
diff --git a/engines/glk/events.cpp b/engines/glk/events.cpp
index 4d6f19f510..6589b512f8 100644
--- a/engines/glk/events.cpp
+++ b/engines/glk/events.cpp
@@ -393,6 +393,10 @@ void Events::setCursor(CursorId cursorId) {
}
}
+void Events::showMouseCursor(bool visible) {
+ CursorMan.showMouse(visible);
+}
+
void Events::setTimerInterval(uint milli) {
_timerMilli = milli;
_timerTimeExpiry = g_system->getMillis() + milli;
diff --git a/engines/glk/events.h b/engines/glk/events.h
index d5d6f7c4d4..37cd3c24dd 100644
--- a/engines/glk/events.h
+++ b/engines/glk/events.h
@@ -275,6 +275,13 @@ public:
void setCursor(CursorId cursorId);
/**
+ * Sets whether the mouse cursor is visible
+ * @remarks Normally the cursor is visible for all games, even for those that didn't have mouse originally,
+ * so as to allow for common Glk functionality for selecting ranges of text
+ */
+ void showMouseCursor(bool visible);
+
+ /**
* Set a timer interval
* @param milli Time in millieseconds for intervals, or 0 for off
*/
diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp
index dcde4b0219..211dc896a5 100644
--- a/engines/glk/frotz/processor_screen.cpp
+++ b/engines/glk/frotz/processor_screen.cpp
@@ -21,6 +21,8 @@
*/
#include "glk/frotz/processor.h"
+#include "glk/frotz/frotz.h"
+#include "glk/events.h"
namespace Glk {
namespace Frotz {
@@ -385,7 +387,11 @@ void Processor::z_set_cursor() {
if (y < 0) {
// Cursor on/off
- error("TODO: Turning cursor on/off");
+ if (y == -2)
+ g_vm->_events->showMouseCursor(true);
+ else if (y == -1)
+ g_vm->_events->showMouseCursor(false);
+ return;
}
if (!x || !y) {