Commit 2669feeb authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: wined3d_device_set_material() never fails.

parent 9fb039bb
......@@ -1333,16 +1333,15 @@ static HRESULT WINAPI d3d8_device_GetViewport(IDirect3DDevice8 *iface, D3DVIEWPO
static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3DMATERIAL8 *material)
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
HRESULT hr;
TRACE("iface %p, material %p.\n", iface, material);
/* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */
wined3d_mutex_lock();
hr = wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material);
wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d8_device_GetMaterial(IDirect3DDevice8 *iface, D3DMATERIAL8 *material)
......
......@@ -1399,16 +1399,15 @@ static HRESULT WINAPI d3d9_device_GetViewport(IDirect3DDevice9Ex *iface, D3DVIEW
static HRESULT WINAPI d3d9_device_SetMaterial(IDirect3DDevice9Ex *iface, const D3DMATERIAL9 *material)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
HRESULT hr;
TRACE("iface %p, material %p.\n", iface, material);
/* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
wined3d_mutex_lock();
hr = wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material);
wined3d_device_set_material(device->wined3d_device, (const struct wined3d_material *)material);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d9_device_GetMaterial(IDirect3DDevice9Ex *iface, D3DMATERIAL9 *material)
......
......@@ -5089,7 +5089,6 @@ static HRESULT WINAPI d3d_device7_GetViewport_FPUPreserve(IDirect3DDevice7 *ifac
static HRESULT d3d_device7_SetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
HRESULT hr;
TRACE("iface %p, material %p.\n", iface, material);
......@@ -5098,10 +5097,10 @@ static HRESULT d3d_device7_SetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *ma
wined3d_mutex_lock();
/* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
hr = wined3d_device_set_material(device->wined3d_device, (struct wined3d_material *)material);
wined3d_device_set_material(device->wined3d_device, (struct wined3d_material *)material);
wined3d_mutex_unlock();
return hr_ddraw_from_wined3d(hr);
return D3D_OK;
}
static HRESULT WINAPI d3d_device7_SetMaterial_FPUSetup(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
......
......@@ -2168,7 +2168,7 @@ HRESULT CDECL wined3d_device_get_clip_status(const struct wined3d_device *device
return WINED3D_OK;
}
HRESULT CDECL wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material)
void CDECL wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material)
{
TRACE("device %p, material %p.\n", device, material);
......@@ -2179,12 +2179,10 @@ HRESULT CDECL wined3d_device_set_material(struct wined3d_device *device, const s
if (device->isRecordingState)
{
TRACE("Recording... not performing anything.\n");
return WINED3D_OK;
return;
}
device_invalidate_state(device, STATE_MATERIAL);
return WINED3D_OK;
}
HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
......
......@@ -2207,7 +2207,7 @@ void __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
HRESULT __cdecl wined3d_device_set_light(struct wined3d_device *device,
UINT light_idx, const struct wined3d_light *light);
HRESULT __cdecl wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable);
HRESULT __cdecl wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material);
void __cdecl wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material);
void __cdecl wined3d_device_set_multithreaded(struct wined3d_device *device);
HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments);
HRESULT __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment