diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index d90161f6cc2..49436da2c45 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -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, diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 8f8f17789c8..523c9ac3db3 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -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) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index a0526d160ea..24bd9938191 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -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); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 386fd25262a..2d6563f3013 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 82a1c803644..28a67198ceb 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -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);