Gediminas Jakutis : d3dx9: Add adjacency generation for D3DXCreateCylinder ().

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 27 11:06:36 CDT 2015


Module: wine
Branch: master
Commit: 329fb2f72890b3f283b8d0d4e0e3cbb16a4b5a0f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=329fb2f72890b3f283b8d0d4e0e3cbb16a4b5a0f

Author: Gediminas Jakutis <gediminas at varciai.lt>
Date:   Mon Oct 26 20:15:50 2015 +0200

d3dx9: Add adjacency generation for D3DXCreateCylinder().

Signed-off-by: Gediminas Jakutis <gediminas at varciai.lt>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dx9_36/mesh.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index 39d279d..6294036 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -4986,12 +4986,6 @@ HRESULT WINAPI D3DXCreateCylinder(struct IDirect3DDevice9 *device, float radius1
         return D3DERR_INVALIDCALL;
     }
 
-    if (adjacency)
-    {
-        FIXME("Case of adjacency != NULL not implemented.\n");
-        return E_NOTIMPL;
-    }
-
     number_of_vertices = 2 + (slices * (3 + stacks));
     number_of_faces = 2 * slices + stacks * (2 * slices);
 
@@ -5143,6 +5137,23 @@ HRESULT WINAPI D3DXCreateCylinder(struct IDirect3DDevice9 *device, float radius1
     free_sincos_table(&theta);
     cylinder->lpVtbl->UnlockIndexBuffer(cylinder);
     cylinder->lpVtbl->UnlockVertexBuffer(cylinder);
+
+    if (adjacency)
+    {
+        if (FAILED(hr = D3DXCreateBuffer(number_of_faces * sizeof(DWORD) * 3, adjacency)))
+        {
+            cylinder->lpVtbl->Release(cylinder);
+            return hr;
+        }
+
+        if (FAILED(hr = cylinder->lpVtbl->GenerateAdjacency(cylinder, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency))))
+        {
+            (*adjacency)->lpVtbl->Release(*adjacency);
+            cylinder->lpVtbl->Release(cylinder);
+            return hr;
+        }
+    }
+
     *mesh = cylinder;
 
     return D3D_OK;




More information about the wine-cvs mailing list