feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -31,7 +31,6 @@
|
|||
#include "os.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/input/input.h"
|
||||
#include "core/io/dir_access.h"
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/io/json.h"
|
||||
|
|
@ -223,6 +222,23 @@ uint64_t OS::get_embedded_pck_offset() const {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Default boot screen rect scale mode is "Keep Aspect Centered"
|
||||
Rect2 OS::calculate_boot_screen_rect(const Size2 &p_window_size, const Size2 &p_imgrect_size) const {
|
||||
Rect2 screenrect;
|
||||
if (p_window_size.width > p_window_size.height) {
|
||||
// Scale horizontally.
|
||||
screenrect.size.y = p_window_size.height;
|
||||
screenrect.size.x = p_imgrect_size.x * p_window_size.height / p_imgrect_size.y;
|
||||
screenrect.position.x = (p_window_size.width - screenrect.size.x) / 2;
|
||||
} else {
|
||||
// Scale vertically.
|
||||
screenrect.size.x = p_window_size.width;
|
||||
screenrect.size.y = p_imgrect_size.y * p_window_size.width / p_imgrect_size.x;
|
||||
screenrect.position.y = (p_window_size.height - screenrect.size.y) / 2;
|
||||
}
|
||||
return screenrect;
|
||||
}
|
||||
|
||||
// Helper function to ensure that a dir name/path will be valid on the OS
|
||||
String OS::get_safe_dir_name(const String &p_dir_name, bool p_allow_paths) const {
|
||||
String safe_dir_name = p_dir_name;
|
||||
|
|
@ -276,6 +292,10 @@ String OS::get_cache_path() const {
|
|||
return ".";
|
||||
}
|
||||
|
||||
String OS::get_temp_path() const {
|
||||
return ".";
|
||||
}
|
||||
|
||||
// Path to macOS .app bundle resources
|
||||
String OS::get_bundle_resource_dir() const {
|
||||
return ".";
|
||||
|
|
@ -287,10 +307,28 @@ String OS::get_bundle_icon_path() const {
|
|||
}
|
||||
|
||||
// OS specific path for user://
|
||||
String OS::get_user_data_dir() const {
|
||||
String OS::get_user_data_dir(const String &p_user_dir) const {
|
||||
return ".";
|
||||
}
|
||||
|
||||
String OS::get_user_data_dir() const {
|
||||
String appname = get_safe_dir_name(GLOBAL_GET("application/config/name"));
|
||||
if (!appname.is_empty()) {
|
||||
bool use_custom_dir = GLOBAL_GET("application/config/use_custom_user_dir");
|
||||
if (use_custom_dir) {
|
||||
String custom_dir = get_safe_dir_name(GLOBAL_GET("application/config/custom_user_dir_name"), true);
|
||||
if (custom_dir.is_empty()) {
|
||||
custom_dir = appname;
|
||||
}
|
||||
return get_user_data_dir(custom_dir);
|
||||
} else {
|
||||
return get_user_data_dir(get_godot_dir_name().path_join("app_userdata").path_join(appname));
|
||||
}
|
||||
} else {
|
||||
return get_user_data_dir(get_godot_dir_name().path_join("app_userdata").path_join("[unnamed project]"));
|
||||
}
|
||||
}
|
||||
|
||||
// Absolute path to res://
|
||||
String OS::get_resource_dir() const {
|
||||
return ProjectSettings::get_singleton()->get_resource_path();
|
||||
|
|
@ -301,6 +339,23 @@ String OS::get_system_dir(SystemDir p_dir, bool p_shared_storage) const {
|
|||
return ".";
|
||||
}
|
||||
|
||||
void OS::create_lock_file() {
|
||||
if (Engine::get_singleton()->is_recovery_mode_hint()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String lock_file_path = get_user_data_dir().path_join(".recovery_mode_lock");
|
||||
Ref<FileAccess> lock_file = FileAccess::open(lock_file_path, FileAccess::WRITE);
|
||||
if (lock_file.is_valid()) {
|
||||
lock_file->close();
|
||||
}
|
||||
}
|
||||
|
||||
void OS::remove_lock_file() {
|
||||
String lock_file_path = get_user_data_dir().path_join(".recovery_mode_lock");
|
||||
DirAccess::remove_absolute(lock_file_path);
|
||||
}
|
||||
|
||||
Error OS::shell_open(const String &p_uri) {
|
||||
return ERR_UNAVAILABLE;
|
||||
}
|
||||
|
|
@ -352,7 +407,7 @@ void OS::ensure_user_data_dir() {
|
|||
|
||||
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||
Error err = da->make_dir_recursive(dd);
|
||||
ERR_FAIL_COND_MSG(err != OK, "Error attempting to create data dir: " + dd + ".");
|
||||
ERR_FAIL_COND_MSG(err != OK, vformat("Error attempting to create data dir: %s.", dd));
|
||||
}
|
||||
|
||||
String OS::get_model_name() const {
|
||||
|
|
@ -405,6 +460,8 @@ bool OS::has_feature(const String &p_feature) {
|
|||
return _in_editor;
|
||||
} else if (p_feature == "editor_runtime") {
|
||||
return !_in_editor;
|
||||
} else if (p_feature == "embedded_in_editor") {
|
||||
return _embedded_in_editor;
|
||||
}
|
||||
#else
|
||||
if (p_feature == "template") {
|
||||
|
|
@ -439,6 +496,11 @@ bool OS::has_feature(const String &p_feature) {
|
|||
}
|
||||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64)
|
||||
#if defined(__x86_64) || defined(__x86_64__) || defined(__amd64__) || defined(_M_X64)
|
||||
#if defined(MACOS_ENABLED)
|
||||
if (p_feature == "universal") {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
if (p_feature == "x86_64") {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -452,6 +514,11 @@ bool OS::has_feature(const String &p_feature) {
|
|||
}
|
||||
#elif defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64)
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#if defined(MACOS_ENABLED)
|
||||
if (p_feature == "universal") {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
if (p_feature == "arm64") {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -504,6 +571,10 @@ bool OS::has_feature(const String &p_feature) {
|
|||
if (p_feature == "wasm") {
|
||||
return true;
|
||||
}
|
||||
#elif defined(__loongarch64)
|
||||
if (p_feature == "loongarch64") {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(IOS_SIMULATOR)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue