[Scummvm-git-logs] scummvm master -> 9cd7eece6e0db31df8ff6bccbb331969e680eb32
bluegr
noreply at scummvm.org
Wed Aug 19 00:35:36 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
9cd7eece6e NANCY: Fix chroma-keyed Bink videos not being keyed
Commit: 9cd7eece6e0db31df8ff6bccbb331969e680eb32
https://github.com/scummvm/scummvm/commit/9cd7eece6e0db31df8ff6bccbb331969e680eb32
Author: fedossayenko (fedyaq1 at gmail.com)
Date: 2026-08-19T03:35:30+03:00
Commit Message:
NANCY: Fix chroma-keyed Bink videos not being keyed
BinkDecoder decodes YUV into Codec::getDefaultYUVFormat(), which is the
screen format, while nancy's surfaces and the transparent colour taken
from the BSUM chunk use the engine's input format. Those differ before
Nancy13 - screen RGB565 against input RGB555 - and frames are copied
with copyToManaged(), which does not convert, so full green was stored
as 0x07E0 while the engine keyed on 0x03E0 and the key never matched.
>From Nancy13 both formats are BGRA32, so nothing changes there.
Ask the decoder for the engine's input format instead, after loadFile()
since setOutputPixelFormat() only reaches tracks that already exist.
This became visible in Nancy11 after a72a80d started preferring Bink
over AVF, since the AVF decoder already decodes into the input format.
Fixes Nigel_Fidget.bik rendering as a green rectangle in the library,
and BLU_FoodCU_OVL, a keyed overlay used in 14 scenes that has no AVF
version at all.
Changed paths:
engines/nancy/movieplayer.cpp
diff --git a/engines/nancy/movieplayer.cpp b/engines/nancy/movieplayer.cpp
index 6c6ad8aa384..1c3f2916efa 100644
--- a/engines/nancy/movieplayer.cpp
+++ b/engines/nancy/movieplayer.cpp
@@ -26,6 +26,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/video.h"
+#include "engines/nancy/graphics.h"
#include "engines/nancy/util.h"
#include "engines/nancy/commontypes.h"
@@ -73,6 +74,21 @@ bool MoviePlayer::loadFile(const Common::Path &name, bool bidirectionalCache) {
return false;
}
+ // Bink decodes YUV into Codec::getDefaultYUVFormat(), i.e. the *screen* format, but
+ // our surfaces - and the transparent colour derived from the BSUM chunk - use the
+ // *input* format. Those differ before Nancy13 (screen RGB565, input RGB555), so a
+ // chroma-keyed video such as Nancy11's Nigel_Fidget.bik ends up storing its key
+ // colour as 0x07E0 while the engine keys on 0x03E0, and the green background is
+ // never keyed out. From Nancy13 both formats are BGRA32 and this is a no-op.
+ // Has to come after loadFile(): setOutputPixelFormat() walks the decoder's tracks,
+ // and those only exist once the file is loaded.
+ if (_videoType == kVideoPlaytypeBink) {
+ const Graphics::PixelFormat &inputFormat = g_nancy->_graphics->getInputPixelFormat();
+ if (inputFormat.bytesPerPixel == 2 || inputFormat.bytesPerPixel == 4) {
+ _decoder->setOutputPixelFormat(inputFormat);
+ }
+ }
+
// The AVF decoder caches frames itself, so only the Bink path needs ours.
_useFrameCache = bidirectionalCache && _videoType == kVideoPlaytypeBink;
if (_useFrameCache) {
More information about the Scummvm-git-logs
mailing list