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
09c6caea
Commit
09c6caea
authored
Nov 12, 2008
by
David Adam
Committed by
Alexandre Julliard
Nov 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXMatrixTransformation2D.
parent
4f1d5c26
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
161 additions
and
1 deletion
+161
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
math.c
dlls/d3dx9_36/math.c
+80
-0
math.c
dlls/d3dx9_36/tests/math.c
+79
-0
d3dx9math.h
include/d3dx9math.h
+1
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
09c6caea
...
@@ -225,7 +225,7 @@
...
@@ -225,7 +225,7 @@
@ stdcall D3DXMatrixScaling(ptr long long long) d3dx8.D3DXMatrixScaling
@ stdcall D3DXMatrixScaling(ptr long long long) d3dx8.D3DXMatrixScaling
@ stdcall D3DXMatrixShadow(ptr ptr ptr) d3dx8.D3DXMatrixShadow
@ stdcall D3DXMatrixShadow(ptr ptr ptr) d3dx8.D3DXMatrixShadow
@ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXMatrixTransformation
@ stdcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXMatrixTransformation
@ st
ub D3DXMatrixTransformation2D
@ st
dcall D3DXMatrixTransformation2D(ptr ptr long ptr ptr long ptr)
@ stdcall D3DXMatrixTranslation(ptr long long long) d3dx8.D3DXMatrixTranslation
@ stdcall D3DXMatrixTranslation(ptr long long long) d3dx8.D3DXMatrixTranslation
@ stdcall D3DXMatrixTranspose(ptr ptr) d3dx8.D3DXMatrixTranspose
@ stdcall D3DXMatrixTranspose(ptr ptr) d3dx8.D3DXMatrixTranspose
@ stub D3DXOptimizeFaces
@ stub D3DXOptimizeFaces
...
...
dlls/d3dx9_36/math.c
View file @
09c6caea
/*
/*
* Mathematical operations specific to D3DX9.
* Mathematical operations specific to D3DX9.
*
*
* Copyright (C) 2008 David Adam
* Copyright (C) 2008 Philip Nilsson
* Copyright (C) 2008 Philip Nilsson
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
...
@@ -130,6 +131,85 @@ HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutr
...
@@ -130,6 +131,85 @@ HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutr
}
}
/*************************************************************************
/*************************************************************************
* D3DXMatrixTransformation2D
*/
D3DXMATRIX
*
WINAPI
D3DXMatrixTransformation2D
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR2
*
pscalingcenter
,
FLOAT
scalingrotation
,
CONST
D3DXVECTOR2
*
pscaling
,
CONST
D3DXVECTOR2
*
protationcenter
,
FLOAT
rotation
,
CONST
D3DXVECTOR2
*
ptranslation
)
{
D3DXQUATERNION
rot
,
sca_rot
;
D3DXVECTOR3
rot_center
,
sca
,
sca_center
,
trans
;
if
(
pscalingcenter
)
{
sca_center
.
x
=
pscalingcenter
->
x
;
sca_center
.
y
=
pscalingcenter
->
y
;
sca_center
.
z
=
0
.
0
f
;
}
else
{
sca_center
.
x
=
0
.
0
f
;
sca_center
.
y
=
0
.
0
f
;
sca_center
.
z
=
0
.
0
f
;
}
if
(
pscaling
)
{
sca
.
x
=
pscaling
->
x
;
sca
.
y
=
pscaling
->
y
;
sca
.
z
=
0
.
0
f
;
}
else
{
sca
.
x
=
0
.
0
f
;
sca
.
y
=
0
.
0
f
;
sca
.
z
=
0
.
0
f
;
}
if
(
protationcenter
)
{
rot_center
.
x
=
protationcenter
->
x
;
rot_center
.
y
=
protationcenter
->
y
;
rot_center
.
z
=
0
.
0
f
;
}
else
{
rot_center
.
x
=
0
.
0
f
;
rot_center
.
y
=
0
.
0
f
;
rot_center
.
z
=
0
.
0
f
;
}
if
(
ptranslation
)
{
trans
.
x
=
ptranslation
->
x
;
trans
.
y
=
ptranslation
->
y
;
trans
.
z
=
0
.
0
f
;
}
else
{
trans
.
x
=
0
.
0
f
;
trans
.
y
=
0
.
0
f
;
trans
.
z
=
0
.
0
f
;
}
rot
.
w
=
cos
(
rotation
/
2
.
0
f
);
rot
.
x
=
0
.
0
f
;
rot
.
y
=
0
.
0
f
;
rot
.
z
=
sin
(
rotation
/
2
.
0
f
);
sca_rot
.
w
=
cos
(
scalingrotation
/
2
.
0
f
);
sca_rot
.
x
=
0
.
0
f
;
sca_rot
.
y
=
0
.
0
f
;
sca_rot
.
z
=
sin
(
scalingrotation
/
2
.
0
f
);
D3DXMatrixTransformation
(
pout
,
&
sca_center
,
&
sca_rot
,
&
sca
,
&
rot_center
,
&
rot
,
&
trans
);
return
pout
;
}
/*************************************************************************
* D3DXPlaneTransformArray
* D3DXPlaneTransformArray
*/
*/
D3DXPLANE
*
WINAPI
D3DXPlaneTransformArray
(
D3DXPLANE
*
WINAPI
D3DXPlaneTransformArray
(
...
...
dlls/d3dx9_36/tests/math.c
View file @
09c6caea
/*
/*
* Copyright 2008 David Adam
* Copyright 2008 Philip Nilsson
* Copyright 2008 Philip Nilsson
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
...
@@ -584,6 +585,83 @@ static void test_Matrix_Decompose(void)
...
@@ -584,6 +585,83 @@ static void test_Matrix_Decompose(void)
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Expected D3DERR_INVALIDCALL, got %x
\n
"
,
hr
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Expected D3DERR_INVALIDCALL, got %x
\n
"
,
hr
);
}
}
static
void
test_Matrix_Transformation2D
(
void
)
{
D3DXMATRIX
exp_mat
,
got_mat
;
D3DXVECTOR2
rot_center
,
sca
,
sca_center
,
trans
;
FLOAT
rot
,
sca_rot
;
rot_center
.
x
=
3
.
0
f
;
rot_center
.
y
=
4
.
0
f
;
sca
.
x
=
12
.
0
f
;
sca
.
y
=
-
3
.
0
f
;
sca_center
.
x
=
9
.
0
f
;
sca_center
.
y
=
-
5
.
0
f
;
trans
.
x
=
-
6
.
0
f
;
trans
.
y
=
7
.
0
f
;
rot
=
D3DX_PI
/
3
.
0
f
;
sca_rot
=
5
.
0
f
*
D3DX_PI
/
4
.
0
f
;
exp_mat
.
m
[
0
][
0
]
=
-
4
.
245192
f
;
exp_mat
.
m
[
1
][
0
]
=
-
0
.
147116
f
;
exp_mat
.
m
[
2
][
0
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
0
]
=
45
.
265373
f
;
exp_mat
.
m
[
0
][
1
]
=
7
.
647113
f
;
exp_mat
.
m
[
1
][
1
]
=
8
.
745192
f
;
exp_mat
.
m
[
2
][
1
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
1
]
=
-
13
.
401899
f
;
exp_mat
.
m
[
0
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
1
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
2
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
0
][
3
]
=
0
.
0
f
;
exp_mat
.
m
[
1
][
3
]
=
0
.
0
f
;
exp_mat
.
m
[
2
][
3
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixTransformation2D
(
&
got_mat
,
&
sca_center
,
sca_rot
,
&
sca
,
&
rot_center
,
rot
,
&
trans
);
expect_mat
(
&
exp_mat
,
&
got_mat
);
/*_________*/
sca_center
.
x
=
9
.
0
f
;
sca_center
.
y
=
-
5
.
0
f
;
trans
.
x
=
-
6
.
0
f
;
trans
.
y
=
7
.
0
f
;
rot
=
D3DX_PI
/
3
.
0
f
;
sca_rot
=
5
.
0
f
*
D3DX_PI
/
4
.
0
f
;
exp_mat
.
m
[
0
][
0
]
=
0
.
0
f
;
exp_mat
.
m
[
1
][
0
]
=
0
.
0
f
;
exp_mat
.
m
[
2
][
0
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
0
]
=
2
.
830127
f
;
exp_mat
.
m
[
0
][
1
]
=
0
.
0
f
;
exp_mat
.
m
[
1
][
1
]
=
0
.
0
f
;
exp_mat
.
m
[
2
][
1
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
1
]
=
12
.
294229
f
;
exp_mat
.
m
[
0
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
1
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
2
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
2
]
=
0
.
0
f
;
exp_mat
.
m
[
0
][
3
]
=
0
.
0
f
;
exp_mat
.
m
[
1
][
3
]
=
0
.
0
f
;
exp_mat
.
m
[
2
][
3
]
=
0
.
0
f
;
exp_mat
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixTransformation2D
(
&
got_mat
,
&
sca_center
,
sca_rot
,
NULL
,
NULL
,
rot
,
&
trans
);
expect_mat
(
&
exp_mat
,
&
got_mat
);
}
static
void
test_D3DXVec_Array
(
void
)
static
void
test_D3DXVec_Array
(
void
)
{
{
unsigned
int
i
;
unsigned
int
i
;
...
@@ -725,5 +803,6 @@ START_TEST(math)
...
@@ -725,5 +803,6 @@ START_TEST(math)
{
{
test_Matrix_AffineTransformation2D
();
test_Matrix_AffineTransformation2D
();
test_Matrix_Decompose
();
test_Matrix_Decompose
();
test_Matrix_Transformation2D
();
test_D3DXVec_Array
();
test_D3DXVec_Array
();
}
}
include/d3dx9math.h
View file @
09c6caea
...
@@ -296,6 +296,7 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle);
...
@@ -296,6 +296,7 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle);
D3DXMATRIX
*
WINAPI
D3DXMatrixScaling
(
D3DXMATRIX
*
pout
,
FLOAT
sx
,
FLOAT
sy
,
FLOAT
sz
);
D3DXMATRIX
*
WINAPI
D3DXMatrixScaling
(
D3DXMATRIX
*
pout
,
FLOAT
sx
,
FLOAT
sy
,
FLOAT
sz
);
D3DXMATRIX
*
WINAPI
D3DXMatrixShadow
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR4
*
plight
,
CONST
D3DXPLANE
*
pPlane
);
D3DXMATRIX
*
WINAPI
D3DXMatrixShadow
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR4
*
plight
,
CONST
D3DXPLANE
*
pPlane
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTransformation
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
pscalingcenter
,
CONST
D3DXQUATERNION
*
pscalingrotation
,
CONST
D3DXVECTOR3
*
pscaling
,
CONST
D3DXVECTOR3
*
protationcenter
,
CONST
D3DXQUATERNION
*
protation
,
CONST
D3DXVECTOR3
*
ptranslation
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTransformation
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
pscalingcenter
,
CONST
D3DXQUATERNION
*
pscalingrotation
,
CONST
D3DXVECTOR3
*
pscaling
,
CONST
D3DXVECTOR3
*
protationcenter
,
CONST
D3DXQUATERNION
*
protation
,
CONST
D3DXVECTOR3
*
ptranslation
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTransformation2D
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR2
*
pscalingcenter
,
FLOAT
scalingrotation
,
CONST
D3DXVECTOR2
*
pscaling
,
CONST
D3DXVECTOR2
*
protationcenter
,
FLOAT
rotation
,
CONST
D3DXVECTOR2
*
ptranslation
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTranslation
(
D3DXMATRIX
*
pout
,
FLOAT
x
,
FLOAT
y
,
FLOAT
z
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTranslation
(
D3DXMATRIX
*
pout
,
FLOAT
x
,
FLOAT
y
,
FLOAT
z
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTranspose
(
D3DXMATRIX
*
pout
,
CONST
D3DXMATRIX
*
pm
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTranspose
(
D3DXMATRIX
*
pout
,
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