Riccardo Bortolato : d3d8: Don' t use a wined3d_volume in d3d8_volume_GetDesc.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Oct 7 10:00:48 CDT 2015
Module: wine
Branch: master
Commit: eeea2af596859fc2b77ca28685a7a1545e6fe718
URL: http://source.winehq.org/git/wine.git/?a=commit;h=eeea2af596859fc2b77ca28685a7a1545e6fe718
Author: Riccardo Bortolato <rikyz619 at gmail.com>
Date: Tue Oct 6 10:36:51 2015 +0200
d3d8: Don't use a wined3d_volume in d3d8_volume_GetDesc.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/d3d8/d3d8_private.h | 3 +--
dlls/d3d8/device.c | 2 +-
dlls/d3d8/volume.c | 9 ++++-----
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h
index aec4831..ab6a3d4 100644
--- a/dlls/d3d8/d3d8_private.h
+++ b/dlls/d3d8/d3d8_private.h
@@ -206,12 +206,11 @@ struct d3d8_volume
struct d3d8_resource resource;
struct wined3d_texture *wined3d_texture;
unsigned int sub_resource_idx;
- struct wined3d_volume *wined3d_volume;
struct d3d8_texture *texture;
};
void volume_init(struct d3d8_volume *volume, struct wined3d_texture *wined3d_texture,
- unsigned int sub_resource_idx, struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN;
+ unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN;
struct d3d8_swapchain
{
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 6ba476e..818f601 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -3029,7 +3029,7 @@ static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *
if (!(d3d_volume = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_volume))))
return E_OUTOFMEMORY;
- volume_init(d3d_volume, wined3d_texture, sub_resource_idx, volume, parent_ops);
+ volume_init(d3d_volume, wined3d_texture, sub_resource_idx, parent_ops);
*parent = d3d_volume;
TRACE("Created volume %p.\n", d3d_volume);
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c
index 81cd40e..e37330c 100644
--- a/dlls/d3d8/volume.c
+++ b/dlls/d3d8/volume.c
@@ -116,13 +116,13 @@ static HRESULT WINAPI d3d8_volume_GetDesc(IDirect3DVolume8 *iface, D3DVOLUME_DES
{
struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface);
struct wined3d_resource_desc wined3d_desc;
- struct wined3d_resource *wined3d_resource;
+ struct wined3d_resource *sub_resource;
TRACE("iface %p, desc %p.\n", iface, desc);
wined3d_mutex_lock();
- wined3d_resource = wined3d_volume_get_resource(volume->wined3d_volume);
- wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
+ sub_resource = wined3d_texture_get_sub_resource(volume->wined3d_texture, volume->sub_resource_idx);
+ wined3d_resource_get_desc(sub_resource, &wined3d_desc);
wined3d_mutex_unlock();
desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
@@ -203,12 +203,11 @@ static const struct wined3d_parent_ops d3d8_volume_wined3d_parent_ops =
};
void volume_init(struct d3d8_volume *volume, struct wined3d_texture *wined3d_texture,
- unsigned int sub_resource_idx, struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops)
+ unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops)
{
volume->IDirect3DVolume8_iface.lpVtbl = &d3d8_volume_vtbl;
d3d8_resource_init(&volume->resource);
volume->resource.refcount = 0;
- volume->wined3d_volume = wined3d_volume;
volume->texture = wined3d_texture_get_parent(wined3d_texture);
volume->wined3d_texture = wined3d_texture;
volume->sub_resource_idx = sub_resource_idx;
More information about the wine-cvs
mailing list