mciavi32: Use SetRect() instead of open coding it.

Signed-off-by: Michael Stefaniuc <mstefani@redhat.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2016-06-29 09:54:30 +02:00 committed by Alexandre Julliard
parent a14e5fb1bb
commit 9fd4429d49
2 changed files with 10 additions and 20 deletions

View File

@ -140,11 +140,7 @@ static BOOL MCIAVI_GetInfoVideo(WINE_MCIAVI* wma, const MMCKINFO* mmckList, MMCK
TRACE("bih.biClrUsed=%d\n", wma->inbih->biClrUsed); TRACE("bih.biClrUsed=%d\n", wma->inbih->biClrUsed);
TRACE("bih.biClrImportant=%d\n", wma->inbih->biClrImportant); TRACE("bih.biClrImportant=%d\n", wma->inbih->biClrImportant);
wma->source.left = 0; SetRect(&wma->source, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
wma->source.top = 0;
wma->source.right = wma->inbih->biWidth;
wma->source.bottom = wma->inbih->biHeight;
wma->dest = wma->source; wma->dest = wma->source;
return TRUE; return TRUE;

View File

@ -122,9 +122,11 @@ BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARM
if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent; if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent;
if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle; if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle;
rc.left = rc.top = 0; if (wma->hic)
rc.right = (wma->hic ? wma->outbih : wma->inbih)->biWidth; SetRect(&rc, 0, 0, wma->outbih->biWidth, wma->outbih->biHeight);
rc.bottom = (wma->hic ? wma->outbih : wma->inbih)->biHeight; else
SetRect(&rc, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
AdjustWindowRect(&rc, dwStyle, FALSE); AdjustWindowRect(&rc, dwStyle, FALSE);
if (!(dwStyle & (WS_CHILD|WS_POPUP))) /* overlapped window ? */ if (!(dwStyle & (WS_CHILD|WS_POPUP))) /* overlapped window ? */
{ {
@ -161,10 +163,8 @@ DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms)
if (dwFlags & MCI_DGV_RECT) { if (dwFlags & MCI_DGV_RECT) {
/* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height /* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
* So convert input MCI RECT into a normal RECT */ * So convert input MCI RECT into a normal RECT */
rc.left = lpParms->rc.left; SetRect(&rc, lpParms->rc.left, lpParms->rc.top, lpParms->rc.left + lpParms->rc.right,
rc.top = lpParms->rc.top; lpParms->rc.top + lpParms->rc.bottom);
rc.right = lpParms->rc.left + lpParms->rc.right;
rc.bottom = lpParms->rc.top + lpParms->rc.bottom;
} else { } else {
GetClientRect(wma->hWndPaint, &rc); GetClientRect(wma->hWndPaint, &rc);
} }
@ -235,10 +235,7 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms)
} }
if (dwFlags & MCI_DGV_WHERE_SOURCE) { if (dwFlags & MCI_DGV_WHERE_SOURCE) {
if (dwFlags & MCI_DGV_WHERE_MAX) { if (dwFlags & MCI_DGV_WHERE_MAX) {
rc.left = 0; SetRect(&rc, 0, 0, wma->inbih->biWidth, wma->inbih->biHeight);
rc.top = 0;
rc.right = wma->inbih->biWidth;
rc.bottom = wma->inbih->biHeight;
TRACE("WHERE_SOURCE_MAX %s\n", wine_dbgstr_rect(&rc)); TRACE("WHERE_SOURCE_MAX %s\n", wine_dbgstr_rect(&rc));
} else { } else {
TRACE("WHERE_SOURCE %s\n", wine_dbgstr_rect(&wma->source)); TRACE("WHERE_SOURCE %s\n", wine_dbgstr_rect(&wma->source));
@ -265,10 +262,7 @@ DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms)
/* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height /* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
* So convert the normal RECT into a MCI RECT before returning */ * So convert the normal RECT into a MCI RECT before returning */
lpParms->rc.left = rc.left; SetRect(&lpParms->rc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
lpParms->rc.top = rc.top;
lpParms->rc.right = rc.right - rc.left;
lpParms->rc.bottom = rc.bottom - rc.top;
LeaveCriticalSection(&wma->cs); LeaveCriticalSection(&wma->cs);
return 0; return 0;