Module: wine Branch: master Commit: bb67a925d69b50c2b3f61666c5347ab0902da8b7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=bb67a925d69b50c2b3f61666c5...
Author: David Adam david.adam.cnrs@gmail.com Date: Thu Aug 21 18:54:27 2008 +0200
ddraw: Only ddraw checks wether one can give a null pointer to SetMaterial.
---
dlls/ddraw/device.c | 1 + dlls/ddraw/tests/d3d.c | 9 +++++++++ dlls/wined3d/device.c | 2 -- 3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index b154ce4..edcb88f 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5543,6 +5543,7 @@ IDirect3DDeviceImpl_7_SetMaterial(IDirect3DDevice7 *iface, HRESULT hr; TRACE("(%p)->(%p): Relay!\n", This, Mat);
+ if (!Mat) return DDERR_INVALIDPARAMS; /* Note: D3DMATERIAL7 is compatible with WINED3DMATERIAL */ EnterCriticalSection(&ddraw_cs); hr = IWineD3DDevice_SetMaterial(This->wineD3DDevice, diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 37c0a8e..221a95b 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -2735,6 +2735,14 @@ static void DeviceLoadTest() } }
+static void SetMaterialTest(void) +{ + HRESULT rc; + + rc =IDirect3DDevice7_SetMaterial(lpD3DDevice, NULL); + ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc); +} + START_TEST(d3d) { init_function_pointers(); @@ -2752,6 +2760,7 @@ START_TEST(d3d) SceneTest(); LimitTest(); D3D7EnumTest(); + SetMaterialTest(); CapsTest(); VertexBufferDescTest(); D3D7_OldRenderStateTest(); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index d247d65..350c6d5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3144,8 +3144,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetClipStatus(IWineD3DDevice *iface, static HRESULT WINAPI IWineD3DDeviceImpl_SetMaterial(IWineD3DDevice *iface, CONST WINED3DMATERIAL* pMaterial) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- if (!pMaterial) return WINED3DERR_INVALIDCALL; - This->updateStateBlock->changed.material = TRUE; This->updateStateBlock->material = *pMaterial;