Skip to content

Commit

Permalink
Fix default value of "D3DRS_POINTSIZE_MIN" (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSnowfall authored Oct 11, 2024
1 parent 61be8d5 commit 52a36f0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion source/d3d8to9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Direct3DDevice8::Direct3DDevice8(Direct3D8 *d3d, IDirect3DDevice9 *ProxyInterfac
{
ProxyAddressLookupTable = new AddressLookupTable(this);
PaletteFlag = SupportsPalettes();

// The default value of D3DRS_POINTSIZE_MIN is 0.0f in D3D8,
// whereas in D3D9 it is 1.0f, so adjust it as needed
ProxyInterface->SetRenderState(D3DRS_POINTSIZE_MIN, (DWORD) 0.0f);
}
Direct3DDevice8::~Direct3DDevice8()
{
Expand Down Expand Up @@ -224,7 +228,16 @@ HRESULT STDMETHODCALLTYPE Direct3DDevice8::Reset(D3DPRESENT_PARAMETERS8 *pPresen
}
}

return ProxyInterface->Reset(&PresentParams);
HRESULT hr = ProxyInterface->Reset(&PresentParams);

if (SUCCEEDED(hr))
{
// The default value of D3DRS_POINTSIZE_MIN is 0.0f in D3D8,
// whereas in D3D9 it is 1.0f, so adjust it as needed
ProxyInterface->SetRenderState(D3DRS_POINTSIZE_MIN, (DWORD) 0.0f);
}

return hr;
}
HRESULT STDMETHODCALLTYPE Direct3DDevice8::Present(const RECT *pSourceRect, const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion)
{
Expand Down

0 comments on commit 52a36f0

Please sign in to comment.