[Scummvm-git-logs] scummvm master -> 939b7ed885754e2a513e8b8498715f52d14dbaa3
sev-
sev at scummvm.org
Wed Nov 9 19:07:07 CET 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fc1633513d DIRECTOR: Parse script CASt resources
939b7ed885 DIRECTOR: More debug information to CASt loading
Commit: fc1633513d715fbba1c08a4016077aaf5ce3ee5b
https://github.com/scummvm/scummvm/commit/fc1633513d715fbba1c08a4016077aaf5ce3ee5b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-09T19:06:49+01:00
Commit Message:
DIRECTOR: Parse script CASt resources
Changed paths:
engines/director/cast.cpp
engines/director/cast.h
engines/director/score.cpp
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 2e4e2c9..667fc24 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -20,9 +20,7 @@
*
*/
-#include "common/array.h"
-#include "common/hashmap.h"
-
+#include "director/director.h"
#include "director/cast.h"
#include "director/score.h"
@@ -45,8 +43,8 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint16 version) {
} else {
initialRect = Score::readRect(stream);
boundingRect = Score::readRect(stream);
- regX = 0; // FIXME: HACK
- regY = 0; // FIXME: HACK
+ regX = stream.readUint16();
+ regY = stream.readUint16();
}
modified = 0;
}
@@ -83,7 +81,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
fontSize = stream.readByte();
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
}
modified = 0;
@@ -103,7 +101,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
lineDirection = stream.readByte();
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
}
modified = 0;
}
@@ -113,7 +111,7 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC
buttonType = static_cast<ButtonType>(stream.readUint16BE());
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
}
modified = 0;
}
@@ -123,7 +121,14 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
error("Unhandled Script cast");
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
+
+ id = stream.readUint32();
+
+ debugC(4, kDebugLoading, "CASt: Script id: %d", id);
+
+ stream.readByte(); // There should be no more data
+ assert(stream.eos());
}
modified = 0;
}
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 82651a7..69edf8c 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -45,13 +45,14 @@ enum CastType {
struct Cast {
CastType type;
Common::Rect initialRect;
+ Common::Rect boundingRect;
+
byte modified;
};
struct BitmapCast : Cast {
BitmapCast(Common::ReadStreamEndian &stream, uint16 version = 2);
- Common::Rect boundingRect;
uint16 regX;
uint16 regY;
uint8 flags;
@@ -136,6 +137,8 @@ struct ButtonCast : TextCast {
struct ScriptCast : Cast {
ScriptCast(Common::ReadStreamEndian &stream, uint16 version = 2);
+
+ uint32 id;
};
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index f2cd673..294b865 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -463,9 +463,6 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
_casts[id]->type = kCastButton;
break;
case kCastScript:
- warning("CASt: Script");
- Common::hexdump(data, size1 + 16);
-
_casts[id] = new ScriptCast(castStream, _vm->getVersion());
_casts[id]->type = kCastScript;
break;
Commit: 939b7ed885754e2a513e8b8498715f52d14dbaa3
https://github.com/scummvm/scummvm/commit/939b7ed885754e2a513e8b8498715f52d14dbaa3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-09T19:06:49+01:00
Commit Message:
DIRECTOR: More debug information to CASt loading
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 294b865..66e5e2a 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -409,14 +409,16 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
stream.hexdump(stream.size());
uint32 size1, size2, size3, castType;
- byte blob[3];
+ byte unk1 = 0, unk2 = 0, unk3 = 0;
if (_vm->getVersion() < 5) {
size1 = stream.readUint16();
size2 = stream.readUint32();
size3 = 0;
castType = stream.readByte();
- stream.read(blob, 3);
+ unk1 = stream.readByte();
+ unk2 = stream.readByte();
+ unk3 = stream.readByte();
} else {
// FIXME: only the cast type and the strings are good
castType = stream.readUint32();
@@ -425,12 +427,12 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
size1 = stream.readUint32();
assert(size1 == 0x14);
size1 = 0;
- blob[0] = blob[1] = blob[2] = 0;
}
- debugC(3, kDebugLoading, "CASt: id: %d type: %x size1: %d size2: %d (%x) size3: %d", id, castType, size1, size2, size2, size3);
+ debugC(3, kDebugLoading, "CASt: id: %d type: %x size1: %d size2: %d (%x) size3: %d unk1: %d unk2: %d unk3: %d",
+ id, castType, size1, size2, size2, size3, unk1, unk2, unk3);
- byte *data = (byte *)malloc(size1 + 16);
+ byte *data = (byte *)calloc(size1 + 16, 1);
stream.read(data, size1 + 16);
Common::MemoryReadStreamEndian castStream(data, size1 + 16, stream.isBE());
More information about the Scummvm-git-logs
mailing list