http://bugs.winehq.org/show_bug.cgi?id=2666
--- Comment #41 from Alex Henrie alexhenrie24@gmail.com 2011-09-27 23:41:34 CDT --- Created attachment 36592 --> http://bugs.winehq.org/attachment.cgi?id=36592 Proposed patch
This is a patch I wrote which fixes both the menu text colors and the "acid trip" color problems in the Age of Empires II demo. The problem was centered around the following code in X11DRV_DIB_GetImageBits_8:
/* * Hack for now * This condition is true when GetImageBits has been called by * UpdateDIBSection. For now, GetNearestIndex is too slow to support * 256 colormaps, so we'll just use it for GetDIBits calls. * (In some cases, in an updateDIBSection, the returned colors are bad too) */ if (!srccolors) goto updatesection;
When this statement was removed, the bugs went away but the performance suffered. To fix the performance, I rewrote X11DRV_DIB_GetNearestIndex to optimize for colors that are exact matches of the colors in the color map. This optimization works excellently for Age of Empires II and should work well for other applications also. I made a minor change to X11DRV_DIB_DoCopyDIBSection to slightly improve performance as well.
Please let me know how this patch works for you. I would love to see it accepted into WINE.