[4/6] ddraw: Convert dwZBufferBitDepth into a DDPIXELFORMAT (try 2)

Henri Verbeet hverbeet at gmail.com
Tue Aug 30 07:19:11 CDT 2011


On 30 August 2011 12:57, Stefan Dösinger <stefan at codeweavers.com> wrote:
> +static DWORD make_bitmask(DWORD count)
> +{
> +    DWORD ret = 0;
> +    for (count--; count != ~0U; count--) ret |= 1 << count;
> +    return ret;
> +}
You could probably do something like "return count ? ~0U >> (32 - count) : 0;"

In this specific case you probably don't care about 0 though, so you
might as well just do something like
"out->u4.ddpfPixelFormat.u3.dwZBitMask = ~0U >> (32 -
in->u2.dwZBufferBitDepth);".



More information about the wine-devel mailing list