Commit 90af51d0 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ddraw: Return D3DERR_NOTINBEGINSTATEBLOCK when EndStateBlock() is called while not recording.

parent f9b9004f
...@@ -5703,7 +5703,12 @@ static HRESULT d3d_device7_EndStateBlock(IDirect3DDevice7 *iface, DWORD *statebl ...@@ -5703,7 +5703,12 @@ static HRESULT d3d_device7_EndStateBlock(IDirect3DDevice7 *iface, DWORD *statebl
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
wined3d_mutex_lock(); wined3d_mutex_lock();
if (!device->recording)
{
wined3d_mutex_unlock();
WARN("Trying to end a stateblock, but no stateblock is being recorded.\n");
return D3DERR_NOTINBEGINSTATEBLOCK;
}
hr = wined3d_device_end_stateblock(device->wined3d_device, &wined3d_sb); hr = wined3d_device_end_stateblock(device->wined3d_device, &wined3d_sb);
if (FAILED(hr)) if (FAILED(hr))
{ {
......
...@@ -15852,8 +15852,8 @@ static void test_begin_end_state_block(void) ...@@ -15852,8 +15852,8 @@ static void test_begin_end_state_block(void)
stateblock2 = 0xdeadbeef; stateblock2 = 0xdeadbeef;
hr = IDirect3DDevice7_EndStateBlock(device, &stateblock2); hr = IDirect3DDevice7_EndStateBlock(device, &stateblock2);
todo_wine ok(hr == D3DERR_NOTINBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr); ok(hr == D3DERR_NOTINBEGINSTATEBLOCK, "Got unexpected hr %#x.\n", hr);
todo_wine ok(stateblock2 == 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock2); ok(stateblock2 == 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock2);
hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &value); hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_LIGHTING, &value);
ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
......
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