Module: wine Branch: master Commit: 5864d18c965fd2e94af86c38808481434a8565d3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5864d18c965fd2e94af86c3880... Author: Markus Amsler <markus.amsler(a)oribi.org> Date: Mon Nov 6 19:43:48 2006 +0100 wined3d: Use SURFACE_ALIGNMENT. --- dlls/wined3d/surface.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index d0f44cf..7fd300f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1842,7 +1842,7 @@ static HRESULT WINAPI IWineD3DSurfaceImp /* Stick to the alignment for the converted surface too, makes it easier to load the surface */ outpitch = width * bpp; - outpitch = (outpitch + 3) & ~3; + outpitch = (outpitch + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); mem = HeapAlloc(GetProcessHeap(), 0, outpitch * height); if(!mem) { @@ -2126,7 +2126,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFo format == WINED3DFMT_DXT4 || format == WINED3DFMT_DXT5) { This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4)); } else { - This->resource.size = ((This->pow2Width * formatEntry->bpp) + 3) & ~3; + This->resource.size = ((This->pow2Width * formatEntry->bpp) + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); This->resource.size *= This->pow2Height; }