mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
Fix AddDirtyRect uncorrect behavior (crash in some cases). Based on a
patch from Roderick Colenbrander.
This commit is contained in:
parent
3f27fecd25
commit
bf2121a312
1 changed files with 11 additions and 4 deletions
|
@ -598,9 +598,16 @@ HRESULT WINAPI IDirect3DSurface8Impl_CleanDirtyRect(LPDIRECT3DSURFACE8 iface) {
|
|||
extern HRESULT WINAPI IDirect3DSurface8Impl_AddDirtyRect(LPDIRECT3DSURFACE8 iface, CONST RECT* pDirtyRect) {
|
||||
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||
This->Dirty = TRUE;
|
||||
This->dirtyRect.left = min(This->dirtyRect.left, pDirtyRect->left);
|
||||
This->dirtyRect.top = min(This->dirtyRect.top, pDirtyRect->top);
|
||||
This->dirtyRect.right = max(This->dirtyRect.right, pDirtyRect->right);
|
||||
This->dirtyRect.bottom = max(This->dirtyRect.bottom, pDirtyRect->bottom);
|
||||
if (NULL != pDirtyRect) {
|
||||
This->dirtyRect.left = min(This->dirtyRect.left, pDirtyRect->left);
|
||||
This->dirtyRect.top = min(This->dirtyRect.top, pDirtyRect->top);
|
||||
This->dirtyRect.right = max(This->dirtyRect.right, pDirtyRect->right);
|
||||
This->dirtyRect.bottom = max(This->dirtyRect.bottom, pDirtyRect->bottom);
|
||||
} else {
|
||||
This->dirtyRect.left = 0;
|
||||
This->dirtyRect.top = 0;
|
||||
This->dirtyRect.right = This->myDesc.Width;
|
||||
This->dirtyRect.bottom = This->myDesc.Height;
|
||||
}
|
||||
return D3D_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue