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
f20ba244
Commit
f20ba244
authored
Jan 31, 2009
by
David Adam
Committed by
Alexandre Julliard
Feb 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXFresnelTerm.
parent
082d740f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-0
math.c
dlls/d3dx8/math.c
+14
-0
math.c
dlls/d3dx8/tests/math.c
+10
-0
d3dx8math.h
include/d3dx8math.h
+2
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
f20ba244
...
...
@@ -68,6 +68,7 @@
@ stdcall D3DXPlaneTransform(ptr ptr ptr)
@ stdcall D3DXColorAdjustSaturation(ptr ptr long)
@ stdcall D3DXColorAdjustContrast(ptr ptr long)
@ stdcall D3DXFresnelTerm(long long)
@ stdcall D3DXCreateMatrixStack(long ptr)
@ stdcall D3DXCreateFont(ptr ptr ptr)
@ stub D3DXCreateFontIndirect
...
...
dlls/d3dx8/math.c
View file @
f20ba244
...
...
@@ -58,6 +58,20 @@ D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc
return
pout
;
}
/*_________________Misc__________________________*/
FLOAT
WINAPI
D3DXFresnelTerm
(
FLOAT
costheta
,
FLOAT
refractionindex
)
{
FLOAT
a
,
d
,
g
,
result
;
g
=
sqrt
(
refractionindex
*
refractionindex
+
costheta
*
costheta
-
1
.
0
f
);
a
=
g
+
costheta
;
d
=
g
-
costheta
;
result
=
(
costheta
*
a
-
1
.
0
f
)
*
(
costheta
*
a
-
1
.
0
f
)
/
(
(
costheta
*
d
+
1
.
0
f
)
*
(
costheta
*
d
+
1
.
0
f
)
)
+
1
.
0
f
;
result
=
result
*
0
.
5
f
*
d
*
d
/
(
a
*
a
);
return
result
;
}
/*_________________D3DXMatrix____________________*/
D3DXMATRIX
*
WINAPI
D3DXMatrixAffineTransformation
(
D3DXMATRIX
*
pout
,
FLOAT
scaling
,
CONST
D3DXVECTOR3
*
rotationcenter
,
CONST
D3DXQUATERNION
*
rotation
,
CONST
D3DXVECTOR3
*
translation
)
...
...
dlls/d3dx8/tests/math.c
View file @
f20ba244
...
...
@@ -166,6 +166,15 @@ static void D3DXColorTest(void)
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
}
static
void
D3DXFresnelTest
(
void
)
{
FLOAT
expected
,
got
;
expected
=
0
.
089187
;
got
=
D3DXFresnelTerm
(
0
.
5
f
,
1
.
5
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
}
static
void
D3DXMatrixTest
(
void
)
{
D3DXMATRIX
expectedmat
,
gotmat
,
mat
,
mat2
,
mat3
;
...
...
@@ -1498,6 +1507,7 @@ static void test_matrix_stack(void)
START_TEST
(
math
)
{
D3DXColorTest
();
D3DXFresnelTest
();
D3DXMatrixTest
();
D3DXPlaneTest
();
D3X8QuaternionTest
();
...
...
include/d3dx8math.h
View file @
f20ba244
...
...
@@ -271,6 +271,8 @@ extern "C" {
D3DXCOLOR
*
WINAPI
D3DXColorAdjustContrast
(
D3DXCOLOR
*
pout
,
CONST
D3DXCOLOR
*
pc
,
FLOAT
s
);
D3DXCOLOR
*
WINAPI
D3DXColorAdjustSaturation
(
D3DXCOLOR
*
pout
,
CONST
D3DXCOLOR
*
pc
,
FLOAT
s
);
FLOAT
WINAPI
D3DXFresnelTerm
(
FLOAT
costheta
,
FLOAT
refractionindex
);
D3DXMATRIX
*
WINAPI
D3DXMatrixAffineTransformation
(
D3DXMATRIX
*
pout
,
FLOAT
scaling
,
CONST
D3DXVECTOR3
*
rotationcenter
,
CONST
D3DXQUATERNION
*
rotation
,
CONST
D3DXVECTOR3
*
translation
);
FLOAT
WINAPI
D3DXMatrixfDeterminant
(
CONST
D3DXMATRIX
*
pm
);
D3DXMATRIX
*
WINAPI
D3DXMatrixInverse
(
D3DXMATRIX
*
pout
,
FLOAT
*
pdeterminant
,
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