From dbb9814420ae8732a10490edd08a69cee66a9439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sat, 5 Aug 2017 14:45:59 -0300 Subject: [PATCH] emscripten fixes. --HG-- branch : dev --- premake4.lua | 2 +- src/eepp/window/backend/SDL2/inputsdl2.cpp | 3 ++- src/eepp/window/backend/SDL2/windowsdl2.cpp | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/premake4.lua b/premake4.lua index 921c3c665..609a6fa05 100644 --- a/premake4.lua +++ b/premake4.lua @@ -442,7 +442,7 @@ function build_link_configuration( package_name, use_ee_icon ) configuration "emscripten" linkoptions{ "-O1 -s TOTAL_MEMORY=67108864 -s ASM_JS=1 -s VERBOSE=1 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_SDL=2" } - buildoptions { "-fno-strict-aliasing -O2 -ffast-math" } + buildoptions { "-fno-strict-aliasing -O2 -ffast-math -s USE_SDL=2" } if _OPTIONS["with-gles1"] and ( not _OPTIONS["with-gles2"] or _OPTIONS["force-gles1"] ) then linkoptions{ "-s LEGACY_GL_EMULATION=1" } diff --git a/src/eepp/window/backend/SDL2/inputsdl2.cpp b/src/eepp/window/backend/SDL2/inputsdl2.cpp index 700734a6a..da3f3051f 100644 --- a/src/eepp/window/backend/SDL2/inputsdl2.cpp +++ b/src/eepp/window/backend/SDL2/inputsdl2.cpp @@ -13,7 +13,8 @@ static Uint32 KeyCodesTable[ SDL_NUM_SCANCODES ]; static bool KeyCodesTableInit = false; InputSDL::InputSDL( EE::Window::Window * window ) : - Input( window, eeNew( JoystickManagerSDL, () ) ) + Input( window, eeNew( JoystickManagerSDL, () ) ), + mDPIScale(1.f) { #if defined( EE_X11_PLATFORM ) mMouseSpeed = 1.75f; diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 2882245f2..0eac8c444 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -130,9 +130,11 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { mWindow.Flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN; + #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN #if SDL_VERSION_ATLEAST(2,0,1) mWindow.Flags |= SDL_WINDOW_ALLOW_HIGHDPI; #endif + #endif if ( mWindow.WindowConfig.Style & WindowStyle::Resize ) { mWindow.Flags |= SDL_WINDOW_RESIZABLE;