ReactOS 0.4.16-dev-197-g92996da
volume.c File Reference
#include "config.h"
#include "d3d9_private.h"
Include dependency graph for volume.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d9)
 
static struct d3d9_volumeimpl_from_IDirect3DVolume9 (IDirect3DVolume9 *iface)
 
static HRESULT WINAPI d3d9_volume_QueryInterface (IDirect3DVolume9 *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3d9_volume_AddRef (IDirect3DVolume9 *iface)
 
static ULONG WINAPI d3d9_volume_Release (IDirect3DVolume9 *iface)
 
static HRESULT WINAPI d3d9_volume_GetDevice (IDirect3DVolume9 *iface, IDirect3DDevice9 **device)
 
static HRESULT WINAPI d3d9_volume_SetPrivateData (IDirect3DVolume9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
 
static HRESULT WINAPI d3d9_volume_GetPrivateData (IDirect3DVolume9 *iface, REFGUID guid, void *data, DWORD *data_size)
 
static HRESULT WINAPI d3d9_volume_FreePrivateData (IDirect3DVolume9 *iface, REFGUID guid)
 
static HRESULT WINAPI d3d9_volume_GetContainer (IDirect3DVolume9 *iface, REFIID riid, void **container)
 
static HRESULT WINAPI d3d9_volume_GetDesc (IDirect3DVolume9 *iface, D3DVOLUME_DESC *desc)
 
static HRESULT WINAPI d3d9_volume_LockBox (IDirect3DVolume9 *iface, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
 
static HRESULT WINAPI d3d9_volume_UnlockBox (IDirect3DVolume9 *iface)
 
static void STDMETHODCALLTYPE volume_wined3d_object_destroyed (void *parent)
 
void volume_init (struct d3d9_volume *volume, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops)
 

Variables

static const struct IDirect3DVolume9Vtbl d3d9_volume_vtbl
 
static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops
 

Function Documentation

◆ d3d9_volume_AddRef()

static ULONG WINAPI d3d9_volume_AddRef ( IDirect3DVolume9 *  iface)
static

Definition at line 50 of file volume.c.

51{
53
54 TRACE("iface %p.\n", iface);
55 TRACE("Forwarding to %p.\n", volume->texture);
56
57 return IDirect3DBaseTexture9_AddRef(&volume->texture->IDirect3DBaseTexture9_iface);
58}
#define IDirect3DBaseTexture9_AddRef(p)
Definition: d3d9.h:834
static struct d3d9_volume * impl_from_IDirect3DVolume9(IDirect3DVolume9 *iface)
Definition: volume.c:27
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d9_volume_FreePrivateData()

static HRESULT WINAPI d3d9_volume_FreePrivateData ( IDirect3DVolume9 *  iface,
REFGUID  guid 
)
static

Definition at line 99 of file volume.c.

100{
102 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
103
104 return d3d9_resource_free_private_data(&volume->resource, guid);
105}
HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid)
Definition: d3d9_main.c:160
#define debugstr_guid
Definition: kernel32.h:35
const GUID * guid

◆ d3d9_volume_GetContainer()

static HRESULT WINAPI d3d9_volume_GetContainer ( IDirect3DVolume9 *  iface,
REFIID  riid,
void **  container 
)
static

Definition at line 107 of file volume.c.

108{
110
111 TRACE("iface %p, riid %s, container %p.\n", iface, debugstr_guid(riid), container);
112
113 return IDirect3DBaseTexture9_QueryInterface(&volume->texture->IDirect3DBaseTexture9_iface, riid, container);
114}
#define IDirect3DBaseTexture9_QueryInterface(p, a, b)
Definition: d3d9.h:833
REFIID riid
Definition: atlbase.h:39

◆ d3d9_volume_GetDesc()

static HRESULT WINAPI d3d9_volume_GetDesc ( IDirect3DVolume9 *  iface,
D3DVOLUME_DESC desc 
)
static

Definition at line 116 of file volume.c.

117{
119 struct wined3d_sub_resource_desc wined3d_desc;
120
121 TRACE("iface %p, desc %p.\n", iface, desc);
122
124 wined3d_texture_get_sub_resource_desc(volume->wined3d_texture, volume->sub_resource_idx, &wined3d_desc);
126
127 desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format);
128 desc->Type = D3DRTYPE_VOLUME;
129 desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage);
130 desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage);
131 desc->Width = wined3d_desc.width;
132 desc->Height = wined3d_desc.height;
133 desc->Depth = wined3d_desc.depth;
134
135 return D3D_OK;
136}
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN
Definition: device.c:44
static DWORD d3dusage_from_wined3dusage(unsigned int usage)
Definition: d3d8_private.h:280
static D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned int usage)
Definition: d3d8_private.h:285
@ D3DRTYPE_VOLUME
Definition: d3d8types.h:811
#define D3D_OK
Definition: d3d.h:106
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
Definition: texture.c:3480
static const WCHAR desc[]
Definition: protectdata.c:36
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368

◆ d3d9_volume_GetDevice()

static HRESULT WINAPI d3d9_volume_GetDevice ( IDirect3DVolume9 *  iface,
IDirect3DDevice9 **  device 
)
static

Definition at line 70 of file volume.c.

71{
73
74 TRACE("iface %p, device %p.\n", iface, device);
75
76 return IDirect3DBaseTexture9_GetDevice(&volume->texture->IDirect3DBaseTexture9_iface, device);
77}
#define IDirect3DBaseTexture9_GetDevice(p, a)
Definition: d3d9.h:837
Definition: devices.h:37

◆ d3d9_volume_GetPrivateData()

static HRESULT WINAPI d3d9_volume_GetPrivateData ( IDirect3DVolume9 *  iface,
REFGUID  guid,
void data,
DWORD data_size 
)
static

Definition at line 89 of file volume.c.

91{
93 TRACE("iface %p, guid %s, data %p, data_size %p.\n",
94 iface, debugstr_guid(guid), data, data_size);
95
96 return d3d9_resource_get_private_data(&volume->resource, guid, data, data_size);
97}
HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, void *data, DWORD *data_size)
Definition: d3d9_main.c:178
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ d3d9_volume_LockBox()

static HRESULT WINAPI d3d9_volume_LockBox ( IDirect3DVolume9 *  iface,
D3DLOCKED_BOX locked_box,
const D3DBOX box,
DWORD  flags 
)
static

Definition at line 138 of file volume.c.

140{
142 struct wined3d_map_desc map_desc;
143 HRESULT hr;
144
145 TRACE("iface %p, locked_box %p, box %p, flags %#x.\n",
146 iface, locked_box, box, flags);
147
150 volume->sub_resource_idx, &map_desc, (const struct wined3d_box *)box,
152 map_desc.data = NULL;
154
155 locked_box->RowPitch = map_desc.row_pitch;
156 locked_box->SlicePitch = map_desc.slice_pitch;
157 locked_box->pBits = map_desc.data;
158
159 if (hr == E_INVALIDARG)
160 return D3DERR_INVALIDCALL;
161 return hr;
162}
unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags) DECLSPEC_HIDDEN
Definition: device.c:144
#define D3DERR_INVALIDCALL
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
Definition: resource.c:344
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1052
GLbitfield flags
Definition: glext.h:7161
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
Definition: palette.c:468

◆ d3d9_volume_QueryInterface()

static HRESULT WINAPI d3d9_volume_QueryInterface ( IDirect3DVolume9 *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 32 of file volume.c.

33{
34 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
35
36 if (IsEqualGUID(riid, &IID_IDirect3DVolume9)
38 {
40 *out = iface;
41 return S_OK;
42 }
43
44 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
45
46 *out = NULL;
47 return E_NOINTERFACE;
48}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define IDirect3DVolume9_AddRef(p)
Definition: d3d9.h:382
#define S_OK
Definition: intsafe.h:52
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static FILE * out
Definition: regtests2xml.c:44
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ d3d9_volume_Release()

static ULONG WINAPI d3d9_volume_Release ( IDirect3DVolume9 *  iface)
static

Definition at line 60 of file volume.c.

61{
63
64 TRACE("iface %p.\n", iface);
65 TRACE("Forwarding to %p.\n", volume->texture);
66
67 return IDirect3DBaseTexture9_Release(&volume->texture->IDirect3DBaseTexture9_iface);
68}
#define IDirect3DBaseTexture9_Release(p)
Definition: d3d9.h:835

◆ d3d9_volume_SetPrivateData()

static HRESULT WINAPI d3d9_volume_SetPrivateData ( IDirect3DVolume9 *  iface,
REFGUID  guid,
const void data,
DWORD  data_size,
DWORD  flags 
)
static

Definition at line 79 of file volume.c.

81{
83 TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
84 iface, debugstr_guid(guid), data, data_size, flags);
85
86 return d3d9_resource_set_private_data(&volume->resource, guid, data, data_size, flags);
87}
HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, const void *data, DWORD data_size, DWORD flags)
Definition: d3d9_main.c:222

◆ d3d9_volume_UnlockBox()

static HRESULT WINAPI d3d9_volume_UnlockBox ( IDirect3DVolume9 *  iface)
static

Definition at line 164 of file volume.c.

165{
167 HRESULT hr;
168
169 TRACE("iface %p.\n", iface);
170
172 hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx);
174
175 if (hr == WINEDDERR_NOTLOCKED)
176 return D3DERR_INVALIDCALL;
177 return hr;
178}
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:382
#define WINEDDERR_NOTLOCKED
Definition: wined3d.h:50

◆ impl_from_IDirect3DVolume9()

static struct d3d9_volume * impl_from_IDirect3DVolume9 ( IDirect3DVolume9 *  iface)
inlinestatic

◆ volume_init()

void volume_init ( struct d3d9_volume volume,
struct wined3d_texture wined3d_texture,
unsigned int  sub_resource_idx,
const struct wined3d_parent_ops **  parent_ops 
)

Definition at line 209 of file volume.c.

211{
212 volume->IDirect3DVolume9_iface.lpVtbl = &d3d9_volume_vtbl;
213 d3d9_resource_init(&volume->resource);
214 volume->resource.refcount = 0;
216 volume->wined3d_texture = wined3d_texture;
217 volume->sub_resource_idx = sub_resource_idx;
218
219 *parent_ops = &d3d9_volume_wined3d_parent_ops;
220}
void d3d9_resource_init(struct d3d9_resource *resource)
Definition: d3d9_main.c:216
static const struct IDirect3DVolume9Vtbl d3d9_volume_vtbl
Definition: volume.c:180
static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops
Definition: volume.c:204
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1121

◆ volume_wined3d_object_destroyed()

static void STDMETHODCALLTYPE volume_wined3d_object_destroyed ( void parent)
static

Definition at line 197 of file volume.c.

198{
199 struct d3d9_volume *volume = parent;
200 d3d9_resource_cleanup(&volume->resource);
202}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
void d3d9_resource_cleanup(struct d3d9_resource *resource)
Definition: d3d9_main.c:155
r parent
Definition: btrfs.c:3010

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d9  )

Variable Documentation

◆ d3d9_volume_vtbl

const struct IDirect3DVolume9Vtbl d3d9_volume_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d9_volume_GetDevice(IDirect3DVolume9 *iface, IDirect3DDevice9 **device)
Definition: volume.c:70
static HRESULT WINAPI d3d9_volume_SetPrivateData(IDirect3DVolume9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags)
Definition: volume.c:79
static HRESULT WINAPI d3d9_volume_LockBox(IDirect3DVolume9 *iface, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
Definition: volume.c:138
static HRESULT WINAPI d3d9_volume_QueryInterface(IDirect3DVolume9 *iface, REFIID riid, void **out)
Definition: volume.c:32
static HRESULT WINAPI d3d9_volume_UnlockBox(IDirect3DVolume9 *iface)
Definition: volume.c:164
static ULONG WINAPI d3d9_volume_Release(IDirect3DVolume9 *iface)
Definition: volume.c:60
static HRESULT WINAPI d3d9_volume_GetDesc(IDirect3DVolume9 *iface, D3DVOLUME_DESC *desc)
Definition: volume.c:116
static HRESULT WINAPI d3d9_volume_FreePrivateData(IDirect3DVolume9 *iface, REFGUID guid)
Definition: volume.c:99
static HRESULT WINAPI d3d9_volume_GetContainer(IDirect3DVolume9 *iface, REFIID riid, void **container)
Definition: volume.c:107
static HRESULT WINAPI d3d9_volume_GetPrivateData(IDirect3DVolume9 *iface, REFGUID guid, void *data, DWORD *data_size)
Definition: volume.c:89
static ULONG WINAPI d3d9_volume_AddRef(IDirect3DVolume9 *iface)
Definition: volume.c:50

Definition at line 180 of file volume.c.

Referenced by volume_init().

◆ d3d9_volume_wined3d_parent_ops

const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops
static
Initial value:
=
{
}
static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent)
Definition: volume.c:197

Definition at line 204 of file volume.c.

Referenced by volume_init().