From 699a48d8f1aed8c0c58f1315dd3fdcdd9ceeb0c6 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Mon, 26 Aug 2024 14:46:47 -0700 Subject: [PATCH 01/13] [3.x] Bind Array and Pool*Array get and set functions --- core/dictionary.cpp | 4 ++++ core/dictionary.h | 1 + core/variant_call.cpp | 11 +++++++++++ doc/classes/Array.xml | 14 ++++++++++++++ doc/classes/Dictionary.xml | 7 +++++++ doc/classes/PoolByteArray.xml | 7 +++++++ doc/classes/PoolColorArray.xml | 7 +++++++ doc/classes/PoolIntArray.xml | 7 +++++++ doc/classes/PoolRealArray.xml | 7 +++++++ doc/classes/PoolStringArray.xml | 7 +++++++ doc/classes/PoolVector2Array.xml | 7 +++++++ doc/classes/PoolVector3Array.xml | 7 +++++++ 12 files changed, 86 insertions(+) diff --git a/core/dictionary.cpp b/core/dictionary.cpp index b8a57218541c..814a0c5363b0 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -125,6 +125,10 @@ Variant Dictionary::get_or_add(const Variant &p_key, const Variant &p_default) { return *result; } +void Dictionary::set(const Variant &p_key, const Variant &p_value) { + operator[](p_key) = p_value; +} + int Dictionary::size() const { return _p->variant_map.size(); } diff --git a/core/dictionary.h b/core/dictionary.h index dad679f30b44..bd04ab9d5bde 100644 --- a/core/dictionary.h +++ b/core/dictionary.h @@ -59,6 +59,7 @@ class Dictionary { Variant get_valid(const Variant &p_key) const; Variant get(const Variant &p_key, const Variant &p_default) const; Variant get_or_add(const Variant &p_key, const Variant &p_default); + void set(const Variant &p_key, const Variant &p_value); int size() const; bool empty() const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 83b3fd7ad71a..902133efb85e 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -562,6 +562,7 @@ struct _VariantCall { VCALL_LOCALMEM1R(Dictionary, duplicate); VCALL_LOCALMEM2R(Dictionary, get); VCALL_LOCALMEM2R(Dictionary, get_or_add); + VCALL_LOCALMEM2(Dictionary, set); VCALL_LOCALMEM2(Array, set); VCALL_LOCALMEM1R(Array, get); @@ -1940,6 +1941,7 @@ void register_variant_methods() { ADDFUNC0R(DICTIONARY, BOOL, Dictionary, empty, varray()); ADDFUNC0NC(DICTIONARY, NIL, Dictionary, clear, varray()); ADDFUNC2NC(DICTIONARY, NIL, Dictionary, merge, DICTIONARY, "dictionary", BOOL, "overwrite", varray(false)); + ADDFUNC2NC(DICTIONARY, NIL, Dictionary, set, NIL, "key", NIL, "value", varray()); ADDFUNC1R(DICTIONARY, BOOL, Dictionary, has, NIL, "key", varray()); ADDFUNC1R(DICTIONARY, BOOL, Dictionary, has_all, ARRAY, "keys", varray()); ADDFUNC1R(DICTIONARY, NIL, Dictionary, find_key, NIL, "value", varray()); @@ -1955,6 +1957,8 @@ void register_variant_methods() { ADDFUNC0R(ARRAY, BOOL, Array, empty, varray()); ADDFUNC0NC(ARRAY, NIL, Array, clear, varray()); ADDFUNC0R(ARRAY, INT, Array, hash, varray()); + ADDFUNC1R(ARRAY, NIL, Array, get, INT, "index", varray()); + ADDFUNC2NC(ARRAY, NIL, Array, set, INT, "index", NIL, "value", varray()); ADDFUNC1NC(ARRAY, NIL, Array, push_back, NIL, "value", varray()); ADDFUNC1NC(ARRAY, NIL, Array, push_front, NIL, "value", varray()); ADDFUNC1NC(ARRAY, NIL, Array, fill, NIL, "value", varray()); @@ -1988,6 +1992,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_BYTE_ARRAY, INT, PoolByteArray, size, varray()); ADDFUNC0R(POOL_BYTE_ARRAY, BOOL, PoolByteArray, empty, varray()); + ADDFUNC1R(POOL_BYTE_ARRAY, INT, PoolByteArray, get, INT, "index", varray()); ADDFUNC2(POOL_BYTE_ARRAY, NIL, PoolByteArray, set, INT, "idx", INT, "byte", varray()); ADDFUNC1(POOL_BYTE_ARRAY, NIL, PoolByteArray, push_back, INT, "byte", varray()); ADDFUNC1(POOL_BYTE_ARRAY, NIL, PoolByteArray, fill, INT, "byte", varray()); @@ -2014,6 +2019,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_INT_ARRAY, INT, PoolIntArray, size, varray()); ADDFUNC0R(POOL_INT_ARRAY, BOOL, PoolIntArray, empty, varray()); + ADDFUNC1R(POOL_INT_ARRAY, INT, PoolIntArray, get, INT, "index", varray()); ADDFUNC2(POOL_INT_ARRAY, NIL, PoolIntArray, set, INT, "idx", INT, "integer", varray()); ADDFUNC1(POOL_INT_ARRAY, NIL, PoolIntArray, push_back, INT, "integer", varray()); ADDFUNC1(POOL_INT_ARRAY, NIL, PoolIntArray, fill, INT, "integer", varray()); @@ -2032,6 +2038,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_REAL_ARRAY, INT, PoolRealArray, size, varray()); ADDFUNC0R(POOL_REAL_ARRAY, BOOL, PoolRealArray, empty, varray()); + ADDFUNC1R(POOL_REAL_ARRAY, REAL, PoolRealArray, get, INT, "index", varray()); ADDFUNC2(POOL_REAL_ARRAY, NIL, PoolRealArray, set, INT, "idx", REAL, "value", varray()); ADDFUNC1(POOL_REAL_ARRAY, NIL, PoolRealArray, push_back, REAL, "value", varray()); ADDFUNC1(POOL_REAL_ARRAY, NIL, PoolRealArray, fill, REAL, "value", varray()); @@ -2050,6 +2057,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_STRING_ARRAY, INT, PoolStringArray, size, varray()); ADDFUNC0R(POOL_STRING_ARRAY, BOOL, PoolStringArray, empty, varray()); + ADDFUNC1R(POOL_STRING_ARRAY, STRING, PoolStringArray, get, INT, "index", varray()); ADDFUNC2(POOL_STRING_ARRAY, NIL, PoolStringArray, set, INT, "idx", STRING, "string", varray()); ADDFUNC1(POOL_STRING_ARRAY, NIL, PoolStringArray, push_back, STRING, "string", varray()); ADDFUNC1(POOL_STRING_ARRAY, NIL, PoolStringArray, fill, STRING, "string", varray()); @@ -2069,6 +2077,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_VECTOR2_ARRAY, INT, PoolVector2Array, size, varray()); ADDFUNC0R(POOL_VECTOR2_ARRAY, BOOL, PoolVector2Array, empty, varray()); + ADDFUNC1R(POOL_VECTOR2_ARRAY, VECTOR2, PoolVector2Array, get, INT, "index", varray()); ADDFUNC2(POOL_VECTOR2_ARRAY, NIL, PoolVector2Array, set, INT, "idx", VECTOR2, "vector2", varray()); ADDFUNC1(POOL_VECTOR2_ARRAY, NIL, PoolVector2Array, push_back, VECTOR2, "vector2", varray()); ADDFUNC1(POOL_VECTOR2_ARRAY, NIL, PoolVector2Array, fill, VECTOR2, "vector2", varray()); @@ -2087,6 +2096,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_VECTOR3_ARRAY, INT, PoolVector3Array, size, varray()); ADDFUNC0R(POOL_VECTOR3_ARRAY, BOOL, PoolVector3Array, empty, varray()); + ADDFUNC1R(POOL_VECTOR3_ARRAY, VECTOR3, PoolVector3Array, get, INT, "index", varray()); ADDFUNC2(POOL_VECTOR3_ARRAY, NIL, PoolVector3Array, set, INT, "idx", VECTOR3, "vector3", varray()); ADDFUNC1(POOL_VECTOR3_ARRAY, NIL, PoolVector3Array, push_back, VECTOR3, "vector3", varray()); ADDFUNC1(POOL_VECTOR3_ARRAY, NIL, PoolVector3Array, fill, VECTOR3, "vector3", varray()); @@ -2105,6 +2115,7 @@ void register_variant_methods() { ADDFUNC0R(POOL_COLOR_ARRAY, INT, PoolColorArray, size, varray()); ADDFUNC0R(POOL_COLOR_ARRAY, BOOL, PoolColorArray, empty, varray()); + ADDFUNC1R(POOL_COLOR_ARRAY, COLOR, PoolColorArray, get, INT, "index", varray()); ADDFUNC2(POOL_COLOR_ARRAY, NIL, PoolColorArray, set, INT, "idx", COLOR, "color", varray()); ADDFUNC1(POOL_COLOR_ARRAY, NIL, PoolColorArray, push_back, COLOR, "color", varray()); ADDFUNC1(POOL_COLOR_ARRAY, NIL, PoolColorArray, fill, COLOR, "color", varray()); diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 63d7e39c83f7..c24385710b53 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -211,6 +211,13 @@ [b]Note:[/b] Calling this function is not the same as writing [code]array[0][/code]. If the array is empty, accessing by index will pause project execution when running from the editor. + + + + + Returns the element at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + @@ -329,6 +336,13 @@ Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. + + + + + Sets the value of the element at the given [code]index[/code] to the given [code]value[/code]. This will not change the size of the array, it only changes the value at an index already in the array. This is the same as using the [code][][/code] operator ([code]array[index] = value[/code]). + + Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GDScript.randi]. Call [method @GDScript.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling. diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index a3cc577424f0..b4cfe0cf1405 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -187,6 +187,13 @@ Adds elements from [code]dictionary[/code] to this [Dictionary]. By default, duplicate keys will not be copied over, unless [code]overwrite[/code] is [code]true[/code]. + + + + + Sets the value of the element at the given [code]key[/code] to the given [code]value[/code]. This is the same as using the [code][][/code] operator ([code]array[index] = value[/code]). + + diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index df7c5a31ed85..e72cdc79a151 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -100,6 +100,13 @@ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds. + + + + + Returns the byte at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + diff --git a/doc/classes/PoolColorArray.xml b/doc/classes/PoolColorArray.xml index 351525fca662..9c26fbf36a49 100644 --- a/doc/classes/PoolColorArray.xml +++ b/doc/classes/PoolColorArray.xml @@ -74,6 +74,13 @@ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds. + + + + + Returns the Color at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index f581808e54d2..5140ef06e620 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -75,6 +75,13 @@ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds. + + + + + Returns the integer at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + diff --git a/doc/classes/PoolRealArray.xml b/doc/classes/PoolRealArray.xml index d892beba0c55..3ef2eb16ff70 100644 --- a/doc/classes/PoolRealArray.xml +++ b/doc/classes/PoolRealArray.xml @@ -75,6 +75,13 @@ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds. + + + + + Returns the float at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + diff --git a/doc/classes/PoolStringArray.xml b/doc/classes/PoolStringArray.xml index aadede943011..d765d5891989 100644 --- a/doc/classes/PoolStringArray.xml +++ b/doc/classes/PoolStringArray.xml @@ -75,6 +75,13 @@ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds. + + + + + Returns the String at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + diff --git a/doc/classes/PoolVector2Array.xml b/doc/classes/PoolVector2Array.xml index c89ea76fd503..d3c6a554a0c2 100644 --- a/doc/classes/PoolVector2Array.xml +++ b/doc/classes/PoolVector2Array.xml @@ -75,6 +75,13 @@ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds. + + + + + Returns the Vector2 at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + diff --git a/doc/classes/PoolVector3Array.xml b/doc/classes/PoolVector3Array.xml index a587019596a3..da1e17fc7eaa 100644 --- a/doc/classes/PoolVector3Array.xml +++ b/doc/classes/PoolVector3Array.xml @@ -74,6 +74,13 @@ Searches the array for a value and returns its index or [code]-1[/code] if not found. Optionally, the initial search index can be passed. Returns [code]-1[/code] if [code]from[/code] is out of bounds. + + + + + Returns the Vector3 at the given [code]index[/code] in the array. This is the same as using the [code][][/code] operator ([code]array[index][/code]). + + From df74f146055ce53d8c337bd3eca2a664d52e288e Mon Sep 17 00:00:00 2001 From: jitspoe Date: Wed, 28 Aug 2024 23:46:57 -0400 Subject: [PATCH 02/13] Fix random multithreaded crash that happens when setting the audio stream on a AudioStreamRandomPitch stream. --- servers/audio/audio_stream.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index a3f221606157..edf7f9451a4e 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -231,12 +231,14 @@ AudioStreamPlaybackMicrophone::AudioStreamPlaybackMicrophone() { //////////////////////////////// void AudioStreamRandomPitch::set_audio_stream(const Ref &p_audio_stream) { + AudioServer::get_singleton()->lock(); audio_stream = p_audio_stream; if (audio_stream.is_valid()) { for (Set::Element *E = playbacks.front(); E; E = E->next()) { E->get()->playback = audio_stream->instance_playback(); } } + AudioServer::get_singleton()->unlock(); } Ref AudioStreamRandomPitch::get_audio_stream() const { From 354e6565316696bcaeb543a931b6a3bfe5d0954c Mon Sep 17 00:00:00 2001 From: Capital Date: Wed, 25 Sep 2024 12:57:56 -0400 Subject: [PATCH 03/13] Backport 65910 for Godot 3 --- modules/gdscript/gdscript.cpp | 14 ++++++++++++-- modules/gdscript/gdscript_function.cpp | 9 +++++++++ modules/gdscript/gdscript_function.h | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index b34ce80dde0a..0a0b0dab58ea 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -83,7 +83,12 @@ void GDScript::_clear_pending_func_states() { // Order matters since clearing the stack may already cause // the GDSCriptFunctionState to be destroyed and thus removed from the list. pending_func_states.remove(E); - E->self()->_clear_stack(); + GDScriptFunctionState *state = E->self(); + ObjectID state_id = state->get_instance_id(); + state->_clear_connections(); + if (ObjectDB::get_instance(state_id)) { + state->_clear_stack(); + } } GDScriptLanguage::get_singleton()->lock.unlock(); } @@ -1372,7 +1377,12 @@ GDScriptInstance::~GDScriptInstance() { // Order matters since clearing the stack may already cause // the GDSCriptFunctionState to be destroyed and thus removed from the list. pending_func_states.remove(E); - E->self()->_clear_stack(); + GDScriptFunctionState *state = E->self(); + ObjectID state_id = state->get_instance_id(); + state->_clear_connections(); + if (ObjectDB::get_instance(state_id)) { + state->_clear_stack(); + } } if (script.is_valid() && owner) { diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index d58164ffa971..233e3b378edc 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -1855,6 +1855,15 @@ void GDScriptFunctionState::_clear_stack() { } } +void GDScriptFunctionState::_clear_connections() { + List conns; + get_signals_connected_to_this(&conns); + for (List::Element *E = conns.front(); E; E = E->next()) { + Object::Connection &c = E->get(); + c.source->disconnect(c.signal, c.target, c.method); + } +} + void GDScriptFunctionState::_bind_methods() { ClassDB::bind_method(D_METHOD("resume", "arg"), &GDScriptFunctionState::resume, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("is_valid", "extended_check"), &GDScriptFunctionState::is_valid, DEFVAL(false)); diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index a77094c31fd2..929f787ef225 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -375,6 +375,7 @@ class GDScriptFunctionState : public Reference { Variant resume(const Variant &p_arg = Variant()); void _clear_stack(); + void _clear_connections(); GDScriptFunctionState(); ~GDScriptFunctionState(); From 287bc6f41e3d1c1c2064c75982d65a2e7111f651 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sat, 28 Sep 2024 08:48:06 +0100 Subject: [PATCH 04/13] Add warning when calling `is_action_just_pressed()` from `_input()` Calling `is_action_just_pressed()` and `is_action_just_released()` from `_input()` is liable to cause duplicate detection bugs in user code. --- main/input_default.cpp | 16 ++++++++++++++++ main/input_default.h | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/main/input_default.cpp b/main/input_default.cpp index 24505577c03b..f632bf45fcd8 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -111,6 +111,12 @@ bool InputDefault::is_action_pressed(const StringName &p_action, bool p_exact) c } bool InputDefault::is_action_just_pressed(const StringName &p_action, bool p_exact) const { +#ifdef TOOLS_ENABLED + if (_currently_parsing_input) { + WARN_PRINT_ONCE("Prefer InputEvent.is_action_pressed() within input event callbacks to prevent detecting duplicates."); + } +#endif + ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), false, InputMap::get_singleton()->suggest_actions(p_action)); const Map::Element *E = action_state.find(p_action); if (!E) { @@ -132,6 +138,12 @@ bool InputDefault::is_action_just_pressed(const StringName &p_action, bool p_exa } bool InputDefault::is_action_just_released(const StringName &p_action, bool p_exact) const { +#ifdef TOOLS_ENABLED + if (_currently_parsing_input) { + WARN_PRINT_ONCE("Prefer InputEvent.is_action_released() within input event callbacks to prevent detecting duplicates."); + } +#endif + ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), false, InputMap::get_singleton()->suggest_actions(p_action)); const Map::Element *E = action_state.find(p_action); if (!E) { @@ -327,6 +339,10 @@ void InputDefault::_parse_input_event_impl(const Ref &p_event, bool // Regardless where the event came from originally, this has to happen on the main thread. DEV_ASSERT(Thread::get_caller_id() == Thread::get_main_id()); +#ifdef TOOLS_ENABLED + InputGuard guard(_currently_parsing_input); +#endif + // Notes on mouse-touch emulation: // - Emulated mouse events are parsed, that is, re-routed to this method, so they make the same effects // as true mouse events. The only difference is the situation is flagged as emulated so they are not diff --git a/main/input_default.h b/main/input_default.h index 6c0192e0d6fd..19206db8558b 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -114,6 +114,20 @@ class InputDefault : public Input { CursorShape default_shape; +#ifdef TOOLS_ENABLED + // Simple single-threaded detection of whether + // inside `_parse_input_event_impl()`. + bool _currently_parsing_input = false; + class InputGuard { + bool &_currently_parsing; + + public: + InputGuard(bool &r_currently_parsing) : + _currently_parsing(r_currently_parsing) { _currently_parsing = true; } + ~InputGuard() { _currently_parsing = false; } + }; +#endif + public: enum HatMask { HAT_MASK_CENTER = 0, From 62a8b7c62ee2289a36fc52a928df0fb104680bf4 Mon Sep 17 00:00:00 2001 From: jitspoe Date: Sat, 12 Oct 2024 01:04:42 -0400 Subject: [PATCH 05/13] [3.x] Do not auto add default script and country codes to the locale. --- core/translation.cpp | 40 +++++++++++++++++++++++----------------- core/translation.h | 1 + 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/core/translation.cpp b/core/translation.cpp index 4ad17f1d1596..d26a58f8f1c2 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -261,6 +261,10 @@ void TranslationServer::init_locale_info() { } String TranslationServer::standardize_locale(const String &p_locale) const { + return _standardize_locale(p_locale, false); +} + +String TranslationServer::_standardize_locale(const String &p_locale, bool p_add_defaults) const { // Replaces '-' with '_' for macOS style locales. String univ_locale = p_locale.replace("-", "_"); @@ -322,24 +326,26 @@ String TranslationServer::standardize_locale(const String &p_locale) const { } // Add script code base on language and country codes for some ambiguous cases. - if (script.empty()) { - for (int i = 0; i < locale_script_info.size(); i++) { - const LocaleScriptInfo &info = locale_script_info[i]; - if (info.name == lang) { - if (country.empty() || info.supported_countries.has(country)) { - script = info.script; - break; + if (p_add_defaults) { + if (script.empty()) { + for (int i = 0; i < locale_script_info.size(); i++) { + const LocaleScriptInfo &info = locale_script_info[i]; + if (info.name == lang) { + if (country.empty() || info.supported_countries.has(country)) { + script = info.script; + break; + } } } } - } - if (!script.empty() && country.empty()) { - // Add conntry code based on script for some ambiguous cases. - for (int i = 0; i < locale_script_info.size(); i++) { - const LocaleScriptInfo &info = locale_script_info[i]; - if (info.name == lang && info.script == script) { - country = info.default_country; - break; + if (!script.empty() && country.empty()) { + // Add conntry code based on script for some ambiguous cases. + for (int i = 0; i < locale_script_info.size(); i++) { + const LocaleScriptInfo &info = locale_script_info[i]; + if (info.name == lang && info.script == script) { + country = info.default_country; + break; + } } } } @@ -359,8 +365,8 @@ String TranslationServer::standardize_locale(const String &p_locale) const { } int TranslationServer::compare_locales(const String &p_locale_a, const String &p_locale_b) const { - String locale_a = standardize_locale(p_locale_a); - String locale_b = standardize_locale(p_locale_b); + String locale_a = _standardize_locale(p_locale_a, true); + String locale_b = _standardize_locale(p_locale_b, true); if (locale_a == locale_b) { // Exact match. diff --git a/core/translation.h b/core/translation.h index d4b2b0fb5faa..3a2db25cc838 100644 --- a/core/translation.h +++ b/core/translation.h @@ -122,6 +122,7 @@ class TranslationServer : public Object { int compare_locales(const String &p_locale_a, const String &p_locale_b) const; String standardize_locale(const String &p_locale) const; + String _standardize_locale(const String &p_locale, bool p_add_defaults) const; Vector get_all_languages() const; String get_language_name(const String &p_language) const; From 7ebb63628d01a1d42a354c33a2898c0f4cd4c542 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 16 Oct 2024 20:23:59 +0800 Subject: [PATCH 06/13] Cache results for `TranslationServer.compare_locales()` --- core/translation.cpp | 40 +++++++++++++++++++++++++++------------- core/translation.h | 2 ++ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/core/translation.cpp b/core/translation.cpp index d26a58f8f1c2..c911e738de11 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -365,32 +365,46 @@ String TranslationServer::_standardize_locale(const String &p_locale, bool p_add } int TranslationServer::compare_locales(const String &p_locale_a, const String &p_locale_b) const { + if (p_locale_a == p_locale_b) { + // Exact match. + return 10; + } + + const String cache_key = p_locale_a + "|" + p_locale_b; + const int *cached_result = locale_compare_cache.getptr(cache_key); + if (cached_result) { + return *cached_result; + } + String locale_a = _standardize_locale(p_locale_a, true); String locale_b = _standardize_locale(p_locale_b, true); if (locale_a == locale_b) { // Exact match. + locale_compare_cache.set(cache_key, 10); return 10; } Vector locale_a_elements = locale_a.split("_"); Vector locale_b_elements = locale_b.split("_"); - if (locale_a_elements[0] == locale_b_elements[0]) { - // Matching language, both locales have extra parts. - // Return number of matching elements. - int matching_elements = 1; - for (int i = 1; i < locale_a_elements.size(); i++) { - for (int j = 1; j < locale_b_elements.size(); j++) { - if (locale_a_elements[i] == locale_b_elements[j]) { - matching_elements++; - } - } - } - return matching_elements; - } else { + if (locale_a_elements[0] != locale_b_elements[0]) { // No match. + locale_compare_cache.set(cache_key, 0); return 0; } + + // Matching language, both locales have extra parts. + // Return number of matching elements. + int matching_elements = 1; + for (int i = 1; i < locale_a_elements.size(); i++) { + for (int j = 1; j < locale_b_elements.size(); j++) { + if (locale_a_elements[i] == locale_b_elements[j]) { + matching_elements++; + } + } + } + locale_compare_cache.set(cache_key, matching_elements); + return matching_elements; } String TranslationServer::get_locale_name(const String &p_locale) const { diff --git a/core/translation.h b/core/translation.h index 3a2db25cc838..bbb549de10c5 100644 --- a/core/translation.h +++ b/core/translation.h @@ -87,6 +87,8 @@ class TranslationServer : public Object { Ref tool_translation; Ref doc_translation; + mutable HashMap locale_compare_cache; + bool enabled; static TranslationServer *singleton; From 93c514600b71c28a72f67441ce288645400643a0 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 18 Oct 2024 22:57:05 +0800 Subject: [PATCH 07/13] Fix button click detection when `Tree` is rotated --- scene/gui/tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 10c5e26b5f6e..ffcbd7906ede 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1722,7 +1722,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool cache.click_id = c.buttons[j].id; cache.click_item = p_item; cache.click_column = col; - cache.click_pos = get_global_mouse_position() - get_global_position(); + cache.click_pos = get_local_mouse_position(); update(); //emit_signal("button_pressed"); return -1; From 51b03b86022b7732a2c5d86506c40a8b8fdf9002 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 23 Oct 2024 11:07:49 +0800 Subject: [PATCH 08/13] Fix `PopupMenu` margin and separation calculations --- scene/gui/popup_menu.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 750c41c5b58e..e6528c037d14 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -32,8 +32,6 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "core/os/os.h" -#include "core/print_string.h" -#include "core/translation.h" String PopupMenu::_get_accel_text(int p_item) const { ERR_FAIL_INDEX_V(p_item, items.size(), String()); @@ -119,8 +117,7 @@ int PopupMenu::_get_items_total_height() const { items_total_height += MAX(items[i].get_icon_size().height, font_height) + vsep; } - // Subtract a separator which is not needed for the last item. - return items_total_height - vsep; + return items_total_height; } void PopupMenu::_scroll_to_item(int p_item) { @@ -149,16 +146,12 @@ int PopupMenu::_get_mouse_over(const Point2 &p_over) const { int vseparation = get_constant("vseparation"); float font_h = get_font("font")->get_height(); - Point2 ofs = style->get_offset() + Point2(0, vseparation / 2); + real_t ofs = style->get_margin(MARGIN_TOP) + control->get_position().y; for (int i = 0; i < items.size(); i++) { - if (i > 0) { - ofs.y += vseparation; - } + ofs += MAX(items[i].get_icon_size().height, font_h) + vseparation; - ofs.y += MAX(items[i].get_icon_size().height, font_h); - - if (p_over.y - control->get_position().y < ofs.y) { + if (p_over.y < ofs) { return i; } } @@ -328,7 +321,7 @@ void PopupMenu::_gui_input(const Ref &p_event) { // Make an area which does not include v scrollbar, so that items are not activated when dragging scrollbar. Transform2D xform = get_global_transform_with_canvas(); - Point2 item_origin = xform.get_origin(); + Point2 item_origin = scroll_container->get_global_position(); float scroll_width = scroll_container->get_v_scrollbar()->is_visible_in_tree() ? scroll_container->get_v_scrollbar()->get_size().width : 0; Size2 item_size = (control->get_global_rect().get_size() - Vector2(scroll_width, 0)) * xform.get_scale(); Rect2 item_clickable_area = Rect2(item_origin, item_size); @@ -465,7 +458,6 @@ void PopupMenu::_draw_items() { margin_size.width = margin_container->get_constant("margin_right") + margin_container->get_constant("margin_left"); margin_size.height = margin_container->get_constant("margin_top") + margin_container->get_constant("margin_bottom"); - Ref style = get_stylebox("panel"); Ref hover = get_stylebox("hover"); Ref font = get_font("font"); select_font(font); @@ -508,7 +500,7 @@ void PopupMenu::_draw_items() { check_ofs = MAX(get_icon("checked")->get_width(), get_icon("radio_checked")->get_width()) + hseparation; } - Point2 ofs = Point2(); + Point2 ofs = Point2(0, vseparation / 2); // Loop through all items and draw each. for (int i = 0; i < items.size(); i++) { From cc11089786de6fc84a58f4b0af004997131b5b02 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 25 Oct 2024 12:30:08 +0800 Subject: [PATCH 09/13] Fix Button not listing `hover_pressed` stylebox --- doc/classes/Button.xml | 3 +++ scene/resources/default_theme/default_theme.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index c736a6aa3768..2e72fd7a57c9 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -113,6 +113,9 @@ [StyleBox] used when the [Button] is being hovered. + + [StyleBox] used when the [Button] is being hovered and pressed. + Default [StyleBox] for the [Button]. diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 375d711e4d5d..bb94d2e22c5c 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -230,6 +230,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_stylebox("normal", "Button", sb_button_normal); theme->set_stylebox("pressed", "Button", sb_button_pressed); theme->set_stylebox("hover", "Button", sb_button_hover); + theme->set_stylebox("hover_pressed", "Button", sb_button_hover); theme->set_stylebox("disabled", "Button", sb_button_disabled); theme->set_stylebox("focus", "Button", sb_button_focus); From a75460f267b49d872f3119156c5e94095fa99788 Mon Sep 17 00:00:00 2001 From: kilian-diener Date: Tue, 5 Nov 2024 12:05:45 +0100 Subject: [PATCH 10/13] Fix error when non-ASCII characters in resource pack path Co-authored-by: Haoyu Qiu --- core/io/file_access_zip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index 143f425945af..af68e38c100e 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -43,7 +43,7 @@ static void *godot_open(void *data, const char *p_fname, int mode) { return nullptr; } - FileAccess *f = FileAccess::open(p_fname, FileAccess::READ); + FileAccess *f = FileAccess::open(String::utf8(p_fname), FileAccess::READ); ERR_FAIL_COND_V(!f, nullptr); return f; From 960898c5bcbdb7ad695095cdadd87f8fd69fa149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 5 Nov 2024 16:50:55 +0100 Subject: [PATCH 11/13] certs: Sync with Mozilla bundle as of Oct 19, 2024 https://github.com/bagder/ca-bundle/commit/4d3fe6683f651d96be1bbef316b201e9b33b274d Document matching mozilla-release changeset. (cherry picked from commit eb41ff0feeeee9f72127534e10810c3334724702) --- thirdparty/README.md | 7 +- thirdparty/certs/ca-certificates.crt | 149 +++++++++++++++++++++------ 2 files changed, 123 insertions(+), 33 deletions(-) diff --git a/thirdparty/README.md b/thirdparty/README.md index 7f963965ef40..680901539fe8 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -34,9 +34,14 @@ Files extracted from upstream source: ## certs - Upstream: Mozilla, via https://github.com/bagder/ca-bundle -- Version: git (c5a419971b1bec220368c619aaafd0b818aa119f, 2024) +- Version: git (4d3fe6683f651d96be1bbef316b201e9b33b274d, 2024), + generated from mozilla-release changeset b8ea2342548b8571e58f9176d9555ccdb5ec199f - License: MPL 2.0 +Files extracted from upstream source: + +- `ca-bundle.crt` renamed to `ca-certificates.crt` + ## cvtt diff --git a/thirdparty/certs/ca-certificates.crt b/thirdparty/certs/ca-certificates.crt index f43758709150..c559ab795b9b 100644 --- a/thirdparty/certs/ca-certificates.crt +++ b/thirdparty/certs/ca-certificates.crt @@ -1,7 +1,9 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Mon Mar 11 15:15:21 2024 GMT +## Certificate data from Mozilla as of: Sat Oct 19 21:26:09 2024 GMT +## +## Find updated versions here: https://curl.se/docs/caextract.html ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates @@ -14,7 +16,7 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.29. -## SHA256: 4d96bd539f4719e9ace493757afbe4a23ee8579de1c97fbebc50bba3c12e8c1e +## SHA256: 36105b01631f9fc03b1eca779b44a30a1a5890b9bf8dc07ccb001a07301e01cf ## @@ -2600,36 +2602,6 @@ vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+ CAezNIm8BZ/3Hobui3A= -----END CERTIFICATE----- -GLOBALTRUST 2020 -================ ------BEGIN CERTIFICATE----- -MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkGA1UEBhMCQVQx -IzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVT -VCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYxMDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAh -BgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAy -MDIwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWi -D59bRatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9ZYybNpyrO -VPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3QWPKzv9pj2gOlTblzLmM -CcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPwyJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCm -fecqQjuCgGOlYx8ZzHyyZqjC0203b+J+BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKA -A1GqtH6qRNdDYfOiaxaJSaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9OR -JitHHmkHr96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj04KlG -DfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXogvziB4xiRfUg3kZwhqG8k9MedKZssCz3AwyIDMvU -clOGvGBG85hqwvG/Q/lwIHfKN0F5VVJjjVsSn8VoxIidrPIwq7ejMZdnrY8XD2zHc+0klGvIg5rQ -mjdJBKuxFshsSUktq6HQjJLyQUp5ISXbY9e2nKd+Qmn7OmMCAwEAAaNjMGEwDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFNwuH9FhN3nkq9XVsxJxaD1qaJwiMB8GA1Ud -IwQYMBaAFNwuH9FhN3nkq9XVsxJxaD1qaJwiMA0GCSqGSIb3DQEBCwUAA4ICAQCR8EICaEDuw2jA -VC/f7GLDw56KoDEoqoOOpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJCXtzoRlgHNQIw -4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd6IwPS3BD0IL/qMy/pJTAvoe9 -iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf+I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS -8cE54+X1+NZK3TTN+2/BT+MAi1bikvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2 -HcqtbepBEX4tdJP7wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxS -vTOBTI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6CMUO+1918 -oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn4rnvyOL2NSl6dPrFf4IF -YqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+IaFvowdlxfv1k7/9nR4hYJS8+hge9+6jl -gqispdNpQ80xiEmEU5LAsTkbOYMBMMTyqfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg== ------END CERTIFICATE----- - ANF Secure Server Root CA ========================= -----BEGIN CERTIFICATE----- @@ -3579,3 +3551,116 @@ wPfc5+pbrrLMtTWGS9DiP7bY+A4A7l3j941Y/8+LN+ljX273CXE2whJdV/LItM3z7gLfEdxquVeE HVlNjM7IDiPCtyaaEBRx/pOyiriA8A4QntOoUAw3gi/q4Iqd4Sw5/7W0cwDk90imc6y/st53BIe0 o82bNSQ3+pCTE4FCxpgmdTdmQRCsu/WU48IxK63nI1bMNSWSs1A= -----END CERTIFICATE----- + +FIRMAPROFESIONAL CA ROOT-A WEB +============================== +-----BEGIN CERTIFICATE----- +MIICejCCAgCgAwIBAgIQMZch7a+JQn81QYehZ1ZMbTAKBggqhkjOPQQDAzBuMQswCQYDVQQGEwJF +UzEcMBoGA1UECgwTRmlybWFwcm9mZXNpb25hbCBTQTEYMBYGA1UEYQwPVkFURVMtQTYyNjM0MDY4 +MScwJQYDVQQDDB5GSVJNQVBST0ZFU0lPTkFMIENBIFJPT1QtQSBXRUIwHhcNMjIwNDA2MDkwMTM2 +WhcNNDcwMzMxMDkwMTM2WjBuMQswCQYDVQQGEwJFUzEcMBoGA1UECgwTRmlybWFwcm9mZXNpb25h +bCBTQTEYMBYGA1UEYQwPVkFURVMtQTYyNjM0MDY4MScwJQYDVQQDDB5GSVJNQVBST0ZFU0lPTkFM +IENBIFJPT1QtQSBXRUIwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARHU+osEaR3xyrq89Zfe9MEkVz6 +iMYiuYMQYneEMy3pA4jU4DP37XcsSmDq5G+tbbT4TIqk5B/K6k84Si6CcyvHZpsKjECcfIr28jlg +st7L7Ljkb+qbXbdTkBgyVcUgt5SjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUk+FD +Y1w8ndYn81LsF7Kpryz3dvgwHQYDVR0OBBYEFJPhQ2NcPJ3WJ/NS7Beyqa8s93b4MA4GA1UdDwEB +/wQEAwIBBjAKBggqhkjOPQQDAwNoADBlAjAdfKR7w4l1M+E7qUW/Runpod3JIha3RxEL2Jq68cgL +cFBTApFwhVmpHqTm6iMxoAACMQD94vizrxa5HnPEluPBMBnYfubDl94cT7iJLzPrSA8Z94dGXSaQ +pYXFuXqUPoeovQA= +-----END CERTIFICATE----- + +TWCA CYBER Root CA +================== +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIQQAE0jMIAAAAAAAAAATzyxjANBgkqhkiG9w0BAQwFADBQMQswCQYDVQQG +EwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJUV0NB +IENZQkVSIFJvb3QgQ0EwHhcNMjIxMTIyMDY1NDI5WhcNNDcxMTIyMTU1OTU5WjBQMQswCQYDVQQG +EwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJUV0NB +IENZQkVSIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDG+Moe2Qkgfh1s +Ts6P40czRJzHyWmqOlt47nDSkvgEs1JSHWdyKKHfi12VCv7qze33Kc7wb3+szT3vsxxFavcokPFh +V8UMxKNQXd7UtcsZyoC5dc4pztKFIuwCY8xEMCDa6pFbVuYdHNWdZsc/34bKS1PE2Y2yHer43CdT +o0fhYcx9tbD47nORxc5zb87uEB8aBs/pJ2DFTxnk684iJkXXYJndzk834H/nY62wuFm40AZoNWDT +Nq5xQwTxaWV4fPMf88oon1oglWa0zbfuj3ikRRjpJi+NmykosaS3Om251Bw4ckVYsV7r8Cibt4LK +/c/WMw+f+5eesRycnupfXtuq3VTpMCEobY5583WSjCb+3MX2w7DfRFlDo7YDKPYIMKoNM+HvnKkH +IuNZW0CP2oi3aQiotyMuRAlZN1vH4xfyIutuOVLF3lSnmMlLIJXcRolftBL5hSmO68gnFSDAS9TM +fAxsNAwmmyYxpjyn9tnQS6Jk/zuZQXLB4HCX8SS7K8R0IrGsayIyJNN4KsDAoS/xUgXJP+92ZuJF +2A09rZXIx4kmyA+upwMu+8Ff+iDhcK2wZSA3M2Cw1a/XDBzCkHDXShi8fgGwsOsVHkQGzaRP6AzR +wyAQ4VRlnrZR0Bp2a0JaWHY06rc3Ga4udfmW5cFZ95RXKSWNOkyrTZpB0F8mAwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBSdhWEUfMFib5do5E83 +QOGt4A1WNzAdBgNVHQ4EFgQUnYVhFHzBYm+XaORPN0DhreANVjcwDQYJKoZIhvcNAQEMBQADggIB +AGSPesRiDrWIzLjHhg6hShbNcAu3p4ULs3a2D6f/CIsLJc+o1IN1KriWiLb73y0ttGlTITVX1olN +c79pj3CjYcya2x6a4CD4bLubIp1dhDGaLIrdaqHXKGnK/nZVekZn68xDiBaiA9a5F/gZbG0jAn/x +X9AKKSM70aoK7akXJlQKTcKlTfjF/biBzysseKNnTKkHmvPfXvt89YnNdJdhEGoHK4Fa0o635yDR +IG4kqIQnoVesqlVYL9zZyvpoBJ7tRCT5dEA7IzOrg1oYJkK2bVS1FmAwbLGg+LhBoF1JSdJlBTrq +/p1hvIbZv97Tujqxf36SNI7JAG7cmL3c7IAFrQI932XtCwP39xaEBDG6k5TY8hL4iuO/Qq+n1M0R +FxbIQh0UqEL20kCGoE8jypZFVmAGzbdVAaYBlGX+bgUJurSkquLvWL69J1bY73NxW0Qz8ppy6rBe +Pm6pUlvscG21h483XjyMnM7k8M4MZ0HMzvaAq07MTFb1wWFZk7Q+ptq4NxKfKjLji7gh7MMrZQzv +It6IKTtM1/r+t+FHvpw+PoP7UV31aPcuIYXcv/Fa4nzXxeSDwWrruoBa3lwtcHb4yOWHh8qgnaHl +IhInD0Q9HWzq1MKLL295q39QpsQZp6F6t5b5wR9iWqJDB0BeJsas7a5wFsWqynKKTbDPAYsDP27X +-----END CERTIFICATE----- + +SecureSign Root CA12 +==================== +-----BEGIN CERTIFICATE----- +MIIDcjCCAlqgAwIBAgIUZvnHwa/swlG07VOX5uaCwysckBYwDQYJKoZIhvcNAQELBQAwUTELMAkG +A1UEBhMCSlAxIzAhBgNVBAoTGkN5YmVydHJ1c3QgSmFwYW4gQ28uLCBMdGQuMR0wGwYDVQQDExRT +ZWN1cmVTaWduIFJvb3QgQ0ExMjAeFw0yMDA0MDgwNTM2NDZaFw00MDA0MDgwNTM2NDZaMFExCzAJ +BgNVBAYTAkpQMSMwIQYDVQQKExpDeWJlcnRydXN0IEphcGFuIENvLiwgTHRkLjEdMBsGA1UEAxMU +U2VjdXJlU2lnbiBSb290IENBMTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6OcE3 +emhFKxS06+QT61d1I02PJC0W6K6OyX2kVzsqdiUzg2zqMoqUm048luT9Ub+ZyZN+v/mtp7JIKwcc +J/VMvHASd6SFVLX9kHrko+RRWAPNEHl57muTH2SOa2SroxPjcf59q5zdJ1M3s6oYwlkm7Fsf0uZl +fO+TvdhYXAvA42VvPMfKWeP+bl+sg779XSVOKik71gurFzJ4pOE+lEa+Ym6b3kaosRbnhW70CEBF +EaCeVESE99g2zvVQR9wsMJvuwPWW0v4JhscGWa5Pro4RmHvzC1KqYiaqId+OJTN5lxZJjfU+1Uef +NzFJM3IFTQy2VYzxV4+Kh9GtxRESOaCtAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P +AQH/BAQDAgEGMB0GA1UdDgQWBBRXNPN0zwRL1SXm8UC2LEzZLemgrTANBgkqhkiG9w0BAQsFAAOC +AQEAPrvbFxbS8hQBICw4g0utvsqFepq2m2um4fylOqyttCg6r9cBg0krY6LdmmQOmFxv3Y67ilQi +LUoT865AQ9tPkbeGGuwAtEGBpE/6aouIs3YIcipJQMPTw4WJmBClnW8Zt7vPemVV2zfrPIpyMpce +mik+rY3moxtt9XUa5rBouVui7mlHJzWhhpmA8zNL4WukJsPvdFlseqJkth5Ew1DgDzk9qTPxpfPS +vWKErI4cqc1avTc7bgoitPQV55FYxTpE05Uo2cBl6XLK0A+9H7MV2anjpEcJnuDLN/v9vZfVvhga +aaI5gdka9at/yOPiZwud9AzqVN/Ssq+xIvEg37xEHA== +-----END CERTIFICATE----- + +SecureSign Root CA14 +==================== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIUZNtaDCBO6Ncpd8hQJ6JaJ90t8sswDQYJKoZIhvcNAQEMBQAwUTELMAkG +A1UEBhMCSlAxIzAhBgNVBAoTGkN5YmVydHJ1c3QgSmFwYW4gQ28uLCBMdGQuMR0wGwYDVQQDExRT +ZWN1cmVTaWduIFJvb3QgQ0ExNDAeFw0yMDA0MDgwNzA2MTlaFw00NTA0MDgwNzA2MTlaMFExCzAJ +BgNVBAYTAkpQMSMwIQYDVQQKExpDeWJlcnRydXN0IEphcGFuIENvLiwgTHRkLjEdMBsGA1UEAxMU +U2VjdXJlU2lnbiBSb290IENBMTQwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDF0nqh +1oq/FjHQmNE6lPxauG4iwWL3pwon71D2LrGeaBLwbCRjOfHw3xDG3rdSINVSW0KZnvOgvlIfX8xn +bacuUKLBl422+JX1sLrcneC+y9/3OPJH9aaakpUqYllQC6KxNedlsmGy6pJxaeQp8E+BgQQ8sqVb +1MWoWWd7VRxJq3qdwudzTe/NCcLEVxLbAQ4jeQkHO6Lo/IrPj8BGJJw4J+CDnRugv3gVEOuGTgpa +/d/aLIJ+7sr2KeH6caH3iGicnPCNvg9JkdjqOvn90Ghx2+m1K06Ckm9mH+Dw3EzsytHqunQG+bOE +kJTRX45zGRBdAuVwpcAQ0BB8b8VYSbSwbprafZX1zNoCr7gsfXmPvkPx+SgojQlD+Ajda8iLLCSx +jVIHvXiby8posqTdDEx5YMaZ0ZPxMBoH064iwurO8YQJzOAUbn8/ftKChazcqRZOhaBgy/ac18iz +ju3Gm5h1DVXoX+WViwKkrkMpKBGk5hIwAUt1ax5mnXkvpXYvHUC0bcl9eQjs0Wq2XSqypWa9a4X0 +dFbD9ed1Uigspf9mR6XU/v6eVL9lfgHWMI+lNpyiUBzuOIABSMbHdPTGrMNASRZhdCyvjG817XsY +AFs2PJxQDcqSMxDxJklt33UkN4Ii1+iW/RVLApY+B3KVfqs9TC7XyvDf4Fg/LS8EmjijAQIDAQAB +o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUBpOjCl4oaTeq +YR3r6/wtbyPk86AwDQYJKoZIhvcNAQEMBQADggIBAJaAcgkGfpzMkwQWu6A6jZJOtxEaCnFxEM0E +rX+lRVAQZk5KQaID2RFPeje5S+LGjzJmdSX7684/AykmjbgWHfYfM25I5uj4V7Ibed87hwriZLoA +ymzvftAj63iP/2SbNDefNWWipAA9EiOWWF3KY4fGoweITedpdopTzfFP7ELyk+OZpDc8h7hi2/Ds +Hzc/N19DzFGdtfCXwreFamgLRB7lUe6TzktuhsHSDCRZNhqfLJGP4xjblJUK7ZGqDpncllPjYYPG +FrojutzdfhrGe0K22VoF3Jpf1d+42kd92jjbrDnVHmtsKheMYc2xbXIBw8MgAGJoFjHVdqqGuw6q +nsb58Nn4DSEC5MUoFlkRudlpcyqSeLiSV5sI8jrlL5WwWLdrIBRtFO8KvH7YVdiI2i/6GaX7i+B/ +OfVyK4XELKzvGUWSTLNhB9xNH27SgRNcmvMSZ4PPmz+Ln52kuaiWA3rF7iDeM9ovnhp6dB7h7sxa +OgTdsxoEqBRjrLdHEoOabPXm6RUVkRqEGQ6UROcSjiVbgGcZ3GOTEAtlLor6CZpO2oYofaphNdgO +pygau1LgePhsumywbrmHXumZNTfxPWQrqaA0k89jL9WB365jJ6UeTo3cKXhZ+PmhIIynJkBugnLN +eLLIjzwec+fBH7/PzqUqm9tEZDKgu39cJRNItX+S +-----END CERTIFICATE----- + +SecureSign Root CA15 +==================== +-----BEGIN CERTIFICATE----- +MIICIzCCAamgAwIBAgIUFhXHw9hJp75pDIqI7fBw+d23PocwCgYIKoZIzj0EAwMwUTELMAkGA1UE +BhMCSlAxIzAhBgNVBAoTGkN5YmVydHJ1c3QgSmFwYW4gQ28uLCBMdGQuMR0wGwYDVQQDExRTZWN1 +cmVTaWduIFJvb3QgQ0ExNTAeFw0yMDA0MDgwODMyNTZaFw00NTA0MDgwODMyNTZaMFExCzAJBgNV +BAYTAkpQMSMwIQYDVQQKExpDeWJlcnRydXN0IEphcGFuIENvLiwgTHRkLjEdMBsGA1UEAxMUU2Vj +dXJlU2lnbiBSb290IENBMTUwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQLUHSNZDKZmbPSYAi4Io5G +dCx4wCtELW1fHcmuS1Iggz24FG1Th2CeX2yF2wYUleDHKP+dX+Sq8bOLbe1PL0vJSpSRZHX+AezB +2Ot6lHhWGENfa4HL9rzatAy2KZMIaY+jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBTrQciu/NWeUUj1vYv0hyCTQSvT9DAKBggqhkjOPQQDAwNoADBlAjEA2S6J +fl5OpBEHvVnCB96rMjhTKkZEBhd6zlHp4P9mLQlO4E/0BdGF9jVg3PVys0Z9AjBEmEYagoUeYWmJ +SwdLZrWeqrqgHkHZAXQ6bkU6iYAZezKYVWOr62Nuk22rGwlgMU4= +-----END CERTIFICATE----- From fd9bd108af6388ecc6b1668a98612b75fc0d3bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 6 Nov 2024 13:57:25 +0100 Subject: [PATCH 12/13] CI: Update Ubuntu runners to 24.04, but keep 22.04 for Linux builds Pin clang-format to version 16, and black to 24.10.0. Keep using Ubuntu 22.04 for Linux builds for portability. --- .github/workflows/android_builds.yml | 9 +-------- .github/workflows/javascript_builds.yml | 2 +- .github/workflows/linux_builds.yml | 16 +++++++-------- .github/workflows/server_builds.yml | 17 ++++++++-------- .github/workflows/static_checks.yml | 20 +++++++------------ core/io/http_client.cpp | 7 ++++--- core/io/packet_peer_udp.cpp | 20 ++++++++++++++++++- core/io/stream_peer.cpp | 4 ++-- doc/translations/extract.py | 1 + editor/editor_builders.py | 1 + editor/icons/editor_icons_builders.py | 1 + gles_builders.py | 1 + main/main_builders.py | 1 + modules/denoise/resource_to_cpp.py | 1 + modules/gdnative/gdnative_builders.py | 1 + platform/osx/platform_osx_builders.py | 1 + platform/windows/platform_windows_builders.py | 1 + platform/x11/platform_x11_builders.py | 1 + scene/2d/tile_map.cpp | 3 ++- scu_builders.py | 2 ++ 20 files changed, 65 insertions(+), 45 deletions(-) diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index 13da21b85c55..c66bfac67317 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -14,19 +14,12 @@ concurrency: jobs: android-template: - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-24.04" name: Template (target=release, tools=no) steps: - uses: actions/checkout@v4 - # Azure repositories are not reliable, we need to prevent azure giving us packages. - - name: Make apt sources.list use the default Ubuntu repositories - run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f misc/ci/sources.list /etc/apt/sources.list - sudo apt-get update - - name: Set up Java 17 uses: actions/setup-java@v4 with: diff --git a/.github/workflows/javascript_builds.yml b/.github/workflows/javascript_builds.yml index c3fde9b23a67..8739a65307ee 100644 --- a/.github/workflows/javascript_builds.yml +++ b/.github/workflows/javascript_builds.yml @@ -16,7 +16,7 @@ concurrency: jobs: javascript-template: - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-24.04" name: Template (target=release, tools=no) steps: diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 2f69ca228568..162ae9aa287c 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -14,7 +14,8 @@ concurrency: jobs: build-linux: - runs-on: "ubuntu-20.04" + # Stay one LTS before latest to increase portability of Linux artifacts. + runs-on: "ubuntu-22.04" name: ${{ matrix.name }} strategy: fail-fast: false @@ -62,14 +63,13 @@ jobs: - name: Linux dependencies shell: bash run: | - # Azure repositories are not reliable, we need to prevent azure giving us packages. - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f misc/ci/sources.list /etc/apt/sources.list + # Azure repositories are flaky, remove them. + sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}* sudo apt-get update - # The actual dependencies - sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \ - libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \ - libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \ + # The actual dependencies. + sudo apt-get install --no-install-recommends build-essential pkg-config libx11-dev \ + libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev \ + libpulse-dev libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \ libspeechd-dev speech-dispatcher - name: Free disk space on runner diff --git a/.github/workflows/server_builds.yml b/.github/workflows/server_builds.yml index 8758574015c7..f422328167b9 100644 --- a/.github/workflows/server_builds.yml +++ b/.github/workflows/server_builds.yml @@ -14,7 +14,8 @@ concurrency: jobs: build-server: - runs-on: "ubuntu-20.04" + # Stay one LTS before latest to increase portability of Linux artifacts. + runs-on: "ubuntu-22.04" name: ${{ matrix.name }} strategy: fail-fast: false @@ -36,14 +37,14 @@ jobs: - name: Linux dependencies shell: bash run: | - # Azure repositories are not reliable, we need to prevent azure giving us packages. - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f misc/ci/sources.list /etc/apt/sources.list + # Azure repositories are flaky, remove them. + sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}* sudo apt-get update - # The actual dependencies - sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \ - libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev \ - libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip + # The actual dependencies. + sudo apt-get install --no-install-recommends build-essential pkg-config libx11-dev \ + libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev \ + libpulse-dev libdbus-1-dev libudev-dev libxi-dev libxrandr-dev yasm xvfb wget unzip \ + libspeechd-dev speech-dispatcher - name: Restore Godot build cache uses: ./.github/actions/godot-cache-restore diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 3b153b5d0ea8..4d4f949e3eb7 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -9,26 +9,20 @@ concurrency: jobs: static-checks: name: Static Checks (clang-format, black format, file format, documentation checks) - runs-on: ubuntu-20.04 + runs-on: "ubuntu-24.04" steps: - name: Checkout uses: actions/checkout@v4 - # Azure repositories are not reliable, we need to prevent Azure giving us packages. - - name: Make apt sources.list use the default Ubuntu repositories - run: | - sudo rm -f /etc/apt/sources.list.d/* - sudo cp -f misc/ci/sources.list /etc/apt/sources.list - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main" - sudo apt-get update - - name: Install dependencies run: | - sudo apt-get install -qq dos2unix clang-format-15 libxml2-utils python3-pip moreutils + # Azure repositories are flaky, remove them. + sudo rm -f /etc/apt/sources.list.d/{azure,microsoft}* + sudo apt-get update + sudo apt-get install -qq dos2unix libxml2-utils python3-pip moreutils sudo update-alternatives --remove-all clang-format || true - sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-15 100 - sudo pip3 install black==22.3.0 pygments + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-16 100 + sudo pip3 install black==24.10.0 pygments # This needs to happen before Python and npm execution; it must happen before any extra files are written. - name: .gitignore checks (gitignore_check.sh) diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 36c17e87b1e9..46053daffa05 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -713,15 +713,16 @@ PoolByteArray HTTPClient::read_response_body_chunk() { chunk_left -= rec; if (chunk_left == 0) { - if (chunk[chunk.size() - 2] != '\r' || chunk[chunk.size() - 1] != '\n') { + const int chunk_size = chunk.size(); + if (chunk[chunk_size - 2] != '\r' || chunk[chunk_size - 1] != '\n') { ERR_PRINT("HTTP Invalid chunk terminator (not \\r\\n)"); status = STATUS_CONNECTION_ERROR; break; } - ret.resize(chunk.size() - 2); + ret.resize(chunk_size - 2); PoolByteArray::Write w = ret.write(); - memcpy(w.ptr(), chunk.ptr(), chunk.size() - 2); + memcpy(w.ptr(), chunk.ptr(), chunk_size - 2); chunk.clear(); } diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 85dc1dbddfde..a502ba4613a8 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -105,8 +105,21 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { return ERR_UNAVAILABLE; } +/* Bogus GCC warning here: + * In member function 'int RingBuffer::read(T*, int, bool) [with T = unsigned char]', + * inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:112:9, + * inlined from 'virtual Error PacketPeerUDP::get_packet(const uint8_t**, int&)' at core/io/packet_peer_udp.cpp:99:7: + * Error: ./core/ring_buffer.h:68:46: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] + * 68 | p_buf[dst++] = read[pos + i]; + * | ~~~~~~~~~~~~~^~~~~~~ + */ +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wstringop-overflow=0" +#endif + uint32_t size = 0; - uint8_t ipv6[16]; + uint8_t ipv6[16] = {}; rb.read(ipv6, 16, true); packet_ip.set_ipv6(ipv6); rb.read((uint8_t *)&packet_port, 4, true); @@ -115,6 +128,11 @@ Error PacketPeerUDP::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { --queue_count; *r_buffer = packet_buffer; r_buffer_size = size; + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + return OK; } diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 8e31e4d199e3..24735c925b92 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -213,12 +213,12 @@ void StreamPeer::put_var(const Variant &p_variant, bool p_full_objects) { } uint8_t StreamPeer::get_u8() { - uint8_t buf[1]; + uint8_t buf[1] = {}; get_data(buf, 1); return buf[0]; } int8_t StreamPeer::get_8() { - uint8_t buf[1]; + uint8_t buf[1] = {}; get_data(buf, 1); return buf[0]; } diff --git a/doc/translations/extract.py b/doc/translations/extract.py index 6208468509f6..e14c6d1b5c3c 100644 --- a/doc/translations/extract.py +++ b/doc/translations/extract.py @@ -59,6 +59,7 @@ sys.modules["_elementtree"] = None import xml.etree.ElementTree as ET + ## override the parser to get the line number class LineNumberingParser(ET.XMLParser): def _start(self, *args, **kwargs): diff --git a/editor/editor_builders.py b/editor/editor_builders.py index 54fc20ca4bcb..bcd1bc071f76 100644 --- a/editor/editor_builders.py +++ b/editor/editor_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os import os.path import shutil diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py index ce6b9a8686ab..dd910a6810b8 100644 --- a/editor/icons/editor_icons_builders.py +++ b/editor/icons/editor_icons_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main from compat import StringIO diff --git a/gles_builders.py b/gles_builders.py index f43b3b850088..a8effa75fd06 100644 --- a/gles_builders.py +++ b/gles_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + from platform_methods import subprocess_main import re diff --git a/main/main_builders.py b/main/main_builders.py index 4905f0b7f284..76995c879f4e 100644 --- a/main/main_builders.py +++ b/main/main_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + from platform_methods import subprocess_main from compat import byte_to_str from collections import OrderedDict diff --git a/modules/denoise/resource_to_cpp.py b/modules/denoise/resource_to_cpp.py index 6c8327735599..307ea0ee7ded 100644 --- a/modules/denoise/resource_to_cpp.py +++ b/modules/denoise/resource_to_cpp.py @@ -19,6 +19,7 @@ import os from array import array + # Generates a C++ file from the specified binary resource file def generate(in_path, out_path): diff --git a/modules/gdnative/gdnative_builders.py b/modules/gdnative/gdnative_builders.py index d44bf452144a..fa9c42239456 100644 --- a/modules/gdnative/gdnative_builders.py +++ b/modules/gdnative/gdnative_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import json from platform_methods import subprocess_main diff --git a/platform/osx/platform_osx_builders.py b/platform/osx/platform_osx_builders.py index 953ed479db36..d60f78884a09 100644 --- a/platform/osx/platform_osx_builders.py +++ b/platform/osx/platform_osx_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main diff --git a/platform/windows/platform_windows_builders.py b/platform/windows/platform_windows_builders.py index 22e33b51b490..0d518e31c437 100644 --- a/platform/windows/platform_windows_builders.py +++ b/platform/windows/platform_windows_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main diff --git a/platform/x11/platform_x11_builders.py b/platform/x11/platform_x11_builders.py index 5884f8e16118..632bafce020d 100644 --- a/platform/x11/platform_x11_builders.py +++ b/platform/x11/platform_x11_builders.py @@ -3,6 +3,7 @@ All such functions are invoked in a subprocess on Windows to prevent build flakiness. """ + import os from platform_methods import subprocess_main diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 36f1f6c1f190..85ce57424f55 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1269,7 +1269,8 @@ void TileMap::_set_tile_data(const PoolVector &p_data) { for (int i = 0; i < c; i += offset) { const uint8_t *ptr = (const uint8_t *)&r[i]; uint8_t local[12]; - for (int j = 0; j < ((format == FORMAT_2) ? 12 : 8); j++) { + const int buffer_size = (format == FORMAT_2) ? 12 : 8; + for (int j = 0; j < buffer_size; j++) { local[j] = ptr[j]; } diff --git a/scu_builders.py b/scu_builders.py index 4417d2122327..ca9f774f4d36 100755 --- a/scu_builders.py +++ b/scu_builders.py @@ -1,6 +1,7 @@ """Functions used to generate scu build source files during build time """ + import glob, os import math from pathlib import Path @@ -159,6 +160,7 @@ def find_section_name(sub_folder): # which is slow like a normal build, but prevents the naming conflicts. # Ideally in these situations, the source code should be changed to prevent naming conflicts. + # "extension" will usually be cpp, but can also be set to c (for e.g. third party libraries that use c) def process_folder(folders, sought_exceptions=[], includes_per_scu=0, extension="cpp"): if len(folders) == 0: From 12e9b22777c5e8de47b6731e7b5367cf1276af21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 7 Nov 2024 22:13:49 +0100 Subject: [PATCH 13/13] CI: Remove now unused sources.list file --- misc/ci/sources.list | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 misc/ci/sources.list diff --git a/misc/ci/sources.list b/misc/ci/sources.list deleted file mode 100644 index 4d8f94f35c41..000000000000 --- a/misc/ci/sources.list +++ /dev/null @@ -1,4 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse