Re: [4/6] ddraw: Convert dwZBufferBitDepth into a DDPIXELFORMAT (try 2)
30 Aug
2011
30 Aug
'11
12:19 p.m.
On 30 August 2011 12:57, Stefan Dösinger <stefan(a)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);".
5221
Age (days ago)
5221
Last active (days ago)
0 comments
1 participants
participants (1)
-
Henri Verbeet