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
|
|
@ -43,6 +43,10 @@
|
|||
#include "core/io/xml_parser.h"
|
||||
#include "drivers/unix/dir_access_unix.h"
|
||||
#include "drivers/unix/file_access_unix.h"
|
||||
#ifdef TOOLS_ENABLED
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/plugins/game_view_plugin.h"
|
||||
#endif
|
||||
#include "main/main.h"
|
||||
#include "scene/main/scene_tree.h"
|
||||
#include "servers/rendering_server.h"
|
||||
|
|
@ -168,7 +172,7 @@ bool OS_Android::copy_dynamic_library(const String &p_library_path, const String
|
|||
}
|
||||
|
||||
Ref<DirAccess> da_ref = DirAccess::create_for_path(p_library_path);
|
||||
if (!da_ref.is_valid()) {
|
||||
if (da_ref.is_null()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -331,6 +335,15 @@ void OS_Android::main_loop_begin() {
|
|||
if (main_loop) {
|
||||
main_loop->initialize();
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (Engine::get_singleton()->is_editor_hint()) {
|
||||
GameViewPlugin *game_view_plugin = Object::cast_to<GameViewPlugin>(EditorNode::get_singleton()->get_editor_main_screen()->get_plugin_by_name("Game"));
|
||||
if (game_view_plugin != nullptr) {
|
||||
game_view_plugin->connect("main_screen_changed", callable_mp_static(&OS_Android::_on_main_screen_changed));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool OS_Android::main_loop_iterate(bool *r_should_swap_buffers) {
|
||||
|
|
@ -353,6 +366,15 @@ bool OS_Android::main_loop_iterate(bool *r_should_swap_buffers) {
|
|||
}
|
||||
|
||||
void OS_Android::main_loop_end() {
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (Engine::get_singleton()->is_editor_hint()) {
|
||||
GameViewPlugin *game_view_plugin = Object::cast_to<GameViewPlugin>(EditorNode::get_singleton()->get_editor_main_screen()->get_plugin_by_name("Game"));
|
||||
if (game_view_plugin != nullptr) {
|
||||
game_view_plugin->disconnect("main_screen_changed", callable_mp_static(&OS_Android::_on_main_screen_changed));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (main_loop) {
|
||||
SceneTree *scene_tree = Object::cast_to<SceneTree>(main_loop);
|
||||
if (scene_tree) {
|
||||
|
|
@ -362,6 +384,14 @@ void OS_Android::main_loop_end() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
void OS_Android::_on_main_screen_changed(const String &p_screen_name) {
|
||||
if (OS_Android::get_singleton() != nullptr && OS_Android::get_singleton()->get_godot_java() != nullptr) {
|
||||
OS_Android::get_singleton()->get_godot_java()->on_editor_workspace_selected(p_screen_name);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void OS_Android::main_loop_focusout() {
|
||||
DisplayServerAndroid::get_singleton()->send_window_event(DisplayServer::WINDOW_EVENT_FOCUS_OUT);
|
||||
if (OS::get_singleton()->get_main_loop()) {
|
||||
|
|
@ -413,10 +443,10 @@ String OS_Android::get_model_name() const {
|
|||
}
|
||||
|
||||
String OS_Android::get_data_path() const {
|
||||
return get_user_data_dir();
|
||||
return OS::get_user_data_dir();
|
||||
}
|
||||
|
||||
void OS_Android::_load_system_font_config() {
|
||||
void OS_Android::_load_system_font_config() const {
|
||||
font_aliases.clear();
|
||||
fonts.clear();
|
||||
font_names.clear();
|
||||
|
|
@ -541,7 +571,7 @@ void OS_Android::_load_system_font_config() {
|
|||
|
||||
Vector<String> OS_Android::get_system_fonts() const {
|
||||
if (!font_config_loaded) {
|
||||
const_cast<OS_Android *>(this)->_load_system_font_config();
|
||||
_load_system_font_config();
|
||||
}
|
||||
Vector<String> ret;
|
||||
for (const String &E : font_names) {
|
||||
|
|
@ -552,7 +582,7 @@ Vector<String> OS_Android::get_system_fonts() const {
|
|||
|
||||
Vector<String> OS_Android::get_system_font_path_for_text(const String &p_font_name, const String &p_text, const String &p_locale, const String &p_script, int p_weight, int p_stretch, bool p_italic) const {
|
||||
if (!font_config_loaded) {
|
||||
const_cast<OS_Android *>(this)->_load_system_font_config();
|
||||
_load_system_font_config();
|
||||
}
|
||||
String font_name = p_font_name.to_lower();
|
||||
if (font_aliases.has(font_name)) {
|
||||
|
|
@ -604,7 +634,7 @@ Vector<String> OS_Android::get_system_font_path_for_text(const String &p_font_na
|
|||
|
||||
String OS_Android::get_system_font_path(const String &p_font_name, int p_weight, int p_stretch, bool p_italic) const {
|
||||
if (!font_config_loaded) {
|
||||
const_cast<OS_Android *>(this)->_load_system_font_config();
|
||||
_load_system_font_config();
|
||||
}
|
||||
String font_name = p_font_name.to_lower();
|
||||
if (font_aliases.has(font_name)) {
|
||||
|
|
@ -647,12 +677,12 @@ String OS_Android::get_executable_path() const {
|
|||
return OS::get_executable_path();
|
||||
}
|
||||
|
||||
String OS_Android::get_user_data_dir() const {
|
||||
String OS_Android::get_user_data_dir(const String &p_user_dir) const {
|
||||
if (!data_dir_cache.is_empty()) {
|
||||
return data_dir_cache;
|
||||
}
|
||||
|
||||
String data_dir = godot_io_java->get_user_data_dir();
|
||||
String data_dir = godot_io_java->get_user_data_dir(p_user_dir);
|
||||
if (!data_dir.is_empty()) {
|
||||
data_dir_cache = _remove_symlink(data_dir);
|
||||
return data_dir_cache;
|
||||
|
|
@ -677,6 +707,19 @@ String OS_Android::get_cache_path() const {
|
|||
return ".";
|
||||
}
|
||||
|
||||
String OS_Android::get_temp_path() const {
|
||||
if (!temp_dir_cache.is_empty()) {
|
||||
return temp_dir_cache;
|
||||
}
|
||||
|
||||
String temp_dir = godot_io_java->get_temp_dir();
|
||||
if (!temp_dir.is_empty()) {
|
||||
temp_dir_cache = _remove_symlink(temp_dir);
|
||||
return temp_dir_cache;
|
||||
}
|
||||
return ".";
|
||||
}
|
||||
|
||||
String OS_Android::get_unique_id() const {
|
||||
String unique_id = godot_io_java->get_unique_id();
|
||||
if (!unique_id.is_empty()) {
|
||||
|
|
@ -751,7 +794,7 @@ void OS_Android::vibrate_handheld(int p_duration_ms, float p_amplitude) {
|
|||
}
|
||||
|
||||
String OS_Android::get_config_path() const {
|
||||
return get_user_data_dir().path_join("config");
|
||||
return OS::get_user_data_dir().path_join("config");
|
||||
}
|
||||
|
||||
void OS_Android::benchmark_begin_measure(const String &p_context, const String &p_what) {
|
||||
|
|
@ -775,6 +818,16 @@ void OS_Android::benchmark_dump() {
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
Error OS_Android::sign_apk(const String &p_input_path, const String &p_output_path, const String &p_keystore_path, const String &p_keystore_user, const String &p_keystore_password) {
|
||||
return godot_java->sign_apk(p_input_path, p_output_path, p_keystore_path, p_keystore_user, p_keystore_password);
|
||||
}
|
||||
|
||||
Error OS_Android::verify_apk(const String &p_apk_path) {
|
||||
return godot_java->verify_apk(p_apk_path);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool OS_Android::_check_internal_feature_support(const String &p_feature) {
|
||||
if (p_feature == "macos" || p_feature == "web_ios" || p_feature == "web_macos" || p_feature == "windows") {
|
||||
return false;
|
||||
|
|
@ -853,6 +906,9 @@ Error OS_Android::create_process(const String &p_path, const List<String> &p_arg
|
|||
|
||||
Error OS_Android::create_instance(const List<String> &p_arguments, ProcessID *r_child_id) {
|
||||
int instance_id = godot_java->create_new_godot_instance(p_arguments);
|
||||
if (instance_id == -1) {
|
||||
return FAILED;
|
||||
}
|
||||
if (r_child_id) {
|
||||
*r_child_id = instance_id;
|
||||
}
|
||||
|
|
@ -871,7 +927,7 @@ String OS_Android::get_system_ca_certificates() {
|
|||
}
|
||||
|
||||
Error OS_Android::setup_remote_filesystem(const String &p_server_host, int p_port, const String &p_password, String &r_project_path) {
|
||||
r_project_path = get_user_data_dir();
|
||||
r_project_path = OS::get_user_data_dir();
|
||||
Error err = OS_Unix::setup_remote_filesystem(p_server_host, p_port, p_password, r_project_path);
|
||||
if (err == OK) {
|
||||
remote_fs_dir = r_project_path;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue