[Scummvm-git-logs] scummvm master -> 9c786bfc7439b876a2f26d49eee0f76c8f5a5cad

bluegr noreply at scummvm.org
Tue May 5 01:00:25 UTC 2026


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

Summary:
6f43a2e005 NANCY: Fix Nancy10+ inventory and notebook popup widget positions
17e666cfc2 NANCY: Remove unnecessary game version checks in action record checks
9c786bfc74 NANCY: Implement differences in ModifyListEntry for Nancy10+


Commit: 6f43a2e005b0ff553cc86da53e0d1495775b5965
    https://github.com/scummvm/scummvm/commit/6f43a2e005b0ff553cc86da53e0d1495775b5965
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-05T03:58:27+03:00

Commit Message:
NANCY: Fix Nancy10+ inventory and notebook popup widget positions

Changed paths:
    engines/nancy/ui/inventorypopup.cpp
    engines/nancy/ui/notebookpopup.cpp


diff --git a/engines/nancy/ui/inventorypopup.cpp b/engines/nancy/ui/inventorypopup.cpp
index 0ec033abe84..0ccdea94dbf 100644
--- a/engines/nancy/ui/inventorypopup.cpp
+++ b/engines/nancy/ui/inventorypopup.cpp
@@ -182,17 +182,21 @@ void InventoryPopup::drawBackground() {
 }
 
 void InventoryPopup::drawFilterTabs() {
+	// Sub-rects in the chunk are stored relative to header.normalDestRect.
+	// After we translate the popup by the viewport offset, _screenPosition
+	// no longer matches that origin, so popup-local conversions must
+	// subtract chunk.normalDestRect.topLeft, not _screenPosition.
+	const Common::Point chunkOrigin(_uiivData->header.normalDestRect.left,
+									_uiivData->header.normalDestRect.top);
+
 	for (const auto &filter : _uiivData->filters) {
 		if (!filter.enabled || filter.button.sourceRects[0].isEmpty()) {
 			continue;
 		}
 
-		Common::Rect dst = filter.button.destRect;
-		dst.translate(-_screenPosition.left, -_screenPosition.top);
-
-		// Draw the idle sprite from the button's primary image; fall back
-		// to the overlay image if no primary image is loaded for the slot.
-		_drawSurface.blitFrom(_overlayImage, filter.button.sourceRects[0], Common::Point(dst.left, dst.top));
+		_drawSurface.blitFrom(_overlayImage, filter.button.sourceRects[0],
+								Common::Point(filter.button.destRect.left - chunkOrigin.x,
+												filter.button.destRect.top - chunkOrigin.y));
 	}
 }
 
@@ -201,9 +205,6 @@ void InventoryPopup::drawSlot(uint slotIndex, int16 itemID) {
 		return;
 	}
 
-	Common::Rect dst = _uiivData->slotDestRects[slotIndex];
-	dst.translate(-_screenPosition.left, -_screenPosition.top);
-
 	if (itemID < 0 || itemID >= (int16)_invData->itemDescriptions.size()) {
 		// Empty slot — leave the popup-background pixels in place.
 		return;
@@ -214,7 +215,12 @@ void InventoryPopup::drawSlot(uint slotIndex, int16 itemID) {
 		return;
 	}
 
-	_drawSurface.blitFrom(_itemIcons, desc.sourceRect, Common::Point(dst.left, dst.top));
+	const Common::Point chunkOrigin(_uiivData->header.normalDestRect.left,
+									_uiivData->header.normalDestRect.top);
+	const Common::Rect &slotDst = _uiivData->slotDestRects[slotIndex];
+	_drawSurface.blitFrom(_itemIcons, desc.sourceRect,
+							Common::Point(slotDst.left - chunkOrigin.x,
+											slotDst.top - chunkOrigin.y));
 }
 
 void InventoryPopup::handleInput(NancyInput &input) {
@@ -222,8 +228,13 @@ void InventoryPopup::handleInput(NancyInput &input) {
 		return;
 	}
 
-	// Hit-test slots against the on-screen DEST rects (UIIV stores them in
-	// absolute screen coords, same as button rects).
+	// Bring the mouse into the chunk's coordinate system so hit-tests
+	// against the chunk's destRects work after we translated the popup
+	// by the viewport offset.
+	const Common::Point chunkMouse(
+		input.mousePos.x - _screenPosition.left + _uiivData->header.normalDestRect.left,
+		input.mousePos.y - _screenPosition.top  + _uiivData->header.normalDestRect.top);
+
 	int newHovered = -1;
 	for (uint i = 0; i < kSlotsPerPage; ++i) {
 		if (i >= _uiivData->slotDestRects.size()) {
@@ -232,7 +243,7 @@ void InventoryPopup::handleInput(NancyInput &input) {
 		if (_slotItemIDs[i] < 0) {
 			continue;
 		}
-		if (_uiivData->slotDestRects[i].contains(input.mousePos)) {
+		if (_uiivData->slotDestRects[i].contains(chunkMouse)) {
 			newHovered = (int)i;
 			break;
 		}
@@ -260,7 +271,7 @@ void InventoryPopup::handleInput(NancyInput &input) {
 		if (!filter.enabled) {
 			continue;
 		}
-		if (!filter.button.destRect.contains(input.mousePos)) {
+		if (!filter.button.destRect.contains(chunkMouse)) {
 			continue;
 		}
 
diff --git a/engines/nancy/ui/notebookpopup.cpp b/engines/nancy/ui/notebookpopup.cpp
index 0c90cb68fa6..5f23126affe 100644
--- a/engines/nancy/ui/notebookpopup.cpp
+++ b/engines/nancy/ui/notebookpopup.cpp
@@ -112,6 +112,13 @@ void NotebookPopup::drawBackground() {
 }
 
 void NotebookPopup::drawTabs() {
+	// Sub-rects in the chunk are stored relative to header.normalDestRect.
+	// After we translate the popup by the viewport offset, _screenPosition
+	// no longer matches that origin, so popup-local conversions must
+	// subtract chunk.normalDestRect.topLeft, not _screenPosition.
+	const Common::Point chunkOrigin(_uinbData->header.normalDestRect.left,
+									_uinbData->header.normalDestRect.top);
+
 	for (uint i = 0; i < kNumTabs; ++i) {
 		const UIButtonSlot &tab = _uinbData->tabs[i];
 		if (!tab.enabled) {
@@ -127,10 +134,9 @@ void NotebookPopup::drawTabs() {
 			continue;
 		}
 
-		Common::Rect dst = tab.button.destRect;
-		dst.translate(-_screenPosition.left, -_screenPosition.top);
-
-		_drawSurface.blitFrom(_overlayImage, src, Common::Point(dst.left, dst.top));
+		_drawSurface.blitFrom(_overlayImage, src,
+								Common::Point(tab.button.destRect.left - chunkOrigin.x,
+												tab.button.destRect.top - chunkOrigin.y));
 	}
 
 	_needsRedraw = true;
@@ -141,13 +147,19 @@ void NotebookPopup::handleInput(NancyInput &input) {
 		return;
 	}
 
+	// Bring the mouse into the chunk's coordinate system so hit-tests
+	// against tab destRects work after the popup was translated.
+	const Common::Point chunkMouse(
+		input.mousePos.x - _screenPosition.left + _uinbData->header.normalDestRect.left,
+		input.mousePos.y - _screenPosition.top  + _uinbData->header.normalDestRect.top);
+
 	// Tab clicks
 	for (uint i = 0; i < kNumTabs; ++i) {
 		const UIButtonSlot &tab = _uinbData->tabs[i];
 		if (!tab.enabled) {
 			continue;
 		}
-		if (!tab.button.destRect.contains(input.mousePos)) {
+		if (!tab.button.destRect.contains(chunkMouse)) {
 			continue;
 		}
 


Commit: 17e666cfc241aaca68712d274e9a2fa74c274384
    https://github.com/scummvm/scummvm/commit/17e666cfc241aaca68712d274e9a2fa74c274384
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-05T03:58:29+03:00

Commit Message:
NANCY: Remove unnecessary game version checks in action record checks

Changed paths:
    engines/nancy/action/arfactory.cpp


diff --git a/engines/nancy/action/arfactory.cpp b/engines/nancy/action/arfactory.cpp
index 0a97818a86d..eb51a53fa2e 100644
--- a/engines/nancy/action/arfactory.cpp
+++ b/engines/nancy/action/arfactory.cpp
@@ -167,15 +167,9 @@ ActionRecord *ActionManager::createActionRecord(uint16 type, Common::SeekableRea
 		else
 			return new HotMultiframeMultiSceneChange();	// Moved from 13 in Nancy 10
 	case 27:
-		if (g_nancy->getGameType() >= kGameTypeNancy10)
-			return new HotMultiframeMultiSceneCursorTypeSceneChange(); // Moved from 24 to 27 in Nancy10
-		// fallthrough
-		// FIXME: Is fallthrough intended here?
+		return new HotMultiframeMultiSceneCursorTypeSceneChange(); // Moved from 24 to 27 in Nancy10
 	case 28:
-		if (g_nancy->getGameType() >= kGameTypeNancy10)
-			return new InteractiveVideo();	// Moved from 26 to 28 in Nancy10
-		// fallthrough
-		// FIXME: Is fallthrough intended here?
+		return new InteractiveVideo();	// Moved from 26 to 28 in Nancy10
 	case 29:
 		// Nancy 10+
 		return new ControlUIItems();


Commit: 9c786bfc7439b876a2f26d49eee0f76c8f5a5cad
    https://github.com/scummvm/scummvm/commit/9c786bfc7439b876a2f26d49eee0f76c8f5a5cad
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-05-05T03:58:31+03:00

Commit Message:
NANCY: Implement differences in ModifyListEntry for Nancy10+

These are used for while checking to add notebook entries

Changed paths:
    engines/nancy/action/datarecords.cpp


diff --git a/engines/nancy/action/datarecords.cpp b/engines/nancy/action/datarecords.cpp
index 5b77b6ae19a..ee01633f6e9 100644
--- a/engines/nancy/action/datarecords.cpp
+++ b/engines/nancy/action/datarecords.cpp
@@ -407,7 +407,13 @@ void ModifyListEntry::readData(Common::SeekableReadStream &stream) {
 	readFilename(stream, _stringID);
 	_mark = stream.readUint16LE();
 
-	if (g_nancy->getGameType() >= kGameTypeNancy9 && _mark >= 10) {
+	if (g_nancy->getGameType() >= kGameTypeNancy10) {
+		// Nancy 10+: the trailing sceneID is always present
+		_sceneID = stream.readUint16LE();
+		if (_mark < 10 && _mark != 7)
+			_sceneID = kNoScene;
+	} else if (g_nancy->getGameType() >= kGameTypeNancy9 && _mark >= 10) {
+		// Nancy 9: the trailing sceneID is only present when mark >= 10.
 		_sceneID = stream.readUint16LE();
 	}
 }




More information about the Scummvm-git-logs mailing list