[Scummvm-git-logs] scummvm master -> bc65ee4f37e85908b67b58292f7ef733c6a054f7

sev- sev at scummvm.org
Thu Apr 23 20:06:40 UTC 2020


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:
7e3d9e733b PINK: Remove redundant flag
e81cf1cb81 DIRECTOR: We will draw individual widgets manually in WM
37f2275f62 GRAPHICS: MACGUI: Draw over optional mask in macDrawPixel()
bc65ee4f37 DIRECTOR: Create mask surface for sprites


Commit: 7e3d9e733b8e9d34ca18634b63fcc3d97be33d43
    https://github.com/scummvm/scummvm/commit/7e3d9e733b8e9d34ca18634b63fcc3d97be33d43
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-23T22:06:20+02:00

Commit Message:
PINK: Remove redundant flag

Changed paths:
    engines/pink/director.cpp


diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp
index 4d0382bb9d..64c52d76a8 100644
--- a/engines/pink/director.cpp
+++ b/engines/pink/director.cpp
@@ -92,7 +92,7 @@ Director::Director()
 	: _surface(640, 480), _textRendered(false) {
 	_wm = new Graphics::MacWindowManager(Graphics::kWMModeNoDesktop | Graphics::kWMModeAutohideMenu
 		| Graphics::kWMModalMenuMode | Graphics::kWMModeForceBuiltinFonts
-		| Graphics::kWMModeUnicode | Graphics::kWMModeManualDrawWidgets);
+		| Graphics::kWMModeUnicode);
 
 	_wm->setScreen(&_surface);
 	_wm->setMenuHotzone(Common::Rect(0, 0, 640, 23));


Commit: e81cf1cb81e23f19299bd313749544ca13ef96a5
    https://github.com/scummvm/scummvm/commit/e81cf1cb81e23f19299bd313749544ca13ef96a5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-23T22:06:20+02:00

Commit Message:
DIRECTOR: We will draw individual widgets manually in WM

Changed paths:
    engines/director/director.cpp


diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index d28d6f7ac0..f22098d52f 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -130,7 +130,8 @@ Common::Error DirectorEngine::run() {
 	_macBinary = nullptr;
 	_soundManager = nullptr;
 
-	_wm = new Graphics::MacWindowManager(Graphics::kWMModalMenuMode | Graphics::kWMModeNoDesktop);
+	_wm = new Graphics::MacWindowManager(Graphics::kWMModalMenuMode | Graphics::kWMModeNoDesktop
+							| Graphics::kWMModeManualDrawWidgets);
 
 	_lingo = new Lingo(this);
 	_soundManager = new DirectorSound();


Commit: 37f2275f62d652b4784a925ceb37a8700b58a67a
    https://github.com/scummvm/scummvm/commit/37f2275f62d652b4784a925ceb37a8700b58a67a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-23T22:06:20+02:00

Commit Message:
GRAPHICS: MACGUI: Draw over optional mask in macDrawPixel()

Changed paths:
    engines/director/frame.cpp
    engines/director/score.cpp
    engines/director/transitions.cpp
    graphics/macgui/macwindowmanager.cpp
    graphics/macgui/macwindowmanager.h


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index b5a5914f59..0c4ff97113 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -715,7 +715,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
 
 	// Draw fill
 	Common::Rect fillRect((int)shapeRect.width(), (int)shapeRect.height());
-	Graphics::MacPlotData plotFill(&tmpSurface, &_vm->getPatterns(), sp->getPattern(), -shapeRect.left, -shapeRect.top, 1, backColor);
+	Graphics::MacPlotData plotFill(&tmpSurface, nullptr, &_vm->getPatterns(), sp->getPattern(), -shapeRect.left, -shapeRect.top, 1, backColor);
 	switch (spriteType) {
 	case kRectangleSprite:
 		Graphics::drawFilledRect(fillRect, foreColor, Graphics::macDrawPixel, &plotFill);
@@ -735,7 +735,7 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
 
 	// Draw stroke
 	Common::Rect strokeRect(MAX((int)shapeRect.width() - lineSize, 0), MAX((int)shapeRect.height() - lineSize, 0));
-	Graphics::MacPlotData plotStroke(&tmpSurface, &_vm->getPatterns(), 1, -shapeRect.left, -shapeRect.top, lineSize, backColor);
+	Graphics::MacPlotData plotStroke(&tmpSurface, nullptr, &_vm->getPatterns(), 1, -shapeRect.left, -shapeRect.top, lineSize, backColor);
 	switch (spriteType) {
 	case kLineTopBottomSprite:
 		Graphics::drawLine(strokeRect.left, strokeRect.top, strokeRect.right, strokeRect.bottom, foreColor, Graphics::macDrawPixel, &plotStroke);
@@ -823,7 +823,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
 	if (!invert)
 		renderText(surface, spriteId, &textRect);
 
-	Graphics::MacPlotData plotStroke(&surface, &_vm->getPatterns(), 1, -_rect.left, -_rect.top, 1, 0);
+	Graphics::MacPlotData plotStroke(&surface, nullptr, &_vm->getPatterns(), 1, -_rect.left, -_rect.top, 1, 0);
 
 	switch (buttonType) {
 	case kCheckboxSprite:
@@ -834,7 +834,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {
 		break;
 	case kButtonSprite: {
 			_rect = Common::Rect(x, y, x + width, y + height + 3);
-			Graphics::MacPlotData pd(&surface, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 0, 0, 1, invert ? Graphics::kColorBlack : Graphics::kColorWhite);
+			Graphics::MacPlotData pd(&surface, nullptr, &_vm->getMacWindowManager()->getPatterns(), Graphics::MacGUIConstants::kPatternSolid, 0, 0, 1, invert ? Graphics::kColorBlack : Graphics::kColorWhite);
 
 			Graphics::drawRoundRect(_rect, 4, 0, invert, Graphics::macDrawPixel, &pd);
 			addDrawRect(spriteId, _rect);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 11dd784a0f..50c8d9ccd7 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1743,7 +1743,7 @@ void Score::renderZoomBox(bool redraw) {
 		end = MIN(start + 3 - box->step % 2, 8);
 	}
 
-	Graphics::MacPlotData pd(_surface, &_vm->_wm->getPatterns(), Graphics::kPatternCheckers, 0, 0, 1, 0);
+	Graphics::MacPlotData pd(_surface, nullptr, &_vm->_wm->getPatterns(), Graphics::kPatternCheckers, 0, 0, 1, 0);
 
 	for (int i = start; i <= end; i++) {
 		Common::Rect r(box->start.left   + (box->end.left   - box->start.left)   * i / 8,
diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index c109bbb204..72dcee2f1e 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -932,7 +932,7 @@ static void transZoom(TransParams &t, Score *score, Common::Rect &clipRect) {
 
 	t.steps += 2;
 
-	Graphics::MacPlotData pd(score->_backSurface, &g_director->_wm->getPatterns(), Graphics::kPatternCheckers, 0, 0, 1, 0);
+	Graphics::MacPlotData pd(score->_backSurface, nullptr, &g_director->_wm->getPatterns(), Graphics::kPatternCheckers, 0, 0, 1, 0);
 
 	for (uint16 i = 1; i < t.steps; i++) {
 		score->_backSurface->copyFrom(*score->_backSurface2);
diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index f31cfe9875..ec660e6193 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -313,6 +313,9 @@ void macDrawPixel(int x, int y, int color, void *data) {
 			*((byte *)p->surface->getBasePtr(xu, yu)) =
 				(pat[(yu - p->fillOriginY) % 8] & (1 << (7 - (xu - p->fillOriginX) % 8))) ?
 					color : p->bgColor;
+
+			if (p->mask)
+				*((byte *)p->mask->getBasePtr(xu, yu)) = 0xff;
 		}
 	} else {
 		int x1 = x;
@@ -328,6 +331,9 @@ void macDrawPixel(int x, int y, int color, void *data) {
 					*((byte *)p->surface->getBasePtr(xu, yu)) =
 						(pat[(yu - p->fillOriginY) % 8] & (1 << (7 - (xu - p->fillOriginX) % 8))) ?
 							color : p->bgColor;
+
+					if (p->mask)
+						*((byte *)p->mask->getBasePtr(xu, yu)) = 0xff;
 				}
 	}
 }
@@ -335,7 +341,7 @@ void macDrawPixel(int x, int y, int color, void *data) {
 void MacWindowManager::drawDesktop() {
 	Common::Rect r(_screen->getBounds());
 
-	MacPlotData pd(_screen, &_patterns, kPatternCheckers, 0, 0, 1, _colorWhite);
+	MacPlotData pd(_screen, nullptr, &_patterns, kPatternCheckers, 0, 0, 1, _colorWhite);
 
 	Graphics::drawRoundRect(r, kDesktopArc, _colorBlack, true, macDrawPixel, &pd);
 
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index 2b5cab7d39..ed69488084 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -82,6 +82,7 @@ typedef Common::Array<byte *> MacPatterns;
 
 struct MacPlotData {
 	Graphics::ManagedSurface *surface;
+	Graphics::ManagedSurface *mask;
 	MacPatterns *patterns;
 	uint fillType;
 	int fillOriginX;
@@ -89,8 +90,8 @@ struct MacPlotData {
 	int thickness;
 	uint bgColor;
 
-	MacPlotData(Graphics::ManagedSurface *s, MacPatterns *p, uint f, int fx, int fy, int t, uint bg) :
-		surface(s), patterns(p), fillType(f), fillOriginX(fx), fillOriginY(fy), thickness(t), bgColor(bg) {
+	MacPlotData(Graphics::ManagedSurface *s, Graphics::ManagedSurface *m, MacPatterns *p, uint f, int fx, int fy, int t, uint bg) :
+		surface(s), mask(m), patterns(p), fillType(f), fillOriginX(fx), fillOriginY(fy), thickness(t), bgColor(bg) {
 	}
 };
 


Commit: bc65ee4f37e85908b67b58292f7ef733c6a054f7
    https://github.com/scummvm/scummvm/commit/bc65ee4f37e85908b67b58292f7ef733c6a054f7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-23T22:06:20+02:00

Commit Message:
DIRECTOR: Create mask surface for sprites

Changed paths:
    engines/director/frame.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 0c4ff97113..94cd894673 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -708,10 +708,12 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
 		sp->_currentPoint.x + sp->_width,
 		sp->_currentPoint.y + sp->_height);
 
-	Graphics::ManagedSurface tmpSurface;
+	Graphics::ManagedSurface tmpSurface, maskSurface;
 	tmpSurface.create(shapeRect.width(), shapeRect.height(), Graphics::PixelFormat::createFormatCLUT8());
-	tmpSurface.clear(255);
+	tmpSurface.clear(backColor);
 
+	maskSurface.create(shapeRect.width(), shapeRect.height(), Graphics::PixelFormat::createFormatCLUT8());
+	maskSurface.clear(0);
 
 	// Draw fill
 	Common::Rect fillRect((int)shapeRect.width(), (int)shapeRect.height());
@@ -765,7 +767,6 @@ void Frame::renderShape(Graphics::ManagedSurface &surface, uint16 spriteId) {
 
 	addDrawRect(spriteId, shapeRect);
 	inkBasedBlit(surface, tmpSurface, ink, shapeRect, spriteId);
-
 }
 
 void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId) {




More information about the Scummvm-git-logs mailing list