diff --git a/VisualStudio/FHeroes2Enh/FHeroes2Enh.vcxproj b/VisualStudio/FHeroes2Enh/FHeroes2Enh.vcxproj
index 6bbaeff..8aed93b 100644
--- a/VisualStudio/FHeroes2Enh/FHeroes2Enh.vcxproj
+++ b/VisualStudio/FHeroes2Enh/FHeroes2Enh.vcxproj
@@ -141,12 +141,16 @@
true
AnySuitable
false
- Speed
+ Size
true
false
stdcpp14
MultiThreaded
false
+ false
+ true
+ false
+ FastCall
Windows
diff --git a/src/Installer/Installer/fh2enh.zip b/src/Installer/Installer/fh2enh.zip
index e199fa2..19a5578 100644
Binary files a/src/Installer/Installer/fh2enh.zip and b/src/Installer/Installer/fh2enh.zip differ
diff --git a/src/engine/IMG_savepng.cpp b/src/engine/IMG_savepng.cpp
index 78cd2bf..3a66e6e 100644
--- a/src/engine/IMG_savepng.cpp
+++ b/src/engine/IMG_savepng.cpp
@@ -37,7 +37,7 @@
#include "png.h"
-int IMG_SavePNG(const char *file, SDL_Surface *surf, int compression)
+int __cdecl IMG_SavePNG(const char *file, SDL_Surface *surf, int compression)
{
SDL_RWops *fp = SDL_RWFromFile(file, "wb");
@@ -51,7 +51,7 @@ int IMG_SavePNG(const char *file, SDL_Surface *surf, int compression)
return ret;
}
-static void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
+static void __cdecl png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
auto *rp = (SDL_RWops *) png_get_io_ptr(png_ptr);
SDL_RWwrite(rp, data, 1, length);
diff --git a/src/engine/IMG_savepng.h b/src/engine/IMG_savepng.h
index 0808c79..bc925cd 100644
--- a/src/engine/IMG_savepng.h
+++ b/src/engine/IMG_savepng.h
@@ -35,7 +35,7 @@
* Takes a filename, a surface to save, and a compression level. The
* compression level can be 0(min) through 9(max), or -1(default).
*/
-int IMG_SavePNG(const char *file,
+int __cdecl IMG_SavePNG(const char *file,
SDL_Surface *surf,
int compression);
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp
index 04bad45..84d92cf 100644
--- a/src/engine/engine.cpp
+++ b/src/engine/engine.cpp
@@ -76,7 +76,7 @@ bool SDL::Init(u32 system)
return true;
}
-void SDL::Quit()
+void __cdecl SDL::Quit()
{
System::CreateTrayIcon(false);
System::PowerManagerOff(false);
diff --git a/src/engine/engine.h b/src/engine/engine.h
index 4b64ca2..f626a0e 100644
--- a/src/engine/engine.h
+++ b/src/engine/engine.h
@@ -36,7 +36,7 @@ namespace SDL
{
bool Init(u32 system = INIT_VIDEO);
- void Quit();
+ void __cdecl Quit();
bool SubSystem(u32 system);
}
diff --git a/src/engine/localevent.cpp b/src/engine/localevent.cpp
index 5eac377..635f653 100644
--- a/src/engine/localevent.cpp
+++ b/src/engine/localevent.cpp
@@ -839,7 +839,7 @@ void LocalEvent::SetGlobalFilterKeysEvents(void (*pf)(int, int))
}
-int LocalEvent::GlobalFilterEvents(const SDL_Event *event)
+int __cdecl LocalEvent::GlobalFilterEvents(const SDL_Event *event)
{
LocalEvent &le = Get();
diff --git a/src/engine/localevent.h b/src/engine/localevent.h
index 2f77d67..44d150c 100644
--- a/src/engine/localevent.h
+++ b/src/engine/localevent.h
@@ -304,7 +304,7 @@ class LocalEvent
void HandleKeyboardEvent(SDL_KeyboardEvent &);
- static int GlobalFilterEvents(const SDL_Event *);
+ static int __cdecl GlobalFilterEvents(const SDL_Event *);
enum flag_t
diff --git a/src/engine/thread.cpp b/src/engine/thread.cpp
index dcf6f3f..92526dd 100644
--- a/src/engine/thread.cpp
+++ b/src/engine/thread.cpp
@@ -43,7 +43,7 @@ Thread &Thread::operator=(const Thread &)
return *this;
}
-void Thread::Create(int (*fn)(void *), void *param)
+void Thread::Create(int (__cdecl *fn)(void *), void *param)
{
thread = SDL_CreateThread(fn, param);
}
@@ -110,7 +110,7 @@ Timer::Timer() : id(nullptr)
{
}
-void Timer::Run(u32 interval, u32 (*fn)(u32, void *), void *param)
+void Timer::Run(u32 interval, u32(__cdecl *fn)(u32, void *), void *param)
{
if (id) Remove();
diff --git a/src/engine/thread.h b/src/engine/thread.h
index 6422281..95a9b8e 100644
--- a/src/engine/thread.h
+++ b/src/engine/thread.h
@@ -45,7 +45,7 @@ namespace SDL
Thread &operator=(const Thread &);
- void Create(int (*)(void *), void *param = nullptr);
+ void Create(int (__cdecl *)(void *), void *param = nullptr);
int Wait();
@@ -88,7 +88,7 @@ namespace SDL
bool IsValid() const;
- void Run(u32, u32 (*)(u32, void *), void *param = nullptr);
+ void Run(u32, u32 (__cdecl*)(u32, void *), void *param = nullptr);
void Remove();
diff --git a/src/fheroes2/agg/agg.cpp b/src/fheroes2/agg/agg.cpp
index 208a9e4..69ff365 100644
--- a/src/fheroes2/agg/agg.cpp
+++ b/src/fheroes2/agg/agg.cpp
@@ -1608,7 +1608,7 @@ bool AGG::Init()
return true;
}
-void AGG::Quit()
+void __cdecl AGG::Quit()
{
for (auto &icns : icn_cache)
{
diff --git a/src/fheroes2/agg/agg.h b/src/fheroes2/agg/agg.h
index c3d05d3..be582dc 100644
--- a/src/fheroes2/agg/agg.h
+++ b/src/fheroes2/agg/agg.h
@@ -53,7 +53,7 @@ namespace AGG
{
bool Init();
- void Quit();
+ void __cdecl Quit();
int PutICN(const Sprite &, bool init_reflect = false);
diff --git a/src/fheroes2/army/army_troop.cpp b/src/fheroes2/army/army_troop.cpp
index fd58244..6065eb2 100644
--- a/src/fheroes2/army/army_troop.cpp
+++ b/src/fheroes2/army/army_troop.cpp
@@ -154,7 +154,7 @@ bool Troop::isBattle() const
return false;
}
-bool Troop::isModes(u32) const
+bool Troop::isModes(u32)
{
return false;
}
diff --git a/src/fheroes2/army/army_troop.h b/src/fheroes2/army/army_troop.h
index 6b198bb..fdb000f 100644
--- a/src/fheroes2/army/army_troop.h
+++ b/src/fheroes2/army/army_troop.h
@@ -75,7 +75,7 @@ class Troop : public Monster
virtual bool isBattle() const;
- bool isModes(u32) const;
+ static bool isModes(u32);
string GetAttackString() const;
diff --git a/src/fheroes2/gui/interface_status.cpp b/src/fheroes2/gui/interface_status.cpp
index 5173f32..eae175f 100644
--- a/src/fheroes2/gui/interface_status.cpp
+++ b/src/fheroes2/gui/interface_status.cpp
@@ -52,7 +52,7 @@ int Interface::StatusWindow::GetState() const
return state;
}
-u32 Interface::StatusWindow::ResetResourceStatus(u32 tick, void *ptr)
+u32 __cdecl Interface::StatusWindow::ResetResourceStatus(u32 tick, void *ptr)
{
if (!ptr)
return 0;
diff --git a/src/fheroes2/gui/interface_status.h b/src/fheroes2/gui/interface_status.h
index fcc80d8..756fc7f 100644
--- a/src/fheroes2/gui/interface_status.h
+++ b/src/fheroes2/gui/interface_status.h
@@ -83,7 +83,7 @@ namespace Interface
void DrawAITurns() const;
- static u32 ResetResourceStatus(u32, void *);
+ static u32 __cdecl ResetResourceStatus(u32, void *);
static u32 RedrawAIStatus(u32, void *);