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
819362d0
Commit
819362d0
authored
Apr 19, 2007
by
David Adam
Committed by
Alexandre Julliard
Apr 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Implement D3DRMVectorNormalize.
parent
5524923c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
2 deletions
+31
-2
d3drm.spec
dlls/d3drm/d3drm.spec
+1
-1
math.c
dlls/d3drm/math.c
+17
-0
vector.c
dlls/d3drm/tests/vector.c
+13
-1
No files found.
dlls/d3drm/d3drm.spec
View file @
819362d0
...
...
@@ -12,7 +12,7 @@
@ stdcall D3DRMVectorCrossProduct(ptr ptr ptr)
@ stdcall D3DRMVectorDotProduct(ptr ptr)
@ stdcall D3DRMVectorModulus(ptr)
@ st
ub D3DRMVectorNormalize
@ st
dcall D3DRMVectorNormalize(ptr)
@ stub D3DRMVectorRandom
@ stub D3DRMVectorReflect
@ stub D3DRMVectorRotate
...
...
dlls/d3drm/math.c
View file @
819362d0
...
...
@@ -75,6 +75,23 @@ D3DVALUE WINAPI D3DRMVectorModulus(LPD3DVECTOR v)
return
result
;
}
/* Normalize a vector. Returns (1,0,0) if INPUT is the NULL vector. */
LPD3DVECTOR
WINAPI
D3DRMVectorNormalize
(
LPD3DVECTOR
u
)
{
D3DVALUE
modulus
=
D3DRMVectorModulus
(
u
);
if
(
modulus
)
{
D3DRMVectorScale
(
u
,
u
,
1
.
0
/
modulus
);
}
else
{
u
->
x
=
1
.
0
;
u
->
y
=
0
.
0
;
u
->
z
=
0
.
0
;
}
return
u
;
}
/* Scale a vector */
LPD3DVECTOR
WINAPI
D3DRMVectorScale
(
LPD3DVECTOR
d
,
LPD3DVECTOR
s
,
D3DVALUE
factor
)
{
...
...
dlls/d3drm/tests/vector.c
View file @
819362d0
...
...
@@ -33,7 +33,7 @@
void
VectorTest
(
void
)
{
D3DVALUE
mod
,
par
;
D3DVECTOR
e
,
r
,
u
,
v
;
D3DVECTOR
e
,
r
,
u
,
v
,
casnul
;
u
.
x
=
2
.
0
;
u
.
y
=
2
.
0
;
u
.
z
=
1
.
0
;
v
.
x
=
4
.
0
;
v
.
y
=
4
.
0
;
v
.
z
=
0
.
0
;
...
...
@@ -61,6 +61,18 @@ void VectorTest(void)
mod
=
D3DRMVectorModulus
(
&
u
);
ok
((
mod
==
3
.
0
),
"Expected 3.0, Got %f"
,
mod
);
/*_______________________VectorNormalize___________________________*/
D3DRMVectorNormalize
(
&
u
);
e
.
x
=
2
.
0
/
3
.
0
;
e
.
y
=
2
.
0
/
3
.
0
;
e
.
z
=
1
.
0
/
3
.
0
;
expect_vec
(
e
,
u
);
/* If u is the NULL vector, MSDN says that the return vector is NULL. In fact, the returned vector is (1,0,0). The following test case prove it. */
casnul
.
x
=
0
.
0
;
casnul
.
y
=
0
.
0
;
casnul
.
z
=
0
.
0
;
D3DRMVectorNormalize
(
&
casnul
);
e
.
x
=
1
.
0
;
e
.
y
=
0
.
0
;
e
.
z
=
0
.
0
;
expect_vec
(
e
,
casnul
);
/*_______________________VectorScale__________________________*/
par
=
2
.
5
;
D3DRMVectorScale
(
&
r
,
&
v
,
par
);
...
...
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