summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/java_godot_view_wrapper.h2
-rw-r--r--platform/android/java_godot_wrapper.h2
-rw-r--r--platform/ios/export/export_plugin.cpp18
-rw-r--r--platform/ios/export/export_plugin.h1
-rw-r--r--platform/ios/os_ios.mm9
-rw-r--r--platform/windows/gl_manager_windows_native.cpp8
6 files changed, 30 insertions, 10 deletions
diff --git a/platform/android/java_godot_view_wrapper.h b/platform/android/java_godot_view_wrapper.h
index e5b04e4866..5f554aa2d6 100644
--- a/platform/android/java_godot_view_wrapper.h
+++ b/platform/android/java_godot_view_wrapper.h
@@ -38,7 +38,7 @@
#include <android/log.h>
#include <jni.h>
-// Class that makes functions in java/src/org/godotengine/godot/GodotView.java callable from C++
+// Class that makes functions in java/src/org/godotengine/godot/GodotRenderView.java callable from C++
class GodotJavaViewWrapper {
private:
jclass _cls;
diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h
index 7c6327c9e1..920df958c2 100644
--- a/platform/android/java_godot_wrapper.h
+++ b/platform/android/java_godot_wrapper.h
@@ -39,7 +39,7 @@
#include <android/log.h>
#include <jni.h>
-// Class that makes functions in java/src/org/godotengine/godot/Godot.java callable from C++
+// Class that makes functions in java/src/org/godotengine/godot/Godot.kt callable from C++
class GodotJavaWrapper {
private:
jobject godot_instance;
diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp
index 94984a74b6..c0e052865f 100644
--- a/platform/ios/export/export_plugin.cpp
+++ b/platform/ios/export/export_plugin.cpp
@@ -2071,6 +2071,22 @@ bool EditorExportPlatformIOS::is_package_name_valid(const String &p_package, Str
}
#ifdef MACOS_ENABLED
+bool EditorExportPlatformIOS::_check_xcode_install() {
+ static bool xcode_found = false;
+ if (!xcode_found) {
+ String xcode_path;
+ List<String> args;
+ args.push_back("-p");
+ int ec = 0;
+ Error err = OS::get_singleton()->execute("xcode-select", args, &xcode_path, &ec, true);
+ if (err != OK || ec != 0) {
+ return false;
+ }
+ xcode_found = DirAccess::dir_exists_absolute(xcode_path.strip_edges());
+ }
+ return xcode_found;
+}
+
void EditorExportPlatformIOS::_check_for_changes_poll_thread(void *ud) {
EditorExportPlatformIOS *ea = static_cast<EditorExportPlatformIOS *>(ud);
@@ -2138,7 +2154,7 @@ void EditorExportPlatformIOS::_check_for_changes_poll_thread(void *ud) {
}
// Enum simulators
- if (FileAccess::exists("/usr/bin/xcrun") || FileAccess::exists("/bin/xcrun")) {
+ if (_check_xcode_install() && (FileAccess::exists("/usr/bin/xcrun") || FileAccess::exists("/bin/xcrun"))) {
String devices;
List<String> args;
args.push_back("simctl");
diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h
index 27a4d73fcd..951017ddae 100644
--- a/platform/ios/export/export_plugin.h
+++ b/platform/ios/export/export_plugin.h
@@ -81,6 +81,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform {
Thread check_for_changes_thread;
SafeFlag quit_request;
+ static bool _check_xcode_install();
static void _check_for_changes_poll_thread(void *ud);
#endif
diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm
index 68e6d4c934..16ac3acbec 100644
--- a/platform/ios/os_ios.mm
+++ b/platform/ios/os_ios.mm
@@ -72,16 +72,15 @@ HashMap<String, void *> OS_IOS::dynamic_symbol_lookup_table;
void add_ios_init_callback(init_callback cb) {
if (ios_init_callbacks_count == ios_init_callbacks_capacity) {
- void *new_ptr = realloc(ios_init_callbacks, sizeof(cb) * 32);
+ void *new_ptr = realloc(ios_init_callbacks, sizeof(cb) * (ios_init_callbacks_capacity + 32));
if (new_ptr) {
ios_init_callbacks = (init_callback *)(new_ptr);
ios_init_callbacks_capacity += 32;
+ } else {
+ ERR_FAIL_MSG("Unable to allocate memory for extension callbacks.");
}
}
- if (ios_init_callbacks_capacity > ios_init_callbacks_count) {
- ios_init_callbacks[ios_init_callbacks_count] = cb;
- ++ios_init_callbacks_count;
- }
+ ios_init_callbacks[ios_init_callbacks_count++] = cb;
}
void register_dynamic_symbol(char *name, void *address) {
diff --git a/platform/windows/gl_manager_windows_native.cpp b/platform/windows/gl_manager_windows_native.cpp
index b350786d11..8af32395b7 100644
--- a/platform/windows/gl_manager_windows_native.cpp
+++ b/platform/windows/gl_manager_windows_native.cpp
@@ -104,8 +104,8 @@ static bool nvapi_err_check(const char *msg, int status) {
}
// On windows we have to disable threaded optimization when using NVIDIA graphics cards
-// to avoid stuttering, see https://github.com/microsoft/vscode-cpptools/issues/6592
-// also see https://github.com/Ryujinx/Ryujinx/blob/master/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs
+// to avoid stuttering, see https://stackoverflow.com/questions/36959508/nvidia-graphics-driver-causing-noticeable-frame-stuttering/37632948
+// also see https://github.com/Ryujinx/Ryujinx/blob/master/src/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs
void GLManagerNative_Windows::_nvapi_disable_threaded_optimization() {
HMODULE nvapi = 0;
#ifdef _WIN64
@@ -149,6 +149,10 @@ void GLManagerNative_Windows::_nvapi_disable_threaded_optimization() {
NvDRSSessionHandle session_handle;
+ if (NvAPI_DRS_CreateSession == nullptr) {
+ return;
+ }
+
if (!nvapi_err_check("NVAPI: Error creating DRS session", NvAPI_DRS_CreateSession(&session_handle))) {
NvAPI_Unload();
return;