Commit fb6b5ce7 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ddraw: Store hardware_device flag in struct d3d_device.

parent f96d9b67
......@@ -4330,7 +4330,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
if (SUCCEEDED(hr = d3d_device_create(ddraw, target, (IUnknown *)surface, 7, &object, NULL)))
if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, target, (IUnknown *)surface, 7, &object, NULL)))
{
*device = &object->IDirect3DDevice7_iface;
}
......@@ -4359,7 +4359,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
return CLASS_E_NOAGGREGATION;
wined3d_mutex_lock();
if (SUCCEEDED(hr = d3d_device_create(ddraw, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL)))
if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL)))
{
*device = &device_impl->IDirect3DDevice3_iface;
}
......@@ -4385,7 +4385,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
if (SUCCEEDED(hr = d3d_device_create(ddraw, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL)))
if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL)))
{
*device = &device_impl->IDirect3DDevice2_iface;
}
......
......@@ -317,6 +317,7 @@ struct d3d_device
IUnknown IUnknown_inner;
LONG ref;
UINT version;
BOOL hardware_device;
IUnknown *outer_unknown;
struct wined3d_device *wined3d_device;
......@@ -364,7 +365,7 @@ struct d3d_device
const struct wined3d_stateblock_state *stateblock_state;
};
HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface,
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface,
UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN;
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device) DECLSPEC_HIDDEN;
......
......@@ -6925,7 +6925,7 @@ static void ddraw_reset_viewport_state(struct ddraw *ddraw)
wined3d_stateblock_set_scissor_rect(ddraw->state, &rect);
}
static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, const GUID *guid,
struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
{
static const struct wined3d_matrix ident =
......@@ -6948,6 +6948,8 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
device->IUnknown_inner.lpVtbl = &d3d_device_inner_vtbl;
device->ref = 1;
device->version = version;
device->hardware_device = IsEqualGUID(&IID_IDirect3DTnLHalDevice, guid)
|| IsEqualGUID(&IID_IDirect3DHALDevice, guid);
if (outer_unknown)
device->outer_unknown = outer_unknown;
......@@ -7006,14 +7008,14 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
return D3D_OK;
}
HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface,
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface,
UINT version, struct d3d_device **device, IUnknown *outer_unknown)
{
struct d3d_device *object;
HRESULT hr;
TRACE("ddraw %p, target %p, version %u, device %p, outer_unknown %p.\n",
ddraw, target, version, device, outer_unknown);
TRACE("ddraw %p, guid %s, target %p, version %u, device %p, outer_unknown %p.\n",
ddraw, debugstr_guid(guid), target, version, device, outer_unknown);
if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
|| (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
......@@ -7054,7 +7056,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
return DDERR_OUTOFMEMORY;
}
if (FAILED(hr = d3d_device_init(object, ddraw, target, rt_iface, version, outer_unknown)))
if (FAILED(hr = d3d_device_init(object, ddraw, guid, target, rt_iface, version, outer_unknown)))
{
WARN("Failed to initialize device, hr %#x.\n", hr);
heap_free(object);
......
......@@ -256,7 +256,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
{
HRESULT hr;
if (FAILED(hr = d3d_device_create(This->ddraw, This, (IUnknown *)&This->IDirectDrawSurface_iface,
if (FAILED(hr = d3d_device_create(This->ddraw, riid, This, (IUnknown *)&This->IDirectDrawSurface_iface,
1, &This->device1, (IUnknown *)&This->IDirectDrawSurface_iface)))
{
This->device1 = NULL;
......
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