Tiny fix to mapping of palette in dlls/winex11.drv/palette.c
Lars-Åke Fredlund
fred at babel.ls.fi.upm.es
Wed Jan 30 06:44:47 CST 2008
In dlls/winex11.drv/palette.c the mapping was always stored in an X
context (palette_set_mapping) during the call to X11DRV_PALETTE_Init.
However, when a palette is realized (X11DRV_RealizePalette) the mapping
is not updated if the condition X11DRV_PALETTE_PaletteFlags &
X11DRV_PALETTE_VIRTUAL is true.
Later, when the "physical color" is computed (by
X11DRV_PALETTE_ToPhysical) the function recognizes that there is a
mapping (even if no map is needed due to X11DRV_PALETTE_VIRTUAL) in the
lines:
> if (mapping) return mapping[idx];
> color = RGB( entry.peRed, entry.peGreen, entry.peBlue );
> break;
Thus the wrong color (not from the "realized" palette", but from the
initial one) may be returned by the mapping. This occurs for instance
for the game "Front Page Sports Football 98" (game statistics are
rendered invisible in black instead of in yellow).
One fix (realized by the included patch) is simply to never assign a
mapping (in X11DRV_PALETTE_INIT) if X11DRV_PALETTE_VIRTUAL is set.
/Lars-Ake Fredlund
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-moved-call-to-palette_set_mapping.patch
Type: text/x-patch
Size: 0 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080130/7de4add4/attachment.bin
More information about the wine-patches
mailing list