[PATCH 3/6] ddraw: Replace wined3d_surface_unmap() with wined3d_resource_unmap() in d3d_texture2_Load().
Riccardo Bortolato
rikyz619 at gmail.com
Sun Jan 31 04:22:20 CST 2016
Also removed wined3d_surface_unmap() from wined3d public api.
Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
dlls/ddraw/surface.c | 9 ++++++---
dlls/wined3d/surface.c | 2 +-
dlls/wined3d/wined3d.spec | 1 -
dlls/wined3d/wined3d_private.h | 1 +
include/wine/wined3d.h | 1 -
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 4f05d42..19a7be2 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5137,7 +5137,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
if (FAILED(hr))
{
ERR("Failed to lock destination surface, hr %#x.\n", hr);
- wined3d_surface_unmap(src_surface->wined3d_surface);
+ wined3d_resource_unmap(wined3d_texture_get_resource(src_surface->wined3d_texture),
+ src_surface->sub_resource_idx);
wined3d_mutex_unlock();
return D3DERR_TEXTURE_LOAD_FAILED;
}
@@ -5147,8 +5148,10 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
else
memcpy(dst_map_desc.data, src_map_desc.data, src_map_desc.row_pitch * src_desc->dwHeight);
- wined3d_surface_unmap(src_surface->wined3d_surface);
- wined3d_surface_unmap(dst_surface->wined3d_surface);
+ wined3d_resource_unmap(wined3d_texture_get_resource(src_surface->wined3d_texture),
+ src_surface->sub_resource_idx);
+ wined3d_resource_unmap(wined3d_texture_get_resource(dst_surface->wined3d_texture),
+ dst_surface->sub_resource_idx);
}
if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 9f98b4e..712b78d 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2436,7 +2436,7 @@ struct wined3d_surface * CDECL wined3d_surface_from_resource(struct wined3d_reso
return surface_from_resource(resource);
}
-HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
+HRESULT wined3d_surface_unmap(struct wined3d_surface *surface)
{
TRACE("surface %p.\n", surface);
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 859fae2..49e0901 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -232,7 +232,6 @@
@ cdecl wined3d_surface_preload(ptr)
@ cdecl wined3d_surface_releasedc(ptr ptr)
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
-@ cdecl wined3d_surface_unmap(ptr)
@ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr)
@ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 31dd61c..59a70d4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2518,6 +2518,7 @@ void wined3d_surface_destroy(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
HRESULT wined3d_surface_map(struct wined3d_surface *surface,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN;
void surface_prepare_map_memory(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
+HRESULT wined3d_surface_unmap(struct wined3d_surface *surface) DECLSPEC_HIDDEN;
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 54d8ce1..3f14b72 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2484,7 +2484,6 @@ HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
void __cdecl wined3d_surface_preload(struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc);
HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y);
-HRESULT __cdecl wined3d_surface_unmap(struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const RECT *dst_rect, DWORD flags, const WINEDDOVERLAYFX *fx);
HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface,
--
1.9.1
More information about the wine-patches
mailing list