[PATCH 3/6] wined3d: The stateblock doesn't have a parent.

Henri Verbeet hverbeet at codeweavers.com
Fri Jul 30 03:15:25 CDT 2010


---
 dlls/d3d8/device.c       |    3 +--
 dlls/d3d9/stateblock.c   |    4 ++--
 dlls/ddraw/device.c      |    2 +-
 dlls/wined3d/device.c    |   15 ++++++---------
 include/wine/wined3d.idl |    3 +--
 5 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 12ed0fb..fad94e4 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -1415,8 +1415,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(IDirect3DDevice8 *if
     }
 
     wined3d_mutex_lock();
-    hr = IWineD3DDevice_CreateStateBlock(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type,
-            &stateblock, NULL);
+    hr = IWineD3DDevice_CreateStateBlock(This->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)Type, &stateblock);
     if (FAILED(hr))
     {
         wined3d_mutex_unlock();
diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c
index c4941db..01a882e 100644
--- a/dlls/d3d9/stateblock.c
+++ b/dlls/d3d9/stateblock.c
@@ -138,8 +138,8 @@ HRESULT stateblock_init(IDirect3DStateBlock9Impl *stateblock, IDirect3DDevice9Im
     else
     {
         wined3d_mutex_lock();
-        hr = IWineD3DDevice_CreateStateBlock(device->WineD3DDevice, (WINED3DSTATEBLOCKTYPE)type,
-                &stateblock->wineD3DStateBlock, (IUnknown *)stateblock);
+        hr = IWineD3DDevice_CreateStateBlock(device->WineD3DDevice,
+                (WINED3DSTATEBLOCKTYPE)type, &stateblock->wineD3DStateBlock);
         wined3d_mutex_unlock();
         if (FAILED(hr))
         {
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index da6a5c4..6cd0f80 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -5927,7 +5927,7 @@ IDirect3DDeviceImpl_7_CreateStateBlock(IDirect3DDevice7 *iface,
     EnterCriticalSection(&ddraw_cs);
 
     /* The D3DSTATEBLOCKTYPE enum is fine here. */
-    hr = IWineD3DDevice_CreateStateBlock(This->wineD3DDevice, Type, &wined3d_sb, NULL);
+    hr = IWineD3DDevice_CreateStateBlock(This->wineD3DDevice, Type, &wined3d_sb);
     if (FAILED(hr))
     {
         WARN("Failed to create stateblock, hr %#x.\n", hr);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 11a6b9a..d74b1f4 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1012,7 +1012,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
 }
 
 static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface,
-        WINED3DSTATEBLOCKTYPE type, IWineD3DStateBlock **stateblock, IUnknown *parent)
+        WINED3DSTATEBLOCKTYPE type, IWineD3DStateBlock **stateblock)
 {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
     IWineD3DStateBlockImpl *object;
@@ -1790,12 +1790,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
     if(!This->adapter->opengl) return WINED3DERR_INVALIDCALL;
 
     TRACE("(%p) : Creating stateblock\n", This);
-    /* Creating the startup stateBlock - Note Special Case: 0 => Don't fill in yet! */
-    hr = IWineD3DDevice_CreateStateBlock(iface,
-                                         WINED3DSBT_INIT,
-                                         (IWineD3DStateBlock **)&This->stateBlock,
-                                         NULL);
-    if (WINED3D_OK != hr) {   /* Note: No parent needed for initial internal stateblock */
+    hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock);
+    if (FAILED(hr))
+    {
         WARN("Failed to create stateblock\n");
         goto err_out;
     }
@@ -4488,7 +4485,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface)
 
     if (This->isRecordingState) return WINED3DERR_INVALIDCALL;
 
-    hr = IWineD3DDeviceImpl_CreateStateBlock(iface, WINED3DSBT_RECORDED, &stateblock, NULL);
+    hr = IWineD3DDeviceImpl_CreateStateBlock(iface, WINED3DSBT_RECORDED, &stateblock);
     if (FAILED(hr)) return hr;
 
     IWineD3DStateBlock_Release((IWineD3DStateBlock*)This->updateStateBlock);
@@ -6469,7 +6466,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
     }
 
     /* Note: No parent needed for initial internal stateblock */
-    hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock, NULL);
+    hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock);
     if (FAILED(hr)) ERR("Resetting the stateblock failed with error 0x%08x\n", hr);
     else TRACE("Created stateblock %p\n", This->stateBlock);
     This->updateStateBlock = This->stateBlock;
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 7eebb39..e15ea4d 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2843,8 +2843,7 @@ interface IWineD3DDevice : IWineD3DBase
     );
     HRESULT CreateStateBlock(
         [in] WINED3DSTATEBLOCKTYPE type,
-        [out] IWineD3DStateBlock **stateblock,
-        [in] IUnknown *parent
+        [out] IWineD3DStateBlock **stateblock
     );
     HRESULT CreateSurface(
         [in] UINT width,
-- 
1.7.1




More information about the wine-patches mailing list