Skip to content

Commit

Permalink
Fixes for newest release
Browse files Browse the repository at this point in the history
  • Loading branch information
ciplogic committed Feb 10, 2018
1 parent 55490de commit 5c1d133
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 18 deletions.
6 changes: 5 additions & 1 deletion VisualStudio/FHeroes2Enh/FHeroes2Enh.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@
<OmitFramePointers>true</OmitFramePointers>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<SmallerTypeCheck>false</SmallerTypeCheck>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<StringPooling>true</StringPooling>
<FloatingPointExceptions>false</FloatingPointExceptions>
<LanguageStandard>stdcpp14</LanguageStandard>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<CallingConvention>FastCall</CallingConvention>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
Binary file modified src/Installer/Installer/fh2enh.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions src/engine/IMG_savepng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/engine/IMG_savepng.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/engine/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bool SDL::Init(u32 system)
return true;
}

void SDL::Quit()
void __cdecl SDL::Quit()
{
System::CreateTrayIcon(false);
System::PowerManagerOff(false);
Expand Down
2 changes: 1 addition & 1 deletion src/engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace SDL
{
bool Init(u32 system = INIT_VIDEO);

void Quit();
void __cdecl Quit();

bool SubSystem(u32 system);
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/localevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/engine/localevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/engine/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/engine/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/agg/agg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ bool AGG::Init()
return true;
}

void AGG::Quit()
void __cdecl AGG::Quit()
{
for (auto &icns : icn_cache)
{
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/agg/agg.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace AGG
{
bool Init();

void Quit();
void __cdecl Quit();

int PutICN(const Sprite &, bool init_reflect = false);

Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/army/army_troop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ bool Troop::isBattle() const
return false;
}

bool Troop::isModes(u32) const
bool Troop::isModes(u32)
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/army/army_troop.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Troop : public Monster

virtual bool isBattle() const;

bool isModes(u32) const;
static bool isModes(u32);

string GetAttackString() const;

Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/gui/interface_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/gui/interface_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);

Expand Down

0 comments on commit 5c1d133

Please sign in to comment.