Commit f879176b authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Alexandre Julliard

ddraw: Use ddraw_from_d3d7 to make a (IDirectDrawImpl *) from a (IDirect3D7 *).

parent 95b8f49d
......@@ -1790,7 +1790,7 @@ Thunk_IDirect3DDeviceImpl_3_GetDirect3D(IDirect3DDevice3 *iface,
ret = IDirect3DDevice7_GetDirect3D((IDirect3DDevice7 *)This, &ret_ptr);
if(ret != D3D_OK)
return ret;
*Direct3D3 = ret_ptr ? (IDirect3D3 *)&((IDirectDrawImpl *)ret_ptr)->IDirect3D3_vtbl : NULL;
*Direct3D3 = ret_ptr ? (IDirect3D3 *)&ddraw_from_d3d7(ret_ptr)->IDirect3D3_vtbl : NULL;
TRACE(" returning interface %p\n", *Direct3D3);
return D3D_OK;
}
......@@ -1807,7 +1807,7 @@ Thunk_IDirect3DDeviceImpl_2_GetDirect3D(IDirect3DDevice2 *iface,
ret = IDirect3DDevice7_GetDirect3D((IDirect3DDevice7 *)This, &ret_ptr);
if(ret != D3D_OK)
return ret;
*Direct3D2 = ret_ptr ? (IDirect3D2 *)&((IDirectDrawImpl *)ret_ptr)->IDirect3D2_vtbl : NULL;
*Direct3D2 = ret_ptr ? (IDirect3D2 *)&ddraw_from_d3d7(ret_ptr)->IDirect3D2_vtbl : NULL;
TRACE(" returning interface %p\n", *Direct3D2);
return D3D_OK;
}
......@@ -1824,7 +1824,7 @@ Thunk_IDirect3DDeviceImpl_1_GetDirect3D(IDirect3DDevice *iface,
ret = IDirect3DDevice7_GetDirect3D((IDirect3DDevice7 *)This, &ret_ptr);
if(ret != D3D_OK)
return ret;
*Direct3D = ret_ptr ? (IDirect3D *)&((IDirectDrawImpl *)ret_ptr)->IDirect3D_vtbl : NULL;
*Direct3D = ret_ptr ? (IDirect3D *)&ddraw_from_d3d7(ret_ptr)->IDirect3D_vtbl : NULL;
TRACE(" returning interface %p\n", *Direct3D);
return D3D_OK;
}
......
......@@ -1033,6 +1033,7 @@ static void Direct3D1Test(void)
D3DVIEWPORT vp_data;
D3DINSTRUCTION *instr;
D3DBRANCH *branch;
IDirect3D *Direct3D_alt;
unsigned int idx = 0;
static struct v_in testverts[] = {
{0.0, 0.0, 0.0}, { 1.0, 1.0, 1.0}, {-1.0, -1.0, -1.0},
......@@ -1050,6 +1051,12 @@ static void Direct3D1Test(void)
D3DTRANSFORMDATA transformdata;
DWORD i = FALSE;
/* Interface consistency check. */
hr = IDirect3DDevice_GetDirect3D(Direct3DDevice1, &Direct3D_alt);
ok(hr == D3D_OK, "IDirect3DDevice_GetDirect3D failed: %08x\n", hr);
if (hr == D3D_OK)
ok(Direct3D_alt == Direct3D1, "Direct3D1 struct pointer missmatch: %p != %p\n", Direct3D_alt, Direct3D1);
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
hr = IDirect3DExecuteBuffer_Lock(ExecuteBuffer, &desc);
......
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