From dea9c030340e50324eba97c72a27c151bed12e1c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 26 Jan 2018 17:38:31 +0300 Subject: 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 --- protocols/Steam/src/stdafx.h | 1 - protocols/Steam/src/steam_dialogs.cpp | 35 +++++++++++------------------------ 2 files changed, 11 insertions(+), 25 deletions(-) (limited to 'protocols/Steam/src') diff --git a/protocols/Steam/src/stdafx.h b/protocols/Steam/src/stdafx.h index a8aa969ca3..4bbc6f770b 100644 --- a/protocols/Steam/src/stdafx.h +++ b/protocols/Steam/src/stdafx.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index b3731551b0..568156796f 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -156,40 +156,27 @@ INT_PTR CSteamCaptchaDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_PAINT) { - FI_INTERFACE *fei = nullptr; - - 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 0; - } - - FIMEMORY *stream = fei->FI_OpenMemory(m_captchaImage, m_captchaImageSize); - FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeFromMemory(stream, 0); - FIBITMAP *bitmap = fei->FI_LoadFromMemory(fif, stream, 0); - fei->FI_CloseMemory(stream); + FIMEMORY *stream = FreeImage_OpenMemory(m_captchaImage, m_captchaImageSize); + FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(stream, 0); + FIBITMAP *bitmap = FreeImage_LoadFromMemory(fif, stream, 0); + FreeImage_CloseMemory(stream); PAINTSTRUCT ps; HDC hDC = BeginPaint(m_hwnd, &ps); - //SetStretchBltMode(hDC, COLORONCOLOR); StretchDIBits( hDC, 11, 11, - fei->FI_GetWidth(bitmap) - 13, - fei->FI_GetHeight(bitmap), + FreeImage_GetWidth(bitmap) - 13, + FreeImage_GetHeight(bitmap), 0, 0, - fei->FI_GetWidth(bitmap), - fei->FI_GetHeight(bitmap), - fei->FI_GetBits(bitmap), - fei->FI_GetInfo(bitmap), + FreeImage_GetWidth(bitmap), + FreeImage_GetHeight(bitmap), + FreeImage_GetBits(bitmap), + FreeImage_GetInfo(bitmap), DIB_RGB_COLORS, SRCCOPY); - fei->FI_Unload(bitmap); - //fei->FI_DeInitialise(); + FreeImage_Unload(bitmap); EndPaint(m_hwnd, &ps); -- cgit v1.2.3