Commit b98cd5d9 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the IWineD3DStateBlock typedef.

parent 4b109ff1
...@@ -1007,7 +1007,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface ...@@ -1007,7 +1007,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
} }
static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface, static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface,
WINED3DSTATEBLOCKTYPE type, IWineD3DStateBlock **stateblock) WINED3DSTATEBLOCKTYPE type, struct wined3d_stateblock **stateblock)
{ {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DStateBlockImpl *object; IWineD3DStateBlockImpl *object;
...@@ -1029,7 +1029,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface, ...@@ -1029,7 +1029,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice *iface,
} }
TRACE("Created stateblock %p.\n", object); TRACE("Created stateblock %p.\n", object);
*stateblock = (IWineD3DStateBlock *)object; *stateblock = object;
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -1886,7 +1886,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, ...@@ -1886,7 +1886,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
if(!This->adapter->opengl) return WINED3DERR_INVALIDCALL; if(!This->adapter->opengl) return WINED3DERR_INVALIDCALL;
TRACE("(%p) : Creating stateblock\n", This); TRACE("(%p) : Creating stateblock\n", This);
hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock); hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, &This->stateBlock);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create stateblock\n"); WARN("Failed to create stateblock\n");
...@@ -4637,9 +4637,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface, U ...@@ -4637,9 +4637,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface, U
* Stateblock related functions * Stateblock related functions
*****/ *****/
static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface) { static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DStateBlock *stateblock; struct wined3d_stateblock *stateblock;
HRESULT hr; HRESULT hr;
TRACE("(%p)\n", This); TRACE("(%p)\n", This);
...@@ -4658,24 +4659,29 @@ static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface) ...@@ -4658,24 +4659,29 @@ static HRESULT WINAPI IWineD3DDeviceImpl_BeginStateBlock(IWineD3DDevice *iface)
return WINED3D_OK; return WINED3D_OK;
} }
static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface, IWineD3DStateBlock** ppStateBlock) { static HRESULT WINAPI IWineD3DDeviceImpl_EndStateBlock(IWineD3DDevice *iface,
struct wined3d_stateblock **stateblock)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DStateBlockImpl *object = This->updateStateBlock; IWineD3DStateBlockImpl *object = This->updateStateBlock;
TRACE("iface %p, stateblock %p.\n", iface, stateblock);
if (!This->isRecordingState) { if (!This->isRecordingState) {
WARN("(%p) not recording! returning error\n", This); WARN("(%p) not recording! returning error\n", This);
*ppStateBlock = NULL; *stateblock = NULL;
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
stateblock_init_contained_states(object); stateblock_init_contained_states(object);
*ppStateBlock = (IWineD3DStateBlock*) object; *stateblock = object;
This->isRecordingState = FALSE; This->isRecordingState = FALSE;
This->updateStateBlock = This->stateBlock; This->updateStateBlock = This->stateBlock;
wined3d_stateblock_incref(This->updateStateBlock); wined3d_stateblock_incref(This->updateStateBlock);
/* IWineD3DStateBlock_AddRef(*ppStateBlock); don't need to do this, since we should really just release UpdateStateBlock first */
TRACE("(%p) returning token (ptr to stateblock) of %p\n", This, *ppStateBlock); TRACE("Returning stateblock %p.\n", *stateblock);
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -6521,7 +6527,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface, ...@@ -6521,7 +6527,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice *iface,
} }
/* Note: No parent needed for initial internal stateblock */ /* Note: No parent needed for initial internal stateblock */
hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, (IWineD3DStateBlock **)&This->stateBlock); hr = IWineD3DDevice_CreateStateBlock(iface, WINED3DSBT_INIT, &This->stateBlock);
if (FAILED(hr)) ERR("Resetting the stateblock failed with error 0x%08x\n", hr); if (FAILED(hr)) ERR("Resetting the stateblock failed with error 0x%08x\n", hr);
else TRACE("Created stateblock %p\n", This->stateBlock); else TRACE("Created stateblock %p\n", This->stateBlock);
This->updateStateBlock = This->stateBlock; This->updateStateBlock = This->stateBlock;
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
#define WINED3D_QUIRK_FBO_TEX_UPDATE 0x00000020 #define WINED3D_QUIRK_FBO_TEX_UPDATE 0x00000020
typedef struct wined3d_stateblock IWineD3DStateBlockImpl; typedef struct wined3d_stateblock IWineD3DStateBlockImpl;
typedef struct wined3d_stateblock IWineD3DStateBlock;
typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl; typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
typedef struct IWineD3DPaletteImpl IWineD3DPaletteImpl; typedef struct IWineD3DPaletteImpl IWineD3DPaletteImpl;
typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl; typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment