wined3d: Let flush_to_framebuffer_drawpixels use a valid rect.

This commit is contained in:
Roderick Colenbrander 2008-02-19 21:18:26 +01:00 committed by Alexandre Julliard
parent 0c4ffe4ff0
commit 8f18eeea35
1 changed files with 13 additions and 5 deletions

View File

@ -1163,11 +1163,19 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm
checkGLcall("glBindBufferARB");
}
glDrawPixels(This->lockedRect.right - This->lockedRect.left,
(This->lockedRect.bottom - This->lockedRect.top)-1,
fmt, type,
mem + bpp * This->lockedRect.left + pitch * This->lockedRect.top);
checkGLcall("glDrawPixels");
/* When the surface is locked we only have to refresh the locked part else we need to update the whole image */
if(This->Flags & SFLAG_LOCKED) {
glDrawPixels(This->lockedRect.right - This->lockedRect.left,
(This->lockedRect.bottom - This->lockedRect.top)-1,
fmt, type,
mem + bpp * This->lockedRect.left + pitch * This->lockedRect.top);
checkGLcall("glDrawPixels");
} else {
glDrawPixels(This->currentDesc.Width,
This->currentDesc.Height,
fmt, type, mem);
checkGLcall("glDrawPixels");
}
if(This->Flags & SFLAG_PBO) {
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));