[Scummvm-git-logs] scummvm master -> e3eb3c8bf6d7dd5909de0b4410111277cb6ebc18
sev-
noreply at scummvm.org
Tue Jun 20 22:47:03 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:
e3eb3c8bf6 DIRECTOR: Implement EventQ xobject stubs
Commit: e3eb3c8bf6d7dd5909de0b4410111277cb6ebc18
https://github.com/scummvm/scummvm/commit/e3eb3c8bf6d7dd5909de0b4410111277cb6ebc18
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-06-21T00:47:00+02:00
Commit Message:
DIRECTOR: Implement EventQ xobject stubs
Implemented eventq xobject using stubs.
`undome` of 'mediaband-win' uses this xobj for events buffering.
Changed paths:
A engines/director/lingo/xlibs/eventq.cpp
A engines/director/lingo/xlibs/eventq.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 52184dc277d..cb14f3a63e9 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -47,6 +47,7 @@
#include "director/lingo/xlibs/dpwqtw.h"
#include "director/lingo/xlibs/draw.h"
#include "director/lingo/xlibs/ednox.h"
+#include "director/lingo/xlibs/eventq.h"
#include "director/lingo/xlibs/fedracul.h"
#include "director/lingo/xlibs/feimasks.h"
#include "director/lingo/xlibs/feiprefs.h"
@@ -174,6 +175,7 @@ static struct XLibProto {
{ DPwQTw::fileNames, DPwQTw::open, DPwQTw::close, kXObj, 400 }, // D4
{ DrawXObj::fileNames, DrawXObj::open, DrawXObj::close, kXObj, 400 }, // D4
{ Ednox::fileNames, Ednox::open, Ednox::close, kXObj, 300 }, // D3
+ { EventQXObj::fileNames, EventQXObj::open, EventQXObj::close, kXObj, 400 }, // D4
{ FEDraculXObj::fileNames, FEDraculXObj::open, FEDraculXObj::close, kXObj, 400 }, // D4
{ FEIMasksXObj::fileNames, FEIMasksXObj::open, FEIMasksXObj::close, kXObj, 400 }, // D4
{ FEIPrefsXObj::fileNames, FEIPrefsXObj::open, FEIPrefsXObj::close, kXObj, 400 }, // D4
diff --git a/engines/director/lingo/xlibs/eventq.cpp b/engines/director/lingo/xlibs/eventq.cpp
new file mode 100644
index 00000000000..25dc1fa9389
--- /dev/null
+++ b/engines/director/lingo/xlibs/eventq.cpp
@@ -0,0 +1,107 @@
+/* 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/>.
+ *
+ */
+
+/*************************************
+*
+* USED IN:
+* Meet Mediaband
+*
+*************************************/
+
+/*
+ * -- EventQ XObject. 7/12/94 greg yachuk
+ * I mNew --Creates a new instance of the XObject
+ * X mDispose --Disposes of XObject instance.
+ * X mBufferEvents --Begins buffering messages.
+ * X mFlushEvents --Ends buffering. Flushes all queued messages.
+ * X mPostEvents --Ends buffering. Posts all queued messages.
+ * I mBufferStatus --1 => Buffering in effect. 0 => No buffering.
+ * SSI mGetNextEvent --Gets the next event of a certain type.
+ * -- -- param1: mouseDown or keyDown.
+ * -- -- param2: 1 => remove found message.
+ * -- -- 0 => leave found message in queue.
+*/
+
+#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/eventq.h"
+
+
+namespace Director {
+
+const char *EventQXObj::xlibNames[] = {
+ "EventQ",
+ nullptr
+};
+
+const char *EventQXObj::fileNames[] = {
+ "EventQ",
+ nullptr
+};
+
+static MethodProto xlibMethods[] = {
+ { "new", EventQXObj::m_new, 0, 0, 400 }, // D4
+ { "Dispose", EventQXObj::m_dispose, 0, 0, 400 }, // D4
+ { "BufferEvents", EventQXObj::m_bufferEvents, 0, 0, 400 }, // D4
+ { "FlushEvents", EventQXObj::m_flushEvents, 0, 0, 400 }, // D4
+ { "PostEvents", EventQXObj::m_postEvents, 0, 0, 400 }, // D4
+ { "BufferStatus", EventQXObj::m_bufferStatus, 0, 0, 400 }, // D4
+ { "GetNextEvent", EventQXObj::m_getNextEvent, 2, 2, 400 }, // D4
+ { nullptr, nullptr, 0, 0, 0 }
+};
+
+void EventQXObj::open(int type) {
+ if (type == kXObj) {
+ EventQXObject::initMethods(xlibMethods);
+ EventQXObject *xobj = new EventQXObject(kXObj);
+ for (uint i = 0; xlibNames[i]; i++) {
+ g_lingo->exposeXObject(xlibNames[i], xobj);
+ }
+ }
+}
+
+void EventQXObj::close(int type) {
+ if (type == kXObj) {
+ EventQXObject::cleanupMethods();
+ for (uint i = 0; xlibNames[i]; i++) {
+ g_lingo->_globalvars[xlibNames[i]] = Datum();
+ }
+ }
+}
+
+EventQXObject::EventQXObject(ObjectType ObjectType) : Object<EventQXObject>("EventQ") {
+ _objType = ObjectType;
+}
+
+void EventQXObj::m_new(int nargs) {
+ g_lingo->push(g_lingo->_state->me);
+}
+
+XOBJSTUB(EventQXObj::m_dispose, 0)
+XOBJSTUB(EventQXObj::m_bufferEvents, 0)
+XOBJSTUB(EventQXObj::m_flushEvents, 0)
+XOBJSTUB(EventQXObj::m_postEvents, 0)
+XOBJSTUB(EventQXObj::m_bufferStatus, 0)
+XOBJSTUB(EventQXObj::m_getNextEvent, 0)
+
+} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/eventq.h b/engines/director/lingo/xlibs/eventq.h
new file mode 100644
index 00000000000..d9bf7886f64
--- /dev/null
+++ b/engines/director/lingo/xlibs/eventq.h
@@ -0,0 +1,51 @@
+/* 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_EVENTQ_H
+#define DIRECTOR_LINGO_XLIBS_EVENTQ_H
+
+namespace Director {
+class EventQXObject : public Object<EventQXObject> {
+public:
+ EventQXObject(ObjectType objType);
+};
+
+namespace EventQXObj {
+
+extern const char *xlibNames[];
+extern const char *fileNames[];
+
+void open(int type);
+void close(int type);
+
+void m_new(int nargs);
+void m_dispose(int nargs);
+void m_bufferEvents(int nargs);
+void m_flushEvents(int nargs);
+void m_postEvents(int nargs);
+void m_bufferStatus(int nargs);
+void m_getNextEvent(int nargs);
+
+} // End of namespace EventQXObj
+
+} // End of namespace Director
+
+#endif
diff --git a/engines/director/module.mk b/engines/director/module.mk
index 4bf6610e510..8d00d32c5f5 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -67,6 +67,7 @@ MODULE_OBJS = \
lingo/xlibs/dpwqtw.o \
lingo/xlibs/draw.o \
lingo/xlibs/ednox.o \
+ lingo/xlibs/eventq.o \
lingo/xlibs/fedracul.o \
lingo/xlibs/feimasks.o \
lingo/xlibs/feiprefs.o \
More information about the Scummvm-git-logs
mailing list