Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
6840049f
Commit
6840049f
authored
Nov 12, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXMatrixAffine Transformation.
parent
a51486c6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
2 deletions
+56
-2
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+38
-0
math.c
dlls/d3dx8/tests/math.c
+16
-1
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
6840049f
...
...
@@ -34,7 +34,7 @@
@ stdcall D3DXMatrixRotationQuaternion(ptr ptr)
@ stdcall D3DXMatrixRotationYawPitchRoll(ptr long long long)
@ stub D3DXMatrixTransformation
@ st
ub D3DXMatrixAffineTransformation
@ st
dcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr)
@ stdcall D3DXMatrixLookAtRH(ptr ptr ptr ptr)
@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr)
@ stdcall D3DXMatrixPerspectiveRH(ptr long long long long)
...
...
dlls/d3dx8/math.c
View file @
6840049f
...
...
@@ -34,6 +34,44 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx8);
/*_________________D3DXMatrix____________________*/
D3DXMATRIX
*
WINAPI
D3DXMatrixAffineTransformation
(
D3DXMATRIX
*
pout
,
float
scaling
,
D3DXVECTOR3
*
rotationcenter
,
D3DXQUATERNION
*
rotation
,
D3DXVECTOR3
*
translation
)
{
D3DXMATRIX
m1
,
m2
,
m3
,
m4
,
m5
,
p1
,
p2
,
p3
;
D3DXMatrixScaling
(
&
m1
,
scaling
,
scaling
,
scaling
);
if
(
!
rotationcenter
)
{
D3DXMatrixIdentity
(
&
m2
);
D3DXMatrixIdentity
(
&
m4
);
}
else
{
D3DXMatrixTranslation
(
&
m2
,
-
rotationcenter
->
x
,
-
rotationcenter
->
y
,
-
rotationcenter
->
z
);
D3DXMatrixTranslation
(
&
m4
,
rotationcenter
->
x
,
rotationcenter
->
y
,
rotationcenter
->
z
);
}
if
(
!
rotation
)
{
D3DXMatrixIdentity
(
&
m3
);
}
else
{
D3DXMatrixRotationQuaternion
(
&
m3
,
rotation
);
}
if
(
!
translation
)
{
D3DXMatrixIdentity
(
&
m5
);
}
else
{
D3DXMatrixTranslation
(
&
m5
,
translation
->
x
,
translation
->
y
,
translation
->
z
);
}
D3DXMatrixMultiply
(
&
p1
,
&
m1
,
&
m2
);
D3DXMatrixMultiply
(
&
p2
,
&
p1
,
&
m3
);
D3DXMatrixMultiply
(
&
p3
,
&
p2
,
&
m4
);
D3DXMatrixMultiply
(
pout
,
&
p3
,
&
m5
);
return
pout
;
}
FLOAT
WINAPI
D3DXMatrixfDeterminant
(
CONST
D3DXMATRIX
*
pm
)
{
D3DXVECTOR4
minor
,
v1
,
v2
,
v3
;
...
...
dlls/d3dx8/tests/math.c
View file @
6840049f
...
...
@@ -21,7 +21,7 @@
#include "wine/test.h"
#define admitted_error 0.000
0
1f
#define admitted_error 0.0001f
#define expect_color(expectedcolor,gotcolor) ok((fabs(expectedcolor.r-gotcolor.r)<admitted_error)&&(fabs(expectedcolor.g-gotcolor.g)<admitted_error)&&(fabs(expectedcolor.b-gotcolor.b)<admitted_error)&&(fabs(expectedcolor.a-gotcolor.a)<admitted_error),"Expected Color= (%f, %f, %f, %f)\n , Got Color= (%f, %f, %f, %f)\n", expectedcolor.r, expectedcolor.g, expectedcolor.b, expectedcolor.a, gotcolor.r, gotcolor.g, gotcolor.b, gotcolor.a);
...
...
@@ -177,6 +177,21 @@ static void D3DXMatrixTest(void)
angle
=
D3DX_PI
/
3
.
0
f
;
/*____________D3DXMatrixAffineTransformation______*/
expectedmat
.
m
[
0
][
0
]
=
-
459
.
239990
f
;
expectedmat
.
m
[
0
][
1
]
=
-
576
.
719971
f
;
expectedmat
.
m
[
0
][
2
]
=
-
263
.
440002
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
519
.
760010
f
;
expectedmat
.
m
[
1
][
1
]
=
-
352
.
440002
f
;
expectedmat
.
m
[
1
][
2
]
=
-
277
.
679993
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
363
.
119995
f
;
expectedmat
.
m
[
2
][
1
]
=
-
121
.
040001
f
;
expectedmat
.
m
[
2
][
2
]
=
-
117
.
479996
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
-
1239
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
667
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
567
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
&
at
,
&
q
,
&
axis
);
expect_mat
(
expectedmat
,
gotmat
);
/* Test the NULL case */
expectedmat
.
m
[
0
][
0
]
=
-
459
.
239990
f
;
expectedmat
.
m
[
0
][
1
]
=
-
576
.
719971
f
;
expectedmat
.
m
[
0
][
2
]
=
-
263
.
440002
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
519
.
760010
f
;
expectedmat
.
m
[
1
][
1
]
=
-
352
.
440002
f
;
expectedmat
.
m
[
1
][
2
]
=
-
277
.
679993
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
363
.
119995
f
;
expectedmat
.
m
[
2
][
1
]
=
-
121
.
040001
f
;
expectedmat
.
m
[
2
][
2
]
=
-
117
.
479996
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
1
.
0
f
;
expectedmat
.
m
[
3
][
1
]
=
-
3
.
0
f
;
expectedmat
.
m
[
3
][
2
]
=
7
.
0
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
NULL
,
&
q
,
&
axis
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixfDeterminant_____________*/
expectedfloat
=
-
147888
.
0
f
;
gotfloat
=
D3DXMatrixfDeterminant
(
&
mat
);
...
...
include/d3dx8math.h
View file @
6840049f
...
...
@@ -259,6 +259,7 @@ typedef struct D3DXCOLOR
FLOAT
r
,
g
,
b
,
a
;
}
D3DXCOLOR
,
*
LPD3DXCOLOR
;
D3DXMATRIX
*
WINAPI
D3DXMatrixAffineTransformation
(
D3DXMATRIX
*
pout
,
float
scaling
,
D3DXVECTOR3
*
rotationcenter
,
D3DXQUATERNION
*
rotation
,
D3DXVECTOR3
*
translation
);
FLOAT
WINAPI
D3DXMatrixfDeterminant
(
CONST
D3DXMATRIX
*
pm
);
D3DXMATRIX
*
WINAPI
D3DXMatrixInverse
(
D3DXMATRIX
*
pout
,
FLOAT
*
pdeterminant
,
CONST
D3DXMATRIX
*
pm
);
D3DXMATRIX
*
WINAPI
D3DXMatrixLookAtLH
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
peye
,
CONST
D3DXVECTOR3
*
pat
,
CONST
D3DXVECTOR3
*
pup
);
...
...
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