[Scummvm-git-logs] scummvm master -> 7beddf7eb6dc73284ff36adfc2ff814fa062cb1a

sev- noreply at scummvm.org
Fri Aug 7 20:34:07 UTC 2026


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

Summary:
81d2d154ac MACVENTURE: Fix placement and size of new inventory windows
edadb38575 MACVENTURE: Show intermediate frames of scripted animations
2b354ee653 MACVENTURE: Do not run a command twice on the destination object
93d2acc22a MACVENTURE: Pause console output with click to continue when it fills the window
b36e1e97e1 MACVENTURE: Fix lasso selection picking up the wrong objects
7beddf7eb6 MACVENTURE: Only redraw the windows when something has changed


Commit: 81d2d154ac27765470b654bba7dcf5a11ac44ced
    https://github.com/scummvm/scummvm/commit/81d2d154ac27765470b654bba7dcf5a11ac44ced
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-07T22:34:01+02:00

Commit Message:
MACVENTURE: Fix placement and size of new inventory windows

A new inventory window was placed by taking the bounds of the previous one
and adding its own position to the offset, so each window ended up at twice
the position of the one before it. With Deja Vu's settings, offsetting by
(3, 26) from (4, 48), the third window already landed below the bottom of
the screen.

Those bounds are not a usable starting point anyway, because
updateWindowInfo() overwrites their left and top with the position of the
window contents without moving right and bottom, which stretches the
rectangle. Each new window inherited the growth of the previous one, so
after a couple of windows they were opening several times too large.

Take the size from the settings and derive the offset from the number of
open inventory windows instead.

Changed paths:
    engines/macventure/gui.cpp


diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 699edd390dc..2a04ae8ab16 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -506,17 +506,13 @@ WindowReference Gui::createInventoryWindow(ObjID objRef) {
 	}
 	newData.refcon = _objToInvRef[objRef];
 
-	if (_windowData->back().refcon < 0x80) { // There is already another inventory window
-		newData.bounds = _windowData->back().bounds; // Inventory windows are always last
-		newData.bounds.translate(newData.bounds.left + settings._invOffsetX, newData.bounds.top + settings._invOffsetY);
-	} else {
-		newData.bounds = Common::Rect(
-			settings._invLeft,
-			settings._invTop,
-			settings._invLeft + settings._invWidth,
-			settings._invTop + settings._invHeight
-		);
-	}
+	int cascade = _inventoryWindows.size();
+	newData.bounds = Common::Rect(
+		settings._invLeft + cascade * settings._invOffsetX,
+		settings._invTop + cascade * settings._invOffsetY,
+		settings._invLeft + cascade * settings._invOffsetX + settings._invWidth,
+		settings._invTop + cascade * settings._invOffsetY + settings._invHeight
+	);
 	newData.type = kInvWindow;
 	newData.hasCloseBox = true;
 	newData.visible = true;


Commit: edadb3857567e869ddb33cd28089157397bcb95a
    https://github.com/scummvm/scummvm/commit/edadb3857567e869ddb33cd28089157397bcb95a
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-07T22:34:01+02:00

Commit Message:
MACVENTURE: Show intermediate frames of scripted animations

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


diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index ffee1e84d9c..1de18110dab 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -46,6 +46,10 @@ enum {
 	kMaxMenuTitleLength = 30
 };
 
+enum {
+	kFrameDelay = 20
+};
+
 MacVentureEngine::MacVentureEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst) {
 	_gameDescription = gameDesc;
 	_rnd = new Common::RandomSource("macventure");
@@ -66,6 +70,8 @@ MacVentureEngine::MacVentureEngine(OSystem *syst, const ADGameDescription *gameD
 
 	_dataBundle = nullptr;
 
+	_nextFrameTime = 0;
+
 	debug("MacVenture::MacVentureEngine()");
 }
 
@@ -208,7 +214,11 @@ Common::Error MacVentureEngine::run() {
 void MacVentureEngine::refreshScreen() {
 	_gui->draw();
 	g_system->updateScreen();
-	g_system->delayMillis(50);
+
+	uint32 now = g_system->getMillis();
+	if (now < _nextFrameTime)
+		g_system->delayMillis(_nextFrameTime - now);
+	_nextFrameTime = g_system->getMillis() + kFrameDelay;
 }
 
 void MacVentureEngine::newGame() {
diff --git a/engines/macventure/macventure.h b/engines/macventure/macventure.h
index 48fe84c8f7a..5d1ce66230b 100644
--- a/engines/macventure/macventure.h
+++ b/engines/macventure/macventure.h
@@ -396,6 +396,7 @@ private: // Attributes
 	bool _gameChanged;
 	bool _clickToContinue;
 	bool _enginePaused;
+	uint32 _nextFrameTime;
 
 	Common::Array<QueuedObject> _objQueue;
 	Common::Array<QueuedObject> _inQueue;
diff --git a/engines/macventure/script.cpp b/engines/macventure/script.cpp
index 50558db0f23..c48cc49b213 100644
--- a/engines/macventure/script.cpp
+++ b/engines/macventure/script.cpp
@@ -475,7 +475,7 @@ bool ScriptEngine::runFunc(EngineFrame *frame) {
 				break;
 			case 0xde: //update screen
 				opdeUPSC(state, frame);
-				break;
+				return true;
 			case 0xdf: //flash main window
 				opdfFMAI(state, frame);
 				return true;
@@ -1171,6 +1171,7 @@ void ScriptEngine::opddRTQ(EngineState *state, EngineFrame *frame) {
 
 void ScriptEngine::opdeUPSC(EngineState *state, EngineFrame *frame) {
 	_engine->updateState(true);
+	_engine->preparedToRun();
 }
 
 void ScriptEngine::opdfFMAI(EngineState *state, EngineFrame *frame) {


Commit: 2b354ee65319608d0980a2e8961daa878c59d03b
    https://github.com/scummvm/scummvm/commit/2b354ee65319608d0980a2e8961daa878c59d03b
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-07T22:34:01+02:00

Commit Message:
MACVENTURE: Do not run a command twice on the destination object

Changed paths:
    engines/macventure/macventure.cpp


diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 1de18110dab..a9066271ba8 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -546,6 +546,9 @@ bool MacVenture::MacVentureEngine::runScriptEngine() {
 	while (!_currentSelection.empty()) {
 		ObjID obj = _currentSelection.front();
 		_currentSelection.remove_at(0);
+		if (getInvolvedObjects() > 1 && obj == _destObject) {
+			continue;
+		}
 		if (isGameRunning() && _world->isObjActive(obj)) {
 			if (_scriptEngine->runControl(_selectedControl, obj, _destObject, _deltaPoint)) {
 				_haltedInSelection = true;


Commit: 93d2acc22afb4d8fa22d7ae5f68e7e6421b7817b
    https://github.com/scummvm/scummvm/commit/93d2acc22afb4d8fa22d7ae5f68e7e6421b7817b
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-07T22:34:01+02:00

Commit Message:
MACVENTURE: Pause console output with click to continue when it fills the window

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


diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 2a04ae8ab16..54ed001803b 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -1137,6 +1137,18 @@ void Gui::printText(const Common::String &text) {
 	_outConsoleWindow->scrollToBottom();
 }
 
+uint Gui::getConsoleRowCount() {
+	return _outConsoleWindow->getRowCount();
+}
+
+uint Gui::getConsoleVisibleRows() {
+	int lineHeight = _outConsoleWindow->getLineHeight(0) + _outConsoleWindow->getLineSpacing();
+	if (lineHeight <= 0) {
+		return 1;
+	}
+	return MAX(1, _outConsoleWindow->getInnerDimensions().height() / lineHeight);
+}
+
 void Gui::setWaitCursor(bool wait) {
 	_wm.replaceCursor(wait ? Graphics::kMacCursorWatch : Graphics::kMacCursorArrow);
 	g_system->updateScreen();
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index def5ecd3985..bb149d5fd2b 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -163,6 +163,8 @@ public:
 	void setConsoleText(const Common::String &text);
 
 	void printText(const Common::String &text);
+	uint getConsoleRowCount();
+	uint getConsoleVisibleRows();
 
 	void setWaitCursor(bool wait);
 
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index a9066271ba8..4423313e611 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -239,6 +239,7 @@ void MacVentureEngine::setInitialFlags(GameState gameState) {
 	_destObject = 0;
 	_prepared = true;
 	_enginePaused = false;
+	_consoleRowsSincePause = 0;
 }
 
 void MacVentureEngine::setNewGameState() {
@@ -281,12 +282,14 @@ void MacVentureEngine::requestUnpause() {
 void MacVentureEngine::selectControl(ControlAction id) {
 	debugC(2, kMVDebugMain, "Select control %x", id);
 	if (id == kClickToContinue) {
+		_consoleRowsSincePause = 0;
 		_clickToContinue = false;
 		_enginePaused = false;
 		_paused = true;
 		return;
 	}
 
+	_consoleRowsSincePause = 0;
 	_selectedControl = id;
 	refreshReady();
 }
@@ -631,7 +634,11 @@ void MacVentureEngine::runObjQueue() {
 }
 
 void MacVentureEngine::printTexts() {
-	for (uint i = 0; i < _textQueue.size(); i++) {
+	while (!_textQueue.empty()) {
+		if (_consoleRowsSincePause >= _gui->getConsoleVisibleRows()) {
+			clickToContinue();
+			return;
+		}
 		QueuedText text = _textQueue.front();
 		_textQueue.remove_at(0);
 		switch (text.id) {
@@ -639,11 +646,14 @@ void MacVentureEngine::printTexts() {
 			_currentConsoleText += Common::String::format("%d", text.asset);
 			gameChanged();
 			break;
-		case kTextNewLine:
+		case kTextNewLine: {
+			uint rows = _gui->getConsoleRowCount();
 			_gui->printText(_currentConsoleText);
+			_consoleRowsSincePause += _gui->getConsoleRowCount() - rows;
 			_currentConsoleText.clear();
 			gameChanged();
 			break;
+		}
 		case kTextPlain:
 			_currentConsoleText += _world->getText(text.asset, text.source, text.destination);
 			gameChanged();
diff --git a/engines/macventure/macventure.h b/engines/macventure/macventure.h
index 5d1ce66230b..45e8e3882cf 100644
--- a/engines/macventure/macventure.h
+++ b/engines/macventure/macventure.h
@@ -397,6 +397,7 @@ private: // Attributes
 	bool _clickToContinue;
 	bool _enginePaused;
 	uint32 _nextFrameTime;
+	uint _consoleRowsSincePause;
 
 	Common::Array<QueuedObject> _objQueue;
 	Common::Array<QueuedObject> _inQueue;


Commit: b36e1e97e19573195cfb8713b68334518fce7585
    https://github.com/scummvm/scummvm/commit/b36e1e97e19573195cfb8713b68334518fce7585
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-07T22:34:01+02:00

Commit Message:
MACVENTURE: Fix lasso selection picking up the wrong objects

The mouse position reported to the window callback is relative to the
outer window, while the objects in an inventory window are placed
relative to its content area. The lasso rectangle was drawn with a
hardcoded vertical correction and tested against the objects with none
at all, so the selected area sat one row below the visible rectangle.
Scrolled windows were off by the scroll position as well.

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


diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 54ed001803b..143395ba7a4 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -846,15 +846,7 @@ void Gui::drawInventories() {
 		drawObjectsInWindow(data, srf);
 
 		if (data.refcon == _lassoWinRef && _lassoBeingDrawn) {
-			Common::Point topLeft(_lassoStart);
-			topLeft.y -= 12;
-			Common::Point bottomRight(_lassoEnd);
-			bottomRight.y -= 12;
-			if (topLeft.x > bottomRight.x)
-				SWAP(topLeft.x, bottomRight.x);
-			if (topLeft.y > bottomRight.y)
-				SWAP(topLeft.y, bottomRight.y);
-			Common::Rect lassoRect(topLeft, bottomRight);
+			Common::Rect lassoRect = calculateLassoRect(win);
 
 			Graphics::MacPlotData plotData(srf, nullptr, &_wm.getBuiltinPatterns(), kPatternCheckers2, 0, 0, {1, 1}, kColorWhite, false);
 			Graphics::Primitives &primitives = _wm.getDrawPrimitives();
@@ -1434,6 +1426,23 @@ void Gui::handleDragRelease(bool shiftPressed, bool isDoubleClick) {
 	}
 }
 
+Common::Rect Gui::calculateLassoRect(Graphics::MacWindow *win) {
+	Common::Point topLeft(_lassoStart);
+	Common::Point bottomRight(_lassoEnd);
+	if (topLeft.x > bottomRight.x)
+		SWAP(topLeft.x, bottomRight.x);
+	if (topLeft.y > bottomRight.y)
+		SWAP(topLeft.y, bottomRight.y);
+
+	Common::Rect lassoRect(topLeft, bottomRight);
+
+	const Common::Rect &innerDims = win->getInnerDimensions();
+	const Common::Rect &outerDims = win->getDimensions();
+	lassoRect.translate(outerDims.left - innerDims.left, outerDims.top - innerDims.top);
+
+	return lassoRect;
+}
+
 Common::Rect Gui::calculateClickRect(Common::Point clickPos, Common::Rect windowBounds) {
 	int left = clickPos.x - windowBounds.left;
 	int top = clickPos.y - windowBounds.top;
@@ -1869,13 +1878,8 @@ bool Gui::processInventoryEvents(WindowReference ref, WindowClick click, Common:
 		if (_lassoBeingDrawn && !_draggedObjects.size()) {
 			WindowData &data = findWindowData((WindowReference)ref);
 
-			Common::Point topLeft(_lassoStart);
-			Common::Point bottomRight(_lassoEnd);
-			if (topLeft.x > bottomRight.x)
-				SWAP(topLeft.x, bottomRight.x);
-			if (topLeft.y > bottomRight.y)
-				SWAP(topLeft.y, bottomRight.y);
-			Common::Rect lassoArea(topLeft, bottomRight);
+			Common::Rect lassoArea = calculateLassoRect(findWindow(ref));
+			lassoArea.translate(data.scrollPos.x, data.scrollPos.y);
 
 			Common::Array<ObjID> &selectedObjects = _engine->getSelectedObjects();
 			bool selectSelfWindow = true;
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index bb149d5fd2b..1c56c1fa664 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -280,6 +280,7 @@ private: // Methods
 	bool isRectInsideObject(Common::Rect target, ObjID obj);
 	void selectDraggable(ObjID child, WindowReference origin, Common::Point startPos);
 	void handleDragRelease(bool shiftPressed, bool isDoubleClick);
+	Common::Rect calculateLassoRect(Graphics::MacWindow *win);
 	Common::Rect calculateClickRect(Common::Point clickPos, Common::Rect windowBounds);
 	Common::Point localizeTravelledDistance(Common::Point point, WindowReference origin, WindowReference target);
 	void removeInventoryWindow(WindowReference ref);


Commit: 7beddf7eb6dc73284ff36adfc2ff814fa062cb1a
    https://github.com/scummvm/scummvm/commit/7beddf7eb6dc73284ff36adfc2ff814fa062cb1a
Author: Ion Andrei Cristian (lecturatul2017 at gmail.com)
Date: 2026-08-07T22:34:01+02:00

Commit Message:
MACVENTURE: Only redraw the windows when something has changed

Gui::draw() forced a full refresh and redrew the contents of every
window on each frame, which took around 60 ms and held the game at
about 17 fps instead of the intended 50. The window contents are now
redrawn when an event, a command or a script has changed them.

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 143395ba7a4..2da7b1698b1 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -121,6 +121,7 @@ Gui::Gui(MacVentureEngine *engine, Common::MacResManager *resman) {
 	_cursor = new Cursor(this);
 
 	_consoleText = new ConsoleText(this);
+	_needsRedraw = true;
 	_graphics = nullptr;
 	_diplomaImage = nullptr;
 	_diplomaWindow = nullptr;
@@ -192,10 +193,13 @@ void Gui::reloadInternals() {
 }
 
 void Gui::draw() {
-	// Will be performance-improved after the milestone
-	_wm.setFullRefresh(true);
+	if (_needsRedraw) {
+		_wm.setFullRefresh(true);
 
-	drawWindows();
+		drawWindows();
+
+		_needsRedraw = false;
+	}
 
 	_wm.draw();
 
@@ -205,6 +209,10 @@ void Gui::draw() {
 	//drawWindowTitle(kMainGameWindow, _mainGameWindow->getWindowSurface());
 }
 
+void Gui::markRedraw() {
+	_needsRedraw = true;
+}
+
 void Gui::drawMenu() {
 	_menu->draw(&_screen);
 }
@@ -1680,6 +1688,9 @@ Common::Point Gui::getObjMeasures(ObjID obj) {
 bool Gui::processEvent(Common::Event &event) {
 	bool processed = false;
 
+	if (event.type != Common::EVENT_MOUSEMOVE)
+		markRedraw();
+
 	processed |= _cursor->processEvent(event);
 
 	if (_dialog && _dialog->processEvent(event)) {
@@ -1689,7 +1700,10 @@ bool Gui::processEvent(Common::Event &event) {
 	if (event.type == Common::EVENT_MOUSEMOVE) {
 		if (_draggedObjects.size() && _draggedObjects[0].id != 0) {
 			moveDraggedObjects(event.mouse);
+			markRedraw();
 		}
+		if (_lassoBeingDrawn)
+			markRedraw();
 		processed = true;
 	} else if (event.type == Common::EVENT_LBUTTONUP) {
 		clearDraggedObjects();
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
index 1c56c1fa664..4428773a769 100644
--- a/engines/macventure/gui.h
+++ b/engines/macventure/gui.h
@@ -99,6 +99,7 @@ public:
 	void reloadInternals();
 
 	void draw();
+	void markRedraw();
 	void drawMenu();
 	void drawTitle();
 
@@ -231,6 +232,8 @@ private: // Attributes
 
 	ConsoleText *_consoleText;
 
+	bool _needsRedraw;
+
 	WindowReference _lassoWinRef;
 	Common::Point _lassoStart;
 	Common::Point _lassoEnd;
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
index 4423313e611..6b56e97d45a 100644
--- a/engines/macventure/macventure.cpp
+++ b/engines/macventure/macventure.cpp
@@ -203,6 +203,8 @@ Common::Error MacVentureEngine::run() {
 
 				if (busy)
 					_gui->setWaitCursor(false);
+
+				_gui->markRedraw();
 			}
 		}
 		refreshScreen();
@@ -266,6 +268,7 @@ void MacVentureEngine::resetGui() {
 	_gui->reloadInternals();
 	updateControls();
 	updateExits();
+	_gui->markRedraw();
 	refreshScreen();
 }
 




More information about the Scummvm-git-logs mailing list