Module: wine Branch: master Commit: 604d15400274a07f3eb0231688e2e09b6edb8355 URL: http://source.winehq.org/git/wine.git/?a=commit;h=604d15400274a07f3eb0231688...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Nov 7 21:19:57 2011 +0100
wined3d: Only report a broken pitch in wined3d_surface_map().
We'd like the correct pitch for internal calls to wined3d_surface_get_pitch().
---
dlls/wined3d/surface.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 1a44f72..4529ad0 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3096,7 +3096,7 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
TRACE("surface %p.\n", surface);
- if ((format->flags & (WINED3DFMT_FLAG_BLOCKS | WINED3DFMT_FLAG_BROKEN_PITCH)) == WINED3DFMT_FLAG_BLOCKS) + if (format->flags & WINED3DFMT_FLAG_BLOCKS) { /* Since compressed formats are block based, pitch means the amount of * bytes to the next row of block rather than the next row of pixels. */ @@ -3743,7 +3743,10 @@ HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface,
surface->surface_ops->surface_map(surface, rect, flags);
- locked_rect->Pitch = wined3d_surface_get_pitch(surface); + if (format->flags & WINED3DFMT_FLAG_BROKEN_PITCH) + locked_rect->Pitch = surface->resource.width * format->byte_count; + else + locked_rect->Pitch = wined3d_surface_get_pitch(surface);
if (!rect) {