Skip to content

Commit

Permalink
Revert part of the D3DRS_ZBIAS value fix again (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud authored May 11, 2023
1 parent 06b33d3 commit aaddbe5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/d3d8to9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ HRESULT STDMETHODCALLTYPE Direct3DDevice8::SetRenderState(D3DRENDERSTATETYPE Sta
ClipPlaneRenderState = Value;
return hr;
case D3DRS_ZBIAS:
Biased = static_cast<FLOAT>(Value) * 0.000005f;
Biased = static_cast<FLOAT>(Value) * -0.000005f;
Value = *reinterpret_cast<const DWORD*>(&Biased);
State = D3DRS_DEPTHBIAS;
default:
Expand All @@ -753,7 +753,7 @@ HRESULT STDMETHODCALLTYPE Direct3DDevice8::GetRenderState(D3DRENDERSTATETYPE Sta
return ProxyInterface->GetRenderState(D3DRS_ANTIALIASEDLINEENABLE, pValue);
case D3DRS_ZBIAS:
hr = ProxyInterface->GetRenderState(D3DRS_DEPTHBIAS, pValue);
*pValue = static_cast<DWORD>(*reinterpret_cast<const FLOAT*>(pValue) * 200000.0f);
*pValue = static_cast<DWORD>(*reinterpret_cast<const FLOAT*>(pValue) * -200000.0f);
return hr;
case D3DRS_SOFTWAREVERTEXPROCESSING:
*pValue = ProxyInterface->GetSoftwareVertexProcessing();
Expand Down

0 comments on commit aaddbe5

Please sign in to comment.