wined3d: Remove AddDirtyBox() from the public interface.

This is an internal wined3d function.
This commit is contained in:
Henri Verbeet 2009-01-14 10:01:10 +01:00 committed by Alexandre Julliard
parent 881780276b
commit fd90021666
5 changed files with 35 additions and 29 deletions

View File

@ -1143,7 +1143,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
memset(&object->lockedBox, 0, sizeof(WINED3DBOX));
object->dirty = TRUE;
return IWineD3DVolume_AddDirtyBox((IWineD3DVolume *) object, NULL);
volume_add_dirty_box((IWineD3DVolume *)object, NULL);
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT EdgeLength,

View File

@ -64,6 +64,31 @@ static void volume_bind_and_dirtify(IWineD3DVolume *iface) {
}
}
void volume_add_dirty_box(IWineD3DVolume *iface, const WINED3DBOX *dirty_box)
{
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
This->dirty = TRUE;
if (dirty_box)
{
This->lockedBox.Left = min(This->lockedBox.Left, dirty_box->Left);
This->lockedBox.Top = min(This->lockedBox.Top, dirty_box->Top);
This->lockedBox.Front = min(This->lockedBox.Front, dirty_box->Front);
This->lockedBox.Right = max(This->lockedBox.Right, dirty_box->Right);
This->lockedBox.Bottom = max(This->lockedBox.Bottom, dirty_box->Bottom);
This->lockedBox.Back = max(This->lockedBox.Back, dirty_box->Back);
}
else
{
This->lockedBox.Left = 0;
This->lockedBox.Top = 0;
This->lockedBox.Front = 0;
This->lockedBox.Right = This->currentDesc.Width;
This->lockedBox.Bottom = This->currentDesc.Height;
This->lockedBox.Back = This->currentDesc.Depth;
}
}
/* *******************************************
IWineD3DVolume IUnknown parts follow
******************************************* */
@ -225,7 +250,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
* Dirtify on lock
* as seen in msdn docs
*/
IWineD3DVolume_AddDirtyBox(iface, &This->lockedBox);
volume_add_dirty_box(iface, &This->lockedBox);
/** Dirtify Container if needed */
if (NULL != This->container) {
@ -261,27 +286,6 @@ static HRESULT WINAPI IWineD3DVolumeImpl_UnlockBox(IWineD3DVolume *iface) {
/* Internal use functions follow : */
static HRESULT WINAPI IWineD3DVolumeImpl_AddDirtyBox(IWineD3DVolume *iface, CONST WINED3DBOX* pDirtyBox) {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
This->dirty = TRUE;
if (NULL != pDirtyBox) {
This->lockedBox.Left = min(This->lockedBox.Left, pDirtyBox->Left);
This->lockedBox.Top = min(This->lockedBox.Top, pDirtyBox->Top);
This->lockedBox.Front = min(This->lockedBox.Front, pDirtyBox->Front);
This->lockedBox.Right = max(This->lockedBox.Right, pDirtyBox->Right);
This->lockedBox.Bottom = max(This->lockedBox.Bottom, pDirtyBox->Bottom);
This->lockedBox.Back = max(This->lockedBox.Back, pDirtyBox->Back);
} else {
This->lockedBox.Left = 0;
This->lockedBox.Top = 0;
This->lockedBox.Front = 0;
This->lockedBox.Right = This->currentDesc.Width;
This->lockedBox.Bottom = This->currentDesc.Height;
This->lockedBox.Back = This->currentDesc.Depth;
}
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWineD3DBase* container) {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
@ -362,7 +366,6 @@ const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
IWineD3DVolumeImpl_LockBox,
IWineD3DVolumeImpl_UnlockBox,
/* Internal interface */
IWineD3DVolumeImpl_AddDirtyBox,
IWineD3DVolumeImpl_LoadTexture,
IWineD3DVolumeImpl_SetContainer
};

View File

@ -119,7 +119,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_PreLoad(IWineD3DVolumeTexture *ifac
FIXME("Volumetexture (%p) has been reloaded at least 20 times due to WINED3DSAMP_SRGBTEXTURE changes on it\'s sampler\n", This);
for (i = 0; i < This->baseTexture.levels; i++) {
IWineD3DVolume_AddDirtyBox(This->volumes[i], NULL);
volume_add_dirty_box(This->volumes[i], NULL);
IWineD3DVolume_LoadTexture(This->volumes[i], i, srgb_mode);
}
} else {
@ -295,7 +295,9 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTextur
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
This->baseTexture.dirty = TRUE;
TRACE("(%p) : dirtyfication of volume Level (0)\n", This);
return IWineD3DVolume_AddDirtyBox(This->volumes[0], pDirtyBox);
volume_add_dirty_box(This->volumes[0], pDirtyBox);
return WINED3D_OK;
}
const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =

View File

@ -1455,6 +1455,8 @@ typedef struct IWineD3DVolumeImpl
extern const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl;
void volume_add_dirty_box(IWineD3DVolume *iface, const WINED3DBOX *dirty_box);
/*****************************************************************************
* IWineD3DVolumeTexture implementation structure (extends IWineD3DBaseTextureImpl)
*/

View File

@ -2512,9 +2512,6 @@ interface IWineD3DVolume : IWineD3DResource
);
HRESULT UnlockBox(
);
HRESULT AddDirtyBox(
[in] const WINED3DBOX *dirty_box
);
HRESULT LoadTexture(
[in] int gl_level,
[in] BOOL srgb_mode