feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -37,9 +37,9 @@
|
|||
#include "editor/themes/editor_scale.h"
|
||||
#endif
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
#ifdef DEBUG_ENABLED
|
||||
Rect2 Path2D::_edit_get_rect() const {
|
||||
if (!curve.is_valid() || curve->get_point_count() == 0) {
|
||||
if (curve.is_null() || curve->get_point_count() == 0) {
|
||||
return Rect2(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ void Path2D::_notification(int p_what) {
|
|||
switch (p_what) {
|
||||
// Draw the curve if path debugging is enabled.
|
||||
case NOTIFICATION_DRAW: {
|
||||
if (!curve.is_valid()) {
|
||||
if (curve.is_null()) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -138,13 +138,14 @@ void Path2D::_notification(int p_what) {
|
|||
draw_polyline(v2p, get_tree()->get_debug_paths_color(), line_width, false);
|
||||
}
|
||||
|
||||
// Draw fish bones
|
||||
// Draw fish bone every 4 points to reduce visual noise and performance impact
|
||||
// (compared to drawing it for every point).
|
||||
{
|
||||
PackedVector2Array v2p;
|
||||
v2p.resize(3);
|
||||
Vector2 *w = v2p.ptrw();
|
||||
|
||||
for (int i = 0; i < sample_count; i++) {
|
||||
for (int i = 0; i < sample_count; i += 4) {
|
||||
const Vector2 p = r[i].get_origin();
|
||||
const Vector2 side = r[i].columns[1];
|
||||
const Vector2 forward = r[i].columns[0];
|
||||
|
|
@ -167,17 +168,16 @@ void Path2D::_curve_changed() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_paths_hint()) {
|
||||
return;
|
||||
}
|
||||
|
||||
queue_redraw();
|
||||
for (int i = 0; i < get_child_count(); i++) {
|
||||
PathFollow2D *follow = Object::cast_to<PathFollow2D>(get_child(i));
|
||||
if (follow) {
|
||||
follow->path_changed();
|
||||
}
|
||||
}
|
||||
|
||||
if (Engine::get_singleton()->is_editor_hint() || get_tree()->is_debugging_paths_hint()) {
|
||||
queue_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
void Path2D::set_curve(const Ref<Curve2D> &p_curve) {
|
||||
|
|
@ -221,7 +221,7 @@ void PathFollow2D::_update_transform() {
|
|||
}
|
||||
|
||||
Ref<Curve2D> c = path->get_curve();
|
||||
if (!c.is_valid()) {
|
||||
if (c.is_null()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ void PathFollow2D::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
|
||||
PackedStringArray PathFollow2D::get_configuration_warnings() const {
|
||||
PackedStringArray warnings = Node::get_configuration_warnings();
|
||||
PackedStringArray warnings = Node2D::get_configuration_warnings();
|
||||
|
||||
if (is_visible_in_tree() && is_inside_tree()) {
|
||||
if (!Object::cast_to<Path2D>(get_parent())) {
|
||||
|
|
@ -378,9 +378,10 @@ real_t PathFollow2D::get_progress() const {
|
|||
}
|
||||
|
||||
void PathFollow2D::set_progress_ratio(real_t p_ratio) {
|
||||
if (path && path->get_curve().is_valid() && path->get_curve()->get_baked_length()) {
|
||||
set_progress(p_ratio * path->get_curve()->get_baked_length());
|
||||
}
|
||||
ERR_FAIL_NULL_MSG(path, "Can only set progress ratio on a PathFollow2D that is the child of a Path2D which is itself part of the scene tree.");
|
||||
ERR_FAIL_COND_MSG(path->get_curve().is_null(), "Can't set progress ratio on a PathFollow2D that does not have a Curve.");
|
||||
ERR_FAIL_COND_MSG(!path->get_curve()->get_baked_length(), "Can't set progress ratio on a PathFollow2D that has a 0 length curve.");
|
||||
set_progress(p_ratio * path->get_curve()->get_baked_length());
|
||||
}
|
||||
|
||||
real_t PathFollow2D::get_progress_ratio() const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue