diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/iphone/export/export.cpp | 6 | ||||
-rw-r--r-- | platform/iphone/os_iphone.cpp | 4 | ||||
-rw-r--r-- | platform/iphone/os_iphone.h | 2 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 2 | ||||
-rw-r--r-- | platform/uwp/logo.png | bin | 1882 -> 1519 bytes | |||
-rw-r--r-- | platform/windows/os_windows.cpp | 39 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 2 |
7 files changed, 42 insertions, 13 deletions
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 8ab1cbc435..b05bb9ab09 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -37,7 +37,7 @@ #include "io/zip_io.h" #include "os/file_access.h" #include "os/os.h" -#include "platform/osx/logo.gen.h" +#include "platform/iphone/logo.gen.h" #include "project_settings.h" #include "string.h" #include "version.h" @@ -977,9 +977,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset EditorExportPlatformIOS::EditorExportPlatformIOS() { - ///@TODO need to create the correct logo - // Ref<Image> img = memnew(Image(_iphone_logo)); - Ref<Image> img = memnew(Image(_osx_logo)); + Ref<Image> img = memnew(Image(_iphone_logo)); logo.instance(); logo->create_from_image(img); } diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index fbe3bd310d..f06657cd7b 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -394,12 +394,12 @@ void OSIPhone::alert(const String &p_alert, const String &p_title) { iOS::alert(utf8_alert.get_data(), utf8_title.get_data()); } -Error OSIPhone::open_dynamic_library(const String p_path, void *&p_library_handle) { +Error OSIPhone::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { if (p_path.length() == 0) { p_library_handle = RTLD_SELF; return OK; } - return OS_Unix::open_dynamic_library(p_path, p_library_handle); + return OS_Unix::open_dynamic_library(p_path, p_library_handle, p_also_set_library_path); } Error OSIPhone::close_dynamic_library(void *p_library_handle) { diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 1ef673765a..3f989b49be 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -155,7 +155,7 @@ public: virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); - virtual Error open_dynamic_library(const String p_path, void *&p_library_handle); + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false); virtual Error close_dynamic_library(void *p_library_handle); virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 781e8de1ab..732ec910c0 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1483,7 +1483,7 @@ void OS_OSX::make_rendering_thread() { Error OS_OSX::shell_open(String p_uri) { - [[NSWorkspace sharedWorkspace] openURL:[[NSURL alloc] initWithString:[NSString stringWithUTF8String:p_uri.utf8().get_data()]]]; + [[NSWorkspace sharedWorkspace] openURL:[[NSURL alloc] initWithString:[[NSString stringWithUTF8String:p_uri.utf8().get_data()] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]]]; return OK; } diff --git a/platform/uwp/logo.png b/platform/uwp/logo.png Binary files differindex 4376abd563..9017a30636 100644 --- a/platform/uwp/logo.png +++ b/platform/uwp/logo.png diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 7c1f733974..9bcbb6ddb6 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -69,8 +69,26 @@ __attribute__((visibility("default"))) DWORD NvOptimusEnablement = 0x00000001; #define WM_TOUCH 576 #endif +static String format_error_message(DWORD id) { + + LPWSTR messageBuffer = NULL; + size_t size = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&messageBuffer, 0, NULL); + + String msg = "Error "+itos(id)+": "+String(messageBuffer,size); + + LocalFree(messageBuffer); + + return msg; + +} + + + extern HINSTANCE godot_hinstance; + + void RedirectIOToConsole() { int hConHandle; @@ -1588,10 +1606,23 @@ void OS_Windows::_update_window_style(bool repaint) { } } -Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle) { - p_library_handle = (void *)LoadLibrary(p_path.utf8().get_data()); +Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { + + + DLL_DIRECTORY_COOKIE cookie; + + if (p_also_set_library_path) { + cookie = AddDllDirectory(p_path.get_base_dir().c_str()); + } + + p_library_handle = (void *)LoadLibraryExW(p_path.c_str(), NULL, p_also_set_library_path ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0); + + if (p_also_set_library_path) { + RemoveDllDirectory(cookie); + } + if (!p_library_handle) { - ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + String::num(GetLastError())); + ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + format_error_message(GetLastError())); ERR_FAIL_V(ERR_CANT_OPEN); } return OK; @@ -1954,7 +1985,7 @@ void OS_Windows::set_icon(const Ref<Image> &p_icon) { bool OS_Windows::has_environment(const String &p_var) const { - return getenv(p_var.utf8().get_data()) != NULL; + return _wgetenv(p_var.c_str()) != NULL; }; String OS_Windows::get_environment(const String &p_var) const { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 4367297262..e98f8277df 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -212,7 +212,7 @@ public: virtual void set_borderless_window(int p_borderless); virtual bool get_borderless_window(); - virtual Error open_dynamic_library(const String p_path, void *&p_library_handle); + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle,bool p_also_set_library_path=false); virtual Error close_dynamic_library(void *p_library_handle); virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false); |