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

sev- sev at scummvm.org
Sun Nov 24 17:43:15 UTC 2019


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

Summary:
9ecc24979c DIRECTOR: Properly initialize cached text
8ecb3207ed DIRECTOR: JANITORIAL: Fix whitespace
2e67303716 DIRECTOR: More debug output to cast rendering
f4ad804eca DIRECTOR: Implemented invalidation of cached text
8efad56968 DIRECTOR: Disable for now precompiled script execution from Lscr resources
663b8d61fb DIRECTOR: Properly load A11 script and STXT resources
8f7df6230e MACGUI: Recognise the fact that Geneva font lives with 2 IDs
6a650e10b1 DIRECTOR: Attach texts to buttons. Now HandV works again


Commit: 9ecc24979cb9991d527fc728118df21454cd2a44
    https://github.com/scummvm/scummvm/commit/9ecc24979cb9991d527fc728118df21454cd2a44
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
DIRECTOR: Properly initialize cached text

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


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index fe0f72d..a3950c0 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -133,7 +133,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
 				warning("TextCast: t: %x", t);
 			}
 
-			initialRect = Score::readRect(stream); 
+			initialRect = Score::readRect(stream);
 		}
 
 		textShadow = static_cast<SizeType>(stream.readByte());
@@ -179,11 +179,11 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
 		fontSize = 12;
 
 		stream.readUint32();
-		stream.readUint32(); 
+		stream.readUint32();
 		stream.readUint32();
 		stream.readUint32();
 		uint16 skip = stream.readUint16();
-		for (int i = 0; i < skip; i++) 
+		for (int i = 0; i < skip; i++)
 			stream.readUint32();
 
 		stream.readUint32();
@@ -203,7 +203,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
 
 	modified = 0;
 
-	cachedMacText = new CachedMacText(this, version);
+	cachedMacText = new CachedMacText(this, version, -1, g_director->_wm);
 	// TODO Destroy me
 }
 
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 1054b08..c22bb05 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -789,7 +789,6 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
 	//uint32 rectTop = textCast->initialRect.top;
 
 	textCast->cachedMacText->clip(width);
-	textCast->cachedMacText->setWm(_vm->_wm); // TODO this is not a good place to do it
 	const Graphics::ManagedSurface *textSurface = textCast->cachedMacText->getSurface();
 
 	if (!textSurface)


Commit: 8ecb3207eddc938b872ce90b9daa4db518337ace
    https://github.com/scummvm/scummvm/commit/8ecb3207eddc938b872ce90b9daa4db518337ace
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
DIRECTOR: JANITORIAL: Fix whitespace

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


diff --git a/engines/director/cachedmactext.cpp b/engines/director/cachedmactext.cpp
index 51ee910..fecd9e9 100644
--- a/engines/director/cachedmactext.cpp
+++ b/engines/director/cachedmactext.cpp
@@ -39,21 +39,23 @@ void CachedMacText::makeMacText() {
 		_align = (Graphics::TextAlign)((int)_textCast->textAlign + 1);
 
 	_macText = new Graphics::MacText(_textCast->_ftext,
-	                                 _wm,
-	                                 _macFont,
-	                                 0x00,
-	                                 0xff,
-	                                 _width,
-	                                 _align,
-	                                 1);
+										_wm,
+										_macFont,
+										0x00,
+										0xff,
+										_width,
+										_align,
+										1);
 	// TODO destroy me
+
+	debug(5, "CachedMacText::makeMacText(): rendering '%s'", _textCast->_ftext.c_str());
 }
 
 CachedMacText::CachedMacText(TextCast *const textCast,
-                             int version,
-                             int defaultWidth,
-                             Graphics::MacWindowManager *const wm
-                            )
+								int version,
+								int defaultWidth,
+								Graphics::MacWindowManager *const wm
+								)
 	:
 	_surface(NULL), _macFont(NULL),
 	_macText(NULL), _width(defaultWidth), _dirty(true), _textCast(textCast),
diff --git a/engines/director/cachedmactext.h b/engines/director/cachedmactext.h
index 87d632b..8adf275 100644
--- a/engines/director/cachedmactext.h
+++ b/engines/director/cachedmactext.h
@@ -47,18 +47,17 @@ private:
 	bool _dirty;
 	Graphics::ManagedSurface *_surface;
 	void makeMacText();
+
 public:
 	CachedMacText(TextCast *const textCast,
-	              int version,
-	              int defaultWidth = -1,
-	              Graphics::MacWindowManager *const wm = NULL
-	             );
+					int version,
+					int defaultWidth = -1,
+					Graphics::MacWindowManager *const wm = NULL);
 	void setWm(Graphics::MacWindowManager *wm);
 	void clip(int width);
 	void forceDirty();
 	const Graphics::ManagedSurface *getSurface();
 	int getLineCount();
-
 };
 
 } // End of namespace Director
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index e593f87..231efae 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -596,7 +596,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
 		size2 = stream.readUint32();
 		size1 = stream.readUint32();
 		if (castType == 1) {
-			if (size3 == 0) 
+			if (size3 == 0)
 				return;
 			for (uint32 skip = 0; skip < (size1 - 4) / 4; skip++)
 				stream.readUint32();


Commit: 2e67303716a4c8be0c5f4db181d72de3c6a83f7a
    https://github.com/scummvm/scummvm/commit/2e67303716a4c8be0c5f4db181d72de3c6a83f7a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
DIRECTOR: More debug output to cast rendering

Changed paths:
    engines/director/frame.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index c22bb05..b7743ae 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -776,7 +776,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
 
 	Graphics::MacFont *macFont = new Graphics::MacFont(textCast->fontId, textCast->fontSize, textCast->textSlant);
 
-	debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str());
+	debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s' text: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(*macFont).c_str(), textCast->_ftext.c_str());
 
 	uint16 boxShadow = (uint16)textCast->boxShadow;
 	uint16 borderSize = (uint16)textCast->borderSize;


Commit: f4ad804ecac82202ba4eee1b7bf7e9ca8ed13394
    https://github.com/scummvm/scummvm/commit/f4ad804ecac82202ba4eee1b7bf7e9ca8ed13394
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
DIRECTOR: Implemented invalidation of cached text

Changed paths:
    engines/director/cachedmactext.cpp


diff --git a/engines/director/cachedmactext.cpp b/engines/director/cachedmactext.cpp
index fecd9e9..a479376 100644
--- a/engines/director/cachedmactext.cpp
+++ b/engines/director/cachedmactext.cpp
@@ -33,6 +33,8 @@ void CachedMacText::makeMacText() {
 	assert(_width != -1);
 	assert(_wm != NULL);
 
+	delete _macText;
+
 	if ((int)_textCast->textAlign == -1)
 		_align = (Graphics::TextAlign)3;
 	else
@@ -96,8 +98,9 @@ void CachedMacText::clip(int width) {
 }
 
 void CachedMacText::forceDirty() {
-	// STUB
-	assert(false);
+	_dirty = true;
+
+	makeMacText();
 }
 
 const Graphics::ManagedSurface *CachedMacText::getSurface() {


Commit: 8efad569686c206fbca0be9974c71dbeee035a83
    https://github.com/scummvm/scummvm/commit/8efad569686c206fbca0be9974c71dbeee035a83
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
DIRECTOR: Disable for now precompiled script execution from Lscr resources

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 231efae..cd91589 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -193,7 +193,7 @@ void Score::loadArchive() {
 	}
 
 	// Try to load compiled Lingo scripts
-	if (_vm->getVersion() >= 4) {
+	if (_vm->getVersion() >= 4 && 0) {
 		Common::Array<uint16> lscr =  _movieArchive->getResourceIDList(MKTAG('L','s','c','r'));
 		if (lscr.size() > 0) {
 			debugC(2, kDebugLoading, "****** Loading %d Lscr resources", lscr.size());


Commit: 663b8d61fb9867ede25752f9436d51ff03be52f8
    https://github.com/scummvm/scummvm/commit/663b8d61fb9867ede25752f9436d51ff03be52f8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
DIRECTOR: Properly load A11 script and STXT resources

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index cd91589..82b09e8 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -204,24 +204,22 @@ void Score::loadArchive() {
 		}
 	}
 
+	// Now process STXTs
+	Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
+
 	// Try to load movie script, it sits in resource A11
 	if (_vm->getVersion() <= 3) {
-		Common::Array<uint16> stxt = _movieArchive->getResourceIDList(MKTAG('S','T','X','T'));
 		if (stxt.size() > 0) {
-			debugC(2, kDebugLoading, "****** Loading %d STXT resources", stxt.size());
-
-			for (Common::Array<uint16>::iterator iterator = stxt.begin(); iterator != stxt.end(); ++iterator) {
-				loadScriptText(*_movieArchive->getResource(MKTAG('S','T','X','T'), *iterator));
-				// Load STXTS
-
-				_loadedStxts->setVal(*iterator,
-									 new Stxt(*_movieArchive->getResource(MKTAG('S','T','X','T'),
-																		  *iterator))
-									 );
-			}
+			loadScriptText(*_movieArchive->getResource(MKTAG('S','T','X','T'), *stxt.begin()));
 		}
-		copyCastStxts();
 	}
+
+	debugC(2, kDebugLoading, "****** Loading %d STXT resources", stxt.size());
+	for (Common::Array<uint16>::iterator iterator = stxt.begin(); iterator != stxt.end(); ++iterator) {
+		_loadedStxts->setVal(*iterator,
+				 new Stxt(*_movieArchive->getResource(MKTAG('S','T','X','T'), *iterator)));
+	}
+	copyCastStxts();
 }
 
 void Score::copyCastStxts() {


Commit: 8f7df6230ea9cb6b985ffe22c2fe354704251f01
    https://github.com/scummvm/scummvm/commit/8f7df6230ea9cb6b985ffe22c2fe354704251f01
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
MACGUI: Recognise the fact that Geneva font lives with 2 IDs

Changed paths:
    graphics/macgui/macfontmanager.cpp


diff --git a/graphics/macgui/macfontmanager.cpp b/graphics/macgui/macfontmanager.cpp
index 92cb63b..8c35220 100644
--- a/graphics/macgui/macfontmanager.cpp
+++ b/graphics/macgui/macfontmanager.cpp
@@ -340,6 +340,9 @@ void MacFontManager::clearFontMapping() {
 const Common::String MacFontManager::getFontName(int id, int size, int slant, bool tryGen) {
 	Common::String n;
 
+	if (id == 3) // This is Geneva
+		id = 1;
+
 	if (_extraFontNames.contains(id)) {
 		n = _extraFontNames[id];
 	} else if (id < ARRAYSIZE(fontNames)) {


Commit: 6a650e10b1fed68e52134f6959bda5f560eebe06
    https://github.com/scummvm/scummvm/commit/6a650e10b1fed68e52134f6959bda5f560eebe06
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-24T18:42:45+01:00

Commit Message:
DIRECTOR: Attach texts to buttons. Now HandV works again

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 82b09e8..6315a5b 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -223,14 +223,33 @@ void Score::loadArchive() {
 }
 
 void Score::copyCastStxts() {
+	debugC(2, kDebugLoading,"######### copyCastStxts(), %d texts", _loadedText->size());
 	Common::HashMap<int, TextCast *>::iterator tc;
 	for (tc = _loadedText->begin(); tc != _loadedText->end(); ++tc) {
 		uint stxtid = (_vm->getVersion() < 4) ?
 			tc->_key + 1024 :
 			tc->_value->children[0].index;
-		if (_loadedStxts->getVal(stxtid)){
+		if (_loadedStxts->getVal(stxtid)) {
+			debugC(3, kDebugLoading,"Yes to STXT: %d", stxtid);
 			const Stxt *stxt = _loadedStxts->getVal(stxtid);
 			tc->_value->importStxt(stxt);
+		} else {
+			debugC(3, "No to STXT: %d", stxtid);
+		}
+	}
+
+	debugC(2, kDebugLoading,"######### copyCastStxts(), %d buttons", _loadedButtons->size());
+	Common::HashMap<int, ButtonCast *>::iterator bc;
+	for (bc = _loadedButtons->begin(); bc != _loadedButtons->end(); ++bc) {
+		uint stxtid = (_vm->getVersion() < 4) ?
+			bc->_key + 1024 :
+			bc->_value->children[0].index;
+		if (_loadedStxts->getVal(stxtid)) {
+			debugC(3, "Yes to STXT: %d", stxtid);
+			const Stxt *stxt = _loadedStxts->getVal(stxtid);
+			bc->_value->importStxt(stxt);
+		} else {
+			debugC(3, "No to STXT: %d", stxtid);
 		}
 	}
 }




More information about the Scummvm-git-logs mailing list