Module: wine Branch: master Commit: e2d9cb69ba9a8b7e4e909ab5a26fb40843f71391 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e2d9cb69ba9a8b7e4e909ab5a2...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Jun 12 11:52:30 2014 +0200
ddraw: Use wined3d_surface_get_pitch() to calculate dwLinearSize for compressed surfaces.
---
dlls/ddraw/surface.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 21ca19f..4ffad8f 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -6120,10 +6120,7 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s { desc->dwFlags |= DDSD_LINEARSIZE; desc->dwFlags &= ~DDSD_PITCH; - if (wined3d_desc.format == WINED3DFMT_DXT1) - surface->surface_desc.u1.dwLinearSize = max(4, desc->dwWidth) * max(4, desc->dwHeight) / 2; - else - surface->surface_desc.u1.dwLinearSize = max(4, desc->dwWidth) * max(4, desc->dwHeight); + desc->u1.dwLinearSize = wined3d_surface_get_pitch(wined3d_surface) * ((desc->dwHeight + 3) / 4); } else if (!(desc->dwFlags & DDSD_LPSURFACE)) {