[Scummvm-git-logs] scummvm master -> fc21f2b7beac974922bc0aed510eef58f2e8d657
djsrv
dservilla at gmail.com
Wed Aug 4 23:35:42 UTC 2021
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d45f4ade4c DIRECTOR: LINGO: Remove .xlib from xlib name
88c0d444f3 DIRECTOR: LINGO: Clean up call stack when stopping movie
ac231f8ad8 DIRECTOR: LINGO: Implement basic SoundJam XObject
1e7e9707a8 DIRECTOR: Load XCOD from non-projector MacBinaries
fc21f2b7be DIRECTOR: LINGO: Allow xlibs to have multiple filenames
Commit: d45f4ade4c29103b9985e94ba5bdc5b47a0f8cd5
https://github.com/scummvm/scummvm/commit/d45f4ade4c29103b9985e94ba5bdc5b47a0f8cd5
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-04T19:29:03-04:00
Commit Message:
DIRECTOR: LINGO: Remove .xlib from xlib name
Changed paths:
engines/director/lingo/lingo-object.cpp
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index e007da9751..75bff436eb 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -168,6 +168,8 @@ Common::String Lingo::normalizeXLibName(Common::String name) {
if (platform == Common::kPlatformMacintosh) {
int pos = name.findLastOf(':');
name = name.substr(pos + 1, name.size());
+ if (name.hasSuffixIgnoreCase(".xlib"))
+ name = name.substr(0, name.size() - 5);
} else if (platform == Common::kPlatformWindows) {
if (name.hasSuffixIgnoreCase(".dll"))
name = name.substr(0, name.size() - 4);
Commit: 88c0d444f30c2a2c17293e1d63b3de7db56977f1
https://github.com/scummvm/scummvm/commit/88c0d444f30c2a2c17293e1d63b3de7db56977f1
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-04T19:29:11-04:00
Commit Message:
DIRECTOR: LINGO: Clean up call stack when stopping movie
Fixes memory leaks.
Changed paths:
engines/director/lingo/lingo.cpp
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 1087a70bcd..138a9c2173 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -441,7 +441,7 @@ void Lingo::execute() {
}
}
- if (_abort) {
+ if (_abort || _vm->getCurrentMovie()->getScore()->_playState == kPlayStopped) {
// Clean up call stack
while (_vm->getCurrentWindow()->_callstack.size()) {
popContext();
Commit: ac231f8ad8ba62615787a40e84d8894b64c40ee5
https://github.com/scummvm/scummvm/commit/ac231f8ad8ba62615787a40e84d8894b64c40ee5
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-04T19:29:18-04:00
Commit Message:
DIRECTOR: LINGO: Implement basic SoundJam XObject
Changed paths:
engines/director/lingo/xlibs/soundjam.cpp
engines/director/lingo/xlibs/soundjam.h
diff --git a/engines/director/lingo/xlibs/soundjam.cpp b/engines/director/lingo/xlibs/soundjam.cpp
index 8846adefbf..a251512127 100644
--- a/engines/director/lingo/xlibs/soundjam.cpp
+++ b/engines/director/lingo/xlibs/soundjam.cpp
@@ -45,6 +45,8 @@
*/
#include "director/director.h"
+#include "director/window.h"
+#include "director/sound.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
@@ -54,6 +56,8 @@ namespace Director {
static const char *xlibName = "SoundJam";
+const int kJamChannel = 3;
+
static MethodProto xlibMethods[] = {
{ "new", SoundJam::m_new, 1, 1, 400 },
{ "defineFileSound", SoundJam::m_defineFileSound, 2, 2, 400 },
@@ -89,17 +93,15 @@ SoundJamObject::SoundJamObject(ObjectType objType) : Object<SoundJamObject>("Sou
}
void SoundJam::m_new(int nargs) {
- /* Datum numberOfChannels = */ g_lingo->pop();
-
- // Meet MediaBand seems to have fully working fallbacks to
- // standard Lingo builtins, which it uses when SoundJam
- // fails to initialize. So let's fail to initialize it...
+ int numberOfChannels = g_lingo->pop().asInt();
- g_lingo->push(-20023); // Indicates this version of Director does not support SoundJam
+ if (numberOfChannels != 1) {
+ warning("SoundJam::m_new: Expected numberOfChannels = 1, got %d", numberOfChannels);
+ g_lingo->push(Datum());
+ return;
+ }
- // If we discover that the standard builtins don't replicate
- // everything SoundJam is used for, then we'll have to properly
- // implement this.
+ g_lingo->push(g_lingo->_currentMe);
}
void SoundJam::m_defineFileSound(int nargs) {
@@ -109,15 +111,37 @@ void SoundJam::m_defineFileSound(int nargs) {
}
void SoundJam::m_defineCastSound(int nargs) {
- g_lingo->printSTUBWithArglist("SoundJam::m_defineCastSound", nargs);
- g_lingo->dropStack(nargs);
- g_lingo->push(Datum());
+ SoundJamObject *me = static_cast<SoundJamObject *>(g_lingo->_currentMe.u.obj);
+
+ /* Datum numberOfBeats = */ g_lingo->pop();
+ CastMemberID castMemberNumber = g_lingo->pop().asMemberID();
+
+ int soundID = 0;
+ while (me->_soundMap.contains(soundID))
+ soundID++;
+
+ me->_soundMap[soundID] = castMemberNumber;
+
+ g_lingo->push(soundID);
}
void SoundJam::m_undefineSound(int nargs) {
- g_lingo->printSTUBWithArglist("SoundJam::m_undefineSound", nargs);
- g_lingo->dropStack(nargs);
- g_lingo->push(Datum());
+ SoundJamObject *me = static_cast<SoundJamObject *>(g_lingo->_currentMe.u.obj);
+ int soundID = g_lingo->pop().asInt();
+
+ if (soundID < 0) {
+ g_lingo->push(0); // success
+ return;
+ }
+
+ if (!me->_soundMap.contains(soundID)) {
+ warning("SoundJam::m_undefineSound: Sound %d is not defined", soundID);
+ g_lingo->push(-1); // error
+ return;
+ }
+
+ me->_soundMap.erase(soundID);
+ g_lingo->push(0); // success
}
void SoundJam::m_readSome(int nargs) {
@@ -133,9 +157,19 @@ void SoundJam::m_startSound(int nargs) {
}
void SoundJam::m_switchNew(int nargs) {
- g_lingo->printSTUBWithArglist("SoundJam::m_switchNew", nargs);
- g_lingo->dropStack(nargs);
- g_lingo->push(Datum());
+ SoundJamObject *me = static_cast<SoundJamObject *>(g_lingo->_currentMe.u.obj);
+ int soundID = g_lingo->pop().asInt();
+
+ if (!me->_soundMap.contains(soundID)) {
+ warning("SoundJam::m_switchNew: Sound %d is not defined", soundID);
+ g_lingo->push(-1); // error
+ return;
+ }
+
+ DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
+ sound->setPuppetSound(me->_soundMap[soundID], kJamChannel);
+ sound->playPuppetSound(kJamChannel);
+ g_lingo->push(0); // success
}
void SoundJam::m_switchParallel(int nargs) {
@@ -156,8 +190,9 @@ void SoundJam::m_toggleMute(int nargs) {
}
void SoundJam::m_stop(int nargs) {
- g_lingo->printSTUBWithArglist("SoundJam::m_stop", nargs);
- g_lingo->dropStack(nargs);
+ DirectorSound *sound = g_director->getCurrentWindow()->getSoundManager();
+ sound->setPuppetSound(SoundID(), kJamChannel);
+ sound->playPuppetSound(kJamChannel);
}
} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/soundjam.h b/engines/director/lingo/xlibs/soundjam.h
index 76f892839e..3c0ebe52c6 100644
--- a/engines/director/lingo/xlibs/soundjam.h
+++ b/engines/director/lingo/xlibs/soundjam.h
@@ -26,6 +26,9 @@
namespace Director {
class SoundJamObject : public Object<SoundJamObject> {
+public:
+ Common::HashMap<int, CastMemberID> _soundMap;
+
public:
SoundJamObject(ObjectType objType);
};
Commit: 1e7e9707a8c0fed8a90ea6e1f66e3e49b4eab602
https://github.com/scummvm/scummvm/commit/1e7e9707a8c0fed8a90ea6e1f66e3e49b4eab602
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-04T19:30:52-04:00
Commit Message:
DIRECTOR: Load XCOD from non-projector MacBinaries
Meet MediaBand's Main/Shared.dir contains XCOD resources.
Changed paths:
engines/director/archive.cpp
engines/director/resource.cpp
engines/director/window.h
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 882ece21cc..a01cd7df1f 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -28,6 +28,7 @@
#include "director/director.h"
#include "director/archive.h"
+#include "director/window.h"
#include "director/util.h"
namespace Director {
@@ -431,6 +432,14 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
if (Common::MacResManager::isMacBinary(*stream)) {
warning("RIFXArchive::openStream(): MacBinary detected, overriding");
+ // We need to look at the resource fork to detect XCOD resources
+ Common::SeekableSubReadStream *macStream = new Common::SeekableSubReadStream(stream, 0, stream->size());
+ MacArchive *macArchive = new MacArchive();
+ macArchive->openStream(macStream);
+ g_director->getCurrentWindow()->probeMacBinary(macArchive);
+ delete macArchive;
+
+ // Then read the data fork
moreOffset = Common::MacResManager::getDataForkOffset();
stream->seek(startOffset + moreOffset);
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index db0c07827b..d17d719f09 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -57,12 +57,12 @@ Common::Error Window::loadInitialMovie() {
debug(0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
Common::String movie = (_vm->getGameGID() == GID_TESTALL) ? getNextMovieFromQueue().movie : _vm->getEXEName();
- probeProjector(movie);
-
- if (g_director->getPlatform() == Common::kPlatformWindows)
+ if (g_director->getPlatform() == Common::kPlatformWindows) {
loadEXE(movie);
- else
+ } else {
+ probeProjector(movie);
loadMac(movie);
+ }
if (!_mainArchive) {
warning("Cannot open main movie");
@@ -89,14 +89,17 @@ void Window::probeProjector(const Common::String &movie) {
if (g_director->getPlatform() == Common::kPlatformWindows)
return;
- Director::MacArchive *archive = new MacArchive();
-
+ MacArchive *archive = new MacArchive();
if (!archive->openFile(movie)) {
delete archive;
-
return;
}
+ 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")) {
@@ -115,15 +118,6 @@ void Window::probeProjector(const Common::String &movie) {
}
}
- if (archive->hasResource(MKTAG('X', 'C', 'O', 'D'), -1)) {
- Common::Array<uint16> xcod = archive->getResourceIDList(MKTAG('X', 'C', 'O', 'D'));
- for (Common::Array<uint16>::iterator iterator = xcod.begin(); iterator != xcod.end(); ++iterator) {
- Resource res = archive->getResourceDetail(MKTAG('X', 'C', 'O', 'D'), *iterator);
- debug(0, "Detected XObject '%s'", res.name.c_str());
- g_lingo->openXLib(res.name, kXObj);
- }
- }
-
if (archive->hasResource(MKTAG('S', 'T', 'R', '#'), 0)) {
if (_currentMovie)
_currentMovie->setArchive(archive);
@@ -149,7 +143,14 @@ void Window::probeProjector(const Common::String &movie) {
}
}
- delete archive;
+ if (archive->hasResource(MKTAG('X', 'C', 'O', 'D'), -1)) {
+ Common::Array<uint16> xcod = archive->getResourceIDList(MKTAG('X', 'C', 'O', 'D'));
+ for (Common::Array<uint16>::iterator iterator = xcod.begin(); iterator != xcod.end(); ++iterator) {
+ Resource res = archive->getResourceDetail(MKTAG('X', 'C', 'O', 'D'), *iterator);
+ debug(0, "Detected XObject '%s'", res.name.c_str());
+ g_lingo->openXLib(res.name, kXObj);
+ }
+ }
}
Archive *Window::openMainArchive(const Common::String movie) {
diff --git a/engines/director/window.h b/engines/director/window.h
index 1a07f85ffa..35f75d724e 100644
--- a/engines/director/window.h
+++ b/engines/director/window.h
@@ -41,6 +41,7 @@ namespace Director {
const int SCALE_THRESHOLD = 0x100;
class Channel;
+class MacArchive;
struct MacShape;
struct TransParams {
@@ -146,6 +147,7 @@ public:
// resource.cpp
Common::Error loadInitialMovie();
void probeProjector(const Common::String &movie);
+ void probeMacBinary(MacArchive *archive);
Archive *openMainArchive(const Common::String movie);
void loadEXE(const Common::String movie);
void loadEXEv3(Common::SeekableReadStream *stream);
Commit: fc21f2b7beac974922bc0aed510eef58f2e8d657
https://github.com/scummvm/scummvm/commit/fc21f2b7beac974922bc0aed510eef58f2e8d657
Author: djsrv (dservilla at gmail.com)
Date: 2021-08-04T19:31:00-04:00
Commit Message:
DIRECTOR: LINGO: Allow xlibs to have multiple filenames
Changed paths:
engines/director/lingo/lingo-object.cpp
engines/director/lingo/lingo.h
engines/director/lingo/xlibs/cdromxobj.cpp
engines/director/lingo/xlibs/cdromxobj.h
engines/director/lingo/xlibs/fileio.cpp
engines/director/lingo/xlibs/fileio.h
engines/director/lingo/xlibs/flushxobj.cpp
engines/director/lingo/xlibs/flushxobj.h
engines/director/lingo/xlibs/fplayxobj.cpp
engines/director/lingo/xlibs/fplayxobj.h
engines/director/lingo/xlibs/labeldrvxobj.cpp
engines/director/lingo/xlibs/labeldrvxobj.h
engines/director/lingo/xlibs/orthoplayxobj.cpp
engines/director/lingo/xlibs/orthoplayxobj.h
engines/director/lingo/xlibs/palxobj.cpp
engines/director/lingo/xlibs/palxobj.h
engines/director/lingo/xlibs/popupmenuxobj.cpp
engines/director/lingo/xlibs/popupmenuxobj.h
engines/director/lingo/xlibs/serialportxobj.cpp
engines/director/lingo/xlibs/serialportxobj.h
engines/director/lingo/xlibs/soundjam.cpp
engines/director/lingo/xlibs/soundjam.h
engines/director/lingo/xlibs/videodiscxobj.cpp
engines/director/lingo/xlibs/videodiscxobj.h
engines/director/lingo/xlibs/winxobj.cpp
engines/director/lingo/xlibs/winxobj.h
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 75bff436eb..fe8f80e39e 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -111,50 +111,37 @@ void Lingo::cleanupMethods() {
}
static struct XLibProto {
- const char *name;
- void (*opener)(int);
- void (*closer)(int);
+ const char **names;
+ XLibFunc opener;
+ XLibFunc closer;
int type;
int version;
} xlibs[] = {
- { "CD-ROM XObj", CDROMXObj::open, CDROMXObj::close, kXObj, 200 }, // D2
- { "FileIO", FileIO::open, FileIO::close, kXObj | kXtraObj, 200 }, // D2
- { "FlushXObj", FlushXObj::open, FlushXObj::close, kXObj, 400 }, // D4
- { "FPlayXObj", FPlayXObj::open, FPlayXObj::close, kXObj, 200 }, // D2
- { "LabelDrv", LabelDrvXObj::open, LabelDrvXObj::close, kXObj, 400 }, // D4
- { "OrthoPlay XObj", OrthoPlayXObj::open, OrthoPlayXObj::close, kXObj, 400 }, // D4
- { "PalXObj", PalXObj::open, PalXObj::close, kXObj, 400 }, // D4
- { "PopUp Menu XObj", PopUpMenuXObj::open, PopUpMenuXObj::close, kXObj, 200 }, // D2
- { "SerialPort", SerialPortXObj::open, SerialPortXObj::close, kXObj, 200 }, // D2
- { "SoundJam", SoundJam::open, SoundJam::close, kXObj, 400 }, // D4
- { "Videodisc XObj", VideodiscXObj::open, VideodiscXObj::close, kXObj, 200 }, // D2
- { "winXObj", RearWindowXObj::open, RearWindowXObj::close, kXObj, 400 }, // D4
+ { CDROMXObj::fileNames, CDROMXObj::open, CDROMXObj::close, kXObj, 200 }, // D2
+ { FileIO::fileNames, FileIO::open, FileIO::close, kXObj | kXtraObj, 200 }, // D2
+ { FlushXObj::fileNames, FlushXObj::open, FlushXObj::close, kXObj, 400 }, // D4
+ { FPlayXObj::fileNames, FPlayXObj::open, FPlayXObj::close, kXObj, 200 }, // D2
+ { 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
+ { 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
+ { VideodiscXObj::fileNames, VideodiscXObj::open, VideodiscXObj::close, kXObj, 200 }, // D2
+ { RearWindowXObj::fileNames, RearWindowXObj::open, RearWindowXObj::close, kXObj, 400 }, // D4
{ 0, 0, 0, 0, 0 }
};
void Lingo::initXLibs() {
- for (XLibProto *lib = xlibs; lib->name; lib++) {
+ for (XLibProto *lib = xlibs; lib->names; lib++) {
if (lib->version > _vm->getVersion())
continue;
- Symbol openSym;
- openSym.name = new Common::String(lib->name);
- openSym.type = HBLTIN;
- openSym.nargs = 0;
- openSym.maxArgs = 0;
- openSym.targetType = lib->type;
- openSym.u.bltin = lib->opener;
- _xlibOpeners[lib->name] = openSym;
-
- Symbol closeSym;
- closeSym.name = new Common::String(lib->name);
- closeSym.type = HBLTIN;
- closeSym.nargs = 0;
- closeSym.maxArgs = 0;
- openSym.targetType = lib->type;
- closeSym.u.bltin = lib->closer;
- _xlibClosers[lib->name] = closeSym;
+ for (uint i = 0; lib->names[i]; i++) {
+ _xlibOpeners[lib->names[i]] = lib->opener;
+ _xlibClosers[lib->names[i]] = lib->closer;
+ }
}
}
@@ -189,8 +176,7 @@ void Lingo::openXLib(Common::String name, ObjectType type) {
_openXLibs[name] = type;
if (_xlibOpeners.contains(name)) {
- Symbol sym = _xlibOpeners[name];
- (*sym.u.bltin)(type);
+ (*_xlibOpeners[name])(type);
} else {
warning("Lingo::openXLib: Unimplemented xlib: '%s'", name.c_str());
}
@@ -208,8 +194,7 @@ void Lingo::closeXLib(Common::String name) {
_openXLibs.erase(name);
if (_xlibClosers.contains(name)) {
- Symbol sym = _xlibClosers[name];
- (*sym.u.bltin)(type);
+ (*_xlibClosers[name])(type);
} else {
warning("Lingo::closeXLib: Unimplemented xlib: '%s'", name.c_str());
}
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 7162a29c43..71d8f662d9 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -209,6 +209,8 @@ typedef Common::HashMap<Common::String, Symbol, Common::IgnoreCase_Hash, Common:
typedef Common::HashMap<Common::String, Datum, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> DatumHash;
typedef Common::HashMap<Common::String, Builtin *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> BuiltinHash;
typedef Common::HashMap<Common::String, VarType, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> VarTypeHash;
+typedef void (*XLibFunc)(int);
+typedef Common::HashMap<Common::String, XLibFunc, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> XLibFuncHash;
typedef Common::HashMap<Common::String, ObjectType, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> OpenXLibsHash;
typedef Common::HashMap<Common::String, TheEntity *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> TheEntityHash;
@@ -413,8 +415,8 @@ public:
SymbolHash _builtinFuncs;
SymbolHash _builtinConsts;
SymbolHash _methods;
- SymbolHash _xlibOpeners;
- SymbolHash _xlibClosers;
+ XLibFuncHash _xlibOpeners;
+ XLibFuncHash _xlibClosers;
OpenXLibsHash _openXLibs;
diff --git a/engines/director/lingo/xlibs/cdromxobj.cpp b/engines/director/lingo/xlibs/cdromxobj.cpp
index 9fc4c466f0..25d37f4257 100644
--- a/engines/director/lingo/xlibs/cdromxobj.cpp
+++ b/engines/director/lingo/xlibs/cdromxobj.cpp
@@ -111,7 +111,11 @@
namespace Director {
-static const char *xlibName = "AppleAudioCD";
+const char *CDROMXObj::xlibName = "AppleAudioCD";
+const char *CDROMXObj::fileNames[] = {
+ "CD-ROM XObj",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", CDROMXObj::m_new, 2, 2, 200 }, // D2
diff --git a/engines/director/lingo/xlibs/cdromxobj.h b/engines/director/lingo/xlibs/cdromxobj.h
index 5b13141f1f..8d270e87e2 100644
--- a/engines/director/lingo/xlibs/cdromxobj.h
+++ b/engines/director/lingo/xlibs/cdromxobj.h
@@ -32,6 +32,9 @@ public:
namespace CDROMXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/fileio.cpp b/engines/director/lingo/xlibs/fileio.cpp
index 6f34901cce..7823f2f12f 100644
--- a/engines/director/lingo/xlibs/fileio.cpp
+++ b/engines/director/lingo/xlibs/fileio.cpp
@@ -32,7 +32,11 @@
namespace Director {
-static const char *xlibName = "FileIO";
+const char *FileIO::xlibName = "FileIO";
+const char *FileIO::fileNames[] = {
+ "FileIO",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "delete", FileIO::m_delete, 0, 0, 200 }, // D2
diff --git a/engines/director/lingo/xlibs/fileio.h b/engines/director/lingo/xlibs/fileio.h
index 361034468d..109579c733 100644
--- a/engines/director/lingo/xlibs/fileio.h
+++ b/engines/director/lingo/xlibs/fileio.h
@@ -68,6 +68,9 @@ public:
};
namespace FileIO {
+ extern const char *xlibName;
+ extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/flushxobj.cpp b/engines/director/lingo/xlibs/flushxobj.cpp
index 2b9837da8c..b25b52e6d8 100644
--- a/engines/director/lingo/xlibs/flushxobj.cpp
+++ b/engines/director/lingo/xlibs/flushxobj.cpp
@@ -42,7 +42,11 @@
namespace Director {
-static const char *xlibName = "FlushXObj";
+const char *FlushXObj::xlibName = "FlushXObj";
+const char *FlushXObj::fileNames[] = {
+ "FlushXObj",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", FlushXObj::m_new, 0, 0, 400 }, // D4
diff --git a/engines/director/lingo/xlibs/flushxobj.h b/engines/director/lingo/xlibs/flushxobj.h
index f1556a93ce..d9af6c460d 100644
--- a/engines/director/lingo/xlibs/flushxobj.h
+++ b/engines/director/lingo/xlibs/flushxobj.h
@@ -32,6 +32,9 @@ public:
namespace FlushXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/fplayxobj.cpp b/engines/director/lingo/xlibs/fplayxobj.cpp
index f330bc10a8..ef53c08205 100644
--- a/engines/director/lingo/xlibs/fplayxobj.cpp
+++ b/engines/director/lingo/xlibs/fplayxobj.cpp
@@ -37,6 +37,12 @@
namespace Director {
+const char *FPlayXObj::xlibName = "FPlay";
+const char *FPlayXObj::fileNames[] = {
+ "FPlayXObj",
+ 0
+};
+
static BuiltinProto builtins[] = {
{ "FPlay", FPlayXObj::b_fplay, -1,0, 200, CBLTIN },
{ "SndInfo", FPlayXObj::b_sndinfo, -1,0, 200, FBLTIN },
diff --git a/engines/director/lingo/xlibs/fplayxobj.h b/engines/director/lingo/xlibs/fplayxobj.h
index 5798f43607..f946006462 100644
--- a/engines/director/lingo/xlibs/fplayxobj.h
+++ b/engines/director/lingo/xlibs/fplayxobj.h
@@ -27,6 +27,9 @@ namespace Director {
namespace FPlayXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/labeldrvxobj.cpp b/engines/director/lingo/xlibs/labeldrvxobj.cpp
index 51d4c60266..dd7a42b8d9 100644
--- a/engines/director/lingo/xlibs/labeldrvxobj.cpp
+++ b/engines/director/lingo/xlibs/labeldrvxobj.cpp
@@ -43,8 +43,11 @@
namespace Director {
-// The name is different from the obj filename.
-static const char *xlibName = "LabelDrv";
+const char *LabelDrvXObj::xlibName = "LabelDrv";
+const char *LabelDrvXObj::fileNames[] = {
+ "LabelDrv",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", LabelDrvXObj::m_new, 0, 0, 400 }, // D4
@@ -68,7 +71,7 @@ void LabelDrvXObj::close(int type) {
}
}
-LabelDrvXObject::LabelDrvXObject(ObjectType ObjectType) :Object<LabelDrvXObject>("LabelDrvXObj") {
+LabelDrvXObject::LabelDrvXObject(ObjectType ObjectType) :Object<LabelDrvXObject>("LabelDrv") {
_objType = ObjectType;
}
diff --git a/engines/director/lingo/xlibs/labeldrvxobj.h b/engines/director/lingo/xlibs/labeldrvxobj.h
index 8eaddd5fed..53133ed75a 100644
--- a/engines/director/lingo/xlibs/labeldrvxobj.h
+++ b/engines/director/lingo/xlibs/labeldrvxobj.h
@@ -35,6 +35,9 @@ public:
namespace LabelDrvXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/orthoplayxobj.cpp b/engines/director/lingo/xlibs/orthoplayxobj.cpp
index 904986106b..99f848a87b 100644
--- a/engines/director/lingo/xlibs/orthoplayxobj.cpp
+++ b/engines/director/lingo/xlibs/orthoplayxobj.cpp
@@ -40,7 +40,11 @@
namespace Director {
-static const char *xlibName = "OrthoPlayXObj";
+const char *OrthoPlayXObj::xlibName = "OrthoPlayXObj";
+const char *OrthoPlayXObj::fileNames[] = {
+ "OrthoPlay XObj",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", OrthoPlayXObj::m_new, 0, 0, 200 }, // D2
diff --git a/engines/director/lingo/xlibs/orthoplayxobj.h b/engines/director/lingo/xlibs/orthoplayxobj.h
index be04579e66..edd6e1e564 100644
--- a/engines/director/lingo/xlibs/orthoplayxobj.h
+++ b/engines/director/lingo/xlibs/orthoplayxobj.h
@@ -32,6 +32,9 @@ public:
namespace OrthoPlayXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/palxobj.cpp b/engines/director/lingo/xlibs/palxobj.cpp
index f10a16d287..ba0adfac4d 100644
--- a/engines/director/lingo/xlibs/palxobj.cpp
+++ b/engines/director/lingo/xlibs/palxobj.cpp
@@ -46,7 +46,11 @@
namespace Director {
// The name is different from the obj filename.
-static const char *xlibName = "FixPalette";
+const char *PalXObj::xlibName = "FixPalette";
+const char *PalXObj::fileNames[] = {
+ "PalXObj",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", PalXObj::m_new, 4, 4, 400 }, // D4
diff --git a/engines/director/lingo/xlibs/palxobj.h b/engines/director/lingo/xlibs/palxobj.h
index 70da86adb3..df77bfb977 100644
--- a/engines/director/lingo/xlibs/palxobj.h
+++ b/engines/director/lingo/xlibs/palxobj.h
@@ -35,6 +35,9 @@ public:
namespace PalXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/popupmenuxobj.cpp b/engines/director/lingo/xlibs/popupmenuxobj.cpp
index 8d5bbf26f3..df5588abdd 100644
--- a/engines/director/lingo/xlibs/popupmenuxobj.cpp
+++ b/engines/director/lingo/xlibs/popupmenuxobj.cpp
@@ -48,7 +48,12 @@
namespace Director {
-static const char *xlibName = "PopMenu";
+const char *PopUpMenuXObj::xlibName = "PopMenu";
+const char *PopUpMenuXObj::fileNames[] = {
+ "PopMenu",
+ "PopUp Menu XObj",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", PopUpMenuXObj::m_new, 2, 2, 200 }, // D2
diff --git a/engines/director/lingo/xlibs/popupmenuxobj.h b/engines/director/lingo/xlibs/popupmenuxobj.h
index f18c6115b6..217ea8a550 100644
--- a/engines/director/lingo/xlibs/popupmenuxobj.h
+++ b/engines/director/lingo/xlibs/popupmenuxobj.h
@@ -32,6 +32,9 @@ public:
namespace PopUpMenuXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/serialportxobj.cpp b/engines/director/lingo/xlibs/serialportxobj.cpp
index 1e524d4c3d..2ffaa32478 100644
--- a/engines/director/lingo/xlibs/serialportxobj.cpp
+++ b/engines/director/lingo/xlibs/serialportxobj.cpp
@@ -36,7 +36,11 @@
namespace Director {
-static const char *xlibName = "SerialPort";
+const char *SerialPortXObj::xlibName = "SerialPort";
+const char *SerialPortXObj::fileNames[] = {
+ "SerialPort",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", SerialPortXObj::m_new, 1, 1, 200 }, // D2
diff --git a/engines/director/lingo/xlibs/serialportxobj.h b/engines/director/lingo/xlibs/serialportxobj.h
index 2da5020f8d..7e837bd69d 100644
--- a/engines/director/lingo/xlibs/serialportxobj.h
+++ b/engines/director/lingo/xlibs/serialportxobj.h
@@ -32,6 +32,9 @@ public:
namespace SerialPortXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/soundjam.cpp b/engines/director/lingo/xlibs/soundjam.cpp
index a251512127..5a38bdea5c 100644
--- a/engines/director/lingo/xlibs/soundjam.cpp
+++ b/engines/director/lingo/xlibs/soundjam.cpp
@@ -54,7 +54,11 @@
namespace Director {
-static const char *xlibName = "SoundJam";
+const char *SoundJam::xlibName = "SoundJam";
+const char *SoundJam::fileNames[] = {
+ "SoundJam",
+ 0
+};
const int kJamChannel = 3;
diff --git a/engines/director/lingo/xlibs/soundjam.h b/engines/director/lingo/xlibs/soundjam.h
index 3c0ebe52c6..423e17fecf 100644
--- a/engines/director/lingo/xlibs/soundjam.h
+++ b/engines/director/lingo/xlibs/soundjam.h
@@ -35,6 +35,9 @@ public:
namespace SoundJam {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/videodiscxobj.cpp b/engines/director/lingo/xlibs/videodiscxobj.cpp
index 250d0a8132..23e6abdbd6 100644
--- a/engines/director/lingo/xlibs/videodiscxobj.cpp
+++ b/engines/director/lingo/xlibs/videodiscxobj.cpp
@@ -108,7 +108,11 @@
namespace Director {
-static const char *xlibName = "LaserDisc";
+const char *VideodiscXObj::xlibName = "LaserDisc";
+const char *VideodiscXObj::fileNames[] = {
+ "Videodisc XObj",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", VideodiscXObj::m_new, 3, 3, 200 }, // D2
diff --git a/engines/director/lingo/xlibs/videodiscxobj.h b/engines/director/lingo/xlibs/videodiscxobj.h
index 26be1d105a..95eb0fb8e3 100644
--- a/engines/director/lingo/xlibs/videodiscxobj.h
+++ b/engines/director/lingo/xlibs/videodiscxobj.h
@@ -32,6 +32,9 @@ public:
namespace VideodiscXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
diff --git a/engines/director/lingo/xlibs/winxobj.cpp b/engines/director/lingo/xlibs/winxobj.cpp
index c9f298b899..793aca980d 100644
--- a/engines/director/lingo/xlibs/winxobj.cpp
+++ b/engines/director/lingo/xlibs/winxobj.cpp
@@ -38,7 +38,11 @@
namespace Director {
-static const char *xlibName = "RearWindow";
+const char *RearWindowXObj::xlibName = "RearWindow";
+const char *RearWindowXObj::fileNames[] = {
+ "winXObj",
+ 0
+};
static MethodProto xlibMethods[] = {
{ "new", RearWindowXObj::m_new, 1, 1, 400 }, // D4
diff --git a/engines/director/lingo/xlibs/winxobj.h b/engines/director/lingo/xlibs/winxobj.h
index c58dbaae66..b7937a5e74 100644
--- a/engines/director/lingo/xlibs/winxobj.h
+++ b/engines/director/lingo/xlibs/winxobj.h
@@ -33,6 +33,9 @@ public:
namespace RearWindowXObj {
+extern const char *xlibName;
+extern const char *fileNames[];
+
void open(int type);
void close(int type);
More information about the Scummvm-git-logs
mailing list