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

wined3d: Remove AddDirtyBox() from the public interface.

This is an internal wined3d function.
parent 88178027
...@@ -1143,7 +1143,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, ...@@ -1143,7 +1143,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
memset(&object->lockedBox, 0, sizeof(WINED3DBOX)); memset(&object->lockedBox, 0, sizeof(WINED3DBOX));
object->dirty = TRUE; 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, static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT EdgeLength,
......
...@@ -64,6 +64,31 @@ static void volume_bind_and_dirtify(IWineD3DVolume *iface) { ...@@ -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 IWineD3DVolume IUnknown parts follow
******************************************* */ ******************************************* */
...@@ -225,7 +250,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL ...@@ -225,7 +250,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
* Dirtify on lock * Dirtify on lock
* as seen in msdn docs * as seen in msdn docs
*/ */
IWineD3DVolume_AddDirtyBox(iface, &This->lockedBox); volume_add_dirty_box(iface, &This->lockedBox);
/** Dirtify Container if needed */ /** Dirtify Container if needed */
if (NULL != This->container) { if (NULL != This->container) {
...@@ -261,27 +286,6 @@ static HRESULT WINAPI IWineD3DVolumeImpl_UnlockBox(IWineD3DVolume *iface) { ...@@ -261,27 +286,6 @@ static HRESULT WINAPI IWineD3DVolumeImpl_UnlockBox(IWineD3DVolume *iface) {
/* Internal use functions follow : */ /* 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) { static HRESULT WINAPI IWineD3DVolumeImpl_SetContainer(IWineD3DVolume *iface, IWineD3DBase* container) {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
...@@ -362,7 +366,6 @@ const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl = ...@@ -362,7 +366,6 @@ const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
IWineD3DVolumeImpl_LockBox, IWineD3DVolumeImpl_LockBox,
IWineD3DVolumeImpl_UnlockBox, IWineD3DVolumeImpl_UnlockBox,
/* Internal interface */ /* Internal interface */
IWineD3DVolumeImpl_AddDirtyBox,
IWineD3DVolumeImpl_LoadTexture, IWineD3DVolumeImpl_LoadTexture,
IWineD3DVolumeImpl_SetContainer IWineD3DVolumeImpl_SetContainer
}; };
...@@ -119,7 +119,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_PreLoad(IWineD3DVolumeTexture *ifac ...@@ -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); 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++) { 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); IWineD3DVolume_LoadTexture(This->volumes[i], i, srgb_mode);
} }
} else { } else {
...@@ -295,7 +295,9 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTextur ...@@ -295,7 +295,9 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTextur
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
This->baseTexture.dirty = TRUE; This->baseTexture.dirty = TRUE;
TRACE("(%p) : dirtyfication of volume Level (0)\n", This); 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 = const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
......
...@@ -1455,6 +1455,8 @@ typedef struct IWineD3DVolumeImpl ...@@ -1455,6 +1455,8 @@ typedef struct IWineD3DVolumeImpl
extern const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl; extern const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl;
void volume_add_dirty_box(IWineD3DVolume *iface, const WINED3DBOX *dirty_box);
/***************************************************************************** /*****************************************************************************
* IWineD3DVolumeTexture implementation structure (extends IWineD3DBaseTextureImpl) * IWineD3DVolumeTexture implementation structure (extends IWineD3DBaseTextureImpl)
*/ */
......
...@@ -2512,9 +2512,6 @@ interface IWineD3DVolume : IWineD3DResource ...@@ -2512,9 +2512,6 @@ interface IWineD3DVolume : IWineD3DResource
); );
HRESULT UnlockBox( HRESULT UnlockBox(
); );
HRESULT AddDirtyBox(
[in] const WINED3DBOX *dirty_box
);
HRESULT LoadTexture( HRESULT LoadTexture(
[in] int gl_level, [in] int gl_level,
[in] BOOL srgb_mode [in] BOOL srgb_mode
......
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