[PATCH 1/6] ddraw: Replace wined3d_surface_map() with wined3d_resource_map() in d3d_texture2_Load().
Riccardo Bortolato
rikyz619 at gmail.com
Sun Jan 31 04:22:18 CST 2016
Also removed wined3d_surface_map() from the public wined3d api.
Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
dlls/ddraw/surface.c | 6 ++++--
dlls/wined3d/surface.c | 2 +-
dlls/wined3d/wined3d.spec | 1 -
dlls/wined3d/wined3d_private.h | 2 ++
include/wine/wined3d.h | 2 --
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 4c12504..96951f4 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5123,7 +5123,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
/* Copy the main memory texture into the surface that corresponds
* to the OpenGL texture object. */
- hr = wined3d_surface_map(src_surface->wined3d_surface, &src_map_desc, NULL, 0);
+ hr = wined3d_resource_map(wined3d_texture_get_resource(src_surface->wined3d_texture),
+ src_surface->sub_resource_idx, &src_map_desc, NULL, 0);
if (FAILED(hr))
{
ERR("Failed to lock source surface, hr %#x.\n", hr);
@@ -5131,7 +5132,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
return D3DERR_TEXTURE_LOAD_FAILED;
}
- hr = wined3d_surface_map(dst_surface->wined3d_surface, &dst_map_desc, NULL, 0);
+ hr = wined3d_resource_map(wined3d_texture_get_resource(dst_surface->wined3d_texture),
+ dst_surface->sub_resource_idx, &dst_map_desc, NULL, 0);
if (FAILED(hr))
{
ERR("Failed to lock destination surface, hr %#x.\n", hr);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7b1cf28..9f98b4e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2452,7 +2452,7 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
return WINED3D_OK;
}
-HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
+HRESULT wined3d_surface_map(struct wined3d_surface *surface,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
const struct wined3d_format *format = surface->resource.format;
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index cd8174c..859fae2 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -229,7 +229,6 @@
@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_get_resource(ptr)
@ cdecl wined3d_surface_getdc(ptr ptr)
-@ cdecl wined3d_surface_map(ptr ptr ptr long)
@ cdecl wined3d_surface_preload(ptr)
@ cdecl wined3d_surface_releasedc(ptr ptr)
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4bd019f..31dd61c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2515,6 +2515,8 @@ HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct w
GLenum target, unsigned int level, unsigned int layer, DWORD flags,
struct wined3d_surface **surface) DECLSPEC_HIDDEN;
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;
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,
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index bd0a9c7..54d8ce1 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2481,8 +2481,6 @@ void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface)
DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
-HRESULT __cdecl wined3d_surface_map(struct wined3d_surface *surface,
- struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
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);
--
1.9.1
More information about the wine-patches
mailing list