diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-01-10 18:38:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 18:38:33 +0100 |
commit | 4b3123104cb766a11a9cb93afb08af118712f012 (patch) | |
tree | b40bbf484fe9d3b28577e3708f79043681128bb5 /core | |
parent | 140a31728f7e90c9bd1769fe9b35e14bcad6b4d3 (diff) | |
parent | d07cdc594f0d0c0cf56896b6b8d98697871462eb (diff) |
Merge pull request #34995 from bruvzg/macos_use_bundle_res_path
[macOS] Fix loading PCK from the .app bundle resources.
Diffstat (limited to 'core')
-rw-r--r-- | core/os/os.cpp | 6 | ||||
-rw-r--r-- | core/os/os.h | 1 | ||||
-rw-r--r-- | core/project_settings.cpp | 10 |
3 files changed, 16 insertions, 1 deletions
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; |