d3d9: Make use of wined3d_texture_map in d3d9_volume_LockBox.

Also removed wined3d_volume_map from wined3d public api.

Signed-off-by: Riccardo Bortolato <rikyz619@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Riccardo Bortolato 2015-10-07 19:04:31 +02:00 committed by Alexandre Julliard
parent b8315e87f1
commit b9cc2859fe
6 changed files with 9 additions and 5 deletions

View File

@ -191,6 +191,8 @@ struct d3d9_volume
{
IDirect3DVolume9 IDirect3DVolume9_iface;
struct d3d9_resource resource;
struct wined3d_texture *wined3d_texture;
unsigned int sub_resource_idx;
struct wined3d_volume *wined3d_volume;
struct d3d9_texture *texture;
};

View File

@ -148,7 +148,8 @@ static HRESULT WINAPI d3d9_volume_LockBox(IDirect3DVolume9 *iface,
iface, locked_box, box, flags);
wined3d_mutex_lock();
hr = wined3d_volume_map(volume->wined3d_volume, &map_desc, (const struct wined3d_box *)box, flags);
hr = wined3d_texture_map(volume->wined3d_texture, volume->sub_resource_idx,
&map_desc, (const struct wined3d_box *)box, flags);
wined3d_mutex_unlock();
locked_box->RowPitch = map_desc.row_pitch;
@ -209,6 +210,8 @@ void volume_init(struct d3d9_volume *volume, struct wined3d_texture *wined3d_tex
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;
*parent_ops = &d3d9_volume_wined3d_parent_ops;
}

View File

@ -531,7 +531,7 @@ static BOOL wined3d_volume_check_box_dimensions(const struct wined3d_volume *vol
return TRUE;
}
HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
HRESULT wined3d_volume_map(struct wined3d_volume *volume,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
struct wined3d_device *device = volume->resource.device;

View File

@ -284,5 +284,4 @@
@ cdecl wined3d_vertex_declaration_incref(ptr)
@ cdecl wined3d_volume_get_resource(ptr)
@ cdecl wined3d_volume_map(ptr ptr ptr long)
@ cdecl wined3d_volume_unmap(ptr)

View File

@ -2341,6 +2341,8 @@ void wined3d_volume_get_pitch(const struct wined3d_volume *volume, UINT *row_pit
void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context,
BOOL srgb_mode) DECLSPEC_HIDDEN;
void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN;
HRESULT wined3d_volume_map(struct wined3d_volume *volume,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN;
void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context,
const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;

View File

@ -2569,8 +2569,6 @@ void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex
ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume);
HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume);
/* Return the integer base-2 logarithm of x. Undefined for x == 0. */