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
09d44a19
Commit
09d44a19
authored
Dec 18, 2012
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Handle DrawIndexedPrimitive via dynamic buffers.
parent
94388ed6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
3 deletions
+46
-3
device.c
dlls/ddraw/device.c
+46
-3
No files found.
dlls/ddraw/device.c
View file @
09d44a19
...
...
@@ -3578,6 +3578,10 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface,
{
struct
d3d_device
*
device
=
impl_from_IDirect3DDevice7
(
iface
);
HRESULT
hr
;
UINT
stride
=
get_flexible_vertex_size
(
fvf
);
UINT
vtx_size
=
stride
*
vertex_count
,
idx_size
=
index_count
*
sizeof
(
*
indices
);
UINT
vb_pos
,
ib_pos
;
BYTE
*
data
;
TRACE
(
"iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, "
"indices %p, index_count %u, flags %#x.
\n
"
,
...
...
@@ -3585,12 +3589,51 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface,
/* Set the D3DDevice's FVF */
wined3d_mutex_lock
();
hr
=
d3d_device_prepare_vertex_buffer
(
device
,
vtx_size
);
if
(
FAILED
(
hr
))
goto
done
;
/* TODO: Align the map position to the vertex size and use the draw start vertex
* parameter instead of the per-stream offset */
vb_pos
=
device
->
vertex_buffer_pos
;
if
(
device
->
vertex_buffer_size
-
vtx_size
<
vb_pos
)
vb_pos
=
0
;
hr
=
wined3d_buffer_map
(
device
->
vertex_buffer
,
vb_pos
,
vtx_size
,
&
data
,
vb_pos
?
WINED3D_MAP_NOOVERWRITE
:
WINED3D_MAP_DISCARD
);
if
(
FAILED
(
hr
))
goto
done
;
memcpy
(
data
,
vertices
,
vtx_size
);
wined3d_buffer_unmap
(
device
->
vertex_buffer
);
device
->
vertex_buffer_pos
=
vb_pos
+
vtx_size
;
hr
=
d3d_device_prepare_index_buffer
(
device
,
idx_size
);
if
(
FAILED
(
hr
))
goto
done
;
ib_pos
=
device
->
index_buffer_pos
;
if
(
device
->
index_buffer_size
-
idx_size
<
ib_pos
)
ib_pos
=
0
;
hr
=
wined3d_buffer_map
(
device
->
index_buffer
,
ib_pos
,
idx_size
,
&
data
,
ib_pos
?
WINED3D_MAP_NOOVERWRITE
:
WINED3D_MAP_DISCARD
);
if
(
FAILED
(
hr
))
goto
done
;
memcpy
(
data
,
indices
,
idx_size
);
wined3d_buffer_unmap
(
device
->
index_buffer
);
device
->
index_buffer_pos
=
ib_pos
+
idx_size
;
hr
=
wined3d_device_set_stream_source
(
device
->
wined3d_device
,
0
,
device
->
vertex_buffer
,
vb_pos
,
stride
);
if
(
FAILED
(
hr
))
goto
done
;
wined3d_device_set_index_buffer
(
device
->
wined3d_device
,
device
->
index_buffer
,
WINED3DFMT_R16_UINT
);
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
ddraw_find_decl
(
device
->
ddraw
,
fvf
));
wined3d_device_set_primitive_type
(
device
->
wined3d_device
,
primitive_type
);
hr
=
wined3d_device_draw_indexed_primitive_up
(
device
->
wined3d_device
,
index_count
,
indices
,
WINED3DFMT_R16_UINT
,
vertices
,
get_flexible_vertex_size
(
fvf
));
wined3d_mutex_unlock
();
hr
=
wined3d_device_draw_indexed_primitive
(
device
->
wined3d_device
,
ib_pos
/
sizeof
(
*
indices
),
index_count
);
done:
wined3d_mutex_unlock
();
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