[Scummvm-git-logs] scummvm master -> 9909165a67eac48cdca4656bc07b6b1a528f723c

eriktorbjorn noreply at scummvm.org
Fri Dec 1 06:55:40 UTC 2023


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

Summary:
9909165a67 SCUMM: Draw decorative line in Mac Loom save/load dialog as shaded


Commit: 9909165a67eac48cdca4656bc07b6b1a528f723c
    https://github.com/scummvm/scummvm/commit/9909165a67eac48cdca4656bc07b6b1a528f723c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2023-12-01T07:55:25+01:00

Commit Message:
SCUMM: Draw decorative line in Mac Loom save/load dialog as shaded

This matches what I see in emulation. Should this also be applied to the
Indy 3 dialog? The color version seems to draw a solid line, but the
black and white version is dotted. I don't have the time to look where
that is done at the moment.

Changed paths:
    engines/scumm/gfx_mac.cpp
    engines/scumm/gfx_mac.h


diff --git a/engines/scumm/gfx_mac.cpp b/engines/scumm/gfx_mac.cpp
index 2eec201a66f..c9b6c14047f 100644
--- a/engines/scumm/gfx_mac.cpp
+++ b/engines/scumm/gfx_mac.cpp
@@ -2043,6 +2043,23 @@ void MacGui::MacDialogWindow::update(bool fullRedraw) {
 	}
 }
 
+void MacGui::MacDialogWindow::drawDottedHLine(int x0, int y, int x1) {
+	Graphics::Surface *s = innerSurface();
+
+	Color color[2];
+
+	if (_gui->_vm->_renderMode == Common::kRenderMacintoshBW) {
+		color[0] = kBlack;
+		color[1] = kWhite;
+	} else {
+		color[0] = kDarkGray;
+		color[1] = kLightGray;
+	}
+
+	for (int x = x0; x <= x1; x++)
+		s->setPixel(x, y, color[x & 1]);
+}
+
 void MacGui::MacDialogWindow::fillPattern(Common::Rect r, uint16 pattern) {
 	for (int y = r.top; y < r.bottom; y++) {
 		for (int x = r.left; x < r.right; x++) {
@@ -3789,8 +3806,7 @@ bool MacLoomGui::runOpenDialog(int &saveSlotToHandle) {
 	window->addButton(Common::Rect(254, 104, 334, 124), "Cancel", true);
 	window->addButton(Common::Rect(254, 59, 334, 79), "Delete", true);
 
-	Graphics::Surface *s = window->innerSurface();
-	s->hLine(253, 91, 334, kBlack);
+	window->drawDottedHLine(253, 91, 334);
 
 	bool availSlots[100];
 	int slotIds[100];
@@ -3860,7 +3876,7 @@ bool MacLoomGui::runSaveDialog(int &saveSlotToHandle, Common::String &name) {
 
 	s->frameRect(Common::Rect(14, 161, 232, 183), kBlack);
 
-	s->hLine(253, 115, 334, kBlack);
+	window->drawDottedHLine(253, 115, 334);
 
 	font->drawString(s, "Save Game File as...", 14, 143, 218, kBlack, Graphics::kTextAlignLeft, 4);
 
diff --git a/engines/scumm/gfx_mac.h b/engines/scumm/gfx_mac.h
index 4bd0b1e8972..c80797b939e 100644
--- a/engines/scumm/gfx_mac.h
+++ b/engines/scumm/gfx_mac.h
@@ -564,6 +564,7 @@ public:
 		static void plotPattern(int x, int y, int pattern, void *data);
 		static void plotPatternDarkenOnly(int x, int y, int pattern, void *data);
 
+		void drawDottedHLine(int x0, int y, int x1);
 		void fillPattern(Common::Rect r, uint16 pattern);
 		void drawSprite(const Graphics::Surface *sprite, int x, int y);
 		void drawSprite(const Graphics::Surface *sprite, int x, int y, Common::Rect clipRect);




More information about the Scummvm-git-logs mailing list