[Scummvm-git-logs] scummvm master -> 8fad5b181fd206f5b4a38f6e5f09fe20b812e47f

bluegr noreply at scummvm.org
Sat Mar 15 21:21:20 UTC 2025


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:
8fad5b181f PRIVATE: Load cursor images from the game executable


Commit: 8fad5b181fd206f5b4a38f6e5f09fe20b812e47f
    https://github.com/scummvm/scummvm/commit/8fad5b181fd206f5b4a38f6e5f09fe20b812e47f
Author: ellm135 (ellm13531 at gmail.com)
Date: 2025-03-15T23:21:16+02:00

Commit Message:
PRIVATE: Load cursor images from the game executable

Support has been added for cursors from both the
Windows executable and Mac data files

Changed paths:
    engines/private/cursors.cpp
    engines/private/private.cpp
    engines/private/private.h


diff --git a/engines/private/cursors.cpp b/engines/private/cursors.cpp
index bc6b56fbf06..a956ce1f9de 100644
--- a/engines/private/cursors.cpp
+++ b/engines/private/cursors.cpp
@@ -22,315 +22,122 @@
 #include "common/rect.h"
 #include "graphics/cursorman.h"
 
-#include "private/private.h"
-
-namespace Private {
+#include "common/formats/winexe_ne.h"
+#include "common/formats/winexe_pe.h"
 
-static const byte MOUSECURSOR_SCI[] = {
-	1,1,0,0,0,0,0,0,0,0,0,
-	1,2,1,0,0,0,0,0,0,0,0,
-	1,2,2,1,0,0,0,0,0,0,0,
-	1,2,2,2,1,0,0,0,0,0,0,
-	1,2,2,2,2,1,0,0,0,0,0,
-	1,2,2,2,2,2,1,0,0,0,0,
-	1,2,2,2,2,2,2,1,0,0,0,
-	1,2,2,2,2,2,2,2,1,0,0,
-	1,2,2,2,2,2,2,2,2,1,0,
-	1,2,2,2,2,2,2,2,2,2,1,
-	1,2,2,2,2,2,1,0,0,0,0,
-	1,2,1,0,1,2,2,1,0,0,0,
-	1,1,0,0,1,2,2,1,0,0,0,
-	0,0,0,0,0,1,2,2,1,0,0,
-	0,0,0,0,0,1,2,2,1,0,0,
-	0,0,0,0,0,0,1,2,2,1,0
-};
+#include "common/macresman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White
-	0xff, 0x00, 0x00   // Red
-};
+namespace Private {
 
-struct CursorTable {
+struct CursorEntry {
 	const char *name;
-	const char *aname;
-	const void *buf;
-	int w;
-	int h;
-	int hotspotX;
-	int hotspotY;
+ 	const char *aname;
+	uint id;
 };
 
-static const CursorTable cursorTable[] = {
-	{ "kTurnLeft",  "k1", MOUSECURSOR_kTurnLeft,  32, 32, 29, 16 },
-	{ "kTurnRight", "k2", MOUSECURSOR_kTurnRight, 32, 32, 1,  15 },
-	{ "kZoomIn",    "k3", MOUSECURSOR_kZoomIn,    32, 32, 10, 8  },
-	{ "kZoomOut",   "k4", MOUSECURSOR_kZoomOut,   32, 32, 13, 31 },
-	{ "kExit",      "k5", MOUSECURSOR_kExit,      32, 32, 9,  0  },
-	{ "kPhone",     "k6", MOUSECURSOR_kPhone,     32, 32, 17, 19 },
-	{ "kInventory", "k7", MOUSECURSOR_kInventory, 32, 32, 15, 3  },
-	{ "default",    "", MOUSECURSOR_SCI,        11, 16, 0,  0  },
-	{ nullptr,      nullptr, nullptr,                0,  0,  0,  0  }
-};
+void PrivateEngine::loadCursors() {
+	if (_platform == Common::kPlatformWindows) {
+		const CursorEntry cursorIDReference[] = {
+			{ "kTurnLeft",  "k1", 23 },
+			{ "kTurnRight", "k2", 9  },
+			{ "kZoomIn",    "k3", 17 },
+			{ "kZoomOut",   "k4", 11 },
+			{ "kExit",      "k5", 7  },
+			{ "kPhone",     "k6", 25 },
+			{ "kInventory", "k7", 19 },
+			{ nullptr, nullptr,   0  }
+		};
+
+		if (_installerArchive.open("SUPPORT/PVTEYE.Z")) {
+			Common::SharedPtr<Common::WinResources> exe(Common::WinResources::createFromEXE(_installerArchive.createReadStreamForMember("PVTEYE.EXE")));
+			
+			if (exe == nullptr) {
+				error("Executable not found");
+			}
+	
+			const Common::Array<Common::WinResourceID> cursorIDs = exe->getIDList(Common::kWinGroupCursor);
+	
+			_cursors.resize(cursorIDs.size());
+			for (uint i = 0; i < cursorIDs.size(); i++) {
+				_cursors[i].winCursorGroup = Graphics::WinCursorGroup::createCursorGroup(exe.get(), cursorIDs[i]);
+				_cursors[i].cursor = _cursors[i].winCursorGroup->cursors[0].cursor;
+	
+				const CursorEntry *entry = cursorIDReference;
+				while (entry->name != nullptr) {
+					if (entry->id == _cursors[i].winCursorGroup->cursors[0].id.getID()) {
+						_cursors[i].name = entry->name;
+						_cursors[i].aname = entry->aname;
+						break;
+					}
+					entry++;
+				}
+			}
+		}
+	} else {
+		const CursorEntry cursorIDReference[] = {
+			{ "kTurnLeft",  "k1", 133 },
+			{ "kTurnRight", "k2", 132 },
+			{ "kZoomIn",    "k3", 138 },
+			{ "kZoomOut",   "k4", 135 },
+			{ "kExit",      "k5", 130 },
+			{ "kPhone",     "k6", 141 },
+			{ "kInventory", "k7", 139 },
+			{ nullptr, nullptr,   0   }
+		};
+
+		Common::MacResManager resMan;
+
+		Common::String path = isDemo() ? "SUPPORT/Private Eye Demo" : "SUPPORT/Private Eye";
+		if (resMan.open(path.c_str())) {
+			const Common::MacResIDArray cursorResIDs = resMan.getResIDArray(MKTAG('C', 'U', 'R', 'S'));
+			_cursors.resize(cursorResIDs.size());
+
+			for (uint i = 0; i < cursorResIDs.size(); i++) {
+				Common::SharedPtr<Common::SeekableReadStream> resData(resMan.getResource(MKTAG('C', 'U', 'R', 'S'), cursorResIDs[i]));
+				Graphics::MacCursor *cursor = new Graphics::MacCursor();
+				cursor->readFromStream(*resData);
+				_cursors[i].cursor = cursor;
+				_cursors[i].winCursorGroup = nullptr;
+
+				const CursorEntry *entry = cursorIDReference;
+				while (entry->name != nullptr) {
+					if (entry->id == cursorResIDs[i]) {
+						_cursors[i].name = entry->name;
+						_cursors[i].aname = entry->aname;
+						break;
+					}
+					entry++;
+				}
+			}
+		}
+	}
+}
 
 void PrivateEngine::changeCursor(const Common::String &cursor) {
-	const CursorTable *entry = cursorTable;
-	while (entry->name) {
-		if (cursor == entry->name || cursor == entry->aname)
-			break;
-		entry++;
-	}
-	if (!entry->name)
+	if (_currentCursor == cursor) {
 		return;
+	}
+
+	if (cursor == "default") {
+		CursorMan.replaceCursor(Graphics::makeDefaultWinCursor());
+	} else {
+		for (uint i = 0; i < _cursors.size(); i++) {
+			if (_cursors[i].name == cursor || _cursors[i].aname == cursor) {
+				CursorMan.replaceCursor(_cursors[i].cursor);
+				break;
+			}
+		}
+	}
+
+	_currentCursor = cursor;
 
-	CursorMan.replaceCursor(entry->buf, entry->w, entry->h, entry->hotspotX, entry->hotspotY, 0);
-	CursorMan.replaceCursorPalette(cursorPalette, 0, 3);
 	CursorMan.showMouse(true);
 }
 
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 053fec3746f..c7b5d75cc4d 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -125,6 +125,13 @@ PrivateEngine::~PrivateEngine() {
 
 	delete Gen::g_vm;
 	delete Settings::g_setts;
+
+	for (uint i = 0; i < _cursors.size(); i++) {
+		if (_cursors[i].winCursorGroup == nullptr) {
+			delete _cursors[i].cursor;
+		}
+		delete _cursors[i].winCursorGroup;
+	}
 }
 
 void PrivateEngine::initializePath(const Common::FSNode &gamePath) {
@@ -224,6 +231,7 @@ Common::Error PrivateEngine::run() {
 
 	_safeColor = _pixelFormat.RGBToColor(65, 65, 65);
 	_screenRect = Common::Rect(0, 0, _screenW, _screenH);
+	loadCursors();
 	changeCursor("default");
 	_origin = Common::Point(0, 0);
 	_image = new Image::BitmapDecoder();
diff --git a/engines/private/private.h b/engines/private/private.h
index b6230508d5e..874deeaa6db 100644
--- a/engines/private/private.h
+++ b/engines/private/private.h
@@ -27,6 +27,7 @@
 #include "common/serializer.h"
 #include "engines/engine.h"
 #include "graphics/managed_surface.h"
+#include "graphics/wincursor.h"
 #include "video/smk_decoder.h"
 
 #include "private/grammar.h"
@@ -104,6 +105,13 @@ typedef struct DossierInfo {
 	Common::String page2;
 } DossierInfo;
 
+typedef struct CursorInfo {
+	Common::String name;
+	Common::String aname;
+	Graphics::Cursor *cursor;
+	Graphics::WinCursorGroup *winCursorGroup;
+} CursorInfo;
+
 // funcs
 
 typedef struct FuncTable {
@@ -205,9 +213,12 @@ public:
 	void drawScreenFrame(const byte *videoPalette);
 
 	// Cursors
+	Common::Array<CursorInfo> _cursors;
+	Common::String _currentCursor;
 	void changeCursor(const Common::String &);
 	Common::String getInventoryCursor();
 	Common::String getExitCursor();
+	void loadCursors();
 
 	// Rendering
 	Graphics::ManagedSurface *_compositeSurface;




More information about the Scummvm-git-logs mailing list