aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/archive.cpp5
-rw-r--r--engines/director/detection.cpp1
-rw-r--r--engines/director/detection_tables.h14
-rw-r--r--engines/director/director.cpp15
-rw-r--r--engines/director/director.h3
-rw-r--r--engines/director/lingo/lingo.cpp8
-rw-r--r--engines/director/score.cpp24
-rw-r--r--engines/director/score.h2
8 files changed, 56 insertions, 16 deletions
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index c9b6cc1cfa..f426107ee3 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -441,14 +441,13 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
debugCN(2, kDebugLoading, "CAS*: %d [", casSize);
for (uint i = 0; i < casSize; i++) {
- uint32 index = casStream.readUint32();
+ uint32 index = casStream.readUint32BE();
+ debugCN(2, kDebugLoading, "%d ", index);
Resource &res = resources[index];
res.index = index;
res.castId = i + 1;
_types[castTag][res.castId] = res;
-
- debugCN(2, kDebugLoading, "%d ", index);
}
debugC(2, kDebugLoading, "]");
}
diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index c26084ac6c..43c5bf2b4f 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -78,6 +78,7 @@ static const PlainGameDescriptor directorGames[] = {
{ "jewels", "Jewels of the Oracle" },
{ "jman", "The Journeyman Project" },
{ "majestic", "Majestic Part I: Alien Encounter" },
+ { "mediaband", "Meet Mediaband" },
{ "melements", "Masters of the Elements" },
{ "spyclub", "Spy Club" },
{ "amber", "AMBER: Journeys Beyond"},
diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index 15bdf37968..95ddd25abe 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -291,6 +291,20 @@ static const DirectorGameDescription gameDescriptions[] = {
4
},
+ { // Meet Mediaband
+ {
+ "mediaband",
+ "",
+ AD_ENTRY1s("MEDIABND.EXE", "0cfb9b4762e33ab56d656a0eb146a048", 717921),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NOASPECT)
+ },
+ GID_GENERIC,
+ 4
+ },
+
{
{
// Masters of the Elements - English (from rootfather)
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index f26d873eff..05775791f6 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -45,6 +45,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
DebugMan.addDebugChannel(kDebugLoading, "loading", "Loading");
DebugMan.addDebugChannel(kDebugImages, "images", "Image drawing");
DebugMan.addDebugChannel(kDebugText, "text", "Text rendering");
+ DebugMan.addDebugChannel(kDebugEvents, "events", "Event processing");
g_director = this;
@@ -83,6 +84,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
const Common::FSNode gameDataDir(ConfMan.get("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "data");
SearchMan.addSubDirectoryMatching(gameDataDir, "install");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "main"); // Meet Mediaband
_colorDepth = 8; // 256-color
_key = 0;
@@ -137,13 +139,14 @@ Common::Error DirectorEngine::run() {
//_mainArchive = new RIFFArchive();
//_mainArchive->openFile("bookshelf_example.mmm");
- if (getPlatform() == Common::kPlatformWindows) {
- _sharedCastFile = "SHARDCST.MMM";
- } else {
- if (getVersion() < 4)
+ if (getVersion() < 4) {
+ if (getPlatform() == Common::kPlatformWindows) {
+ _sharedCastFile = "SHARDCST.MMM";
+ } else {
_sharedCastFile = "Shared Cast";
- else
- _sharedCastFile = "Shared.dir";
+ }
+ } else {
+ _sharedCastFile = "Shared.dir";
}
loadSharedCastsFrom(_sharedCastFile);
diff --git a/engines/director/director.h b/engines/director/director.h
index eeb9c6b8d5..805a51c610 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -57,7 +57,8 @@ enum {
kDebugLingoCompile = 1 << 1,
kDebugLoading = 1 << 2,
kDebugImages = 1 << 3,
- kDebugText = 1 << 4
+ kDebugText = 1 << 4,
+ kDebugEvents = 1 << 5
};
extern byte defaultPalette[768];
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index d3132f93e5..759d40e819 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -247,7 +247,7 @@ void Lingo::executeScript(ScriptType type, uint16 id) {
return;
}
- debugC(2, kDebugLingoExec, "Executing script type: %d, id: %d", type, id);
+ debugC(2, kDebugLingoExec, "Executing script type: %s, id: %d", scriptType2str(type), id);
_currentScript = _scripts[type][id];
_pc = 0;
@@ -294,6 +294,8 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
if (entityId <= 0)
return;
+ debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d)", _eventHandlerTypes[event], scriptType2str(st), entityId);
+
_currentEntityId = entityId;
if (!_eventHandlerTypes.contains(event))
@@ -302,8 +304,8 @@ void Lingo::processEvent(LEvent event, ScriptType st, int entityId) {
if (_handlers.contains(ENTITY_INDEX(event, entityId))) {
call(_eventHandlerTypes[event], 0); // D4+ Events
pop();
- } else if (_scripts[st].contains(entityId + 1)) {
- executeScript(st, entityId + 1); // D3 list of scripts.
+ } else if (_scripts[st].contains(entityId)) {
+ executeScript(st, entityId); // D3 list of scripts.
} else {
debugC(8, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
}
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 53d15469b4..2544a612c0 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -41,6 +41,24 @@
namespace Director {
+const char *scriptTypes[] = {
+ "MovieScript",
+ "SpriteScript",
+ "FrameScript",
+ "CastScript"
+};
+
+const char *scriptType2str(ScriptType scr) {
+ if (scr < 0)
+ return "NoneScript";
+
+ if (scr > kMaxScriptType)
+ return "<unknown>";
+
+ return scriptTypes[scr];
+}
+
+
Score::Score(DirectorEngine *vm, Archive *archive) {
_vm = vm;
_surface = new Graphics::ManagedSurface;
@@ -863,8 +881,8 @@ void Score::update() {
_surface->copyFrom(*_trailSurface);
// Enter and exit from previous frame (Director 4)
- _lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId);
- _lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId);
+ _lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId - 1);
+ _lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId - 1);
// TODO Director 6 - another order
// TODO Director 6 step: send beginSprite event to any sprites whose span begin in the upcoming frame
@@ -971,7 +989,7 @@ void Score::processEvents() {
_lingo->processEvent(kEventMouseUp, kSpriteScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId);
} else {
// D3 doesn't have cast member or sprite scripts. Just Frame Scripts.
- _lingo->processEvent(kEventMouseUp, kFrameScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId);
+ _lingo->processEvent(kEventMouseUp, kFrameScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId + 1);
}
}
diff --git a/engines/director/score.h b/engines/director/score.h
index 61d911800e..6db5e33988 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -52,6 +52,8 @@ enum ScriptType {
kMaxScriptType = 3
};
+const char *scriptType2str(ScriptType scr);
+
class Score {
public:
Score(DirectorEngine *vm, Archive *);