Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
47cd5b14
Commit
47cd5b14
authored
Aug 15, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Use nameless unions/structs.
parent
8bec6d39
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
35 deletions
+35
-35
core.c
dlls/d3dx9_36/tests/core.c
+13
-13
line.c
dlls/d3dx9_36/tests/line.c
+10
-10
math.c
dlls/d3dx9_36/tests/math.c
+0
-0
mesh.c
dlls/d3dx9_36/tests/mesh.c
+12
-12
shader.c
dlls/d3dx9_36/tests/shader.c
+0
-0
No files found.
dlls/d3dx9_36/tests/core.c
View file @
47cd5b14
...
...
@@ -49,19 +49,19 @@ static inline void check_mat(D3DXMATRIX got, D3DXMATRIX exp)
int
i
,
j
,
equal
=
1
;
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
j
=
0
;
j
<
4
;
j
++
)
if
(
fabs
(
U
(
exp
).
m
[
i
][
j
]
-
U
(
got
)
.
m
[
i
][
j
])
>
admitted_error
)
if
(
fabs
(
exp
.
m
[
i
][
j
]
-
got
.
m
[
i
][
j
])
>
admitted_error
)
equal
=
0
;
ok
(
equal
,
"Got matrix
\n\t
(%f,%f,%f,%f
\n\t
%f,%f,%f,%f
\n\t
%f,%f,%f,%f
\n\t
%f,%f,%f,%f)
\n
"
"Expected matrix=
\n\t
(%f,%f,%f,%f
\n\t
%f,%f,%f,%f
\n\t
%f,%f,%f,%f
\n\t
%f,%f,%f,%f)
\n
"
,
U
(
got
).
m
[
0
][
0
],
U
(
got
).
m
[
0
][
1
],
U
(
got
).
m
[
0
][
2
],
U
(
got
)
.
m
[
0
][
3
],
U
(
got
).
m
[
1
][
0
],
U
(
got
).
m
[
1
][
1
],
U
(
got
).
m
[
1
][
2
],
U
(
got
)
.
m
[
1
][
3
],
U
(
got
).
m
[
2
][
0
],
U
(
got
).
m
[
2
][
1
],
U
(
got
).
m
[
2
][
2
],
U
(
got
)
.
m
[
2
][
3
],
U
(
got
).
m
[
3
][
0
],
U
(
got
).
m
[
3
][
1
],
U
(
got
).
m
[
3
][
2
],
U
(
got
)
.
m
[
3
][
3
],
U
(
exp
).
m
[
0
][
0
],
U
(
exp
).
m
[
0
][
1
],
U
(
exp
).
m
[
0
][
2
],
U
(
exp
)
.
m
[
0
][
3
],
U
(
exp
).
m
[
1
][
0
],
U
(
exp
).
m
[
1
][
1
],
U
(
exp
).
m
[
1
][
2
],
U
(
exp
)
.
m
[
1
][
3
],
U
(
exp
).
m
[
2
][
0
],
U
(
exp
).
m
[
2
][
1
],
U
(
exp
).
m
[
2
][
2
],
U
(
exp
)
.
m
[
2
][
3
],
U
(
exp
).
m
[
3
][
0
],
U
(
exp
).
m
[
3
][
1
],
U
(
exp
).
m
[
3
][
2
],
U
(
exp
)
.
m
[
3
][
3
]);
got
.
m
[
0
][
0
],
got
.
m
[
0
][
1
],
got
.
m
[
0
][
2
],
got
.
m
[
0
][
3
],
got
.
m
[
1
][
0
],
got
.
m
[
1
][
1
],
got
.
m
[
1
][
2
],
got
.
m
[
1
][
3
],
got
.
m
[
2
][
0
],
got
.
m
[
2
][
1
],
got
.
m
[
2
][
2
],
got
.
m
[
2
][
3
],
got
.
m
[
3
][
0
],
got
.
m
[
3
][
1
],
got
.
m
[
3
][
2
],
got
.
m
[
3
][
3
],
exp
.
m
[
0
][
0
],
exp
.
m
[
0
][
1
],
exp
.
m
[
0
][
2
],
exp
.
m
[
0
][
3
],
exp
.
m
[
1
][
0
],
exp
.
m
[
1
][
1
],
exp
.
m
[
1
][
2
],
exp
.
m
[
1
][
3
],
exp
.
m
[
2
][
0
],
exp
.
m
[
2
][
1
],
exp
.
m
[
2
][
2
],
exp
.
m
[
2
][
3
],
exp
.
m
[
3
][
0
],
exp
.
m
[
3
][
1
],
exp
.
m
[
3
][
2
],
exp
.
m
[
3
][
3
]);
}
#define check_rect(rect, left, top, right, bottom) _check_rect(__LINE__, rect, left, top, right, bottom)
...
...
@@ -169,10 +169,10 @@ static void test_ID3DXSprite(IDirect3DDevice9 *device)
/* Test ID3DXSprite_SetTransform */
/* Set a transform and test if it gets returned correctly */
U
(
mat
).
m
[
0
][
0
]
=
2
.
1
f
;
U
(
mat
).
m
[
0
][
1
]
=
6
.
5
f
;
U
(
mat
).
m
[
0
][
2
]
=-
9
.
6
f
;
U
(
mat
)
.
m
[
0
][
3
]
=
1
.
7
f
;
U
(
mat
).
m
[
1
][
0
]
=
4
.
2
f
;
U
(
mat
).
m
[
1
][
1
]
=-
2
.
5
f
;
U
(
mat
).
m
[
1
][
2
]
=
2
.
1
f
;
U
(
mat
)
.
m
[
1
][
3
]
=
5
.
5
f
;
U
(
mat
).
m
[
2
][
0
]
=-
2
.
6
f
;
U
(
mat
).
m
[
2
][
1
]
=
0
.
3
f
;
U
(
mat
).
m
[
2
][
2
]
=
8
.
6
f
;
U
(
mat
)
.
m
[
2
][
3
]
=
8
.
4
f
;
U
(
mat
).
m
[
3
][
0
]
=
6
.
7
f
;
U
(
mat
).
m
[
3
][
1
]
=-
5
.
1
f
;
U
(
mat
).
m
[
3
][
2
]
=
6
.
1
f
;
U
(
mat
)
.
m
[
3
][
3
]
=
2
.
2
f
;
mat
.
m
[
0
][
0
]
=
2
.
1
f
;
mat
.
m
[
0
][
1
]
=
6
.
5
f
;
mat
.
m
[
0
][
2
]
=-
9
.
6
f
;
mat
.
m
[
0
][
3
]
=
1
.
7
f
;
mat
.
m
[
1
][
0
]
=
4
.
2
f
;
mat
.
m
[
1
][
1
]
=-
2
.
5
f
;
mat
.
m
[
1
][
2
]
=
2
.
1
f
;
mat
.
m
[
1
][
3
]
=
5
.
5
f
;
mat
.
m
[
2
][
0
]
=-
2
.
6
f
;
mat
.
m
[
2
][
1
]
=
0
.
3
f
;
mat
.
m
[
2
][
2
]
=
8
.
6
f
;
mat
.
m
[
2
][
3
]
=
8
.
4
f
;
mat
.
m
[
3
][
0
]
=
6
.
7
f
;
mat
.
m
[
3
][
1
]
=-
5
.
1
f
;
mat
.
m
[
3
][
2
]
=
6
.
1
f
;
mat
.
m
[
3
][
3
]
=
2
.
2
f
;
hr
=
ID3DXSprite_SetTransform
(
sprite
,
NULL
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"SetTransform returned %#lx, expected %#lx
\n
"
,
hr
,
D3DERR_INVALIDCALL
);
...
...
dlls/d3dx9_36/tests/line.c
View file @
47cd5b14
...
...
@@ -31,7 +31,7 @@ static inline BOOL compare_matrix(const D3DXMATRIX *m1, const D3DXMATRIX *m2)
{
for
(
j
=
0
;
j
<
4
;
++
j
)
{
if
(
relative_error
(
U
(
*
m1
).
m
[
i
][
j
],
U
(
*
m2
).
m
[
i
][
j
])
>
admitted_error
)
if
(
relative_error
(
m1
->
m
[
i
][
j
],
m2
->
m
[
i
][
j
])
>
admitted_error
)
return
FALSE
;
}
}
...
...
@@ -45,14 +45,14 @@ do { \
const D3DXMATRIX *__m2 = (gotmat); \
ok(compare_matrix(__m1, __m2), "Expected matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n)\n\n" \
"Got matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f)\n", \
U(*__m1).m[0][0], U(*__m1).m[0][1], U(*__m1).m[0][2], U(*__m1).
m[0][3], \
U(*__m1).m[1][0], U(*__m1).m[1][1], U(*__m1).m[1][2], U(*__m1).
m[1][3], \
U(*__m1).m[2][0], U(*__m1).m[2][1], U(*__m1).m[2][2], U(*__m1).
m[2][3], \
U(*__m1).m[3][0], U(*__m1).m[3][1], U(*__m1).m[3][2], U(*__m1).
m[3][3], \
U(*__m2).m[0][0], U(*__m2).m[0][1], U(*__m2).m[0][2], U(*__m2).
m[0][3], \
U(*__m2).m[1][0], U(*__m2).m[1][1], U(*__m2).m[1][2], U(*__m2).
m[1][3], \
U(*__m2).m[2][0], U(*__m2).m[2][1], U(*__m2).m[2][2], U(*__m2).
m[2][3], \
U(*__m2).m[3][0], U(*__m2).m[3][1], U(*__m2).m[3][2], U(*__m2).
m[3][3]); \
__m1->m[0][0], __m1->m[0][1], __m1->m[0][2], __m1->
m[0][3], \
__m1->m[1][0], __m1->m[1][1], __m1->m[1][2], __m1->
m[1][3], \
__m1->m[2][0], __m1->m[2][1], __m1->m[2][2], __m1->
m[2][3], \
__m1->m[3][0], __m1->m[3][1], __m1->m[3][2], __m1->
m[3][3], \
__m2->m[0][0], __m2->m[0][1], __m2->m[0][2], __m2->
m[0][3], \
__m2->m[1][0], __m2->m[1][1], __m2->m[1][2], __m2->
m[1][3], \
__m2->m[2][0], __m2->m[2][1], __m2->m[2][2], __m2->
m[2][3], \
__m2->m[3][0], __m2->m[3][1], __m2->m[3][2], __m2->
m[3][3]); \
} while(0)
static
void
test_create_line
(
IDirect3DDevice9
*
device
)
...
...
@@ -90,7 +90,7 @@ static void test_create_line(IDirect3DDevice9* device)
D3DXMatrixIdentity
(
&
world
);
D3DXMatrixIdentity
(
&
identity
);
S
(
U
(
world
)).
_11
=
r11
;
S
(
U
(
world
)).
_12
=
r12
;
S
(
U
(
world
)).
_13
=
r13
;
S
(
U
(
world
))
.
_14
=
r14
;
world
.
_11
=
r11
;
world
.
_12
=
r12
;
world
.
_13
=
r13
;
world
.
_14
=
r14
;
hr
=
IDirect3DDevice9_SetTransform
(
device
,
D3DTS_WORLD
,
&
world
);
ok
(
hr
==
D3D_OK
,
"Got result %lx, expected %lx (D3D_OK)
\n
"
,
hr
,
D3D_OK
);
...
...
dlls/d3dx9_36/tests/math.c
View file @
47cd5b14
This diff is collapsed.
Click to expand it.
dlls/d3dx9_36/tests/mesh.c
View file @
47cd5b14
...
...
@@ -1658,9 +1658,9 @@ static void check_matrix_(int line, const D3DXMATRIX *got, const D3DXMATRIX *exp
int
i
,
j
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
j
=
0
;
j
<
4
;
j
++
)
{
ok_
(
__FILE__
,
line
)(
compare
(
U
(
*
expected
).
m
[
i
][
j
],
U
(
*
got
).
m
[
i
][
j
]),
ok_
(
__FILE__
,
line
)(
compare
(
expected
->
m
[
i
][
j
],
got
->
m
[
i
][
j
]),
"matrix[%u][%u]: expected %g, got %g
\n
"
,
i
,
j
,
U
(
*
expected
).
m
[
i
][
j
],
U
(
*
got
).
m
[
i
][
j
]);
i
,
j
,
expected
->
m
[
i
][
j
],
got
->
m
[
i
][
j
]);
}
}
}
...
...
@@ -1842,8 +1842,8 @@ static HRESULT destroy_mesh_container(LPD3DXMESHCONTAINER mesh_container)
if
(
!
mesh_container
)
return
D3D_OK
;
free
(
mesh_container
->
Name
);
if
(
U
(
mesh_container
->
MeshData
)
.
pMesh
)
IUnknown_Release
(
U
(
mesh_container
->
MeshData
)
.
pMesh
);
if
(
mesh_container
->
MeshData
.
pMesh
)
IUnknown_Release
(
mesh_container
->
MeshData
.
pMesh
);
if
(
mesh_container
->
pMaterials
)
{
for
(
i
=
0
;
i
<
mesh_container
->
NumMaterials
;
i
++
)
free
(
mesh_container
->
pMaterials
[
i
].
pTextureFilename
);
...
...
@@ -1885,7 +1885,7 @@ static HRESULT CALLBACK ID3DXAllocateHierarchyImpl_CreateMeshContainer(ID3DXAllo
int
i
;
TRACECALLBACK
(
"ID3DXAllocateHierarchyImpl_CreateMeshContainer(%p, '%s', %u, %p, %p, %p, %ld, %p, %p, %p)
\n
"
,
iface
,
name
,
mesh_data
->
Type
,
U
(
*
mesh_data
).
pMesh
,
materials
,
effects
,
iface
,
name
,
mesh_data
->
Type
,
mesh_data
->
pMesh
,
materials
,
effects
,
num_materials
,
adjacency
,
skin_info
,
*
new_mesh_container
);
mesh_container
=
calloc
(
1
,
sizeof
(
*
mesh_container
));
...
...
@@ -1952,7 +1952,7 @@ static HRESULT CALLBACK ID3DXAllocateHierarchyImpl_CreateMeshContainer(ID3DXAllo
ok
(
adjacency
!=
NULL
,
"Expected non-NULL adjacency, got NULL
\n
"
);
if
(
adjacency
)
{
if
(
mesh_data
->
Type
==
D3DXMESHTYPE_MESH
||
mesh_data
->
Type
==
D3DXMESHTYPE_PMESH
)
{
ID3DXBaseMesh
*
basemesh
=
(
ID3DXBaseMesh
*
)
U
(
*
mesh_data
).
pMesh
;
ID3DXBaseMesh
*
basemesh
=
(
ID3DXBaseMesh
*
)
mesh_data
->
pMesh
;
DWORD
num_faces
=
basemesh
->
lpVtbl
->
GetNumFaces
(
basemesh
);
size_t
size
=
num_faces
*
sizeof
(
DWORD
)
*
3
;
mesh_container
->
pAdjacency
=
malloc
(
size
);
...
...
@@ -1967,8 +1967,8 @@ static HRESULT CALLBACK ID3DXAllocateHierarchyImpl_CreateMeshContainer(ID3DXAllo
}
memcpy
(
&
mesh_container
->
MeshData
,
mesh_data
,
sizeof
(
*
mesh_data
));
if
(
U
(
*
mesh_data
).
pMesh
)
IUnknown_AddRef
(
U
(
*
mesh_data
).
pMesh
);
if
(
mesh_data
->
pMesh
)
IUnknown_AddRef
(
mesh_data
->
pMesh
);
if
(
skin_info
)
{
mesh_container
->
pSkinInfo
=
skin_info
;
skin_info
->
lpVtbl
->
AddRef
(
skin_info
);
...
...
@@ -2428,7 +2428,7 @@ static void D3DXLoadMeshTest(void)
ok
(
!
strcmp
(
container
->
Name
,
""
),
"Expected '', got '%s'
\n
"
,
container
->
Name
);
ok
(
container
->
MeshData
.
Type
==
D3DXMESHTYPE_MESH
,
"Expected %d, got %d
\n
"
,
D3DXMESHTYPE_MESH
,
container
->
MeshData
.
Type
);
mesh
=
U
(
container
->
MeshData
)
.
pMesh
;
mesh
=
container
->
MeshData
.
pMesh
;
check_vertex_buffer
(
mesh
,
simple_vertex_buffer
,
ARRAY_SIZE
(
simple_vertex_buffer
),
simple_fvf
);
check_index_buffer
(
mesh
,
simple_index_buffer
,
ARRAY_SIZE
(
simple_index_buffer
),
sizeof
(
*
simple_index_buffer
));
check_materials
(
container
->
pMaterials
,
container
->
NumMaterials
,
NULL
,
0
);
...
...
@@ -2471,7 +2471,7 @@ static void D3DXLoadMeshTest(void)
ok
(
!
strcmp
(
container
->
Name
,
""
),
"Expected '', got '%s'
\n
"
,
container
->
Name
);
ok
(
container
->
MeshData
.
Type
==
D3DXMESHTYPE_MESH
,
"Expected %d, got %d
\n
"
,
D3DXMESHTYPE_MESH
,
container
->
MeshData
.
Type
);
mesh
=
U
(
container
->
MeshData
)
.
pMesh
;
mesh
=
container
->
MeshData
.
pMesh
;
check_vertex_buffer
(
mesh
,
box_vertex_buffer
,
ARRAY_SIZE
(
box_vertex_buffer
),
box_fvf
);
check_index_buffer
(
mesh
,
box_index_buffer
,
ARRAY_SIZE
(
box_index_buffer
),
sizeof
(
*
box_index_buffer
));
check_materials
(
container
->
pMaterials
,
container
->
NumMaterials
,
box_materials
,
ARRAY_SIZE
(
box_materials
));
...
...
@@ -2492,14 +2492,14 @@ static void D3DXLoadMeshTest(void)
ok
(
!
strcmp
(
frame_hier
->
Name
,
""
),
"Expected '', got '%s'
\n
"
,
frame_hier
->
Name
);
/* last frame transform replaces the first */
D3DXMatrixIdentity
(
&
transform
);
U
(
transform
)
.
m
[
3
][
2
]
=
3
.
0
;
transform
.
m
[
3
][
2
]
=
3
.
0
;
check_matrix
(
&
frame_hier
->
TransformationMatrix
,
&
transform
);
for
(
i
=
0
;
i
<
3
;
i
++
)
{
ok
(
!
strcmp
(
container
->
Name
,
""
),
"Expected '', got '%s'
\n
"
,
container
->
Name
);
ok
(
container
->
MeshData
.
Type
==
D3DXMESHTYPE_MESH
,
"Expected %d, got %d
\n
"
,
D3DXMESHTYPE_MESH
,
container
->
MeshData
.
Type
);
mesh
=
U
(
container
->
MeshData
)
.
pMesh
;
mesh
=
container
->
MeshData
.
pMesh
;
check_vertex_buffer
(
mesh
,
framed_vertex_buffers
[
i
],
ARRAY_SIZE
(
framed_vertex_buffers
[
0
]),
framed_fvf
);
check_index_buffer
(
mesh
,
framed_index_buffer
,
ARRAY_SIZE
(
framed_index_buffer
),
sizeof
(
*
framed_index_buffer
));
check_materials
(
container
->
pMaterials
,
container
->
NumMaterials
,
NULL
,
0
);
...
...
dlls/d3dx9_36/tests/shader.c
View file @
47cd5b14
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment