diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-26 17:38:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-26 17:38:31 +0300 |
commit | dea9c030340e50324eba97c72a27c151bed12e1c (patch) | |
tree | 6fc156f40f52a9fc6e6b29e60001959477ee1a5e /plugins/AVS/src/main.cpp | |
parent | c6e8f8223cab9d799593b7b2cfa22134aa9745d6 (diff) |
AdvaImg:
- freeimage extracted to the separate library;
- FI_INTERFACE removed, all references to it are replaced with direct calls of FreeImage_* functions;
- unified project for AdvaImg
Diffstat (limited to 'plugins/AVS/src/main.cpp')
-rw-r--r-- | plugins/AVS/src/main.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 802396eb9d..774b5c5218 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -63,8 +63,6 @@ char *g_szMetaName = nullptr; int OnDetailsInit(WPARAM wParam, LPARAM lParam);
int OptInit(WPARAM wParam, LPARAM lParam);
-FI_INTERFACE *fei = nullptr;
-
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -283,11 +281,11 @@ void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bm StretchBlt(r->hTargetDC, r->rcDraw.left + leftoffset, r->rcDraw.top + topoffset, newWidth, newHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, SRCCOPY);
else {
// get around SUCKY AlphaBlend() rescaling quality...
- FIBITMAP *fb = fei->FI_CreateDIBFromHBITMAP(hbm);
- FIBITMAP *fbResized = fei->FI_Rescale(fb, newWidth, newHeight, FILTER_BICUBIC);
- HBITMAP hbmResized = fei->FI_CreateHBITMAPFromDIB(fbResized);
- fei->FI_Unload(fb);
- fei->FI_Unload(fbResized);
+ FIBITMAP *fb = FreeImage_CreateDIBFromHBITMAP(hbm);
+ FIBITMAP *fbResized = FreeImage_Rescale(fb, newWidth, newHeight, FILTER_BICUBIC);
+ HBITMAP hbmResized = FreeImage_CreateHBITMAPFromDIB(fbResized);
+ FreeImage_Unload(fb);
+ FreeImage_Unload(fbResized);
HBITMAP hbmTempOld;
HDC hdcTemp = CreateCompatibleDC(r->hTargetDC);
@@ -337,17 +335,15 @@ static int ModulesLoaded(WPARAM, LPARAM) PROTOACCOUNT **accs = nullptr;
Proto_EnumAccounts(&accCount, &accs);
- if (fei != nullptr) {
- LoadDefaultInfo();
+ LoadDefaultInfo();
- int protoCount;
- PROTOCOLDESCRIPTOR **proto;
- Proto_EnumProtocols(&protoCount, &proto);
- for (int i = 0; i < protoCount; i++)
- LoadProtoInfo(proto[i]);
- for (int i = 0; i < accCount; i++)
- LoadAccountInfo(accs[i]);
- }
+ int protoCount;
+ PROTOCOLDESCRIPTOR **proto;
+ Proto_EnumProtocols(&protoCount, &proto);
+ for (int i = 0; i < protoCount; i++)
+ LoadProtoInfo(proto[i]);
+ for (int i = 0; i < accCount; i++)
+ LoadAccountInfo(accs[i]);
// Load global avatar
protoPicCacheEntry *pce = new protoPicCacheEntry;
@@ -401,14 +397,6 @@ extern "C" int __declspec(dllexport) Load(void) mir_getLP(&pluginInfoEx);
pcli = Clist_GetInterface();
- INT_PTR result = CALLSERVICE_NOTFOUND;
- if (ServiceExists(MS_IMG_GETINTERFACE))
- result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fei);
-
- if (fei == nullptr || result != S_OK) {
- MessageBox(nullptr, TranslateT("Fatal error, image services not found. Avatar services will be disabled."), TranslateT("Avatar service"), MB_OK);
- return 1;
- }
LoadACC();
return LoadAvatarModule();
}
|