Commit 9512fee2 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ddraw: Retrieve render state from the primary stateblock.

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