[Scummvm-git-logs] scummvm master -> 82ade7d5015ef801023d7c532436992ddf97ae2c
sev-
sev at scummvm.org
Mon Jun 22 17:08:40 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
82ade7d501 DIRECTOR: Move flag loading to casts itself for D4.
Commit: 82ade7d5015ef801023d7c532436992ddf97ae2c
https://github.com/scummvm/scummvm/commit/82ade7d5015ef801023d7c532436992ddf97ae2c
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-06-22T19:08:36+02:00
Commit Message:
DIRECTOR: Move flag loading to casts itself for D4.
unk1 in loadCastDataVWCR is probably a flag, based on D4Player.
https://github.com/renaldobf/D4Player/blob/master/src/director/cast.c#L90
Changed paths:
engines/director/cast.cpp
engines/director/score-loading.cpp
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index a241ea9c48..37236d486d 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -79,6 +79,7 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16
if (_pitch % 16)
_pitch += 16 - (_initialRect.width() % 16);
} else if (version == 4) {
+ _flags = stream.readByte();
_pitch = stream.readUint16();
_pitch &= 0x0fff;
@@ -161,7 +162,7 @@ DigitalVideoCast::DigitalVideoCast(Common::ReadStreamEndian &stream, uint16 vers
_enableCrop = false;
_center = false;
} else {
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < 5; i++) {
stream.readUint16();
}
_frameRate = stream.readByte();
@@ -191,7 +192,7 @@ SoundCast::SoundCast(Common::ReadStreamEndian &stream, uint16 version) {
_looping = 0;
if (version == 4) {
- for (int i = 0; i < 0xe; i++) {
+ for (int i = 0; i < 0xf; i++) {
stream.readByte();
}
_looping = stream.readByte() & 0x10 ? 0 : 1;
@@ -267,6 +268,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version, bool asButt
_initialRect.debugPrint(2, "TextCast(): rect:");
}
} else if (version == 4) {
+ byte flags = stream.readByte();
_borderSize = static_cast<SizeType>(stream.readByte());
_gutterSize = static_cast<SizeType>(stream.readByte());
_boxShadow = static_cast<SizeType>(stream.readByte());
@@ -282,10 +284,10 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version, bool asButt
_initialRect = Score::readRect(stream);
stream.readUint16();
_textShadow = static_cast<SizeType>(stream.readByte());
- byte flags = stream.readByte();
+ byte flags2 = stream.readByte();
- if (flags)
- warning("Unprocessed text cast flags: %x", flags);
+ if (flags || flags2)
+ warning("Unprocessed text cast flags: %x, flags:2 %x", flags, flags2);
_fontSize = stream.readUint16();
_textSlant = 0;
@@ -493,7 +495,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
_lineThickness = stream.readByte();
_lineDirection = stream.readByte();
} else if (version == 4) {
- flags = 0;
+ flags = stream.readByte();
unk1 = stream.readByte();
_shapeType = static_cast<ShapeType>(stream.readByte());
_initialRect = Score::readRect(stream);
@@ -545,6 +547,7 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
if (version < 4) {
error("Unhandled Script cast");
} else if (version == 4) {
+ byte flags = stream.readByte();
byte unk1 = stream.readByte();
byte type = stream.readByte();
@@ -564,7 +567,7 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
_id = stream.readUint32();
- debugC(4, kDebugLoading, "CASt: Script id: %d type: %s (%d) unk1: %d", _id, scriptType2str(_scriptType), type, unk1);
+ debugC(3, kDebugLoading, "CASt: Script id: %d type: %s (%d), flags: (%x), unk1: %d", _id, scriptType2str(_scriptType), type, flags, unk1);
stream.readByte(); // There should be no more data
assert(stream.eos());
diff --git a/engines/director/score-loading.cpp b/engines/director/score-loading.cpp
index e5d4709d6f..b90b96b4d1 100644
--- a/engines/director/score-loading.cpp
+++ b/engines/director/score-loading.cpp
@@ -737,11 +737,10 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
unk3 = stream.readByte();
} else if (_vm->getVersion() == 4) {
size1 = stream.readUint16();
- sizeToRead = size1 + 2 + 16; // 16 is for bounding rects
+ sizeToRead = size1 + 2 + 16 + 1; // 16 is for bounding rects + 1 is for moved _flag
size2 = stream.readUint32();
size3 = 0;
castType = stream.readByte();
- unk1 = stream.readByte();
} else if (_vm->getVersion() == 5) {
castType = stream.readUint32();
size3 = stream.readUint32();
More information about the Scummvm-git-logs
mailing list