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

lotharsm noreply at scummvm.org
Mon Oct 13 17:06:06 UTC 2025


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

Summary:
bf3a8f2c41 DIRECTOR: Implement Putcurs.dll XObject


Commit: bf3a8f2c41a26ef169e30b4587abc47346723f38
    https://github.com/scummvm/scummvm/commit/bf3a8f2c41a26ef169e30b4587abc47346723f38
Author: Lothar Serra Mari (mail at serra.me)
Date: 2025-10-13T19:05:52+02:00

Commit Message:
DIRECTOR: Implement Putcurs.dll XObject

Used in Masters of the Elements

Changed paths:
  A engines/director/lingo/xlibs/putcurs.cpp
  A engines/director/lingo/xlibs/putcurs.h
    engines/director/lingo/lingo-object.cpp
    engines/director/module.mk


diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 109b48f1d4f..ad2545a2b73 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -111,6 +111,7 @@
 #include "director/lingo/xlibs/prefpath.h"
 #include "director/lingo/xlibs/printomatic.h"
 #include "director/lingo/xlibs/processxobj.h"
+#include "director/lingo/xlibs/putcurs.h"
 #include "director/lingo/xlibs/qtmovie.h"
 #include "director/lingo/xlibs/qtcatmovieplayerxobj.h"
 #include "director/lingo/xlibs/qtvr.h"
@@ -315,6 +316,7 @@ static const struct XLibProto {
 	XLIBDEF(PrefPath,			kXObj,			400),	// D4
 	XLIBDEF(PrintOMaticXObj,	kXObj | kXtraObj,400),	// D4
 	XLIBDEF(ProcessXObj,		kXObj,			400),	// D4
+	XLIBDEF(PutcursXObj,		kXObj,			400),	// D4
 	XLIBDEF(QTCatMoviePlayerXObj,kXObj,			400),	// D4
 	XLIBDEF(QTMovie,			kXObj,			400),	// D4
 	XLIBDEF(QTVR,				kXObj,			400),	// D4
diff --git a/engines/director/lingo/xlibs/putcurs.cpp b/engines/director/lingo/xlibs/putcurs.cpp
new file mode 100644
index 00000000000..95420e0fe6a
--- /dev/null
+++ b/engines/director/lingo/xlibs/putcurs.cpp
@@ -0,0 +1,96 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/system.h"
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/lingo-utils.h"
+#include "director/lingo/xlibs/putcurs.h"
+
+/**************************************************
+ *
+ * USED IN:
+ * Die tolle Spiele-Box (Tivola)
+ * Masters of the Elements
+ *
+ **************************************************/
+
+/*
+--Put Cursor XObject. 31 ago 95. Mauricio Piacentini Tabuleiro da Baiana Multimedia
+--putCurs
+I      mNew                --Creates a new instance of the XObject
+X      mDispose            --Disposes of XObject instance
+III    mSet, Xpos, Ypos    --Set the cursor to a new position
+ */
+
+namespace Director {
+
+const char *PutcursXObj::xlibName = "Putcurs";
+const XlibFileDesc PutcursXObj::fileNames[] = {
+	{ "PUTCURS", nullptr },
+	{ nullptr,   nullptr },
+};
+
+static MethodProto xlibMethods[] = {
+	{ "new",		PutcursXObj::m_new,		0, 0,	400 },
+	{ "dispose",	PutcursXObj::m_dispose,	0, 0,	400 },
+	{ "set",		PutcursXObj::m_set,		2, 2,	400 },
+	{ nullptr, nullptr, 0, 0, 0 }
+};
+
+PutcursXObject::PutcursXObject(ObjectType ObjectType) :Object<PutcursXObject>("Putcurs") {
+	_objType = ObjectType;
+}
+
+void PutcursXObj::open(ObjectType type, const Common::Path &path) {
+	PutcursXObject::initMethods(xlibMethods);
+    PutcursXObject *xobj = new PutcursXObject(kXObj);
+    g_lingo->exposeXObject(xlibName, xobj);
+}
+
+void PutcursXObj::close(ObjectType type) {
+    PutcursXObject::cleanupMethods();
+    g_lingo->_globalvars[xlibName] = Datum();
+
+}
+
+void PutcursXObj::m_new(int nargs) {
+	g_lingo->printSTUBWithArglist("PutcursXObj::m_new", nargs);
+	g_lingo->dropStack(nargs);
+	g_lingo->push(g_lingo->_state->me);
+}
+
+void PutcursXObj::m_set(int nargs) {
+	if (nargs != 2) {
+		warning("PutcursXObj::m_set: expected 2 arguments, got %d", nargs);
+		g_lingo->dropStack(nargs);
+		return;
+	}
+	int x = g_lingo->pop().asInt();
+	int y = g_lingo->pop().asInt();
+	g_system->warpMouse(x, y);
+}
+
+XOBJSTUBNR(PutcursXObj::m_dispose)
+
+}
diff --git a/engines/director/lingo/xlibs/putcurs.h b/engines/director/lingo/xlibs/putcurs.h
new file mode 100644
index 00000000000..ba8ba6f0980
--- /dev/null
+++ b/engines/director/lingo/xlibs/putcurs.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef DIRECTOR_LINGO_XLIBS_PUTCURS_H
+#define DIRECTOR_LINGO_XLIBS_PUTCURS_H
+
+namespace Director {
+
+class PutcursXObject : public Object<PutcursXObject> {
+public:
+	PutcursXObject(ObjectType objType);
+};
+
+namespace PutcursXObj {
+
+extern const char *xlibName;
+extern const XlibFileDesc fileNames[];
+
+void open(ObjectType type, const Common::Path &path);
+void close(ObjectType type);
+
+void m_new(int nargs);
+void m_dispose(int nargs);
+void m_set(int nargs);
+
+} // End of namespace PutcursXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index 145e05b4829..45d46dbbdff 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -143,6 +143,7 @@ MODULE_OBJS = \
 	lingo/xlibs/prefpath.o \
 	lingo/xlibs/printomatic.o \
 	lingo/xlibs/processxobj.o \
+	lingo/xlibs/putcurs.o \
 	lingo/xlibs/qtcatmovieplayerxobj.o \
 	lingo/xlibs/qtmovie.o \
 	lingo/xlibs/qtvr.o \




More information about the Scummvm-git-logs mailing list