ddraw: Map ZBIAS values to a smaller depth range.
This commit is contained in:
parent
7b1e081515
commit
a1519e62f4
@ -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,
|
|||||||
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,
|
|||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user