[Scummvm-git-logs] scummvm master -> 4a5283f2ff3c186d986f6cc006b8c9e97a013c22
rvanlaar
noreply at scummvm.org
Fri Mar 25 19:02:39 UTC 2022
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0799ed3b1e DIRECTOR: LINGO: Stub XCMD RegisterCommand
37c12fab97 DIRECTOR: LINGO: Memoryxobj update
f5d68a3035 DIRECTOR: LINGO: register FlushXObj multiple times
4a5283f2ff DIRECTOR: read more from projector rsrc fork
Commit: 0799ed3b1e0f30c71975c4a492fa6571d7f7bc60
https://github.com/scummvm/scummvm/commit/0799ed3b1e0f30c71975c4a492fa6571d7f7bc60
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-03-25T19:24:33+01:00
Commit Message:
DIRECTOR: LINGO: Stub XCMD RegisterCommand
RegisterCommand is an XCMD used in Star Trek: The Next Generation
Interactive Technical Manual. It's unclear what it's purpose is.
Changed paths:
A engines/director/lingo/xlibs/registercomponent.cpp
A engines/director/lingo/xlibs/registercomponent.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 36fa46ffc8b..1faf2eab999 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -44,6 +44,7 @@
#include "director/lingo/xlibs/orthoplayxobj.h"
#include "director/lingo/xlibs/palxobj.h"
#include "director/lingo/xlibs/popupmenuxobj.h"
+#include "director/lingo/xlibs/registercomponent.h"
#include "director/lingo/xlibs/serialportxobj.h"
#include "director/lingo/xlibs/soundjam.h"
#include "director/lingo/xlibs/videodiscxobj.h"
@@ -129,6 +130,7 @@ static struct XLibProto {
{ PopUpMenuXObj::fileNames, PopUpMenuXObj::open, PopUpMenuXObj::close, kXObj, 200 }, // D2
{ SerialPortXObj::fileNames, SerialPortXObj::open, SerialPortXObj::close, kXObj, 200 }, // D2
{ SoundJam::fileNames, SoundJam::open, SoundJam::close, kXObj, 400 }, // D4
+ { RegisterComponent::fileNames, RegisterComponent::open,RegisterComponent::close, kXObj, 400 }, // D4
{ VideodiscXObj::fileNames, VideodiscXObj::open, VideodiscXObj::close, kXObj, 200 }, // D2
{ RearWindowXObj::fileNames, RearWindowXObj::open, RearWindowXObj::close, kXObj, 400 }, // D4
{ MoveMouseXObj::fileNames, MoveMouseXObj::open, MoveMouseXObj::close, kXObj, 400 }, // D4
diff --git a/engines/director/lingo/xlibs/registercomponent.cpp b/engines/director/lingo/xlibs/registercomponent.cpp
new file mode 100644
index 00000000000..e63395441a3
--- /dev/null
+++ b/engines/director/lingo/xlibs/registercomponent.cpp
@@ -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/>.
+ *
+ */
+
+#include "director/lingo/lingo.h"
+#include "director/lingo/xlibs/registercomponent.h"
+
+namespace Director {
+
+const char *RegisterComponent::xlibName = "RegisterComponent";
+const char *RegisterComponent::fileNames[] = {
+ "RegisterComponent",
+ nullptr
+};
+
+static BuiltinProto builtins[] = {
+ { "RegisterComponent", RegisterComponent::b_RegisterComponent, 1, 2, 400, FBLTIN },
+ { nullptr, nullptr, 0, 0, 0, VOIDSYM }
+};
+
+void RegisterComponent::open(int type) {
+ g_lingo->initBuiltIns(builtins);
+}
+
+void RegisterComponent::close(int type) {
+ g_lingo->cleanupBuiltIns(builtins);
+}
+
+void RegisterComponent::b_RegisterComponent(int nargs) {
+ g_lingo->dropStack(nargs);
+ g_lingo->push(Datum(0));
+}
+
+} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/registercomponent.h b/engines/director/lingo/xlibs/registercomponent.h
new file mode 100644
index 00000000000..865f77c9904
--- /dev/null
+++ b/engines/director/lingo/xlibs/registercomponent.h
@@ -0,0 +1,53 @@
+/* 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/>.
+ *
+ */
+
+/*************************************
+ *
+ * XCMD: RegisterComponent
+ *
+ * USED IN:
+ * trektech: Star Trek: The Next Generation Interactive Technical Manual
+ *
+ * Note: It's not clear what its purpose is.
+ *
+ * Example usage: set errMsg to RegisterComponent(the pathName & "QTVR", ":")
+ *************************************/
+
+#ifndef DIRECTOR_LINGO_XLIBS_REGISTERCOMMANDXCMD_H
+#define DIRECTOR_LINGO_XLIBS_REGISTERCOMMANDXCMD_H
+
+namespace Director {
+
+namespace RegisterComponent {
+
+extern const char *xlibName;
+extern const char *fileNames[];
+
+void open(int type);
+void close(int type);
+
+void b_RegisterComponent(int nargs);
+
+} // End of namespace RegisterComponent
+
+} // End of namespace Director
+
+#endif
\ No newline at end of file
diff --git a/engines/director/module.mk b/engines/director/module.mk
index c3bd4c28600..8acbc926629 100644
--- a/engines/director/module.mk
+++ b/engines/director/module.mk
@@ -48,6 +48,7 @@ MODULE_OBJS = \
lingo/xlibs/orthoplayxobj.o \
lingo/xlibs/palxobj.o \
lingo/xlibs/popupmenuxobj.o \
+ lingo/xlibs/registercomponent.o \
lingo/xlibs/serialportxobj.o \
lingo/xlibs/soundjam.o \
lingo/xlibs/videodiscxobj.o \
Commit: 37c12fab9780cb0e3920870ba1eb9e6220267c8a
https://github.com/scummvm/scummvm/commit/37c12fab9780cb0e3920870ba1eb9e6220267c8a
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-03-25T19:28:20+01:00
Commit Message:
DIRECTOR: LINGO: Memoryxobj update
The name reflects the name of the object inside the rsrc file.
It's now also registered as an XOBJ.
Changed paths:
engines/director/lingo/lingo-object.cpp
engines/director/lingo/xlibs/memoryxobj.cpp
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 1faf2eab999..2338ab0d4e2 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -127,6 +127,7 @@ static struct XLibProto {
{ LabelDrvXObj::fileNames, LabelDrvXObj::open, LabelDrvXObj::close, kXObj, 400 }, // D4
{ OrthoPlayXObj::fileNames, OrthoPlayXObj::open, OrthoPlayXObj::close, kXObj, 400 }, // D4
{ PalXObj::fileNames, PalXObj::open, PalXObj::close, kXObj, 400 }, // D4
+ { MemoryXObj::fileNames, MemoryXObj::open, MemoryXObj::close, kXObj, 400 }, // D4
{ PopUpMenuXObj::fileNames, PopUpMenuXObj::open, PopUpMenuXObj::close, kXObj, 200 }, // D2
{ SerialPortXObj::fileNames, SerialPortXObj::open, SerialPortXObj::close, kXObj, 200 }, // D2
{ SoundJam::fileNames, SoundJam::open, SoundJam::close, kXObj, 400 }, // D4
diff --git a/engines/director/lingo/xlibs/memoryxobj.cpp b/engines/director/lingo/xlibs/memoryxobj.cpp
index 67e3507c651..42e5f57c136 100644
--- a/engines/director/lingo/xlibs/memoryxobj.cpp
+++ b/engines/director/lingo/xlibs/memoryxobj.cpp
@@ -35,7 +35,7 @@ namespace Director {
const char *MemoryXObj::xlibName = "Memory";
const char *MemoryXObj::fileNames[] = {
- "Memory XObj",
+ "Memory",
nullptr
};
Commit: f5d68a30356477dc98c841ef81fbaae7f7821b79
https://github.com/scummvm/scummvm/commit/f5d68a30356477dc98c841ef81fbaae7f7821b79
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-03-25T19:30:22+01:00
Commit Message:
DIRECTOR: LINGO: register FlushXObj multiple times
FlushXObj has the same interface as Johnny.
When opened, it's now registered under both names.
This is done to prevent duplicating the Xobject implementation.
Changed paths:
engines/director/lingo/xlibs/flushxobj.cpp
engines/director/lingo/xlibs/flushxobj.h
diff --git a/engines/director/lingo/xlibs/flushxobj.cpp b/engines/director/lingo/xlibs/flushxobj.cpp
index 44030679adb..e9498a4160e 100644
--- a/engines/director/lingo/xlibs/flushxobj.cpp
+++ b/engines/director/lingo/xlibs/flushxobj.cpp
@@ -41,9 +41,14 @@
namespace Director {
-const char *FlushXObj::xlibName = "FlushXObj";
+const char *FlushXObj::xlibNames[] = {
+ "FlushXObj",
+ "Johnny",
+ nullptr,
+};
const char *FlushXObj::fileNames[] = {
"FlushXObj",
+ "Johnny",
nullptr
};
@@ -60,14 +65,18 @@ void FlushXObj::open(int type) {
if (type == kXObj) {
FlushXObject::initMethods(xlibMethods);
FlushXObject *xobj = new FlushXObject(kXObj);
- g_lingo->_globalvars[xlibName] = xobj;
+ for (uint i = 0; xlibNames[i]; i++) {
+ g_lingo->_globalvars[xlibNames[i]] = xobj;
+ }
}
}
void FlushXObj::close(int type) {
if (type == kXObj) {
FlushXObject::cleanupMethods();
- g_lingo->_globalvars[xlibName] = Datum();
+ for (uint i = 0; xlibNames[i]; i++) {
+ g_lingo->_globalvars[xlibNames[i]] = Datum();
+ }
}
}
diff --git a/engines/director/lingo/xlibs/flushxobj.h b/engines/director/lingo/xlibs/flushxobj.h
index 3841e64d09f..6c75a16d047 100644
--- a/engines/director/lingo/xlibs/flushxobj.h
+++ b/engines/director/lingo/xlibs/flushxobj.h
@@ -31,7 +31,7 @@ public:
namespace FlushXObj {
-extern const char *xlibName;
+extern const char *xlibNames[];
extern const char *fileNames[];
void open(int type);
Commit: 4a5283f2ff3c186d986f6cc006b8c9e97a013c22
https://github.com/scummvm/scummvm/commit/4a5283f2ff3c186d986f6cc006b8c9e97a013c22
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-03-25T20:01:51+01:00
Commit Message:
DIRECTOR: read more from projector rsrc fork
The projector file on mac contains resources. They are loaded
automatically.
This commit implements:
- registering the resource file to enable handling by the Cursor class
- probe XCMDs for loading
The delete archive statement is removed. The archive needs to stay
available to be read when requested by the Cursor class.
openResFile is destroyed by ~Director.
Changed paths:
engines/director/resource.cpp
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 1bfe41cb712..48044aef0e6 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -117,12 +117,9 @@ void Window::probeProjector(const Common::String &movie) {
}
probeMacBinary(archive);
- delete archive;
}
void Window::probeMacBinary(MacArchive *archive) {
- // Let's check if it is a projector file
- // So far tested with Spaceship Warlock, D2
if (archive->hasResource(MKTAG('B', 'N', 'D', 'L'), "Projector")) {
warning("Detected Projector file");
@@ -178,6 +175,16 @@ void Window::probeMacBinary(MacArchive *archive) {
g_lingo->openXLib(res.name, kXObj);
}
}
+ if (archive->hasResource(MKTAG('X', 'C', 'M', 'D'), -1)) {
+ Common::Array<uint16> xcmd = archive->getResourceIDList(MKTAG('X', 'C', 'M', 'D'));
+ for (Common::Array<uint16>::iterator iterator = xcmd.begin(); iterator != xcmd.end(); ++iterator) {
+ Resource res = archive->getResourceDetail(MKTAG('X', 'C', 'M', 'D'), *iterator);
+ debug(0, "Detected XCMD '%s'", res.name.c_str());
+ g_lingo->openXLib(res.name, kXObj);
+ }
+ }
+ // Register the resfile so that Cursor::readFromResource can find it
+ g_director->_openResFiles.setVal(archive->getPathName(), archive);
}
Archive *Window::openMainArchive(const Common::String movie) {
More information about the Scummvm-git-logs
mailing list