[Scummvm-git-logs] scummvm master -> 183d8319d30df9396e2970e92809b0f1bba7d57f

dreammaster paulfgilbert at gmail.com
Sun Jan 20 04:28:57 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
183d8319d3 GLK: FROTZ: Implement setting mouse cursor visibility


Commit: 183d8319d30df9396e2970e92809b0f1bba7d57f
    https://github.com/scummvm/scummvm/commit/183d8319d30df9396e2970e92809b0f1bba7d57f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-01-19T19:28:37-08:00

Commit Message:
GLK: FROTZ: Implement setting mouse cursor visibility

Changed paths:
    engines/glk/events.cpp
    engines/glk/events.h
    engines/glk/frotz/processor_screen.cpp


diff --git a/engines/glk/events.cpp b/engines/glk/events.cpp
index 4d6f19f..6589b51 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 d5d6f7c..37cd3c2 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 dcde4b0..211dc89 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) {





More information about the Scummvm-git-logs mailing list