summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp2
-rw-r--r--core/io/marshalls.cpp12
-rw-r--r--core/os/os.cpp6
-rw-r--r--core/os/os.h1
-rw-r--r--core/project_settings.cpp10
5 files changed, 29 insertions, 2 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 0eacffeb88..4586dc6d14 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -1393,7 +1393,7 @@ void _OS::_bind_methods() {
ADD_PROPERTY_DEFAULT("current_screen", 0);
ADD_PROPERTY_DEFAULT("exit_code", 0);
ADD_PROPERTY_DEFAULT("vsync_enabled", true);
- ADD_PROPERTY_DEFAULT("vsync_via_compositor", false);
+ ADD_PROPERTY_DEFAULT("vsync_via_compositor", true);
ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false);
ADD_PROPERTY_DEFAULT("low_processor_usage_mode_sleep_usec", 6900);
ADD_PROPERTY_DEFAULT("keep_screen_on", true);
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 8c8f65c3a0..e847a9cf0c 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -803,6 +803,18 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
}
} break;
case Variant::OBJECT: {
+#ifdef DEBUG_ENABLED
+ // Test for potential wrong values sent by the debugger when it breaks.
+ Object *obj = p_variant;
+ if (!obj || !ObjectDB::instance_validate(obj)) {
+ // Object is invalid, send a NULL instead.
+ if (buf) {
+ encode_uint32(Variant::NIL, buf);
+ }
+ r_len += 4;
+ return OK;
+ }
+#endif // DEBUG_ENABLED
if (!p_full_objects) {
flags |= ENCODE_FLAG_OBJECT_AS_ID;
}
diff --git a/core/os/os.cpp b/core/os/os.cpp
index edb2416b67..81dea159a6 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -343,6 +343,12 @@ String OS::get_cache_path() const {
return ".";
}
+// Path to macOS .app bundle resources
+String OS::get_bundle_resource_dir() const {
+
+ return ".";
+};
+
// OS specific path for user://
String OS::get_user_data_dir() const {
diff --git a/core/os/os.h b/core/os/os.h
index 593ea2b645..714c4e3f09 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -411,6 +411,7 @@ public:
virtual String get_data_path() const;
virtual String get_config_path() const;
virtual String get_cache_path() const;
+ virtual String get_bundle_resource_dir() const;
virtual String get_user_data_dir() const;
virtual String get_resource_dir() const;
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index a30967dcca..a01a8a35c6 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -383,8 +383,16 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b
}
}
- // Attempt with PCK bundled into executable
+#ifdef OSX_ENABLED
+ // Attempt to load PCK from macOS .app bundle resources
+ if (!found) {
+ if (_load_resource_pack(OS::get_singleton()->get_bundle_resource_dir().plus_file(exec_basename + ".pck"))) {
+ found = true;
+ }
+ }
+#endif
+ // Attempt with PCK bundled into executable
if (!found) {
if (_load_resource_pack(exec_path)) {
found = true;