[Bug 2666] Text color lost

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Sep 27 23:41:34 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=2666

--- Comment #41 from Alex Henrie <alexhenrie24 at 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.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list