Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5a14f5b3
Commit
5a14f5b3
authored
Mar 30, 2012
by
Michael Mc Donnell
Committed by
Alexandre Julliard
May 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Added D3DXOptimizeFaces semi-stub.
parent
2aa3d697
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
mesh.c
dlls/d3dx9_36/mesh.c
+68
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
5a14f5b3
...
...
@@ -228,7 +228,7 @@
@ stdcall D3DXMatrixTransformation2D(ptr ptr float ptr ptr float ptr)
@ stdcall D3DXMatrixTranslation(ptr float float float)
@ stdcall D3DXMatrixTranspose(ptr ptr)
@ st
ub
D3DXOptimizeFaces(ptr long long long ptr)
@ st
dcall
D3DXOptimizeFaces(ptr long long long ptr)
@ stub D3DXOptimizeVertices(ptr long long long ptr)
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
...
...
dlls/d3dx9_36/mesh.c
View file @
5a14f5b3
...
...
@@ -6700,3 +6700,71 @@ cleanup:
return
hr
;
}
/*************************************************************************
* D3DXOptimizeFaces (D3DX9_36.@)
*
* Re-orders the faces so the vertex cache is used optimally.
*
* PARAMS
* indices [I] Pointer to an index buffer belonging to a mesh.
* num_faces [I] Number of faces in the mesh.
* num_vertices [I] Number of vertices in the mesh.
* indices_are_32bit [I] Specifies whether indices are 32- or 16-bit.
* face_remap [I/O] The new order the faces should be drawn in.
*
* RETURNS
* Success: D3D_OK.
* Failure: D3DERR_INVALIDCALL.
*
* BUGS
* The face re-ordering does not use the vertex cache optimally.
*
*/
HRESULT
WINAPI
D3DXOptimizeFaces
(
LPCVOID
indices
,
UINT
num_faces
,
UINT
num_vertices
,
BOOL
indices_are_32bit
,
DWORD
*
face_remap
)
{
UINT
i
;
UINT
j
=
num_faces
-
1
;
UINT
limit_16_bit
=
2
<<
15
;
/* According to MSDN */
HRESULT
hr
=
D3D_OK
;
FIXME
(
"(%p, %u, %u, %s, %p): semi-stub. Face order will not be optimal.
\n
"
,
indices
,
num_faces
,
num_vertices
,
indices_are_32bit
?
"TRUE"
:
"FALSE"
,
face_remap
);
if
(
!
indices_are_32bit
&&
num_faces
>=
limit_16_bit
)
{
WARN
(
"Number of faces must be less than %d when using 16-bit indices.
\n
"
,
limit_16_bit
);
hr
=
D3DERR_INVALIDCALL
;
goto
error
;
}
if
(
!
face_remap
)
{
WARN
(
"Face remap pointer is NULL.
\n
"
);
hr
=
D3DERR_INVALIDCALL
;
goto
error
;
}
/* The faces are drawn in reverse order for simple meshes. This ordering
* is not optimal for complicated meshes, but will not break anything
* either. The ordering should be changed to take advantage of the vertex
* cache on the graphics card.
*
* TODO Re-order to take advantage of vertex cache.
*/
for
(
i
=
0
;
i
<
num_faces
;
i
++
)
{
face_remap
[
i
]
=
j
--
;
}
return
D3D_OK
;
error:
return
hr
;
}
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