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

ddraw: Forward the mag filter correctly to wined3d.

Fixes the erros when using anisotropic mag filtering in the d3d7 filter demo.
parent 0fb41a88
......@@ -4032,12 +4032,28 @@ IDirect3DDeviceImpl_7_GetTextureStageState(IDirect3DDevice7 *iface,
Stage,
WINED3DSAMP_MINFILTER,
State);
/* Same for MAGFILTER */
/* Magfilter has slightly different values */
case D3DTSS_MAGFILTER:
return IWineD3DDevice_GetSamplerState(This->wineD3DDevice,
Stage,
WINED3DSAMP_MAGFILTER,
State);
{
HRESULT hr;
WINED3DTEXTUREFILTERTYPE wined3dfilter;
hr = IWineD3DDevice_GetSamplerState(This->wineD3DDevice,
Stage,
WINED3DSAMP_MAGFILTER,
&wined3dfilter);
switch(wined3dfilter)
{
case WINED3DTEXF_POINT: *State = D3DTFG_POINT; break;
case WINED3DTEXF_LINEAR: *State = D3DTFG_LINEAR; break;
case WINED3DTEXF_ANISOTROPIC: *State = D3DTFG_ANISOTROPIC; break;
case WINED3DTEXF_FLATCUBIC: *State = D3DTFG_FLATCUBIC; break;
case WINED3DTEXF_GAUSSIANCUBIC: *State = D3DTFG_GAUSSIANCUBIC; break;
default:
ERR("Unexpected wined3d mag filter value %d\n", wined3dfilter);
*State = D3DTFG_POINT;
}
return hr;
}
case D3DTSS_ADDRESS:
case D3DTSS_ADDRESSU:
......@@ -4126,12 +4142,26 @@ IDirect3DDeviceImpl_7_SetTextureStageState(IDirect3DDevice7 *iface,
Stage,
WINED3DSAMP_MINFILTER,
State);
/* Same for MAGFILTER */
/* Magfilter has slightly different values */
case D3DTSS_MAGFILTER:
{
WINED3DTEXTUREFILTERTYPE wined3dfilter;
switch((D3DTEXTUREMAGFILTER) State)
{
case D3DTFG_POINT: wined3dfilter = WINED3DTEXF_POINT; break;
case D3DTFG_LINEAR: wined3dfilter = WINED3DTEXF_LINEAR; break;
case D3DTFG_FLATCUBIC: wined3dfilter = WINED3DTEXF_FLATCUBIC; break;
case D3DTFG_GAUSSIANCUBIC: wined3dfilter = WINED3DTEXF_GAUSSIANCUBIC; break;
case D3DTFG_ANISOTROPIC: wined3dfilter = WINED3DTEXF_ANISOTROPIC; break;
default:
ERR("Unexpected d3d7 mag filter type %d\n", State);
wined3dfilter = WINED3DTEXF_POINT;
}
return IWineD3DDevice_SetSamplerState(This->wineD3DDevice,
Stage,
WINED3DSAMP_MAGFILTER,
State);
wined3dfilter);
}
case D3DTSS_ADDRESS:
IWineD3DDevice_SetSamplerState(This->wineD3DDevice,
......
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