Module: wine Branch: master Commit: fd6395f0c7d910971560c613d87ac44d6de5bc27 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fd6395f0c7d910971560c613d8...
Author: Fabian Bieler der.fabe@gmx.net Date: Sat Mar 31 13:01:48 2007 +0200
wined3d: Fix UpdateSurface for sourceRect != sourceWidth.
---
dlls/wined3d/device.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3bee323..d1224e4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4823,14 +4823,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, /* This function doesn't support compressed textures the pitch is just bytesPerPixel * width */ if(srcWidth != srcSurfaceWidth || srcLeft ){ - rowoffset = (srcSurfaceWidth - srcWidth) * pSrcSurface->bytesPerPixel; + rowoffset = srcSurfaceWidth * pSrcSurface->bytesPerPixel; offset += srcLeft * pSrcSurface->bytesPerPixel; /* TODO: do we ever get 3bpp?, would a shift and an add be quicker than a mul (well maybe a cycle or two) */ } /* TODO DXT formats */
if(pSourceRect != NULL && pSourceRect->top != 0){ - offset += pSourceRect->top * srcWidth * pSrcSurface->bytesPerPixel; + offset += pSourceRect->top * srcSurfaceWidth * pSrcSurface->bytesPerPixel; } TRACE("(%p) glTexSubImage2D, Level %d, left %d, top %d, width %d, height %d , ftm %d, type %d, memory %p\n" ,This