Commit 83ff5b50 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Handle D3DRENDERSTATE_TEXTUREHANDLE and D3DRENDERSTATE_TEXTUREMAPBLEND in d3d7.

parent fa3a72c6
......@@ -2492,6 +2492,12 @@ IDirect3DDeviceImpl_7_GetRenderState(IDirect3DDevice7 *iface,
hr = E_NOTIMPL;
break;
case D3DRENDERSTATE_TEXTUREHANDLE:
case D3DRENDERSTATE_TEXTUREMAPBLEND:
WARN("Render state %#x is invalid in d3d7.\n", RenderStateType);
hr = DDERR_INVALIDPARAMS;
break;
default:
if (RenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00
&& RenderStateType <= D3DRENDERSTATE_STIPPLEPATTERN31)
......@@ -2802,6 +2808,12 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface,
hr = E_NOTIMPL;
break;
case D3DRENDERSTATE_TEXTUREHANDLE:
case D3DRENDERSTATE_TEXTUREMAPBLEND:
WARN("Render state %#x is invalid in d3d7.\n", RenderStateType);
hr = DDERR_INVALIDPARAMS;
break;
default:
if (RenderStateType >= D3DRENDERSTATE_STIPPLEPATTERN00
&& RenderStateType <= D3DRENDERSTATE_STIPPLEPATTERN31)
......
......@@ -1818,28 +1818,18 @@ out:
static void D3D7_OldRenderStateTest(void)
{
HRESULT rc;
HRESULT hr;
DWORD val;
/* Test reaction to some deprecated states in D3D7.
* IDirect3DDevice7 in Wine currently relays such states to wined3d where they are do-nothing and return 0, instead
* of INVALIDPARAMS. Unless an app is found which cares this is probably ok. What this test shows is that these states
* need not to be handled in D3D7.
*/
todo_wine {
rc = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREHANDLE, 0);
ok(rc == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %08x\n", rc);
rc = IDirect3DDevice7_GetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREHANDLE, &val);
ok(rc == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %08x\n", rc);
rc = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE);
ok(rc == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %08x\n", rc);
rc = IDirect3DDevice7_GetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREMAPBLEND, &val);
ok(rc == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %08x\n", rc);
}
/* Test reaction to some deprecated states in D3D7. */
hr = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREHANDLE, 0);
ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %#x.\n", hr);
hr = IDirect3DDevice7_GetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREHANDLE, &val);
ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %#x.\n", hr);
hr = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE);
ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %#x.\n", hr);
hr = IDirect3DDevice7_GetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREMAPBLEND, &val);
ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %#x.\n", hr);
}
#define IS_VALUE_NEAR(a, b) ( ((a) == (b)) || ((a) == (b) - 1) || ((a) == (b) + 1) )
......
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