[v2 05/10] d3d8: don't use a wined3d_volume in d3d8_volume_GetDesc
Riccardo Bortolato
rikyz619 at gmail.com
Tue Oct 6 02:26:13 CDT 2015
finally removed the wind3d_volume pointer from d3d8_volume
---
dlls/d3d8/d3d8_private.h | 3 +--
dlls/d3d8/device.c | 2 +-
dlls/d3d8/volume.c | 8 ++++----
3 files changed, 6 insertions(+), 7 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 a7539de..b7cbdb9 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -3028,7 +3028,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 6a364d1..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,7 +203,7 @@ 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);
--
1.9.1
More information about the wine-patches
mailing list