diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 692042067c5..b1769e8078f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6588,20 +6588,11 @@ static void WINAPI IWineD3DDeviceImpl_GetGammaRamp(IWineD3DDevice *iface, UINT i } } - -/** ******************************************************** -* Notification functions -** ********************************************************/ -/** This function must be called in the release of a resource when ref == 0, -* the contents of resource must still be correct, -* any handles to other resource held by the caller must be closed -* (e.g. a texture should release all held surfaces because telling the device that it's been released.) - *****************************************************/ -void device_resource_add(IWineD3DDeviceImpl *This, IWineD3DResource *resource) +void device_resource_add(struct IWineD3DDeviceImpl *device, struct IWineD3DResourceImpl *resource) { - TRACE("(%p) : Adding resource %p\n", This, resource); + TRACE("device %p, resource %p.\n", device, resource); - list_add_head(&This->resources, &((IWineD3DResourceImpl *) resource)->resource.resource_list_entry); + list_add_head(&device->resources, &resource->resource.resource_list_entry); } static void device_resource_remove(struct IWineD3DDeviceImpl *device, struct IWineD3DResourceImpl *resource) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 73b9943c2e2..6e90ee14437 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -88,7 +88,7 @@ HRESULT resource_init(struct IWineD3DResourceImpl *resource, WINED3DRESOURCETYPE WineD3DAdapterChangeGLRam(device, size); } - device_resource_add(device, (IWineD3DResource *)resource); + device_resource_add(device, resource); return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index c7527267787..1ee0b9c714d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -59,6 +59,7 @@ typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl; typedef struct IWineD3DSwapChainImpl IWineD3DSwapChainImpl; struct IWineD3DBaseShaderImpl; struct IWineD3DBaseTextureImpl; +struct IWineD3DResourceImpl; /* Texture format fixups */ @@ -1782,7 +1783,7 @@ HRESULT device_init(IWineD3DDeviceImpl *device, IWineD3DImpl *wined3d, void device_preload_textures(IWineD3DDeviceImpl *device) DECLSPEC_HIDDEN; LRESULT device_process_message(IWineD3DDeviceImpl *device, HWND window, BOOL unicode, UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; -void device_resource_add(IWineD3DDeviceImpl *This, IWineD3DResource *resource) DECLSPEC_HIDDEN; +void device_resource_add(struct IWineD3DDeviceImpl *device, struct IWineD3DResourceImpl *resource) DECLSPEC_HIDDEN; void device_resource_released(IWineD3DDeviceImpl *This, IWineD3DResource *resource) DECLSPEC_HIDDEN; void device_stream_info_from_declaration(IWineD3DDeviceImpl *This, BOOL use_vshader, struct wined3d_stream_info *stream_info, BOOL *fixup) DECLSPEC_HIDDEN;