Commit ad23586c authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Pull the WM_TIMER handling into its own function.

ANIMATE_DrawFrame shouldn't worry about locking, the lock should be held by the caller.
parent 17c31068
......@@ -349,15 +349,12 @@ static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr)
TRACE("Drawing frame %d (loop %d)\n", infoPtr->currFrame, infoPtr->nLoop);
EnterCriticalSection(&infoPtr->cs);
mmioSeek(infoPtr->hMMio, infoPtr->lpIndex[infoPtr->currFrame], SEEK_SET);
mmioRead(infoPtr->hMMio, infoPtr->indata, infoPtr->ash.dwSuggestedBufferSize);
if (infoPtr->hic &&
fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata,
infoPtr->outbih, infoPtr->outdata) != ICERR_OK) {
LeaveCriticalSection(&infoPtr->cs);
WARN("Decompression error\n");
return FALSE;
}
......@@ -375,11 +372,24 @@ static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr)
}
}
}
LeaveCriticalSection(&infoPtr->cs);
return TRUE;
}
static LRESULT ANIMATE_Timer(ANIMATE_INFO *infoPtr)
{
/* FIXME: we should pass the hDC instead of 0 to WM_CTLCOLORSTATIC */
if (infoPtr->dwStyle & ACS_TRANSPARENT)
infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
WM_CTLCOLORSTATIC,
0, (LPARAM)infoPtr->hwndSelf);
EnterCriticalSection(&infoPtr->cs);
ANIMATE_DrawFrame(infoPtr);
LeaveCriticalSection(&infoPtr->cs);
return 0;
}
static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
{
ANIMATE_INFO *infoPtr = (ANIMATE_INFO *)ptr_;
......@@ -892,11 +902,7 @@ static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LP
return ANIMATE_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
case WM_TIMER:
if (infoPtr->dwStyle & ACS_TRANSPARENT)
infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
WM_CTLCOLORSTATIC,
wParam, (LPARAM)infoPtr->hwndSelf);
return ANIMATE_DrawFrame(infoPtr);
return ANIMATE_Timer(infoPtr);
case WM_PAINT:
{
......
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