case WINED3DRS_FOGCOLOR:
/* Valid Values are between 0 and FFFF (4 bytes alpha, red,
green, and blue)) */
if ((Value >= 0) ||
(Value <= 0xFFFF)) break;
Humm, this does not sound right to me. The fog color used to be A8R8G8B8, thus equal values are between 0xFFFFFFFF and 0x00000000. I don't know what native D3D does with the alpha in fog though.
As you can see in dlls/d3d9/tests/visual.c, if you search for D3DRS_FOGCOLOR, there are lots of calls which have color values > 0xFFFF and succeed:
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGCOLOR, 0xFF00FF00 /* A nice green */); ok(hr == D3D_OK, "Turning on fog calculations returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGCOLOR, 0xFF00FF00 /* A nice green */); ok(hr == D3D_OK, "Setting fog color failed (%08x)\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGCOLOR, 0xffffffff); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr);