ddraw: Introduce a helper to convert ddraw primitive types to wined3d types.
Signed-off-by: Chip Davis <cdavis@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
67d71cb2d0
commit
02d03a66a5
|
@ -96,6 +96,11 @@ static enum wined3d_transform_state wined3d_transform_state_from_ddraw(D3DTRANSF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum wined3d_primitive_type wined3d_primitive_type_from_ddraw(D3DPRIMITIVETYPE type)
|
||||||
|
{
|
||||||
|
return (enum wined3d_primitive_type)type;
|
||||||
|
}
|
||||||
|
|
||||||
static inline struct d3d_device *impl_from_IUnknown(IUnknown *iface)
|
static inline struct d3d_device *impl_from_IUnknown(IUnknown *iface)
|
||||||
{
|
{
|
||||||
return CONTAINING_RECORD(iface, struct d3d_device, IUnknown_inner);
|
return CONTAINING_RECORD(iface, struct d3d_device, IUnknown_inner);
|
||||||
|
@ -3464,7 +3469,7 @@ static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface,
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
||||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
|
wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0);
|
||||||
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
||||||
hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vertex_count);
|
hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vertex_count);
|
||||||
|
|
||||||
|
@ -3675,7 +3680,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface,
|
||||||
wined3d_stateblock_set_index_buffer(device->state, device->index_buffer, WINED3DFMT_R16_UINT);
|
wined3d_stateblock_set_index_buffer(device->state, device->index_buffer, WINED3DFMT_R16_UINT);
|
||||||
|
|
||||||
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
||||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
|
wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0);
|
||||||
wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / stride);
|
wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / stride);
|
||||||
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
||||||
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(*indices), index_count);
|
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(*indices), index_count);
|
||||||
|
@ -4002,7 +4007,7 @@ static HRESULT d3d_device7_DrawPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIM
|
||||||
goto done;
|
goto done;
|
||||||
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
||||||
|
|
||||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
|
wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0);
|
||||||
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
||||||
hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / dst_stride, vertex_count);
|
hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / dst_stride, vertex_count);
|
||||||
|
|
||||||
|
@ -4138,7 +4143,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
|
||||||
wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vtx_dst_stride);
|
wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vtx_dst_stride);
|
||||||
|
|
||||||
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
|
||||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
|
wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0);
|
||||||
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
||||||
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
|
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
|
||||||
|
|
||||||
|
@ -4260,7 +4265,7 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now draw the primitives */
|
/* Now draw the primitives */
|
||||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
|
wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0);
|
||||||
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
||||||
hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count);
|
hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count);
|
||||||
|
|
||||||
|
@ -4414,7 +4419,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
|
wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0);
|
||||||
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
wined3d_device_apply_stateblock(device->wined3d_device, device->state);
|
||||||
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
|
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue