summaryrefslogtreecommitdiff
path: root/protocols/Steam/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-26 17:38:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-26 17:38:31 +0300
commitdea9c030340e50324eba97c72a27c151bed12e1c (patch)
tree6fc156f40f52a9fc6e6b29e60001959477ee1a5e /protocols/Steam/src
parentc6e8f8223cab9d799593b7b2cfa22134aa9745d6 (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 'protocols/Steam/src')
-rw-r--r--protocols/Steam/src/stdafx.h1
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp35
2 files changed, 11 insertions, 25 deletions
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 <m_clist.h>
#include <m_genmenu.h>
#include <m_string.h>
-#include <m_freeimage.h>
#include <m_imgsrvc.h>
#include <m_protocols.h>
#include <m_protosvc.h>
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);