Henri Verbeet : wined3d: wined3d_device_get_material() never fails.

Alexandre Julliard julliard at winehq.org
Tue Sep 18 14:04:28 CDT 2012


Module: wine
Branch: master
Commit: 343974e2fdad5db1d76d8281185118ab3e40b62a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=343974e2fdad5db1d76d8281185118ab3e40b62a

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Sep 17 21:48:52 2012 +0200

wined3d: wined3d_device_get_material() never fails.

---

 dlls/d3d8/device.c     |    5 ++---
 dlls/d3d9/device.c     |    5 ++---
 dlls/ddraw/device.c    |    5 ++---
 dlls/wined3d/device.c  |    4 +---
 include/wine/wined3d.h |    2 +-
 5 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 7ff67ab..f6f0501 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1347,16 +1347,15 @@ static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3D
 static HRESULT WINAPI d3d8_device_GetMaterial(IDirect3DDevice8 *iface, 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_get_material(device->wined3d_device, (struct wined3d_material *)material);
+    wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
     wined3d_mutex_unlock();
 
-    return hr;
+    return D3D_OK;
 }
 
 static HRESULT WINAPI d3d8_device_SetLight(IDirect3DDevice8 *iface, DWORD index, const D3DLIGHT8 *light)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index ef51f25..fcdfc6f 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -1413,16 +1413,15 @@ static HRESULT WINAPI d3d9_device_SetMaterial(IDirect3DDevice9Ex *iface, const D
 static HRESULT WINAPI d3d9_device_GetMaterial(IDirect3DDevice9Ex *iface, 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_get_material(device->wined3d_device, (struct wined3d_material *)material);
+    wined3d_device_get_material(device->wined3d_device, (struct wined3d_material *)material);
     wined3d_mutex_unlock();
 
-    return hr;
+    return D3D_OK;
 }
 
 static HRESULT WINAPI d3d9_device_SetLight(IDirect3DDevice9Ex *iface, DWORD index, const D3DLIGHT9 *light)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 9162e92..996fca8 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -5139,16 +5139,15 @@ static HRESULT WINAPI d3d_device7_SetMaterial_FPUPreserve(IDirect3DDevice7 *ifac
 static HRESULT d3d_device7_GetMaterial(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
 {
     struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
-    HRESULT hr;
 
     TRACE("iface %p, material %p.\n", iface, material);
 
     wined3d_mutex_lock();
     /* 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();
 
-    return hr_ddraw_from_wined3d(hr);
+    return D3D_OK;
 }
 
 static HRESULT WINAPI d3d_device7_GetMaterial_FPUSetup(IDirect3DDevice7 *iface, D3DMATERIAL7 *material)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index e4da126..a8bb403 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2185,7 +2185,7 @@ void CDECL wined3d_device_set_material(struct wined3d_device *device, const stru
     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);
 
@@ -2204,8 +2204,6 @@ HRESULT CDECL wined3d_device_get_material(const struct wined3d_device *device, s
             material->emissive.r, material->emissive.g,
             material->emissive.b, material->emissive.a);
     TRACE("power %.8e.\n", material->power);
-
-    return WINED3D_OK;
 }
 
 void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 2bc112a..4d10fd6 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -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,
         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_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);
 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,




More information about the wine-cvs mailing list