[PATCH 1/1] d3drm: Implement IDirect3DRMFrame2::SetSceneBackgroundImage

Alistair Leslie-Hughes wine at gitlab.winehq.org
Tue Jun 21 01:44:19 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         | 23 +++++++++++++++--------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h
index 2fb6bafe951..96a9c3e7f60 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;
+    IDirect3DRMTexture3 *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..d1e8d6d55b2 100644
--- a/dlls/d3drm/frame.c
+++ b/dlls/d3drm/frame.c
@@ -2222,25 +2222,32 @@ 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);
+    TRACE("iface %p, texture %p\n", iface, texture);
 
-    return E_NOTIMPL;
+    if (frame->backgroundimage)
+        IDirect3DRMTexture3_Release(frame->backgroundimage);
+    frame->backgroundimage = texture;
+    if (frame->backgroundimage)
+        IDirect3DRMTexture3_AddRef(frame->backgroundimage);
+
+    return S_OK;
 }
 
 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
         IDirect3DRMTexture *texture)
 {
-    FIXME("iface %p, texture %p stub!\n", iface, texture);
-
-    return E_NOTIMPL;
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
+    TRACE("iface %p, texture %p\n", iface, texture);
+    return d3drm_frame3_SetSceneBackgroundImage(&frame->IDirect3DRMFrame3_iface, (IDirect3DRMTexture3*)texture);
 }
 
 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_frame3_SetSceneBackgroundImage(&frame->IDirect3DRMFrame3_iface, (IDirect3DRMTexture3*)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