https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e6deaabfc6c3ad9fe8967…
commit e6deaabfc6c3ad9fe8967d2ce203e32cc12dcfbb
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Sep 21 22:50:20 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:03 2021 +0100
[WINESYNC] d3dx9: Generate ID3DXSkinInfo in D3DXLoadSkinMeshFromXof() when needed.
Based on a patch by Michael Müller.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=33904
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 70d722340ad546ab988fffe4577e0c0ebe35a982 by Vijay Kiran Kamuju
<infyquest(a)gmail.com>
---
dll/directx/wine/d3dx9_36/mesh.c | 7 ++++
modules/rostests/winetests/d3dx9_36/mesh.c | 58 ++++++++++++++----------------
sdk/tools/winesync/d3dx9.cfg | 2 +-
3 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/mesh.c b/dll/directx/wine/d3dx9_36/mesh.c
index b4dab57bffd..dcdae29098a 100644
--- a/dll/directx/wine/d3dx9_36/mesh.c
+++ b/dll/directx/wine/d3dx9_36/mesh.c
@@ -3337,6 +3337,13 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data
*mesh_data,
goto end;
}
+ if ((provide_flags & PROVIDE_SKININFO) && !mesh_data->skin_info)
+ {
+ if (FAILED(hr = D3DXCreateSkinInfoFVF(mesh_data->num_vertices,
mesh_data->fvf,
+ mesh_data->nb_bones, &mesh_data->skin_info)))
+ goto end;
+ }
+
hr = D3D_OK;
end:
diff --git a/modules/rostests/winetests/d3dx9_36/mesh.c
b/modules/rostests/winetests/d3dx9_36/mesh.c
index 1f81f1728d2..35d5be61b1f 100644
--- a/modules/rostests/winetests/d3dx9_36/mesh.c
+++ b/modules/rostests/winetests/d3dx9_36/mesh.c
@@ -11350,53 +11350,49 @@ static void test_load_skin_mesh_from_xof(void)
ok(!materials, "Got unexpected value %p.\n", materials);
ok(!effects, "Got unexpected value %p.\n", effects);
ok(!count, "Got unexpected value %u.\n", count);
- todo_wine ok(!!skin_info, "Got unexpected value %p.\n", skin_info);
+ ok(!!skin_info, "Got unexpected value %p.\n", skin_info);
ok(!!mesh, "Got unexpected value %p.\n", mesh);
count = mesh->lpVtbl->GetNumVertices(mesh);
ok(count == 3, "Got unexpected value %u.\n", count);
count = mesh->lpVtbl->GetNumFaces(mesh);
ok(count == 1, "Got unexpected value %u.\n", count);
- if (skin_info)
- {
- hr = skin_info->lpVtbl->GetDeclaration(skin_info, declaration);
- ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- compare_elements(declaration, expected_declaration, __LINE__, 0);
-
- fvf = skin_info->lpVtbl->GetFVF(skin_info);
- ok(fvf == D3DFVF_XYZ, "Got unexpected value %u.\n", fvf);
+ hr = skin_info->lpVtbl->GetDeclaration(skin_info, declaration);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ compare_elements(declaration, expected_declaration, __LINE__, 0);
- count = skin_info->lpVtbl->GetNumBones(skin_info);
- ok(!count, "Got unexpected value %u.\n", count);
+ fvf = skin_info->lpVtbl->GetFVF(skin_info);
+ ok(fvf == D3DFVF_XYZ, "Got unexpected value %u.\n", fvf);
- influence = skin_info->lpVtbl->GetMinBoneInfluence(skin_info);
- ok(!influence, "Got unexpected value %.8e.\n", influence);
+ count = skin_info->lpVtbl->GetNumBones(skin_info);
+ ok(!count, "Got unexpected value %u.\n", count);
- memset(max_influences, 0x55, sizeof(max_influences));
- hr = skin_info->lpVtbl->GetMaxVertexInfluences(skin_info, max_influences);
- ok(hr == D3D_OK, "Got unexpected value %#x.\n", hr);
- ok(!max_influences[0], "Got unexpected value %u.\n",
max_influences[0]);
- ok(max_influences[1] == 0x55555555, "Got unexpected value %u.\n",
max_influences[1]);
- ok(max_influences[2] == 0x55555555, "Got unexpected value %u.\n",
max_influences[2]);
+ influence = skin_info->lpVtbl->GetMinBoneInfluence(skin_info);
+ ok(!influence, "Got unexpected value %.8e.\n", influence);
- bone_name = skin_info->lpVtbl->GetBoneName(skin_info, 0);
- ok(!bone_name, "Got unexpected value %p.\n", bone_name);
+ memset(max_influences, 0x55, sizeof(max_influences));
+ hr = skin_info->lpVtbl->GetMaxVertexInfluences(skin_info, max_influences);
+ todo_wine ok(hr == D3D_OK, "Got unexpected value %#x.\n", hr);
+ todo_wine ok(!max_influences[0], "Got unexpected value %u.\n",
max_influences[0]);
+ ok(max_influences[1] == 0x55555555, "Got unexpected value %u.\n",
max_influences[1]);
+ ok(max_influences[2] == 0x55555555, "Got unexpected value %u.\n",
max_influences[2]);
- count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 0);
- ok(!count, "Got unexpected value %u.\n", count);
+ bone_name = skin_info->lpVtbl->GetBoneName(skin_info, 0);
+ ok(!bone_name, "Got unexpected value %p.\n", bone_name);
- count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 1);
- ok(!count, "Got unexpected value %u.\n", count);
+ count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 0);
+ ok(!count, "Got unexpected value %u.\n", count);
- matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, -1);
- ok(!matrix, "Got unexpected value %p.\n", matrix);
+ count = skin_info->lpVtbl->GetNumBoneInfluences(skin_info, 1);
+ ok(!count, "Got unexpected value %u.\n", count);
- matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, 0);
- ok(!matrix, "Got unexpected value %p.\n", matrix);
+ matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, -1);
+ ok(!matrix, "Got unexpected value %p.\n", matrix);
- skin_info->lpVtbl->Release(skin_info);
- }
+ matrix = skin_info->lpVtbl->GetBoneOffsetMatrix(skin_info, 0);
+ ok(!matrix, "Got unexpected value %p.\n", matrix);
+ skin_info->lpVtbl->Release(skin_info);
mesh->lpVtbl->Release(mesh);
adjacency->lpVtbl->Release(adjacency);
file_data->lpVtbl->Release(file_data);
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index b3d7639fde3..75c482ee88d 100644
--- a/sdk/tools/winesync/d3dx9.cfg
+++ b/sdk/tools/winesync/d3dx9.cfg
@@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h:
sdk/inc
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h:
sdk/include/dxsdk/d3dx9of.h,
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h:
sdk/include/dxsdk/d3dx9shape.h,
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h:
sdk/include/dxsdk/d3dx9xof.h}
-tags: {wine: a30fd8c0e44833b2a6412987a348273bfe42fe2f}
+tags: {wine: 70d722340ad546ab988fffe4577e0c0ebe35a982}