[Scummvm-git-logs] scummvm master -> 513fce71772f3b9f73e7f969e8d1707a2cf54402

bluegr noreply at scummvm.org
Thu Jul 16 22:40:00 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:
de65395590 NANCY: NANCY4: Handle compression correctly in CIF files
852375af46 NANCY: NANCY13: Use 32bpp for screen graphics
4250f61a03 NANCY: NANCY13: Add text color parsing to UINB chunk
a6b944fd5a NANCY: NANCY13: Use new notebook tab ordering
ed19e936eb NANCY: NANCY13: Fix frame time calculation in conversation animations
513fce7177 NANCY: NANCY13: Correctly handle 32bpp notebook assets


Commit: de6539559011efea37df5fc08ef257a0990fd953
    https://github.com/scummvm/scummvm/commit/de6539559011efea37df5fc08ef257a0990fd953
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-07-17T01:39:47+03:00

Commit Message:
NANCY: NANCY4: Handle compression correctly in CIF files

Since Nancy4, CIF compression is decided from the resource type, rather
than the "comp" flag

Changed paths:
    engines/nancy/cif.cpp


diff --git a/engines/nancy/cif.cpp b/engines/nancy/cif.cpp
index 43ecc5f41bc..7ee50847bbf 100644
--- a/engines/nancy/cif.cpp
+++ b/engines/nancy/cif.cpp
@@ -61,11 +61,13 @@ static void syncCifInfo(Common::Serializer &ser, CifInfo &info, bool tree) {
 		info.dataOffset = ser.bytesSynced();
 	}
 
-	// HACK: Since Nancy14, the compression flag isn't set
-	// in the header. Try to detect compressed files by the
-	// presence of a compressed size
-	if (g_nancy->getGameType() >= kGameTypeNancy14 && info.compressedSize > 0)
-		info.comp = CifInfo::kResCompression;
+	// From Nancy4 on, the original decides compression from the resource type
+	// (image and script resources are always LZSS-compressed) and ignores the
+	// 'comp' byte, which isn't reliably written in the later games. Only Nancy2
+	// and Nancy3 actually key off the 'comp' byte read above.
+	if (g_nancy->getGameType() >= kGameTypeNancy4)
+		info.comp = (info.type == CifInfo::kResTypeImage || info.type == CifInfo::kResTypeScript) ?
+			CifInfo::kResCompression : CifInfo::kResCompressionNone;
 }
 
 // Reads the data for ciftree cif files


Commit: 852375af4669bab0f48e838ffda80f3a04b82a74
    https://github.com/scummvm/scummvm/commit/852375af4669bab0f48e838ffda80f3a04b82a74
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-07-17T01:39:48+03:00

Commit Message:
NANCY: NANCY13: Use 32bpp for screen graphics

>From Nancy13 onwards, games use 32bpp instead of 16bpp. Use 32bpp and
remove relevant hacks in the game resource loading code.

Fixes cursors and character transparency in Nancy13+

Changed paths:
    engines/nancy/cursor.cpp
    engines/nancy/graphics.cpp
    engines/nancy/graphics.h
    engines/nancy/resource.cpp


diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index 29af3cc1472..88ab36e6c0a 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -386,7 +386,7 @@ void CursorManager::warpCursor(const Common::Point &pos) {
 }
 
 void CursorManager::applyCursor() {
-	bool isNancy13 = g_nancy->getGameType() >= kGameTypeNancy13;
+	const bool isNancy13 = g_nancy->getGameType() >= kGameTypeNancy13;
 
 	if (_curCursorID != _lastCursorID) {
 		Graphics::ManagedSurface *surf;
@@ -400,7 +400,7 @@ void CursorManager::applyCursor() {
 
 		Graphics::ManagedSurface temp(*surf, bounds);
 
-		CursorMan.replaceCursor(temp, hotspot.x, hotspot.y, !isNancy13 ? g_nancy->_graphics->getTransColor() : 0);
+		CursorMan.replaceCursor(temp, hotspot.x, hotspot.y, g_nancy->_graphics->getTransColor());
 		if (g_nancy->getGameType() == kGameTypeVampire) {
 			byte palette[3 * 256];
 			surf->grabPalette(palette, 0, 256);
diff --git a/engines/nancy/graphics.cpp b/engines/nancy/graphics.cpp
index 0454b20ab16..c4c6662318b 100644
--- a/engines/nancy/graphics.cpp
+++ b/engines/nancy/graphics.cpp
@@ -37,12 +37,12 @@ GraphicsManager::GraphicsManager() :
 	_inputPixelFormat16(2, 5, 5, 5, 0, 10, 5, 0, 0),
 	_inputPixelFormat24(Graphics::PixelFormat::createFormatBGR24()),
 	_inputPixelFormat32(Graphics::PixelFormat::createFormatBGRA32()),
-	_screenPixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0),
+	_screenPixelFormat16(2, 5, 6, 5, 0, 11, 5, 0, 0),
+	_screenPixelFormat32(Graphics::PixelFormat::createFormatBGRA32()),
 	_clut8Format(Graphics::PixelFormat::createFormatCLUT8()),
-	_transparentPixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0),
-	_isSuppressed(false),
-	_screen(640, 480, _screenPixelFormat){}
-
+	_transparentPixelFormat(Graphics::PixelFormat::createFormatBGRA32()),
+	_screen(640, 480, getScreenPixelFormat()),
+	_isSuppressed(false){}
 void GraphicsManager::init() {
 	auto *bsum = GetEngineData(BSUM);
 	assert(bsum);
@@ -51,12 +51,13 @@ void GraphicsManager::init() {
 	if (g_nancy->getGameType() == kGameTypeVampire) {
 		_transColor = bsum->paletteTrans;
 	} else {
-		_transColor = 	(bsum->rTrans << _inputPixelFormat16.rShift) |
-						(bsum->gTrans << _inputPixelFormat16.gShift) |
-						(bsum->bTrans << _inputPixelFormat16.bShift);
+		const Graphics::PixelFormat &format = getInputPixelFormat();
+		_transColor = (bsum->rTrans << format.rShift) |
+					  (bsum->gTrans << format.gShift) |
+					  (bsum->bTrans << format.bShift);
 	}
 
-	initGraphics(640, 480, &_screenPixelFormat);
+	initGraphics(640, 480, &getScreenPixelFormat());
 	_screen.setTransparentColor(getTransColor());
 	_screen.clear();
 
@@ -412,7 +413,7 @@ const Graphics::PixelFormat &GraphicsManager::getInputPixelFormat(uint bpp) {
 }
 
 const Graphics::PixelFormat &GraphicsManager::getScreenPixelFormat() {
-	return _screenPixelFormat;
+	return (g_nancy->getGameType() >= kGameTypeNancy13) ? _screenPixelFormat32 : _screenPixelFormat16;
 }
 
 const Graphics::PixelFormat &GraphicsManager::getTransparentPixelFormat() {
diff --git a/engines/nancy/graphics.h b/engines/nancy/graphics.h
index efd903a273f..c57540489e9 100644
--- a/engines/nancy/graphics.h
+++ b/engines/nancy/graphics.h
@@ -86,7 +86,7 @@ private:
 	Common::SortedArray<RenderObject *> _objects;
 
 	Graphics::PixelFormat _inputPixelFormat16, _inputPixelFormat24, _inputPixelFormat32;
-	Graphics::PixelFormat _screenPixelFormat;
+	Graphics::PixelFormat _screenPixelFormat16, _screenPixelFormat32;
 	Graphics::PixelFormat _clut8Format;
 	Graphics::PixelFormat _transparentPixelFormat;
 
diff --git a/engines/nancy/resource.cpp b/engines/nancy/resource.cpp
index c682578adcd..e981df1ff52 100644
--- a/engines/nancy/resource.cpp
+++ b/engines/nancy/resource.cpp
@@ -176,13 +176,6 @@ bool ResourceManager::loadImage(const Common::Path &name, Graphics::ManagedSurfa
 
 	GraphicsManager::copyToManaged(buf, surf, info.width, info.height, g_nancy->_graphics->getInputPixelFormat(info.depth));
 
-	if (info.depth != 16) {
-		// Convert 24/32 bpp images to 16 bpp on the fly since that's what the
-		// engine uses internally. These images are used since nancy13.
-		// TODO: add support for 24/32 bpp surfaces in the engine and skip this conversion
-		surf.convertToInPlace(g_nancy->_graphics->getInputPixelFormat());
-	}
-
 	delete[] buf;
 	delete stream;
 	return true;


Commit: 4250f61a032c15874521ede52c29d30e7e7a8276
    https://github.com/scummvm/scummvm/commit/4250f61a032c15874521ede52c29d30e7e7a8276
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-07-17T01:39:48+03:00

Commit Message:
NANCY: NANCY13: Add text color parsing to UINB chunk

Fixes crash when opening the notebook

Changed paths:
    engines/nancy/enginedata.cpp
    engines/nancy/enginedata.h


diff --git a/engines/nancy/enginedata.cpp b/engines/nancy/enginedata.cpp
index 267443139f0..fbaa910805d 100644
--- a/engines/nancy/enginedata.cpp
+++ b/engines/nancy/enginedata.cpp
@@ -1114,6 +1114,17 @@ UINB::UINB(Common::SeekableReadStream *chunkStream) : EngineData(chunkStream) {
 	}
 
 	readRect(*chunkStream, textRect);
+
+	if (g_nancy->getGameType() >= kGameTypeNancy13) {
+		// Two RGB text colors, added in Nancy 13
+		for (uint i = 0; i < 3; ++i) {
+			primaryTextColor[i] = chunkStream->readByte();
+		}
+		for (uint i = 0; i < 3; ++i) {
+			secondaryTextColor[i] = chunkStream->readByte();
+		}
+	}
+
 	primaryFontID = chunkStream->readUint16LE();
 	secondaryFontAttr = chunkStream->readUint16LE();
 	useFilenameTextFlag = chunkStream->readUint16LE();
diff --git a/engines/nancy/enginedata.h b/engines/nancy/enginedata.h
index c4fb7797577..9355488d99c 100644
--- a/engines/nancy/enginedata.h
+++ b/engines/nancy/enginedata.h
@@ -733,6 +733,8 @@ struct UINB : public EngineData {
 	UIPopupHeader header;
 	UIButtonSlot tabs[kNumTabs];
 	Common::Rect textRect;
+	byte primaryTextColor[3] = {};    // RGB, Nancy 13+
+	byte secondaryTextColor[3] = {};  // RGB, Nancy 13+
 	uint16 primaryFontID = 0;
 	uint16 secondaryFontAttr = 0;
 	uint16 useFilenameTextFlag = 0;


Commit: a6b944fd5ad12fec9d82b122c26f17c829e09f34
    https://github.com/scummvm/scummvm/commit/a6b944fd5ad12fec9d82b122c26f17c829e09f34
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-07-17T01:39:49+03:00

Commit Message:
NANCY: NANCY13: Use new notebook tab ordering

Fixes inverted notebook tabs in Nancy13

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


diff --git a/engines/nancy/ui/notebookpopup.cpp b/engines/nancy/ui/notebookpopup.cpp
index 0cc4cc10277..562a9541ce6 100644
--- a/engines/nancy/ui/notebookpopup.cpp
+++ b/engines/nancy/ui/notebookpopup.cpp
@@ -437,6 +437,10 @@ void NotebookPopup::refreshContent() {
 	drawForeground();
 }
 
+uint16 NotebookPopup::notebookJournalTabId() const {
+	return g_nancy->getGameType() >= kGameTypeNancy13 ? 0 : 1;
+}
+
 void NotebookPopup::buildTextLines() {
 	if (!_uinbData)
 		return;
@@ -445,8 +449,10 @@ void NotebookPopup::buildTextLines() {
 	if (!tab.enabled)
 		return;
 
-	// tab.id 1 (top/book) → Journal; tab.id 2 (bottom/clipboard) → Tasks.
-	const uint16 surfaceID = (tab.id == 1) ? kNotebookTabJournal : kNotebookTabTasks;
+	// The lower tab id (top/book) is the Journal; the higher (bottom/clipboard)
+	// is the Tasks list. Nancy 13 renumbered the tab ids from {1,2} to {0,1}.
+	const uint16 journalTabId = notebookJournalTabId();
+	const uint16 surfaceID = (tab.id == journalTabId) ? kNotebookTabJournal : kNotebookTabTasks;
 
 	JournalData *journalData = (JournalData *)NancySceneState.getPuzzleData(JournalData::getTag());
 	if (!journalData)
@@ -519,7 +525,7 @@ void NotebookPopup::drawContent() {
 
 	// Only the Tasklist has clickable checkboxes; record their glyph rects.
 	const UIButtonSlot &activeTab = _uinbData->tabs[_activeTab];
-	const bool tasksTab = activeTab.enabled && activeTab.id != 1;
+	const bool tasksTab = activeTab.enabled && activeTab.id != notebookJournalTabId();
 	_recordMarkHotspots = tasksTab;
 
 	buildTextLines();
diff --git a/engines/nancy/ui/notebookpopup.h b/engines/nancy/ui/notebookpopup.h
index 10969d1bd6b..d592858e60a 100644
--- a/engines/nancy/ui/notebookpopup.h
+++ b/engines/nancy/ui/notebookpopup.h
@@ -94,6 +94,10 @@ private:
 	Common::Rect toPopupLocal(const Common::Rect &chunkRect, bool useGameFrame) const;
 	Common::Point popupLocalMouse(const Common::Point &screenMouse) const;
 
+	// The UINB tab id of the Journal (book) tab. Nancy 13 renumbered the tab
+	// ids from {1,2} to {0,1}, so the Journal id dropped from 1 to 0.
+	uint16 notebookJournalTabId() const;
+
 	// Populate HypertextParser's text-line list with the active tab's
 	// entries.
 	void buildTextLines();


Commit: ed19e936eb1c7067c72133c7901da1acd16e2133
    https://github.com/scummvm/scummvm/commit/ed19e936eb1c7067c72133c7901da1acd16e2133
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-07-17T01:39:50+03:00

Commit Message:
NANCY: NANCY13: Fix frame time calculation in conversation animations

Changed paths:
    engines/nancy/action/conversation.cpp
    engines/nancy/action/conversation.h


diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index 38dc1f7f905..03b183e471b 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -960,11 +960,12 @@ void ConversationCel::readXSheet(Common::SeekableReadStream &stream, const Commo
 	uint16 numTrees = 4;
 
 	if (isNancy13) {
-		// Nancy13 moved the cel tree / .cal names into the XSheet header. Each
-		// frame is a fixed-size block of numTrees cel names plus padding.
-
-		const uint kTreeNamesOffset = 38;
-		const uint kFrameDataOffset = 174;
+		// Nancy13 moved the cel tree / .cal names into the XSheet header, which
+		// reserves a fixed kMaxTrees name slots followed by a 32-bit frame time;
+		// the frame data begins right after. Each frame is likewise a fixed-size
+		// block of kMaxTrees name slots. Earlier games keep the tree names in the
+		// AR data and use a 16-bit frame time.
+		const uint kMaxTrees = 4;
 
 		numTrees = xsheet->readUint16LE();
 
@@ -973,8 +974,10 @@ void ConversationCel::readXSheet(Common::SeekableReadStream &stream, const Commo
 			readFilename(*xsheet, _treeNames[j]);
 		}
 
-		_frameTime = xsheet->readUint16LE();
-		xsheet->skip(kFrameDataOffset - kTreeNamesOffset - numTrees * kNameSize - 2);
+		// Skip any unused tree-name slots so the frame time is read from its fixed
+		// offset regardless of numTrees.
+		xsheet->skip((kMaxTrees - numTrees) * kNameSize);
+		_frameTime = xsheet->readUint32LE();
 	} else {
 		xsheet->skip(2);
 		_frameTime = xsheet->readUint16LE();
diff --git a/engines/nancy/action/conversation.h b/engines/nancy/action/conversation.h
index b1a9f4870f0..ea33c8f72a7 100644
--- a/engines/nancy/action/conversation.h
+++ b/engines/nancy/action/conversation.h
@@ -207,7 +207,7 @@ protected:
 	Common::Array<Common::Array<Common::Path>> _celNames;
 	Common::Array<Common::String> _treeNames;
 
-	uint16 _frameTime = 0;
+	uint32 _frameTime = 0;
 	uint _videoFormat = kLargeVideoFormat;
 	uint16 _firstFrame = 0;
 	uint16 _lastFrame = 0;


Commit: 513fce71772f3b9f73e7f969e8d1707a2cf54402
    https://github.com/scummvm/scummvm/commit/513fce71772f3b9f73e7f969e8d1707a2cf54402
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-07-17T01:39:50+03:00

Commit Message:
NANCY: NANCY13: Correctly handle 32bpp notebook assets

Fixes notebook display

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


diff --git a/engines/nancy/ui/notebookpopup.cpp b/engines/nancy/ui/notebookpopup.cpp
index 562a9541ce6..da5f62923f0 100644
--- a/engines/nancy/ui/notebookpopup.cpp
+++ b/engines/nancy/ui/notebookpopup.cpp
@@ -74,14 +74,15 @@ void NotebookPopup::init() {
 	moveTo(popupRect);
 	Common::Rect bounds = _screenPosition;
 	bounds.moveTo(0, 0);
-	_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphics->getInputPixelFormat());
+	_drawSurface.create(bounds.width(), bounds.height(), g_nancy->_graphics->getScreenPixelFormat());
 
 	// Transparent-keyed scratch surfaces so text blits over the paper
 	// painted by drawBackground() — paper stays stationary while text
 	// scrolls. Color 0 would clip real font pixels in Nancy fonts.
 	const uint32 trans = g_nancy->_graphics->getTransColor();
+	const uint bpp = g_nancy->getGameType() >= kGameTypeNancy13 ? 32 : 16;
 	initSurfaces(_uinbData->textRect.width(), kHypertextSurfaceHeight,
-		g_nancy->_graphics->getInputPixelFormat(), trans, trans);
+		g_nancy->_graphics->getInputPixelFormat(bpp), trans, trans);
 	_fullSurface.setTransparentColor(trans);
 	_textHighlightSurface.setTransparentColor(trans);
 




More information about the Scummvm-git-logs mailing list