ddraw: Implement surface private data handling on top of wined3d_resource.
This commit is contained in:
parent
f6bfdd47c9
commit
acd8c58725
|
@ -1957,13 +1957,15 @@ static HRESULT WINAPI ddraw_surface7_SetPrivateData(IDirectDrawSurface7 *iface,
|
|||
REFGUID tag, void *Data, DWORD Size, DWORD Flags)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *This = impl_from_IDirectDrawSurface7(iface);
|
||||
struct wined3d_resource *resource;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, tag %s, data %p, data_size %u, flags %#x.\n",
|
||||
iface, debugstr_guid(tag), Data, Size, Flags);
|
||||
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
hr = wined3d_surface_set_private_data(This->wined3d_surface, tag, Data, Size, Flags);
|
||||
resource = wined3d_surface_get_resource(This->wined3d_surface);
|
||||
hr = wined3d_resource_set_private_data(resource, tag, Data, Size, Flags);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
switch(hr)
|
||||
{
|
||||
|
@ -2001,6 +2003,7 @@ static HRESULT WINAPI ddraw_surface4_SetPrivateData(IDirectDrawSurface4 *iface,
|
|||
static HRESULT WINAPI ddraw_surface7_GetPrivateData(IDirectDrawSurface7 *iface, REFGUID tag, void *Data, DWORD *Size)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *This = impl_from_IDirectDrawSurface7(iface);
|
||||
struct wined3d_resource *resource;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, tag %s, data %p, data_size %p.\n",
|
||||
|
@ -2010,7 +2013,8 @@ static HRESULT WINAPI ddraw_surface7_GetPrivateData(IDirectDrawSurface7 *iface,
|
|||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
hr = wined3d_surface_get_private_data(This->wined3d_surface, tag, Data, Size);
|
||||
resource = wined3d_surface_get_resource(This->wined3d_surface);
|
||||
hr = wined3d_resource_get_private_data(resource, tag, Data, Size);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
}
|
||||
|
@ -2040,12 +2044,14 @@ static HRESULT WINAPI ddraw_surface4_GetPrivateData(IDirectDrawSurface4 *iface,
|
|||
static HRESULT WINAPI ddraw_surface7_FreePrivateData(IDirectDrawSurface7 *iface, REFGUID tag)
|
||||
{
|
||||
IDirectDrawSurfaceImpl *This = impl_from_IDirectDrawSurface7(iface);
|
||||
struct wined3d_resource *resource;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, tag %s.\n", iface, debugstr_guid(tag));
|
||||
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
hr = wined3d_surface_free_private_data(This->wined3d_surface, tag);
|
||||
resource = wined3d_surface_get_resource(This->wined3d_surface);
|
||||
hr = wined3d_resource_free_private_data(resource, tag);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -2704,23 +2704,6 @@ ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface)
|
|||
return refcount;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_surface_set_private_data(struct wined3d_surface *surface,
|
||||
REFGUID riid, const void *data, DWORD data_size, DWORD flags)
|
||||
{
|
||||
return wined3d_resource_set_private_data(&surface->resource, riid, data, data_size, flags);
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_surface_get_private_data(const struct wined3d_surface *surface,
|
||||
REFGUID guid, void *data, DWORD *data_size)
|
||||
{
|
||||
return wined3d_resource_get_private_data(&surface->resource, guid, data, data_size);
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_surface_free_private_data(struct wined3d_surface *surface, REFGUID refguid)
|
||||
{
|
||||
return wined3d_resource_free_private_data(&surface->resource, refguid);
|
||||
}
|
||||
|
||||
DWORD CDECL wined3d_surface_set_priority(struct wined3d_surface *surface, DWORD priority)
|
||||
{
|
||||
return resource_set_priority(&surface->resource, priority);
|
||||
|
|
|
@ -209,7 +209,6 @@
|
|||
@ cdecl wined3d_surface_create(ptr long long long long long long long long long long long ptr ptr ptr)
|
||||
@ cdecl wined3d_surface_decref(ptr)
|
||||
@ cdecl wined3d_surface_flip(ptr ptr long)
|
||||
@ cdecl wined3d_surface_free_private_data(ptr ptr)
|
||||
@ cdecl wined3d_surface_get_blt_status(ptr long)
|
||||
@ cdecl wined3d_surface_get_clipper(ptr)
|
||||
@ cdecl wined3d_surface_get_flip_status(ptr long)
|
||||
|
@ -218,7 +217,6 @@
|
|||
@ cdecl wined3d_surface_get_parent(ptr)
|
||||
@ cdecl wined3d_surface_get_pitch(ptr)
|
||||
@ cdecl wined3d_surface_get_priority(ptr)
|
||||
@ cdecl wined3d_surface_get_private_data(ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_surface_get_resource(ptr)
|
||||
@ cdecl wined3d_surface_getdc(ptr ptr)
|
||||
@ cdecl wined3d_surface_incref(ptr)
|
||||
|
@ -234,7 +232,6 @@
|
|||
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
|
||||
@ cdecl wined3d_surface_set_palette(ptr ptr)
|
||||
@ cdecl wined3d_surface_set_priority(ptr long)
|
||||
@ cdecl wined3d_surface_set_private_data(ptr ptr ptr long long)
|
||||
@ cdecl wined3d_surface_unmap(ptr)
|
||||
@ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr)
|
||||
@ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr)
|
||||
|
|
|
@ -2421,7 +2421,6 @@ HRESULT __cdecl wined3d_surface_create(struct wined3d_device *device, UINT width
|
|||
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_surface **surface);
|
||||
ULONG __cdecl wined3d_surface_decref(struct wined3d_surface *surface);
|
||||
HRESULT __cdecl wined3d_surface_flip(struct wined3d_surface *surface, struct wined3d_surface *override, DWORD flags);
|
||||
HRESULT __cdecl wined3d_surface_free_private_data(struct wined3d_surface *surface, REFGUID guid);
|
||||
HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *surface, DWORD flags);
|
||||
struct wined3d_clipper * __cdecl wined3d_surface_get_clipper(const struct wined3d_surface *surface);
|
||||
HRESULT __cdecl wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags);
|
||||
|
@ -2430,8 +2429,6 @@ struct wined3d_palette * __cdecl wined3d_surface_get_palette(const struct wined3
|
|||
void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
|
||||
DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
|
||||
DWORD __cdecl wined3d_surface_get_priority(const struct wined3d_surface *surface);
|
||||
HRESULT __cdecl wined3d_surface_get_private_data(const struct wined3d_surface *surface,
|
||||
REFGUID guid, void *data, DWORD *data_size);
|
||||
struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
|
||||
HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
|
||||
ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface);
|
||||
|
@ -2449,8 +2446,6 @@ HRESULT __cdecl wined3d_surface_set_mem(struct wined3d_surface *surface, void *m
|
|||
HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y);
|
||||
HRESULT __cdecl wined3d_surface_set_palette(struct wined3d_surface *surface, struct wined3d_palette *palette);
|
||||
DWORD __cdecl wined3d_surface_set_priority(struct wined3d_surface *surface, DWORD new_priority);
|
||||
HRESULT __cdecl wined3d_surface_set_private_data(struct wined3d_surface *surface,
|
||||
REFGUID guid, const void *data, DWORD data_size, DWORD flags);
|
||||
HRESULT __cdecl wined3d_surface_unmap(struct wined3d_surface *surface);
|
||||
HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface, const RECT *src_rect,
|
||||
struct wined3d_surface *dst_surface, const RECT *dst_rect, DWORD flags, const WINEDDOVERLAYFX *fx);
|
||||
|
|
Loading…
Reference in New Issue