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
8da63cf5
Commit
8da63cf5
authored
Nov 21, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Factor out mesh_get_parse_func().
parent
6348888a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
14 deletions
+30
-14
mesh.c
dlls/d3dx9_36/mesh.c
+30
-14
No files found.
dlls/d3dx9_36/mesh.c
View file @
8da63cf5
...
...
@@ -3206,9 +3206,37 @@ static HRESULT parse_skin_weights_info(ID3DXFileData *filedata, struct mesh_data
return
hr
;
}
typedef
HRESULT
(
*
mesh_parse_func
)(
ID3DXFileData
*
,
struct
mesh_data
*
,
DWORD
);
static
mesh_parse_func
mesh_get_parse_func
(
const
GUID
*
type
)
{
static
const
struct
{
const
GUID
*
type
;
mesh_parse_func
func
;
}
funcs
[]
=
{
{
&
TID_D3DRMMeshNormals
,
parse_normals
},
{
&
TID_D3DRMMeshVertexColors
,
parse_vertex_colors
},
{
&
TID_D3DRMMeshTextureCoords
,
parse_texture_coords
},
{
&
TID_D3DRMMeshMaterialList
,
parse_material_list
},
{
&
DXFILEOBJ_XSkinMeshHeader
,
parse_skin_mesh_header
},
{
&
DXFILEOBJ_SkinWeights
,
parse_skin_weights_info
},
};
unsigned
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
funcs
);
++
i
)
if
(
IsEqualGUID
(
type
,
funcs
[
i
].
type
))
return
funcs
[
i
].
func
;
return
NULL
;
}
static
HRESULT
parse_mesh
(
ID3DXFileData
*
filedata
,
struct
mesh_data
*
mesh_data
,
DWORD
provide_flags
)
{
ID3DXFileData
*
child
=
NULL
;
mesh_parse_func
parse_func
;
const
BYTE
*
data
,
*
in_ptr
;
DWORD
*
index_out_ptr
;
SIZE_T
child_count
;
...
...
@@ -3333,20 +3361,8 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
if
(
FAILED
(
hr
))
goto
end
;
if
(
IsEqualGUID
(
&
type
,
&
TID_D3DRMMeshNormals
))
{
hr
=
parse_normals
(
child
,
mesh_data
,
provide_flags
);
}
else
if
(
IsEqualGUID
(
&
type
,
&
TID_D3DRMMeshVertexColors
))
{
hr
=
parse_vertex_colors
(
child
,
mesh_data
,
provide_flags
);
}
else
if
(
IsEqualGUID
(
&
type
,
&
TID_D3DRMMeshTextureCoords
))
{
hr
=
parse_texture_coords
(
child
,
mesh_data
,
provide_flags
);
}
else
if
(
IsEqualGUID
(
&
type
,
&
TID_D3DRMMeshMaterialList
))
{
hr
=
parse_material_list
(
child
,
mesh_data
,
provide_flags
);
}
else
if
(
IsEqualGUID
(
&
type
,
&
DXFILEOBJ_XSkinMeshHeader
))
{
hr
=
parse_skin_mesh_header
(
child
,
mesh_data
,
provide_flags
);
}
else
if
(
IsEqualGUID
(
&
type
,
&
DXFILEOBJ_SkinWeights
))
{
hr
=
parse_skin_weights_info
(
child
,
mesh_data
,
provide_flags
);
}
if
((
parse_func
=
mesh_get_parse_func
(
&
type
)))
hr
=
parse_func
(
child
,
mesh_data
,
provide_flags
);
if
(
FAILED
(
hr
))
goto
end
;
...
...
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