1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-03 18:14:01 +00:00

Some fixes for msys2/mingw build

This commit is contained in:
fgenesis 2017-09-02 22:13:46 +02:00
parent 4cfeadeb6e
commit 64406419c1
4 changed files with 14 additions and 9 deletions

View file

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "DSQ.h"
#include <fstream>
#include <SDL.h>
#include <SDL_main.h>
#ifdef BBGE_BUILD_WINDOWS
#define WIN32_LEAN_AND_MEAN

View file

@ -61,18 +61,21 @@ void initIcon(void *screen)
HINSTANCE handle = ::GetModuleHandle(NULL);
if(!icon_windows)
icon_windows = ::LoadIcon(handle, "icon");
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version)
if(icon_windows)
{
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version)
#ifdef BBGE_BUILD_SDL2
SDL_GetWindowWMInfo((SDL_Window*)screen, &wminfo);
HWND hwnd = wminfo.info.win.window;
SDL_GetWindowWMInfo((SDL_Window*)screen, &wminfo);
HWND hwnd = wminfo.info.win.window;
#else
SDL_GetWMInfo(&wminfo);
HWND hwnd = wminfo.window;
SDL_GetWMInfo(&wminfo);
HWND hwnd = wminfo.window;
#endif
::SetClassLongPtr(hwnd, -14, (LONG) icon_windows); // -14 is GCL_HICON (32bit) or GCLP_HICON (64bit)
::SetClassLongPtr(hwnd, -14, (LONG)(uintptr_t)icon_windows); // -14 is GCL_HICON (32bit) or GCLP_HICON (64bit)
}
#endif
}

View file

@ -260,7 +260,7 @@ public:
bool cull;
float updateCull;
unsigned layer;
int layer;
InterpolatedVector *positionSnapTo;

View file

@ -375,7 +375,8 @@ IF(CMAKE_COMPILER_IS_GNUCC)
# It doesn't seem to work well, and it adds bulk to the binary.
CHECK_C_COMPILER_FLAG("-fno-stack-protector" AQUARIA_GCC_HAS_STACKPROT)
IF(AQUARIA_GCC_HAS_STACKPROT)
ADD_DEFINITIONS(-fno-stack-protector)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-stack-protector")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fno-stack-protector")
ENDIF(AQUARIA_GCC_HAS_STACKPROT)
# -O3 breaks on some GCC/MinGW versions, make sure CMake does not set this as default.