[Scummvm-git-logs] scummvm master -> 38eb5514b735114ab65b3cd97e753e4d7c12dab1
sev-
sev at scummvm.org
Thu Oct 21 09:52:15 UTC 2021
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:
38eb5514b7 DIRECTOR: Implement Memory Xobj
Commit: 38eb5514b735114ab65b3cd97e753e4d7c12dab1
https://github.com/scummvm/scummvm/commit/38eb5514b735114ab65b3cd97e753e4d7c12dab1
Author: eientei (log.butt at gmail.com)
Date: 2021-10-21T11:52:12+02:00
Commit Message:
DIRECTOR: Implement Memory Xobj
Changed paths:
A engines/director/lingo/xlibs/memoryxobj.cpp
A engines/director/lingo/xlibs/memoryxobj.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 93c832bf74..c087935d8a 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -40,6 +40,7 @@
#include "director/lingo/xlibs/flushxobj.h"
#include "director/lingo/xlibs/fplayxobj.h"
#include "director/lingo/xlibs/labeldrvxobj.h"
+#include "director/lingo/xlibs/memoryxobj.h"
#include "director/lingo/xlibs/movemousexobj.h"
#include "director/lingo/xlibs/orthoplayxobj.h"
#include "director/lingo/xlibs/palxobj.h"
diff --git a/engines/director/lingo/xlibs/memoryxobj.cpp b/engines/director/lingo/xlibs/memoryxobj.cpp
new file mode 100644
index 0000000000..fd2db88600
--- /dev/null
+++ b/engines/director/lingo/xlibs/memoryxobj.cpp
@@ -0,0 +1,78 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/* Memory is a Mac only XObject.
+ *
+ * Implemented as a no-op, since ScummVM doesn't need to handle memory clears.
+ *
+ */
+
+#include "director/director.h"
+#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-object.h"
+#include "director/lingo/xlibs/memoryxobj.h"
+
+
+namespace Director {
+
+const char *MemoryXObj::xlibName = "Memory";
+const char *MemoryXObj::fileNames[] = {
+ "Memory XObj",
+ 0
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", MemoryXObj::m_new, 0, 0, 400 }, // D4
+ { "Clear", MemoryXObj::m_clear, 0, 0, 400 }, // D4
+ { 0, 0, 0, 0, 0 }
+};
+
+void MemoryXObj::open(int type) {
+ if (type == kXObj) {
+ MemoryXObject::initMethods(xlibMethods);
+ MemoryXObject *xobj = new MemoryXObject(kXObj);
+ g_lingo->_globalvars[xlibName] = xobj;
+ }
+}
+
+void MemoryXObj::close(int type) {
+ if (type == kXObj) {
+ MemoryXObject::cleanupMethods();
+ g_lingo->_globalvars[xlibName] = Datum();
+ }
+}
+
+
+MemoryXObject::MemoryXObject(ObjectType ObjectType) :Object<MemoryXObject>("MemoryXObj") {
+ _objType = ObjectType;
+}
+
+void MemoryXObj::m_new(int nargs) {
+ // Datum d1 = g_lingo->pop();
+ g_lingo->push(g_lingo->_currentMe);
+}
+
+void MemoryXObj::m_clear(int nargs) {
+ // g_lingo->pop();
+}
+
+} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/memoryxobj.h b/engines/director/lingo/xlibs/memoryxobj.h
new file mode 100644
index 0000000000..a959c998d7
--- /dev/null
+++ b/engines/director/lingo/xlibs/memoryxobj.h
@@ -0,0 +1,49 @@
+/* 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+
+#ifndef DIRECTOR_LINGO_XLIBS_MEMORYXOBJ_H
+#define DIRECTOR_LINGO_XLIBS_MEMORYXOBJ_H
+
+namespace Director {
+
+class MemoryXObject : public Object<MemoryXObject> {
+public:
+ MemoryXObject(ObjectType objType);
+};
+
+namespace MemoryXObj {
+
+extern const char *xlibName;
+extern const char *fileNames[];
+
+void open(int type);
+void close(int type);
+
+void m_new(int nargs);
+void m_clear(int nargs);
+
+} // End of namespace MemoryXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index e341b2a57a..34cf701b16 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -42,9 +42,10 @@ MODULE_OBJS = \
lingo/xlibs/flushxobj.o \
lingo/xlibs/fplayxobj.o \
lingo/xlibs/labeldrvxobj.o \
+ lingo/xlibs/memoryxobj.o \
lingo/xlibs/movemousexobj.o \
- lingo/xlibs/palxobj.o \
lingo/xlibs/orthoplayxobj.o \
+ lingo/xlibs/palxobj.o \
lingo/xlibs/popupmenuxobj.o \
lingo/xlibs/serialportxobj.o \
lingo/xlibs/soundjam.o \
More information about the Scummvm-git-logs
mailing list