diff options
Diffstat (limited to 'platform/uwp')
-rw-r--r-- | platform/uwp/detect.py | 14 | ||||
-rw-r--r-- | platform/uwp/export/export.cpp | 18 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 6 | ||||
-rw-r--r-- | platform/uwp/os_uwp.h | 3 |
4 files changed, 21 insertions, 20 deletions
diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index 00f419f4f0..7da93eafae 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -60,13 +60,13 @@ def configure(env): elif (env["target"] == "release_debug"): env.Append(CCFLAGS=['/O2', '/Zi']) env.Append(CCFLAGS=['/MD']) - env.Append(CPPFLAGS=['/DDEBUG_ENABLED']) + env.Append(CPPDEFINES=['DEBUG_ENABLED']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) elif (env["target"] == "debug"): env.Append(CCFLAGS=['/Zi']) env.Append(CCFLAGS=['/MDd']) - env.Append(CPPFLAGS=['/DDEBUG_ENABLED', '/DDEBUG_MEMORY_ENABLED']) + env.Append(CPPDEFINES=['DEBUG_ENABLED', 'DEBUG_MEMORY_ENABLED']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) env.Append(LINKFLAGS=['/DEBUG']) @@ -138,18 +138,18 @@ def configure(env): ## Compile flags env.Prepend(CPPPATH=['#platform/uwp', '#drivers/windows']) - env.Append(CPPFLAGS=['/DUWP_ENABLED', '/DWINDOWS_ENABLED', '/DTYPED_METHOD_BIND']) - env.Append(CPPFLAGS=['/DGLES_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED']) + env.Append(CPPDEFINES=['UWP_ENABLED', 'WINDOWS_ENABLED', 'TYPED_METHOD_BIND']) + env.Append(CPPDEFINES=['GLES_ENABLED', 'GL_GLEXT_PROTOTYPES', 'EGL_EGLEXT_PROTOTYPES', 'ANGLE_ENABLED']) winver = "0x0602" # Windows 8 is the minimum target for UWP build - env.Append(CPPFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver]) + env.Append(CPPDEFINES=[('WINVER', winver), ('_WIN32_WINNT', winver), 'WIN32']) - env.Append(CPPFLAGS=['/D__WRL_NO_DEFAULT_LIB__', '/DWIN32', '/DPNG_ABORT=abort']) + env.Append(CPPDEFINES=['__WRL_NO_DEFAULT_LIB__', ('PNG_ABORT', 'abort')]) env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/store/references']) env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/x86/store/references']) env.Append(CCFLAGS='/FS /MP /GS /wd"4453" /wd"28204" /wd"4291" /Zc:wchar_t /Gm- /fp:precise /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo'.split()) - env.Append(CPPFLAGS=['/D_UNICODE', '/DUNICODE', '/D "WINAPI_FAMILY=WINAPI_FAMILY_APP"']) + env.Append(CPPDEFINES=['_UNICODE', 'UNICODE', ('WINAPI_FAMILY', 'WINAPI_FAMILY_APP')]) env.Append(CXXFLAGS=['/ZW']) env.Append(CCFLAGS=['/AI', vc_base_path + '\\vcpackages', '/AI', os.environ['WINDOWSSDKDIR'] + '\\References\\CommonConfiguration\\Neutral']) diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index cdcad33f6d..abb7b391d3 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -32,6 +32,7 @@ #include "core/bind/core_bind.h" #include "core/io/marshalls.h" #include "core/io/zip_io.h" +#include "core/math/crypto_core.h" #include "core/object.h" #include "core/os/file_access.h" #include "core/project_settings.h" @@ -42,8 +43,6 @@ #include "thirdparty/minizip/unzip.h" #include "thirdparty/minizip/zip.h" -#include "thirdparty/misc/base64.h" -#include "thirdparty/misc/sha256.h" #include <zlib.h> @@ -198,15 +197,12 @@ public: String AppxPackager::hash_block(const uint8_t *p_block_data, size_t p_block_len) { - char hash[32]; + unsigned char hash[32]; char base64[45]; - sha256_context ctx; - sha256_init(&ctx); - sha256_hash(&ctx, (uint8_t *)p_block_data, p_block_len); - sha256_done(&ctx, (uint8_t *)hash); - - base64_encode(base64, hash, 32); + CryptoCore::sha256(p_block_data, p_block_len, hash); + size_t len = 0; + CryptoCore::b64_encode((unsigned char *)base64, 45, &len, (unsigned char *)hash, 32); base64[44] = '\0'; return String(base64); @@ -241,7 +237,6 @@ void AppxPackager::make_block_map() { tmp_file->close(); memdelete(tmp_file); - tmp_file = NULL; } String AppxPackager::content_type(String p_extension) { @@ -291,7 +286,6 @@ void AppxPackager::make_content_types() { tmp_file->close(); memdelete(tmp_file); - tmp_file = NULL; } Vector<uint8_t> AppxPackager::make_file_header(FileMeta p_file_meta) { @@ -606,7 +600,6 @@ void AppxPackager::finish() { blockmap_file->close(); memdelete(blockmap_file); - blockmap_file = NULL; // Add content types EditorNode::progress_task_step("export", "Setting content types...", 5); @@ -622,7 +615,6 @@ void AppxPackager::finish() { types_file->close(); memdelete(types_file); - types_file = NULL; // Pre-process central directory before signing for (int i = 0; i < file_metadata.size(); i++) { diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index f9d22481dd..9d9be44ce5 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -302,6 +302,10 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a } visual_server->init(); + + ///@TODO implement a subclass for UWP and instantiate that instead + camera_server = memnew(CameraServer); + input = memnew(InputDefault); joypad = ref new JoypadUWP(input); @@ -400,6 +404,8 @@ void OS_UWP::finalize() { memdelete(input); + memdelete(camera_server); + joypad = nullptr; } diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 1bb68bc75d..b7a7248f19 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -41,6 +41,7 @@ #include "main/input_default.h" #include "power_uwp.h" #include "servers/audio_server.h" +#include "servers/camera_server.h" #include "servers/visual/rasterizer.h" #include "servers/visual_server.h" @@ -95,6 +96,8 @@ private: VisualServer *visual_server; int pressrc; + CameraServer *camera_server; + ContextEGL_UWP *gl_context; Windows::UI::Core::CoreWindow ^ window; |