Files
wine-staging/patches/d3drm-starwars/0018-d3drm-IDirect3DRMFrame2-SetSceneBackgroundImage.patch
Alistair Leslie-Hughes 31b114a4e3 Added d3drm-starwars patchset
This stops the crash but doesn't show the battle at all.

Patchset shows what is needed (as a minimum), to be
implemented in order for it to work correctly.
2025-10-16 17:40:42 +11:00

94 lines
3.1 KiB
Diff

From ec155c69fa91896ed148f17934872b59a9809dfe Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 13 May 2022 14:56:03 +1000
Subject: [PATCH] d3drm: IDirect3DRMFrame2 SetSceneBackgroundImage
---
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 3e33e9e65b7..edd79996b36 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)
{
@@ -2231,25 +2233,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)
--
2.35.1