[Scummvm-git-logs] scummvm master -> 6ef67b9186535f8058dabfbbd181ad3ad032e079

sev- sev at scummvm.org
Tue Oct 18 11:50:18 CEST 2016


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
01cf3d2ebd GRAPHICS: Remove debug leftover
0eac022f55 DIRECTOR: Added debug chanel for text rendering
e19cb15943 GRAPHICS: Declared few methods in MacFontManager public
6ef67b9186 DIRECTOR: Further work on text cast loading and rendering


Commit: 01cf3d2ebd7e4b189121a4818dae19ccad52bfbd
    https://github.com/scummvm/scummvm/commit/01cf3d2ebd7e4b189121a4818dae19ccad52bfbd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-18T11:50:12+02:00

Commit Message:
GRAPHICS: Remove debug leftover

Changed paths:
    graphics/fonts/bdf.cpp



diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp
index e109d07..6049f9a 100644
--- a/graphics/fonts/bdf.cpp
+++ b/graphics/fonts/bdf.cpp
@@ -731,8 +731,6 @@ BdfFont *BdfFont::scaleFont(BdfFont *src, int newSize) {
 	BdfBoundingBox *boxes = new BdfBoundingBox[data.numCharacters];
 	for (int i = 0; i < data.numCharacters; ++i) {
 		boxes[i].width = (int)((float)src->_data.boxes[i].width * scale);
-		if (i == 40)
-			warning("char w: %d, scale: %g", boxes[i].width, scale);
 		boxes[i].height = (int)((float)src->_data.boxes[i].height * scale);
 		boxes[i].xOffset = (int)((float)src->_data.boxes[i].xOffset * scale);
 		boxes[i].yOffset = (int)((float)src->_data.boxes[i].yOffset * scale);


Commit: 0eac022f554469846fe5c752a650f668133ae4a1
    https://github.com/scummvm/scummvm/commit/0eac022f554469846fe5c752a650f668133ae4a1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-18T11:50:12+02:00

Commit Message:
DIRECTOR: Added debug chanel for text rendering

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



diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 848eaa9..43c5602 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -39,6 +39,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
 	DebugMan.addDebugChannel(kDebugLingoCompile, "lingocompile", "Lingo Compilation");
 	DebugMan.addDebugChannel(kDebugLoading, "loading", "Loading");
 	DebugMan.addDebugChannel(kDebugImages, "images", "Image drawing");
+	DebugMan.addDebugChannel(kDebugText, "text", "Text rendering");
 
 	if (!_mixer->isReady())
 		error("Sound initialization failed");
diff --git a/engines/director/director.h b/engines/director/director.h
index 7c65897..f64b87b 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -55,7 +55,8 @@ enum {
 	kDebugLingoExec		= 1 << 0,
 	kDebugLingoCompile	= 1 << 1,
 	kDebugLoading		= 1 << 2,
-	kDebugImages		= 1 << 3
+	kDebugImages		= 1 << 3,
+	kDebugText			= 1 << 4
 };
 
 
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 2eaddc5..53b7502 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -586,9 +586,9 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
 	} else {
 		textStream = _vm->getSharedSTXT()->getVal(spriteID + 1024);
 	}
-	/*uint32 unk1 = */ textStream->readUint32();
+	uint32 unk1 = textStream->readUint32();
 	uint32 strLen = textStream->readUint32();
-	/*uin32 dataLen = */ textStream->readUint32();
+	uint32 dataLen = textStream->readUint32();
 	Common::String text;
 
 	for (uint32 i = 0; i < strLen; i++) {
@@ -599,6 +599,8 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
 		text += ch;
 	}
 
+	debugC(3, kDebugText, "renderText: unk1: %d strLen: %d dataLen: %d textlen: %d", unk1, strLen, dataLen, text.size());
+
 	uint32 rectLeft = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.left;
 	uint32 rectTop = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.top;
 


Commit: e19cb159430d4672c16865263c729a689e9e98cf
    https://github.com/scummvm/scummvm/commit/e19cb159430d4672c16865263c729a689e9e98cf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-18T11:50:12+02:00

Commit Message:
GRAPHICS: Declared few methods in MacFontManager public

Changed paths:
    graphics/macgui/macfontmanager.h



diff --git a/graphics/macgui/macfontmanager.h b/graphics/macgui/macfontmanager.h
index e429eea..09fd0ae 100644
--- a/graphics/macgui/macfontmanager.h
+++ b/graphics/macgui/macfontmanager.h
@@ -105,9 +105,6 @@ public:
 	 */
 	const Font *getFont(MacFont macFont);
 
-private:
-	void loadFonts();
-
 	/**
 	 * Return font name from standard ID
 	 * @param id ID of the font
@@ -117,6 +114,9 @@ private:
 	const char *getFontName(int id, int size, int slant = kMacFontRegular);
 	const char *getFontName(MacFont &font);
 
+private:
+	void loadFonts();
+
 	void generateFontSubstitute(MacFont &macFont);
 	void generateFont(MacFont &toFont, MacFont &fromFont);
 


Commit: 6ef67b9186535f8058dabfbbd181ad3ad032e079
    https://github.com/scummvm/scummvm/commit/6ef67b9186535f8058dabfbbd181ad3ad032e079
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-18T11:50:12+02:00

Commit Message:
DIRECTOR: Further work on text cast loading and rendering

Changed paths:
    engines/director/frame.cpp
    engines/director/score.cpp
    engines/director/score.h



diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 53b7502..0ce7f2b 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -599,7 +599,9 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
 		text += ch;
 	}
 
-	debugC(3, kDebugText, "renderText: unk1: %d strLen: %d dataLen: %d textlen: %d", unk1, strLen, dataLen, text.size());
+	debugC(3, kDebugText, "renderText: unk1: %d strLen: %d dataLen: %d textlen: %u", unk1, strLen, dataLen, text.size());
+	if (strLen < 200)
+		debugC(3, kDebugText, "text: '%s'", text.c_str());
 
 	uint32 rectLeft = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.left;
 	uint32 rectTop = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.top;
@@ -618,6 +620,8 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) {
 
 	const Graphics::Font *font = _vm->_wm->_fontMan->getFont(macFont);
 
+	debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(macFont));
+
 	font->drawString(&surface, text, x, y, width, 0);
 
 	if (textCast->borderSize != kSizeNone) {
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index c95aae1..5c594c2 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -714,13 +714,15 @@ BitmapCast::BitmapCast(Common::SeekableSubReadStreamEndian &stream) {
 }
 
 TextCast::TextCast(Common::SeekableSubReadStreamEndian &stream) {
-	/*byte flags =*/ stream.readByte();
+	flags1 = stream.readByte();
 	borderSize = static_cast<SizeType>(stream.readByte());
 	gutterSize = static_cast<SizeType>(stream.readByte());
 	boxShadow = static_cast<SizeType>(stream.readByte());
 	textType = static_cast<TextType>(stream.readByte());
 	textAlign = static_cast<TextAlignType>(stream.readUint16());
-	stream.skip(6); //palinfo
+	palinfo1 = stream.readUint16();
+	palinfo2 = stream.readUint16();
+	palinfo3 = stream.readUint16();
 
 	int t = stream.readUint32();
 	assert(t == 0); // So far we saw only 0 here
@@ -734,6 +736,8 @@ TextCast::TextCast(Common::SeekableSubReadStreamEndian &stream) {
 		textFlags.push_back(kTextFlagAutoTab);
 	if (flags & 0x4)
 		textFlags.push_back(kTextFlagDoNotWrap);
+	if (flags & 0xf8)
+		warning("Unproxessed text cast flags: %x", flags & 0xf8);
 
 	// TODO: FIXME: guesswork
 	fontId = stream.readByte();
diff --git a/engines/director/score.h b/engines/director/score.h
index ad07b6d..b5c66d1 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -132,12 +132,14 @@ struct TextCast : Cast {
 	SizeType gutterSize;
 	SizeType boxShadow;
 
+	byte flags1;
 	uint32 fontId;
 	uint16 fontSize;
 	TextType textType;
 	TextAlignType textAlign;
 	SizeType textShadow;
 	Common::Array<TextFlag> textFlags;
+	int16 palinfo1, palinfo2, palinfo3;
 };
 
 enum ButtonType {





More information about the Scummvm-git-logs mailing list