[Scummvm-git-logs] scummvm master -> 4bd85d5edabc8ef8c6b865fbe6358f6e6142fc6e

neuromancer noreply at scummvm.org
Sat Aug 12 13:39:47 UTC 2023


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:
4bd85d5eda FREESCAPE: added option to use inverted y mouse


Commit: 4bd85d5edabc8ef8c6b865fbe6358f6e6142fc6e
    https://github.com/scummvm/scummvm/commit/4bd85d5edabc8ef8c6b865fbe6358f6e6142fc6e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-08-12T15:41:31+02:00

Commit Message:
FREESCAPE: added option to use inverted y mouse

Changed paths:
    engines/freescape/detection.cpp
    engines/freescape/detection.h
    engines/freescape/freescape.cpp
    engines/freescape/freescape.h
    engines/freescape/metaengine.cpp


diff --git a/engines/freescape/detection.cpp b/engines/freescape/detection.cpp
index b6b404c9f3c..704e13e0c33 100644
--- a/engines/freescape/detection.cpp
+++ b/engines/freescape/detection.cpp
@@ -777,7 +777,7 @@ static const DebugChannelDef debugFlagList[] = {
 class FreescapeMetaEngineDetection : public AdvancedMetaEngineDetection {
 public:
 	FreescapeMetaEngineDetection() : AdvancedMetaEngineDetection(Freescape::gameDescriptions, sizeof(ADGameDescription), Freescape::freescapeGames) {
-		_guiOptions = GUIO6(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_EXTENDED_TIMER, GAMEOPTION_DISABLE_DEMO_MODE, GAMEOPTION_DISABLE_SENSORS, GAMEOPTION_DISABLE_FALLING);
+		_guiOptions = GUIO7(GUIO_NOMIDI, GAMEOPTION_PRERECORDED_SOUNDS, GAMEOPTION_EXTENDED_TIMER, GAMEOPTION_DISABLE_DEMO_MODE, GAMEOPTION_DISABLE_SENSORS, GAMEOPTION_DISABLE_FALLING, GAMEOPTION_INVERT_Y);
 	}
 
 	const char *getName() const override {
diff --git a/engines/freescape/detection.h b/engines/freescape/detection.h
index deb59771394..31c8ebf6117 100644
--- a/engines/freescape/detection.h
+++ b/engines/freescape/detection.h
@@ -24,13 +24,13 @@
 
 // Engine options
 #define GAMEOPTION_PRERECORDED_SOUNDS   GUIO_GAMEOPTIONS1
-#define GAMEOPTION_EXTENDED_TIMER   	GUIO_GAMEOPTIONS2
+#define GAMEOPTION_EXTENDED_TIMER       GUIO_GAMEOPTIONS2
 #define GAMEOPTION_DISABLE_DEMO_MODE    GUIO_GAMEOPTIONS3
-#define GAMEOPTION_DISABLE_SENSORS    	GUIO_GAMEOPTIONS4
-#define GAMEOPTION_DISABLE_FALLING    	GUIO_GAMEOPTIONS5
+#define GAMEOPTION_DISABLE_SENSORS      GUIO_GAMEOPTIONS4
+#define GAMEOPTION_DISABLE_FALLING      GUIO_GAMEOPTIONS5
+#define GAMEOPTION_INVERT_Y             GUIO_GAMEOPTIONS6
 
 // Driller options
-#define GAMEOPTION_AUTOMATIC_DRILLING   GUIO_GAMEOPTIONS6
-
+#define GAMEOPTION_AUTOMATIC_DRILLING   GUIO_GAMEOPTIONS7
 
 #endif
diff --git a/engines/freescape/freescape.cpp b/engines/freescape/freescape.cpp
index 6f8381d70b0..1e30bee8030 100644
--- a/engines/freescape/freescape.cpp
+++ b/engines/freescape/freescape.cpp
@@ -76,6 +76,9 @@ FreescapeEngine::FreescapeEngine(OSystem *syst, const ADGameDescription *gd)
 	if (!Common::parseBool(ConfMan.get("disable_falling"), _disableFalling))
 		error("Failed to parse bool from disable_falling option");
 
+	if (!Common::parseBool(ConfMan.get("invert_y"), _invertY))
+		error("Failed to parse bool from disable_falling option");
+
 	_startArea = 0;
 	_startEntrance = 0;
 	_currentArea = nullptr;
@@ -491,6 +494,9 @@ void FreescapeEngine::processInput() {
 				// so on-screen controls are still accesible
 				mousePos.x = g_system->getWidth() * ( _viewArea.left + _viewArea.width() / 2) / _screenW;
 				mousePos.y = g_system->getHeight() * (_viewArea.top + _viewArea.height() / 2) / _screenW;
+				if (_invertY)
+					event.relMouse.y = -event.relMouse.y;
+
 				g_system->warpMouse(mousePos.x, mousePos.y);
 				g_system->getEventManager()->purgeMouseEvents();
 			}
diff --git a/engines/freescape/freescape.h b/engines/freescape/freescape.h
index 7766619fcbb..041bdf0ef57 100644
--- a/engines/freescape/freescape.h
+++ b/engines/freescape/freescape.h
@@ -223,6 +223,7 @@ public:
 	bool _flyMode;
 	bool _shootMode;
 	bool _noClipMode;
+	bool _invertY;
 	static Common::Array<Common::Keymap *> initKeymaps(const char *target);
 	void processInput();
 	void resetInput();
diff --git a/engines/freescape/metaengine.cpp b/engines/freescape/metaengine.cpp
index 7b501f53dcb..efd7c4e74ef 100644
--- a/engines/freescape/metaengine.cpp
+++ b/engines/freescape/metaengine.cpp
@@ -95,6 +95,17 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 			0
 		}
 	},
+	{
+		GAMEOPTION_INVERT_Y,
+		{
+			_s("Invert Y-axis on mouse"),
+			_s("Use alternative camera controls"),
+			"invert_y",
+			false,
+			0,
+			0
+		}
+	},
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 




More information about the Scummvm-git-logs mailing list