static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface, UINT Width, UINT Height,
UINT Depth, DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool, void *parent,
- const struct wined3d_parent_ops *parent_ops, IWineD3DVolume **ppVolume)
+ const struct wined3d_parent_ops *parent_ops, struct wined3d_volume **volume)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
- IWineD3DVolumeImpl *object;
+ struct wined3d_volume *object;
HRESULT hr;
TRACE("(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)\n", This, Width, Height,
if (!object)
{
ERR("Out of memory\n");
- *ppVolume = NULL;
+ *volume = NULL;
return WINED3DERR_OUTOFVIDEOMEMORY;
}
}
TRACE("(%p) : Created volume %p.\n", This, object);
- *ppVolume = (IWineD3DVolume *)object;
+ *volume = object;
return WINED3D_OK;
}
/* This is a helper function for UpdateTexture, there is no UpdateVolume method in D3D. */
static HRESULT IWineD3DDeviceImpl_UpdateVolume(IWineD3DDevice *iface,
- IWineD3DVolume *pSourceVolume, IWineD3DVolume *pDestinationVolume)
+ struct wined3d_volume *src_volume, struct wined3d_volume *dst_volume)
{
WINED3DLOCKED_BOX src;
WINED3DLOCKED_BOX dst;
HRESULT hr;
TRACE("iface %p, src_volume %p, dst_volume %p.\n",
- iface, pSourceVolume, pDestinationVolume);
+ iface, src_volume, dst_volume);
- /* TODO: Implement direct loading into the gl volume instead of using memcpy and
- * dirtification to improve loading performance.
- */
- hr = wined3d_volume_map(pSourceVolume, &src, NULL, WINED3DLOCK_READONLY);
+ /* TODO: Implement direct loading into the gl volume instead of using
+ * memcpy and dirtification to improve loading performance. */
+ hr = wined3d_volume_map(src_volume, &src, NULL, WINED3DLOCK_READONLY);
if (FAILED(hr)) return hr;
- hr = wined3d_volume_map(pDestinationVolume, &dst, NULL, WINED3DLOCK_DISCARD);
+ hr = wined3d_volume_map(dst_volume, &dst, NULL, WINED3DLOCK_DISCARD);
if (FAILED(hr))
{
- wined3d_volume_unmap(pSourceVolume);
+ wined3d_volume_unmap(src_volume);
return hr;
}
- memcpy(dst.pBits, src.pBits, ((IWineD3DVolumeImpl *) pDestinationVolume)->resource.size);
+ memcpy(dst.pBits, src.pBits, dst_volume->resource.size);
- hr = wined3d_volume_unmap(pDestinationVolume);
+ hr = wined3d_volume_unmap(dst_volume);
if (FAILED(hr))
- wined3d_volume_unmap(pSourceVolume);
+ wined3d_volume_unmap(src_volume);
else
- hr = wined3d_volume_unmap(pSourceVolume);
+ hr = wined3d_volume_unmap(src_volume);
return hr;
}
case WINED3DRTYPE_VOLUMETEXTURE:
{
- IWineD3DVolume *src_volume;
- IWineD3DVolume *dst_volume;
-
for (i = 0; i < level_count; ++i)
{
- src_volume = (IWineD3DVolume *)volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
- dst_volume = (IWineD3DVolume *)volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
- hr = IWineD3DDeviceImpl_UpdateVolume(iface, src_volume, dst_volume);
+ hr = IWineD3DDeviceImpl_UpdateVolume(iface,
+ volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i)),
+ volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i)));
if (FAILED(hr))
{
WARN("IWineD3DDeviceImpl_UpdateVolume failed, hr %#x.\n", hr);
{
for (i = 0; i < texture->level_count; ++i)
{
- IWineD3DVolumeImpl *volume = volume_from_resource(texture->sub_resources[i]);
+ struct wined3d_volume *volume = volume_from_resource(texture->sub_resources[i]);
volume_add_dirty_box(volume, NULL);
volume_load(volume, i, texture->flags & WINED3D_TEXTURE_IS_SRGB);
}
static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
{
- IWineD3DVolumeImpl *volume = volume_from_resource(sub_resource);
+ struct wined3d_volume *volume = volume_from_resource(sub_resource);
/* Cleanup the container. */
volume_set_container(volume, NULL);
for (i = 0; i < texture->level_count; ++i)
{
- IWineD3DVolume *volume;
+ struct wined3d_volume *volume;
/* Create the volume. */
hr = IWineD3DDeviceParent_CreateVolume(device->device_parent, parent,
}
/* Set its container to this texture. */
- volume_set_container((IWineD3DVolumeImpl *)volume, texture);
- texture->sub_resources[i] = &((IWineD3DVolumeImpl *)volume)->resource;
+ volume_set_container(volume, texture);
+ texture->sub_resources[i] = &volume->resource;
/* Calculate the next mipmap level. */
tmp_w = max(1, tmp_w >> 1);
/*
- * IWineD3DVolume implementation
- *
* Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber
}
}
-void volume_set_container(IWineD3DVolumeImpl *volume, struct wined3d_texture *container)
+void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture *container)
{
TRACE("volume %p, container %p.\n", volume, container);
}
/* Context activation is done by the caller. */
-void volume_load(IWineD3DVolumeImpl *volume, UINT level, BOOL srgb_mode)
+void volume_load(struct wined3d_volume *volume, UINT level, BOOL srgb_mode)
{
const struct wined3d_gl_info *gl_info = &volume->resource.device->adapter->gl_info;
const struct wined3d_format *format = volume->resource.format;
volume_unload,
};
-HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
+HRESULT volume_init(struct wined3d_volume *volume, IWineD3DDeviceImpl *device, UINT width,
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
void *parent, const struct wined3d_parent_ops *parent_ops)
{
typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl;
-typedef struct wined3d_volume IWineD3DVolumeImpl;
-typedef struct wined3d_volume IWineD3DVolume;
/* Texture format fixups */
BOOL dirty;
};
-static inline IWineD3DVolumeImpl *volume_from_resource(struct wined3d_resource *resource)
+static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
{
- return CONTAINING_RECORD(resource, IWineD3DVolumeImpl, resource);
+ return CONTAINING_RECORD(resource, struct wined3d_volume, resource);
}
void volume_add_dirty_box(struct wined3d_volume *volume, const WINED3DBOX *dirty_box) DECLSPEC_HIDDEN;
-HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
+HRESULT volume_init(struct wined3d_volume *volume, IWineD3DDeviceImpl *device, UINT width,
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 volume_load(IWineD3DVolumeImpl *volume, UINT level, BOOL srgb_mode) DECLSPEC_HIDDEN;
-void volume_set_container(IWineD3DVolumeImpl *volume, struct wined3d_texture *container) DECLSPEC_HIDDEN;
+void volume_load(struct wined3d_volume *volume, UINT level, BOOL srgb_mode) DECLSPEC_HIDDEN;
+void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture *container) DECLSPEC_HIDDEN;
/*****************************************************************************
* Structure for DIB Surfaces (GetDC and GDI surfaces)