gdi32: Return default palette entries from GetSystemPaletteEntries for non-palette-based devices. (try 2)

Anton Baskanov baskanov at gmail.com
Mon Jun 1 22:49:42 CDT 2015


Oops :-) Thanks for spotting! I'll resend the patch with your changes
and tests included.

On Mon, Jun 1, 2015 at 10:29 PM, Sebastian Lackner
<sebastian at fds-team.de> wrote:
> On 01.06.2015 17:51, Anton Baskanov wrote:
>> +            if (entries && start < 256)
>> +            {
>> +                UINT i;
>> +                const RGBQUAD *default_entries;
>> +
>> +                if (start + count > 256) count = 256 - start;
>> +
>> +                default_entries = get_default_color_table( 8 );
>> +                for (i = 0; i < count; ++i)
>> +                {
>> +                    if (i < 10 || i >= 246)
>> +                    {
>
> That condition is obviously wrong. Feel free to merge the changes and additional tests from my improved patchset which is included in Wine-Staging:
> https://github.com/wine-compholio/wine-staging/blob/master/patches/gdi32-Default_Palette/0001-gdi32-Return-default-palette-entries-from-GetSystemP.patch#L39
>
>> +                        entries[i].peRed = default_entries[start + i].rgbRed;
>> +                        entries[i].peGreen = default_entries[start + i].rgbGreen;
>> +                        entries[i].peBlue = default_entries[start + i].rgbBlue;
>> +                    }
>> +                    else
>> +                    {
>> +                        entries[i].peRed = 0;
>> +                        entries[i].peGreen = 0;
>> +                        entries[i].peBlue = 0;
>> +                    }
>> +                    entries[i].peFlags = 0;
>> +                }
>



More information about the wine-devel mailing list