Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
43fed89d
Commit
43fed89d
authored
12 years ago
by
Christian Costa
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3drm: Implement IDirect3DRMMesh_AddGroup.
parent
e07f8242
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/d3drm/meshbuilder.c
+89
-4
89 additions, 4 deletions
dlls/d3drm/meshbuilder.c
with
89 additions
and
4 deletions
dlls/d3drm/meshbuilder.c
+
89
−
4
View file @
43fed89d
...
...
@@ -36,9 +36,21 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
static
HRESULT
Direct3DRMMesh_create
(
IDirect3DRMMesh
**
obj
);
typedef
struct
{
unsigned
nb_vertices
;
D3DRMVERTEX
*
vertices
;
unsigned
nb_faces
;
unsigned
vertex_per_face
;
DWORD
face_data_size
;
unsigned
*
face_data
;
}
mesh_group
;
typedef
struct
{
IDirect3DRMMesh
IDirect3DRMMesh_iface
;
LONG
ref
;
DWORD
groups_capacity
;
DWORD
nb_groups
;
mesh_group
*
groups
;
}
IDirect3DRMMeshImpl
;
typedef
struct
{
...
...
@@ -2174,7 +2186,14 @@ static ULONG WINAPI IDirect3DRMMeshImpl_Release(IDirect3DRMMesh* iface)
TRACE
(
"(%p)->(): new ref = %d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
int
i
;
for
(
i
=
0
;
i
<
This
->
nb_groups
;
i
++
)
HeapFree
(
GetProcessHeap
(),
0
,
This
->
groups
[
i
].
vertices
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
groups
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
...
...
@@ -2294,14 +2313,80 @@ static HRESULT WINAPI IDirect3DRMMeshImpl_GetBox(IDirect3DRMMesh* iface,
}
static
HRESULT
WINAPI
IDirect3DRMMeshImpl_AddGroup
(
IDirect3DRMMesh
*
iface
,
unsigned
v
C
ount
,
unsigned
f
C
ount
,
unsigned
v
PerF
ace
,
unsigned
*
f
D
ata
,
D3DRMGROUPINDEX
*
return
I
d
)
unsigned
v
ertex_c
ount
,
unsigned
f
ace_c
ount
,
unsigned
v
ertex_per_f
ace
,
unsigned
*
f
ace_d
ata
,
D3DRMGROUPINDEX
*
return
_i
d
)
{
IDirect3DRMMeshImpl
*
This
=
impl_from_IDirect3DRMMesh
(
iface
);
mesh_group
*
group
;
FIXM
E
(
"(%p)->(%u,%u,%u,%p,%p)
: stub
\n
"
,
This
,
v
C
ount
,
f
C
ount
,
v
P
er
F
ace
,
f
D
ata
,
return
I
d
);
TRAC
E
(
"(%p)->(%u,%u,%u,%p,%p)
\n
"
,
This
,
v
ertex_c
ount
,
f
ace_c
ount
,
ver
tex_per_f
ace
,
f
ace_d
ata
,
return
_i
d
);
return
E_NOTIMPL
;
if
(
!
face_data
||
!
return_id
)
return
E_POINTER
;
if
((
This
->
nb_groups
+
1
)
>
This
->
groups_capacity
)
{
ULONG
new_capacity
;
mesh_group
*
groups
;
if
(
!
This
->
groups_capacity
)
{
new_capacity
=
16
;
groups
=
HeapAlloc
(
GetProcessHeap
(),
0
,
new_capacity
*
sizeof
(
mesh_group
));
}
else
{
new_capacity
=
This
->
groups_capacity
*
2
;
groups
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
groups
,
new_capacity
*
sizeof
(
mesh_group
));
}
if
(
!
groups
)
return
E_OUTOFMEMORY
;
This
->
groups_capacity
=
new_capacity
;
This
->
groups
=
groups
;
}
group
=
This
->
groups
+
This
->
nb_groups
;
group
->
vertices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
vertex_count
*
sizeof
(
D3DRMVERTEX
));
if
(
!
group
->
vertices
)
return
E_OUTOFMEMORY
;
group
->
nb_vertices
=
vertex_count
;
group
->
nb_faces
=
face_count
;
group
->
vertex_per_face
=
vertex_per_face
;
if
(
vertex_per_face
)
{
group
->
face_data_size
=
face_count
*
vertex_per_face
;
}
else
{
int
i
;
unsigned
nb_indices
;
unsigned
*
face_data_ptr
=
face_data
;
group
->
face_data_size
=
0
;
for
(
i
=
0
;
i
<
face_count
;
i
++
)
{
nb_indices
=
*
face_data_ptr
;
group
->
face_data_size
+=
nb_indices
+
1
;
face_data_ptr
+=
nb_indices
;
}
}
group
->
face_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
group
->
face_data_size
*
sizeof
(
unsigned
));
if
(
!
group
->
face_data
)
{
HeapFree
(
GetProcessHeap
(),
0
,
group
->
vertices
);
return
E_OUTOFMEMORY
;
}
memcpy
(
group
->
face_data
,
face_data
,
group
->
face_data_size
*
sizeof
(
unsigned
));
*
return_id
=
This
->
nb_groups
++
;
return
D3DRM_OK
;
}
static
HRESULT
WINAPI
IDirect3DRMMeshImpl_SetVertices
(
IDirect3DRMMesh
*
iface
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment