[Scummvm-git-logs] scummvm master -> 15c0c68b1c533fc686de28173cef890c89ff1be1

ysj1173886760 42030331+ysj1173886760 at users.noreply.github.com
Thu Aug 12 09:03:43 UTC 2021


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:
dcabde4f8e DIRECTOR: release previous widget when setting new castmember.
e5af48a2ac GRAPHICS: MACGUI: fix getRowCol.
2dcf31f18c DIRECTOR: renderSprites in updateStage, delete the link from castmember to widget.
15c0c68b1c DIRECTOR: don't clear bbox when render trailed channel.


Commit: dcabde4f8eaffc29cec86594cef3fa71f5cdd896
    https://github.com/scummvm/scummvm/commit/dcabde4f8eaffc29cec86594cef3fa71f5cdd896
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-12T17:03:09+08:00

Commit Message:
DIRECTOR: release previous widget when setting new castmember.

Changed paths:
    engines/director/channel.cpp


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 242395aad4..c9fd8c5df9 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -297,6 +297,10 @@ Common::Rect Channel::getBbox(bool unstretched) {
 }
 
 void Channel::setCast(CastMemberID memberID) {
+	// release previous widget
+	if (_sprite->_cast)
+		_sprite->_cast->releaseWidget();
+
 	_sprite->setCast(memberID);
 	_width = _sprite->_width;
 	_height = _sprite->_height;


Commit: e5af48a2acf848cf54605c587fa02e59d11270db
    https://github.com/scummvm/scummvm/commit/e5af48a2acf848cf54605c587fa02e59d11270db
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-12T17:03:09+08:00

Commit Message:
GRAPHICS: MACGUI: fix getRowCol.
deal with out of bound error.

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 70b80193bb..c01e0cd127 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -2043,20 +2043,23 @@ void MacText::getRowCol(int x, int y, int *sx, int *sy, int *row, int *col) {
 	if (chunk == _textLines[nrow].chunks.size())
 		chunk--;
 
-	Common::U32String str = _textLines[nrow].chunks[chunk].text;
-
-	ncol = mcol;
-	nsx = pwidth;
+	// prevent out bounding error, because sometimes chunk.size() is 0, thus we don't have correct chunk number.
+	if (chunk < _textLines[nrow].chunks.size()) {
+		Common::U32String str = _textLines[nrow].chunks[chunk].text;
+
+		ncol = mcol;
+		nsx = pwidth;
+
+		for (int i = str.size(); i >= 0; i--) {
+			int strw = getStringWidth(_textLines[nrow].chunks[chunk], str);
+			if (strw + pwidth + alignOffset <= x) {
+				ncol = pmcol + i;
+				nsx = strw + pwidth;
+				break;
+			}
 
-	for (int i = str.size(); i >= 0; i--) {
-		int strw = getStringWidth(_textLines[nrow].chunks[chunk], str);
-		if (strw + pwidth + alignOffset <= x) {
-			ncol = pmcol + i;
-			nsx = strw + pwidth;
-			break;
+			str.deleteLastChar();
 		}
-
-		str.deleteLastChar();
 	}
 
 	if (sx)


Commit: 2dcf31f18c078a264e7132fed4d0e805486de31b
    https://github.com/scummvm/scummvm/commit/2dcf31f18c078a264e7132fed4d0e805486de31b
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-12T17:03:09+08:00

Commit Message:
DIRECTOR: renderSprites in updateStage, delete the link from castmember to widget.

Changed paths:
    engines/director/castmember.cpp
    engines/director/lingo/lingo-builtins.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 282bd205b9..c0affd54f7 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -769,8 +769,6 @@ Graphics::MacWidget *TextCastMember::createWidget(Common::Rect &bbox, Channel *c
 			if (activeWidget == nullptr || !activeWidget->isEditable())
 				g_director->_wm->setActiveWidget(widget);
 		}
-		// just a link to the widget which we created. we may use it later
-		_widget = widget;
 		break;
 
 	case kCastButton:
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 77e90f91a1..05e0137629 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -2284,6 +2284,7 @@ void LB::b_updateStage(int nargs) {
 
 	Score *score = movie->getScore();
 
+	score->renderSprites(score->getCurrentFrame());
 	if (movie->_videoPlayback)
 		score->renderVideo();
 


Commit: 15c0c68b1c533fc686de28173cef890c89ff1be1
    https://github.com/scummvm/scummvm/commit/15c0c68b1c533fc686de28173cef890c89ff1be1
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-12T17:03:09+08:00

Commit Message:
DIRECTOR: don't clear bbox when render trailed channel.

Changed paths:
    engines/director/channel.cpp
    engines/director/channel.h
    engines/director/window.cpp


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index c9fd8c5df9..66965ff6f6 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -556,6 +556,10 @@ bool Channel::updateWidget() {
 	return false;
 }
 
+bool Channel::isTrail() {
+	return _sprite->_trails;
+}
+
 void Channel::addRegistrationOffset(Common::Point &pos, bool subtract) {
 	if (!_sprite->_cast)
 		return;
diff --git a/engines/director/channel.h b/engines/director/channel.h
index d2fd981e8a..62e80a1247 100644
--- a/engines/director/channel.h
+++ b/engines/director/channel.h
@@ -66,6 +66,8 @@ public:
 	bool updateWidget();
 	void updateTextCast();
 
+	bool isTrail();
+
 	void updateGlobalAttr();
 
 	void addDelta(Common::Point pos);
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index b8a15614b8..cf62d7073f 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -39,7 +39,6 @@
 #include "director/sound.h"
 #include "director/sprite.h"
 #include "director/util.h"
-#include "director/sound.h"
 
 namespace Director {
 
@@ -139,9 +138,19 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
 
 	for (Common::List<Common::Rect>::iterator i = _dirtyRects.begin(); i != _dirtyRects.end(); i++) {
 		const Common::Rect &r = *i;
-		blitTo->fillRect(r, _stageColor);
-
 		_dirtyChannels = _currentMovie->getScore()->getSpriteIntersections(r);
+
+		bool shouldClear = true;
+		for (Common::List<Channel *>::iterator j = _dirtyChannels.begin(); j != _dirtyChannels.end(); j++) {
+			if ((*j)->_visible && r == (*j)->getBbox() && (*j)->isTrail()) {
+				shouldClear = false;
+				break;
+			}
+		}
+
+		if (shouldClear)
+			blitTo->fillRect(r, _stageColor);
+
 		for (int pass = 0; pass < 2; pass++) {
 			for (Common::List<Channel *>::iterator j = _dirtyChannels.begin(); j != _dirtyChannels.end(); j++) {
 				if ((*j)->isActiveVideo() && (*j)->isVideoDirectToStage()) {




More information about the Scummvm-git-logs mailing list