DIRECTOR: add second movutils name, method

This is loaded as `MovieUtilities` in Momi no Ki no Shita de, which
also makes use of the getSystemPath method.

Other methods not implemented since they're not used on this disc.
This commit is contained in:
Misty De Meo 2023-06-11 11:38:19 -07:00
parent 7cb2e1ce5f
commit dbda3574cc
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C
2 changed files with 26 additions and 5 deletions

View File

@ -23,6 +23,7 @@
*
* USED IN:
* Gahan Wilson's Ultimate Haunted House
* Momi no Ki no Shita de: The Day of St. Claus
*
*************************************/
@ -99,14 +100,22 @@
namespace Director {
const char *MovUtilsXObj::xlibName = "movutils";
const char *MovUtilsXObj::xlibNames[] = {
"movutils",
"MovieUtilities",
nullptr
};
const char *MovUtilsXObj::fileNames[] = {
"MOVUTILS",
"MovieUtilities",
"MovieUtilities.XObj",
nullptr
};
static MethodProto xlibMethods[] = {
{ "new", MovUtilsXObj::m_new, 0, 0, 400 }, // D4
{ "new", MovUtilsXObj::m_new, 0, 0, 400 }, // D4
{ "getSystemPath", MovUtilsXObj::m_getsystempath, 0, 0, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
@ -114,14 +123,18 @@ void MovUtilsXObj::open(int type) {
if (type == kXObj) {
MovieUtilsXObject::initMethods(xlibMethods);
MovieUtilsXObject *xobj = new MovieUtilsXObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->exposeXObject(xlibNames[i], xobj);
}
}
}
void MovUtilsXObj::close(int type) {
if (type == kXObj) {
MovieUtilsXObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->_globalvars[xlibNames[i]] = Datum();
}
}
}
@ -134,4 +147,11 @@ void MovUtilsXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
void MovUtilsXObj::m_getsystempath(int nargs) {
g_lingo->dropStack(nargs);
// An empty string ensures this just maps to the root of
// ScummVM's save data path.
g_lingo->push(Datum(""));
}
} // End of namespace Director

View File

@ -32,7 +32,7 @@ public:
namespace MovUtilsXObj {
extern const char *xlibName;
extern const char *xlibNames[];
extern const char *fileNames[];
void open(int type);
@ -40,6 +40,7 @@ void close(int type);
void m_new(int nargs);
void m_clear(int nargs);
void m_getsystempath(int nargs);
} // End of namespace MovUtilsXObj