From 4314bf948da0cc912dfbe4f4fd863673c0c696ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 14 Mar 2014 22:50:03 +0000 Subject: [PATCH] [CARDS]: "Localize" some variables. svn path=/trunk/; revision=62497 --- reactos/dll/win32/cards/cards.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/reactos/dll/win32/cards/cards.c b/reactos/dll/win32/cards/cards.c index 05ff746992a..b2feb63c5b3 100644 --- a/reactos/dll/win32/cards/cards.c +++ b/reactos/dll/win32/cards/cards.c @@ -123,8 +123,7 @@ static __inline VOID BltCard(HDC hdc, INT x, INT y, INT dx, INT dy, HDC hdcCard, */ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type, COLORREF color) { - HDC hdcCard; - DWORD dwRasterOp = SRCCOPY, OldBkColor; + DWORD dwRasterOp = SRCCOPY; BOOL bSaveEdges = TRUE; BOOL bStretch = FALSE; @@ -180,22 +179,25 @@ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type } if (type != ectERASE) { + HDC hdcCard; + COLORREF OldBkColor; + hdcCard = CreateCompatibleDC(hdc); SelectObject(hdcCard, g_CardBitmaps[card]); OldBkColor = SetBkColor(hdc, (type == ectFACES) ? 0xFFFFFF : color); if (bSaveEdges) { COLORREF SavedPixels[12]; - SavedPixels[0] = GetPixel(hdc, x, y); - SavedPixels[1] = GetPixel(hdc, x + 1, y); - SavedPixels[2] = GetPixel(hdc, x, y + 1); - SavedPixels[3] = GetPixel(hdc, x + dx - 1, y); - SavedPixels[4] = GetPixel(hdc, x + dx - 2, y); - SavedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1); - SavedPixels[6] = GetPixel(hdc, x, y + dy - 1); - SavedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1); - SavedPixels[8] = GetPixel(hdc, x, y + dy - 2); - SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1); + SavedPixels[0] = GetPixel(hdc, x, y); + SavedPixels[1] = GetPixel(hdc, x + 1, y); + SavedPixels[2] = GetPixel(hdc, x, y + 1); + SavedPixels[3] = GetPixel(hdc, x + dx - 1, y); + SavedPixels[4] = GetPixel(hdc, x + dx - 2, y); + SavedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1); + SavedPixels[6] = GetPixel(hdc, x, y + dy - 1); + SavedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1); + SavedPixels[8] = GetPixel(hdc, x, y + dy - 2); + SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1); SavedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1); SavedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2); @@ -244,6 +246,7 @@ BOOL WINAPI cdtAnimate(HDC hdc, int cardback, int x, int y, int frame) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { UNREFERENCED_PARAMETER(lpvReserved); + if (fdwReason == DLL_PROCESS_ATTACH) g_hModule = hinstDLL;