wined3d: wined3d_device_set_index_buffer() never fails.

This commit is contained in:
Henri Verbeet 2012-09-06 11:25:02 +02:00 committed by Alexandre Julliard
parent 129ad9cbf5
commit a3e28f6ce5
5 changed files with 8 additions and 12 deletions

View File

@ -2344,7 +2344,6 @@ static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface,
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
struct d3d8_indexbuffer *ib = unsafe_impl_from_IDirect3DIndexBuffer8(buffer);
HRESULT hr;
TRACE("iface %p, buffer %p, base_vertex_idx %u.\n", iface, buffer, base_vertex_idx);
@ -2356,12 +2355,12 @@ static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface,
*/
wined3d_mutex_lock();
wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx);
hr = wined3d_device_set_index_buffer(device->wined3d_device,
wined3d_device_set_index_buffer(device->wined3d_device,
ib ? ib->wined3d_buffer : NULL,
ib ? ib->format : WINED3DFMT_UNKNOWN);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface,

View File

@ -2524,17 +2524,16 @@ static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
struct d3d9_indexbuffer *ib = unsafe_impl_from_IDirect3DIndexBuffer9(buffer);
HRESULT hr;
TRACE("iface %p, buffer %p.\n", iface, buffer);
wined3d_mutex_lock();
hr = wined3d_device_set_index_buffer(device->wined3d_device,
wined3d_device_set_index_buffer(device->wined3d_device,
ib ? ib->wined3d_buffer : NULL,
ib ? ib->format : WINED3DFMT_UNKNOWN);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 **buffer)

View File

@ -4158,7 +4158,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
/* Set the index stream */
wined3d_device_set_base_vertex_index(This->wined3d_device, StartVertex);
hr = wined3d_device_set_index_buffer(This->wined3d_device, This->indexbuffer, WINED3DFMT_R16_UINT);
wined3d_device_set_index_buffer(This->wined3d_device, This->indexbuffer, WINED3DFMT_R16_UINT);
/* Set the vertex stream source */
hr = wined3d_device_set_stream_source(This->wined3d_device, 0, vb->wineD3DVertexBuffer, 0, stride);

View File

@ -2215,7 +2215,7 @@ HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, s
return WINED3D_OK;
}
HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
struct wined3d_buffer *buffer, enum wined3d_format_id format_id)
{
struct wined3d_buffer *prev_buffer;
@ -2237,7 +2237,7 @@ HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
wined3d_buffer_incref(buffer);
if (prev_buffer)
wined3d_buffer_decref(prev_buffer);
return WINED3D_OK;
return;
}
if (prev_buffer != buffer)
@ -2254,8 +2254,6 @@ HRESULT CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
wined3d_buffer_decref(prev_buffer);
}
}
return WINED3D_OK;
}
HRESULT CDECL wined3d_device_get_index_buffer(const struct wined3d_device *device, struct wined3d_buffer **buffer)

View File

@ -2204,7 +2204,7 @@ HRESULT __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device,
HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs);
void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device,
UINT swapchain_idx, DWORD flags, const struct wined3d_gamma_ramp *ramp);
HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
void __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
struct wined3d_buffer *index_buffer, enum wined3d_format_id format_id);
HRESULT __cdecl wined3d_device_set_light(struct wined3d_device *device,
UINT light_idx, const struct wined3d_light *light);