Module: wine Branch: master Commit: 4155c22e25464f4aa6fa121a786b34d748664bd4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4155c22e25464f4aa6fa121a78... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Feb 10 19:30:00 2016 +0100 wined3d: Use wined3d_texture_get_pitch() in wined3d_surface_map(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/surface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 95ee255..45cefca 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2414,10 +2414,15 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + { map_desc->row_pitch = surface->resource.width * format->byte_count; + map_desc->slice_pitch = surface->resource.height * map_desc->row_pitch; + } else - map_desc->row_pitch = wined3d_surface_get_pitch(surface); - map_desc->slice_pitch = surface->resource.height * map_desc->row_pitch; + { + wined3d_texture_get_pitch(surface->container, surface->texture_level, + &map_desc->row_pitch, &map_desc->slice_pitch); + } if (!box) {