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

wined3d: Pass an IWineD3DVolumeImpl pointer to volume_add_dirty_box().

parent ad6bc944
...@@ -63,28 +63,26 @@ static void volume_bind_and_dirtify(IWineD3DVolume *iface) { ...@@ -63,28 +63,26 @@ static void volume_bind_and_dirtify(IWineD3DVolume *iface) {
container->baseTexture.texture_ops->texture_bind(container, FALSE); container->baseTexture.texture_ops->texture_bind(container, FALSE);
} }
void volume_add_dirty_box(IWineD3DVolume *iface, const WINED3DBOX *dirty_box) void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *dirty_box)
{ {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; volume->dirty = TRUE;
This->dirty = TRUE;
if (dirty_box) if (dirty_box)
{ {
This->lockedBox.Left = min(This->lockedBox.Left, dirty_box->Left); volume->lockedBox.Left = min(volume->lockedBox.Left, dirty_box->Left);
This->lockedBox.Top = min(This->lockedBox.Top, dirty_box->Top); volume->lockedBox.Top = min(volume->lockedBox.Top, dirty_box->Top);
This->lockedBox.Front = min(This->lockedBox.Front, dirty_box->Front); volume->lockedBox.Front = min(volume->lockedBox.Front, dirty_box->Front);
This->lockedBox.Right = max(This->lockedBox.Right, dirty_box->Right); volume->lockedBox.Right = max(volume->lockedBox.Right, dirty_box->Right);
This->lockedBox.Bottom = max(This->lockedBox.Bottom, dirty_box->Bottom); volume->lockedBox.Bottom = max(volume->lockedBox.Bottom, dirty_box->Bottom);
This->lockedBox.Back = max(This->lockedBox.Back, dirty_box->Back); volume->lockedBox.Back = max(volume->lockedBox.Back, dirty_box->Back);
} }
else else
{ {
This->lockedBox.Left = 0; volume->lockedBox.Left = 0;
This->lockedBox.Top = 0; volume->lockedBox.Top = 0;
This->lockedBox.Front = 0; volume->lockedBox.Front = 0;
This->lockedBox.Right = This->currentDesc.Width; volume->lockedBox.Right = volume->currentDesc.Width;
This->lockedBox.Bottom = This->currentDesc.Height; volume->lockedBox.Bottom = volume->currentDesc.Height;
This->lockedBox.Back = This->currentDesc.Depth; volume->lockedBox.Back = volume->currentDesc.Depth;
} }
} }
...@@ -255,7 +253,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface, ...@@ -255,7 +253,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface,
if (!(flags & (WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY))) if (!(flags & (WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY)))
{ {
volume_add_dirty_box(iface, &This->lockedBox); volume_add_dirty_box(This, &This->lockedBox);
This->container->baseTexture.texture_rgb.dirty = TRUE; This->container->baseTexture.texture_rgb.dirty = TRUE;
This->container->baseTexture.texture_srgb.dirty = TRUE; This->container->baseTexture.texture_srgb.dirty = TRUE;
} }
...@@ -368,7 +366,7 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT ...@@ -368,7 +366,7 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox)); memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
volume->dirty = TRUE; volume->dirty = TRUE;
volume_add_dirty_box((IWineD3DVolume *)volume, NULL); volume_add_dirty_box(volume, NULL);
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -70,9 +70,9 @@ static void volumetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3D ...@@ -70,9 +70,9 @@ static void volumetexture_preload(IWineD3DBaseTextureImpl *texture, enum WINED3D
{ {
for (i = 0; i < texture->baseTexture.level_count; ++i) for (i = 0; i < texture->baseTexture.level_count; ++i)
{ {
IWineD3DVolume *volume = (IWineD3DVolume *)texture->baseTexture.sub_resources[i]; IWineD3DVolumeImpl *volume = (IWineD3DVolumeImpl *)texture->baseTexture.sub_resources[i];
volume_add_dirty_box(volume, NULL); volume_add_dirty_box(volume, NULL);
IWineD3DVolume_LoadTexture(volume, i, srgb_mode); IWineD3DVolume_LoadTexture((IWineD3DVolume *)volume, i, srgb_mode);
} }
} }
else else
...@@ -336,11 +336,11 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_Unmap(IWineD3DVolumeTexture *ifa ...@@ -336,11 +336,11 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_Unmap(IWineD3DVolumeTexture *ifa
static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, const WINED3DBOX *dirty_box) static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, const WINED3DBOX *dirty_box)
{ {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
IWineD3DVolume *volume; IWineD3DVolumeImpl *volume;
TRACE("iface %p, dirty_box %p.\n", iface, dirty_box); TRACE("iface %p, dirty_box %p.\n", iface, dirty_box);
if (!(volume = (IWineD3DVolume *)basetexture_get_sub_resource(texture, 0))) if (!(volume = (IWineD3DVolumeImpl *)basetexture_get_sub_resource(texture, 0)))
{ {
WARN("Failed to get sub-resource.\n"); WARN("Failed to get sub-resource.\n");
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
......
...@@ -2001,7 +2001,7 @@ typedef struct IWineD3DVolumeImpl ...@@ -2001,7 +2001,7 @@ typedef struct IWineD3DVolumeImpl
BOOL dirty; BOOL dirty;
} IWineD3DVolumeImpl; } IWineD3DVolumeImpl;
void volume_add_dirty_box(IWineD3DVolume *iface, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN; void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN;
HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width, HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
......
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