[Scummvm-git-logs] scummvm master -> 91409d2cc1cf48318106cdd2667e1adec84a504e

npjg nathanael.gentrydb8 at gmail.com
Thu Jul 16 22:40:22 UTC 2020


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

Summary:
19e6c4666e DIRECTOR: Remove redundant palette search
a292aab351 GRAPHICS: MACGUI: Add missing window manager assignment
0e6750d90c DIRECTOR: Load palettes from shared casts
93d9bf4671 DIRECTOR: Add partial set-clean rendering mode
91409d2cc1 GRAPHICS: MACGUI: MacWidget: Handle priorities properly


Commit: 19e6c4666e8f71bc87758d8593b6f66e47416146
    https://github.com/scummvm/scummvm/commit/19e6c4666e8f71bc87758d8593b6f66e47416146
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-16T18:32:44-04:00

Commit Message:
DIRECTOR: Remove redundant palette search

This is done per-chunk in MacText.

Changed paths:
    engines/director/castmember.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 46a475d398..ca31755029 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -462,8 +462,6 @@ void TextCastMember::importStxt(const Stxt *stxt) {
 	_fgpalinfo3 = stxt->_style.b;
 	_ftext = stxt->_ftext;
 	_ptext = stxt->_ptext;
-
-	_fgcolor = g_director->_wm->findBestColor(_fgpalinfo1 & 0xff, _fgpalinfo2 & 0xff, _fgpalinfo3 & 0xff);
 }
 
 void TextCastMember::createWidget() {


Commit: a292aab35101f7b7f39479a6fb472462bc4cb06e
    https://github.com/scummvm/scummvm/commit/a292aab35101f7b7f39479a6fb472462bc4cb06e
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-16T18:36:24-04:00

Commit Message:
GRAPHICS: MACGUI: Add missing window manager assignment

Changed paths:
    graphics/macgui/mactext.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 0b44fb19a9..ae6016edbc 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -100,6 +100,7 @@ MacText::MacText(MacWidget *parent, int x, int y, int w, int h, MacWindowManager
 	_str = s;
 	_fullRefresh = true;
 
+	_wm = wm;
 	_macFont = macFont;
 	_fgcolor = fgcolor;
 	_bgcolor = bgcolor;


Commit: 0e6750d90cae04028661e709cba269cd75699bb5
    https://github.com/scummvm/scummvm/commit/0e6750d90cae04028661e709cba269cd75699bb5
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-16T18:36:33-04:00

Commit Message:
DIRECTOR: Load palettes from shared casts

Changed paths:
    engines/director/cast.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index b3dca8c1a8..f4758e1220 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -205,22 +205,19 @@ bool Cast::loadArchive() {
 		_movie->_stageColor = 1;
 	}
 
-	if (!_isShared) {
-		// TODO: Can shared casts have palettes?
-		if (clutList.size() > 1)
-			warning("More than one palette was found (%d)", clutList.size());
+	if (clutList.size() > 1)
+		warning("More than one palette was found (%d)", clutList.size());
 
-		if (clutList.size() == 0) {
-			warning("CLUT resource not found, using default Mac palette");
-			_vm->setPalette(-1);
-		} else {
-			Common::SeekableSubReadStreamEndian *pal = _castArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]);
+	if (clutList.size() == 0) {
+		warning("CLUT resource not found, using default Mac palette");
+		_vm->setPalette(-1);
+	} else {
+		Common::SeekableSubReadStreamEndian *pal = _castArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]);
 
-			debugC(2, kDebugLoading, "****** Loading Palette CLUT, #%d", clutList[0]);
-			loadPalette(*pal);
+		debugC(2, kDebugLoading, "****** Loading Palette CLUT, #%d", clutList[0]);
+		loadPalette(*pal);
 
-			delete pal;
-		}
+		delete pal;
 	}
 
 	// Font Directory


Commit: 93d9bf4671a452046b6416ebbc60ff31f7390514
    https://github.com/scummvm/scummvm/commit/93d9bf4671a452046b6416ebbc60ff31f7390514
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-16T18:36:33-04:00

Commit Message:
DIRECTOR: Add partial set-clean rendering mode

This is a mode for when the script or other internal parameters of a sprite have
changed, but nothing on screen should change. This also ensures that cast
widgets are properly updated with new priorities on each frame.

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


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 9e5152845f..2f7dbdafe5 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -146,32 +146,39 @@ Common::Rect Channel::getBbox(bool unstretched) {
 	return result;
 }
 
-void Channel::setClean(Sprite *nextSprite, int spriteId) {
+void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
 	if (!nextSprite)
 		return;
 
 	bool newSprite = (_sprite->_spriteType == kInactiveSprite && nextSprite->_spriteType != kInactiveSprite);
 	_dirty = false;
 
-	if (!_sprite->_puppet) {
-		_sprite = nextSprite;
-		_sprite->updateCast();
-
-		// Sprites marked moveable are constrained to the same bounding box until
-		// the moveable is disabled
-		if (!_sprite->_moveable || newSprite)
-			_currentPoint = _sprite->_startPoint;
-
-		if (!_sprite->_stretch) {
-			_width = _sprite->_width;
-			_height = _sprite->_height;
+	if (nextSprite) {
+		if (!_sprite->_puppet) {
+			if (partial) {
+				// Updating scripts, etc. does not require a full re-render
+				_sprite->_scriptId = nextSprite->_scriptId;
+			} else {
+				_sprite = nextSprite;
+
+				// Sprites marked moveable are constrained to the same bounding box until
+				// the moveable is disabled
+				if (!_sprite->_moveable || newSprite)
+					_currentPoint = _sprite->_startPoint;
+
+				if (!_sprite->_stretch) {
+					_width = _sprite->_width;
+					_height = _sprite->_height;
+				}
+			}
 		}
-	}
 
-	_currentPoint += _delta;
-	_delta = Common::Point(0, 0);
+		_currentPoint += _delta;
+		_delta = Common::Point(0, 0);
+	}
 
 	if (_sprite->_cast && _sprite->_cast->_widget) {
+		_sprite->updateCast();
 		Common::Point p(getPosition());
 		_sprite->_cast->_modified = false;
 		_sprite->_cast->_widget->_dims.moveTo(p.x, p.y);
diff --git a/engines/director/channel.h b/engines/director/channel.h
index efa94b0539..48f832e54c 100644
--- a/engines/director/channel.h
+++ b/engines/director/channel.h
@@ -47,7 +47,7 @@ public:
 	void setWidth(int w);
 	void setHeight(int h);
 	void setBbox(int l, int t, int r, int b);
-	void setClean(Sprite *nextSprite, int spriteId);
+	void setClean(Sprite *nextSprite, int spriteId, bool partial = false);
 
 	void addDelta(Common::Point pos);
 
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index c3c48f543a..f5d2b6ebdf 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -415,10 +415,8 @@ void Score::renderSprites(uint16 frameId, RenderMode mode) {
 
 			channel->setClean(nextSprite, i);
 			_stage->addDirtyRect(channel->getBbox());
-		} else if (!channel->_sprite->_puppet) {
-			// Updating scripts, etc. does not require a full re-render
-			channel->_sprite->updateCast();
-			channel->_sprite->_scriptId = nextSprite->_scriptId;
+		} else {
+			channel->setClean(nextSprite, i, true);
 		}
 	}
 }


Commit: 91409d2cc1cf48318106cdd2667e1adec84a504e
    https://github.com/scummvm/scummvm/commit/91409d2cc1cf48318106cdd2667e1adec84a504e
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-16T18:36:33-04:00

Commit Message:
GRAPHICS: MACGUI: MacWidget: Handle priorities properly

Changed paths:
    graphics/macgui/macwidget.cpp


diff --git a/graphics/macgui/macwidget.cpp b/graphics/macgui/macwidget.cpp
index c5664bcae8..9440b4541c 100644
--- a/graphics/macgui/macwidget.cpp
+++ b/graphics/macgui/macwidget.cpp
@@ -125,8 +125,10 @@ MacWidget *MacWidget::findEventHandler(Common::Event &event, int dx, int dy) {
 
 				for (uint i = 0; i < _children.size(); i++) {
 					MacWidget *res = _children[i]->findEventHandler(event, dx + _dims.left, dy + _dims.top);
-					if (res && res->_priority > priority)
+					if (res && res->_priority > priority) {
+						priority = res->_priority;
 						widget = res;
+					}
 				}
 				return widget ? widget : this;
 			}




More information about the Scummvm-git-logs mailing list