(try 3) programs/winemenubuilder: scale 64x64 classic icons to 48x48 for Icns format

Ken Thomases ken at codeweavers.com
Wed Oct 17 10:58:32 CDT 2012


On Oct 17, 2012, at 9:50 AM, Aric Stewart wrote:

> -        if (iconDirEntries[i].wBitCount >= best[slot].maxBits)
> +        if (((best[slot].maxBits && !scaled) || (!best[slot].maxBits) || (scaled && best[slot].scaled)) && (iconDirEntries[i].wBitCount >= best[slot].maxBits || (!scaled && best[slot].scaled)))

This could be more clearly written as:

        if ((!scaled || !best[slot].maxBits || best[slot].scaled) &&
            (iconDirEntries[i].wBitCount >= best[slot].maxBits || (!scaled && best[slot].scaled)))

or even:

        if (scaled && best[slot].maxBits && !best[slot].scaled)
            continue; /* don't replace unscaled with scaled */
        if (iconDirEntries[i].wBitCount >= best[slot].maxBits || (!scaled && best[slot].scaled))

That is, your left side of the outer && has redundancies and all the negatives make it hard to penetrate.

-Ken




More information about the wine-devel mailing list