Commit a1519e62 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

ddraw: Map ZBIAS values to a smaller depth range.

parent 7b1e0815
...@@ -2249,6 +2249,8 @@ static HRESULT WINAPI IDirect3DDeviceImpl_2_End(IDirect3DDevice2 *iface, DWORD d ...@@ -2249,6 +2249,8 @@ static HRESULT WINAPI IDirect3DDeviceImpl_2_End(IDirect3DDevice2 *iface, DWORD d
* DDERR_INVALIDPARAMS if Value == NULL * DDERR_INVALIDPARAMS if Value == NULL
* *
*****************************************************************************/ *****************************************************************************/
static const float zbias_factor = -0.000005f;
static HRESULT static HRESULT
IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface, IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
D3DRENDERSTATETYPE RenderStateType, D3DRENDERSTATETYPE RenderStateType,
...@@ -2383,7 +2385,7 @@ IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface, ...@@ -2383,7 +2385,7 @@ IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
hr = IWineD3DDevice_GetRenderState(This->wineD3DDevice, hr = IWineD3DDevice_GetRenderState(This->wineD3DDevice,
WINED3DRS_DEPTHBIAS, WINED3DRS_DEPTHBIAS,
&wined3d_value.d); &wined3d_value.d);
if (SUCCEEDED(hr)) *Value = -wined3d_value.f * 16.0f; if (SUCCEEDED(hr)) *Value = wined3d_value.f / zbias_factor;
break; break;
} }
...@@ -2708,7 +2710,7 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface, ...@@ -2708,7 +2710,7 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
DWORD d; DWORD d;
float f; float f;
} wined3d_value; } wined3d_value;
wined3d_value.f = Value / -16.0; wined3d_value.f = Value * zbias_factor;
hr = IWineD3DDevice_SetRenderState(This->wineD3DDevice, hr = IWineD3DDevice_SetRenderState(This->wineD3DDevice,
WINED3DRS_DEPTHBIAS, WINED3DRS_DEPTHBIAS,
wined3d_value.d); wined3d_value.d);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment