ddraw: Retrieve render state from the primary stateblock.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-11-27 23:53:41 -06:00 committed by Alexandre Julliard
parent 2b0fd0cf16
commit 9512fee2e0
1 changed files with 4 additions and 2 deletions

View File

@ -2289,6 +2289,7 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface,
D3DRENDERSTATETYPE state, DWORD *value)
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
const struct wined3d_stateblock_state *device_state;
HRESULT hr = D3D_OK;
TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
@ -2297,6 +2298,7 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface,
return DDERR_INVALIDPARAMS;
wined3d_mutex_lock();
device_state = wined3d_stateblock_get_state(device->state);
switch (state)
{
case D3DRENDERSTATE_TEXTUREMAG:
@ -2392,7 +2394,7 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface,
break;
case D3DRENDERSTATE_ZBIAS:
*value = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS);
*value = device_state->rs[WINED3D_RS_DEPTHBIAS];
break;
default:
@ -2403,7 +2405,7 @@ static HRESULT d3d_device7_GetRenderState(IDirect3DDevice7 *iface,
hr = E_NOTIMPL;
break;
}
*value = wined3d_device_get_render_state(device->wined3d_device, state);
*value = device_state->rs[state];
}
wined3d_mutex_unlock();