Module: wine Branch: master Commit: 3ad82a82bb62019e491800e5117983059ae4540e URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ad82a82bb62019e491800e511...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Fri Jul 30 10:15:25 2010 +0200
wined3d: The stateblock doesn't have a parent.
---
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,