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
c1892f25
Commit
c1892f25
authored
Oct 18, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DX*Minimize.
parent
c7f0eca4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
math.c
dlls/d3dx8/tests/math.c
+20
-0
d3dx8math.inl
include/d3dx8math.inl
+19
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
c1892f25
...
@@ -253,6 +253,16 @@ static void D3X8Vector3Test(void)
...
@@ -253,6 +253,16 @@ static void D3X8Vector3Test(void)
funcpointer
=
D3DXVec3Maximize
(
NULL
,
NULL
,
NULL
);
funcpointer
=
D3DXVec3Maximize
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec3Minimize__________________________*/
expectedvec
.
x
=
2
.
0
f
;
expectedvec
.
y
=
-
3
.
0
f
;
expectedvec
.
z
=
-
4
.
0
f
;
D3DXVec3Minimize
(
&
gotvec
,
&
u
,
&
v
);
expect_vec3
(
expectedvec
,
gotvec
);
/* Tests the case NULL */
funcpointer
=
D3DXVec3Minimize
(
&
gotvec
,
NULL
,
&
v
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXVec3Minimize
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec3Subtract_______________________*/
/*_______________D3DXVec3Subtract_______________________*/
expectedvec
.
x
=
7
.
0
f
;
expectedvec
.
y
=
9
.
0
f
;
expectedvec
.
z
=
6
.
0
f
;
expectedvec
.
x
=
7
.
0
f
;
expectedvec
.
y
=
9
.
0
f
;
expectedvec
.
z
=
6
.
0
f
;
D3DXVec3Subtract
(
&
gotvec
,
&
u
,
&
v
);
D3DXVec3Subtract
(
&
gotvec
,
&
u
,
&
v
);
...
@@ -335,6 +345,16 @@ static void D3X8Vector4Test(void)
...
@@ -335,6 +345,16 @@ static void D3X8Vector4Test(void)
funcpointer
=
D3DXVec4Maximize
(
NULL
,
NULL
,
NULL
);
funcpointer
=
D3DXVec4Maximize
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec4Minimize__________________________*/
expectedvec
.
x
=
-
3
.
0
f
;
expectedvec
.
y
=
2
.
0
f
;
expectedvec
.
z
=
-
5
.
0
f
;
expectedvec
.
w
=
7
.
0
;
D3DXVec4Minimize
(
&
gotvec
,
&
u
,
&
v
);
expect_vec4
(
expectedvec
,
gotvec
);
/* Tests the case NULL */
funcpointer
=
D3DXVec4Minimize
(
&
gotvec
,
NULL
,
&
v
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXVec4Minimize
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec4Subtract__________________________*/
/*_______________D3DXVec4Subtract__________________________*/
expectedvec
.
x
=
4
.
0
f
;
expectedvec
.
y
=
-
2
.
0
f
;
expectedvec
.
z
=
9
.
0
f
;
expectedvec
.
w
=
3
.
0
f
;
expectedvec
.
x
=
4
.
0
f
;
expectedvec
.
y
=
-
2
.
0
f
;
expectedvec
.
z
=
9
.
0
f
;
expectedvec
.
w
=
3
.
0
f
;
D3DXVec4Subtract
(
&
gotvec
,
&
u
,
&
v
);
D3DXVec4Subtract
(
&
gotvec
,
&
u
,
&
v
);
...
...
include/d3dx8math.inl
View file @
c1892f25
...
@@ -140,6 +140,15 @@ static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3
...
@@ -140,6 +140,15 @@ static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3
return pout;
return pout;
}
}
static inline D3DXVECTOR3* D3DXVec3Minimize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
if ( !pout || !pv1 || !pv2) return NULL;
pout->x = min(pv1->x , pv2->x);
pout->y = min(pv1->y , pv2->y);
pout->z = min(pv1->z , pv2->z);
return pout;
}
static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
{
if ( !pout || !pv1 || !pv2) return NULL;
if ( !pout || !pv1 || !pv2) return NULL;
...
@@ -199,6 +208,16 @@ static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4
...
@@ -199,6 +208,16 @@ static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4
return pout;
return pout;
}
}
static inline D3DXVECTOR4* D3DXVec4Minimize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
{
if ( !pout || !pv1 || !pv2) return NULL;
pout->x = min(pv1->x , pv2->x);
pout->y = min(pv1->y , pv2->y);
pout->z = min(pv1->z , pv2->z);
pout->w = min(pv1->w , pv2->w);
return pout;
}
static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
{
{
if ( !pout || !pv1 || !pv2) return NULL;
if ( !pout || !pv1 || !pv2) return NULL;
...
...
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