aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-25 22:32:39 +0100
committerEugene Sandulenko2019-12-25 22:32:39 +0100
commit74dbb60931ca0ff59e7b63caed6178147c579d34 (patch)
treecf547ed3b47fdec2f5ed7d4254c7b7e97e8c4bb7 /engines
parentdf3d87062e25b208d62564c27f2d3610abc7325b (diff)
downloadscummvm-rg350-74dbb60931ca0ff59e7b63caed6178147c579d34.tar.gz
scummvm-rg350-74dbb60931ca0ff59e7b63caed6178147c579d34.tar.bz2
scummvm-rg350-74dbb60931ca0ff59e7b63caed6178147c579d34.zip
DIRECTOR: More loading debug output
Diffstat (limited to 'engines')
-rw-r--r--engines/director/cast.cpp19
-rw-r--r--engines/director/cast.h10
-rw-r--r--engines/director/score.cpp84
3 files changed, 89 insertions, 24 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 7c7604b21f..f1d49d9388 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -129,17 +129,20 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_palinfo2 = stream.readUint16();
_palinfo3 = stream.readUint16();
+ uint32 t;
+ uint16 pad = 0;
+
if (version == 2) {
- int t = stream.readUint16();
+ t = stream.readUint16();
if (t != 0) { // In D2 there are values
warning("TextCast: t: %x", t);
}
_initialRect = Score::readRect(stream);
- stream.readUint16();
+ pad = stream.readUint16();
} else {
- int t = stream.readUint32();
- if (t != 0) { // In D2 there are values
+ t = stream.readUint32();
+ if (t != 0) {
warning("TextCast: t: %x", t);
}
@@ -161,6 +164,14 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_fontId = stream.readByte();
_fontSize = stream.readByte();
_textSlant = 0;
+
+ debugC(2, kDebugLoading, "TextCast(): flags1: %d, border: %d gutter: %d shadow: %d type: %d align: %04x",
+ _flags1, _borderSize, _gutterSize, _boxShadow, _textType, _textAlign);
+ debugC(2, kDebugLoading, "TextCast(): rgb: 0x%04x 0x%04x 0x%04x, t: %d pad: %d shadow: %d flags: %d font: %d size: %d",
+ _palinfo1, _palinfo2, _palinfo3, t, pad, _textShadow, flags, _fontId, _fontSize);
+ if (debugChannelSet(2, kDebugLoading)) {
+ _initialRect.debugPrint(2, "TextCast(): rect:");
+ }
} else if (version == 4) {
_borderSize = static_cast<SizeType>(stream.readByte());
_gutterSize = static_cast<SizeType>(stream.readByte());
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 9a407e5be6..6c8704158c 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -54,7 +54,7 @@ public:
class BitmapCast : public Cast {
public:
- BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version = 2);
+ BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version);
uint16 _pitch;
uint16 _regX;
@@ -70,7 +70,7 @@ public:
class ShapeCast : public Cast {
public:
- ShapeCast(Common::ReadStreamEndian &stream, uint16 version = 2);
+ ShapeCast(Common::ReadStreamEndian &stream, uint16 version);
ShapeType _shapeType;
uint16 _pattern;
@@ -84,7 +84,7 @@ public:
class TextCast : public Cast {
public:
- TextCast(Common::ReadStreamEndian &stream, uint16 version = 2);
+ TextCast(Common::ReadStreamEndian &stream, uint16 version);
void setText(const char *text);
@@ -111,14 +111,14 @@ public:
class ButtonCast : public TextCast {
public:
- ButtonCast(Common::ReadStreamEndian &stream, uint16 version = 2);
+ ButtonCast(Common::ReadStreamEndian &stream, uint16 version);
ButtonType _buttonType;
};
class ScriptCast : public Cast {
public:
- ScriptCast(Common::ReadStreamEndian &stream, uint16 version = 2);
+ ScriptCast(Common::ReadStreamEndian &stream, uint16 version);
uint32 _id;
};
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index a399870d2e..2cb9b6a97b 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -110,8 +110,9 @@ void Score::setArchive(Archive *archive) {
_macName = archive->getFileName();
}
- if (archive->hasResource(MKTAG('V', 'W', 'L', 'B'), 1024)) {
- loadLabels(*archive->getResource(MKTAG('V', 'W', 'L', 'B'), 1024));
+ // Frame Labels
+ if (archive->hasResource(MKTAG('V', 'W', 'L', 'B'), -1)) {
+ loadLabels(*archive->getFirstResource(MKTAG('V', 'W', 'L', 'B')));
}
}
@@ -133,13 +134,16 @@ void Score::loadArchive() {
g_system->getPaletteManager()->setPalette(_vm->getPalette(), 0, _vm->getPaletteColorCount());
}
+ // Font Directory
if (_movieArchive->hasResource(MKTAG('F', 'O', 'N', 'D'), -1)) {
- debug("Movie has fonts. Loading....");
+ debug("STUB: Unhandled FOND resource");
}
+ // Score
assert(_movieArchive->hasResource(MKTAG('V', 'W', 'S', 'C'), -1));
loadFrames(*_movieArchive->getFirstResource(MKTAG('V', 'W', 'S', 'C')));
+ // Configuration Information
if (_movieArchive->hasResource(MKTAG('V', 'W', 'C', 'F'), -1)) {
loadConfig(*_movieArchive->getFirstResource(MKTAG('V', 'W', 'C', 'F')));
} else {
@@ -148,24 +152,44 @@ void Score::loadArchive() {
_stageColor = 1;
}
+ // Cast Information Array
if (_movieArchive->hasResource(MKTAG('V', 'W', 'C', 'R'), -1)) {
_castIDoffset = _movieArchive->getResourceIDList(MKTAG('V', 'W', 'C', 'R'))[0];
loadCastDataVWCR(*_movieArchive->getResource(MKTAG('V', 'W', 'C', 'R'), _castIDoffset));
}
+
+ // Action list
if (_movieArchive->hasResource(MKTAG('V', 'W', 'A', 'C'), -1)) {
loadActions(*_movieArchive->getFirstResource(MKTAG('V', 'W', 'A', 'C')));
}
+ // File Info
if (_movieArchive->hasResource(MKTAG('V', 'W', 'F', 'I'), -1)) {
loadFileInfo(*_movieArchive->getFirstResource(MKTAG('V', 'W', 'F', 'I')));
}
+ // Font Mapping
if (_movieArchive->hasResource(MKTAG('V', 'W', 'F', 'M'), -1)) {
_vm->_wm->_fontMan->clearFontMapping();
loadFontMap(*_movieArchive->getFirstResource(MKTAG('V', 'W', 'F', 'M')));
}
+ // Pattern Tiles
+ if (_movieArchive->hasResource(MKTAG('V', 'W', 'T', 'L'), -1)) {
+ debug("STUB: Unhandled VWTL resource.");
+ }
+
+ // Time code
+ if (_movieArchive->hasResource(MKTAG('V', 'W', 't', 'c'), -1)) {
+ debug("STUB: Unhandled VWtc resource");
+ }
+
+ // External sound files
+ if (_movieArchive->hasResource(MKTAG('S', 'T', 'R', ' '), -1)) {
+ debug("STUB: Unhandled 'STR ' resource");
+ }
+
// Try to load script context
if (_vm->getVersion() >= 4) {
Common::Array<uint16> lctx = _movieArchive->getResourceIDList(MKTAG('L','c','t','x'));
@@ -209,6 +233,22 @@ void Score::loadArchive() {
}
}
+ // PICT resources
+ if (_movieArchive->hasResource(MKTAG('P', 'I', 'C', 'T'), -1)) {
+ debug("STUB: Unhandled 'PICT' resource");
+ }
+
+ // Sound resources
+ if (_movieArchive->hasResource(MKTAG('s', 'n', 'd', ' '), -1)) {
+ debug("STUB: Unhandled 'snd ' resource");
+ }
+
+ // Film Loop resources
+ if (_movieArchive->hasResource(MKTAG('S', 'C', 'V', 'W'), -1)) {
+ debug("STUB: Unhandled 'SCVW' resource");
+ }
+
+
setSpriteCasts();
loadSpriteImages(false);
@@ -479,17 +519,31 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
void Score::loadConfig(Common::SeekableSubReadStreamEndian &stream) {
debugC(1, kDebugLoading, "****** Loading Config VWCF");
- /*uint16 unk1 = */ stream.readUint16();
- /*ver1 = */ stream.readUint16();
+ uint16 len = stream.readUint16();
+ uint16 ver1 = stream.readUint16();
_movieRect = Score::readRect(stream);
_castArrayStart = stream.readUint16();
_castArrayEnd = stream.readUint16();
_currentFrameRate = stream.readByte();
- debugC(1, kDebugLoading, "Config. Framerate: %d", _currentFrameRate);
- stream.skip(9);
+ byte lightswitch = stream.readByte();
+ uint16 unk1 = stream.readUint16();
+ uint16 commentFont = stream.readUint16();
+ uint16 commentSize = stream.readUint16();
+ uint16 commentStyle = stream.readUint16();
_stageColor = stream.readUint16();
+ uint16 bitdepth = stream.readUint16();
+ byte color = stream.readByte(); // boolean, color = 1, B/W = 0
+ uint16 stageColorR = stream.readUint16();
+ uint16 stageColorG = stream.readUint16();
+ uint16 stageColorB = stream.readUint16();
+
+ debugC(1, kDebugLoading, "Score::loadConfig(): len: %d, ver: %d, framerate: %d, light: %d, unk: %d, font: %d, size: %d"
+ ", style: %d", len, ver1, _currentFrameRate, lightswitch, unk1, commentFont, commentSize, commentStyle);
+ debugC(1, kDebugLoading, "Score::loadConfig(): stagecolor: %d, depth: %d, color: %d, rgb: 0x%04x 0x%04x 0x%04x",
+ _stageColor, bitdepth, color, stageColorR, stageColorG, stageColorB);
+ debugC(1, kDebugLoading, "Score::loadConfig(): %d bytes left", stream.size() - stream.pos());
}
void Score::readVersion(uint32 rid) {
@@ -514,24 +568,24 @@ void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
switch (castType) {
case kCastBitmap:
- debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d BitmapCast", id);
+ debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) BitmapCast", id, numToCastNum(id));
// TODO: Work out the proper tag!
- _loadedBitmaps->setVal(id, new BitmapCast(stream, MKTAG('B', 'I', 'T', 'D')));
+ _loadedBitmaps->setVal(id, new BitmapCast(stream, MKTAG('B', 'I', 'T', 'D'), _vm->getVersion()));
_castTypes[id] = kCastBitmap;
break;
case kCastText:
- debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d TextCast", id);
- _loadedText->setVal(id, new TextCast(stream));
+ debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) TextCast", id, numToCastNum(id));
+ _loadedText->setVal(id, new TextCast(stream, _vm->getVersion()));
_castTypes[id] = kCastText;
break;
case kCastShape:
- debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d ShapeCast", id);
- _loadedShapes->setVal(id, new ShapeCast(stream));
+ debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) ShapeCast", id, numToCastNum(id));
+ _loadedShapes->setVal(id, new ShapeCast(stream, _vm->getVersion()));
_castTypes[id] = kCastShape;
break;
case kCastButton:
- debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d ButtonCast", id);
- _loadedButtons->setVal(id, new ButtonCast(stream));
+ debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) ButtonCast", id, numToCastNum(id));
+ _loadedButtons->setVal(id, new ButtonCast(stream, _vm->getVersion()));
_castTypes[id] = kCastButton;
break;
default: