From 0c0c911ae86df3602139976f65e49c1f7446a05c Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 22 Jul 2019 23:14:51 +0200 Subject: [PATCH 01/68] Display version information in the editor at all times This closes #27811. (cherry picked from commit dee9e9dc629556c858e8f2b9b17c10db9876c5c2) --- editor/editor_node.cpp | 7 +++++++ editor/editor_node.h | 1 + 2 files changed, 8 insertions(+) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8cbbcee4cbe..fef967508df 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5789,6 +5789,13 @@ EditorNode::EditorNode() { bottom_panel_hb_editors = memnew(HBoxContainer); bottom_panel_hb_editors->set_h_size_flags(Control::SIZE_EXPAND_FILL); bottom_panel_hb->add_child(bottom_panel_hb_editors); + + version_label = memnew(Label); + version_label->set_text(VERSION_FULL_CONFIG); + // Fade out the version label to be less prominent, but still readable + version_label->set_self_modulate(Color(1, 1, 1, 0.6)); + bottom_panel_hb->add_child(version_label); + bottom_panel_raise = memnew(ToolButton); bottom_panel_raise->set_icon(gui_base->get_icon("ExpandBottomDock", "EditorIcons")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 267c70c7737..e853703cab2 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -399,6 +399,7 @@ private: HBoxContainer *bottom_panel_hb; HBoxContainer *bottom_panel_hb_editors; VBoxContainer *bottom_panel_vb; + Label *version_label; ToolButton *bottom_panel_raise; void _bottom_panel_raise_toggled(bool); From 7ef78e87c1b4160aa55d943745dc999fdca5a5ff Mon Sep 17 00:00:00 2001 From: Kanabenki <18357657+Kanabenki@users.noreply.github.com> Date: Tue, 1 Oct 2019 11:44:26 +0200 Subject: [PATCH 02/68] Fix casting to uint64_t when returning unix system time (cherry picked from commit add91724e694dd4e5d26e232d925fcbe12a5ad37) --- drivers/unix/os_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 2778590658e..367636fad60 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -206,7 +206,7 @@ uint64_t OS_Unix::get_system_time_secs() const { uint64_t OS_Unix::get_system_time_msecs() const { struct timeval tv_now; gettimeofday(&tv_now, NULL); - return uint64_t(tv_now.tv_sec * 1000 + tv_now.tv_usec / 1000); + return uint64_t(tv_now.tv_sec) * 1000 + uint64_t(tv_now.tv_usec) / 1000; } OS::Date OS_Unix::get_date(bool utc) const { From 5967c6347dfff3af8ce3990cc3f3d884ab28858f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 27 Sep 2019 13:35:33 +0200 Subject: [PATCH 03/68] Travis: Make scons cache branch-specific (cherry picked from commit a99b7a5f886a0462c79c321dcccf6c589f9d140d) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 727567b8e7b..a4705ae54aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ sudo: false env: global: - - SCONS_CACHE=$HOME/.scons_cache + - SCONS_CACHE=$HOME/.scons_cache/$TRAVIS_BRANCH - SCONS_CACHE_LIMIT=1024 - OPTIONS="debug_symbols=no verbose=yes progress=no" - secure: "uch9QszCgsl1qVbuzY41P7S2hWL2IiNFV4SbAYRCdi0oJ9MIu+pVyrQdpf3+jG4rH6j4Rffl+sN17Zz4dIDDioFL1JwqyCqyCyswR8uACC0Rr8gr4Mi3+HIRbv+2s2P4cIQq41JM8FJe84k9jLEMGCGh69w+ibCWoWs74CokYVA=" From e46f2be4d7170ddd04364ae2d6a735b27e14a416 Mon Sep 17 00:00:00 2001 From: sheepandshepherd Date: Sun, 6 Oct 2019 04:53:08 +0200 Subject: [PATCH 04/68] Document GDNativeLibrary (cherry picked from commit 04dbcd7f5a9d84562b79ad123f7e3722f7bf2c57) --- modules/gdnative/doc_classes/GDNativeLibrary.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/gdnative/doc_classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml index 28bdf8107ed..e67e31afb04 100644 --- a/modules/gdnative/doc_classes/GDNativeLibrary.xml +++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml @@ -1,35 +1,50 @@ + An external library containing functions or script classes to use in Godot. + A GDNative library can implement [NativeScript]s, global functions to call with the [GDNative] class, or low-level engine extensions through interfaces such as [ARVRInterfaceGDNative]. The library must be compiled for each platform and architecture that the project will run on. + https://docs.godotengine.org/en/latest/tutorials/plugins/gdnative/gdnative-c-example.html + https://docs.godotengine.org/en/latest/tutorials/plugins/gdnative/gdnative-cpp-example.html + Returns paths to all dependency libraries for the current platform and architecture. + Returns the path to the dynamic library file for the current platform and architecture. + This resource in INI-style [ConfigFile] format, as in [code].gdnlib[/code] files. + If [code]true[/code], Godot loads only one copy of the library and each script that references the library will share static data like static or global variables. + If [code]false[/code], Godot loads a separate copy of the library into memory for each script that references it. + If [code]true[/code], the editor will temporarily unload the library whenever the user switches away from the editor window, allowing the user to recompile the library without restarting Godot. + [b]Note:[/b] If the library defines tool scripts that run inside the editor, [code]reloadable[/code] must be [code]false[/code]. Otherwise, the editor will attempt to unload the tool scripts while they're in use and crash. + If [code]true[/code], Godot loads the library at startup rather than the first time a script uses the library, calling [code]gdnative_singleton[/code] after initializing the library. The library remains loaded as long as Godot is running. + [b]Note:[/b] A singleton library cannot be [member reloadable]. + The prefix this library's entry point functions begin with. For example, a GDNativeLibrary would declare its [code]gdnative_init[/code] function as [code]godot_gdnative_init[/code] by default. + On platforms that require statically linking libraries (currently only iOS), each library must have a different [code]symbol_prefix[/code]. From 5f314c54ff04d446eae8adf2451c68ba7e7a82f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 31 Oct 2019 15:14:49 +0100 Subject: [PATCH 05/68] Prevent crash when we can't write to editor cache or config path This can happen if users somehow got wrong user permissions assigned to their Godot cache, config or data paths (e.g. `~/.config/godot`). The error messages should give them a hint as to what the issue may be. Fixes #33199. There may be other situations that still lead to a crash, we need to review all uses of `FileAccess::open` with `FileAccess::WRITE` mode to ensure that proper pointer validation is done. (cherry picked from commit 565f7183aab390986e678dfb909e2481e94e441f) --- editor/editor_file_system.cpp | 17 +++++++++++------ editor/editor_resource_preview.cpp | 18 ++++++++++++++---- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 286db917a83..53ee85fbbdb 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -322,13 +322,14 @@ void EditorFileSystem::_save_filesystem_cache() { FileAccess *f = FileAccess::open(fscache, FileAccess::WRITE); if (f == NULL) { - ERR_PRINTS("Error writing fscache: " + fscache); - } else { - f->store_line(filesystem_settings_version_for_import); - _save_filesystem_cache(filesystem, f); - f->close(); - memdelete(f); + ERR_EXPLAIN("Cannot create file '" + fscache + "'. Check user write permissions."); + ERR_FAIL(); } + + f->store_line(filesystem_settings_version_for_import); + _save_filesystem_cache(filesystem, f); + f->close(); + memdelete(f); } void EditorFileSystem::_thread_func(void *_userdata) { @@ -1370,6 +1371,10 @@ void EditorFileSystem::_save_late_updated_files() { //files that already existed, and were modified, need re-scanning for dependencies upon project restart. This is done via saving this special file String fscache = EditorSettings::get_singleton()->get_project_settings_dir().plus_file("filesystem_update4"); FileAccessRef f = FileAccess::open(fscache, FileAccess::WRITE); + if (!f) { + ERR_EXPLAIN("Cannot create file '" + fscache + "'. Check user write permissions."); + ERR_FAIL(); + } for (Set::Element *E = late_update_files.front(); E; E = E->next()) { f->store_line(E->get()); } diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 173333dac9e..f56cfc12a29 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -177,6 +177,10 @@ void EditorResourcePreview::_generate_preview(Ref &r_texture, Ref< ResourceSaver::save(cache_base + "_small.png", r_small_texture); } FileAccess *f = FileAccess::open(cache_base + ".txt", FileAccess::WRITE); + if (!f) { + ERR_EXPLAIN("Cannot create file '" + cache_base + ".txt'. Check user write permissions."); + ERR_FAIL(); + } f->store_line(itos(thumbnail_size)); f->store_line(itos(has_small_texture)); f->store_line(itos(FileAccess::get_modified_time(p_item.path))); @@ -267,10 +271,16 @@ void EditorResourcePreview::_thread() { //update modified time f = FileAccess::open(file, FileAccess::WRITE); - f->store_line(itos(modtime)); - f->store_line(itos(has_small_texture)); - f->store_line(md5); - memdelete(f); + if (!f) { + // Not returning as this would leave the thread hanging and would require + // some proper cleanup/disabling of resource preview generation. + ERR_PRINTS("Cannot create file '" + file + "'. Check user write permissions."); + } else { + f->store_line(itos(modtime)); + f->store_line(itos(has_small_texture)); + f->store_line(md5); + memdelete(f); + } } } else { memdelete(f); From 6befb0836e0deb39475da82c6fd05e2c897b1646 Mon Sep 17 00:00:00 2001 From: Harley Laue Date: Mon, 23 Sep 2019 02:53:29 -0700 Subject: [PATCH 06/68] Allow building cvtt with system squish It looks like the SCsub for cvtt was copied from squish and it left the `if env['build_squish']:` line intact. This means that using `scons builtin_squish=no modules/cvtt` would fail and overal builds would also fail because they'd fail to find `ConvectionKernels.h` (cherry picked from commit 0fbd00f6569eb818542dfefd935a2f7f25f13829) --- modules/cvtt/SCsub | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/cvtt/SCsub b/modules/cvtt/SCsub index fcc69d83710..8c93a594b53 100644 --- a/modules/cvtt/SCsub +++ b/modules/cvtt/SCsub @@ -6,19 +6,18 @@ Import('env_modules') env_cvtt = env_modules.Clone() # Thirdparty source files -if env['builtin_squish']: - thirdparty_dir = "#thirdparty/cvtt/" - thirdparty_sources = [ - "ConvectionKernels.cpp" - ] +thirdparty_dir = "#thirdparty/cvtt/" +thirdparty_sources = [ + "ConvectionKernels.cpp" +] - thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] +thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env_cvtt.Append(CPPPATH=[thirdparty_dir]) +env_cvtt.Append(CPPPATH=[thirdparty_dir]) - env_thirdparty = env_cvtt.Clone() - env_thirdparty.disable_warnings() - env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) +env_thirdparty = env_cvtt.Clone() +env_thirdparty.disable_warnings() +env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) # Godot source files env_cvtt.add_source_files(env.modules_sources, "*.cpp") From 02c4c7a69331c8534435ea9dd57d2456eb603b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 3 Oct 2019 10:43:59 +0200 Subject: [PATCH 07/68] Android one-click deploy: Don't clear by default This makes iteration faster as you don't need to monitor your phone to allow the installation each time. Fixes #32183. (cherry picked from commit 9d96f041382b5b9e1cd9844c27cfa12b023c47a7) --- platform/android/export/export.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index afccbd113ea..856af31c3a4 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1140,7 +1140,7 @@ public: virtual void get_export_options(List *r_options) { r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/32_bits_framebuffer"), true)); - r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "one_click_deploy/clear_previous_install"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "one_click_deploy/clear_previous_install"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "*.apk"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "*.apk"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "command_line/extra_args"), "")); From aa8386c59381e54df2a2d7c18742d9f93a30e067 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Fri, 30 Aug 2019 01:33:50 +0200 Subject: [PATCH 08/68] Mono: Force preemptive thread suspend mode as a temporary workaround (cherry picked from commit 5a6070dde3fcd6f13d55ed8b580487b6b1f42263) --- modules/mono/mono_gd/gd_mono.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index bfb6c13224f..dfe5d69905e 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -312,6 +312,13 @@ void GDMono::initialize() { } #endif +#if !defined(WINDOWS_ENABLED) && !defined(NO_MONO_THREADS_SUSPEND_WORKAROUND) + // FIXME: Temporary workaround. See: https://github.com/godotengine/godot/issues/29812 + if (!OS::get_singleton()->has_environment("MONO_THREADS_SUSPEND")) { + OS::get_singleton()->set_environment("MONO_THREADS_SUSPEND", "preemptive"); + } +#endif + root_domain = mono_jit_init_version("GodotEngine.RootDomain", "v4.0.30319"); ERR_EXPLAIN("Mono: Failed to initialize runtime"); From e168f04bc337ddfc39047b3de25a14ffef765db6 Mon Sep 17 00:00:00 2001 From: volzhs Date: Mon, 21 Oct 2019 22:44:03 +0900 Subject: [PATCH 09/68] Fix validating editor bold font (cherry picked from commit aa5e34d0182b5181f425f6273536fb1a9cf90346) --- editor/editor_fonts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index fa4172cdedb..d0401add578 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -64,7 +64,7 @@ Ref m_name; \ m_name.instance(); \ m_name->set_size(m_size); \ - if (CustomFont.is_valid()) { \ + if (CustomFontBold.is_valid()) { \ m_name->set_font_data(CustomFontBold); \ m_name->add_fallback(DefaultFontBold); \ } else { \ From 1f772917d2cf0fce441c7d3b0b2cb808ffbeb934 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 24 Oct 2019 19:06:09 +0200 Subject: [PATCH 10/68] makerst: Separate signals/enums/properties/methods with a line (cherry picked from commit c2e5ef4cec37597d472250370eda5a3696700bb1) --- doc/tools/makerst.py | 49 ++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 18772d103da..98735c58675 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -425,21 +425,30 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S # Signals if len(class_def.signals) > 0: f.write(make_heading('Signals', '-')) + index = 0 + for signal in class_def.signals.values(): - #f.write(".. _class_{}_{}:\n\n".format(class_name, signal.name)) + if index != 0: + f.write('----\n\n') + f.write(".. _class_{}_signal_{}:\n\n".format(class_name, signal.name)) _, signature = make_method_signature(class_def, signal, False, state) f.write("- {}\n\n".format(signature)) - if signal.description is None or signal.description.strip() == '': - continue - f.write(rstize_text(signal.description.strip(), state)) - f.write("\n\n") + if signal.description is not None and signal.description.strip() != '': + f.write(rstize_text(signal.description.strip(), state) + '\n\n') + + index += 1 # Enums if len(class_def.enums) > 0: f.write(make_heading('Enumerations', '-')) + index = 0 + for e in class_def.enums.values(): + if index != 0: + f.write('----\n\n') + f.write(".. _enum_{}_{}:\n\n".format(class_name, e.name)) # Sphinx seems to divide the bullet list into individual