[PATCH 2/4] wined3d: Pass an IWineD3DResourceImpl pointer to device_resource_add().

Henri Verbeet hverbeet at codeweavers.com
Sun Jan 16 16:36:45 CST 2011


---
 dlls/wined3d/device.c          |   15 +++------------
 dlls/wined3d/resource.c        |    2 +-
 dlls/wined3d/wined3d_private.h |    3 ++-
 3 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6920420..b1769e8 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 73b9943..6e90ee1 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 c752726..1ee0b9c 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;
-- 
1.7.3.4




More information about the wine-patches mailing list