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/SmileyAdd | |
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/SmileyAdd')
-rw-r--r-- | plugins/SmileyAdd/SmileyAdd.vcxproj | 5 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/imagecache.cpp | 28 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/main.cpp | 4 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/stdafx.h | 1 |
4 files changed, 19 insertions, 19 deletions
diff --git a/plugins/SmileyAdd/SmileyAdd.vcxproj b/plugins/SmileyAdd/SmileyAdd.vcxproj index 68cab8ea78..87eb21f46b 100644 --- a/plugins/SmileyAdd/SmileyAdd.vcxproj +++ b/plugins/SmileyAdd/SmileyAdd.vcxproj @@ -30,6 +30,11 @@ <ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
</ImportGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\libs\freeimage\freeimage.vcxproj">
+ <Project>{5D14CFF3-0D17-4528-99EA-DE9DCA47CC2E}</Project>
+ </ProjectReference>
+ </ItemGroup>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4458;%(DisableSpecificWarnings)</DisableSpecificWarnings>
diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp index 26842e284b..87043a9e26 100644 --- a/plugins/SmileyAdd/src/imagecache.cpp +++ b/plugins/SmileyAdd/src/imagecache.cpp @@ -421,34 +421,34 @@ ImageFType::ImageFType(const unsigned id, const CMStringW &file) {
m_bmp = nullptr;
- FREE_IMAGE_FORMAT fif = fei->FI_GetFileTypeU(file.c_str(), 0);
+ FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeU(file.c_str(), 0);
if (fif == FIF_UNKNOWN)
- fif = fei->FI_GetFIFFromFilenameU(file.c_str());
+ fif = FreeImage_GetFIFFromFilenameU(file.c_str());
if (fif == FIF_UNKNOWN) return;
- FIBITMAP *dib = fei->FI_LoadU(fif, file.c_str(), 0);
+ FIBITMAP *dib = FreeImage_LoadU(fif, file.c_str(), 0);
if (dib == nullptr) return;
- bool transp = fei->FI_IsTransparent(dib) != 0;
- FREE_IMAGE_TYPE imt = fei->FI_GetImageType(dib);
- unsigned bpp = fei->FI_GetBPP(dib);
+ bool transp = FreeImage_IsTransparent(dib) != 0;
+ FREE_IMAGE_TYPE imt = FreeImage_GetImageType(dib);
+ unsigned bpp = FreeImage_GetBPP(dib);
if (transp && bpp != 32 || imt == FIT_RGBA16) {
- FIBITMAP *tdib = fei->FI_ConvertTo32Bits(dib);
- fei->FI_Unload(dib);
+ FIBITMAP *tdib = FreeImage_ConvertTo32Bits(dib);
+ FreeImage_Unload(dib);
dib = tdib;
}
else if (!transp && bpp > 24) {
- FIBITMAP *tdib = fei->FI_ConvertTo24Bits(dib);
- fei->FI_Unload(dib);
+ FIBITMAP *tdib = FreeImage_ConvertTo24Bits(dib);
+ FreeImage_Unload(dib);
dib = tdib;
}
- m_bmp = fei->FI_CreateHBITMAPFromDIB(dib);
- fei->FI_Unload(dib);
+ m_bmp = FreeImage_CreateHBITMAPFromDIB(dib);
+ FreeImage_Unload(dib);
if (transp)
- fei->FI_Premultiply(m_bmp);
+ FreeImage_Premultiply(m_bmp);
}
ImageFType::~ImageFType()
@@ -550,7 +550,7 @@ ImageBase* AddCacheImage(const CMStringW &file, int index) img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoIcl) : (ImageBase*)new IconType(id, file, index, icoIcl);
else if (ext == L"gif")
img = new ImageType(id, file, nullptr);
- else if (fei == nullptr || ext == L"tif" || ext == L"tiff")
+ else if (ext == L"tif" || ext == L"tiff")
img = new ImageType(id, file, nullptr);
else
img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, nullptr) : (ImageBase*)new ImageFType(id, file);
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 3a6cfee311..05698d2c75 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -24,8 +24,6 @@ HINSTANCE g_hInst; HANDLE hEvent1;
HGENMENU hContactMenuItem;
-FI_INTERFACE *fei;
-
int hLangpack;
static const PLUGININFOEX pluginInfoEx =
@@ -91,8 +89,6 @@ extern "C" __declspec(dllexport) int Load(void) return 1;
}
- CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fei);
-
InitImageCache();
Icon_Register(g_hInst, MODULENAME, &icon, 1);
diff --git a/plugins/SmileyAdd/src/stdafx.h b/plugins/SmileyAdd/src/stdafx.h index 227d1744fb..3993c29660 100644 --- a/plugins/SmileyAdd/src/stdafx.h +++ b/plugins/SmileyAdd/src/stdafx.h @@ -86,7 +86,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "smileyroutines.h"
#include "smltool.h"
-extern FI_INTERFACE *fei;
extern HINSTANCE g_hInst;
extern HNETLIBUSER hNetlibUser;
extern HANDLE hEvent1;
|