[Scummvm-git-logs] scummvm master -> 5c985ab549ae9ac2c47bf32f7951fca80db071f1

sev- sev at scummvm.org
Wed Jan 11 19:45:40 CET 2017


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:
a1500016ff DIRECTOR: Process Cast scripts when dumping
5c985ab549 DIRECTOR: Fix warnings


Commit: a1500016ff26b59619fe90bf20c37a4ad582a07f
    https://github.com/scummvm/scummvm/commit/a1500016ff26b59619fe90bf20c37a4ad582a07f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-11T19:40:37+01:00

Commit Message:
DIRECTOR: Process Cast scripts when dumping

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 3fab9cf..2b74650 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -510,14 +510,14 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
 		debugC(4, kDebugLoading, "'");
 
 		CastInfo *ci = new CastInfo();
-		
+
 		if (castStrings.size() == 5) {
 			ci->script = castStrings[0];
 			ci->name = castStrings[1];
 			ci->directory = castStrings[2];
 			ci->fileName = castStrings[3];
 			ci->type = castStrings[4];
-		
+
 			if (!ci->script.empty()) {
 				//the script type here could be wrong!
 				_lingo->addCode(ci->script.c_str(), kCastScript, id);
@@ -674,6 +674,9 @@ void Score::dumpScript(const char *script, ScriptType type, uint16 id) {
 	case kSpriteScript:
 		typeName = "sprite";
 		break;
+	case kCastScript:
+		typeName = "cast";
+		break;
 	}
 
 	sprintf(buf, "./dumps/%s-%s-%d.txt", _macName.c_str(), typeName.c_str(), id);


Commit: 5c985ab549ae9ac2c47bf32f7951fca80db071f1
    https://github.com/scummvm/scummvm/commit/5c985ab549ae9ac2c47bf32f7951fca80db071f1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-11T19:45:23+01:00

Commit Message:
DIRECTOR: Fix warnings

Changed paths:
    engines/director/cast.cpp
    engines/director/frame.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 1434419..a3c5800 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -86,7 +86,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
 		if (flags & 0x4)
 			textFlags.push_back(kTextFlagDoNotWrap);
 		if (flags & 0xf8)
-			warning("Unproxessed text cast flags: %x", flags & 0xf8);
+			warning("Unprocessed text cast flags: %x", flags & 0xf8);
 
 		// TODO: FIXME: guesswork
 		fontId = stream.readByte();
@@ -108,6 +108,10 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
 		stream.readUint16();
 		textShadow = static_cast<SizeType>(stream.readByte());
 		byte flags = stream.readByte();
+
+		if (flags)
+			warning("Unproxessed text cast flags: %x", flags);
+
 		fontSize = stream.readUint16();
 	} else {
 		initialRect = Score::readRect(stream);
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 4de017b..6978c57 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -638,9 +638,9 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
 }
 
 void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteID) {
-	Common::Rect r = Common::Rect(_sprites[spriteID]->_startPoint.x, 
+	Common::Rect r = Common::Rect(_sprites[spriteID]->_startPoint.x,
 		_sprites[spriteID]->_startPoint.y,
-		_sprites[spriteID]->_startPoint.x + _sprites[spriteID]->_width, 
+		_sprites[spriteID]->_startPoint.x + _sprites[spriteID]->_width,
 		_sprites[spriteID]->_startPoint.y + _sprites[spriteID]->_height);
 
 	Graphics::Surface tmpSurface;
@@ -743,7 +743,7 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
 		pic = _vm->_currentScore->getArchive()->getResource(MKTAG('B', 'I', 'T', 'D'), imgId);
 		bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]);
 	}
-		 
+
 	if (pic != NULL && bc != NULL) {
 		if (_vm->getVersion() < 4) {
 			int w = bc->initialRect.width(), h = bc->initialRect.height();
@@ -752,7 +752,7 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) {
 				imgId, w, h, bc->flags, bc->someFlaggyThing, bc->unk1, bc->unk2);
 			img = new BITDDecoder(w, h);
 		} else if (_vm->getVersion() < 6) {
-			BitmapCast *bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]);
+			bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]);
 			int w = bc->initialRect.width(), h = bc->initialRect.height();
 
 			debugC(2, kDebugImages, "id: %d, w: %d, h: %d, flags: %x, some: %x, unk1: %d, unk2: %d",
@@ -797,8 +797,9 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, uint1
 }
 
 void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Common::SeekableSubReadStreamEndian *textStream, bool isButtonLabel) {
-	if (textStream == NULL) return; 
-	
+	if (textStream == NULL)
+		return;
+
 	uint16 castID = _sprites[spriteID]->_castId;
 	TextCast *textCast = static_cast<TextCast *>(_vm->_currentScore->_casts[castID]);
 
@@ -824,6 +825,9 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Commo
 		uint32 b = textStream->readUint32();
 		uint16 c = textStream->readUint16();
 		uint16 d = textStream->readUint16();
+
+		debugC(3, kDebugText, "text: a: %x b: %x c: %x d: %x", a, b, c, d);
+
 		textCast->fontId = textStream->readUint16();
 		textCast->textSlant = textStream->readByte();
 		textStream->readByte();
@@ -839,8 +843,8 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Commo
 	uint16 padding = (uint16)textCast->gutterSize;
 	uint16 textShadow = (uint16)textCast->textShadow;
 
-	uint32 rectLeft = textCast->initialRect.left;
-	uint32 rectTop = textCast->initialRect.top;
+	//uint32 rectLeft = textCast->initialRect.left;
+	//uint32 rectTop = textCast->initialRect.top;
 
 	int x = _sprites[spriteID]->_startPoint.x; // +rectLeft;
 	int y = _sprites[spriteID]->_startPoint.y; // +rectTop;
@@ -866,7 +870,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Commo
 	int alignment = (int)textCast->textAlign;
 	if (alignment == -1) alignment = 3;
 	else alignment++;
-	
+
 	uint16 textX = x, textY = y;
 	if (!isButtonLabel) {
 		if (borderSize > 0) {
@@ -902,7 +906,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID, Commo
 		return;
 
 	uint16 borderX = x + borderSize - 1, borderY = y + borderSize - 1, borderHeight = height, borderWidth = width;
-	if (borderSize != kSizeNone) {		
+	if (borderSize != kSizeNone) {
 		while (borderSize) {
 			borderWidth += 2;
 			borderHeight += 2;





More information about the Scummvm-git-logs mailing list