summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/csg/csg_shape.cpp5
-rw-r--r--modules/csg/doc_classes/CSGShape3D.xml2
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp2
-rw-r--r--modules/gdscript/gdscript.cpp14
-rw-r--r--modules/gltf/editor/editor_scene_importer_blend.cpp4
-rw-r--r--modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp2
-rw-r--r--modules/mbedtls/tls_context_mbedtls.cpp12
-rw-r--r--modules/multiplayer/editor/editor_network_profiler.cpp4
-rw-r--r--modules/navigation/nav_map.cpp30
-rw-r--r--modules/text_server_adv/text_server_adv.cpp27
10 files changed, 62 insertions, 40 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 8d2847ab1a..296cda627a 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -141,7 +141,12 @@ bool CSGShape3D::is_root_shape() const {
}
void CSGShape3D::set_snap(float p_snap) {
+ if (snap == p_snap) {
+ return;
+ }
+
snap = p_snap;
+ _make_dirty();
}
float CSGShape3D::get_snap() const {
diff --git a/modules/csg/doc_classes/CSGShape3D.xml b/modules/csg/doc_classes/CSGShape3D.xml
index 0414aa362d..f9017e47c7 100644
--- a/modules/csg/doc_classes/CSGShape3D.xml
+++ b/modules/csg/doc_classes/CSGShape3D.xml
@@ -73,7 +73,7 @@
The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent.
</member>
<member name="snap" type="float" setter="set_snap" getter="get_snap" default="0.001">
- Snap makes the mesh vertices snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust.
+ Snap makes the mesh vertices snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust. The top-level CSG shape's snap value is used for the entire CSG tree.
</member>
<member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision" default="false">
Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. See also [member collision_mask] and [member collision_priority].
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index f83b784f85..eecce70202 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -690,7 +690,7 @@ void GDScriptSyntaxHighlighter::_update_cache() {
color_regions.clear();
color_region_cache.clear();
- font_color = text_edit->get_theme_color(SNAME("font_color"));
+ font_color = text_edit->get_theme_color(SceneStringName(font_color));
symbol_color = EDITOR_GET("text_editor/theme/highlighting/symbol_color");
function_color = EDITOR_GET("text_editor/theme/highlighting/function_color");
number_color = EDITOR_GET("text_editor/theme/highlighting/number_color");
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 0c58b41fcb..20d424894a 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -771,8 +771,16 @@ Error GDScript::reload(bool p_keep_state) {
if (GDScriptCache::has_parser(source_path)) {
Error err = OK;
Ref<GDScriptParserRef> parser_ref = GDScriptCache::get_parser(source_path, GDScriptParserRef::EMPTY, err);
- if (parser_ref.is_valid() && parser_ref->get_source_hash() != source.hash()) {
- GDScriptCache::remove_parser(source_path);
+ if (parser_ref.is_valid()) {
+ uint32_t source_hash;
+ if (!binary_tokens.is_empty()) {
+ source_hash = hash_djb2_buffer(binary_tokens.ptr(), binary_tokens.size());
+ } else {
+ source_hash = source.hash();
+ }
+ if (parser_ref->get_source_hash() != source_hash) {
+ GDScriptCache::remove_parser(source_path);
+ }
}
}
}
@@ -987,7 +995,7 @@ bool GDScript::_get(const StringName &p_name, Variant &r_ret) const {
bool GDScript::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == GDScriptLanguage::get_singleton()->strings._script_source) {
set_source_code(p_value);
- reload();
+ reload(true);
return true;
}
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp
index 822e11ea4b..4ad00c719b 100644
--- a/modules/gltf/editor/editor_scene_importer_blend.cpp
+++ b/modules/gltf/editor/editor_scene_importer_blend.cpp
@@ -395,10 +395,10 @@ void EditorFileSystemImportFormatSupportQueryBlend::_validate_path(String p_path
path_status->set_text(error);
if (success) {
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
configure_blender_dialog->get_ok_button()->set_disabled(false);
} else {
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
configure_blender_dialog->get_ok_button()->set_disabled(true);
}
}
diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
index cd3814879a..28b875a4ad 100644
--- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
+++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
@@ -161,7 +161,7 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
return;
}
int clip_count = audio_stream_interactive->get_clip_count();
- Color font_color = tree->get_theme_color("font_color", "Tree");
+ Color font_color = tree->get_theme_color(SceneStringName(font_color), "Tree");
Color font_color_default = font_color;
font_color_default.a *= 0.5;
Ref<Texture> fade_icons[5] = {
diff --git a/modules/mbedtls/tls_context_mbedtls.cpp b/modules/mbedtls/tls_context_mbedtls.cpp
index aab082f488..eaea7b9293 100644
--- a/modules/mbedtls/tls_context_mbedtls.cpp
+++ b/modules/mbedtls/tls_context_mbedtls.cpp
@@ -152,21 +152,23 @@ Error TLSContextMbedTLS::init_client(int p_transport, const String &p_hostname,
ERR_FAIL_COND_V(p_options.is_null() || p_options->is_server(), ERR_INVALID_PARAMETER);
int authmode = MBEDTLS_SSL_VERIFY_REQUIRED;
- if (p_options->get_verify_mode() == TLSOptions::TLS_VERIFY_NONE) {
+ bool unsafe = p_options->is_unsafe_client();
+ if (unsafe && p_options->get_trusted_ca_chain().is_valid()) {
authmode = MBEDTLS_SSL_VERIFY_NONE;
}
Error err = _setup(MBEDTLS_SSL_IS_CLIENT, p_transport, authmode);
ERR_FAIL_COND_V(err != OK, err);
- if (p_options->get_verify_mode() == TLSOptions::TLS_VERIFY_FULL) {
- String cn = p_options->get_common_name();
+ if (unsafe) {
+ // No hostname verification for unsafe clients.
+ mbedtls_ssl_set_hostname(&tls, nullptr);
+ } else {
+ String cn = p_options->get_common_name_override();
if (cn.is_empty()) {
cn = p_hostname;
}
mbedtls_ssl_set_hostname(&tls, cn.utf8().get_data());
- } else {
- mbedtls_ssl_set_hostname(&tls, nullptr);
}
X509CertificateMbedTLS *cas = nullptr;
diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp
index 75941207c7..d5d4b465d8 100644
--- a/modules/multiplayer/editor/editor_network_profiler.cpp
+++ b/modules/multiplayer/editor/editor_network_profiler.cpp
@@ -74,8 +74,8 @@ void EditorNetworkProfiler::_update_theme_item_cache() {
theme_cache.incoming_bandwidth_icon = get_theme_icon(SNAME("ArrowDown"), EditorStringName(EditorIcons));
theme_cache.outgoing_bandwidth_icon = get_theme_icon(SNAME("ArrowUp"), EditorStringName(EditorIcons));
- theme_cache.incoming_bandwidth_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
- theme_cache.outgoing_bandwidth_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ theme_cache.incoming_bandwidth_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
+ theme_cache.outgoing_bandwidth_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
}
void EditorNetworkProfiler::_refresh() {
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index 1779be2cc2..f0184a155b 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -627,24 +627,20 @@ Vector3 NavMap::get_closest_point_to_segment(const Vector3 &p_from, const Vector
closest_point_d = d;
}
}
- }
-
- if (use_collision == false) {
- for (size_t point_id = 0; point_id < p.points.size(); point_id += 1) {
- Vector3 a, b;
-
- Geometry3D::get_closest_points_between_segments(
- p_from,
- p_to,
- p.points[point_id].pos,
- p.points[(point_id + 1) % p.points.size()].pos,
- a,
- b);
+ // If segment does not itersect face, check the distance from segment's endpoints.
+ else if (!use_collision) {
+ const Vector3 p_from_closest = f.get_closest_point_to(p_from);
+ const real_t d_p_from = p_from.distance_to(p_from_closest);
+ if (closest_point_d > d_p_from) {
+ closest_point = p_from_closest;
+ closest_point_d = d_p_from;
+ }
- const real_t d = a.distance_to(b);
- if (d < closest_point_d) {
- closest_point_d = d;
- closest_point = b;
+ const Vector3 p_to_closest = f.get_closest_point_to(p_to);
+ const real_t d_p_to = p_to.distance_to(p_to_closest);
+ if (closest_point_d > d_p_to) {
+ closest_point = p_to_closest;
+ closest_point_d = d_p_to;
}
}
}
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index 361d88af90..33ba2da761 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -6052,6 +6052,7 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star
unsigned int last_cluster_index = 0;
bool last_cluster_valid = true;
+ double adv_rem = 0.0;
for (unsigned int i = 0; i < glyph_count; i++) {
if ((i > 0) && (last_cluster_id != glyph_info[i].cluster)) {
if (p_direction == HB_DIRECTION_RTL || p_direction == HB_DIRECTION_BTT) {
@@ -6097,21 +6098,31 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star
gl.index = glyph_info[i].codepoint;
if (gl.index != 0) {
_ensure_glyph(fd, fss, gl.index | mod);
+ if (subpos) {
+ gl.x_off = (double)glyph_pos[i].x_offset / (64.0 / scale);
+ } else if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
+ gl.x_off = Math::round(adv_rem + ((double)glyph_pos[i].x_offset / (64.0 / scale)));
+ } else {
+ gl.x_off = Math::round((double)glyph_pos[i].x_offset / (64.0 / scale));
+ }
+ if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
+ gl.y_off = -Math::round((double)glyph_pos[i].y_offset / (64.0 / scale));
+ } else {
+ gl.y_off = -Math::round(adv_rem + ((double)glyph_pos[i].y_offset / (64.0 / scale)));
+ }
if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
if (subpos) {
gl.advance = (double)glyph_pos[i].x_advance / (64.0 / scale) + ea;
} else {
- gl.advance = Math::round((double)glyph_pos[i].x_advance / (64.0 / scale) + ea);
+ double full_adv = adv_rem + ((double)glyph_pos[i].x_advance / (64.0 / scale) + ea);
+ gl.advance = Math::round(full_adv);
+ adv_rem = full_adv - gl.advance;
}
} else {
- gl.advance = -Math::round((double)glyph_pos[i].y_advance / (64.0 / scale));
- }
- if (subpos) {
- gl.x_off = (double)glyph_pos[i].x_offset / (64.0 / scale);
- } else {
- gl.x_off = Math::round((double)glyph_pos[i].x_offset / (64.0 / scale));
+ double full_adv = adv_rem + ((double)glyph_pos[i].y_advance / (64.0 / scale));
+ gl.advance = -Math::round(full_adv);
+ adv_rem = full_adv + gl.advance;
}
- gl.y_off = -Math::round((double)glyph_pos[i].y_offset / (64.0 / scale));
if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
gl.y_off += _font_get_baseline_offset(gl.font_rid) * (double)(_font_get_ascent(gl.font_rid, gl.font_size) + _font_get_descent(gl.font_rid, gl.font_size));
} else {