diff --git a/patches/ddraw-GetPickRecords/0001-ddraw-Implement-Pick-and-GetPickRecords.patch b/patches/ddraw-GetPickRecords/0001-ddraw-Implement-Pick-and-GetPickRecords.patch index c2c8624e..a3b08606 100644 --- a/patches/ddraw-GetPickRecords/0001-ddraw-Implement-Pick-and-GetPickRecords.patch +++ b/patches/ddraw-GetPickRecords/0001-ddraw-Implement-Pick-and-GetPickRecords.patch @@ -1,4 +1,4 @@ -From 2c5da9b35cb387a1ca09fe49f662189536ee664a Mon Sep 17 00:00:00 2001 +From 274e40a7f25d8041f5b93d132f01e0a66fefe481 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 18 Sep 2020 00:47:13 +0000 Subject: [PATCH] ddraw: Implement Pick() and GetPickRecords(). @@ -31,10 +31,10 @@ Signed-off-by: Matthew Wong Signed-off-by: Myah Caron --- dlls/ddraw/ddraw_private.h | 7 +- - dlls/ddraw/device.c | 77 ++++++++++++---- + dlls/ddraw/device.c | 67 ++++++++++++-- dlls/ddraw/executebuffer.c | 176 ++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw1.c | 133 ++++++++++++++++++++++++++++ - 4 files changed, 372 insertions(+), 21 deletions(-) + 4 files changed, 373 insertions(+), 10 deletions(-) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 1f0c94a9c6e..157384e3579 100644 @@ -62,30 +62,20 @@ index 1f0c94a9c6e..157384e3579 100644 /***************************************************************************** * IDirect3DVertexBuffer diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c -index f64db3aa633..fe29bf0d16e 100644 +index f64db3aa633..60c43c250b1 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c -@@ -321,17 +321,8 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface) - IDirect3DDevice3_DeleteViewport(&This->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface); +@@ -333,6 +333,9 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface) + This->ddraw = NULL; } -- wined3d_stateblock_decref(This->state); -- if (This->recording) -- wined3d_stateblock_decref(This->recording); -- -- /* Releasing the render target below may release the last reference to the ddraw object. Detach -- * the device from it before so it doesn't try to save / restore state on the teared down device. */ -- if (This->ddraw) -- { -- list_remove(&This->ddraw_entry); -- This->ddraw = NULL; -- } + if (This->pick_record_size > 0) + free(This->pick_records); - ++ TRACE("Releasing render target %p.\n", This->rt_iface); rt_iface = This->rt_iface; -@@ -739,7 +730,7 @@ static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface, + This->rt_iface = NULL; +@@ -739,7 +742,7 @@ static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface, /* Execute... */ wined3d_mutex_lock(); @@ -94,7 +84,7 @@ index f64db3aa633..fe29bf0d16e 100644 wined3d_mutex_unlock(); return hr; -@@ -1006,16 +997,44 @@ static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface, +@@ -1006,16 +1009,44 @@ static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface, * x2 and y2 are ignored. * * Returns: @@ -143,7 +133,7 @@ index f64db3aa633..fe29bf0d16e 100644 } /***************************************************************************** -@@ -1031,13 +1050,35 @@ static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteB +@@ -1031,13 +1062,35 @@ static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteB * D3DPickRec: Address to store the resulting D3DPICKRECORD array. * * Returns: @@ -397,10 +387,10 @@ index 0cf0bf121f3..89915fb7145 100644 static inline struct d3d_execute_buffer *impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface) { diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c -index 0940aa8d78a..faf4e2b7694 100644 +index 96047744635..2364c92eb96 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c -@@ -15467,6 +15467,137 @@ static void test_enum_devices(void) +@@ -15507,6 +15507,137 @@ static void test_enum_devices(void) ok(!refcount, "Device has %lu references left.\n", refcount); } @@ -538,7 +528,7 @@ index 0940aa8d78a..faf4e2b7694 100644 /* Emperor: Rise of the Middle Kingdom locks a sysmem surface and then accesses * the pointer after unlocking it. This test roughly replicates the calls that * it makes. */ -@@ -15527,6 +15658,7 @@ static void test_pinned_sysmem(void) +@@ -15567,6 +15698,7 @@ static void test_pinned_sysmem(void) IDirectDrawSurface_Release(surface); refcount = IDirectDraw_Release(ddraw); ok(!refcount, "Device has %lu references left.\n", refcount); @@ -546,7 +536,7 @@ index 0940aa8d78a..faf4e2b7694 100644 DestroyWindow(window); } -@@ -15749,6 +15881,7 @@ START_TEST(ddraw1) +@@ -15789,6 +15921,7 @@ START_TEST(ddraw1) test_vtbl_protection(); test_window_position(); test_get_display_mode();