[Scummvm-git-logs] scummvm master -> c717cdce8849058bd71edf2af0b602c0daeb1521

bluegr noreply at scummvm.org
Sat Sep 13 14:42:49 UTC 2025


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

Summary:
0f4ed50089 GRAPHICS: Allow passing dontScale flag to CursorManager::replaceCursor
c717cdce88 MADE: Allow using Win16 cursors for Rodney's Funscreen


Commit: 0f4ed50089eb2f283bf32c5d26b2d40b291f5962
    https://github.com/scummvm/scummvm/commit/0f4ed50089eb2f283bf32c5d26b2d40b291f5962
Author: Greg Kennedy (kennedy.greg at gmail.com)
Date: 2025-09-13T17:42:45+03:00

Commit Message:
GRAPHICS: Allow passing dontScale flag to CursorManager::replaceCursor

Changed paths:
    graphics/cursorman.cpp
    graphics/cursorman.h


diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 04c8f518d78..67e9324568e 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -206,9 +206,9 @@ void CursorManager::replaceCursor(const Surface &surf, int hotspotX, int hotspot
 	g_system->setMouseCursor(cur->_surf.getPixels(), surf.w, surf.h, hotspotX, hotspotY, keycolor, dontScale, &cur->_surf.format, mask);
 }
 
-void CursorManager::replaceCursor(const Graphics::Cursor *cursor) {
+void CursorManager::replaceCursor(const Graphics::Cursor *cursor, bool dontScale) {
 	replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(),
-				  cursor->getHotspotY(), cursor->getKeyColor(), false, nullptr, cursor->getMask());
+				  cursor->getHotspotY(), cursor->getKeyColor(), dontScale, nullptr, cursor->getMask());
 
 	if (cursor->getPalette())
 		replaceCursorPalette(cursor->getPalette(), cursor->getPaletteStartIndex(), cursor->getPaletteCount());
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 3208a41b98c..968f3e165fa 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -166,8 +166,10 @@ public:
 	 * more optimized way of popping the old cursor before pushing the new one.
 	 *
 	 * @param cursor	New cursor.
+	 * @param dontScale	Whether the cursor should never be scaled. An exception are high PPI displays, where the cursor
+	 *                  would be too small to notice otherwise. These are allowed to scale the cursor anyway.
 	 */
-	void replaceCursor(const Graphics::Cursor *cursor);
+	void replaceCursor(const Graphics::Cursor *cursor, bool dontScale = false);
 
 	/**
 	 * Pop all cursors and cursor palettes from their respective stacks.


Commit: c717cdce8849058bd71edf2af0b602c0daeb1521
    https://github.com/scummvm/scummvm/commit/c717cdce8849058bd71edf2af0b602c0daeb1521
Author: Greg Kennedy (kennedy.greg at gmail.com)
Date: 2025-09-13T17:42:45+03:00

Commit Message:
MADE: Allow using Win16 cursors for Rodney's Funscreen

Changed paths:
    engines/made/detection.h
    engines/made/detection_tables.h
    engines/made/made.cpp
    engines/made/made.h
    engines/made/metaengine.cpp
    engines/made/screen.cpp
    engines/made/screen.h
    engines/made/scriptfuncs.cpp


diff --git a/engines/made/detection.h b/engines/made/detection.h
index 22b6380dc5e..43287316816 100644
--- a/engines/made/detection.h
+++ b/engines/made/detection.h
@@ -53,6 +53,7 @@ struct MadeGameDescription {
 
 #define GAMEOPTION_INTRO_MUSIC_DIGITAL GUIO_GAMEOPTIONS1
 #define GAMEOPTION_TTS                 GUIO_GAMEOPTIONS2
+#define GAMEOPTION_WINDOWS_CURSORS     GUIO_GAMEOPTIONS3
 
 } // End of namespace Made
 
diff --git a/engines/made/detection_tables.h b/engines/made/detection_tables.h
index 88227d340a3..daf9c3e5c78 100644
--- a/engines/made/detection_tables.h
+++ b/engines/made/detection_tables.h
@@ -22,7 +22,8 @@
 #ifndef MADE_DETECTION_TABLES_H
 #define MADE_DETECTION_TABLES_H
 
-#include "engines/advancedDetector.h"
+#include "made/detection.h"
+
 #include "common/translation.h"
 
 namespace Made {
@@ -615,14 +616,15 @@ static const MadeGameDescription gameDescriptions[] = {
 
 	{
 		// Rodney's Funscreen
+		// MS-DOS, Win16 and Tandy VIS all share the same resource but a different player.
 		{
 			"rodney",
 			"",
-			AD_ENTRY1("rodneys.dat", "a79887dbaa47689facd7c6f09258ba5a"),
+			AD_ENTRY1s("rodneys.dat", "a79887dbaa47689facd7c6f09258ba5a", 92990),
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO1(GUIO_NOSPEECH)
+			GUIO2(GUIO_NOSPEECH, GAMEOPTION_WINDOWS_CURSORS)
 		},
 		GID_RODNEY,
 		0,
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index 9702ec42760..1cc74098b01 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -30,11 +30,14 @@
 
 #include "common/config-manager.h"
 #include "common/events.h"
+#include "common/formats/winexe_ne.h"
 #include "common/system.h"
 #include "common/error.h"
 
 #include "engines/util.h"
 
+#include "graphics/wincursor.h"
+
 #include "backends/audiocd/audiocd.h"
 
 namespace Made {
@@ -44,6 +47,9 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
 	_eventNum = 0;
 	_eventMouseX = _eventMouseY = 0;
 	_eventKey = 0;
+
+	_useWinCursors = false;
+
 	_autoStopSound = false;
 	_soundEnergyIndex = 0;
 	_soundEnergyArray = nullptr;
@@ -439,6 +445,26 @@ Common::Error MadeEngine::run() {
 	} else if (getGameID() == GID_RODNEY) {
 		_dat->open("rodneys.dat");
 		_res->open("rodneys.prj");
+
+		if (ConfMan.hasKey("windows_cursors") && ConfMan.getBool("windows_cursors")) {
+			// Try to open the EXE and get the hand cursor out
+			Common::WinResources *exe = Common::WinResources::createFromEXE("rodneysw.exe"); // Win16 executable
+			if (!exe)
+				exe = Common::WinResources::createFromEXE("rodneysv.exe"); // Tandy VIS executable
+
+			if (exe) {
+				Graphics::WinCursorGroup *_winCursor = Graphics::WinCursorGroup::createCursorGroup(exe, Common::WinResourceID("HANDCURSOR"));
+				if (_winCursor) {
+					if (_winCursor->cursors.size() > 0) {
+						_screen->setMouseCursor(_winCursor->cursors[0].cursor);
+						_useWinCursors = true;
+					}
+					delete _winCursor;
+				}
+
+				delete exe;
+			}
+		}
 	} else {
 		error ("Unknown MADE game");
 	}
@@ -456,7 +482,9 @@ Common::Error MadeEngine::run() {
 #ifdef DUMP_SCRIPTS
 	_script->dumpAllScripts();
 #else
-	_screen->setDefaultMouseCursor();
+	if (! _useWinCursors)
+		_screen->setDefaultMouseCursor();
+
 	_script->runScript(_dat->getMainCodeObjectIndex());
 #endif
 
diff --git a/engines/made/made.h b/engines/made/made.h
index 19e9dfd31e1..a266cb09aeb 100644
--- a/engines/made/made.h
+++ b/engines/made/made.h
@@ -95,6 +95,8 @@ public:
 	ScriptInterpreter *_script;
 	MusicPlayer *_music;
 
+	bool _useWinCursors;
+
 	uint16 _eventNum;
 	int _eventMouseX, _eventMouseY;
 	uint16 _eventKey;
diff --git a/engines/made/metaengine.cpp b/engines/made/metaengine.cpp
index 2cc36cffe7c..9931171dd7b 100644
--- a/engines/made/metaengine.cpp
+++ b/engines/made/metaengine.cpp
@@ -57,6 +57,17 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 		}
 	},
 #endif
+	{
+		GAMEOPTION_WINDOWS_CURSORS,
+		{
+			_s("Use Windows mouse cursors"),
+			_s("If selected, the game will use Windows mouse cursors bundled in the original .exe file. Otherwise, it will use lower resolution cursors from the data files."),
+			"windows_cursors",
+			true,
+			0,
+			0
+		}
+	},
 
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index bf18959a09d..ab2ff5d42d0 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -979,6 +979,10 @@ void Screen::clearSpriteList() {
 	_spriteList.clear();
 }
 
+void Screen::setMouseCursor(const Graphics::Cursor *cursor) {
+	CursorMan.replaceCursor(cursor, true);
+}
+
 void Screen::setDefaultMouseCursor() {
 	CursorMan.replaceCursor(defaultMouseCursor, 16, 16, 9, 2, 0);
 }
diff --git a/engines/made/screen.h b/engines/made/screen.h
index 62c9c58dfe1..3303fcce90a 100644
--- a/engines/made/screen.h
+++ b/engines/made/screen.h
@@ -26,6 +26,8 @@
 
 #include "common/rect.h"
 
+#include "graphics/cursor.h"
+
 namespace Made {
 
 struct SpriteChannel {
@@ -189,6 +191,7 @@ public:
 	SpriteListItem getFromSpriteList(int16 index);
 	void clearSpriteList();
 
+	void setMouseCursor(const Graphics::Cursor *cursor);
 	void setDefaultMouseCursor();
 
 protected:
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index 572e21772bb..d8751387658 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -32,6 +32,7 @@
 
 #include "common/config-manager.h"
 
+#include "graphics/wincursor.h"
 #include "graphics/cursorman.h"
 #include "graphics/surface.h"
 
@@ -632,11 +633,16 @@ int16 ScriptFunctions::sfSetFontOutline(int16 argc, int16 *argv) {
 }
 
 int16 ScriptFunctions::sfLoadMouseCursor(int16 argc, int16 *argv) {
-	PictureResource *flex = _vm->_res->getPicture(argv[2]);
-	if (flex) {
-		Graphics::Surface *surf = flex->getPicture();
-		CursorMan.replaceCursor(*surf, argv[1], argv[0], 0);
-		_vm->_res->freeResource(flex);
+
+	if (_vm->_useWinCursors) {
+		debug(4, "sfLoadMouseCursor: Not replacing mouse cursor, hand already active");
+	} else {
+		PictureResource *flex = _vm->_res->getPicture(argv[2]);
+		if (flex) {
+			Graphics::Surface *surf = flex->getPicture();
+			CursorMan.replaceCursor(*surf, argv[1], argv[0], 0);
+			_vm->_res->freeResource(flex);
+		}
 	}
 	return 0;
 }




More information about the Scummvm-git-logs mailing list