diff options
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_global_structure.h | 1 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_aniavatars.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_cachefuncs.cpp | 35 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcopts.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcpaint.cpp | 57 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistopts.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_gdiplus.cpp | 19 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_skinengine.cpp | 67 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_skinopt.cpp | 27 |
9 files changed, 17 insertions, 205 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_global_structure.h b/plugins/Clist_modern/src/hdr/modern_global_structure.h index 09036459ec..b8742177a0 100644 --- a/plugins/Clist_modern/src/hdr/modern_global_structure.h +++ b/plugins/Clist_modern/src/hdr/modern_global_structure.h @@ -41,7 +41,6 @@ typedef struct tagCLUIDATA BOOL fSmoothAnimation;
BOOL fLayered;
BOOL fDocked;
- BOOL fGDIPlusFail;
BOOL fSortNoOfflineBottom;
BOOL fAutoSize;
BOOL fAeroGlass;
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index b54eed3821..093f0852e6 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -211,10 +211,7 @@ static void _AniAva_AnimationTreadProc(void*) // Init AniAva module
int AniAva_InitModule()
{
- if (g_CluiData.fGDIPlusFail)
- return 0;
-
- if ( !(db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) &&
+ if ( !(db_get_b(NULL, "CList", "AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) &&
db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)))
return 0;
@@ -269,8 +266,7 @@ int AniAva_UnloadModule() int AniAva_UpdateOptions()
{
BOOL bReloadAvatars = FALSE;
- BOOL bBeEnabled = (!g_CluiData.fGDIPlusFail &&
- db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) &&
+ BOOL bBeEnabled = (db_get_b(NULL, "CList", "AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) &&
db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT));
if (bBeEnabled && !s_bModuleStarted) {
AniAva_InitModule();
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 48f44932c6..e9ae405c35 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -778,40 +778,7 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact) int w = width_clip;
int h = height_clip;
- if ( !g_CluiData.fGDIPlusFail) //Use gdi+ engine
- DrawAvatarImageWithGDIp(hdc, 0, 0, w, h,ace->hbmPic, 0, 0, ace->bmWidth,ace->bmHeight,ace->dwFlags,255);
- else {
- if ( !(ace->dwFlags & AVS_PREMULTIPLIED)) {
- HDC hdcTmp = CreateCompatibleDC(hdc);
- RECT r = {0, 0, w,h};
- HDC hdcTmp2 = CreateCompatibleDC(hdc);
- HBITMAP bmo = (HBITMAP)SelectObject(hdcTmp,ace->hbmPic);
- HBITMAP b2 = ske_CreateDIB32(w,h);
- HBITMAP bmo2 = (HBITMAP)SelectObject(hdcTmp2,b2);
- SetStretchBltMode(hdcTmp, HALFTONE);
- SetStretchBltMode(hdcTmp2, HALFTONE);
- StretchBlt(hdcTmp2, 0, 0, w, h,
- hdcTmp, 0, 0, ace->bmWidth, ace->bmHeight,
- SRCCOPY);
-
- ske_SetRectOpaque(hdcTmp2,&r);
- BitBlt(hdc, rc.left, rc.top, w, h,hdcTmp2, 0, 0, SRCCOPY);
- SelectObject(hdcTmp2,bmo2);
- SelectObject(hdcTmp,bmo);
- DeleteDC(hdcTmp);
- DeleteDC(hdcTmp2);
- DeleteObject(b2);
- }
- else {
- BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- HDC hdcTempAv = CreateCompatibleDC(hdc);
- HBITMAP hbmTempAvOld;
- hbmTempAvOld = (HBITMAP)SelectObject(hdcTempAv,ace->hbmPic);
- ske_AlphaBlend(hdc, rc.left, rc.top, w, h, hdcTempAv, 0, 0, ace->bmWidth,ace->bmHeight, bf);
- SelectObject(hdcTempAv, hbmTempAvOld);
- DeleteDC(hdcTempAv);
- }
- }
+ DrawAvatarImageWithGDIp(hdc, 0, 0, w, h,ace->hbmPic, 0, 0, ace->bmWidth,ace->bmHeight,ace->dwFlags,255);
}
SelectObject(hdc,oldBmp);
DeleteDC(hdc);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 916d7d7839..77e12e9bf3 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -845,7 +845,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_MULTITRAY, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(NULL,"CList","DisableTrayFlash",SETTING_DISABLETRAYFLASH_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) == 1 ? BST_CHECKED : BST_UNCHECKED );
if (IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 7ae0f488bc..50392aba60 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -1406,66 +1406,9 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact // Draw avatar
if ( dat->use_avatar_service )
- /*if ( ServiceExists( MS_AV_BLENDDRAWAVATAR ))
- {
- AVATARDRAWREQUEST adr;
-
- adr.cbSize = sizeof( AVATARDRAWREQUEST );
- adr.hContact = Drawing->hContact;
- adr.hTargetDC = hdcMem;
- adr.rcDraw = p_rect;
- adr.dwFlags = ( dat->avatars_draw_border ? AVDRQ_DRAWBORDER : 0 ) |
- ( dat->avatars_round_corners ? AVDRQ_ROUNDEDCORNER : 0 ) |
- AVDRQ_HIDEBORDERONTRANSPARENCY;
- adr.clrBorder = dat->avatars_border_color;
- adr.radius = round_radius;
- adr.alpha = blendmode;
-
- CallService(MS_AV_DRAWAVATAR, 0, (LPARAM) &adr );
- }
- else
- */
{
int w = width;
int h = height;
-/* if ( !g_CluiData.fGDIPlusFail ) //Use gdi+ engine
- {
- DrawAvatarImageWithGDIp( hdcMem, p_rect.left, p_rect.top, w, h, Drawing->avatar_data->hbmPic, 0, 0, Drawing->avatar_data->bmWidth, Drawing->avatar_data->bmHeight, Drawing->avatar_data->dwFlags, blendmode );
- }
- else
- {
- if ( !( Drawing->avatar_data->dwFlags&AVS_PREMULTIPLIED ))
- {
- HDC hdcTmp = CreateCompatibleDC( hdcMem );
- RECT r = {0, 0, w, h};
- HDC hdcTmp2 = CreateCompatibleDC( hdcMem );
- HBITMAP bmo = ( HBITMAP )SelectObject( hdcTmp, Drawing->avatar_data->hbmPic );
- HBITMAP b2 = ske_CreateDIB32( w, h );
- HBITMAP bmo2 = ( HBITMAP )SelectObject( hdcTmp2, b2 );
- SetStretchBltMode( hdcTmp, HALFTONE );
- SetStretchBltMode( hdcTmp2, HALFTONE );
- StretchBlt( hdcTmp2, 0, 0, w, h,
- hdcTmp, 0, 0, Drawing->avatar_data->bmWidth, Drawing->avatar_data->bmHeight,
- SRCCOPY );
-
- ske_SetRectOpaque( hdcTmp2, &r );
- BitBlt( hdcMem, p_rect.left, p_rect.top, w, h, hdcTmp2, 0, 0, SRCCOPY );
- SelectObject( hdcTmp2, bmo2 );
- SelectObject( hdcTmp, bmo );
- DeleteDC( hdcTmp );
- DeleteDC( hdcTmp2 );
- DeleteObject( b2 );
- }
- else {
- BLENDFUNCTION bf = {AC_SRC_OVER, 0, blendmode, AC_SRC_ALPHA };
- HDC hdcTempAv = CreateCompatibleDC( hdcMem );
- HBITMAP hbmTempAvOld;
- hbmTempAvOld = ( HBITMAP )SelectObject( hdcTempAv, Drawing->avatar_data->hbmPic );
- ske_AlphaBlend( hdcMem, p_rect.left, p_rect.top, w, h, hdcTempAv, 0, 0, Drawing->avatar_data->bmWidth, Drawing->avatar_data->bmHeight, bf );
- SelectObject( hdcTempAv, hbmTempAvOld );
- DeleteDC( hdcTempAv );
- }
- }*/
_DrawContactAvatar( hdcMem, dat, Drawing, &row_rc, selected, hottrack, p_rect, &p_rect );
}
else
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 6b234ee068..04d6a8397b 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -241,7 +241,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) == 1 ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton(hwndDlg, IDC_AVATAR_FASTDRAW, db_get_b(NULL,"CList","AvatarsInSeparateWnd",SETTINGS_AVATARINSEPARATE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AVATAR_DRAW_BORDER, db_get_b(NULL,"CList","AvatarsDrawBorders",SETTINGS_AVATARDRAWBORDER_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton(hwndDlg, IDC_AVATAR_ROUND_CORNERS, db_get_b(NULL,"CList","AvatarsRoundCorners",SETTINGS_AVATARROUNDCORNERS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
@@ -323,7 +323,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_CONTACT),FALSE);
}
- if ( !ServiceExists(MS_AV_GETAVATARBITMAP) || g_CluiData.fGDIPlusFail) {
+ if ( !ServiceExists(MS_AV_GETAVATARBITMAP)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS),FALSE);
SetDlgItemText(hwndDlg, IDC_SHOW_ANIAVATARS, TranslateT("Animate Avatars (GDI+ and Avatar Service module (avs.dll) are required)"));
}
@@ -347,7 +347,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_SPIN),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_PIXELS2),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_PIXELS3),enabled);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS),enabled && ( ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS), enabled && ServiceExists(MS_AV_GETAVATARBITMAP));
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_WIDTH),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_WIDTH_SPIN),enabled);
diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp index 972105cfb1..f4241b4778 100644 --- a/plugins/Clist_modern/src/modern_gdiplus.cpp +++ b/plugins/Clist_modern/src/modern_gdiplus.cpp @@ -22,26 +22,15 @@ int g_hottrack; void InitGdiPlus(void)
{
GdiplusStartupInput gdiplusStartupInput;
- g_CluiData.fGDIPlusFail = false;
- __try {
- if (g_gdiplusToken == 0)
- GdiplusStartup(&g_gdiplusToken, &gdiplusStartupInput, NULL);
- }
- __except ( EXCEPTION_EXECUTE_HANDLER ) {
- g_CluiData.fGDIPlusFail = true;
- }
+ if (g_gdiplusToken == 0)
+ GdiplusStartup(&g_gdiplusToken, &gdiplusStartupInput, NULL);
}
void ShutdownGdiPlus(void)
{
GdiplusStartupInput gdiplusStartupInput;
- __try {
- if (g_gdiplusToken)
- GdiplusShutdown(g_gdiplusToken);
- }
- __except ( EXCEPTION_EXECUTE_HANDLER ) {
- g_CluiData.fGDIPlusFail = true;
- }
+ if (g_gdiplusToken)
+ GdiplusShutdown(g_gdiplusToken);
g_gdiplusToken = 0;
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 960b5293a4..cfe4f3e1a5 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -92,24 +92,6 @@ static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam); static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam);
static INT_PTR ske_Service_DrawTextWithEffect(WPARAM wParam, LPARAM lParam);
-//Decoders
-static HMODULE hImageDecoderModule;
-
-typedef DWORD (__stdcall *pfnImgNewDecoder)(void ** ppDecoder);
-static pfnImgNewDecoder ImgNewDecoder;
-
-typedef DWORD (__stdcall *pfnImgDeleteDecoder)(void * pDecoder);
-static pfnImgDeleteDecoder ImgDeleteDecoder;
-
-typedef DWORD (__stdcall *pfnImgNewDIBFromFile)(LPVOID /*in*/pDecoder, LPCSTR /*in*/pFileName, LPVOID /*out*/*pImg);
-static pfnImgNewDIBFromFile ImgNewDIBFromFile;
-
-typedef DWORD (__stdcall *pfnImgDeleteDIBSection)(LPVOID /*in*/pImg);
-static pfnImgDeleteDIBSection ImgDeleteDIBSection;
-
-typedef DWORD (__stdcall *pfnImgGetHandle)(LPVOID /*in*/pImg, HBITMAP /*out*/*pBitmap, LPVOID /*out*/*ppDIBBits);
-static pfnImgGetHandle ImgGetHandle;
-
static MODERNEFFECT meCurrentEffect = {-1,{0}, 0, 0};
@@ -428,36 +410,6 @@ HRESULT SkinEngineLoadModule() // Initialize GDI+
InitGdiPlus();
AniAva_InitModule();
- //load decoder
- hImageDecoderModule = NULL;
- if (g_CluiData.fGDIPlusFail)
- {
- hImageDecoderModule = LoadLibrary(_T("ImgDecoder.dll"));
- if (hImageDecoderModule == NULL)
- {
- char tDllPath[ MAX_PATH ];
- GetModuleFileNameA( g_hInst, tDllPath, sizeof( tDllPath ));
- {
- char* p = strrchr( tDllPath, '\\' );
- if ( p != NULL )
- strcpy( p+1, "ImgDecoder.dll");
- else
- {
- strcpy( tDllPath, "ImgDecoder.dll");
- }
- }
-
- hImageDecoderModule = LoadLibraryA(tDllPath);
- }
- if (hImageDecoderModule != NULL)
- {
- ImgNewDecoder = (pfnImgNewDecoder )GetProcAddress( hImageDecoderModule, "ImgNewDecoder");
- ImgDeleteDecoder = (pfnImgDeleteDecoder )GetProcAddress( hImageDecoderModule, "ImgDeleteDecoder");
- ImgNewDIBFromFile = (pfnImgNewDIBFromFile)GetProcAddress( hImageDecoderModule, "ImgNewDIBFromFile");
- ImgDeleteDIBSection = (pfnImgDeleteDIBSection)GetProcAddress( hImageDecoderModule, "ImgDeleteDIBSection");
- ImgGetHandle = (pfnImgGetHandle)GetProcAddress( hImageDecoderModule, "ImgGetHandle");
- }
- }
//create services
CreateServiceFunction(MS_SKIN_DRAWGLYPH,ske_Service_DrawGlyph);
CreateServiceFunction(MS_SKINENG_UPTATEFRAMEIMAGE,ske_Service_UpdateFrameImage);
@@ -506,7 +458,6 @@ int SkinEngineUnloadModule() DeleteCriticalSection(&cs_SkinChanging);
GdiFlush();
DestroyHookableEvent(g_CluiData.hEventSkinServicesCreated);
- if (hImageDecoderModule) FreeLibrary(hImageDecoderModule);
AniAva_UnloadModule();
ShutdownGdiPlus();
//free variables
@@ -515,7 +466,7 @@ int SkinEngineUnloadModule() BOOL ske_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest,int nHeightDest,HDC hdcSrc,int nXOriginSrc,int nYOriginSrc,int nWidthSrc,int nHeightSrc,BLENDFUNCTION blendFunction)
{
- if (g_CluiData.fDisableSkinEngine && !(!g_CluiData.fGDIPlusFail && blendFunction.BlendFlags&128))
+ if (g_CluiData.fDisableSkinEngine && !(blendFunction.BlendFlags&128))
{
if (nWidthDest != nWidthSrc || nHeightDest != nHeightSrc)
return StretchBlt(hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,hdcSrc,nXOriginSrc,nYOriginSrc,nWidthSrc,nHeightSrc, SRCCOPY);
@@ -523,7 +474,7 @@ BOOL ske_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest return BitBlt(hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,hdcSrc,nXOriginSrc,nYOriginSrc, SRCCOPY);
}
- if ( !g_CluiData.fGDIPlusFail && blendFunction.BlendFlags&128 ) //Use gdi+ engine
+ if (blendFunction.BlendFlags&128) //Use gdi+ engine
{
return GDIPlus_AlphaBlend( hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,
hdcSrc,nXOriginSrc,nYOriginSrc,nWidthSrc,nHeightSrc,
@@ -1939,9 +1890,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName) HBITMAP hBitmap = NULL;
TCHAR ext[5];
BYTE f = 0;
- LPBYTE pBitmapBits;
LPVOID pImg = NULL;
- LPVOID m_pImgDecoder;
BITMAP bmpInfo;
{
@@ -1960,17 +1909,9 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName) GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);
f = (bmpInfo.bmBits != NULL);
}
- else if (hImageDecoderModule == NULL || !mir_bool_tstrcmpi(ext, _T(".png"))) {
+ else if (!mir_bool_tstrcmpi(ext, _T(".png"))) {
hBitmap = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)tszFileName);
}
- else {
- f = 1;
- ImgNewDecoder(&m_pImgDecoder);
- if ( !ImgNewDIBFromFile(m_pImgDecoder, _T2A(tszFileName), &pImg)) {
- ImgGetHandle(pImg, &hBitmap, (LPVOID *)&pBitmapBits);
- ImgDeleteDecoder(m_pImgDecoder);
- }
- }
if (hBitmap) {
GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);
@@ -1999,7 +1940,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName) static HBITMAP ske_skinLoadGlyphImage(const TCHAR *tszFileName)
{
- if ( !g_CluiData.fGDIPlusFail && !wildcmpit(tszFileName, _T("*.tga")))
+ if (!wildcmpit(tszFileName, _T("*.tga")))
return GDIPlus_LoadGlyphImage(tszFileName);
return ske_LoadGlyphImageByDecoders(tszFileName);
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 5d4003185e..7fb29421e3 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -240,19 +240,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara imgPos.x = workRect.left+(( wWidth-dWidth )>>1 );
imgPos.y = workRect.top+(( wHeight-dHeight )>>1 );
//DrawImage
- if ( !g_CluiData.fGDIPlusFail ) //Use gdi+ engine
- {
- DrawAvatarImageWithGDIp( memDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255 );
- }
- else
- {
- BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- HDC imgDC = CreateCompatibleDC( dis->hDC );
- HBITMAP imgOldbmp = (HBITMAP) SelectObject( imgDC, hPreviewBitmap );
- ske_AlphaBlend( memDC, imgPos.x, imgPos.y, dWidth, dHeight, imgDC, 0, 0, bmp.bmWidth, bmp.bmHeight, bf );
- SelectObject( imgDC, imgOldbmp );
- DeleteDC( imgDC );
- }
+ DrawAvatarImageWithGDIp( memDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255 );
}
BitBlt( dis->hDC, dis->rcItem.left, dis->rcItem.top, mWidth, mHeight, memDC, 0, 0, SRCCOPY );
SelectObject( memDC, holdbmp );
@@ -553,8 +541,6 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) {
DRAWITEMSTRUCT *dis = ( DRAWITEMSTRUCT * )wParam;
- HDC imgDC;
- HBITMAP imgOldbmp;
int mWidth, mHeight;
RECT workRect = {0};
mWidth = dis->rcItem.right-dis->rcItem.left;
@@ -593,16 +579,7 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) imgPos.x = workRect.left+(( wWidth-dWidth )>>1 );
imgPos.y = workRect.top+(( wHeight-dHeight )>>1 );
//DrawImage
- if ( !g_CluiData.fGDIPlusFail ) //Use gdi+ engine
- DrawAvatarImageWithGDIp( dis->hDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255 );
- else {
- BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- imgDC = CreateCompatibleDC( dis->hDC );
- imgOldbmp = ( HBITMAP )SelectObject( imgDC, hPreviewBitmap );
- ske_AlphaBlend( dis->hDC, imgPos.x, imgPos.y, dWidth, dHeight, imgDC, 0, 0, bmp.bmWidth, bmp.bmHeight, bf );
- SelectObject( imgDC, imgOldbmp );
- DeleteDC( imgDC );
- }
+ DrawAvatarImageWithGDIp( dis->hDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255 );
ske_UnloadGlyphImage(hPreviewBitmap);
}
}
|