Skip to content

Commit

Permalink
Fix D3DTSS_MAGFILTER types
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Apr 6, 2024
1 parent c47452d commit 58b098f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 6997
#define BUILD_NUMBER 6998
32 changes: 31 additions & 1 deletion ddraw/IDirect3DDeviceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,25 @@ HRESULT m_IDirect3DDeviceX::GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGES
case D3DTSS_BORDERCOLOR:
return (*d3d9Device)->GetSamplerState(dwStage, D3DSAMP_BORDERCOLOR, lpdwValue);
case D3DTSS_MAGFILTER:
return (*d3d9Device)->GetSamplerState(dwStage, D3DSAMP_MAGFILTER, lpdwValue);
{
HRESULT hr = (*d3d9Device)->GetSamplerState(dwStage, D3DSAMP_MAGFILTER, lpdwValue);
if (SUCCEEDED(hr))
{
if (*lpdwValue == D3DTEXF_ANISOTROPIC)
{
*lpdwValue = D3DTFG_ANISOTROPIC;
}
else if (*lpdwValue == D3DTEXF_PYRAMIDALQUAD)
{
*lpdwValue = D3DTFG_FLATCUBIC;
}
else if (*lpdwValue == D3DTEXF_GAUSSIANQUAD)
{
*lpdwValue = D3DTFG_GAUSSIANCUBIC;
}
}
return hr;
}
case D3DTSS_MINFILTER:
return (*d3d9Device)->GetSamplerState(dwStage, D3DSAMP_MINFILTER, lpdwValue);
case D3DTSS_MIPFILTER:
Expand Down Expand Up @@ -1177,6 +1195,18 @@ HRESULT m_IDirect3DDeviceX::SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGES
case D3DTSS_BORDERCOLOR:
return (*d3d9Device)->SetSamplerState(dwStage, D3DSAMP_BORDERCOLOR, dwValue);
case D3DTSS_MAGFILTER:
if (dwValue == D3DTFG_ANISOTROPIC)
{
dwValue = D3DTEXF_ANISOTROPIC;
}
else if (dwValue == D3DTFG_FLATCUBIC)
{
dwValue = D3DTEXF_PYRAMIDALQUAD;
}
else if (dwValue == D3DTFG_GAUSSIANCUBIC)
{
dwValue = D3DTEXF_GAUSSIANQUAD;
}
return (*d3d9Device)->SetSamplerState(dwStage, D3DSAMP_MAGFILTER, dwValue);
case D3DTSS_MINFILTER:
return (*d3d9Device)->SetSamplerState(dwStage, D3DSAMP_MINFILTER, dwValue);
Expand Down

0 comments on commit 58b098f

Please sign in to comment.