Commit 343974e2 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: wined3d_device_get_material() never fails.

parent 2669feeb
...@@ -1347,16 +1347,15 @@ static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3D ...@@ -1347,16 +1347,15 @@ static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3D
static HRESULT WINAPI d3d8_device_GetMaterial(IDirect3DDevice8 *iface, D3DMATERIAL8 *material) static HRESULT WINAPI d3d8_device_GetMaterial(IDirect3DDevice8 *iface, D3DMATERIAL8 *material)
{ {
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
HRESULT hr;
TRACE("iface %p, material %p.\n", iface, material); TRACE("iface %p, material %p.\n", iface, material);
/* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */ /* Note: D3DMATERIAL8 is compatible with struct wined3d_material. */
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material); wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return D3D_OK;
} }
static HRESULT WINAPI d3d8_device_SetLight(IDirect3DDevice8 *iface, DWORD index, const D3DLIGHT8 *light) static HRESULT WINAPI d3d8_device_SetLight(IDirect3DDevice8 *iface, DWORD index, const D3DLIGHT8 *light)
......
...@@ -1413,16 +1413,15 @@ static HRESULT WINAPI d3d9_device_SetMaterial(IDirect3DDevice9Ex *iface, const D ...@@ -1413,16 +1413,15 @@ static HRESULT WINAPI d3d9_device_SetMaterial(IDirect3DDevice9Ex *iface, const D
static HRESULT WINAPI d3d9_device_GetMaterial(IDirect3DDevice9Ex *iface, D3DMATERIAL9 *material) static HRESULT WINAPI d3d9_device_GetMaterial(IDirect3DDevice9Ex *iface, D3DMATERIAL9 *material)
{ {
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
HRESULT hr;
TRACE("iface %p, material %p.\n", iface, material); TRACE("iface %p, material %p.\n", iface, material);
/* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */ /* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material); wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return D3D_OK;
} }
static HRESULT WINAPI d3d9_device_SetLight(IDirect3DDevice9Ex *iface, DWORD index, const D3DLIGHT9 *light) static HRESULT WINAPI d3d9_device_SetLight(IDirect3DDevice9Ex *iface, DWORD index, const D3DLIGHT9 *light)
......
...@@ -5139,16 +5139,15 @@ static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve(IDirect3DDevice7 *ifac ...@@ -5139,16 +5139,15 @@ static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve(IDirect3DDevice7 *ifac
static HRESULT d3d_device7_GetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material) static HRESULT d3d_device7_GetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
{ {
struct d3d_device *device = impl_from_IDirect3DDevice7(iface); struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
HRESULT hr;
TRACE("iface %p, material %p.\n", iface, material); TRACE("iface %p, material %p.\n", iface, material);
wined3d_mutex_lock(); wined3d_mutex_lock();
/* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */ /* Note: D3DMATERIAL7 is compatible with struct wined3d_material. */
hr = wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material); wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr_ddraw_from_wined3d(hr); return D3D_OK;
} }
static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup(IDirect3DDevice7 *iface, D3DMATERIAL7 *material) static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
......
...@@ -2185,7 +2185,7 @@ void CDECL wined3d_device_set_material(struct wined3d_device *device, const stru ...@@ -2185,7 +2185,7 @@ void CDECL wined3d_device_set_material(struct wined3d_device *device, const stru
device_invalidate_state(device, STATE_MATERIAL); device_invalidate_state(device, STATE_MATERIAL);
} }
HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material) void CDECL wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material)
{ {
TRACE("device %p, material %p.\n", device, material); TRACE("device %p, material %p.\n", device, material);
...@@ -2204,8 +2204,6 @@ HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, s ...@@ -2204,8 +2204,6 @@ HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, s
material->emissive.r, material->emissive.g, material->emissive.r, material->emissive.g,
material->emissive.b, material->emissive.a); material->emissive.b, material->emissive.a);
TRACE("power %.8e.\n", material->power); TRACE("power %.8e.\n", material->power);
return WINED3D_OK;
} }
void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
......
...@@ -2129,7 +2129,7 @@ struct wined3d_buffer * __cdecl wined3d_device_get_index_buffer(const struct win ...@@ -2129,7 +2129,7 @@ struct wined3d_buffer * __cdecl wined3d_device_get_index_buffer(const struct win
HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device, HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device,
UINT light_idx, struct wined3d_light *light); UINT light_idx, struct wined3d_light *light);
HRESULT __cdecl wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable); HRESULT __cdecl wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable);
HRESULT __cdecl wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material); void __cdecl wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material);
float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device); float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device);
struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device);
void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device, void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device,
......
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