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
f06fc7f8
Commit
f06fc7f8
authored
Jan 02, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Use float math functions.
parent
0f3c31b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
31 deletions
+31
-31
math.c
dlls/d3dx9_36/math.c
+22
-22
mesh.c
dlls/d3dx9_36/mesh.c
+9
-9
No files found.
dlls/d3dx9_36/math.c
View file @
f06fc7f8
...
...
@@ -487,8 +487,8 @@ D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOA
TRACE
(
"pout %p, fovy %f, aspect %f, zn %f, zf %f
\n
"
,
pout
,
fovy
,
aspect
,
zn
,
zf
);
D3DXMatrixIdentity
(
pout
);
pout
->
u
.
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
(
fovy
/
2
.
0
f
));
pout
->
u
.
m
[
1
][
1
]
=
1
.
0
f
/
tan
(
fovy
/
2
.
0
f
);
pout
->
u
.
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
f
(
fovy
/
2
.
0
f
));
pout
->
u
.
m
[
1
][
1
]
=
1
.
0
f
/
tan
f
(
fovy
/
2
.
0
f
);
pout
->
u
.
m
[
2
][
2
]
=
zf
/
(
zf
-
zn
);
pout
->
u
.
m
[
2
][
3
]
=
1
.
0
f
;
pout
->
u
.
m
[
3
][
2
]
=
(
zf
*
zn
)
/
(
zn
-
zf
);
...
...
@@ -501,8 +501,8 @@ D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOA
TRACE
(
"pout %p, fovy %f, aspect %f, zn %f, zf %f
\n
"
,
pout
,
fovy
,
aspect
,
zn
,
zf
);
D3DXMatrixIdentity
(
pout
);
pout
->
u
.
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
(
fovy
/
2
.
0
f
));
pout
->
u
.
m
[
1
][
1
]
=
1
.
0
f
/
tan
(
fovy
/
2
.
0
f
);
pout
->
u
.
m
[
0
][
0
]
=
1
.
0
f
/
(
aspect
*
tan
f
(
fovy
/
2
.
0
f
));
pout
->
u
.
m
[
1
][
1
]
=
1
.
0
f
/
tan
f
(
fovy
/
2
.
0
f
);
pout
->
u
.
m
[
2
][
2
]
=
zf
/
(
zn
-
zf
);
pout
->
u
.
m
[
2
][
3
]
=
-
1
.
0
f
;
pout
->
u
.
m
[
3
][
2
]
=
(
zf
*
zn
)
/
(
zn
-
zf
);
...
...
@@ -647,10 +647,10 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle)
TRACE
(
"pout %p, angle %f
\n
"
,
pout
,
angle
);
D3DXMatrixIdentity
(
pout
);
pout
->
u
.
m
[
1
][
1
]
=
cos
(
angle
);
pout
->
u
.
m
[
2
][
2
]
=
cos
(
angle
);
pout
->
u
.
m
[
1
][
2
]
=
sin
(
angle
);
pout
->
u
.
m
[
2
][
1
]
=
-
sin
(
angle
);
pout
->
u
.
m
[
1
][
1
]
=
cos
f
(
angle
);
pout
->
u
.
m
[
2
][
2
]
=
cos
f
(
angle
);
pout
->
u
.
m
[
1
][
2
]
=
sin
f
(
angle
);
pout
->
u
.
m
[
2
][
1
]
=
-
sin
f
(
angle
);
return
pout
;
}
...
...
@@ -659,10 +659,10 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle)
TRACE
(
"pout %p, angle %f
\n
"
,
pout
,
angle
);
D3DXMatrixIdentity
(
pout
);
pout
->
u
.
m
[
0
][
0
]
=
cos
(
angle
);
pout
->
u
.
m
[
2
][
2
]
=
cos
(
angle
);
pout
->
u
.
m
[
0
][
2
]
=
-
sin
(
angle
);
pout
->
u
.
m
[
2
][
0
]
=
sin
(
angle
);
pout
->
u
.
m
[
0
][
0
]
=
cos
f
(
angle
);
pout
->
u
.
m
[
2
][
2
]
=
cos
f
(
angle
);
pout
->
u
.
m
[
0
][
2
]
=
-
sin
f
(
angle
);
pout
->
u
.
m
[
2
][
0
]
=
sin
f
(
angle
);
return
pout
;
}
...
...
@@ -704,10 +704,10 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle)
TRACE
(
"pout %p, angle %f
\n
"
,
pout
,
angle
);
D3DXMatrixIdentity
(
pout
);
pout
->
u
.
m
[
0
][
0
]
=
cos
(
angle
);
pout
->
u
.
m
[
1
][
1
]
=
cos
(
angle
);
pout
->
u
.
m
[
0
][
1
]
=
sin
(
angle
);
pout
->
u
.
m
[
1
][
0
]
=
-
sin
(
angle
);
pout
->
u
.
m
[
0
][
0
]
=
cos
f
(
angle
);
pout
->
u
.
m
[
1
][
1
]
=
cos
f
(
angle
);
pout
->
u
.
m
[
0
][
1
]
=
sin
f
(
angle
);
pout
->
u
.
m
[
1
][
0
]
=
-
sin
f
(
angle
);
return
pout
;
}
...
...
@@ -888,15 +888,15 @@ D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pout, const D3DXVECTOR
trans
.
z
=
0
.
0
f
;
}
rot
.
w
=
cos
(
rotation
/
2
.
0
f
);
rot
.
w
=
cos
f
(
rotation
/
2
.
0
f
);
rot
.
x
=
0
.
0
f
;
rot
.
y
=
0
.
0
f
;
rot
.
z
=
sin
(
rotation
/
2
.
0
f
);
rot
.
z
=
sin
f
(
rotation
/
2
.
0
f
);
sca_rot
.
w
=
cos
(
scalingrotation
/
2
.
0
f
);
sca_rot
.
w
=
cos
f
(
scalingrotation
/
2
.
0
f
);
sca_rot
.
x
=
0
.
0
f
;
sca_rot
.
y
=
0
.
0
f
;
sca_rot
.
z
=
sin
(
scalingrotation
/
2
.
0
f
);
sca_rot
.
z
=
sin
f
(
scalingrotation
/
2
.
0
f
);
D3DXMatrixTransformation
(
pout
,
&
sca_center
,
&
sca_rot
,
&
sca
,
&
rot_center
,
&
rot
,
&
trans
);
...
...
@@ -1655,7 +1655,7 @@ void WINAPI D3DXQuaternionToAxisAngle(const D3DXQUATERNION *pq, D3DXVECTOR3 *pax
paxis
->
x
=
pq
->
x
;
paxis
->
y
=
pq
->
y
;
paxis
->
z
=
pq
->
z
;
*
pangle
=
2
.
0
f
*
acos
(
pq
->
w
);
*
pangle
=
2
.
0
f
*
acos
f
(
pq
->
w
);
}
/*_________________D3DXVec2_____________________*/
...
...
@@ -2128,7 +2128,7 @@ D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4* out, UINT outstride, con
unsigned
short
float_32_to_16
(
const
float
in
)
{
int
exp
=
0
,
origexp
;
float
tmp
=
fabs
(
in
);
float
tmp
=
fabs
f
(
in
);
int
sign
=
(
copysignf
(
1
,
in
)
<
0
);
unsigned
int
mantissa
;
unsigned
short
ret
;
...
...
dlls/d3dx9_36/mesh.c
View file @
f06fc7f8
...
...
@@ -2404,7 +2404,7 @@ BOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *p0, const D3DXVECTOR3 *p1, const
{
*
pu
=
vec
.
x
;
*
pv
=
vec
.
y
;
*
pdist
=
fabs
(
vec
.
z
);
*
pdist
=
fabs
f
(
vec
.
z
);
return
TRUE
;
}
}
...
...
@@ -4569,8 +4569,8 @@ static BOOL compute_sincos_table(struct sincos_table *sincos_table, float angle_
angle
=
angle_start
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
sincos_table
->
sin
[
i
]
=
sin
(
angle
);
sincos_table
->
cos
[
i
]
=
cos
(
angle
);
sincos_table
->
sin
[
i
]
=
sin
f
(
angle
);
sincos_table
->
cos
[
i
]
=
cos
f
(
angle
);
angle
+=
angle_step
;
}
...
...
@@ -4660,8 +4660,8 @@ HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, U
for
(
stack
=
0
;
stack
<
stacks
-
1
;
stack
++
)
{
sin_theta
=
sin
(
theta
);
cos_theta
=
cos
(
theta
);
sin_theta
=
sin
f
(
theta
);
cos_theta
=
cos
f
(
theta
);
for
(
slice
=
0
;
slice
<
slices
;
slice
++
)
{
...
...
@@ -5772,9 +5772,9 @@ HRESULT WINAPI D3DXCreateTextW(struct IDirect3DDevice9 *device, HDC hdc, const W
face
*
face_ptr
;
float
max_deviation_sq
;
const
struct
cos_table
cos_table
=
{
cos
(
D3DXToRadian
(
0
.
5
f
)),
cos
(
D3DXToRadian
(
45
.
0
f
)),
cos
(
D3DXToRadian
(
90
.
0
f
)),
cos
f
(
D3DXToRadian
(
0
.
5
f
)),
cos
f
(
D3DXToRadian
(
45
.
0
f
)),
cos
f
(
D3DXToRadian
(
90
.
0
f
)),
};
int
f1
,
f2
;
...
...
@@ -6154,7 +6154,7 @@ static BOOL weld_float4(void *to, void *from, FLOAT epsilon)
FLOAT
diff_y
=
fabsf
(
v1
->
y
-
v2
->
y
);
FLOAT
diff_z
=
fabsf
(
v1
->
z
-
v2
->
z
);
FLOAT
diff_w
=
fabsf
(
v1
->
w
-
v2
->
w
);
FLOAT
max_abs_diff
=
f
max
(
diff_x
,
diff_y
);
FLOAT
max_abs_diff
=
max
(
diff_x
,
diff_y
);
max_abs_diff
=
max
(
diff_z
,
max_abs_diff
);
max_abs_diff
=
max
(
diff_w
,
max_abs_diff
);
...
...
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