[PATCH v2 1/1] d3drm: Implement IDirect3DRMFrame{1/2/3}::SetSceneBackgroundImage

Alistair Leslie-Hughes wine at gitlab.winehq.org
Tue Jun 21 06:53:51 CDT 2022


From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/d3drm/d3drm_private.h |  1 +
 dlls/d3drm/frame.c         | 38 +++++++++++++++++++++++++++++++-------
 2 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h
index 2fb6bafe951..31fdd4984a1 100644
--- a/dlls/d3drm/d3drm_private.h
+++ b/dlls/d3drm/d3drm_private.h
@@ -81,6 +81,7 @@ struct d3drm_frame
     IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
     IDirect3DRM *d3drm;
     LONG ref;
+    IUnknown *backgroundimage;
     struct d3drm_frame *parent;
     SIZE_T nb_children;
     SIZE_T children_size;
diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c
index 5cc3ad585d4..9365e02cc47 100644
--- a/dlls/d3drm/frame.c
+++ b/dlls/d3drm/frame.c
@@ -608,6 +608,8 @@ static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface)
 
     if (!refcount)
     {
+        if (frame->backgroundimage)
+            IUnknown_Release(frame->backgroundimage);
         d3drm_object_cleanup((IDirect3DRMObject *)&frame->IDirect3DRMFrame_iface, &frame->obj);
         for (i = 0; i < frame->nb_children; ++i)
         {
@@ -2222,25 +2224,47 @@ static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundDepth(IDirect3DRMFrame *ifa
 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
         IDirect3DRMTexture3 *texture)
 {
-    FIXME("iface %p, texture %p stub!\n", iface, texture);
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
+    IUnknown *unk = NULL;
 
-    return E_NOTIMPL;
+    TRACE("iface %p, texture %p\n", iface, texture);
+
+    if (texture)
+        IDirect3DRMTexture3_QueryInterface(texture, &IID_IUnknown, (void**)&unk);
+
+    if (frame->backgroundimage)
+        IUnknown_Release(frame->backgroundimage);
+
+    frame->backgroundimage = unk;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
         IDirect3DRMTexture *texture)
 {
-    FIXME("iface %p, texture %p stub!\n", iface, texture);
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
+    IUnknown *unk = NULL;
 
-    return E_NOTIMPL;
+    TRACE("iface %p, texture %p\n", iface, texture);
+
+    if (texture)
+        IDirect3DRMTexture_QueryInterface(texture, &IID_IUnknown, (void**)&unk);
+
+    if (frame->backgroundimage)
+        IUnknown_Release(frame->backgroundimage);
+
+    frame->backgroundimage = unk;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundImage(IDirect3DRMFrame *iface,
         IDirect3DRMTexture *texture)
 {
-    FIXME("iface %p, texture %p stub!\n", iface, texture);
-
-    return E_NOTIMPL;
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+    TRACE("iface %p, texture %p\n", iface, texture);
+    return d3drm_frame2_SetSceneBackgroundImage(&frame->IDirect3DRMFrame2_iface, texture);
 }
 
 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
-- 
GitLab

https://gitlab.winehq.org/wine/wine/-/merge_requests/289



More information about the wine-devel mailing list