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
40c6cf77
Commit
40c6cf77
authored
Jul 11, 2009
by
David Adam
Committed by
Alexandre Julliard
Jul 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Merge d3dx8 mesh into d3dx9.
parent
de5090c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
3 deletions
+94
-3
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+2
-2
mesh.c
dlls/d3dx9_36/mesh.c
+92
-1
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
40c6cf77
...
...
@@ -3,7 +3,7 @@
@ stub D3DXAssembleShaderFromFileW
@ stub D3DXAssembleShaderFromResourceA
@ stub D3DXAssembleShaderFromResourceW
@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr)
d3dx8.D3DXBoxBoundProbe
@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr)
@ stub D3DXCheckCubeTextureRequirements
@ stub D3DXCheckTextureRequirements
@ stdcall D3DXCheckVersion(long long)
...
...
@@ -291,7 +291,7 @@
@ stub D3DXSHRotateZ
@ stub D3DXSHScale
@ stdcall D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) d3dx8.D3DXSimplifyMesh
@ stdcall D3DXSphereBoundProbe(ptr long ptr ptr)
d3dx8.D3DXSphereBoundProbe
@ stdcall D3DXSphereBoundProbe(ptr long ptr ptr)
@ stdcall D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) d3dx8.D3DXSplitMesh
@ stdcall D3DXTessellateNPatches(ptr ptr long long ptr ptr) d3dx8.D3DXTessellateNPatches
@ stub D3DXTessellateRectPatch
...
...
dlls/d3dx9_36/mesh.c
View file @
40c6cf77
...
...
@@ -28,6 +28,79 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
/*************************************************************************
* D3DXBoxBoundProbe
*/
BOOL
WINAPI
D3DXBoxBoundProbe
(
CONST
D3DXVECTOR3
*
pmin
,
CONST
D3DXVECTOR3
*
pmax
,
CONST
D3DXVECTOR3
*
prayposition
,
CONST
D3DXVECTOR3
*
praydirection
)
/* Algorithm taken from the article: An Efficient and Robust Ray-Box Intersection Algoritm
Amy Williams University of Utah
Steve Barrus University of Utah
R. Keith Morley University of Utah
Peter Shirley University of Utah
International Conference on Computer Graphics and Interactive Techniques archive
ACM SIGGRAPH 2005 Courses
Los Angeles, California
This algorithm is free of patents or of copyrights, as confirmed by Peter Shirley himself.
Algorithm: Consider the box as the intersection of three slabs. Clip the ray
against each slab, if there's anything left of the ray after we're
done we've got an intersection of the ray with the box.
*/
{
FLOAT
div
,
tmin
,
tmax
,
tymin
,
tymax
,
tzmin
,
tzmax
;
div
=
1
.
0
f
/
praydirection
->
x
;
if
(
div
>=
0
.
0
f
)
{
tmin
=
(
pmin
->
x
-
prayposition
->
x
)
*
div
;
tmax
=
(
pmax
->
x
-
prayposition
->
x
)
*
div
;
}
else
{
tmin
=
(
pmax
->
x
-
prayposition
->
x
)
*
div
;
tmax
=
(
pmin
->
x
-
prayposition
->
x
)
*
div
;
}
if
(
tmax
<
0
.
0
f
)
return
FALSE
;
div
=
1
.
0
f
/
praydirection
->
y
;
if
(
div
>=
0
.
0
f
)
{
tymin
=
(
pmin
->
y
-
prayposition
->
y
)
*
div
;
tymax
=
(
pmax
->
y
-
prayposition
->
y
)
*
div
;
}
else
{
tymin
=
(
pmax
->
y
-
prayposition
->
y
)
*
div
;
tymax
=
(
pmin
->
y
-
prayposition
->
y
)
*
div
;
}
if
(
(
tymax
<
0
.
0
f
)
||
(
tmin
>
tymax
)
||
(
tymin
>
tmax
)
)
return
FALSE
;
if
(
tymin
>
tmin
)
tmin
=
tymin
;
if
(
tymax
<
tmax
)
tmax
=
tymax
;
div
=
1
.
0
f
/
praydirection
->
z
;
if
(
div
>=
0
.
0
f
)
{
tzmin
=
(
pmin
->
z
-
prayposition
->
z
)
*
div
;
tzmax
=
(
pmax
->
z
-
prayposition
->
z
)
*
div
;
}
else
{
tzmin
=
(
pmax
->
z
-
prayposition
->
z
)
*
div
;
tzmax
=
(
pmin
->
z
-
prayposition
->
z
)
*
div
;
}
if
(
(
tzmax
<
0
.
0
f
)
||
(
tmin
>
tzmax
)
||
(
tzmin
>
tmax
)
)
return
FALSE
;
return
TRUE
;
}
/*************************************************************************
* D3DXComputeBoundingBox
*/
HRESULT
WINAPI
D3DXComputeBoundingBox
(
CONST
D3DXVECTOR3
*
pfirstposition
,
DWORD
numvertices
,
DWORD
dwstride
,
D3DXVECTOR3
*
pmin
,
D3DXVECTOR3
*
pmax
)
...
...
@@ -131,7 +204,7 @@ UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF)
}
/*************************************************************************
* D3DXGet
FVF
VertexSize
* D3DXGet
Decl
VertexSize
*/
UINT
WINAPI
D3DXGetDeclVertexSize
(
const
D3DVERTEXELEMENT9
*
decl
,
DWORD
stream_idx
)
{
...
...
@@ -223,3 +296,21 @@ BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST
return
FALSE
;
}
/*************************************************************************
* D3DXSphereBoundProbe
*/
BOOL
WINAPI
D3DXSphereBoundProbe
(
CONST
D3DXVECTOR3
*
pcenter
,
FLOAT
radius
,
CONST
D3DXVECTOR3
*
prayposition
,
CONST
D3DXVECTOR3
*
praydirection
)
{
D3DXVECTOR3
difference
;
FLOAT
a
,
b
,
c
,
d
;
a
=
D3DXVec3LengthSq
(
praydirection
);
if
(
!
D3DXVec3Subtract
(
&
difference
,
prayposition
,
pcenter
))
return
FALSE
;
b
=
D3DXVec3Dot
(
&
difference
,
praydirection
);
c
=
D3DXVec3LengthSq
(
&
difference
)
-
radius
*
radius
;
d
=
b
*
b
-
a
*
c
;
if
(
(
d
<=
0
.
0
f
)
||
(
sqrt
(
d
)
<=
b
)
)
return
FALSE
;
return
TRUE
;
}
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