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
c131bee4
Commit
c131bee4
authored
Sep 28, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Sep 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Improve D3DXMatrixAffineTransformation2D().
parent
aa344fc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
41 deletions
+26
-41
math.c
dlls/d3dx9_36/math.c
+26
-41
No files found.
dlls/d3dx9_36/math.c
View file @
c131bee4
...
@@ -126,57 +126,42 @@ D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scalin
...
@@ -126,57 +126,42 @@ D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scalin
return
pout
;
return
pout
;
}
}
D3DXMATRIX
*
WINAPI
D3DXMatrixAffineTransformation2D
(
D3DXMATRIX
*
pout
,
FLOAT
scaling
,
CONST
D3DXVECTOR2
*
protationcenter
,
FLOAT
rotation
,
CONST
D3DXVECTOR2
*
ptranslation
)
D3DXMATRIX
*
WINAPI
D3DXMatrixAffineTransformation2D
(
D3DXMATRIX
*
out
,
FLOAT
scaling
,
const
D3DXVECTOR2
*
rotationcenter
,
FLOAT
rotation
,
const
D3DXVECTOR2
*
translation
)
{
{
D3DXMATRIX
m1
,
m2
,
m3
,
m4
,
m5
;
FLOAT
tmp1
,
tmp2
,
s
;
D3DXQUATERNION
rot
;
D3DXVECTOR3
rot_center
,
trans
;
TRACE
(
"(%p, %f, %p, %f, %p)
\n
"
,
pout
,
scaling
,
protationcenter
,
rotation
,
ptranslation
);
TRACE
(
"out %p, scaling %f, rotationcenter %p, rotation %f, translation %p
\n
"
,
out
,
scaling
,
rotationcenter
,
rotation
,
translation
);
rot
.
w
=
cos
(
rotation
/
2
.
0
f
);
s
=
sinf
(
rotation
/
2
.
0
f
);
rot
.
x
=
0
.
0
f
;
tmp1
=
1
.
0
f
-
2
.
0
f
*
s
*
s
;
rot
.
y
=
0
.
0
f
;
tmp2
=
2
.
0
*
s
*
cosf
(
rotation
/
2
.
0
f
);
rot
.
z
=
sin
(
rotation
/
2
.
0
f
);
if
(
protationcenter
)
D3DXMatrixIdentity
(
out
);
{
out
->
u
.
m
[
0
][
0
]
=
scaling
*
tmp1
;
rot_center
.
x
=
protationcenter
->
x
;
out
->
u
.
m
[
0
][
1
]
=
scaling
*
tmp2
;
rot_center
.
y
=
protationcenter
->
y
;
out
->
u
.
m
[
1
][
0
]
=
-
scaling
*
tmp2
;
rot_center
.
z
=
0
.
0
f
;
out
->
u
.
m
[
1
][
1
]
=
scaling
*
tmp1
;
}
else
{
rot_center
.
x
=
0
.
0
f
;
rot_center
.
y
=
0
.
0
f
;
rot_center
.
z
=
0
.
0
f
;
}
if
(
ptranslation
)
if
(
rotationcenter
)
{
{
trans
.
x
=
ptranslation
->
x
;
FLOAT
x
,
y
;
trans
.
y
=
ptranslation
->
y
;
trans
.
z
=
0
.
0
f
;
x
=
rotationcenter
->
x
;
y
=
rotationcenter
->
y
;
out
->
u
.
m
[
3
][
0
]
=
y
*
tmp2
-
x
*
tmp1
+
x
;
out
->
u
.
m
[
3
][
1
]
=
-
x
*
tmp2
-
y
*
tmp1
+
y
;
}
}
else
if
(
translation
)
{
{
trans
.
x
=
0
.
0
f
;
out
->
u
.
m
[
3
][
0
]
+=
translation
->
x
;
trans
.
y
=
0
.
0
f
;
out
->
u
.
m
[
3
][
1
]
+=
translation
->
y
;
trans
.
z
=
0
.
0
f
;
}
}
D3DXMatrixScaling
(
&
m1
,
scaling
,
scaling
,
1
.
0
f
);
return
out
;
D3DXMatrixTranslation
(
&
m2
,
-
rot_center
.
x
,
-
rot_center
.
y
,
-
rot_center
.
z
);
D3DXMatrixTranslation
(
&
m4
,
rot_center
.
x
,
rot_center
.
y
,
rot_center
.
z
);
D3DXMatrixRotationQuaternion
(
&
m3
,
&
rot
);
D3DXMatrixTranslation
(
&
m5
,
trans
.
x
,
trans
.
y
,
trans
.
z
);
D3DXMatrixMultiply
(
&
m1
,
&
m1
,
&
m2
);
D3DXMatrixMultiply
(
&
m1
,
&
m1
,
&
m3
);
D3DXMatrixMultiply
(
&
m1
,
&
m1
,
&
m4
);
D3DXMatrixMultiply
(
pout
,
&
m1
,
&
m5
);
return
pout
;
}
}
HRESULT
WINAPI
D3DXMatrixDecompose
(
D3DXVECTOR3
*
poutscale
,
D3DXQUATERNION
*
poutrotation
,
D3DXVECTOR3
*
pouttranslation
,
CONST
D3DXMATRIX
*
pm
)
HRESULT
WINAPI
D3DXMatrixDecompose
(
D3DXVECTOR3
*
poutscale
,
D3DXQUATERNION
*
poutrotation
,
D3DXVECTOR3
*
pouttranslation
,
CONST
D3DXMATRIX
*
pm
)
...
...
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