[2/2] d3drm: Partial implementation for [Add/Delete]Visual
André Hentschel
nerv at dawncrow.de
Fri Jan 6 12:55:11 CST 2012
---
dlls/d3drm/d3drm_private.h | 1 +
dlls/d3drm/frame.c | 53 ++++++++++++++++++++++++++++++++++++-------
dlls/d3drm/meshbuilder.c | 1 +
3 files changed, 46 insertions(+), 9 deletions(-)
diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h
index 34a32df..4d91790 100644
--- a/dlls/d3drm/d3drm_private.h
+++ b/dlls/d3drm/d3drm_private.h
@@ -22,6 +22,7 @@
#define __D3DRM_PRIVATE_INCLUDED__
#include "d3drm.h"
+#include "wine/list.h"
HRESULT Direct3DRM_create(IUnknown** ppObj) DECLSPEC_HIDDEN;
HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN;
diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c
index 0f3c113..12b1bc5 100644
--- a/dlls/d3drm/frame.c
+++ b/dlls/d3drm/frame.c
@@ -24,18 +24,32 @@
#include "winbase.h"
#include "wingdi.h"
-#include "wine/list.h"
#include "d3drm_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
typedef struct {
+ IDirect3DRMVisual dummy1;
+ IDirect3DRMVisual dummy2;
+ LONG ref;
+ struct list entry;
+} IDirect3DRMVisualImpl;
+
+static const struct IDirect3DRMVisualVtbl Direct3DRMVisual_Vtbl;
+
+static inline IDirect3DRMVisualImpl *impl_from_IDirect3DRMVisual(IDirect3DRMVisual *iface)
+{
+ return CONTAINING_RECORD(iface, IDirect3DRMVisualImpl, dummy1);
+}
+
+typedef struct {
IDirect3DRMFrame2 IDirect3DRMFrame2_iface;
IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
LONG ref;
struct list entry;
struct list child_list;
+ struct list visual_list;
} IDirect3DRMFrameImpl;
static const struct IDirect3DRMFrame2Vtbl Direct3DRMFrame2_Vtbl;
@@ -68,6 +82,7 @@ HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown** ppObj)
object->IDirect3DRMFrame3_iface.lpVtbl = &Direct3DRMFrame3_Vtbl;
object->ref = 1;
list_init(&object->child_list);
+ list_init(&object->visual_list);
if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
*ppObj = (IUnknown*)&object->IDirect3DRMFrame3_iface;
@@ -296,10 +311,15 @@ static HRESULT WINAPI IDirect3DRMFrame2Impl_AddVisual(IDirect3DRMFrame2* iface,
LPDIRECT3DRMVISUAL vis)
{
IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
+ IDirect3DRMVisualImpl *Visual = impl_from_IDirect3DRMVisual(vis);
- FIXME("(%p/%p)->(%p): stub\n", iface, This, vis);
+ FIXME("(%p/%p)->(%p): partial stub\n", iface, This, vis);
- return E_NOTIMPL;
+ /* Add the visual in the 'linked' chain */
+ list_add_head(&This->visual_list, &Visual->entry);
+ IDirect3DRMVisual_AddRef(vis);
+
+ return S_OK;
}
static HRESULT WINAPI IDirect3DRMFrame2Impl_GetChildren(IDirect3DRMFrame2* iface,
@@ -535,10 +555,15 @@ static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteVisual(IDirect3DRMFrame2* ifac
LPDIRECT3DRMVISUAL vis)
{
IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
+ IDirect3DRMVisualImpl *Visual = impl_from_IDirect3DRMVisual(vis);
- FIXME("(%p/%p)->(%p): stub\n", iface, This, vis);
+ FIXME("(%p/%p)->(%p): partial stub\n", iface, This, vis);
- return E_NOTIMPL;
+ /* Remove the visual from the 'linked' chain */
+ list_remove(&Visual->entry);
+ IDirect3DRMVisual_Release(vis);
+
+ return S_OK;
}
static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetSceneBackground(IDirect3DRMFrame2* iface)
@@ -1167,10 +1192,15 @@ static HRESULT WINAPI IDirect3DRMFrame3Impl_AddRotation(IDirect3DRMFrame3* iface
static HRESULT WINAPI IDirect3DRMFrame3Impl_AddVisual(IDirect3DRMFrame3* iface, LPUNKNOWN vis)
{
IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
+ IDirect3DRMVisualImpl *Visual = impl_from_IDirect3DRMVisual((LPDIRECT3DRMVISUAL)vis);
- FIXME("(%p/%p)->(%p): stub\n", iface, This, vis);
+ FIXME("(%p/%p)->(%p): partial stub\n", iface, This, vis);
- return E_NOTIMPL;
+ /* Add the visual in the 'linked' chain */
+ list_add_head(&This->visual_list, &Visual->entry);
+ IDirect3DRMVisual_AddRef(vis);
+
+ return S_OK;
}
static HRESULT WINAPI IDirect3DRMFrame3Impl_GetChildren(IDirect3DRMFrame3* iface,
@@ -1397,10 +1427,15 @@ static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteMoveCallback(IDirect3DRMFrame3
static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteVisual(IDirect3DRMFrame3* iface, LPUNKNOWN vis)
{
IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
+ IDirect3DRMVisualImpl *Visual = impl_from_IDirect3DRMVisual((LPDIRECT3DRMVISUAL)vis);
- FIXME("(%p/%p)->(%p): stub\n", iface, This, vis);
+ FIXME("(%p/%p)->(%p): partial stub\n", iface, This, vis);
- return E_NOTIMPL;
+ /* Remove the visual from the 'linked' chain */
+ list_remove(&Visual->entry);
+ IDirect3DRMVisual_Release(vis);
+
+ return S_OK;
}
static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetSceneBackground(IDirect3DRMFrame3* iface)
diff --git a/dlls/d3drm/meshbuilder.c b/dlls/d3drm/meshbuilder.c
index ce910a9..b909b99 100644
--- a/dlls/d3drm/meshbuilder.c
+++ b/dlls/d3drm/meshbuilder.c
@@ -41,6 +41,7 @@ typedef struct {
IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface;
IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface;
LONG ref;
+ struct list entry;
DWORD nb_vertices;
D3DVECTOR* pVertices;
DWORD nb_normals;
--
Best Regards, André Hentschel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Nachrichtenteil als Anhang
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120106/c87dab05/attachment.ksh>
More information about the wine-patches
mailing list