@@ -2068,6 +2068,14 @@ static void D3DXLoadMeshTest(void)
2068
2068
"}"
2069
2069
"Mesh { 3; 0.0; 0.0; 0.0;, 0.0; 1.0; 0.0;, 3.0; 1.0; 0.0;; 1; 3; 0, 1, 2;; }"
2070
2070
"}" ;
2071
+ static const char framed_xfile_empty [] =
2072
+ "xof 0303txt 0032"
2073
+ "Frame Box01 {"
2074
+ " Mesh { 0;; 0;;"
2075
+ " MeshNormals { 0;; 0;; }"
2076
+ " }"
2077
+ "}" ;
2078
+
2071
2079
static const WORD framed_index_buffer [] = { 0 , 1 , 2 };
2072
2080
static const D3DXVECTOR3 framed_vertex_buffers [3 ][3 ] = {
2073
2081
{{0.0 , 0.0 , 0.0 }, {0.0 , 1.0 , 0.0 }, {1.0 , 1.0 , 0.0 }},
@@ -2508,6 +2516,16 @@ static void D3DXLoadMeshTest(void)
2508
2516
ok (hr == D3D_OK , "Expected D3D_OK, got %#lx\n" , hr );
2509
2517
frame_hier = NULL ;
2510
2518
2519
+ hr = D3DXLoadMeshHierarchyFromXInMemory (framed_xfile_empty , sizeof (framed_xfile_empty ) - 1 ,
2520
+ D3DXMESH_MANAGED , device , & alloc_hier , NULL , & frame_hier , NULL );
2521
+ ok (hr == D3D_OK , "Unexpected hr %#lx.\n" , hr );
2522
+ container = frame_hier -> pMeshContainer ;
2523
+ ok (!strcmp (frame_hier -> Name , "Box01" ), "Unexpected name %s.\n" , debugstr_a (frame_hier -> Name ));
2524
+ ok (!container , "Unexpected container %p.\n" , container );
2525
+
2526
+ hr = D3DXFrameDestroy (frame_hier , & alloc_hier );
2527
+ ok (hr == D3D_OK , "Unexpected hr %#lx.\n" , hr );
2528
+ frame_hier = NULL ;
2511
2529
2512
2530
hr = D3DXLoadMeshFromXInMemory (NULL , 0 , D3DXMESH_MANAGED ,
2513
2531
device , NULL , NULL , NULL , NULL , & mesh );
@@ -11317,6 +11335,9 @@ static void test_load_skin_mesh_from_xof(void)
11317
11335
"1;"
11318
11336
"3; 0, 1, 2;;"
11319
11337
"}" ;
11338
+ static const char simple_xfile_empty [] =
11339
+ "xof 0303txt 0032"
11340
+ "Mesh { 0;; 0;; }" ;
11320
11341
static const D3DVERTEXELEMENT9 expected_declaration [] =
11321
11342
{
11322
11343
{0 , 0 , D3DDECLTYPE_FLOAT3 , D3DDECLMETHOD_DEFAULT , D3DDECLUSAGE_POSITION , 0 },
@@ -11428,6 +11449,28 @@ static void test_load_skin_mesh_from_xof(void)
11428
11449
mesh -> lpVtbl -> Release (mesh );
11429
11450
adjacency -> lpVtbl -> Release (adjacency );
11430
11451
file_data -> lpVtbl -> Release (file_data );
11452
+
11453
+ /* Empty Mesh Test */
11454
+ file_data = get_mesh_data (simple_xfile_empty , sizeof (simple_xfile_empty ) - 1 );
11455
+ ok (!!file_data , "Failed to load mesh data.\n" );
11456
+
11457
+ adjacency = materials = effects = (void * )0xdeadbeef ;
11458
+ count = 0xdeadbeefu ;
11459
+ skin_info = (void * )0xdeadbeef ;
11460
+ mesh = (void * )0xdeadbeef ;
11461
+
11462
+ hr = D3DXLoadSkinMeshFromXof (file_data , 0 , device , & adjacency , & materials , & effects , & count ,
11463
+ & skin_info , & mesh );
11464
+ todo_wine ok (hr == D3DXERR_LOADEDMESHASNODATA , "Unexpected hr %#lx.\n" , hr );
11465
+ ok (!adjacency , "Unexpected adjacency %p.\n" , adjacency );
11466
+ ok (!materials , "Unexpected materials %p.\n" , materials );
11467
+ ok (!effects , "Unexpected effects %p.\n" , effects );
11468
+ ok (count == 0xdeadbeefu , "Unexpected count %lu.\n" , count );
11469
+ ok (skin_info == (void * )0xdeadbeef , "Unexpected skin_info %p.\n" , skin_info );
11470
+ ok (!mesh , "Unexpected mesh %p.\n" , mesh );
11471
+
11472
+ file_data -> lpVtbl -> Release (file_data );
11473
+
11431
11474
refcount = IDirect3DDevice9_Release (device );
11432
11475
ok (!refcount , "Device has %lu references left.\n" , refcount );
11433
11476
DestroyWindow (hwnd );
0 commit comments