Commit bb67a925 authored by David Adam's avatar David Adam Committed by Alexandre Julliard

ddraw: Only ddraw checks wether one can give a null pointer to SetMaterial.

parent f0a821a1
......@@ -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,
......
......@@ -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();
......
......@@ -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;
......
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