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
9031adfd
Commit
9031adfd
authored
Jun 16, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Properly declare matrices.
parent
b9bfcf2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
46 deletions
+54
-46
d3d.c
dlls/ddraw/tests/d3d.c
+21
-16
visual.c
dlls/ddraw/tests/visual.c
+33
-30
No files found.
dlls/ddraw/tests/d3d.c
View file @
9031adfd
...
...
@@ -2807,27 +2807,32 @@ static void SetMaterialTest(void)
static
void
ComputeSphereVisibility
(
void
)
{
D3DMATRIX
proj
,
view
,
world
;
D3DMATRIX
proj
=
{
1
.
810660
f
,
0
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
2
.
414213
f
,
0
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
1
.
02040
8
f
,
1
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
-
0
.
102041
f
,
0
.
000000
f
,
};
D3DMATRIX
view
=
{
1
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
0
.
000000
f
,
0
.
768221
f
,
-
0
.
640185
f
,
0
.
000000
f
,
-
0
.
000000
f
,
0
.
640185
f
,
0
.
768221
f
,
0
.
000000
f
,
-
14
.
852037
f
,
9
.
857489
f
,
11
.
600972
f
,
1
.
000000
f
,
};
D3DMATRIX
world
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
};
D3DVALUE
radius
[
3
];
D3DVECTOR
center
[
3
];
DWORD
result
[
3
];
HRESULT
rc
;
world
.
_11
=
1
.
0
;
world
.
_12
=
0
.
0
;
world
.
_13
=
0
.
0
;
world
.
_14
=
0
.
0
;
world
.
_21
=
0
.
0
;
world
.
_22
=
1
.
0
;
world
.
_23
=
0
.
0
;
world
.
_24
=
0
.
0
;
world
.
_31
=
0
.
0
;
world
.
_32
=
0
.
0
;
world
.
_33
=
1
.
0
;
world
.
_34
=
0
.
0
;
world
.
_41
=
0
.
0
;
world
.
_42
=
0
.
0
;
world
.
_43
=
0
.
0
;
world
.
_44
=
1
.
0
;
view
.
_11
=
1
.
000000
;
view
.
_12
=
0
.
000000
;
view
.
_13
=
0
.
000000
;
view
.
_14
=
0
.
000000
;
view
.
_21
=
0
.
000000
;
view
.
_22
=
0
.
768221
;
view
.
_23
=-
0
.
640185
;
view
.
_24
=
0
.
000000
;
view
.
_31
=-
0
.
000000
;
view
.
_32
=
0
.
640185
;
view
.
_33
=
0
.
768221
;
view
.
_34
=
0
.
000000
;
view
.
_41
=-
14
.
852037
;
view
.
_42
=
9
.
857489
;
view
.
_43
=
11
.
600972
;
view
.
_44
=
1
.
000000
;
proj
.
_11
=
1
.
810660
;
proj
.
_12
=
0
.
000000
;
proj
.
_13
=
0
.
00000
;
proj
.
_14
=
0
.
000000
;
proj
.
_21
=
0
.
000000
;
proj
.
_22
=
2
.
414213
;
proj
.
_23
=
0
.
000000
,
proj
.
_24
=
0
.
000000
;
proj
.
_31
=
0
.
000000
;
proj
.
_32
=
0
.
000000
;
proj
.
_33
=
1
.
02040
8
,
proj
.
_34
=
1
.
000000
;
proj
.
_41
=
0
.
000000
;
proj
.
_42
=
0
.
000000
;
proj
.
_43
=-
0
.
102041
;
proj
.
_44
=
0
.
000000
;
IDirect3DDevice7_SetTransform
(
lpD3DDevice
,
D3DTRANSFORMSTATE_WORLD
,
&
world
);
IDirect3DDevice7_SetTransform
(
lpD3DDevice
,
D3DTRANSFORMSTATE_VIEW
,
&
view
);
IDirect3DDevice7_SetTransform
(
lpD3DDevice
,
D3DTRANSFORMSTATE_PROJECTION
,
&
proj
);
...
...
dlls/ddraw/tests/visual.c
View file @
9031adfd
...
...
@@ -290,11 +290,13 @@ static void lighting_test(IDirect3DDevice7 *device)
DWORD
nfvf
=
D3DFVF_XYZ
|
D3DFVF_DIFFUSE
|
D3DFVF_NORMAL
;
DWORD
color
;
float
mat
[
16
]
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
};
D3DMATRIX
mat
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
};
struct
vertex
unlitquad
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
,
0xffff0000
},
...
...
@@ -329,11 +331,11 @@ static void lighting_test(IDirect3DDevice7 *device)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_Clear failed with %08x
\n
"
,
hr
);
/* Setup some states that may cause issues */
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
(
D3DMATRIX
*
)
mat
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
&
mat
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_SetTransform returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_VIEW
,
(
D3DMATRIX
*
)
mat
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_VIEW
,
&
mat
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_SetTransform returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_PROJECTION
,
(
D3DMATRIX
*
)
mat
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_PROJECTION
,
&
mat
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_SetTransform returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_CLIPPING
,
FALSE
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_SetRenderState returned %08x
\n
"
,
hr
);
...
...
@@ -491,36 +493,34 @@ static void fog_test(IDirect3DDevice7 *device)
{
320
,
480
,
1
.
0
f
,
1
.
0
f
,
0xFFFFFF00
,
0xFF000000
},
};
WORD
Indices
[]
=
{
0
,
1
,
2
,
2
,
3
,
0
};
float
ident_mat
[
16
]
=
D3DMATRIX
ident_mat
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
};
float
world_mat1
[
16
]
=
D3DMATRIX
world_mat1
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
-
0
.
5
f
,
1
.
0
f
0
.
0
f
,
0
.
0
f
,
-
0
.
5
f
,
1
.
0
f
,
};
float
world_mat2
[
16
]
=
D3DMATRIX
world_mat2
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
1
.
0
f
,
};
float
proj_mat
[
16
]
=
D3DMATRIX
proj_mat
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
-
1
.
0
f
,
1
.
0
f
0
.
0
f
,
0
.
0
f
,
-
1
.
0
f
,
1
.
0
f
,
};
struct
sVertex
far_quad1
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
5
f
,
0xffff0000
,
0xff000000
},
...
...
@@ -625,7 +625,7 @@ static void fog_test(IDirect3DDevice7 *device)
if
(
caps
.
dpcTriCaps
.
dwRasterCaps
&
D3DPRASTERCAPS_FOGTABLE
)
{
/* A simple fog + non-identity world matrix test */
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
(
D3DMATRIX
*
)
world_mat1
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
&
world_mat1
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice7_SetTransform returned %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGTABLEMODE
,
D3DFOG_LINEAR
);
...
...
@@ -660,9 +660,9 @@ static void fog_test(IDirect3DDevice7 *device)
ok
(
color_match
(
color
,
0x0000ff00
,
1
),
"Fogged out quad has color %08x
\n
"
,
color
);
/* Test fog behavior with an orthogonal (but not identity) projection matrix */
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
(
D3DMATRIX
*
)
world_mat2
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
&
world_mat2
);
ok
(
hr
==
D3D_OK
,
"SetTransform returned %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_PROJECTION
,
(
D3DMATRIX
*
)
proj_mat
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_PROJECTION
,
&
proj_mat
);
ok
(
hr
==
D3D_OK
,
"SetTransform returned %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0xffff00ff
,
0
.
0
,
0
);
...
...
@@ -691,9 +691,9 @@ static void fog_test(IDirect3DDevice7 *device)
color
=
getPixelColor
(
device
,
160
,
120
);
ok
(
color_match
(
color
,
0x0000ff00
,
1
),
"Fogged out quad has color %08x
\n
"
,
color
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
(
D3DMATRIX
*
)
ident_mat
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_WORLD
,
&
ident_mat
);
ok
(
hr
==
D3D_OK
,
"SetTransform returned %#08x
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_PROJECTION
,
(
D3DMATRIX
*
)
ident_mat
);
hr
=
IDirect3DDevice7_SetTransform
(
device
,
D3DTRANSFORMSTATE_PROJECTION
,
&
ident_mat
);
ok
(
hr
==
D3D_OK
,
"SetTransform returned %#08x
\n
"
,
hr
);
}
else
...
...
@@ -2230,10 +2230,13 @@ static void D3D3_ViewportClearTest(void)
D3DVIEWPORT2
vp_data
;
DWORD
color
,
red
,
green
,
blue
;
D3DRECT
rect
;
float
mat
[
16
]
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
};
D3DMATRIX
mat
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
};
struct
vertex
quad
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
1
f
,
0xffffffff
},
...
...
@@ -2335,11 +2338,11 @@ static void D3D3_ViewportClearTest(void)
hr
=
IDirect3DDevice3_BeginScene
(
Direct3DDevice3
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice3_BeginScene failed with %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice3_SetTransform
(
Direct3DDevice3
,
D3DTRANSFORMSTATE_WORLD
,
(
D3DMATRIX
*
)
mat
);
hr
=
IDirect3DDevice3_SetTransform
(
Direct3DDevice3
,
D3DTRANSFORMSTATE_WORLD
,
&
mat
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice3_SetTransform returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice3_SetTransform
(
Direct3DDevice3
,
D3DTRANSFORMSTATE_VIEW
,
(
D3DMATRIX
*
)
mat
);
hr
=
IDirect3DDevice3_SetTransform
(
Direct3DDevice3
,
D3DTRANSFORMSTATE_VIEW
,
&
mat
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice3_SetTransform returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice3_SetTransform
(
Direct3DDevice3
,
D3DTRANSFORMSTATE_PROJECTION
,
(
D3DMATRIX
*
)
mat
);
hr
=
IDirect3DDevice3_SetTransform
(
Direct3DDevice3
,
D3DTRANSFORMSTATE_PROJECTION
,
&
mat
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice3_SetTransform returned %08x
\n
"
,
hr
);
hr
=
IDirect3DDevice3_SetRenderState
(
Direct3DDevice3
,
D3DRENDERSTATE_CLIPPING
,
FALSE
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice3_SetRenderState returned %08x
\n
"
,
hr
);
...
...
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