From 320e707ce83310093e240fb4779258a201d37b82 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 14 Apr 2015 16:13:41 +0000 Subject: switch to correct parameter types git-svn-id: http://svn.miranda-ng.org/main/trunk@12817 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_gdiplus.cpp | 34 ++++++++++++----------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'plugins/Clist_modern/src/modern_gdiplus.cpp') diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp index 2ec2359fc7..1ae96da1ab 100644 --- a/plugins/Clist_modern/src/modern_gdiplus.cpp +++ b/plugins/Clist_modern/src/modern_gdiplus.cpp @@ -168,16 +168,14 @@ BOOL GDIPlus_IsAnimatedGif(TCHAR * szName) return (BOOL)(nFrameCount > 1); } -void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * pBitmap, int ** pframesDelay, int * pframesCount, SIZE * pSizeAvatar) +void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar) { int nFrameCount = 0; Bitmap image(szName); PropertyItem * pPropertyItem; - UINT count = 0; - - count = image.GetFrameDimensionsCount(); - GUID* pDimensionIDs = new GUID[count]; + UINT count = image.GetFrameDimensionsCount(); + GUID *pDimensionIDs = new GUID[count]; // Get the list of frame dimensions from the Image object. image.GetFrameDimensionsList(pDimensionIDs, count); @@ -212,18 +210,15 @@ void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * graphics.SetInterpolationMode(InterpolationModeHighQualityBicubic); graphics.SetPixelOffsetMode(PixelOffsetModeHalf); - int * delays = (int*)malloc(nFrameCount*sizeof(int)); + int *delays = (int*)malloc(nFrameCount*sizeof(int)); memset(delays, 0, nFrameCount*sizeof(int)); - GUID pageGuid = FrameDimensionTime; - /* - The GDIPlus strange behavior: without next 2 lines it will draw first frame anti aliased, but next - not - */ + // The GDIPlus strange behavior: without next 2 lines it will draw first frame anti aliased, but next - not + GUID pageGuid = FrameDimensionTime; if (nFrameCount > 1) image.SelectActiveFrame(&pageGuid, 1); - for (int i = 0; i < nFrameCount; i++) - { + for (int i = 0; i < nFrameCount; i++) { image.SelectActiveFrame(&pageGuid, i); graphics.DrawImage(&image, Rect(i*clipWidth, 0, clipWidth, clipHeight), 0, 0, imWidth, imHeight, UnitPixel, &attr); long lPause = ((long*)pPropertyItem->value)[i] * 10; @@ -233,13 +228,12 @@ void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * DeleteDC(hdc); free(pPropertyItem); delete[] pDimensionIDs; - if (pBitmap && pframesDelay && pframesCount && pSizeAvatar) - { - *pBitmap = hBitmap; - *pframesDelay = delays; - *pframesCount = nFrameCount; - pSizeAvatar->cx = clipWidth; - pSizeAvatar->cy = clipHeight; - } + + pBitmap = hBitmap; + pframesDelay = delays; + pframesCount = nFrameCount; + pSizeAvatar.cx = clipWidth; + pSizeAvatar.cy = clipHeight; + GdiFlush(); } -- cgit v1.2.3