Commit fd6395f0 authored by Fabian Bieler's avatar Fabian Bieler Committed by Alexandre Julliard

wined3d: Fix UpdateSurface for sourceRect != sourceWidth.

parent 65479a24
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment