summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct40
-rw-r--r--core/SCsub16
-rw-r--r--core/input/SCsub2
-rw-r--r--core/io/json.cpp2
-rw-r--r--core/math/expression.cpp2
-rw-r--r--core/string_buffer.h2
-rw-r--r--core/ustring.cpp14
-rw-r--r--core/ustring.h7
-rw-r--r--core/variant.cpp4
-rw-r--r--core/variant_call.cpp2
-rw-r--r--doc/classes/CollisionObject2D.xml8
-rw-r--r--doc/classes/EditorInspector.xml4
-rw-r--r--doc/classes/LineEdit.xml2
-rw-r--r--doc/classes/OS.xml2
-rw-r--r--doc/classes/ProjectSettings.xml30
-rw-r--r--editor/SCsub21
-rw-r--r--editor/editor_node.cpp1
-rw-r--r--editor/editor_properties.cpp72
-rw-r--r--editor/editor_translation_parser.cpp5
-rw-r--r--editor/editor_translation_parser.h1
-rw-r--r--editor/icons/SCsub10
-rw-r--r--editor/import/collada.cpp34
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp24
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp2
-rw-r--r--editor/property_editor.cpp8
-rw-r--r--main/SCsub13
-rw-r--r--main/main.cpp4
-rw-r--r--methods.py13
-rw-r--r--modules/SCsub18
-rw-r--r--modules/bullet/godot_result_callbacks.cpp2
-rw-r--r--modules/denoise/SCsub1
-rw-r--r--modules/gdnative/SCsub3
-rw-r--r--modules/gdnative/gdnative/string.cpp16
-rw-r--r--modules/gdnative/gdnative_api.json13
-rw-r--r--modules/gdnative/include/gdnative/string.h7
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml36
-rw-r--r--modules/gdscript/doc_classes/GDScriptFunctionState.xml5
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp6
-rw-r--r--modules/gdscript/gdscript_tokenizer.cpp2
-rw-r--r--modules/gdscript/register_types.cpp8
-rw-r--r--modules/mono/editor/script_class_parser.cpp2
-rw-r--r--modules/mono/mono_gd/gd_mono_assembly.cpp2
-rw-r--r--modules/visual_script/visual_script_expression.cpp2
-rw-r--r--platform/android/export/export.cpp172
-rw-r--r--platform_methods.py11
-rw-r--r--scene/gui/rich_text_label.cpp2
-rw-r--r--scene/gui/tree.cpp2
-rw-r--r--scene/main/scene_tree.cpp8
-rw-r--r--scene/main/viewport.cpp14
-rw-r--r--servers/physics_2d/space_2d_sw.cpp7
-rw-r--r--servers/physics_3d/space_3d_sw.cpp6
-rw-r--r--servers/rendering/shader_language.cpp2
-rw-r--r--tests/test_math.cpp2
-rw-r--r--tests/test_string.h2
55 files changed, 357 insertions, 341 deletions
diff --git a/SConstruct b/SConstruct
index 7ec926f99b..96d2f1abe7 100644
--- a/SConstruct
+++ b/SConstruct
@@ -84,6 +84,7 @@ env_base.__class__.add_shared_library = methods.add_shared_library
env_base.__class__.add_library = methods.add_library
env_base.__class__.add_program = methods.add_program
env_base.__class__.CommandNoCache = methods.CommandNoCache
+env_base.__class__.Run = methods.Run
env_base.__class__.disable_warnings = methods.disable_warnings
env_base.__class__.module_check_dependencies = methods.module_check_dependencies
@@ -627,27 +628,24 @@ if selected_platform in platform_list:
methods.no_verbose(sys, env)
if not env["platform"] == "server":
- env.Append(
- BUILDERS={
- "GLES2_GLSL": env.Builder(
- action=run_in_subprocess(gles_builders.build_gles2_headers), suffix="glsl.gen.h", src_suffix=".glsl"
- )
- }
- )
- env.Append(
- BUILDERS={
- "RD_GLSL": env.Builder(
- action=run_in_subprocess(gles_builders.build_rd_headers), suffix="glsl.gen.h", src_suffix=".glsl"
- )
- }
- )
- env.Append(
- BUILDERS={
- "GLSL_HEADER": env.Builder(
- action=run_in_subprocess(gles_builders.build_raw_headers), suffix="glsl.gen.h", src_suffix=".glsl"
- )
- }
- )
+ GLSL_BUILDERS = {
+ "GLES2_GLSL": env.Builder(
+ action=env.Run(gles_builders.build_gles2_headers, 'Building GLES2_GLSL header: "$TARGET"'),
+ suffix="glsl.gen.h",
+ src_suffix=".glsl",
+ ),
+ "RD_GLSL": env.Builder(
+ action=env.Run(gles_builders.build_rd_headers, 'Building RD_GLSL header: "$TARGET"'),
+ suffix="glsl.gen.h",
+ src_suffix=".glsl",
+ ),
+ "GLSL_HEADER": env.Builder(
+ action=env.Run(gles_builders.build_raw_headers, 'Building GLSL header: "$TARGET"'),
+ suffix="glsl.gen.h",
+ src_suffix=".glsl",
+ ),
+ }
+ env.Append(BUILDERS=GLSL_BUILDERS)
scons_cache_path = os.environ.get("SCONS_CACHE")
if scons_cache_path != None:
diff --git a/core/SCsub b/core/SCsub
index 80a5f6b623..d08f17c60a 100644
--- a/core/SCsub
+++ b/core/SCsub
@@ -149,28 +149,34 @@ env.Depends(
env.CommandNoCache(
"#core/io/certs_compressed.gen.h",
"#thirdparty/certs/ca-certificates.crt",
- run_in_subprocess(core_builders.make_certs_header),
+ env.Run(core_builders.make_certs_header, "Building ca-certificates header."),
)
# Make binders
env.CommandNoCache(
["method_bind.gen.inc", "method_bind_ext.gen.inc", "method_bind_free_func.gen.inc"],
"make_binders.py",
- run_in_subprocess(make_binders.run),
+ env.Run(make_binders.run, "Generating method binders."),
)
# Authors
env.Depends("#core/authors.gen.h", "../AUTHORS.md")
-env.CommandNoCache("#core/authors.gen.h", "../AUTHORS.md", run_in_subprocess(core_builders.make_authors_header))
+env.CommandNoCache(
+ "#core/authors.gen.h", "../AUTHORS.md", env.Run(core_builders.make_authors_header, "Generating authors header."),
+)
# Donors
env.Depends("#core/donors.gen.h", "../DONORS.md")
-env.CommandNoCache("#core/donors.gen.h", "../DONORS.md", run_in_subprocess(core_builders.make_donors_header))
+env.CommandNoCache(
+ "#core/donors.gen.h", "../DONORS.md", env.Run(core_builders.make_donors_header, "Generating donors header."),
+)
# License
env.Depends("#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"])
env.CommandNoCache(
- "#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"], run_in_subprocess(core_builders.make_license_header)
+ "#core/license.gen.h",
+ ["../COPYRIGHT.txt", "../LICENSE.txt"],
+ env.Run(core_builders.make_license_header, "Generating license header."),
)
# Chain load SCsubs
diff --git a/core/input/SCsub b/core/input/SCsub
index c641819698..f40978911b 100644
--- a/core/input/SCsub
+++ b/core/input/SCsub
@@ -16,7 +16,7 @@ env.Depends("#core/input/default_controller_mappings.gen.cpp", controller_databa
env.CommandNoCache(
"#core/input/default_controller_mappings.gen.cpp",
controller_databases,
- run_in_subprocess(input_builders.make_default_controller_mappings),
+ env.Run(input_builders.make_default_controller_mappings, "Generating default controller mappings."),
)
env.add_source_files(env.core_sources, "*.cpp")
diff --git a/core/io/json.cpp b/core/io/json.cpp
index b90841a5ef..8bdd6385cb 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -265,7 +265,7 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to
if (p_str[index] == '-' || (p_str[index] >= '0' && p_str[index] <= '9')) {
//a number
const CharType *rptr;
- double number = String::to_double(&p_str[index], &rptr);
+ double number = String::to_float(&p_str[index], &rptr);
index += (rptr - &p_str[index]);
r_token.type = TK_NUMBER;
r_token.value = number;
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index 13a49feb6b..735a30f6cc 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -1062,7 +1062,7 @@ Error Expression::_get_token(Token &r_token) {
r_token.type = TK_CONSTANT;
if (is_float) {
- r_token.value = num.to_double();
+ r_token.value = num.to_float();
} else {
r_token.value = num.to_int();
}
diff --git a/core/string_buffer.h b/core/string_buffer.h
index 956a6333d9..f9cf31075a 100644
--- a/core/string_buffer.h
+++ b/core/string_buffer.h
@@ -150,7 +150,7 @@ String StringBuffer<SHORT_BUFFER_SIZE>::as_string() {
template <int SHORT_BUFFER_SIZE>
double StringBuffer<SHORT_BUFFER_SIZE>::as_double() {
current_buffer_ptr()[string_length] = '\0';
- return String::to_double(current_buffer_ptr());
+ return String::to_float(current_buffer_ptr());
}
template <int SHORT_BUFFER_SIZE>
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 572ad1af59..957caf1015 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -851,7 +851,7 @@ Vector<float> String::split_floats(const String &p_splitter, bool p_allow_empty)
end = len;
}
if (p_allow_empty || (end > from)) {
- ret.push_back(String::to_double(&c_str()[from]));
+ ret.push_back(String::to_float(&c_str()[from]));
}
if (end == len) {
@@ -880,7 +880,7 @@ Vector<float> String::split_floats_mk(const Vector<String> &p_splitters, bool p_
}
if (p_allow_empty || (end > from)) {
- ret.push_back(String::to_double(&c_str()[from]));
+ ret.push_back(String::to_float(&c_str()[from]));
}
if (end == len) {
@@ -2006,7 +2006,7 @@ done:
#define READING_EXP 3
#define READING_DONE 4
-double String::to_double(const char *p_str) {
+double String::to_float(const char *p_str) {
#ifndef NO_USE_STDLIB
return built_in_strtod<char>(p_str);
//return atof(p_str); DOES NOT WORK ON ANDROID(??)
@@ -2015,11 +2015,7 @@ double String::to_double(const char *p_str) {
#endif
}
-float String::to_float() const {
- return to_double();
-}
-
-double String::to_double(const CharType *p_str, const CharType **r_end) {
+double String::to_float(const CharType *p_str, const CharType **r_end) {
return built_in_strtod<CharType>(p_str, (CharType **)r_end);
}
@@ -2087,7 +2083,7 @@ int64_t String::to_int(const CharType *p_str, int p_len, bool p_clamp) {
return sign * integer;
}
-double String::to_double() const {
+double String::to_float() const {
if (empty()) {
return 0;
}
diff --git a/core/ustring.h b/core/ustring.h
index e745475f11..d37346fbd6 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -242,15 +242,14 @@ public:
static String md5(const uint8_t *p_md5);
static String hex_encode_buffer(const uint8_t *p_buffer, int p_len);
bool is_numeric() const;
- double to_double() const;
- float to_float() const;
+ double to_float() const;
int64_t hex_to_int(bool p_with_prefix = true) const;
int64_t bin_to_int(bool p_with_prefix = true) const;
int64_t to_int() const;
static int64_t to_int(const char *p_str, int p_len = -1);
- static double to_double(const char *p_str);
- static double to_double(const CharType *p_str, const CharType **r_end = nullptr);
+ static double to_float(const char *p_str);
+ static double to_float(const CharType *p_str, const CharType **r_end = nullptr);
static int64_t to_int(const CharType *p_str, int p_len = -1, bool p_clamp = false);
String capitalize() const;
String camelcase_to_underscore(bool lowercase = true) const;
diff --git a/core/variant.cpp b/core/variant.cpp
index afd01b3359..c19ce79e64 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -1573,7 +1573,7 @@ Variant::operator float() const {
case FLOAT:
return _data._float;
case STRING:
- return operator String().to_double();
+ return operator String().to_float();
default: {
return 0;
}
@@ -1591,7 +1591,7 @@ Variant::operator double() const {
case FLOAT:
return _data._float;
case STRING:
- return operator String().to_double();
+ return operator String().to_float();
default: {
return 0;
}
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 8afa24e63d..b96fd0c103 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -1405,7 +1405,7 @@ Variant Variant::construct(const Variant::Type p_type, const Variant **p_args, i
return (int64_t(*p_args[0]));
}
case FLOAT: {
- return real_t(*p_args[0]);
+ return double(*p_args[0]);
}
case STRING: {
return String(*p_args[0]);
diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml
index bf82e921fb..e8f7a59e4c 100644
--- a/doc/classes/CollisionObject2D.xml
+++ b/doc/classes/CollisionObject2D.xml
@@ -217,7 +217,7 @@
</methods>
<members>
<member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" default="true">
- If [code]true[/code], this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events.
+ If [code]true[/code], this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one [code]collision_layer[/code] bit to be set.
</member>
</members>
<signals>
@@ -229,17 +229,17 @@
<argument index="2" name="shape_idx" type="int">
</argument>
<description>
- Emitted when an input event occurs and [code]input_pickable[/code] is [code]true[/code]. See [method _input_event] for details.
+ Emitted when an input event occurs. Requires [member input_pickable] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set. See [method _input_event] for details.
</description>
</signal>
<signal name="mouse_entered">
<description>
- Emitted when the mouse pointer enters any of this object's shapes.
+ Emitted when the mouse pointer enters any of this object's shapes. Requires [member input_pickable] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set.
</description>
</signal>
<signal name="mouse_exited">
<description>
- Emitted when the mouse pointer exits all this object's shapes.
+ Emitted when the mouse pointer exits all this object's shapes. Requires [member input_pickable] to be [code]true[/code] and at least one [code]collision_layer[/code] bit to be set.
</description>
</signal>
</signals>
diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml
index 5fbe427f67..6f03165a97 100644
--- a/doc/classes/EditorInspector.xml
+++ b/doc/classes/EditorInspector.xml
@@ -20,9 +20,7 @@
</method>
</methods>
<members>
- <member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" override="true" default="false">
- If [code]true[/code], horizontal scrolling is enabled. An horizontal scroll bar will display at the bottom of the inspector.
- </member>
+ <member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" override="true" default="false" />
</members>
<signals>
<signal name="object_id_selected">
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index feac483fc4..f08a15d873 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -122,6 +122,8 @@
<member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed" default="0.65">
Duration (in seconds) of a caret's blinking cycle.
</member>
+ <member name="caret_force_displayed" type="bool" setter="cursor_set_force_displayed" getter="cursor_get_force_displayed" default="false">
+ </member>
<member name="caret_position" type="int" setter="set_cursor_position" getter="get_cursor_position" default="0">
The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it.
</member>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 5b4b5d02fb..26110df335 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -120,7 +120,7 @@
[codeblock]
var arguments = {}
for argument in OS.get_cmdline_args():
- if argument.find("=") > -1:
+ if argument.find("=") &gt; -1:
var key_value = argument.split("=")
arguments[key_value[0].lstrip("--")] = key_value[1]
[/codeblock]
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 733bb559cb..f13dbbae76 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -280,6 +280,10 @@
<member name="debug/gdscript/completion/autocomplete_setters_and_getters" type="bool" setter="" getter="" default="false">
If [code]true[/code], displays getters and setters in autocompletion results in the script editor. This setting is meant to be used when porting old projects (Godot 2), as using member variables is the preferred style from Godot 3 onwards.
</member>
+ <member name="debug/gdscript/warnings/assert_always_false" type="bool" setter="" getter="" default="true">
+ </member>
+ <member name="debug/gdscript/warnings/assert_always_true" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/constant_used_as_function" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a constant is used as a function.
</member>
@@ -292,15 +296,6 @@
<member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true">
If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings.
</member>
- <member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function is declared with the same name as a constant.
- </member>
- <member name="debug/gdscript/warnings/function_conflicts_variable" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function is declared with the same name as a variable. This will turn into an error in a future version when first-class functions become supported in GDScript.
- </member>
- <member name="debug/gdscript/warnings/function_may_yield" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function assigned to a variable may yield and return a function state instead of a value.
- </member>
<member name="debug/gdscript/warnings/function_used_as_property" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when using a function as if it was a property.
</member>
@@ -316,12 +311,16 @@
<member name="debug/gdscript/warnings/property_used_as_function" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when using a property as if it was a function.
</member>
+ <member name="debug/gdscript/warnings/redundant_await" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/return_value_discarded" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when calling a function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the [enum Error] enum.
</member>
<member name="debug/gdscript/warnings/shadowed_variable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when defining a local or subclass member variable that would shadow a variable at an upper level (such as a member variable).
</member>
+ <member name="debug/gdscript/warnings/shadowed_variable_base_class" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/standalone_expression" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when calling an expression that has no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement.
</member>
@@ -340,6 +339,8 @@
<member name="debug/gdscript/warnings/unreachable_code" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when unreachable code is detected (such as after a [code]return[/code] statement that will always be executed).
</member>
+ <member name="debug/gdscript/warnings/unreachable_pattern" type="bool" setter="" getter="" default="true">
+ </member>
<member name="debug/gdscript/warnings/unsafe_call_argument" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when using an expression whose type may not be compatible with the function parameter expected.
</member>
@@ -352,11 +353,11 @@
<member name="debug/gdscript/warnings/unsafe_property_access" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when accessing a property whose presence is not guaranteed at compile-time in the class.
</member>
- <member name="debug/gdscript/warnings/unused_argument" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a function parameter is unused.
+ <member name="debug/gdscript/warnings/unused_local_constant" type="bool" setter="" getter="" default="true">
</member>
- <member name="debug/gdscript/warnings/unused_class_variable" type="bool" setter="" getter="" default="false">
- If [code]true[/code], enables warnings when a member variable is unused.
+ <member name="debug/gdscript/warnings/unused_parameter" type="bool" setter="" getter="" default="true">
+ </member>
+ <member name="debug/gdscript/warnings/unused_private_class_variable" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/unused_signal" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a signal is unused.
@@ -364,9 +365,6 @@
<member name="debug/gdscript/warnings/unused_variable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a local variable is unused.
</member>
- <member name="debug/gdscript/warnings/variable_conflicts_function" type="bool" setter="" getter="" default="true">
- If [code]true[/code], enables warnings when a variable is declared with the same name as a function. This will turn into an error in a future version when first-class functions become supported in GDScript.
- </member>
<member name="debug/gdscript/warnings/void_assignment" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when assigning the result of a function that returns [code]void[/code] to a variable.
</member>
diff --git a/editor/SCsub b/editor/SCsub
index 651dd5fffd..a976c4ed12 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -7,7 +7,6 @@ env.editor_sources = []
import os
import os.path
import glob
-from platform_methods import run_in_subprocess
import editor_builders
@@ -61,7 +60,11 @@ if env["tools"]:
docs = sorted(docs)
env.Depends("#editor/doc_data_compressed.gen.h", docs)
- env.CommandNoCache("#editor/doc_data_compressed.gen.h", docs, run_in_subprocess(editor_builders.make_doc_header))
+ env.CommandNoCache(
+ "#editor/doc_data_compressed.gen.h",
+ docs,
+ env.Run(editor_builders.make_doc_header, "Generating documentation header."),
+ )
path = env.Dir(".").abspath
@@ -69,14 +72,18 @@ if env["tools"]:
tlist = glob.glob(path + "/translations/*.po")
env.Depends("#editor/editor_translations.gen.h", tlist)
env.CommandNoCache(
- "#editor/editor_translations.gen.h", tlist, run_in_subprocess(editor_builders.make_editor_translations_header)
+ "#editor/editor_translations.gen.h",
+ tlist,
+ env.Run(editor_builders.make_editor_translations_header, "Generating editor translations header."),
)
# Documentation translations
tlist = glob.glob(env.Dir("#doc").abspath + "/translations/*.po")
env.Depends("#editor/doc_translations.gen.h", tlist)
env.CommandNoCache(
- "#editor/doc_translations.gen.h", tlist, run_in_subprocess(editor_builders.make_doc_translations_header)
+ "#editor/doc_translations.gen.h",
+ tlist,
+ env.Run(editor_builders.make_doc_translations_header, "Generating translations header."),
)
# Fonts
@@ -84,7 +91,11 @@ if env["tools"]:
flist.extend(glob.glob(path + "/../thirdparty/fonts/*.otf"))
flist.sort()
env.Depends("#editor/builtin_fonts.gen.h", flist)
- env.CommandNoCache("#editor/builtin_fonts.gen.h", flist, run_in_subprocess(editor_builders.make_fonts_header))
+ env.CommandNoCache(
+ "#editor/builtin_fonts.gen.h",
+ flist,
+ env.Run(editor_builders.make_fonts_header, "Generating builtin fonts header."),
+ )
env.add_source_files(env.editor_sources, "*.cpp")
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 7eb5b3094d..ce131e6a05 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -6799,6 +6799,7 @@ EditorNode::EditorNode() {
EditorNode::~EditorNode() {
EditorInspector::cleanup_plugins();
+ EditorTranslationParser::get_singleton()->clean_parsers();
remove_print_handler(&print_handler);
memdelete(EditorHelp::get_doc_data());
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 2d50d25ff5..daafe095ce 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3275,10 +3275,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
if ((p_hint == PROPERTY_HINT_RANGE || p_hint == PROPERTY_HINT_EXP_RANGE) && p_hint_text.get_slice_count(",") >= 2) {
greater = false; //if using ranged, assume false by default
lesser = false;
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
exp_range = p_hint == PROPERTY_HINT_EXP_RANGE;
@@ -3378,10 +3378,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3396,8 +3396,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
hide_slider = false;
}
@@ -3411,10 +3411,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3428,8 +3428,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
hide_slider = false;
}
@@ -3442,10 +3442,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3460,8 +3460,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
hide_slider = false;
}
@@ -3476,10 +3476,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3494,10 +3494,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3511,10 +3511,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3528,10 +3528,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3545,10 +3545,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3562,10 +3562,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
diff --git a/editor/editor_translation_parser.cpp b/editor/editor_translation_parser.cpp
index 3f4864ad1e..da191fbc92 100644
--- a/editor/editor_translation_parser.cpp
+++ b/editor/editor_translation_parser.cpp
@@ -147,6 +147,11 @@ void EditorTranslationParser::remove_parser(const Ref<EditorTranslationParserPlu
}
}
+void EditorTranslationParser::clean_parsers() {
+ standard_parsers.clear();
+ custom_parsers.clear();
+}
+
EditorTranslationParser *EditorTranslationParser::get_singleton() {
if (!singleton) {
singleton = memnew(EditorTranslationParser);
diff --git a/editor/editor_translation_parser.h b/editor/editor_translation_parser.h
index 6d00bedfa4..fb8aa6ec9b 100644
--- a/editor/editor_translation_parser.h
+++ b/editor/editor_translation_parser.h
@@ -64,6 +64,7 @@ public:
Ref<EditorTranslationParserPlugin> get_parser(const String &p_extension) const;
void add_parser(const Ref<EditorTranslationParserPlugin> &p_parser, ParserType p_type);
void remove_parser(const Ref<EditorTranslationParserPlugin> &p_parser, ParserType p_type);
+ void clean_parsers();
EditorTranslationParser();
~EditorTranslationParser();
diff --git a/editor/icons/SCsub b/editor/icons/SCsub
index e143276259..dd4243d750 100644
--- a/editor/icons/SCsub
+++ b/editor/icons/SCsub
@@ -4,14 +4,14 @@ Import("env")
import os
-from platform_methods import run_in_subprocess
import editor_icons_builders
-make_editor_icons_builder = Builder(
- action=run_in_subprocess(editor_icons_builders.make_editor_icons_action), suffix=".h", src_suffix=".svg"
-)
-env["BUILDERS"]["MakeEditorIconsBuilder"] = make_editor_icons_builder
+env["BUILDERS"]["MakeEditorIconsBuilder"] = Builder(
+ action=env.Run(editor_icons_builders.make_editor_icons_action, "Generating editor icons header."),
+ suffix=".h",
+ src_suffix=".svg",
+)
# Editor's own icons
icon_sources = Glob("*.svg")
diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp
index 41e71248a9..8eb68ecdcf 100644
--- a/editor/import/collada.cpp
+++ b/editor/import/collada.cpp
@@ -262,7 +262,7 @@ void Collada::_parse_asset(XMLParser &parser) {
COLLADA_PRINT("up axis: " + parser.get_node_data());
} else if (name == "unit") {
- state.unit_scale = parser.get_attribute_value("meter").to_double();
+ state.unit_scale = parser.get_attribute_value("meter").to_float();
COLLADA_PRINT("unit scale: " + rtos(state.unit_scale));
}
@@ -433,7 +433,7 @@ Transform Collada::_read_transform(XMLParser &parser) {
Vector<float> farr;
farr.resize(16);
for (int i = 0; i < 16; i++) {
- farr.write[i] = array[i].to_double();
+ farr.write[i] = array[i].to_float();
}
return _read_transform_from_array(farr);
@@ -469,7 +469,7 @@ Variant Collada::_parse_param(XMLParser &parser) {
if (parser.get_node_name() == "float") {
parser.read();
if (parser.get_node_type() == XMLParser::NODE_TEXT) {
- data = parser.get_node_data().to_double();
+ data = parser.get_node_data().to_float();
}
} else if (parser.get_node_name() == "float2") {
Vector<float> v2 = _read_float_array(parser);
@@ -735,29 +735,29 @@ void Collada::_parse_camera(XMLParser &parser) {
camera.mode = CameraData::MODE_ORTHOGONAL;
} else if (name == "xfov") {
parser.read();
- camera.perspective.x_fov = parser.get_node_data().to_double();
+ camera.perspective.x_fov = parser.get_node_data().to_float();
} else if (name == "yfov") {
parser.read();
- camera.perspective.y_fov = parser.get_node_data().to_double();
+ camera.perspective.y_fov = parser.get_node_data().to_float();
} else if (name == "xmag") {
parser.read();
- camera.orthogonal.x_mag = parser.get_node_data().to_double();
+ camera.orthogonal.x_mag = parser.get_node_data().to_float();
} else if (name == "ymag") {
parser.read();
- camera.orthogonal.y_mag = parser.get_node_data().to_double();
+ camera.orthogonal.y_mag = parser.get_node_data().to_float();
} else if (name == "aspect_ratio") {
parser.read();
- camera.aspect = parser.get_node_data().to_double();
+ camera.aspect = parser.get_node_data().to_float();
} else if (name == "znear") {
parser.read();
- camera.z_near = parser.get_node_data().to_double();
+ camera.z_near = parser.get_node_data().to_float();
} else if (name == "zfar") {
parser.read();
- camera.z_far = parser.get_node_data().to_double();
+ camera.z_far = parser.get_node_data().to_float();
}
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "camera") {
@@ -806,20 +806,20 @@ void Collada::_parse_light(XMLParser &parser) {
} else if (name == "constant_attenuation") {
parser.read();
- light.constant_att = parser.get_node_data().to_double();
+ light.constant_att = parser.get_node_data().to_float();
} else if (name == "linear_attenuation") {
parser.read();
- light.linear_att = parser.get_node_data().to_double();
+ light.linear_att = parser.get_node_data().to_float();
} else if (name == "quadratic_attenuation") {
parser.read();
- light.quad_att = parser.get_node_data().to_double();
+ light.quad_att = parser.get_node_data().to_float();
} else if (name == "falloff_angle") {
parser.read();
- light.spot_angle = parser.get_node_data().to_double();
+ light.spot_angle = parser.get_node_data().to_float();
} else if (name == "falloff_exponent") {
parser.read();
- light.spot_exp = parser.get_node_data().to_double();
+ light.spot_exp = parser.get_node_data().to_float();
}
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "light") {
@@ -1877,10 +1877,10 @@ void Collada::_parse_animation_clip(XMLParser &parser) {
clip.name = parser.get_attribute_value("id");
}
if (parser.has_attribute("start")) {
- clip.begin = parser.get_attribute_value("start").to_double();
+ clip.begin = parser.get_attribute_value("start").to_float();
}
if (parser.has_attribute("end")) {
- clip.end = parser.get_attribute_value("end").to_double();
+ clip.end = parser.get_attribute_value("end").to_float();
}
while (parser.read() == OK) {
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index af1d266832..6e4a39d3f0 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -744,7 +744,7 @@ void AnimationPlayerEditor::_dialog_action(String p_path) {
}
void AnimationPlayerEditor::_scale_changed(const String &p_scale) {
- player->set_speed_scale(p_scale.to_double());
+ player->set_speed_scale(p_scale.to_float());
}
void AnimationPlayerEditor::_update_animation() {
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 6f209c512e..b4b81cc7f0 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -4689,9 +4689,9 @@ void Node3DEditor::edit(Node3D *p_spatial) {
}
void Node3DEditor::_snap_changed() {
- snap_translate_value = snap_translate->get_text().to_double();
- snap_rotate_value = snap_rotate->get_text().to_double();
- snap_scale_value = snap_scale->get_text().to_double();
+ snap_translate_value = snap_translate->get_text().to_float();
+ snap_rotate_value = snap_rotate->get_text().to_float();
+ snap_scale_value = snap_scale->get_text().to_float();
}
void Node3DEditor::_snap_update() {
@@ -4708,9 +4708,9 @@ void Node3DEditor::_xform_dialog_action() {
Vector3 translate;
for (int i = 0; i < 3; i++) {
- translate[i] = xform_translate[i]->get_text().to_double();
- rotate[i] = Math::deg2rad(xform_rotate[i]->get_text().to_double());
- scale[i] = xform_scale[i]->get_text().to_double();
+ translate[i] = xform_translate[i]->get_text().to_float();
+ rotate[i] = Math::deg2rad(xform_rotate[i]->get_text().to_float());
+ scale[i] = xform_scale[i]->get_text().to_float();
}
t.basis.scale(scale);
@@ -6432,9 +6432,9 @@ Vector3 Node3DEditor::snap_point(Vector3 p_target, Vector3 p_start) const {
float Node3DEditor::get_translate_snap() const {
float snap_value;
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
- snap_value = snap_translate->get_text().to_double() / 10.0;
+ snap_value = snap_translate->get_text().to_float() / 10.0;
} else {
- snap_value = snap_translate->get_text().to_double();
+ snap_value = snap_translate->get_text().to_float();
}
return snap_value;
@@ -6443,9 +6443,9 @@ float Node3DEditor::get_translate_snap() const {
float Node3DEditor::get_rotate_snap() const {
float snap_value;
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
- snap_value = snap_rotate->get_text().to_double() / 3.0;
+ snap_value = snap_rotate->get_text().to_float() / 3.0;
} else {
- snap_value = snap_rotate->get_text().to_double();
+ snap_value = snap_rotate->get_text().to_float();
}
return snap_value;
@@ -6454,9 +6454,9 @@ float Node3DEditor::get_rotate_snap() const {
float Node3DEditor::get_scale_snap() const {
float snap_value;
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
- snap_value = snap_scale->get_text().to_double() / 2.0;
+ snap_value = snap_scale->get_text().to_float() / 2.0;
} else {
- snap_value = snap_scale->get_text().to_double();
+ snap_value = snap_scale->get_text().to_float();
}
return snap_value;
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 516c14329c..1073da7d8c 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -458,7 +458,7 @@ void SpriteFramesEditor::_animation_select() {
}
if (frames->has_animation(edited_anim)) {
- double value = anim_speed->get_line_edit()->get_text().to_double();
+ double value = anim_speed->get_line_edit()->get_text().to_float();
if (!Math::is_equal_approx(value, frames->get_animation_speed(edited_anim))) {
_animation_fps_changed(value);
}
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index c9115fb870..cb56358ae6 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -368,18 +368,18 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
float min = 0, max = 100, step = type == Variant::FLOAT ? .01 : 1;
if (c >= 1) {
if (!hint_text.get_slice(",", 0).empty()) {
- min = hint_text.get_slice(",", 0).to_double();
+ min = hint_text.get_slice(",", 0).to_float();
}
}
if (c >= 2) {
if (!hint_text.get_slice(",", 1).empty()) {
- max = hint_text.get_slice(",", 1).to_double();
+ max = hint_text.get_slice(",", 1).to_float();
}
}
if (c >= 3) {
if (!hint_text.get_slice(",", 2).empty()) {
- step = hint_text.get_slice(",", 2).to_double();
+ step = hint_text.get_slice(",", 2).to_float();
}
}
@@ -1590,7 +1590,7 @@ real_t CustomPropertyEditor::_parse_real_expression(String text) {
Error err = expr->parse(text);
real_t out;
if (err != OK) {
- out = value_editor[0]->get_text().to_double();
+ out = value_editor[0]->get_text().to_float();
} else {
out = expr->execute(Array(), nullptr, false);
}
diff --git a/main/SCsub b/main/SCsub
index 97f77840f1..ebadefd450 100644
--- a/main/SCsub
+++ b/main/SCsub
@@ -2,7 +2,6 @@
Import("env")
-from platform_methods import run_in_subprocess
import main_builders
env.main_sources = []
@@ -15,15 +14,21 @@ if env["tests"]:
env_main.Append(CPPDEFINES=["TESTS_ENABLED"])
env_main.Depends("#main/splash.gen.h", "#main/splash.png")
-env_main.CommandNoCache("#main/splash.gen.h", "#main/splash.png", run_in_subprocess(main_builders.make_splash))
+env_main.CommandNoCache(
+ "#main/splash.gen.h", "#main/splash.png", env.Run(main_builders.make_splash, "Building splash screen header."),
+)
env_main.Depends("#main/splash_editor.gen.h", "#main/splash_editor.png")
env_main.CommandNoCache(
- "#main/splash_editor.gen.h", "#main/splash_editor.png", run_in_subprocess(main_builders.make_splash_editor)
+ "#main/splash_editor.gen.h",
+ "#main/splash_editor.png",
+ env.Run(main_builders.make_splash_editor, "Building editor splash screen header."),
)
env_main.Depends("#main/app_icon.gen.h", "#main/app_icon.png")
-env_main.CommandNoCache("#main/app_icon.gen.h", "#main/app_icon.png", run_in_subprocess(main_builders.make_app_icon))
+env_main.CommandNoCache(
+ "#main/app_icon.gen.h", "#main/app_icon.png", env.Run(main_builders.make_app_icon, "Building application icon."),
+)
lib = env_main.add_library("main", env.main_sources)
env.Prepend(LIBS=[lib])
diff --git a/main/main.cpp b/main/main.cpp
index 6965e5415a..9978be7ab7 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -879,7 +879,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "--time-scale") { // force time scale
if (I->next()) {
- Engine::get_singleton()->set_time_scale(I->next()->get().to_double());
+ Engine::get_singleton()->set_time_scale(I->next()->get().to_float());
N = I->next()->next();
} else {
OS::get_singleton()->print("Missing time scale argument, aborting.\n");
@@ -2017,7 +2017,7 @@ bool Main::start() {
String stretch_mode = GLOBAL_DEF("display/window/stretch/mode", "disabled");
String stretch_aspect = GLOBAL_DEF("display/window/stretch/aspect", "ignore");
- Size2i stretch_size = Size2(GLOBAL_DEF("display/window/size/width", 0),
+ Size2i stretch_size = Size2i(GLOBAL_DEF("display/window/size/width", 0),
GLOBAL_DEF("display/window/size/height", 0));
Window::ContentScaleMode cs_sm = Window::CONTENT_SCALE_MODE_DISABLED;
diff --git a/methods.py b/methods.py
index fe93db4797..65b0e2dd6b 100644
--- a/methods.py
+++ b/methods.py
@@ -4,6 +4,11 @@ import glob
import subprocess
from collections import OrderedDict
+# We need to define our own `Action` method to control the verbosity of output
+# and whenever we need to run those commands in a subprocess on some platforms.
+from SCons.Script import Action
+from platform_methods import run_in_subprocess
+
def add_source_files(self, sources, files, warn_duplicates=True):
# Convert string to list of absolute paths (including expanding wildcard)
@@ -621,6 +626,14 @@ def CommandNoCache(env, target, sources, command, **args):
return result
+def Run(env, function, short_message, subprocess=True):
+ output_print = short_message if not env["verbose"] else ""
+ if not subprocess:
+ return Action(function, output_print)
+ else:
+ return Action(run_in_subprocess(function), output_print)
+
+
def detect_darwin_sdk_path(platform, env):
sdk_name = ""
if platform == "osx":
diff --git a/modules/SCsub b/modules/SCsub
index 2d774306e4..edfc4ed9c6 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -10,14 +10,28 @@ env_modules = env.Clone()
Export("env_modules")
# Header with MODULE_*_ENABLED defines.
-env.CommandNoCache("modules_enabled.gen.h", Value(env.module_list), modules_builders.generate_modules_enabled)
+env.CommandNoCache(
+ "modules_enabled.gen.h",
+ Value(env.module_list),
+ env.Run(
+ modules_builders.generate_modules_enabled,
+ "Generating enabled modules header.",
+ # NOTE: No need to run in subprocess since this is still executed serially.
+ subprocess=False,
+ ),
+)
# Header to be included in `tests/test_main.cpp` to run module-specific tests.
if env["tests"]:
env.CommandNoCache(
"modules_tests.gen.h",
Value(env.module_list),
- Action(modules_builders.generate_modules_tests, "Generating modules tests header."),
+ env.Run(
+ modules_builders.generate_modules_tests,
+ "Generating modules tests header.",
+ # NOTE: No need to run in subprocess since this is still executed serially.
+ subprocess=False,
+ ),
)
env.AlwaysBuild("modules_tests.gen.h")
diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp
index e1f950dad1..f82648d6ff 100644
--- a/modules/bullet/godot_result_callbacks.cpp
+++ b/modules/bullet/godot_result_callbacks.cpp
@@ -57,7 +57,7 @@ bool GodotFilterCallback::needBroadphaseCollision(btBroadphaseProxy *proxy0, btB
bool GodotClosestRayResultCallback::needsCollision(btBroadphaseProxy *proxy0) const {
const bool needs = GodotFilterCallback::test_collision_filters(m_collisionFilterGroup, m_collisionFilterMask, proxy0->m_collisionFilterGroup, proxy0->m_collisionFilterMask);
- if (m_pickRay || needs) {
+ if (needs) {
btCollisionObject *btObj = static_cast<btCollisionObject *>(proxy0->m_clientObject);
CollisionObjectBullet *gObj = static_cast<CollisionObjectBullet *>(btObj->getUserPointer());
diff --git a/modules/denoise/SCsub b/modules/denoise/SCsub
index 0fa65c6296..bf3bd7d073 100644
--- a/modules/denoise/SCsub
+++ b/modules/denoise/SCsub
@@ -1,7 +1,6 @@
#!/usr/bin/env python
import resource_to_cpp
-from platform_methods import run_in_subprocess
Import("env")
Import("env_modules")
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub
index cab05549d2..0e2291c1f9 100644
--- a/modules/gdnative/SCsub
+++ b/modules/gdnative/SCsub
@@ -22,13 +22,12 @@ SConscript("pluginscript/SCsub")
SConscript("videodecoder/SCsub")
-from platform_methods import run_in_subprocess
import gdnative_builders
_, gensource = env_gdnative.CommandNoCache(
["include/gdnative_api_struct.gen.h", "gdnative_api_struct.gen.cpp"],
"gdnative_api.json",
- run_in_subprocess(gdnative_builders.build_gdnative_api_struct),
+ env.Run(gdnative_builders.build_gdnative_api_struct, "Generating GDNative API."),
)
env_gdnative.add_source_files(env.modules_sources, [gensource])
diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp
index 8b0c7474e8..26c40b625c 100644
--- a/modules/gdnative/gdnative/string.cpp
+++ b/modules/gdnative/gdnative/string.cpp
@@ -541,13 +541,7 @@ godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_f
return result;
}
-double GDAPI godot_string_to_double(const godot_string *p_self) {
- const String *self = (const String *)p_self;
-
- return self->to_double();
-}
-
-godot_real GDAPI godot_string_to_float(const godot_string *p_self) {
+double GDAPI godot_string_to_float(const godot_string *p_self) {
const String *self = (const String *)p_self;
return self->to_float();
@@ -583,8 +577,8 @@ godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_s
return result;
}
-double GDAPI godot_string_char_to_double(const char *p_what) {
- return String::to_double(p_what);
+double GDAPI godot_string_char_to_float(const char *p_what) {
+ return String::to_float(p_what);
}
godot_int GDAPI godot_string_char_to_int(const char *p_what) {
@@ -621,8 +615,8 @@ int64_t GDAPI godot_string_to_int64(const godot_string *p_self) {
return self->to_int();
}
-double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end) {
- return String::to_double(p_str, r_end);
+double GDAPI godot_string_unicode_char_to_float(const wchar_t *p_str, const wchar_t **r_end) {
+ return String::to_float(p_str, r_end);
}
godot_string GDAPI godot_string_get_slice(const godot_string *p_self, godot_string p_splitter, godot_int p_slice) {
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index 9852928d22..8ccf44ff1a 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -4237,15 +4237,8 @@
]
},
{
- "name": "godot_string_to_double",
- "return_type": "double",
- "arguments": [
- ["const godot_string *", "p_self"]
- ]
- },
- {
"name": "godot_string_to_float",
- "return_type": "godot_real",
+ "return_type": "double",
"arguments": [
["const godot_string *", "p_self"]
]
@@ -4279,7 +4272,7 @@
]
},
{
- "name": "godot_string_char_to_double",
+ "name": "godot_string_char_to_float",
"return_type": "double",
"arguments": [
["const char *", "p_what"]
@@ -4337,7 +4330,7 @@
]
},
{
- "name": "godot_string_unicode_char_to_double",
+ "name": "godot_string_unicode_char_to_float",
"return_type": "double",
"arguments": [
["const wchar_t *", "p_str"],
diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h
index dfd4fcab89..d89383dc1b 100644
--- a/modules/gdnative/include/gdnative/string.h
+++ b/modules/gdnative/include/gdnative/string.h
@@ -145,14 +145,13 @@ godot_string GDAPI godot_string_rpad_with_custom_character(const godot_string *p
godot_real GDAPI godot_string_similarity(const godot_string *p_self, const godot_string *p_string);
godot_string GDAPI godot_string_sprintf(const godot_string *p_self, const godot_array *p_values, godot_bool *p_error);
godot_string GDAPI godot_string_substr(const godot_string *p_self, godot_int p_from, godot_int p_chars);
-double GDAPI godot_string_to_double(const godot_string *p_self);
-godot_real GDAPI godot_string_to_float(const godot_string *p_self);
+double GDAPI godot_string_to_float(const godot_string *p_self);
godot_int GDAPI godot_string_to_int(const godot_string *p_self);
godot_string GDAPI godot_string_camelcase_to_underscore(const godot_string *p_self);
godot_string GDAPI godot_string_camelcase_to_underscore_lowercased(const godot_string *p_self);
godot_string GDAPI godot_string_capitalize(const godot_string *p_self);
-double GDAPI godot_string_char_to_double(const char *p_what);
+double GDAPI godot_string_char_to_float(const char *p_what);
godot_int GDAPI godot_string_char_to_int(const char *p_what);
int64_t GDAPI godot_string_wchar_to_int(const wchar_t *p_str);
godot_int GDAPI godot_string_char_to_int_with_len(const char *p_what, godot_int p_len);
@@ -160,7 +159,7 @@ int64_t GDAPI godot_string_char_to_int64_with_len(const wchar_t *p_str, int p_le
int64_t GDAPI godot_string_hex_to_int64(const godot_string *p_self);
int64_t GDAPI godot_string_hex_to_int64_with_prefix(const godot_string *p_self);
int64_t GDAPI godot_string_to_int64(const godot_string *p_self);
-double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end);
+double GDAPI godot_string_unicode_char_to_float(const wchar_t *p_str, const wchar_t **r_end);
godot_int GDAPI godot_string_get_slice_count(const godot_string *p_self, godot_string p_splitter);
godot_string GDAPI godot_string_get_slice(const godot_string *p_self, godot_string p_splitter, godot_int p_slice);
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index d8825ecc9a..c86b974f47 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -1367,42 +1367,6 @@
[code]wrapi[/code] is more flexible than using the [method posmod] approach by giving the user control over the minimum value.
</description>
</method>
- <method name="yield">
- <return type="GDScriptFunctionState">
- </return>
- <argument index="0" name="object" type="Object" default="null">
- </argument>
- <argument index="1" name="signal" type="String" default="&quot;&quot;">
- </argument>
- <description>
- Stops the function execution and returns the current suspended state to the calling function.
- From the caller, call [method GDScriptFunctionState.resume] on the state to resume execution. This invalidates the state. Within the resumed function, [code]yield()[/code] returns whatever was passed to the [code]resume()[/code] function call.
- If passed an object and a signal, the execution is resumed when the object emits the given signal. In this case, [code]yield()[/code] returns the argument passed to [code]emit_signal()[/code] if the signal takes only one argument, or an array containing all the arguments passed to [code]emit_signal()[/code] if the signal takes multiple arguments.
- You can also use [code]yield[/code] to wait for a function to finish:
- [codeblock]
- func _ready():
- yield(countdown(), "completed") # waiting for the countdown() function to complete
- print('Ready')
-
- func countdown():
- yield(get_tree(), "idle_frame") # returns a GDScriptFunctionState object to _ready()
- print(3)
- yield(get_tree().create_timer(1.0), "timeout")
- print(2)
- yield(get_tree().create_timer(1.0), "timeout")
- print(1)
- yield(get_tree().create_timer(1.0), "timeout")
-
- # prints:
- # 3
- # 2
- # 1
- # Ready
- [/codeblock]
- When yielding on a function, the [code]completed[/code] signal will be emitted automatically when the function returns. It can, therefore, be used as the [code]signal[/code] parameter of the [code]yield[/code] method to resume.
- In order to yield on a function, the resulting function should also return a [code]GDScriptFunctionState[/code]. Notice [code]yield(get_tree(), "idle_frame")[/code] from the above example.
- </description>
- </method>
</methods>
<constants>
<constant name="PI" value="3.141593">
diff --git a/modules/gdscript/doc_classes/GDScriptFunctionState.xml b/modules/gdscript/doc_classes/GDScriptFunctionState.xml
index 9a73764646..5e369b32d9 100644
--- a/modules/gdscript/doc_classes/GDScriptFunctionState.xml
+++ b/modules/gdscript/doc_classes/GDScriptFunctionState.xml
@@ -4,7 +4,8 @@
State of a function call after yielding.
</brief_description>
<description>
- Calling [method @GDScript.yield] within a function will cause that function to yield and return its current state as an object of this type. The yielded function call can then be resumed later by calling [method resume] on this state object.
+ FIXME: Outdated docs as of GDScript rewrite in 4.0.
+ Calling [code]yield[/code] within a function will cause that function to yield and return its current state as an object of this type. The yielded function call can then be resumed later by calling [method resume] on this state object.
</description>
<tutorials>
</tutorials>
@@ -26,7 +27,7 @@
</argument>
<description>
Resume execution of the yielded function call.
- If handed an argument, return the argument from the [method @GDScript.yield] call in the yielded function call. You can pass e.g. an [Array] to hand multiple arguments.
+ If handed an argument, return the argument from the [code]yield[/code] call in the yielded function call. You can pass e.g. an [Array] to hand multiple arguments.
This function returns what the resumed function call returns, possibly another function state if yielded again.
</description>
</method>
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 0843a54106..4098425518 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -1430,6 +1430,12 @@ void GDScriptAnalyzer::reduce_assignment(GDScriptParser::AssignmentNode *p_assig
}
void GDScriptAnalyzer::reduce_await(GDScriptParser::AwaitNode *p_await) {
+ if (p_await->to_await == nullptr) {
+ GDScriptParser::DataType await_type;
+ await_type.kind = GDScriptParser::DataType::VARIANT;
+ p_await->set_datatype(await_type);
+ return;
+ }
if (p_await->to_await->type == GDScriptParser::Node::CALL) {
reduce_call(static_cast<GDScriptParser::CallNode *>(p_await->to_await), true);
} else {
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp
index d230173e9a..7a4bdd88ba 100644
--- a/modules/gdscript/gdscript_tokenizer.cpp
+++ b/modules/gdscript/gdscript_tokenizer.cpp
@@ -646,7 +646,7 @@ GDScriptTokenizer::Token GDScriptTokenizer::number() {
int64_t value = number.bin_to_int();
return make_literal(value);
} else if (has_decimal || has_exponent) {
- double value = number.to_double();
+ double value = number.to_float();
return make_literal(value);
} else {
int64_t value = number.to_int();
diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp
index 23c7f97b5a..5c1d2f6f1b 100644
--- a/modules/gdscript/register_types.cpp
+++ b/modules/gdscript/register_types.cpp
@@ -57,8 +57,6 @@ GDScriptCache *gdscript_cache = nullptr;
#include "language_server/gdscript_language_server.h"
#endif // !GDSCRIPT_NO_LSP
-Ref<GDScriptEditorTranslationParserPlugin> gdscript_translation_parser_plugin;
-
class EditorExportGDScript : public EditorExportPlugin {
GDCLASS(EditorExportGDScript, EditorExportPlugin);
@@ -122,6 +120,7 @@ void register_gdscript_types() {
#ifdef TOOLS_ENABLED
EditorNode::add_init_callback(_editor_init);
+ Ref<GDScriptEditorTranslationParserPlugin> gdscript_translation_parser_plugin;
gdscript_translation_parser_plugin.instance();
EditorTranslationParser::get_singleton()->add_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD);
#endif // TOOLS_ENABLED
@@ -143,9 +142,4 @@ void unregister_gdscript_types() {
ResourceSaver::remove_resource_format_saver(resource_saver_gd);
resource_saver_gd.unref();
-
-#ifdef TOOLS_ENABLED
- EditorTranslationParser::get_singleton()->remove_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD);
- gdscript_translation_parser_plugin.unref();
-#endif // TOOLS_ENABLED
}
diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp
index 012ccd5339..430c82953e 100644
--- a/modules/mono/editor/script_class_parser.cpp
+++ b/modules/mono/editor/script_class_parser.cpp
@@ -235,7 +235,7 @@ ScriptClassParser::Token ScriptClassParser::get_token() {
if (code[idx] == '-' || (code[idx] >= '0' && code[idx] <= '9')) {
//a number
const CharType *rptr;
- double number = String::to_double(&code[idx], &rptr);
+ double number = String::to_float(&code[idx], &rptr);
idx += (rptr - &code[idx]);
value = number;
return TK_NUMBER;
diff --git a/modules/mono/mono_gd/gd_mono_assembly.cpp b/modules/mono/mono_gd/gd_mono_assembly.cpp
index a170fd36e7..9dbeee57ce 100644
--- a/modules/mono/mono_gd/gd_mono_assembly.cpp
+++ b/modules/mono/mono_gd/gd_mono_assembly.cpp
@@ -425,7 +425,7 @@ GDMonoClass *GDMonoAssembly::get_object_derived_class(const StringName &p_class)
while (!nested_classes.empty()) {
GDMonoClass *current_nested = nested_classes.front()->get();
- nested_classes.pop_back();
+ nested_classes.pop_front();
void *iter = nullptr;
diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp
index bd41117497..2ac7793b8c 100644
--- a/modules/visual_script/visual_script_expression.cpp
+++ b/modules/visual_script/visual_script_expression.cpp
@@ -489,7 +489,7 @@ Error VisualScriptExpression::_get_token(Token &r_token) {
r_token.type = TK_CONSTANT;
if (is_float) {
- r_token.value = num.to_double();
+ r_token.value = num.to_float();
} else {
r_token.value = num.to_int();
}
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 8d3257a365..6f8a968c82 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -2080,6 +2080,93 @@ public:
return OK;
}
+ Error sign_apk(const Ref<EditorExportPreset> &p_preset, bool p_debug, String apk_path, EditorProgress ep) {
+ String release_keystore = p_preset->get("keystore/release");
+ String release_username = p_preset->get("keystore/release_user");
+ String release_password = p_preset->get("keystore/release_password");
+
+ String jarsigner = EditorSettings::get_singleton()->get("export/android/jarsigner");
+ if (!FileAccess::exists(jarsigner)) {
+ EditorNode::add_io_error("'jarsigner' could not be found.\nPlease supply a path in the Editor Settings.\nThe resulting APK is unsigned.");
+ return OK;
+ }
+
+ String keystore;
+ String password;
+ String user;
+ if (p_debug) {
+ keystore = p_preset->get("keystore/debug");
+ password = p_preset->get("keystore/debug_password");
+ user = p_preset->get("keystore/debug_user");
+
+ if (keystore.empty()) {
+ keystore = EditorSettings::get_singleton()->get("export/android/debug_keystore");
+ password = EditorSettings::get_singleton()->get("export/android/debug_keystore_pass");
+ user = EditorSettings::get_singleton()->get("export/android/debug_keystore_user");
+ }
+
+ if (ep.step("Signing debug APK...", 103)) {
+ return ERR_SKIP;
+ }
+
+ } else {
+ keystore = release_keystore;
+ password = release_password;
+ user = release_username;
+
+ if (ep.step("Signing release APK...", 103)) {
+ return ERR_SKIP;
+ }
+ }
+
+ if (!FileAccess::exists(keystore)) {
+ EditorNode::add_io_error("Could not find keystore, unable to export.");
+ return ERR_FILE_CANT_OPEN;
+ }
+
+ List<String> args;
+ args.push_back("-digestalg");
+ args.push_back("SHA-256");
+ args.push_back("-sigalg");
+ args.push_back("SHA256withRSA");
+ String tsa_url = EditorSettings::get_singleton()->get("export/android/timestamping_authority_url");
+ if (tsa_url != "") {
+ args.push_back("-tsa");
+ args.push_back(tsa_url);
+ }
+ args.push_back("-verbose");
+ args.push_back("-keystore");
+ args.push_back(keystore);
+ args.push_back("-storepass");
+ args.push_back(password);
+ args.push_back(apk_path);
+ args.push_back(user);
+ int retval;
+ OS::get_singleton()->execute(jarsigner, args, true, NULL, NULL, &retval);
+ if (retval) {
+ EditorNode::add_io_error("'jarsigner' returned with error #" + itos(retval));
+ return ERR_CANT_CREATE;
+ }
+
+ if (ep.step("Verifying APK...", 104)) {
+ return ERR_SKIP;
+ }
+
+ args.clear();
+ args.push_back("-verify");
+ args.push_back("-keystore");
+ args.push_back(keystore);
+ args.push_back(apk_path);
+ args.push_back("-verbose");
+
+ OS::get_singleton()->execute(jarsigner, args, true, NULL, NULL, &retval);
+ if (retval) {
+ EditorNode::add_io_error("'jarsigner' verification of APK failed. Make sure to use a jarsigner from OpenJDK 8.");
+ return ERR_CANT_CREATE;
+ }
+ return OK;
+ }
+
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override {
ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags);
@@ -2249,10 +2336,6 @@ public:
bool apk_expansion = p_preset->get("apk_expansion/enable");
String apk_expansion_pkey = p_preset->get("apk_expansion/public_key");
- String release_keystore = p_preset->get("keystore/release");
- String release_username = p_preset->get("keystore/release_user");
- String release_password = p_preset->get("keystore/release_password");
-
Vector<String> enabled_abis = get_enabled_abis(p_preset);
// Prepare images to be resized for the icons. If some image ends up being uninitialized, the default image from the export template will be used.
@@ -2404,84 +2487,9 @@ public:
}
if (_signed) {
- String jarsigner = EditorSettings::get_singleton()->get("export/android/jarsigner");
- if (!FileAccess::exists(jarsigner)) {
- EditorNode::add_io_error("'jarsigner' could not be found.\nPlease supply a path in the Editor Settings.\nThe resulting APK is unsigned.");
- CLEANUP_AND_RETURN(OK);
- }
-
- String keystore;
- String password;
- String user;
- if (p_debug) {
- keystore = p_preset->get("keystore/debug");
- password = p_preset->get("keystore/debug_password");
- user = p_preset->get("keystore/debug_user");
-
- if (keystore.empty()) {
- keystore = EditorSettings::get_singleton()->get("export/android/debug_keystore");
- password = EditorSettings::get_singleton()->get("export/android/debug_keystore_pass");
- user = EditorSettings::get_singleton()->get("export/android/debug_keystore_user");
- }
-
- if (ep.step("Signing debug APK...", 103)) {
- CLEANUP_AND_RETURN(ERR_SKIP);
- }
-
- } else {
- keystore = release_keystore;
- password = release_password;
- user = release_username;
-
- if (ep.step("Signing release APK...", 103)) {
- CLEANUP_AND_RETURN(ERR_SKIP);
- }
- }
-
- if (!FileAccess::exists(keystore)) {
- EditorNode::add_io_error("Could not find keystore, unable to export.");
- CLEANUP_AND_RETURN(ERR_FILE_CANT_OPEN);
- }
-
- List<String> args;
- args.push_back("-digestalg");
- args.push_back("SHA-256");
- args.push_back("-sigalg");
- args.push_back("SHA256withRSA");
- String tsa_url = EditorSettings::get_singleton()->get("export/android/timestamping_authority_url");
- if (tsa_url != "") {
- args.push_back("-tsa");
- args.push_back(tsa_url);
- }
- args.push_back("-verbose");
- args.push_back("-keystore");
- args.push_back(keystore);
- args.push_back("-storepass");
- args.push_back(password);
- args.push_back(tmp_unaligned_path);
- args.push_back(user);
- int retval;
- OS::get_singleton()->execute(jarsigner, args, true, nullptr, nullptr, &retval);
- if (retval) {
- EditorNode::add_io_error("'jarsigner' returned with error #" + itos(retval));
- CLEANUP_AND_RETURN(ERR_CANT_CREATE);
- }
-
- if (ep.step("Verifying APK...", 104)) {
- CLEANUP_AND_RETURN(ERR_SKIP);
- }
-
- args.clear();
- args.push_back("-verify");
- args.push_back("-keystore");
- args.push_back(keystore);
- args.push_back(tmp_unaligned_path);
- args.push_back("-verbose");
-
- OS::get_singleton()->execute(jarsigner, args, true, nullptr, nullptr, &retval);
- if (retval) {
- EditorNode::add_io_error("'jarsigner' verification of APK failed. Make sure to use a jarsigner from OpenJDK 8.");
- CLEANUP_AND_RETURN(ERR_CANT_CREATE);
+ err = sign_apk(p_preset, p_debug, tmp_unaligned_path, ep);
+ if (err != OK) {
+ CLEANUP_AND_RETURN(err);
}
}
diff --git a/platform_methods.py b/platform_methods.py
index 805d7de82a..ec394d76d8 100644
--- a/platform_methods.py
+++ b/platform_methods.py
@@ -44,11 +44,12 @@ def run_in_subprocess(builder_function):
json.dump(data, json_file, indent=2)
json_file_size = os.stat(json_path).st_size
- print(
- "Executing builder function in subprocess: "
- "module_path=%r, parameter_file=%r, parameter_file_size=%r, target=%r, source=%r"
- % (module_path, json_path, json_file_size, target, source)
- )
+ if env["verbose"]:
+ print(
+ "Executing builder function in subprocess: "
+ "module_path=%r, parameter_file=%r, parameter_file_size=%r, target=%r, source=%r"
+ % (module_path, json_path, json_file_size, target, source)
+ )
try:
exit_code = subprocess.call([sys.executable, module_path, json_path], env=subprocess_env)
finally:
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 572be8d901..41cd67dbf1 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -2898,7 +2898,7 @@ Dictionary RichTextLabel::parse_expressions_for_values(Vector<String> p_expressi
a.append(false);
}
} else if (!decimal.search(values[j]).is_null()) {
- a.append(values[j].to_double());
+ a.append(values[j].to_float());
} else if (!numerical.search(values[j]).is_null()) {
a.append(values[j].to_int());
} else {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index eeb7f9430d..5057f84192 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1971,7 +1971,7 @@ void Tree::_text_editor_enter(String p_text) {
//popup_edited_item->edited_signal.call( popup_edited_item_col );
} break;
case TreeItem::CELL_MODE_RANGE: {
- c.val = p_text.to_double();
+ c.val = p_text.to_float();
if (c.step > 0) {
c.val = Math::stepify(c.val, c.step);
}
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 75b3d7a73d..2449b3bd35 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -875,8 +875,12 @@ void SceneTree::_call_input_pause(const StringName &p_group, const StringName &p
continue;
}
- n->call(p_method, (const Variant **)v, 1);
- //ERR_FAIL_COND(node_count != g.nodes.size());
+ Callable::CallError err;
+ // Call both script and native method.
+ if (n->get_script_instance()) {
+ n->get_script_instance()->call(p_method, (const Variant **)v, 1, err);
+ }
+ n->call(p_method, (const Variant **)v, 1, err);
}
call_lock--;
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 16d0325881..d962171555 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1607,7 +1607,17 @@ void Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
}
if (control->data.mouse_filter != Control::MOUSE_FILTER_IGNORE) {
- control->call(SceneStringNames::get_singleton()->_gui_input, ev);
+ // Call both script and native methods.
+ Callable::CallError error;
+ Variant event = ev;
+ const Variant *args[1] = { &event };
+ if (control->get_script_instance()) {
+ control->get_script_instance()->call(SceneStringNames::get_singleton()->_gui_input, args, 1, error);
+ }
+ MethodBind *method = ClassDB::get_method(control->get_class_name(), SceneStringNames::get_singleton()->_gui_input);
+ if (method) {
+ method->call(control, args, 1, error);
+ }
}
if (!control->is_inside_tree() || control->is_set_as_toplevel()) {
@@ -2989,10 +2999,8 @@ void Viewport::unhandled_input(const Ref<InputEvent> &p_event, bool p_local_coor
}
get_tree()->_call_input_pause(unhandled_input_group, "_unhandled_input", ev, this);
- //call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_input","_unhandled_input",ev);
if (!is_input_handled() && Object::cast_to<InputEventKey>(*ev) != nullptr) {
get_tree()->_call_input_pause(unhandled_key_input_group, "_unhandled_key_input", ev, this);
- //call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_key_input","_unhandled_key_input",ev);
}
if (physics_object_picking && !is_input_handled()) {
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index 2083caf4c3..966dcbd651 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -34,9 +34,8 @@
#include "core/os/os.h"
#include "core/pair.h"
#include "physics_server_2d_sw.h"
-
-_FORCE_INLINE_ static bool _can_collide_with(CollisionObject2DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_ignore_layers = false) {
- if (!p_ignore_layers && !(p_object->get_collision_layer() & p_collision_mask)) {
+_FORCE_INLINE_ static bool _can_collide_with(CollisionObject2DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+ if (!(p_object->get_collision_layer() & p_collision_mask)) {
return false;
}
@@ -65,7 +64,7 @@ int PhysicsDirectSpaceState2DSW::_intersect_point_impl(const Vector2 &p_point, S
int cc = 0;
for (int i = 0; i < amount; i++) {
- if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas, p_filter_by_canvas)) {
+ if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas)) {
continue;
}
diff --git a/servers/physics_3d/space_3d_sw.cpp b/servers/physics_3d/space_3d_sw.cpp
index aa4cb894dd..48f250ba35 100644
--- a/servers/physics_3d/space_3d_sw.cpp
+++ b/servers/physics_3d/space_3d_sw.cpp
@@ -34,8 +34,8 @@
#include "core/project_settings.h"
#include "physics_server_3d_sw.h"
-_FORCE_INLINE_ static bool _can_collide_with(CollisionObject3DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, bool p_ignore_layers = false) {
- if (!p_ignore_layers && !(p_object->get_collision_layer() & p_collision_mask)) {
+_FORCE_INLINE_ static bool _can_collide_with(CollisionObject3DSW *p_object, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
+ if (!(p_object->get_collision_layer() & p_collision_mask)) {
return false;
}
@@ -117,7 +117,7 @@ bool PhysicsDirectSpaceState3DSW::intersect_ray(const Vector3 &p_from, const Vec
real_t min_d = 1e10;
for (int i = 0; i < amount; i++) {
- if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas, p_pick_ray)) {
+ if (!_can_collide_with(space->intersection_query_results[i], p_collision_mask, p_collide_with_bodies, p_collide_with_areas)) {
continue;
}
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index 535011710d..d6acad83f7 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -645,7 +645,7 @@ ShaderLanguage::Token ShaderLanguage::_get_token() {
if (hexa_found) {
tk.constant = (double)str.hex_to_int(true);
} else {
- tk.constant = str.to_double();
+ tk.constant = str.to_float();
}
tk.line = tk_line;
diff --git a/tests/test_math.cpp b/tests/test_math.cpp
index 5f84bad4e9..84a85be2f6 100644
--- a/tests/test_math.cpp
+++ b/tests/test_math.cpp
@@ -242,7 +242,7 @@ class GetClassAndNamespace {
if (code[idx] == '-' || (code[idx] >= '0' && code[idx] <= '9')) {
//a number
const CharType *rptr;
- double number = String::to_double(&code[idx], &rptr);
+ double number = String::to_float(&code[idx], &rptr);
idx += (rptr - &code[idx]);
value = number;
return TK_NUMBER;
diff --git a/tests/test_string.h b/tests/test_string.h
index 25fd513a1a..310be31f4b 100644
--- a/tests/test_string.h
+++ b/tests/test_string.h
@@ -209,7 +209,7 @@ TEST_CASE("[String] String to float") {
static const double num[4] = { -12348298412.2, 0.05, 2.0002, -0.0001 };
for (int i = 0; i < 4; i++) {
- CHECK(!(ABS(String(nums[i]).to_double() - num[i]) > 0.00001));
+ CHECK(!(ABS(String(nums[i]).to_float() - num[i]) > 0.00001));
}
}