wined3d: Get rid of stateblock_copy().
This commit is contained in:
parent
345b329217
commit
5f3425b89b
|
@ -228,23 +228,6 @@ static void stateblock_copy_values(IWineD3DStateBlockImpl *dst, const IWineD3DSt
|
||||||
memcpy(dst->pixelShaderConstantF, src->pixelShaderConstantF, sizeof(float) * gl_info->max_pshader_constantsF * 4);
|
memcpy(dst->pixelShaderConstantF, src->pixelShaderConstantF, sizeof(float) * gl_info->max_pshader_constantsF * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stateblock_copy(IWineD3DStateBlockImpl *dst, const IWineD3DStateBlockImpl *src)
|
|
||||||
{
|
|
||||||
const struct wined3d_gl_info *gl_info = &src->wineD3DDevice->adapter->gl_info;
|
|
||||||
|
|
||||||
dst->lpVtbl = src->lpVtbl;
|
|
||||||
dst->ref = src->ref;
|
|
||||||
dst->parent = src->parent;
|
|
||||||
dst->wineD3DDevice = src->wineD3DDevice;
|
|
||||||
dst->blockType = src->blockType;
|
|
||||||
|
|
||||||
/* Saved states */
|
|
||||||
stateblock_savedstates_copy(&dst->changed, &src->changed, gl_info);
|
|
||||||
|
|
||||||
/* Saved values */
|
|
||||||
stateblock_copy_values(dst, src, gl_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************************************
|
/**********************************************************
|
||||||
* IWineD3DStateBlockImpl IUnknown parts follows
|
* IWineD3DStateBlockImpl IUnknown parts follows
|
||||||
**********************************************************/
|
**********************************************************/
|
||||||
|
@ -1387,13 +1370,18 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
|
||||||
if (type == WINED3DSBT_INIT || type == WINED3DSBT_RECORDED) return WINED3D_OK;
|
if (type == WINED3DSBT_INIT || type == WINED3DSBT_RECORDED) return WINED3D_OK;
|
||||||
|
|
||||||
/* Otherwise, might as well set the whole state block to the appropriate values */
|
/* Otherwise, might as well set the whole state block to the appropriate values */
|
||||||
if (device->stateBlock) stateblock_copy(stateblock, device->stateBlock);
|
if (device->stateBlock)
|
||||||
else memset(stateblock->streamFreq, 1, sizeof(stateblock->streamFreq));
|
{
|
||||||
|
/* Saved states */
|
||||||
|
stateblock_savedstates_copy(&stateblock->changed, &device->stateBlock->changed, gl_info);
|
||||||
|
|
||||||
/* Reset the ref and type after kludging it. */
|
/* Saved values */
|
||||||
stateblock->wineD3DDevice = device;
|
stateblock_copy_values(stateblock, device->stateBlock, gl_info);
|
||||||
stateblock->ref = 1;
|
}
|
||||||
stateblock->blockType = type;
|
else
|
||||||
|
{
|
||||||
|
memset(stateblock->streamFreq, 1, sizeof(stateblock->streamFreq));
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("Updating changed flags appropriate for type %#x.\n", type);
|
TRACE("Updating changed flags appropriate for type %#x.\n", type);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue