So I have this ready-made function that matches colours to the closest available colour that can be displayed. It:
a) gets an HDC for a DirectDraw surface
b) saves the pixel that is at (0,0)
c) uses SetPixel() to set it to the colour passed in the arguments
d) goes through a bunch of other painful-looking steps to figure out what colour was used (i.e. "lock the surface", then "get DWORD", then "Mask it to bpp")
e) sets the pixel back to the original colour.
My question is, couldn't it just
a) get the pixel
b) use SetPixelV() to set it to the "closest approximation of" the passed colour
c) GetPixel() to find the colour that was used
d) set the pixel back to the original colour
Wouldn't that work just as well? (anyways, what's up with the masking to bpp?)