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

sev- noreply at scummvm.org
Tue Aug 11 18:55:19 UTC 2026


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

Summary:
bbaac69d07 MACVENTURE: Let the player sign the diploma at the end of the game
8015971767 MACVENTURE: Initialize the title of dialog elements read from DITL
c9e2408b56 GRAPHICS: MACGUI: Add an absolute scroll position setter to MacTextWindow
ba1c9fb346 MACVENTURE: Make the click to continue prompt page through the console


Commit: bbaac69d0791973af05dfded214a598c42728d76
    https://github.com/scummvm/scummvm/commit/bbaac69d0791973af05dfded214a598c42728d76
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-11T20:55:13+02:00

Commit Message:
MACVENTURE: Let the player sign the diploma at the end of the game

The dialog shown with the diploma asks the player to type in their
name, but the name is written on the diploma itself rather than in a
dialog field, and nothing handled it. The geometry resource that
describes the name line was already known as kDiplomaGeometryID, but
was never read: it holds the font, the font size and the bounds of the
line. The Print button now hands the signed diploma to the printing
manager.

Changed paths:
    engines/macventure/dialog.cpp
    engines/macventure/gui.cpp
    engines/macventure/gui.h
    engines/macventure/prebuilt_dialogs.h


diff --git a/engines/macventure/dialog.cpp b/engines/macventure/dialog.cpp
index e4b0c7cb96b..393264e1b73 100644
--- a/engines/macventure/dialog.cpp
+++ b/engines/macventure/dialog.cpp
@@ -154,6 +154,9 @@ void Dialog::handleDialogAction(DialogElement *trigger, DialogAction action) {
 		_gui->quitGame();
 		_gui->closeDialog();
 		break;
+	case kDAPrintDiploma:
+		_gui->printDiploma();
+		break;
 	default:
 		break;
 	}
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 2da7b1698b1..6deb3e9f758 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -34,6 +34,7 @@
 #include "image/bmp.h"
 #include "graphics/macgui/macfontmanager.h"
 #include "graphics/macgui/mactextwindow.h"
+#include "gui/gui-manager.h"
 
 #include "macventure/gui.h"
 #include "macventure/dialog.h"
@@ -125,6 +126,9 @@ Gui::Gui(MacVentureEngine *engine, Common::MacResManager *resman) {
 	_graphics = nullptr;
 	_diplomaImage = nullptr;
 	_diplomaWindow = nullptr;
+	_diplomaFontId = Graphics::kMacFontSystem;
+	_diplomaFontSize = 12;
+	_diplomaNameBounds = Common::Rect();
 
 	_lassoStart = Common::Point(0, 0);
 	_lassoEnd = Common::Point(0, 0);
@@ -605,6 +609,20 @@ void Gui::loadDiploma() {
 	_dialog = new Dialog(this, _resourceManager, kDialogBoxDiplomaID);
 	DialogElement *quitButton = _dialog->getElement("Quit");
 	quitButton->setAction(kDAQuit);
+	DialogElement *printButton = _dialog->getElement("Print");
+	printButton->setAction(kDAPrintDiploma);
+
+	_diplomaName.clear();
+	Common::SeekableReadStream *geometry = _resourceManager->getResource(MKTAG('G', 'N', 'R', 'L'), kDiplomaGeometryID);
+	if (geometry) {
+		_diplomaFontId = geometry->readUint16BE();
+		_diplomaFontSize = geometry->readUint16BE();
+		_diplomaNameBounds.top = geometry->readUint16BE();
+		_diplomaNameBounds.left = geometry->readUint16BE();
+		_diplomaNameBounds.bottom = geometry->readUint16BE();
+		_diplomaNameBounds.right = geometry->readUint16BE();
+		delete geometry;
+	}
 
 	// Image
 	if (!_diplomaImage) {
@@ -803,6 +821,18 @@ void Gui::drawDiplomaWindow() {
 		0,
 		kBlitDirect);
 
+	if (!_diplomaNameBounds.isEmpty()) {
+		const Graphics::Font *font = _wm._fontMan->getFont(Graphics::MacFont(_diplomaFontId, _diplomaFontSize));
+		font->drawString(
+			_diplomaWindow->getWindowSurface(),
+			_diplomaName,
+			_diplomaNameBounds.left,
+			_diplomaNameBounds.top,
+			_diplomaNameBounds.width(),
+			kColorBlack,
+			Graphics::kTextAlignCenter);
+	}
+
 	findWindow(kDiplomaWindow)->setDirty(true);
 }
 
@@ -1697,6 +1727,10 @@ bool Gui::processEvent(Common::Event &event) {
 		return true;
 	}
 
+	if (event.type == Common::EVENT_KEYDOWN && _diplomaWindow && processDiplomaKey(event)) {
+		return true;
+	}
+
 	if (event.type == Common::EVENT_MOUSEMOVE) {
 		if (_draggedObjects.size() && _draggedObjects[0].id != 0) {
 			moveDraggedObjects(event.mouse);
@@ -1839,6 +1873,42 @@ bool MacVenture::Gui::processDiplomaEvents(WindowClick click, Common::Event &eve
 	return getWindowData(kDiplomaWindow).visible;
 }
 
+void Gui::printDiploma() {
+	if (!_diplomaWindow)
+		return;
+
+	Graphics::ManagedSurface diploma;
+	diploma.copyFrom(*_diplomaWindow->getWindowSurface());
+	diploma.setPalette(_wm.getPalette(), 0, _wm.getPaletteSize());
+
+	g_gui.printImage(diploma);
+
+	markRedraw();
+}
+
+bool Gui::processDiplomaKey(Common::Event &event) {
+	if (_diplomaNameBounds.isEmpty())
+		return false;
+
+	if (event.kbd.keycode == Common::KEYCODE_BACKSPACE) {
+		if (_diplomaName.empty())
+			return false;
+		_diplomaName.deleteLastChar();
+		return true;
+	}
+
+	if (event.kbd.ascii < 0x20 || event.kbd.ascii > 0x7f)
+		return false;
+
+	const Graphics::Font *font = _wm._fontMan->getFont(Graphics::MacFont(_diplomaFontId, _diplomaFontSize));
+	Common::String candidate = _diplomaName + (char)event.kbd.ascii;
+	if (font->getStringWidth(candidate) > _diplomaNameBounds.width())
+		return true;
+
+	_diplomaName = candidate;
+	return true;
+}
+
 bool Gui::processInventoryEvents(WindowReference ref, WindowClick click, Common::Event &event) {
 	if (click == kBorderCloseButton) {
 		if (event.type == Common::EVENT_LBUTTONUP) {
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index 4428773a769..48180fe1edb 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -131,6 +131,8 @@ public:
 	bool processSelfEvents(WindowClick click, Common::Event &event);
 	bool processExitsEvents(WindowClick click, Common::Event &event);
 	bool processDiplomaEvents(WindowClick click, Common::Event &event);
+	bool processDiplomaKey(Common::Event &event);
+	void printDiploma();
 	bool processInventoryEvents(WindowReference ref, WindowClick click, Common::Event &event);
 
 	const WindowData& getWindowData(WindowReference reference);
@@ -224,6 +226,10 @@ private: // Attributes
 	Container *_graphics;
 	Common::HashMap<ObjID, ImageAsset*> _assets;
 	ImageAsset *_diplomaImage;
+	Common::String _diplomaName;
+	Common::Rect _diplomaNameBounds;
+	uint16 _diplomaFontId;
+	uint16 _diplomaFontSize;
 
 	Common::Array<DraggedObj> _draggedObjects;
 	Common::Array<Graphics::ManagedSurface> _draggedSurfaces;
diff --git a/engines/macventure/prebuilt_dialogs.h b/engines/macventure/prebuilt_dialogs.h
index 0ea56dfa599..5cbccf9e210 100644
--- a/engines/macventure/prebuilt_dialogs.h
+++ b/engines/macventure/prebuilt_dialogs.h
@@ -41,7 +41,8 @@ enum DialogAction {
 	kDASaveAs,
 	kDALoadGame,
 	kDAQuit,
-	kDANewGame
+	kDANewGame,
+	kDAPrintDiploma
 };
 
 enum PrebuiltDialogs {


Commit: 8015971767814686db9782d2d72c90e5eae76fdf
    https://github.com/scummvm/scummvm/commit/8015971767814686db9782d2d72c90e5eae76fdf
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-11T20:55:13+02:00

Commit Message:
MACVENTURE: Initialize the title of dialog elements read from DITL

Only the action field was initialized before parsing an item, so an item
whose title length is zero left the title pointer pointing at whatever
happened to be on the stack. Both the button and the plain text cases
pass that pointer straight to a Common::String constructor.

Changed paths:
    engines/macventure/dialog.cpp


diff --git a/engines/macventure/dialog.cpp b/engines/macventure/dialog.cpp
index 393264e1b73..a0e44b4beb9 100644
--- a/engines/macventure/dialog.cpp
+++ b/engines/macventure/dialog.cpp
@@ -72,6 +72,7 @@ Dialog::Dialog(Gui *gui, Common::MacResManager *resourceManager, uint16 resID) {
 		stream->readUint32BE(); // reserved
 		PrebuiltDialogElement element;
 		element.action = kDANone;
+		element.title = "";
 		element.top = stream->readUint16BE();
 		element.left = stream->readUint16BE();
 		element.height = stream->readUint16BE() - element.top;


Commit: c9e2408b567da823a3c1e145db227110d0fc6e60
    https://github.com/scummvm/scummvm/commit/c9e2408b567da823a3c1e145db227110d0fc6e60
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-11T20:55:13+02:00

Commit Message:
GRAPHICS: MACGUI: Add an absolute scroll position setter to MacTextWindow

Only scrollToBottom() was available, so a caller that wants to show an
earlier part of the text had no way to ask for it. Unlike that one, this
marks the text as dirty: MacText::draw() returns early when nothing is
dirty, and scrolling without appending any text would otherwise leave the
previous position on screen.

Changed paths:
    graphics/macgui/mactextwindow.h


diff --git a/graphics/macgui/mactextwindow.h b/graphics/macgui/mactextwindow.h
index 50fc85714e0..0551174fcdc 100644
--- a/graphics/macgui/mactextwindow.h
+++ b/graphics/macgui/mactextwindow.h
@@ -51,6 +51,7 @@ public:
 	void setMarkdownText(const Common::U32String &str);
 
 	void scrollToBottom() { _mactext->_scrollPos = MAX<int>(0, _mactext->getTextHeight() - getInnerDimensions().height()); }
+	void scrollTo(int pos) { _mactext->_scrollPos = CLIP<int>(pos, 0, MAX<int>(0, _mactext->getTextHeight() - getInnerDimensions().height())); _mactext->setDirty(true); }
 
 	void setEditable(bool editable) { _editable = editable; _mactext->setEditable(editable); }
 	void setActive(bool active) override { MacWindow::setActive(active); if (_editable) _mactext->setActive(active); }


Commit: ba1c9fb346edf20088b555d04d599f12e1151c23
    https://github.com/scummvm/scummvm/commit/ba1c9fb346edf20088b555d04d599f12e1151c23
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-11T20:55:13+02:00

Commit Message:
MACVENTURE: Make the click to continue prompt page through the console

The prompt was almost never shown, and when it was, the game stopped for
good. Three things were wrong.

updateControls() and resetVars() call selectControl(kNoCommand) as an
internal state reset, right after printTexts() had paused, which cleared
the counter and dropped the pending pause. The counter is now kept while
a pause is pending.

The engine only runs its main loop when _prepared is set, and the click
never set it again, so the rest of the text queue was stranded.

Finally the console is filled one whole message at a time, while the
original stopped printing as soon as the window was full, so a message
taller than the window scrolled past the player. Each click now shows the
next windowful of it, and the game resumes once nothing is left hidden.

Changed paths:
    engines/macventure/gui.cpp
    engines/macventure/gui.h
    engines/macventure/macventure.cpp


diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 6deb3e9f758..10d3d600483 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -1167,6 +1167,15 @@ void Gui::printText(const Common::String &text) {
 	_outConsoleWindow->scrollToBottom();
 }
 
+void Gui::scrollConsoleToRow(uint row) {
+	int lineHeight = _outConsoleWindow->getLineHeight(0) + _outConsoleWindow->getLineSpacing();
+	if (lineHeight <= 0) {
+		_outConsoleWindow->scrollToBottom();
+		return;
+	}
+	_outConsoleWindow->scrollTo(row * lineHeight);
+}
+
 uint Gui::getConsoleRowCount() {
 	return _outConsoleWindow->getRowCount();
 }
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index 48180fe1edb..93193afff2c 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -166,6 +166,7 @@ public:
 	void setConsoleText(const Common::String &text);
 
 	void printText(const Common::String &text);
+	void scrollConsoleToRow(uint row);
 	uint getConsoleRowCount();
 	uint getConsoleVisibleRows();
 
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 6b56e97d45a..c4bc3f862d6 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -285,14 +285,23 @@ void MacVentureEngine::requestUnpause() {
 void MacVentureEngine::selectControl(ControlAction id) {
 	debugC(2, kMVDebugMain, "Select control %x", id);
 	if (id == kClickToContinue) {
+		if (_consoleRowsSincePause > _gui->getConsoleVisibleRows()) {
+			_consoleRowsSincePause -= _gui->getConsoleVisibleRows();
+			clickToContinue();
+			return;
+		}
+
 		_consoleRowsSincePause = 0;
 		_clickToContinue = false;
 		_enginePaused = false;
 		_paused = true;
+		_prepared = true;
 		return;
 	}
 
-	_consoleRowsSincePause = 0;
+	if (!_clickToContinue)
+		_consoleRowsSincePause = 0;
+
 	_selectedControl = id;
 	refreshReady();
 }
@@ -335,6 +344,9 @@ void MacVentureEngine::loseGame() {
 }
 
 void MacVentureEngine::clickToContinue() {
+	uint rowCount = _gui->getConsoleRowCount();
+
+	_gui->scrollConsoleToRow(rowCount > _consoleRowsSincePause ? rowCount - _consoleRowsSincePause : 0);
 	_clickToContinue = true;
 	_enginePaused = true;
 }
@@ -665,6 +677,9 @@ void MacVentureEngine::printTexts() {
 			break;
 		}
 	}
+
+	if (_consoleRowsSincePause > _gui->getConsoleVisibleRows())
+		clickToContinue();
 }
 
 void MacVentureEngine::playSounds(bool pause) {




More information about the Scummvm-git-logs mailing list