[5/6] d3drm: Implement GetVertices for IDirect3DRMMeshBuilder3

André Hentschel nerv at dawncrow.de
Sun Jan 8 11:47:06 CST 2012


---
 dlls/d3drm/meshbuilder.c |   14 ++++++++++----
 dlls/d3drm/tests/d3drm.c |    4 ++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/dlls/d3drm/meshbuilder.c b/dlls/d3drm/meshbuilder.c
index 0fd7537..3bd6034 100644
--- a/dlls/d3drm/meshbuilder.c
+++ b/dlls/d3drm/meshbuilder.c
@@ -1844,14 +1844,20 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetVertices(IDirect3DRMMeshBui
 }
 
 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetVertices(IDirect3DRMMeshBuilder3* iface,
-                                                              DWORD IndexFirst, LPDWORD count,
-                                                              LPD3DVECTOR vector)
+                                                              DWORD IndexFirst, LPDWORD vcount,
+                                                              LPD3DVECTOR vertices)
 {
     IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
+    DWORD count = This->nb_vertices - IndexFirst;
 
-    FIXME("(%p)->(%u,%p,%p): stub\n", This, IndexFirst, count, vector);
+    TRACE("(%p)->(%u,%p,%p)\n", This, IndexFirst, vcount, vertices);
 
-    return E_NOTIMPL;
+    if (vcount)
+        *vcount = count;
+    if (vertices && This->nb_vertices)
+        memcpy(vertices, This->pVertices + IndexFirst, count * sizeof(D3DVECTOR));
+
+    return D3DRM_OK;
 }
 
 static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_SetNormals(IDirect3DRMMeshBuilder3* iface,
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c
index 8f3c01c..e742d0d 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -193,8 +193,8 @@ static void test_MeshBuilder3(void)
     ok(val == 3, "Wrong number of faces %d (must be 3)\n", val);
 
     hr = IDirect3DRMMeshBuilder3_GetVertices(pMeshBuilder3, 0, &val1, NULL);
-    todo_wine ok(hr == D3DRM_OK, "Cannot get vertices information (hr = %x)\n", hr);
-    todo_wine ok(val1 == 4, "Wrong number of vertices %d (must be 4)\n", val1);
+    ok(hr == D3DRM_OK, "Cannot get vertices information (hr = %x)\n", hr);
+    ok(val1 == 4, "Wrong number of vertices %d (must be 4)\n", val1);
 
     valu = 1.23f;
     valv = 3.21f;
-- 

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/20120108/a23b66d5/attachment.ksh>


More information about the wine-patches mailing list