[PATCH 5/5] d3drm: Avoid LPDIRECT3DRMLIGHTARRAY.

Henri Verbeet hverbeet at codeweavers.com
Tue Aug 13 01:51:48 CDT 2013


---
 dlls/d3drm/frame.c       | 12 +++++-------
 dlls/d3drm/tests/d3drm.c | 14 +++++++-------
 include/d3drmobj.h       |  6 +++---
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c
index 88540f0..4b6eae8 100644
--- a/dlls/d3drm/frame.c
+++ b/dlls/d3drm/frame.c
@@ -703,14 +703,13 @@ static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetColor(IDirect3DRMFrame2* iface)
     return 0;
 }
 
-static HRESULT WINAPI IDirect3DRMFrame2Impl_GetLights(IDirect3DRMFrame2* iface,
-                                                      LPDIRECT3DRMLIGHTARRAY *lights)
+static HRESULT WINAPI IDirect3DRMFrame2Impl_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
 {
-    IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
+    IDirect3DRMFrameImpl *frame = impl_from_IDirect3DRMFrame2(iface);
 
-    TRACE("(%p/%p)->(%p)\n", iface, This, lights);
+    TRACE("iface %p, lights %p.\n", iface, lights);
 
-    return IDirect3DRMFrame3_GetLights(&This->IDirect3DRMFrame3_iface, lights);
+    return IDirect3DRMFrame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
 }
 
 static D3DRMMATERIALMODE WINAPI IDirect3DRMFrame2Impl_GetMaterialMode(IDirect3DRMFrame2* iface)
@@ -1721,8 +1720,7 @@ static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetColor(IDirect3DRMFrame3* iface)
     return 0;
 }
 
-static HRESULT WINAPI IDirect3DRMFrame3Impl_GetLights(IDirect3DRMFrame3* iface,
-                                                      LPDIRECT3DRMLIGHTARRAY *lights)
+static HRESULT WINAPI IDirect3DRMFrame3Impl_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
 {
     IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
     IDirect3DRMLightArrayImpl* obj;
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c
index 34b0fd0..7e59050 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -918,7 +918,7 @@ static void test_Frame(void)
     IDirect3DRMVisualArray *visual_array;
     IDirect3DRMLight *light1;
     IDirect3DRMLight *light_tmp;
-    LPDIRECT3DRMLIGHTARRAY pLightArray;
+    IDirect3DRMLightArray *light_array;
     D3DCOLOR color;
     DWORD count;
     CHAR cname[64] = {0};
@@ -1193,18 +1193,18 @@ static void test_Frame(void)
     CHECK_REFCOUNT(pFrameP1, 3);
     CHECK_REFCOUNT(light1, 2);
 
-    pLightArray = NULL;
-    hr = IDirect3DRMFrame_GetLights(pFrameP1, &pLightArray);
+    light_array = NULL;
+    hr = IDirect3DRMFrame_GetLights(pFrameP1, &light_array);
     ok(hr == D3DRM_OK, "Cannot get lights (hr = %x)\n", hr);
-    if (pLightArray)
+    if (light_array)
     {
-        count = IDirect3DRMLightArray_GetSize(pLightArray);
+        count = IDirect3DRMLightArray_GetSize(light_array);
         ok(count == 1, "count = %u\n", count);
-        hr = IDirect3DRMLightArray_GetElement(pLightArray, 0, &light_tmp);
+        hr = IDirect3DRMLightArray_GetElement(light_array, 0, &light_tmp);
         ok(hr == D3DRM_OK, "Cannot get element (hr = %x)\n", hr);
         ok(light_tmp == light1, "light_tmp = %p\n", light_tmp);
         IDirect3DRMLight_Release(light_tmp);
-        IDirect3DRMLightArray_Release(pLightArray);
+        IDirect3DRMLightArray_Release(light_array);
     }
 
     /* Delete Light */
diff --git a/include/d3drmobj.h b/include/d3drmobj.h
index 7bae278..e1c2da9 100644
--- a/include/d3drmobj.h
+++ b/include/d3drmobj.h
@@ -1106,7 +1106,7 @@ DECLARE_INTERFACE_(IDirect3DRMFrame,IDirect3DRMVisual)
     STDMETHOD(AddVisual)(THIS_ IDirect3DRMVisual *visual) PURE;
     STDMETHOD(GetChildren)(THIS_ struct IDirect3DRMFrameArray **children) PURE;
     STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
-    STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE;
+    STDMETHOD(GetLights)(THIS_ struct IDirect3DRMLightArray **lights) PURE;
     STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE;
     STDMETHOD(GetParent)(THIS_ IDirect3DRMFrame **parent) PURE;
     STDMETHOD(GetPosition)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *return_position) PURE;
@@ -1339,7 +1339,7 @@ DECLARE_INTERFACE_(IDirect3DRMFrame2,IDirect3DRMFrame)
     STDMETHOD(AddVisual)(THIS_ IDirect3DRMVisual *visual) PURE;
     STDMETHOD(GetChildren)(THIS_ struct IDirect3DRMFrameArray **children) PURE;
     STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
-    STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE;
+    STDMETHOD(GetLights)(THIS_ struct IDirect3DRMLightArray **lights) PURE;
     STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE;
     STDMETHOD(GetParent)(THIS_ IDirect3DRMFrame **parent) PURE;
     STDMETHOD(GetPosition)(THIS_ IDirect3DRMFrame *reference, D3DVECTOR *return_position) PURE;
@@ -1621,7 +1621,7 @@ DECLARE_INTERFACE_(IDirect3DRMFrame3,IDirect3DRMVisual)
     STDMETHOD(AddVisual)(THIS_ LPUNKNOWN) PURE;
     STDMETHOD(GetChildren)(THIS_ struct IDirect3DRMFrameArray **children) PURE;
     STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
-    STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE;
+    STDMETHOD(GetLights)(THIS_ struct IDirect3DRMLightArray **lights) PURE;
     STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE;
     STDMETHOD(GetParent)(THIS_ IDirect3DRMFrame3 **parent) PURE;
     STDMETHOD(GetPosition)(THIS_ IDirect3DRMFrame3 *reference, D3DVECTOR *return_position) PURE;
-- 
1.8.1.5




More information about the wine-patches mailing list