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
0af9415a
Commit
0af9415a
authored
Sep 11, 2008
by
Luis C. Busquets Pérez
Committed by
Alexandre Julliard
Sep 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement D3DXMatrixDecompose.
parent
36cf25b5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
math.c
dlls/d3dx9_36/math.c
+54
-0
d3dx9math.h
include/d3dx9math.h
+1
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
0af9415a
...
...
@@ -198,7 +198,7 @@
@ stub D3DXLoadVolumeFromVolume
@ stdcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr) d3dx8.D3DXMatrixAffineTransformation
@ stub D3DXMatrixAffineTransformation2D
@ st
ub D3DXMatrixDecompose
@ st
dcall D3DXMatrixDecompose(ptr ptr ptr ptr)
@ stdcall D3DXMatrixDeterminant(ptr) d3dx8.D3DXMatrixfDeterminant
@ stdcall D3DXMatrixInverse(ptr ptr ptr) d3dx8.D3DXMatrixInverse
@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr) d3dx8.D3DXMatrixLookAtLH
...
...
dlls/d3dx9_36/math.c
View file @
0af9415a
...
...
@@ -27,6 +27,60 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
/*************************************************************************
* D3DXMatrixDecompose
*/
HRESULT
WINAPI
D3DXMatrixDecompose
(
D3DXVECTOR3
*
poutscale
,
D3DXQUATERNION
*
poutrotation
,
D3DXVECTOR3
*
pouttranslation
,
D3DXMATRIX
*
pm
)
{
D3DXMATRIX
normalized
;
D3DXVECTOR3
vec
;
if
(
!
pm
)
{
return
D3DERR_INVALIDCALL
;
}
/*Compute the scaling part.*/
vec
.
x
=
pm
->
m
[
0
][
0
];
vec
.
y
=
pm
->
m
[
0
][
1
];
vec
.
z
=
pm
->
m
[
0
][
2
];
poutscale
->
x
=
D3DXVec3Length
(
&
vec
);
vec
.
x
=
pm
->
m
[
1
][
0
];
vec
.
y
=
pm
->
m
[
1
][
1
];
vec
.
z
=
pm
->
m
[
1
][
2
];
poutscale
->
y
=
D3DXVec3Length
(
&
vec
);
vec
.
x
=
pm
->
m
[
2
][
0
];
vec
.
y
=
pm
->
m
[
2
][
1
];
vec
.
z
=
pm
->
m
[
2
][
2
];
poutscale
->
z
=
D3DXVec3Length
(
&
vec
);
/*Compute the translation part.*/
pouttranslation
->
x
=
pm
->
m
[
3
][
0
];
pouttranslation
->
y
=
pm
->
m
[
3
][
1
];
pouttranslation
->
z
=
pm
->
m
[
3
][
2
];
/*Let's calculate the rotation now*/
if
(
(
poutscale
->
x
==
0
.
0
f
)
||
(
poutscale
->
y
==
0
.
0
f
)
||
(
poutscale
->
z
==
0
.
0
f
)
)
{
return
D3DERR_INVALIDCALL
;
}
normalized
.
m
[
0
][
0
]
=
pm
->
m
[
0
][
0
]
/
poutscale
->
x
;
normalized
.
m
[
0
][
1
]
=
pm
->
m
[
0
][
1
]
/
poutscale
->
x
;
normalized
.
m
[
0
][
2
]
=
pm
->
m
[
0
][
2
]
/
poutscale
->
x
;
normalized
.
m
[
1
][
0
]
=
pm
->
m
[
1
][
0
]
/
poutscale
->
y
;
normalized
.
m
[
1
][
1
]
=
pm
->
m
[
1
][
1
]
/
poutscale
->
y
;
normalized
.
m
[
1
][
2
]
=
pm
->
m
[
1
][
2
]
/
poutscale
->
y
;
normalized
.
m
[
2
][
0
]
=
pm
->
m
[
2
][
0
]
/
poutscale
->
z
;
normalized
.
m
[
2
][
1
]
=
pm
->
m
[
2
][
1
]
/
poutscale
->
z
;
normalized
.
m
[
2
][
2
]
=
pm
->
m
[
2
][
2
]
/
poutscale
->
z
;
D3DXQuaternionRotationMatrix
(
poutrotation
,
&
normalized
);
return
S_OK
;
}
/*************************************************************************
* D3DXPlaneTransformArray
*/
D3DXPLANE
*
WINAPI
D3DXPlaneTransformArray
(
...
...
include/d3dx9math.h
View file @
0af9415a
...
...
@@ -267,6 +267,7 @@ D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc,
D3DXCOLOR
*
WINAPI
D3DXColorAdjustSaturation
(
D3DXCOLOR
*
pout
,
CONST
D3DXCOLOR
*
pc
,
FLOAT
s
);
D3DXMATRIX
*
WINAPI
D3DXMatrixAffineTransformation
(
D3DXMATRIX
*
pout
,
float
scaling
,
D3DXVECTOR3
*
rotationcenter
,
D3DXQUATERNION
*
rotation
,
D3DXVECTOR3
*
translation
);
HRESULT
WINAPI
D3DXMatrixDecompose
(
D3DXVECTOR3
*
poutscale
,
D3DXQUATERNION
*
poutrotation
,
D3DXVECTOR3
*
pouttranslation
,
D3DXMATRIX
*
pm
);
FLOAT
WINAPI
D3DXMatrixDeterminant
(
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