clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
This commit is contained in:
parent
c7f4e1d5dd
commit
42d385b312
96 changed files with 519 additions and 540 deletions
|
@ -12,7 +12,7 @@ AlignAfterOpenBracket: DontAlign
|
|||
# AlignConsecutiveBitFields: None
|
||||
# AlignConsecutiveDeclarations: None
|
||||
# AlignEscapedNewlines: Right
|
||||
# AlignOperands: Align
|
||||
AlignOperands: DontAlign
|
||||
AlignTrailingComments: false
|
||||
# AllowAllArgumentsOnNextLine: true
|
||||
# AllowAllConstructorInitializersOnNextLine: true
|
||||
|
|
|
@ -239,7 +239,7 @@ bool AStar::are_points_connected(int p_id, int p_with_id, bool bidirectional) co
|
|||
const Set<Segment>::Element *element = segments.find(s);
|
||||
|
||||
return element != nullptr &&
|
||||
(bidirectional || (element->get().direction & s.direction) == s.direction);
|
||||
(bidirectional || (element->get().direction & s.direction) == s.direction);
|
||||
}
|
||||
|
||||
void AStar::clear() {
|
||||
|
|
|
@ -183,7 +183,7 @@ Vector3 AABB::get_support(const Vector3 &p_normal) const {
|
|||
(p_normal.x > 0) ? -half_extents.x : half_extents.x,
|
||||
(p_normal.y > 0) ? -half_extents.y : half_extents.y,
|
||||
(p_normal.z > 0) ? -half_extents.z : half_extents.z) +
|
||||
ofs;
|
||||
ofs;
|
||||
}
|
||||
|
||||
Vector3 AABB::get_endpoint(int p_point) const {
|
||||
|
|
|
@ -58,8 +58,8 @@ void Basis::invert() {
|
|||
cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1)
|
||||
};
|
||||
real_t det = elements[0][0] * co[0] +
|
||||
elements[0][1] * co[1] +
|
||||
elements[0][2] * co[2];
|
||||
elements[0][1] * co[1] +
|
||||
elements[0][2] * co[2];
|
||||
#ifdef MATH_CHECKS
|
||||
ERR_FAIL_COND(det == 0);
|
||||
#endif
|
||||
|
@ -272,10 +272,7 @@ Vector3 Basis::get_scale() const {
|
|||
//
|
||||
// The rotation part of this decomposition is returned by get_rotation* functions.
|
||||
real_t det_sign = SGN(determinant());
|
||||
return det_sign * Vector3(
|
||||
Vector3(elements[0][0], elements[1][0], elements[2][0]).length(),
|
||||
Vector3(elements[0][1], elements[1][1], elements[2][1]).length(),
|
||||
Vector3(elements[0][2], elements[1][2], elements[2][2]).length());
|
||||
return det_sign * get_scale_abs();
|
||||
}
|
||||
|
||||
// Decomposes a Basis into a rotation-reflection matrix (an element of the group O(3)) and a positive scaling matrix as B = O.S.
|
||||
|
@ -785,8 +782,8 @@ Quat Basis::get_quat() const {
|
|||
temp[2] = ((m.elements[1][0] - m.elements[0][1]) * s);
|
||||
} else {
|
||||
int i = m.elements[0][0] < m.elements[1][1] ?
|
||||
(m.elements[1][1] < m.elements[2][2] ? 2 : 1) :
|
||||
(m.elements[0][0] < m.elements[2][2] ? 2 : 0);
|
||||
(m.elements[1][1] < m.elements[2][2] ? 2 : 1) :
|
||||
(m.elements[0][0] < m.elements[2][2] ? 2 : 0);
|
||||
int j = (i + 1) % 3;
|
||||
int k = (i + 2) % 3;
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ Vector3 Basis::xform_inv(const Vector3 &p_vector) const {
|
|||
|
||||
real_t Basis::determinant() const {
|
||||
return elements[0][0] * (elements[1][1] * elements[2][2] - elements[2][1] * elements[1][2]) -
|
||||
elements[1][0] * (elements[0][1] * elements[2][2] - elements[2][1] * elements[0][2]) +
|
||||
elements[2][0] * (elements[0][1] * elements[1][2] - elements[1][1] * elements[0][2]);
|
||||
elements[1][0] * (elements[0][1] * elements[2][2] - elements[2][1] * elements[0][2]) +
|
||||
elements[2][0] * (elements[0][1] * elements[1][2] - elements[1][1] * elements[0][2]);
|
||||
}
|
||||
#endif // BASIS_H
|
||||
|
|
|
@ -156,7 +156,7 @@ public:
|
|||
} ieee754;
|
||||
ieee754.f = p_val;
|
||||
return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 &&
|
||||
((unsigned)ieee754.u == 0);
|
||||
((unsigned)ieee754.u == 0);
|
||||
#else
|
||||
return isinf(p_val);
|
||||
#endif
|
||||
|
@ -454,7 +454,7 @@ public:
|
|||
mantissa = 0;
|
||||
}
|
||||
hf = (((uint16_t)sign) << 15) | (uint16_t)((0x1F << 10)) |
|
||||
(uint16_t)(mantissa >> 13);
|
||||
(uint16_t)(mantissa >> 13);
|
||||
}
|
||||
// check if exponent is <= -15
|
||||
else if (exp <= 0x38000000) {
|
||||
|
@ -467,8 +467,8 @@ public:
|
|||
hf = 0; //denormals do not work for 3D, convert to zero
|
||||
} else {
|
||||
hf = (((uint16_t)sign) << 15) |
|
||||
(uint16_t)((exp - 0x38000000) >> 13) |
|
||||
(uint16_t)(mantissa >> 13);
|
||||
(uint16_t)((exp - 0x38000000) >> 13) |
|
||||
(uint16_t)(mantissa >> 13);
|
||||
}
|
||||
|
||||
return hf;
|
||||
|
|
|
@ -91,7 +91,7 @@ bool Plane::intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r
|
|||
*r_result = ((vec3_cross(normal1, normal2) * p_plane0.d) +
|
||||
(vec3_cross(normal2, normal0) * p_plane1.d) +
|
||||
(vec3_cross(normal0, normal1) * p_plane2.d)) /
|
||||
denom;
|
||||
denom;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -116,8 +116,8 @@ struct Rect2 {
|
|||
|
||||
inline bool encloses(const Rect2 &p_rect) const {
|
||||
return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
|
||||
((p_rect.position.x + p_rect.size.x) <= (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) <= (position.y + size.y));
|
||||
((p_rect.position.x + p_rect.size.x) <= (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) <= (position.y + size.y));
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool has_no_area() const {
|
||||
|
@ -287,8 +287,8 @@ struct Rect2i {
|
|||
|
||||
inline bool encloses(const Rect2i &p_rect) const {
|
||||
return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
|
||||
((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
|
||||
((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool has_no_area() const {
|
||||
|
|
|
@ -149,7 +149,7 @@ Vector2 Transform2D::xform(const Vector2 &p_vec) const {
|
|||
return Vector2(
|
||||
tdotx(p_vec),
|
||||
tdoty(p_vec)) +
|
||||
elements[2];
|
||||
elements[2];
|
||||
}
|
||||
Vector2 Transform2D::xform_inv(const Vector2 &p_vec) const {
|
||||
Vector2 v = p_vec - elements[2];
|
||||
|
|
|
@ -149,10 +149,11 @@ Vector2 Vector2::cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, c
|
|||
real_t t3 = t2 * t;
|
||||
|
||||
Vector2 out;
|
||||
out = 0.5 * ((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
out = 0.5 *
|
||||
((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,10 +88,11 @@ Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a,
|
|||
real_t t3 = t2 * t;
|
||||
|
||||
Vector3 out;
|
||||
out = 0.5 * ((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
out = 0.5 *
|
||||
((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -106,10 +107,11 @@ Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, c
|
|||
real_t t3 = t2 * t;
|
||||
|
||||
Vector3 out;
|
||||
out = 0.5 * ((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
out = 0.5 *
|
||||
((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -1526,9 +1526,10 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const
|
|||
Signal *s = signal_map.getptr(p_signal);
|
||||
if (!s) {
|
||||
bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal) ||
|
||||
(!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal));
|
||||
ERR_FAIL_COND_MSG(signal_is_valid, vformat("Attempt to disconnect a nonexistent connection to signal '%s' in %s, with target '%s' in %s.",
|
||||
p_signal, to_string(), p_to_method, p_to_object->to_string()));
|
||||
(!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal));
|
||||
ERR_FAIL_COND_MSG(signal_is_valid,
|
||||
vformat("Attempt to disconnect a nonexistent connection to signal '%s' in %s, with target '%s' in %s.",
|
||||
p_signal, to_string(), p_to_method, p_to_object->to_string()));
|
||||
}
|
||||
ERR_FAIL_COND_MSG(!s, vformat("Disconnecting nonexistent signal '%s' in %s.", p_signal, to_string()));
|
||||
|
||||
|
|
|
@ -136,10 +136,11 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
|
|||
const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\"";
|
||||
|
||||
String pf = p_function;
|
||||
if (p_idx == 0 && (pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" ||
|
||||
pf == "is_action_just_pressed" || pf == "is_action_just_released" ||
|
||||
pf == "get_action_strength" || pf == "get_action_raw_strength" ||
|
||||
pf == "get_axis" || pf == "get_vector")) {
|
||||
if (p_idx == 0 &&
|
||||
(pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" ||
|
||||
pf == "is_action_just_pressed" || pf == "is_action_just_released" ||
|
||||
pf == "get_action_strength" || pf == "get_action_raw_strength" ||
|
||||
pf == "get_axis" || pf == "get_vector")) {
|
||||
List<PropertyInfo> pinfo;
|
||||
ProjectSettings::get_singleton()->get_property_list(&pinfo);
|
||||
|
||||
|
|
|
@ -331,10 +331,10 @@ bool InputEventKey::shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_
|
|||
|
||||
if (scancode == 0) {
|
||||
return physical_scancode == key->physical_scancode &&
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
} else {
|
||||
return scancode == key->scancode &&
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -497,7 +497,7 @@ bool InputEventMouseButton::shortcut_match(const Ref<InputEvent> &p_event, bool
|
|||
}
|
||||
|
||||
return button_index == mb->button_index &&
|
||||
(!p_exact_match || get_modifiers_mask() == mb->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == mb->get_modifiers_mask());
|
||||
}
|
||||
|
||||
String InputEventMouseButton::as_text() const {
|
||||
|
@ -773,7 +773,7 @@ bool InputEventJoypadMotion::shortcut_match(const Ref<InputEvent> &p_event, bool
|
|||
}
|
||||
|
||||
return axis == jm->axis &&
|
||||
(!p_exact_match || ((axis_value < 0) == (jm->axis_value < 0)));
|
||||
(!p_exact_match || ((axis_value < 0) == (jm->axis_value < 0)));
|
||||
}
|
||||
|
||||
String InputEventJoypadMotion::as_text() const {
|
||||
|
|
|
@ -66,18 +66,12 @@ String OS::get_iso_date_time(bool local) const {
|
|||
timezone = "Z";
|
||||
}
|
||||
|
||||
return itos(date.year).pad_zeros(2) +
|
||||
"-" +
|
||||
itos(date.month).pad_zeros(2) +
|
||||
"-" +
|
||||
itos(date.day).pad_zeros(2) +
|
||||
"T" +
|
||||
itos(time.hour).pad_zeros(2) +
|
||||
":" +
|
||||
itos(time.min).pad_zeros(2) +
|
||||
":" +
|
||||
itos(time.sec).pad_zeros(2) +
|
||||
timezone;
|
||||
return itos(date.year).pad_zeros(2) + "-" +
|
||||
itos(date.month).pad_zeros(2) + "-" +
|
||||
itos(date.day).pad_zeros(2) + "T" +
|
||||
itos(time.hour).pad_zeros(2) + ":" +
|
||||
itos(time.min).pad_zeros(2) + ":" +
|
||||
itos(time.sec).pad_zeros(2) + timezone;
|
||||
}
|
||||
|
||||
uint64_t OS::get_splash_tick_msec() const {
|
||||
|
|
|
@ -60,7 +60,7 @@ struct TypeInherits {
|
|||
static char (&test(...))[2];
|
||||
|
||||
static bool const value = sizeof(test(get_d())) == sizeof(char) &&
|
||||
!TypesAreSame<B volatile const, void volatile const>::value;
|
||||
!TypesAreSame<B volatile const, void volatile const>::value;
|
||||
};
|
||||
|
||||
namespace GodotTypeInfo {
|
||||
|
|
|
@ -2777,7 +2777,7 @@ bool Variant::hash_compare(const Variant &p_variant) const {
|
|||
const Rect2 *r = reinterpret_cast<const Rect2 *>(p_variant._data._mem);
|
||||
|
||||
return (hash_compare_vector2(l->position, r->position)) &&
|
||||
(hash_compare_vector2(l->size, r->size));
|
||||
(hash_compare_vector2(l->size, r->size));
|
||||
} break;
|
||||
|
||||
case TRANSFORM2D: {
|
||||
|
@ -2805,7 +2805,7 @@ bool Variant::hash_compare(const Variant &p_variant) const {
|
|||
const Plane *r = reinterpret_cast<const Plane *>(p_variant._data._mem);
|
||||
|
||||
return (hash_compare_vector3(l->normal, r->normal)) &&
|
||||
(hash_compare_scalar(l->d, r->d));
|
||||
(hash_compare_scalar(l->d, r->d));
|
||||
} break;
|
||||
|
||||
case AABB: {
|
||||
|
|
|
@ -838,10 +838,9 @@ void RasterizerCanvasBaseGLES2::canvas_light_shadow_buffer_update(RID p_buffer,
|
|||
|
||||
if (transformed_cull_cache != VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
|
||||
(p_light_xform.basis_determinant() * instance->xform_cache.basis_determinant()) < 0) {
|
||||
transformed_cull_cache =
|
||||
transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
transformed_cull_cache = transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
}
|
||||
|
||||
if (cull != transformed_cull_cache) {
|
||||
|
|
|
@ -172,7 +172,7 @@ void main() {
|
|||
vec3(1.00000, 1.00000, 1.00000),
|
||||
vec3(0.00000, -0.34413, 1.77200),
|
||||
vec3(1.40200, -0.71414, 0.00000)) *
|
||||
color.rgb;
|
||||
color.rgb;
|
||||
#endif
|
||||
|
||||
#ifdef USE_NO_ALPHA
|
||||
|
|
|
@ -1004,7 +1004,7 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture2D(tex, p0) + g1x * texture2D(tex, p1))) +
|
||||
(g1(fuv.y) * (g0x * texture2D(tex, p2) + g1x * texture2D(tex, p3)));
|
||||
(g1(fuv.y) * (g0x * texture2D(tex, p2) + g1x * texture2D(tex, p3)));
|
||||
}
|
||||
#endif //USE_LIGHTMAP_FILTER_BICUBIC
|
||||
#endif
|
||||
|
@ -1544,7 +1544,7 @@ float sample_shadow(highp sampler2D shadow, highp vec4 spos) {
|
|||
SAMPLE_SHADOW_TEXEL(shadow, pos + vec2(2.0 * shadow_pixel_size.x, 2.0 * shadow_pixel_size.y), depth),
|
||||
f.x),
|
||||
f.y)) *
|
||||
(1.0 / 9.0);
|
||||
(1.0 / 9.0);
|
||||
#endif
|
||||
|
||||
#ifdef SHADOW_MODE_PCF_5
|
||||
|
|
|
@ -317,7 +317,7 @@ highp mat3 inverse(highp mat3 m) {
|
|||
return mat3(c01, (-m[2].z * m[0].y + m[0].z * m[2].y), (m[1].z * m[0].y - m[0].z * m[1].y),
|
||||
c11, (m[2].z * m[0].x - m[0].z * m[2].x), (-m[1].z * m[0].x + m[0].z * m[1].x),
|
||||
c21, (-m[2].y * m[0].x + m[0].y * m[2].x), (m[1].y * m[0].x - m[0].y * m[1].x)) *
|
||||
d;
|
||||
d;
|
||||
}
|
||||
|
||||
highp mat4 inverse(highp mat4 m) {
|
||||
|
|
|
@ -168,7 +168,7 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv, int p_lod) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture2DLod(tex, p0, lod) + g1x * texture2DLod(tex, p1, lod))) +
|
||||
(g1(fuv.y) * (g0x * texture2DLod(tex, p2, lod) + g1x * texture2DLod(tex, p3, lod)));
|
||||
(g1(fuv.y) * (g0x * texture2DLod(tex, p2, lod) + g1x * texture2DLod(tex, p3, lod)));
|
||||
}
|
||||
|
||||
#define GLOW_TEXTURE_SAMPLE(m_tex, m_uv, m_lod) texture2D_bicubic(m_tex, m_uv, m_lod)
|
||||
|
@ -244,18 +244,17 @@ vec3 apply_fxaa(vec3 color, vec2 uv_interp, vec2 pixel_size) {
|
|||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
FXAA_REDUCE_MIN);
|
||||
|
||||
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
|
||||
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
|
||||
dir * rcpDirMin)) *
|
||||
pixel_size;
|
||||
pixel_size;
|
||||
|
||||
vec3 rgbA = 0.5 * (texture2DLod(source, uv_interp + dir * (1.0 / 3.0 - 0.5), 0.0).xyz + texture2DLod(source, uv_interp + dir * (2.0 / 3.0 - 0.5), 0.0).xyz);
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * (texture2DLod(source, uv_interp + dir * -0.5, 0.0).xyz +
|
||||
texture2DLod(source, uv_interp + dir * 0.5, 0.0).xyz);
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * (texture2DLod(source, uv_interp + dir * -0.5, 0.0).xyz + texture2DLod(source, uv_interp + dir * 0.5, 0.0).xyz);
|
||||
|
||||
float lumaB = dot(rgbB, luma);
|
||||
if ((lumaB < lumaMin) || (lumaB > lumaMax)) {
|
||||
|
|
|
@ -897,10 +897,9 @@ void RasterizerCanvasBaseGLES3::canvas_light_shadow_buffer_update(RID p_buffer,
|
|||
|
||||
if (transformed_cull_cache != VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
|
||||
(p_light_xform.basis_determinant() * instance->xform_cache.basis_determinant()) < 0) {
|
||||
transformed_cull_cache =
|
||||
transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
transformed_cull_cache = transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
}
|
||||
|
||||
if (cull != transformed_cull_cache) {
|
||||
|
|
|
@ -1192,9 +1192,9 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
|
|||
uint32_t a = px >> 30 & 0xFF;
|
||||
|
||||
ptr[ofs] = (px >> 2 & 0xFF) |
|
||||
(px >> 12 & 0xFF) << 8 |
|
||||
(px >> 22 & 0xFF) << 16 |
|
||||
(a | a << 2 | a << 4 | a << 6) << 24;
|
||||
(px >> 12 & 0xFF) << 8 |
|
||||
(px >> 22 & 0xFF) << 16 |
|
||||
(a | a << 2 | a << 4 | a << 6) << 24;
|
||||
}
|
||||
} else {
|
||||
img_format = real_format;
|
||||
|
|
|
@ -253,28 +253,28 @@ VERTEX_SHADER_CODE
|
|||
m = mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.x;
|
||||
bone_weights.x;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.y % 256, (bone_indicesi.y / 256) * 2);
|
||||
|
||||
m += mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.y;
|
||||
bone_weights.y;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.z % 256, (bone_indicesi.z / 256) * 2);
|
||||
|
||||
m += mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.z;
|
||||
bone_weights.z;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.w % 256, (bone_indicesi.w / 256) * 2);
|
||||
|
||||
m += mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.w;
|
||||
bone_weights.w;
|
||||
|
||||
mat4 bone_matrix = skeleton_transform * transpose(mat4(m[0], m[1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0))) * skeleton_transform_inverse;
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ void main() {
|
|||
vec3(1.00000, 1.00000, 1.00000),
|
||||
vec3(0.00000, -0.18732, 1.85560),
|
||||
vec3(1.57481, -0.46813, 0.00000)) *
|
||||
color.rgb;
|
||||
color.rgb;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.x;
|
||||
bone_weights.x;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.y % 256, (bone_indicesi.y / 256) * 3);
|
||||
|
||||
|
@ -457,7 +457,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.y;
|
||||
bone_weights.y;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.z % 256, (bone_indicesi.z / 256) * 3);
|
||||
|
||||
|
@ -466,7 +466,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.z;
|
||||
bone_weights.z;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.w % 256, (bone_indicesi.w / 256) * 3);
|
||||
|
||||
|
@ -475,7 +475,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.w;
|
||||
bone_weights.w;
|
||||
|
||||
world_matrix = world_matrix * transpose(m);
|
||||
}
|
||||
|
@ -1562,7 +1562,7 @@ vec4 texture_bicubic(sampler2D tex, vec2 uv) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture(tex, p0) + g1x * texture(tex, p1))) +
|
||||
(g1(fuv.y) * (g0x * texture(tex, p2) + g1x * texture(tex, p3)));
|
||||
(g1(fuv.y) * (g0x * texture(tex, p2) + g1x * texture(tex, p3)));
|
||||
}
|
||||
|
||||
vec4 textureArray_bicubic(sampler2DArray tex, vec3 uv) {
|
||||
|
@ -1586,7 +1586,7 @@ vec4 textureArray_bicubic(sampler2DArray tex, vec3 uv) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture(tex, vec3(p0, uv.z)) + g1x * texture(tex, vec3(p1, uv.z)))) +
|
||||
(g1(fuv.y) * (g0x * texture(tex, vec3(p2, uv.z)) + g1x * texture(tex, vec3(p3, uv.z))));
|
||||
(g1(fuv.y) * (g0x * texture(tex, vec3(p2, uv.z)) + g1x * texture(tex, vec3(p3, uv.z))));
|
||||
}
|
||||
|
||||
#define LIGHTMAP_TEXTURE_SAMPLE(m_tex, m_uv) texture_bicubic(m_tex, m_uv)
|
||||
|
|
|
@ -123,7 +123,7 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv, int p_lod) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5f)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * textureLod(tex, p0, lod) + g1x * textureLod(tex, p1, lod))) +
|
||||
(g1(fuv.y) * (g0x * textureLod(tex, p2, lod) + g1x * textureLod(tex, p3, lod)));
|
||||
(g1(fuv.y) * (g0x * textureLod(tex, p2, lod) + g1x * textureLod(tex, p3, lod)));
|
||||
}
|
||||
|
||||
#define GLOW_TEXTURE_SAMPLE(m_tex, m_uv, m_lod) texture2D_bicubic(m_tex, m_uv, m_lod)
|
||||
|
@ -332,14 +332,14 @@ vec3 apply_fxaa(vec3 color, float exposure, vec2 uv_interp, vec2 pixel_size) {
|
|||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
FXAA_REDUCE_MIN);
|
||||
|
||||
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
|
||||
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
|
||||
dir * rcpDirMin)) *
|
||||
pixel_size;
|
||||
pixel_size;
|
||||
|
||||
vec3 rgbA = 0.5 * exposure * (textureLod(source, uv_interp + dir * (1.0 / 3.0 - 0.5), 0.0).xyz + textureLod(source, uv_interp + dir * (2.0 / 3.0 - 0.5), 0.0).xyz);
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * exposure * (textureLod(source, uv_interp + dir * -0.5, 0.0).xyz + textureLod(source, uv_interp + dir * 0.5, 0.0).xyz);
|
||||
|
|
|
@ -552,9 +552,9 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &
|
|||
COLLADA_PRINT("param: " + name + " value:" + String(value));
|
||||
|
||||
} else if (parser.get_node_name() == "constant" ||
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn") {
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn") {
|
||||
COLLADA_PRINT("shade model: " + parser.get_node_name());
|
||||
while (parser.read() == OK) {
|
||||
if (parser.get_node_type() == XMLParser::NODE_ELEMENT) {
|
||||
|
@ -628,10 +628,11 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &
|
|||
} else if (what == "shininess") {
|
||||
effect.shininess = _parse_param(parser);
|
||||
}
|
||||
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && (parser.get_node_name() == "constant" ||
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn")) {
|
||||
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END &&
|
||||
(parser.get_node_name() == "constant" ||
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -682,10 +683,10 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &
|
|||
parser.skip_section();
|
||||
}
|
||||
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END &&
|
||||
(parser.get_node_name() == "effect" ||
|
||||
parser.get_node_name() == "profile_COMMON" ||
|
||||
parser.get_node_name() == "technique" ||
|
||||
parser.get_node_name() == "extra")) {
|
||||
(parser.get_node_name() == "effect" ||
|
||||
parser.get_node_name() == "profile_COMMON" ||
|
||||
parser.get_node_name() == "technique" ||
|
||||
parser.get_node_name() == "extra")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,10 +124,7 @@ void CreateDialog::_text_changed(const String &p_newtext) {
|
|||
|
||||
void CreateDialog::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> k = p_ie;
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP ||
|
||||
k->get_scancode() == KEY_DOWN ||
|
||||
k->get_scancode() == KEY_PAGEUP ||
|
||||
k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_PAGEUP || k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
search_options->call("_gui_input", k);
|
||||
search_box->accept_event();
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ EditorAbout::EditorAbout() {
|
|||
Label *about_text = memnew(Label);
|
||||
about_text->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
|
||||
about_text->set_text(String::utf8("\xc2\xa9 2007-2021 Juan Linietsky, Ariel Manzur.\n\xc2\xa9 2014-2021 ") +
|
||||
TTR("Godot Engine contributors") + "\n");
|
||||
TTR("Godot Engine contributors") + "\n");
|
||||
version_info_vbc->add_child(about_text);
|
||||
|
||||
hbc->add_child(version_info_vbc);
|
||||
|
|
|
@ -4818,8 +4818,8 @@ void EditorNode::_scene_tab_closed(int p_tab, int option) {
|
|||
}
|
||||
|
||||
bool unsaved = (p_tab == editor_data.get_edited_scene()) ?
|
||||
saved_version != editor_data.get_undo_redo().get_version() :
|
||||
editor_data.get_scene_version(p_tab) != 0;
|
||||
saved_version != editor_data.get_undo_redo().get_version() :
|
||||
editor_data.get_scene_version(p_tab) != 0;
|
||||
if (unsaved) {
|
||||
save_confirmation->get_ok()->set_text(TTR("Save & Close"));
|
||||
save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene->get_filename() != "" ? scene->get_filename() : "unsaved scene"));
|
||||
|
|
|
@ -2719,13 +2719,13 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
|
|||
}
|
||||
add_property_editor(p_path, editor);
|
||||
} else if (p_hint == PROPERTY_HINT_METHOD_OF_VARIANT_TYPE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_SCRIPT ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) {
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_SCRIPT ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) {
|
||||
EditorPropertyMember *editor = memnew(EditorPropertyMember);
|
||||
|
||||
EditorPropertyMember::Type type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE;
|
||||
|
|
|
@ -1336,7 +1336,7 @@ void FileSystemDock::_make_dir_confirm() {
|
|||
EditorNode::get_singleton()->show_warning(TTR("No name provided."));
|
||||
return;
|
||||
} else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.find("*") != -1 ||
|
||||
dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) {
|
||||
dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters."));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -409,7 +409,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
|||
tex_flags |= Texture::FLAG_REPEAT;
|
||||
|
||||
const bool min_gles3 = GLOBAL_GET("rendering/quality/driver/driver_name") == "GLES3" &&
|
||||
!GLOBAL_GET("rendering/quality/driver/fallback_to_gles2");
|
||||
!GLOBAL_GET("rendering/quality/driver/fallback_to_gles2");
|
||||
if (!min_gles3 && !image->is_size_po2()) {
|
||||
// The project can be run using GLES2. GLES2 does not guarantee that
|
||||
// repeating textures with a non-power-of-two size will be displayed
|
||||
|
|
|
@ -3175,18 +3175,16 @@ void CanvasItemEditor::_draw_ruler_tool() {
|
|||
|
||||
const Vector2 end_to_begin = (end - begin);
|
||||
|
||||
float arc_1_start_angle =
|
||||
end_to_begin.x < 0 ?
|
||||
(end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 - vertical_angle_rad : Math_PI / 2.0) :
|
||||
(end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 : Math_PI / 2.0 - vertical_angle_rad);
|
||||
float arc_1_start_angle = end_to_begin.x < 0 ?
|
||||
(end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 - vertical_angle_rad : Math_PI / 2.0) :
|
||||
(end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 : Math_PI / 2.0 - vertical_angle_rad);
|
||||
float arc_1_end_angle = arc_1_start_angle + vertical_angle_rad;
|
||||
// Constrain arc to triangle height & max size
|
||||
float arc_1_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.y)), arc_max_radius);
|
||||
|
||||
float arc_2_start_angle =
|
||||
end_to_begin.x < 0 ?
|
||||
(end_to_begin.y < 0 ? 0.0 : -horizontal_angle_rad) :
|
||||
(end_to_begin.y < 0 ? Math_PI - horizontal_angle_rad : Math_PI);
|
||||
float arc_2_start_angle = end_to_begin.x < 0 ?
|
||||
(end_to_begin.y < 0 ? 0.0 : -horizontal_angle_rad) :
|
||||
(end_to_begin.y < 0 ? Math_PI - horizontal_angle_rad : Math_PI);
|
||||
float arc_2_end_angle = arc_2_start_angle + horizontal_angle_rad;
|
||||
// Constrain arc to triangle width & max size
|
||||
float arc_2_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.x)), arc_max_radius);
|
||||
|
@ -6519,13 +6517,13 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian
|
|||
}
|
||||
memdelete(instanced_scene);
|
||||
} else if (type == "Texture" ||
|
||||
type == "ImageTexture" ||
|
||||
type == "ViewportTexture" ||
|
||||
type == "CurveTexture" ||
|
||||
type == "GradientTexture" ||
|
||||
type == "StreamTexture" ||
|
||||
type == "AtlasTexture" ||
|
||||
type == "LargeTexture") {
|
||||
type == "ImageTexture" ||
|
||||
type == "ViewportTexture" ||
|
||||
type == "CurveTexture" ||
|
||||
type == "GradientTexture" ||
|
||||
type == "StreamTexture" ||
|
||||
type == "AtlasTexture" ||
|
||||
type == "LargeTexture") {
|
||||
Ref<Texture> texture = Ref<Texture>(Object::cast_to<Texture>(*res));
|
||||
if (!texture.is_valid()) {
|
||||
continue;
|
||||
|
|
|
@ -353,8 +353,8 @@ void CurveEditor::open_context_menu(Vector2 pos) {
|
|||
_context_menu->add_check_item(TTR("Linear"), CONTEXT_LINEAR);
|
||||
|
||||
bool is_linear = _selected_tangent == TANGENT_LEFT ?
|
||||
_curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR :
|
||||
_curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
|
||||
_curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR :
|
||||
_curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
|
||||
|
||||
_context_menu->set_item_checked(_context_menu->get_item_index(CONTEXT_LINEAR), is_linear);
|
||||
|
||||
|
|
|
@ -156,10 +156,7 @@ void ScriptEditorQuickOpen::_text_changed(const String &p_newtext) {
|
|||
void ScriptEditorQuickOpen::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> k = p_ie;
|
||||
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP ||
|
||||
k->get_scancode() == KEY_DOWN ||
|
||||
k->get_scancode() == KEY_PAGEUP ||
|
||||
k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_PAGEUP || k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
search_options->call("_gui_input", k);
|
||||
search_box->accept_event();
|
||||
}
|
||||
|
|
|
@ -1452,11 +1452,12 @@ Variant ScriptTextEditor::get_drag_data_fw(const Point2 &p_point, Control *p_fro
|
|||
|
||||
bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
|
||||
Dictionary d = p_data;
|
||||
if (d.has("type") && (String(d["type"]) == "resource" ||
|
||||
String(d["type"]) == "files" ||
|
||||
String(d["type"]) == "nodes" ||
|
||||
String(d["type"]) == "obj_property" ||
|
||||
String(d["type"]) == "files_and_dirs")) {
|
||||
if (d.has("type") &&
|
||||
(String(d["type"]) == "resource" ||
|
||||
String(d["type"]) == "files" ||
|
||||
String(d["type"]) == "nodes" ||
|
||||
String(d["type"]) == "obj_property" ||
|
||||
String(d["type"]) == "files_and_dirs")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1609,7 +1609,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
motion_snapped.snap(Vector3(snap, snap, snap));
|
||||
// This might not be necessary anymore after issue #288 is solved (in 4.0?).
|
||||
set_message(TTR("Scaling: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " +
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
|
||||
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
|
||||
Spatial *sp = Object::cast_to<Spatial>(E->get());
|
||||
|
@ -1731,7 +1731,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
Vector3 motion_snapped = motion;
|
||||
motion_snapped.snap(Vector3(snap, snap, snap));
|
||||
set_message(TTR("Translating: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " +
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
|
||||
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
|
||||
Spatial *sp = Object::cast_to<Spatial>(E->get());
|
||||
|
|
|
@ -387,10 +387,7 @@ void TileMapEditor::_text_changed(const String &p_text) {
|
|||
void TileMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> k = p_ie;
|
||||
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP ||
|
||||
k->get_scancode() == KEY_DOWN ||
|
||||
k->get_scancode() == KEY_PAGEUP ||
|
||||
k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_PAGEUP || k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
palette->call("_gui_input", k);
|
||||
search_box->accept_event();
|
||||
}
|
||||
|
|
|
@ -1663,10 +1663,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos) {
|
|||
|
||||
void VisualShaderEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> ie = p_ie;
|
||||
if (ie.is_valid() && (ie->get_scancode() == KEY_UP ||
|
||||
ie->get_scancode() == KEY_DOWN ||
|
||||
ie->get_scancode() == KEY_ENTER ||
|
||||
ie->get_scancode() == KEY_KP_ENTER)) {
|
||||
if (ie.is_valid() && (ie->get_scancode() == KEY_UP || ie->get_scancode() == KEY_DOWN || ie->get_scancode() == KEY_ENTER || ie->get_scancode() == KEY_KP_ENTER)) {
|
||||
members->call("_gui_input", ie);
|
||||
node_filter->accept_event();
|
||||
}
|
||||
|
|
|
@ -632,8 +632,7 @@ void RenameDialog::reset() {
|
|||
}
|
||||
|
||||
bool RenameDialog::_is_main_field(LineEdit *line_edit) {
|
||||
return line_edit &&
|
||||
(line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
|
||||
return line_edit && (line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
|
||||
}
|
||||
|
||||
void RenameDialog::_insert_text(String text) {
|
||||
|
|
|
@ -170,11 +170,11 @@ Vector2 Input::get_vector(const StringName &p_negative_x, const StringName &p_po
|
|||
|
||||
if (p_deadzone < 0.0f) {
|
||||
// If the deadzone isn't specified, get it from the average of the actions.
|
||||
p_deadzone = (InputMap::get_singleton()->action_get_deadzone(p_positive_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_positive_y) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_y)) /
|
||||
4;
|
||||
p_deadzone = 0.25 *
|
||||
(InputMap::get_singleton()->action_get_deadzone(p_positive_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_positive_y) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_y));
|
||||
}
|
||||
|
||||
// Circular length limiting and deadzone.
|
||||
|
|
|
@ -248,8 +248,7 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
|
|||
}
|
||||
// Don't rely on sizeof(bmp_file_header) as structure padding
|
||||
// adds 2 bytes offset leading to misaligned color table reading
|
||||
uint32_t ct_offset = BITMAP_FILE_HEADER_SIZE +
|
||||
bmp_header.bmp_info_header.bmp_header_size;
|
||||
uint32_t ct_offset = BITMAP_FILE_HEADER_SIZE + bmp_header.bmp_info_header.bmp_header_size;
|
||||
f->seek(ct_offset);
|
||||
|
||||
uint32_t color_table_size = 0;
|
||||
|
@ -271,8 +270,7 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
|
|||
|
||||
f->seek(bmp_header.bmp_file_header.bmp_file_offset);
|
||||
|
||||
uint32_t bmp_buffer_size = (bmp_header.bmp_file_header.bmp_file_size -
|
||||
bmp_header.bmp_file_header.bmp_file_offset);
|
||||
uint32_t bmp_buffer_size = (bmp_header.bmp_file_header.bmp_file_size - bmp_header.bmp_file_header.bmp_file_offset);
|
||||
|
||||
PoolVector<uint8_t> bmp_buffer;
|
||||
err = bmp_buffer.resize(bmp_buffer_size);
|
||||
|
|
|
@ -156,8 +156,8 @@ inline bool is_point_in_triangle(const Vector3 &p_point, const Vector3 p_vertice
|
|||
|
||||
inline static bool is_triangle_degenerate(const Vector2 p_vertices[3], real_t p_vertex_snap2) {
|
||||
real_t det = p_vertices[0].x * p_vertices[1].y - p_vertices[0].x * p_vertices[2].y +
|
||||
p_vertices[0].y * p_vertices[2].x - p_vertices[0].y * p_vertices[1].x +
|
||||
p_vertices[1].x * p_vertices[2].y - p_vertices[1].y * p_vertices[2].x;
|
||||
p_vertices[0].y * p_vertices[2].x - p_vertices[0].y * p_vertices[1].x +
|
||||
p_vertices[1].x * p_vertices[2].y - p_vertices[1].y * p_vertices[2].x;
|
||||
|
||||
return det < p_vertex_snap2;
|
||||
}
|
||||
|
|
|
@ -217,8 +217,7 @@ struct EditorSceneImporterAssetImportInterpolate {
|
|||
float t2 = t * t;
|
||||
float t3 = t2 * t;
|
||||
|
||||
return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3);
|
||||
return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3);
|
||||
}
|
||||
|
||||
T bezier(T start, T control_1, T control_2, T end, float t) {
|
||||
|
|
|
@ -114,12 +114,12 @@ const T *ProcessSimpleConnection(const Connection &con,
|
|||
const char **propNameOut = nullptr) {
|
||||
if (is_object_property_conn && !con.PropertyName().length()) {
|
||||
DOMWarning("expected incoming " + std::string(name) +
|
||||
" link to be an object-object connection, ignoring",
|
||||
" link to be an object-object connection, ignoring",
|
||||
element);
|
||||
return nullptr;
|
||||
} else if (!is_object_property_conn && con.PropertyName().length()) {
|
||||
DOMWarning("expected incoming " + std::string(name) +
|
||||
" link to be an object-property connection, ignoring",
|
||||
" link to be an object-property connection, ignoring",
|
||||
element);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -114,12 +114,12 @@ PropertyPtr ReadTypedProperty(const ElementPtr element) {
|
|||
} else if (!strcmp(cs, "KTime")) {
|
||||
return new TypedProperty<int64_t>(ParseTokenAsInt64(tok[4]));
|
||||
} else if (!strcmp(cs, "Vector3D") ||
|
||||
!strcmp(cs, "ColorRGB") ||
|
||||
!strcmp(cs, "Vector") ||
|
||||
!strcmp(cs, "Color") ||
|
||||
!strcmp(cs, "Lcl Translation") ||
|
||||
!strcmp(cs, "Lcl Rotation") ||
|
||||
!strcmp(cs, "Lcl Scaling")) {
|
||||
!strcmp(cs, "ColorRGB") ||
|
||||
!strcmp(cs, "Vector") ||
|
||||
!strcmp(cs, "Color") ||
|
||||
!strcmp(cs, "Lcl Translation") ||
|
||||
!strcmp(cs, "Lcl Rotation") ||
|
||||
!strcmp(cs, "Lcl Scaling")) {
|
||||
return new TypedProperty<Vector3>(Vector3(
|
||||
ParseTokenAsFloat(tok[4]),
|
||||
ParseTokenAsFloat(tok[5]),
|
||||
|
|
|
@ -1782,15 +1782,15 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
|
|||
|
||||
bool GDScriptLanguage::is_control_flow_keyword(String p_keyword) const {
|
||||
return p_keyword == "break" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "elif" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "match" ||
|
||||
p_keyword == "pass" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "while";
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "elif" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "match" ||
|
||||
p_keyword == "pass" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "while";
|
||||
}
|
||||
|
||||
bool GDScriptLanguage::handles_global_class_type(const String &p_type) const {
|
||||
|
|
|
@ -745,7 +745,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
} else {
|
||||
#ifdef DEBUG_ENABLED
|
||||
err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) +
|
||||
"' to a variable of type '" + Variant::get_type_name(var_type) + "'.";
|
||||
"' to a variable of type '" + Variant::get_type_name(var_type) + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
} else {
|
||||
|
@ -768,14 +768,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
GD_ERR_BREAK(!nc);
|
||||
if (src->get_type() != Variant::OBJECT && src->get_type() != Variant::NIL) {
|
||||
err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) +
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
Object *src_obj = src->operator Object *();
|
||||
|
||||
if (src_obj && !ClassDB::is_parent_class(src_obj->get_class_name(), nc->get_name())) {
|
||||
err_text = "Trying to assign value of type '" + src_obj->get_class_name() +
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
|
@ -805,7 +805,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
ScriptInstance *scr_inst = src->operator Object *()->get_script_instance();
|
||||
if (!scr_inst) {
|
||||
err_text = "Trying to assign value of type '" + src->operator Object *()->get_class_name() +
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
|
||||
|
@ -822,7 +822,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
|
||||
if (!valid) {
|
||||
err_text = "Trying to assign value of type '" + src->operator Object *()->get_script_instance()->get_script()->get_path().get_file() +
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4864,14 +4864,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
if (current_class->constant_expressions.has(member.identifier)) {
|
||||
_set_error("A constant named \"" + String(member.identifier) + "\" already exists in this class (at line: " +
|
||||
itos(current_class->constant_expressions[member.identifier].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[member.identifier].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == member.identifier) {
|
||||
_set_error("Variable \"" + String(member.identifier) + "\" already exists in this class (at line: " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5123,14 +5123,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
if (current_class->constant_expressions.has(const_id)) {
|
||||
_set_error("Constant \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == const_id) {
|
||||
_set_error("A variable named \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5201,14 +5201,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
if (current_class->constant_expressions.has(enum_name)) {
|
||||
_set_error("A constant named \"" + String(enum_name) + "\" already exists in this class (at line " +
|
||||
itos(current_class->constant_expressions[enum_name].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[enum_name].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == enum_name) {
|
||||
_set_error("A variable named \"" + String(enum_name) + "\" already exists in this class (at line " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5293,14 +5293,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
} else {
|
||||
if (current_class->constant_expressions.has(const_id)) {
|
||||
_set_error("A constant named \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == const_id) {
|
||||
_set_error("A variable named \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5952,8 +5952,8 @@ GDScriptParser::DataType GDScriptParser::_resolve_type(const DataType &p_source,
|
|||
} else {
|
||||
base = result.to_string();
|
||||
}
|
||||
_set_error("The identifier \"" + String(id) + "\" isn't a valid type (not a script or class), or couldn't be found on base \"" +
|
||||
base + "\".",
|
||||
_set_error("The identifier \"" + String(id) +
|
||||
"\" isn't a valid type (not a script or class), or couldn't be found on base \"" + base + "\".",
|
||||
p_line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6449,7 +6449,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
|
||||
if (!valid) {
|
||||
_set_error("Invalid cast. Cannot convert from \"" + source_type.to_string() +
|
||||
"\" to \"" + cn->cast_type.to_string() + "\".",
|
||||
"\" to \"" + cn->cast_type.to_string() + "\".",
|
||||
cn->line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6537,7 +6537,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
|
||||
if (check_types && !valid) {
|
||||
_set_error("Invalid operand type (\"" + argument_type.to_string() +
|
||||
"\") to unary operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
"\") to unary operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
op->line, op->column);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6581,7 +6581,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
|
||||
if (check_types && !valid) {
|
||||
_set_error("Invalid operand types (\"" + argument_a_type.to_string() + "\" and \"" +
|
||||
argument_b_type.to_string() + "\") to operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
argument_b_type.to_string() + "\") to operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
op->line, op->column);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6667,7 +6667,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
result = _type_from_variant(res);
|
||||
} else if (check_types) {
|
||||
_set_error("Can't get index \"" + String(member_id->name.operator String()) + "\" on base \"" +
|
||||
base_type.to_string() + "\".",
|
||||
base_type.to_string() + "\".",
|
||||
op->line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6794,7 +6794,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
node_type.is_constant = false;
|
||||
} else if (check_types) {
|
||||
_set_error("Can't get index \"" + String(cn->value) + "\" on base \"" +
|
||||
base_type.to_string() + "\".",
|
||||
base_type.to_string() + "\".",
|
||||
op->line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -7388,8 +7388,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||
// Supertypes are acceptable for dynamic compliance
|
||||
if (!_is_type_compatible(par_type, arg_types[i - arg_diff])) {
|
||||
_set_error("At \"" + callee_name + "()\" call, argument " + itos(i - arg_diff + 1) + ". The passed argument's type (" +
|
||||
par_type.to_string() + ") doesn't match the function's expected argument type (" +
|
||||
arg_types[i - arg_diff].to_string() + ").",
|
||||
par_type.to_string() + ") doesn't match the function's expected argument type (" +
|
||||
arg_types[i - arg_diff].to_string() + ").",
|
||||
p_call->line);
|
||||
return DataType();
|
||||
} else {
|
||||
|
@ -7873,7 +7873,7 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
// Try with implicit conversion
|
||||
if (v.data_type.kind != DataType::BUILTIN || !_is_type_compatible(v.data_type, expr_type, true)) {
|
||||
_set_error("The assigned expression's type (" + expr_type.to_string() + ") doesn't match the variable's type (" +
|
||||
v.data_type.to_string() + ").",
|
||||
v.data_type.to_string() + ").",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -7918,7 +7918,7 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
DataType export_type = _type_from_property(v._export);
|
||||
if (!_is_type_compatible(v.data_type, export_type, true)) {
|
||||
_set_error("The export hint's type (" + export_type.to_string() + ") doesn't match the variable's type (" +
|
||||
v.data_type.to_string() + ").",
|
||||
v.data_type.to_string() + ").",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -7939,14 +7939,14 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
if (setter->get_required_argument_count() != 1 &&
|
||||
!(setter->get_required_argument_count() == 0 && setter->default_values.size() > 0)) {
|
||||
_set_error("The setter function needs to receive exactly 1 argument. See \"" + setter->name +
|
||||
"()\" definition at line " + itos(setter->line) + ".",
|
||||
"()\" definition at line " + itos(setter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
if (!_is_type_compatible(v.data_type, setter->argument_types[0])) {
|
||||
_set_error("The setter argument's type (" + setter->argument_types[0].to_string() +
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() + "). See \"" +
|
||||
setter->name + "()\" definition at line " + itos(setter->line) + ".",
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() + "). See \"" +
|
||||
setter->name + "()\" definition at line " + itos(setter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -7958,14 +7958,14 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
|
||||
if (getter->get_required_argument_count() != 0) {
|
||||
_set_error("The getter function can't receive arguments. See \"" + getter->name +
|
||||
"()\" definition at line " + itos(getter->line) + ".",
|
||||
"()\" definition at line " + itos(getter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
if (!_is_type_compatible(v.data_type, getter->get_datatype())) {
|
||||
_set_error("The getter return type (" + getter->get_datatype().to_string() +
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() +
|
||||
"). See \"" + getter->name + "()\" definition at line " + itos(getter->line) + ".",
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() +
|
||||
"). See \"" + getter->name + "()\" definition at line " + itos(getter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -8088,7 +8088,7 @@ void GDScriptParser::_check_function_types(FunctionNode *p_function) {
|
|||
if (!_is_type_compatible(p_function->argument_types[i], def_type, true)) {
|
||||
String arg_name = p_function->arguments[i];
|
||||
_set_error("Value type (" + def_type.to_string() + ") doesn't match the type of argument '" +
|
||||
arg_name + "' (" + p_function->argument_types[i].to_string() + ").",
|
||||
arg_name + "' (" + p_function->argument_types[i].to_string() + ").",
|
||||
p_function->line);
|
||||
}
|
||||
}
|
||||
|
@ -8301,7 +8301,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
// Try implicit conversion
|
||||
if (lv->datatype.kind != DataType::BUILTIN || !_is_type_compatible(lv->datatype, assign_type, true)) {
|
||||
_set_error("The assigned value type (" + assign_type.to_string() + ") doesn't match the variable's type (" +
|
||||
lv->datatype.to_string() + ").",
|
||||
lv->datatype.to_string() + ").",
|
||||
lv->line);
|
||||
return;
|
||||
}
|
||||
|
@ -8407,7 +8407,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
|
||||
if (check_types && !valid) {
|
||||
_set_error("Invalid operand types (\"" + lh_type.to_string() + "\" and \"" + arg_type.to_string() +
|
||||
"\") to assignment operator \"" + Variant::get_operator_name(oper) + "\".",
|
||||
"\") to assignment operator \"" + Variant::get_operator_name(oper) + "\".",
|
||||
op->line);
|
||||
return;
|
||||
}
|
||||
|
@ -8439,7 +8439,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
// Try implicit conversion
|
||||
if (lh_type.kind != DataType::BUILTIN || !_is_type_compatible(lh_type, rh_type, true)) {
|
||||
_set_error("The assigned value's type (" + rh_type.to_string() + ") doesn't match the variable's type (" +
|
||||
lh_type.to_string() + ").",
|
||||
lh_type.to_string() + ").",
|
||||
op->line);
|
||||
return;
|
||||
}
|
||||
|
@ -8548,7 +8548,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
|
||||
if (!_is_type_compatible(function_type, ret_type)) {
|
||||
_set_error("The returned value type (" + ret_type.to_string() + ") doesn't match the function return type (" +
|
||||
function_type.to_string() + ").",
|
||||
function_type.to_string() + ").",
|
||||
cf->line, cf->column);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5430,7 +5430,7 @@ void GLTFDocument::_convert_mult_mesh_instance_to_gltf(MultiMeshInstance *p_mult
|
|||
p_multi_mesh_instance->get_transform() * transform;
|
||||
} else if (multi_mesh->get_transform_format() == MultiMesh::TRANSFORM_3D) {
|
||||
transform = p_multi_mesh_instance->get_transform() *
|
||||
multi_mesh->get_instance_transform(instance_i);
|
||||
multi_mesh->get_instance_transform(instance_i);
|
||||
}
|
||||
Ref<ArrayMesh> mm = multi_mesh->get_mesh();
|
||||
if (mm.is_valid()) {
|
||||
|
|
|
@ -293,22 +293,22 @@ void CSharpLanguage::get_reserved_words(List<String> *p_words) const {
|
|||
|
||||
bool CSharpLanguage::is_control_flow_keyword(String p_keyword) const {
|
||||
return p_keyword == "break" ||
|
||||
p_keyword == "case" ||
|
||||
p_keyword == "catch" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "default" ||
|
||||
p_keyword == "do" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "finally" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "foreach" ||
|
||||
p_keyword == "goto" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "switch" ||
|
||||
p_keyword == "throw" ||
|
||||
p_keyword == "try" ||
|
||||
p_keyword == "while";
|
||||
p_keyword == "case" ||
|
||||
p_keyword == "catch" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "default" ||
|
||||
p_keyword == "do" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "finally" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "foreach" ||
|
||||
p_keyword == "goto" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "switch" ||
|
||||
p_keyword == "throw" ||
|
||||
p_keyword == "try" ||
|
||||
p_keyword == "while";
|
||||
}
|
||||
|
||||
void CSharpLanguage::get_comment_delimiters(List<String> *p_delimiters) const {
|
||||
|
@ -3023,8 +3023,7 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) {
|
|||
if (ScriptDebugger::get_singleton()) {
|
||||
CSharpLanguage::get_singleton()->debug_break_parse(get_path(), 0, "Script inherits from native type '" + native_name + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'");
|
||||
}
|
||||
ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + native_name +
|
||||
"', so it can't be instanced in object of type: '" + p_this->get_class() + "'.");
|
||||
ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + native_name + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2350,7 +2350,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
if (itype.cname != name_cache.type_Object || imethod.name != "free") {
|
||||
WARN_PRINT("Notification: New unexpected virtual non-overridable method found."
|
||||
" We only expected Object.free, but found '" +
|
||||
itype.name + "." + imethod.name + "'.");
|
||||
itype.name + "." + imethod.name + "'.");
|
||||
}
|
||||
} else if (return_info.type == Variant::INT && return_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) {
|
||||
imethod.return_type.cname = return_info.class_name;
|
||||
|
|
|
@ -638,8 +638,7 @@ static String get_preprocessor_directive(const String &p_line, int p_from) {
|
|||
CRASH_COND(p_line[p_from] != '#');
|
||||
p_from++;
|
||||
int i = p_from;
|
||||
while (i < p_line.length() && (p_line[i] == '_' || (p_line[i] >= 'A' && p_line[i] <= 'Z') ||
|
||||
(p_line[i] >= 'a' && p_line[i] <= 'z') || p_line[i] > 127)) {
|
||||
while (i < p_line.length() && (p_line[i] == '_' || (p_line[i] >= 'A' && p_line[i] <= 'Z') || (p_line[i] >= 'a' && p_line[i] <= 'z') || p_line[i] > 127)) {
|
||||
i++;
|
||||
}
|
||||
return p_line.substr(p_from, i - p_from);
|
||||
|
|
|
@ -149,7 +149,7 @@ void gd_mono_debug_init() {
|
|||
|
||||
if (da_args.length() == 0) {
|
||||
da_args = String("--debugger-agent=transport=dt_socket,address=127.0.0.1:" + itos(da_port) +
|
||||
",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n"))
|
||||
",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n"))
|
||||
.utf8();
|
||||
}
|
||||
#else
|
||||
|
@ -585,8 +585,8 @@ ApiAssemblyInfo::Version ApiAssemblyInfo::Version::get_from_loaded_assembly(GDMo
|
|||
ApiAssemblyInfo::Version api_assembly_version;
|
||||
|
||||
const char *nativecalls_name = p_api_type == ApiAssemblyInfo::API_CORE ?
|
||||
BINDINGS_CLASS_NATIVECALLS :
|
||||
BINDINGS_CLASS_NATIVECALLS_EDITOR;
|
||||
BINDINGS_CLASS_NATIVECALLS :
|
||||
BINDINGS_CLASS_NATIVECALLS_EDITOR;
|
||||
|
||||
GDMonoClass *nativecalls_klass = p_api_assembly->get_class(BINDINGS_NAMESPACE, nativecalls_name);
|
||||
|
||||
|
@ -685,11 +685,11 @@ static bool try_get_cached_api_hash_for(const String &p_api_assemblies_dir, bool
|
|||
}
|
||||
|
||||
r_out_of_sync = GodotSharpBindings::get_bindings_version() != (uint32_t)cfg->get_value("core", "bindings_version") ||
|
||||
GodotSharpBindings::get_cs_glue_version() != (uint32_t)cfg->get_value("core", "cs_glue_version") ||
|
||||
GodotSharpBindings::get_bindings_version() != (uint32_t)cfg->get_value("editor", "bindings_version") ||
|
||||
GodotSharpBindings::get_cs_glue_version() != (uint32_t)cfg->get_value("editor", "cs_glue_version") ||
|
||||
GodotSharpBindings::get_core_api_hash() != (uint64_t)cfg->get_value("core", "api_hash") ||
|
||||
GodotSharpBindings::get_editor_api_hash() != (uint64_t)cfg->get_value("editor", "api_hash");
|
||||
GodotSharpBindings::get_cs_glue_version() != (uint32_t)cfg->get_value("core", "cs_glue_version") ||
|
||||
GodotSharpBindings::get_bindings_version() != (uint32_t)cfg->get_value("editor", "bindings_version") ||
|
||||
GodotSharpBindings::get_cs_glue_version() != (uint32_t)cfg->get_value("editor", "cs_glue_version") ||
|
||||
GodotSharpBindings::get_core_api_hash() != (uint64_t)cfg->get_value("core", "api_hash") ||
|
||||
GodotSharpBindings::get_editor_api_hash() != (uint64_t)cfg->get_value("editor", "api_hash");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -801,13 +801,13 @@ bool GDMono::_load_core_api_assembly(LoadedApiAssembly &r_loaded_api_assembly, c
|
|||
|
||||
// If running the project manager, load it from the prebuilt API directory
|
||||
String assembly_dir = !Main::is_project_manager() ?
|
||||
GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config) :
|
||||
GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config);
|
||||
GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config) :
|
||||
GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config);
|
||||
|
||||
String assembly_path = assembly_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll");
|
||||
|
||||
bool success = FileAccess::exists(assembly_path) &&
|
||||
load_assembly_from(CORE_API_ASSEMBLY_NAME, assembly_path, &r_loaded_api_assembly.assembly, p_refonly);
|
||||
load_assembly_from(CORE_API_ASSEMBLY_NAME, assembly_path, &r_loaded_api_assembly.assembly, p_refonly);
|
||||
#else
|
||||
bool success = load_assembly(CORE_API_ASSEMBLY_NAME, &r_loaded_api_assembly.assembly, p_refonly);
|
||||
#endif
|
||||
|
@ -815,8 +815,8 @@ bool GDMono::_load_core_api_assembly(LoadedApiAssembly &r_loaded_api_assembly, c
|
|||
if (success) {
|
||||
ApiAssemblyInfo::Version api_assembly_ver = ApiAssemblyInfo::Version::get_from_loaded_assembly(r_loaded_api_assembly.assembly, ApiAssemblyInfo::API_CORE);
|
||||
r_loaded_api_assembly.out_of_sync = GodotSharpBindings::get_core_api_hash() != api_assembly_ver.godot_api_hash ||
|
||||
GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version ||
|
||||
GodotSharpBindings::get_cs_glue_version() != api_assembly_ver.cs_glue_version;
|
||||
GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version ||
|
||||
GodotSharpBindings::get_cs_glue_version() != api_assembly_ver.cs_glue_version;
|
||||
} else {
|
||||
r_loaded_api_assembly.out_of_sync = false;
|
||||
}
|
||||
|
@ -833,19 +833,19 @@ bool GDMono::_load_editor_api_assembly(LoadedApiAssembly &r_loaded_api_assembly,
|
|||
|
||||
// If running the project manager, load it from the prebuilt API directory
|
||||
String assembly_dir = !Main::is_project_manager() ?
|
||||
GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config) :
|
||||
GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config);
|
||||
GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config) :
|
||||
GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config);
|
||||
|
||||
String assembly_path = assembly_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll");
|
||||
|
||||
bool success = FileAccess::exists(assembly_path) &&
|
||||
load_assembly_from(EDITOR_API_ASSEMBLY_NAME, assembly_path, &r_loaded_api_assembly.assembly, p_refonly);
|
||||
load_assembly_from(EDITOR_API_ASSEMBLY_NAME, assembly_path, &r_loaded_api_assembly.assembly, p_refonly);
|
||||
|
||||
if (success) {
|
||||
ApiAssemblyInfo::Version api_assembly_ver = ApiAssemblyInfo::Version::get_from_loaded_assembly(r_loaded_api_assembly.assembly, ApiAssemblyInfo::API_EDITOR);
|
||||
r_loaded_api_assembly.out_of_sync = GodotSharpBindings::get_editor_api_hash() != api_assembly_ver.godot_api_hash ||
|
||||
GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version ||
|
||||
GodotSharpBindings::get_cs_glue_version() != api_assembly_ver.cs_glue_version;
|
||||
GodotSharpBindings::get_bindings_version() != api_assembly_ver.bindings_version ||
|
||||
GodotSharpBindings::get_cs_glue_version() != api_assembly_ver.cs_glue_version;
|
||||
} else {
|
||||
r_loaded_api_assembly.out_of_sync = false;
|
||||
}
|
||||
|
@ -958,7 +958,7 @@ bool GDMono::_load_tools_assemblies() {
|
|||
return true;
|
||||
|
||||
bool success = load_assembly(TOOLS_ASM_NAME, &tools_assembly) &&
|
||||
load_assembly(TOOLS_PROJECT_EDITOR_ASM_NAME, &tools_project_editor_assembly);
|
||||
load_assembly(TOOLS_PROJECT_EDITOR_ASM_NAME, &tools_project_editor_assembly);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -54,8 +54,8 @@ struct Version {
|
|||
|
||||
bool operator==(const Version &p_other) const {
|
||||
return godot_api_hash == p_other.godot_api_hash &&
|
||||
bindings_version == p_other.bindings_version &&
|
||||
cs_glue_version == p_other.cs_glue_version;
|
||||
bindings_version == p_other.bindings_version &&
|
||||
cs_glue_version == p_other.cs_glue_version;
|
||||
}
|
||||
|
||||
Version() :
|
||||
|
|
|
@ -180,7 +180,7 @@ void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base
|
|||
#ifdef DEBUG_ENABLED
|
||||
String fullname = method->get_ret_type_full_name() + " " + name + "(" + method->get_signature_desc(true) + ")";
|
||||
WARN_PRINT("Method '" + fullname + "' is hidden by Godot API method. Should be '" +
|
||||
method->get_full_name_no_class() + "'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
method->get_full_name_no_class() + "'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base
|
|||
// found
|
||||
String fullname = m->get_ret_type_full_name() + " " + name + "(" + m->get_signature_desc(true) + ")";
|
||||
WARN_PRINT("Method '" + fullname + "' should be '" + m->get_full_name_no_class() +
|
||||
"'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
"'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -712,8 +712,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
|
|||
} break;
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to an unmarshallable managed type. Name: '" +
|
||||
p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to an unmarshallable managed type. Name: '" + p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
}
|
||||
|
||||
Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type, bool p_fail_with_err = true) {
|
||||
|
@ -925,8 +924,7 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type
|
|||
}
|
||||
|
||||
if (p_fail_with_err) {
|
||||
ERR_FAIL_V_MSG(Variant(), "Attempted to convert an unmarshallable managed type to Variant. Name: '" +
|
||||
p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
ERR_FAIL_V_MSG(Variant(), "Attempted to convert an unmarshallable managed type to Variant. Name: '" + p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
} else {
|
||||
return Variant();
|
||||
}
|
||||
|
@ -982,7 +980,7 @@ String mono_object_to_variant_string(MonoObject *p_obj, MonoException **r_exc) {
|
|||
|
||||
MonoObject *Dictionary_to_system_generic_dict(const Dictionary &p_dict, GDMonoClass *p_class, MonoReflectionType *p_key_reftype, MonoReflectionType *p_value_reftype) {
|
||||
String ctor_desc = ":.ctor(System.Collections.Generic.IDictionary`2<" + GDMonoUtils::get_type_desc(p_key_reftype) +
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
GDMonoMethod *ctor = p_class->get_method_with_desc(ctor_desc, true);
|
||||
CRASH_COND(ctor == nullptr);
|
||||
|
||||
|
@ -1004,7 +1002,7 @@ MonoObject *Dictionary_to_system_generic_dict(const Dictionary &p_dict, GDMonoCl
|
|||
Dictionary system_generic_dict_to_Dictionary(MonoObject *p_obj, GDMonoClass *p_class, MonoReflectionType *p_key_reftype, MonoReflectionType *p_value_reftype) {
|
||||
GDMonoClass *godot_dict_class = GDMonoUtils::Marshal::make_generic_dictionary_type(p_key_reftype, p_value_reftype);
|
||||
String ctor_desc = ":.ctor(System.Collections.Generic.IDictionary`2<" + GDMonoUtils::get_type_desc(p_key_reftype) +
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
GDMonoMethod *godot_dict_ctor = godot_dict_class->get_method_with_desc(ctor_desc, true);
|
||||
CRASH_COND(godot_dict_ctor == nullptr);
|
||||
|
||||
|
|
|
@ -187,45 +187,45 @@ enum {
|
|||
#endif
|
||||
|
||||
MATCHES_Vector2 = (MATCHES_real_t && (sizeof(Vector2) == (sizeof(real_t) * 2)) &&
|
||||
offsetof(Vector2, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector2, y) == (sizeof(real_t) * 1)),
|
||||
offsetof(Vector2, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector2, y) == (sizeof(real_t) * 1)),
|
||||
|
||||
MATCHES_Rect2 = (MATCHES_Vector2 && (sizeof(Rect2) == (sizeof(Vector2) * 2)) &&
|
||||
offsetof(Rect2, position) == (sizeof(Vector2) * 0) &&
|
||||
offsetof(Rect2, size) == (sizeof(Vector2) * 1)),
|
||||
offsetof(Rect2, position) == (sizeof(Vector2) * 0) &&
|
||||
offsetof(Rect2, size) == (sizeof(Vector2) * 1)),
|
||||
|
||||
MATCHES_Transform2D = (MATCHES_Vector2 && (sizeof(Transform2D) == (sizeof(Vector2) * 3))), // No field offset required, it stores an array
|
||||
|
||||
MATCHES_Vector3 = (MATCHES_real_t && (sizeof(Vector3) == (sizeof(real_t) * 3)) &&
|
||||
offsetof(Vector3, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector3, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Vector3, z) == (sizeof(real_t) * 2)),
|
||||
offsetof(Vector3, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector3, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Vector3, z) == (sizeof(real_t) * 2)),
|
||||
|
||||
MATCHES_Basis = (MATCHES_Vector3 && (sizeof(Basis) == (sizeof(Vector3) * 3))), // No field offset required, it stores an array
|
||||
|
||||
MATCHES_Quat = (MATCHES_real_t && (sizeof(Quat) == (sizeof(real_t) * 4)) &&
|
||||
offsetof(Quat, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Quat, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Quat, z) == (sizeof(real_t) * 2) &&
|
||||
offsetof(Quat, w) == (sizeof(real_t) * 3)),
|
||||
offsetof(Quat, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Quat, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Quat, z) == (sizeof(real_t) * 2) &&
|
||||
offsetof(Quat, w) == (sizeof(real_t) * 3)),
|
||||
|
||||
MATCHES_Transform = (MATCHES_Basis && MATCHES_Vector3 && (sizeof(Transform) == (sizeof(Basis) + sizeof(Vector3))) &&
|
||||
offsetof(Transform, basis) == 0 &&
|
||||
offsetof(Transform, origin) == sizeof(Basis)),
|
||||
offsetof(Transform, basis) == 0 &&
|
||||
offsetof(Transform, origin) == sizeof(Basis)),
|
||||
|
||||
MATCHES_AABB = (MATCHES_Vector3 && (sizeof(AABB) == (sizeof(Vector3) * 2)) &&
|
||||
offsetof(AABB, position) == (sizeof(Vector3) * 0) &&
|
||||
offsetof(AABB, size) == (sizeof(Vector3) * 1)),
|
||||
offsetof(AABB, position) == (sizeof(Vector3) * 0) &&
|
||||
offsetof(AABB, size) == (sizeof(Vector3) * 1)),
|
||||
|
||||
MATCHES_Color = (MATCHES_float && (sizeof(Color) == (sizeof(float) * 4)) &&
|
||||
offsetof(Color, r) == (sizeof(float) * 0) &&
|
||||
offsetof(Color, g) == (sizeof(float) * 1) &&
|
||||
offsetof(Color, b) == (sizeof(float) * 2) &&
|
||||
offsetof(Color, a) == (sizeof(float) * 3)),
|
||||
offsetof(Color, r) == (sizeof(float) * 0) &&
|
||||
offsetof(Color, g) == (sizeof(float) * 1) &&
|
||||
offsetof(Color, b) == (sizeof(float) * 2) &&
|
||||
offsetof(Color, a) == (sizeof(float) * 3)),
|
||||
|
||||
MATCHES_Plane = (MATCHES_Vector3 && MATCHES_real_t && (sizeof(Plane) == (sizeof(Vector3) + sizeof(real_t))) &&
|
||||
offsetof(Plane, normal) == 0 &&
|
||||
offsetof(Plane, d) == sizeof(Vector3))
|
||||
offsetof(Plane, normal) == 0 &&
|
||||
offsetof(Plane, d) == sizeof(Vector3))
|
||||
};
|
||||
|
||||
// In the future we may force this if we want to ref return these structs
|
||||
|
|
|
@ -173,7 +173,7 @@ template <typename T>
|
|||
struct m2n_arg_cast_helper<T, 'L'> {
|
||||
static T cast(Mono_InterpMethodArguments *p_margs, size_t p_idx) {
|
||||
static_assert(std::is_same<T, int64_t>::value || std::is_same<T, uint64_t>::value ||
|
||||
(sizeof(void *) == 8 && std::is_pointer<T>::value),
|
||||
(sizeof(void *) == 8 && std::is_pointer<T>::value),
|
||||
"Invalid type for cookie 'L'.");
|
||||
|
||||
union {
|
||||
|
|
|
@ -135,24 +135,24 @@ bool is_csharp_keyword(const String &p_name) {
|
|||
// Reserved keywords
|
||||
|
||||
return p_name == "abstract" || p_name == "as" || p_name == "base" || p_name == "bool" ||
|
||||
p_name == "break" || p_name == "byte" || p_name == "case" || p_name == "catch" ||
|
||||
p_name == "char" || p_name == "checked" || p_name == "class" || p_name == "const" ||
|
||||
p_name == "continue" || p_name == "decimal" || p_name == "default" || p_name == "delegate" ||
|
||||
p_name == "do" || p_name == "double" || p_name == "else" || p_name == "enum" ||
|
||||
p_name == "event" || p_name == "explicit" || p_name == "extern" || p_name == "false" ||
|
||||
p_name == "finally" || p_name == "fixed" || p_name == "float" || p_name == "for" ||
|
||||
p_name == "forech" || p_name == "goto" || p_name == "if" || p_name == "implicit" ||
|
||||
p_name == "in" || p_name == "int" || p_name == "interface" || p_name == "internal" ||
|
||||
p_name == "is" || p_name == "lock" || p_name == "long" || p_name == "namespace" ||
|
||||
p_name == "new" || p_name == "null" || p_name == "object" || p_name == "operator" ||
|
||||
p_name == "out" || p_name == "override" || p_name == "params" || p_name == "private" ||
|
||||
p_name == "protected" || p_name == "public" || p_name == "readonly" || p_name == "ref" ||
|
||||
p_name == "return" || p_name == "sbyte" || p_name == "sealed" || p_name == "short" ||
|
||||
p_name == "sizeof" || p_name == "stackalloc" || p_name == "static" || p_name == "string" ||
|
||||
p_name == "struct" || p_name == "switch" || p_name == "this" || p_name == "throw" ||
|
||||
p_name == "true" || p_name == "try" || p_name == "typeof" || p_name == "uint" || p_name == "ulong" ||
|
||||
p_name == "unchecked" || p_name == "unsafe" || p_name == "ushort" || p_name == "using" ||
|
||||
p_name == "virtual" || p_name == "volatile" || p_name == "void" || p_name == "while";
|
||||
p_name == "break" || p_name == "byte" || p_name == "case" || p_name == "catch" ||
|
||||
p_name == "char" || p_name == "checked" || p_name == "class" || p_name == "const" ||
|
||||
p_name == "continue" || p_name == "decimal" || p_name == "default" || p_name == "delegate" ||
|
||||
p_name == "do" || p_name == "double" || p_name == "else" || p_name == "enum" ||
|
||||
p_name == "event" || p_name == "explicit" || p_name == "extern" || p_name == "false" ||
|
||||
p_name == "finally" || p_name == "fixed" || p_name == "float" || p_name == "for" ||
|
||||
p_name == "forech" || p_name == "goto" || p_name == "if" || p_name == "implicit" ||
|
||||
p_name == "in" || p_name == "int" || p_name == "interface" || p_name == "internal" ||
|
||||
p_name == "is" || p_name == "lock" || p_name == "long" || p_name == "namespace" ||
|
||||
p_name == "new" || p_name == "null" || p_name == "object" || p_name == "operator" ||
|
||||
p_name == "out" || p_name == "override" || p_name == "params" || p_name == "private" ||
|
||||
p_name == "protected" || p_name == "public" || p_name == "readonly" || p_name == "ref" ||
|
||||
p_name == "return" || p_name == "sbyte" || p_name == "sealed" || p_name == "short" ||
|
||||
p_name == "sizeof" || p_name == "stackalloc" || p_name == "static" || p_name == "string" ||
|
||||
p_name == "struct" || p_name == "switch" || p_name == "this" || p_name == "throw" ||
|
||||
p_name == "true" || p_name == "try" || p_name == "typeof" || p_name == "uint" || p_name == "ulong" ||
|
||||
p_name == "unchecked" || p_name == "unsafe" || p_name == "ushort" || p_name == "using" ||
|
||||
p_name == "virtual" || p_name == "volatile" || p_name == "void" || p_name == "while";
|
||||
}
|
||||
|
||||
String escape_csharp_keyword(const String &p_name) {
|
||||
|
|
|
@ -398,15 +398,15 @@ static void get_modulation_value(int x, int y, const int p_2bit, const int p_mod
|
|||
rep_vals0[p_modulation[y + 1][x]] +
|
||||
rep_vals0[p_modulation[y][x - 1]] +
|
||||
rep_vals0[p_modulation[y][x + 1]] + 2) /
|
||||
4;
|
||||
4;
|
||||
} else if (p_modulation_modes[y][x] == 2) {
|
||||
mod_val = (rep_vals0[p_modulation[y][x - 1]] +
|
||||
rep_vals0[p_modulation[y][x + 1]] + 1) /
|
||||
2;
|
||||
2;
|
||||
} else {
|
||||
mod_val = (rep_vals0[p_modulation[y - 1][x]] +
|
||||
rep_vals0[p_modulation[y + 1][x]] + 1) /
|
||||
2;
|
||||
2;
|
||||
}
|
||||
} else {
|
||||
mod_val = rep_vals1[p_modulation[y][x]];
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
|
||||
bool UPNP::is_common_device(const String &dev) const {
|
||||
return dev.empty() ||
|
||||
dev.find("InternetGatewayDevice") >= 0 ||
|
||||
dev.find("WANIPConnection") >= 0 ||
|
||||
dev.find("WANPPPConnection") >= 0 ||
|
||||
dev.find("rootdevice") >= 0;
|
||||
dev.find("InternetGatewayDevice") >= 0 ||
|
||||
dev.find("WANIPConnection") >= 0 ||
|
||||
dev.find("WANPPPConnection") >= 0 ||
|
||||
dev.find("rootdevice") >= 0;
|
||||
}
|
||||
|
||||
int UPNP::discover(int timeout, int ttl, const String &device_filter) {
|
||||
|
|
|
@ -3799,7 +3799,7 @@ void VisualScriptEditor::connect_seq(Ref<VisualScriptNode> vnode_old, Ref<Visual
|
|||
undo_redo->add_do_method(script.ptr(), "sequence_connect", func, port_action_node, pass_port, new_id);
|
||||
undo_redo->add_undo_method(script.ptr(), "sequence_disconnect", func, port_action_node, pass_port, new_id);
|
||||
} else if (vnode_old->get_output_value_port_info(port_action_output).name == String("return") &&
|
||||
!script->get_output_sequence_ports_connected(func, port_action_node).has(return_port)) {
|
||||
!script->get_output_sequence_ports_connected(func, port_action_node).has(return_port)) {
|
||||
undo_redo->add_do_method(script.ptr(), "sequence_connect", func, port_action_node, return_port, new_id);
|
||||
undo_redo->add_undo_method(script.ptr(), "sequence_disconnect", func, port_action_node, return_port, new_id);
|
||||
} else {
|
||||
|
|
|
@ -831,7 +831,7 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|||
OS::get_singleton()->get_screen_orientation_from_string(GLOBAL_GET("display/window/handheld/orientation")));
|
||||
|
||||
bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES3" &&
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
bool screen_support_small = p_preset->get("screen/support_small");
|
||||
bool screen_support_normal = p_preset->get("screen/support_normal");
|
||||
bool screen_support_large = p_preset->get("screen/support_large");
|
||||
|
|
|
@ -96,13 +96,13 @@ Vector<PluginConfigAndroid> PluginConfigAndroid::get_prebuilt_plugins(String plu
|
|||
bool PluginConfigAndroid::is_plugin_config_valid(PluginConfigAndroid plugin_config) {
|
||||
bool valid_name = !plugin_config.name.empty();
|
||||
bool valid_binary_type = plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_LOCAL ||
|
||||
plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE;
|
||||
plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE;
|
||||
|
||||
bool valid_binary = false;
|
||||
if (valid_binary_type) {
|
||||
valid_binary = !plugin_config.binary.empty() &&
|
||||
(plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE ||
|
||||
FileAccess::exists(plugin_config.binary));
|
||||
(plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE ||
|
||||
FileAccess::exists(plugin_config.binary));
|
||||
}
|
||||
|
||||
bool valid_local_dependencies = true;
|
||||
|
|
|
@ -191,7 +191,7 @@ String bool_to_string(bool v) {
|
|||
|
||||
String _get_gles_tag() {
|
||||
bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES3" &&
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
return min_gles3 ? " <uses-feature android:glEsVersion=\"0x00030000\" android:required=\"true\" />\n" : "";
|
||||
}
|
||||
|
||||
|
|
|
@ -683,8 +683,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
|
|||
|
||||
if (!pack_valid) {
|
||||
Intent notifierIntent = new Intent(activity, activity.getClass());
|
||||
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
|
||||
Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(activity, 0,
|
||||
notifierIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
|
|
@ -157,15 +157,15 @@ public class GodotView extends GLSurfaceView {
|
|||
|
||||
if (GLUtils.use_32) {
|
||||
setEGLConfigChooser(translucent ?
|
||||
new RegularFallbackConfigChooser(8, 8, 8, 8, 24, stencil,
|
||||
new RegularConfigChooser(8, 8, 8, 8, 16, stencil)) :
|
||||
new RegularFallbackConfigChooser(8, 8, 8, 8, 24, stencil,
|
||||
new RegularConfigChooser(5, 6, 5, 0, 16, stencil)));
|
||||
new RegularFallbackConfigChooser(8, 8, 8, 8, 24, stencil,
|
||||
new RegularConfigChooser(8, 8, 8, 8, 16, stencil)) :
|
||||
new RegularFallbackConfigChooser(8, 8, 8, 8, 24, stencil,
|
||||
new RegularConfigChooser(5, 6, 5, 0, 16, stencil)));
|
||||
|
||||
} else {
|
||||
setEGLConfigChooser(translucent ?
|
||||
new RegularConfigChooser(8, 8, 8, 8, 16, stencil) :
|
||||
new RegularConfigChooser(5, 6, 5, 0, 16, stencil));
|
||||
new RegularConfigChooser(8, 8, 8, 8, 16, stencil) :
|
||||
new RegularConfigChooser(5, 6, 5, 0, 16, stencil));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -187,9 +187,9 @@ public class GodotEditText extends EditText {
|
|||
|
||||
private boolean needHandlingInGodot(int keyCode, KeyEvent keyEvent) {
|
||||
boolean isArrowKey = keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||
|
||||
keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT;
|
||||
keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT;
|
||||
boolean isModifiedKey = keyEvent.isAltPressed() || keyEvent.isCtrlPressed() || keyEvent.isSymPressed() ||
|
||||
keyEvent.isFunctionPressed() || keyEvent.isMetaPressed();
|
||||
keyEvent.isFunctionPressed() || keyEvent.isMetaPressed();
|
||||
return isArrowKey || keyCode == KeyEvent.KEYCODE_TAB || KeyEvent.isModifierKey(keyCode) ||
|
||||
isModifiedKey;
|
||||
}
|
||||
|
|
|
@ -1113,7 +1113,7 @@ void EditorExportPlatformIOS::_add_assets_to_project(const Ref<EditorExportPrese
|
|||
String pbx_embeded_frameworks;
|
||||
|
||||
const String file_info_format = String("$build_id = {isa = PBXBuildFile; fileRef = $ref_id; };\n") +
|
||||
"$ref_id = {isa = PBXFileReference; lastKnownFileType = $file_type; name = \"$name\"; path = \"$file_path\"; sourceTree = \"<group>\"; };\n";
|
||||
"$ref_id = {isa = PBXFileReference; lastKnownFileType = $file_type; name = \"$name\"; path = \"$file_path\"; sourceTree = \"<group>\"; };\n";
|
||||
|
||||
for (int i = 0; i < p_additional_assets.size(); ++i) {
|
||||
String additional_asset_info_format = file_info_format;
|
||||
|
@ -1533,8 +1533,8 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset>
|
|||
String deinitialization_method = plugin.deinitialization_method + "();\n";
|
||||
|
||||
plugin_definition_cpp_code += definition_comment +
|
||||
"extern void " + initialization_method +
|
||||
"extern void " + deinitialization_method + "\n";
|
||||
"extern void " + initialization_method +
|
||||
"extern void " + deinitialization_method + "\n";
|
||||
|
||||
plugin_initialization_cpp_code += "\t" + initialization_method;
|
||||
plugin_deinitialization_cpp_code += "\t" + deinitialization_method;
|
||||
|
|
|
@ -463,7 +463,7 @@ void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Re
|
|||
if (p_preset->get("progressive_web_app/enabled")) {
|
||||
head_include += "<link rel='manifest' href='" + p_name + ".manifest.json'>\n";
|
||||
head_include += "<script type='application/javascript'>window.addEventListener('load', () => {if ('serviceWorker' in navigator) {navigator.serviceWorker.register('" +
|
||||
p_name + ".service.worker.js');}});</script>\n";
|
||||
p_name + ".service.worker.js');}});</script>\n";
|
||||
}
|
||||
|
||||
// Replaces HTML string
|
||||
|
|
|
@ -343,10 +343,10 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
|
|||
}
|
||||
// Xbox controller hat values start at 1 rather than 0.
|
||||
p_joy->offset_hat = vendor == 0x45e &&
|
||||
(product_id == 0x0b05 ||
|
||||
product_id == 0x02e0 ||
|
||||
product_id == 0x02fd ||
|
||||
product_id == 0x0b13);
|
||||
(product_id == 0x0b05 ||
|
||||
product_id == 0x02e0 ||
|
||||
product_id == 0x02fd ||
|
||||
product_id == 0x0b13);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -131,8 +131,7 @@ void App::SetWindow(CoreWindow ^ p_window) {
|
|||
window->PointerWheelChanged +=
|
||||
ref new TypedEventHandler<CoreWindow ^, PointerEventArgs ^>(this, &App::OnPointerWheelChanged);
|
||||
|
||||
mouseChangedNotifier = SignalNotifier::AttachToEvent(L"os_mouse_mode_changed", ref new SignalHandler(
|
||||
this, &App::OnMouseModeChanged));
|
||||
mouseChangedNotifier = SignalNotifier::AttachToEvent(L"os_mouse_mode_changed", ref new SignalHandler(this, &App::OnMouseModeChanged));
|
||||
|
||||
mouseChangedNotifier->Enable();
|
||||
|
||||
|
|
|
@ -414,13 +414,13 @@ unsigned int KeyMappingWindows::get_scansym(unsigned int p_code, bool p_extended
|
|||
|
||||
bool KeyMappingWindows::is_extended_key(unsigned int p_code) {
|
||||
return p_code == VK_INSERT ||
|
||||
p_code == VK_DELETE ||
|
||||
p_code == VK_HOME ||
|
||||
p_code == VK_END ||
|
||||
p_code == VK_PRIOR ||
|
||||
p_code == VK_NEXT ||
|
||||
p_code == VK_LEFT ||
|
||||
p_code == VK_UP ||
|
||||
p_code == VK_RIGHT ||
|
||||
p_code == VK_DOWN;
|
||||
p_code == VK_DELETE ||
|
||||
p_code == VK_HOME ||
|
||||
p_code == VK_END ||
|
||||
p_code == VK_PRIOR ||
|
||||
p_code == VK_NEXT ||
|
||||
p_code == VK_LEFT ||
|
||||
p_code == VK_UP ||
|
||||
p_code == VK_RIGHT ||
|
||||
p_code == VK_DOWN;
|
||||
}
|
||||
|
|
|
@ -426,18 +426,18 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
XSetWindowAttributes new_attr;
|
||||
|
||||
new_attr.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |
|
||||
ButtonReleaseMask | EnterWindowMask |
|
||||
LeaveWindowMask | PointerMotionMask |
|
||||
Button1MotionMask |
|
||||
Button2MotionMask | Button3MotionMask |
|
||||
Button4MotionMask | Button5MotionMask |
|
||||
ButtonMotionMask | KeymapStateMask |
|
||||
ExposureMask | VisibilityChangeMask |
|
||||
StructureNotifyMask |
|
||||
SubstructureNotifyMask | SubstructureRedirectMask |
|
||||
FocusChangeMask | PropertyChangeMask |
|
||||
ColormapChangeMask | OwnerGrabButtonMask |
|
||||
im_event_mask;
|
||||
ButtonReleaseMask | EnterWindowMask |
|
||||
LeaveWindowMask | PointerMotionMask |
|
||||
Button1MotionMask |
|
||||
Button2MotionMask | Button3MotionMask |
|
||||
Button4MotionMask | Button5MotionMask |
|
||||
ButtonMotionMask | KeymapStateMask |
|
||||
ExposureMask | VisibilityChangeMask |
|
||||
StructureNotifyMask |
|
||||
SubstructureNotifyMask | SubstructureRedirectMask |
|
||||
FocusChangeMask | PropertyChangeMask |
|
||||
ColormapChangeMask | OwnerGrabButtonMask |
|
||||
im_event_mask;
|
||||
|
||||
XChangeWindowAttributes(x11_display, x11_window, CWEventMask, &new_attr);
|
||||
|
||||
|
@ -2115,11 +2115,11 @@ Atom OS_X11::_process_selection_request_target(Atom p_target, Window p_requestor
|
|||
0);
|
||||
return p_property;
|
||||
} else if (p_target == XInternAtom(x11_display, "UTF8_STRING", 0) ||
|
||||
p_target == XInternAtom(x11_display, "COMPOUND_TEXT", 0) ||
|
||||
p_target == XInternAtom(x11_display, "TEXT", 0) ||
|
||||
p_target == XA_STRING ||
|
||||
p_target == XInternAtom(x11_display, "text/plain;charset=utf-8", 0) ||
|
||||
p_target == XInternAtom(x11_display, "text/plain", 0)) {
|
||||
p_target == XInternAtom(x11_display, "COMPOUND_TEXT", 0) ||
|
||||
p_target == XInternAtom(x11_display, "TEXT", 0) ||
|
||||
p_target == XA_STRING ||
|
||||
p_target == XInternAtom(x11_display, "text/plain;charset=utf-8", 0) ||
|
||||
p_target == XInternAtom(x11_display, "text/plain", 0)) {
|
||||
// Directly using internal clipboard because we know our window
|
||||
// is the owner during a selection request.
|
||||
CharString clip = OS::get_clipboard().utf8();
|
||||
|
@ -2410,7 +2410,7 @@ void OS_X11::process_xevents() {
|
|||
if (pen_pressure_range != Vector2()) {
|
||||
xi.pressure_supported = true;
|
||||
xi.pressure = (*values - pen_pressure_range[0]) /
|
||||
(pen_pressure_range[1] - pen_pressure_range[0]);
|
||||
(pen_pressure_range[1] - pen_pressure_range[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3115,7 +3115,7 @@ String OS_X11::get_clipboard() const {
|
|||
Bool OS_X11::_predicate_clipboard_save_targets(Display *display, XEvent *event, XPointer arg) {
|
||||
if (event->xany.window == *(Window *)arg) {
|
||||
return (event->type == SelectionRequest) ||
|
||||
(event->type == SelectionNotify);
|
||||
(event->type == SelectionNotify);
|
||||
} else {
|
||||
return False;
|
||||
}
|
||||
|
|
|
@ -142,9 +142,9 @@ void LineBuilder::build() {
|
|||
_interpolate_color = gradient != nullptr;
|
||||
bool retrieve_curve = curve != nullptr;
|
||||
bool distance_required = _interpolate_color ||
|
||||
retrieve_curve ||
|
||||
texture_mode == Line2D::LINE_TEXTURE_TILE ||
|
||||
texture_mode == Line2D::LINE_TEXTURE_STRETCH;
|
||||
retrieve_curve ||
|
||||
texture_mode == Line2D::LINE_TEXTURE_TILE ||
|
||||
texture_mode == Line2D::LINE_TEXTURE_STRETCH;
|
||||
if (distance_required) {
|
||||
total_distance = calculate_total_distance(points);
|
||||
//Adjust totalDistance.
|
||||
|
|
|
@ -202,8 +202,7 @@ String CPUParticles::get_configuration_warning() const {
|
|||
warnings += "- " + TTR("Nothing is visible because no mesh has been assigned.");
|
||||
}
|
||||
|
||||
if (!anim_material_found && (get_param(PARAM_ANIM_SPEED) != 0.0 || get_param(PARAM_ANIM_OFFSET) != 0.0 ||
|
||||
get_param_curve(PARAM_ANIM_SPEED).is_valid() || get_param_curve(PARAM_ANIM_OFFSET).is_valid())) {
|
||||
if (!anim_material_found && (get_param(PARAM_ANIM_SPEED) != 0.0 || get_param(PARAM_ANIM_OFFSET) != 0.0 || get_param_curve(PARAM_ANIM_SPEED).is_valid() || get_param_curve(PARAM_ANIM_OFFSET).is_valid())) {
|
||||
if (warnings != String()) {
|
||||
warnings += "\n";
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ void VehicleWheel::_update(PhysicsDirectBodyState *s) {
|
|||
Vector3 relpos = m_raycastInfo.m_contactPointWS - s->get_transform().origin;
|
||||
|
||||
chassis_velocity_at_contactPoint = s->get_linear_velocity() +
|
||||
(s->get_angular_velocity()).cross(relpos); // * mPos);
|
||||
(s->get_angular_velocity()).cross(relpos); // * mPos);
|
||||
|
||||
real_t projVel = m_raycastInfo.m_contactNormalWS.dot(chassis_velocity_at_contactPoint);
|
||||
if (project >= real_t(-0.1)) {
|
||||
|
@ -460,7 +460,7 @@ real_t VehicleBody::_ray_cast(int p_idx, PhysicsDirectBodyState *s) {
|
|||
//chassis_velocity_at_contactPoint = getRigidBody()->getVelocityInLocalPoint(relpos);
|
||||
|
||||
chassis_velocity_at_contactPoint = s->get_linear_velocity() +
|
||||
(s->get_angular_velocity()).cross(wheel.m_raycastInfo.m_contactPointWS - s->get_transform().origin); // * mPos);
|
||||
(s->get_angular_velocity()).cross(wheel.m_raycastInfo.m_contactPointWS - s->get_transform().origin); // * mPos);
|
||||
|
||||
real_t projVel = wheel.m_raycastInfo.m_contactNormalWS.dot(chassis_velocity_at_contactPoint);
|
||||
|
||||
|
@ -788,7 +788,7 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) {
|
|||
VehicleWheel &wheelInfo = *wheels[wheel];
|
||||
|
||||
Vector3 rel_pos = wheelInfo.m_raycastInfo.m_contactPointWS -
|
||||
s->get_transform().origin;
|
||||
s->get_transform().origin;
|
||||
|
||||
if (m_forwardImpulse[wheel] != real_t(0.)) {
|
||||
s->apply_impulse(rel_pos, m_forwardWS[wheel] * (m_forwardImpulse[wheel]));
|
||||
|
|
|
@ -70,8 +70,8 @@ Dictionary Control::_edit_get_state() const {
|
|||
|
||||
void Control::_edit_set_state(const Dictionary &p_state) {
|
||||
ERR_FAIL_COND((p_state.size() <= 0) ||
|
||||
!p_state.has("rotation") || !p_state.has("scale") ||
|
||||
!p_state.has("pivot") || !p_state.has("anchors") || !p_state.has("margins"));
|
||||
!p_state.has("rotation") || !p_state.has("scale") ||
|
||||
!p_state.has("pivot") || !p_state.has("anchors") || !p_state.has("margins"));
|
||||
Dictionary state = p_state;
|
||||
|
||||
set_rotation(state["rotation"]);
|
||||
|
|
|
@ -306,7 +306,7 @@ bool FileDialog::_is_open_should_be_disabled() {
|
|||
|
||||
// Opening a file, but selected a folder? Forbidden.
|
||||
return ((mode == MODE_OPEN_FILE || mode == MODE_OPEN_FILES) && d["dir"]) || // Flipped case, also forbidden.
|
||||
(mode == MODE_OPEN_DIR && !d["dir"]);
|
||||
(mode == MODE_OPEN_DIR && !d["dir"]);
|
||||
}
|
||||
|
||||
void FileDialog::_go_up() {
|
||||
|
|
|
@ -401,13 +401,13 @@ void Label::regenerate_word_cache() {
|
|||
// if your language is not well supported, consider helping improve
|
||||
// the unicode support in Godot.
|
||||
bool separatable = (current >= 0x2E08 && current <= 0x9FFF) || // CJK scripts and symbols.
|
||||
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
|
||||
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
|
||||
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
|
||||
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
|
||||
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
|
||||
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
|
||||
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
|
||||
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
|
||||
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
|
||||
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
|
||||
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
|
||||
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
|
||||
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
|
||||
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
|
||||
bool insert_newline = false;
|
||||
real_t char_width = 0;
|
||||
|
||||
|
|
|
@ -420,13 +420,13 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
|||
// For info about the unicode range, see Label::regenerate_word_cache.
|
||||
const CharType current = c[end];
|
||||
const bool separatable = (current >= 0x2E08 && current <= 0x9FFF) || // CJK scripts and symbols.
|
||||
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
|
||||
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
|
||||
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
|
||||
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
|
||||
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
|
||||
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
|
||||
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
|
||||
(current >= 0xAC00 && current <= 0xD7FF) || // Hangul Syllables and Hangul Jamo Extended-B.
|
||||
(current >= 0xF900 && current <= 0xFAFF) || // CJK Compatibility Ideographs.
|
||||
(current >= 0xFE30 && current <= 0xFE4F) || // CJK Compatibility Forms.
|
||||
(current >= 0xFF65 && current <= 0xFF9F) || // Halfwidth forms of katakana
|
||||
(current >= 0xFFA0 && current <= 0xFFDC) || // Halfwidth forms of compatibility jamo characters for Hangul
|
||||
(current >= 0x20000 && current <= 0x2FA1F) || // CJK Unified Ideographs Extension B ~ F and CJK Compatibility Ideographs Supplement.
|
||||
(current >= 0x30000 && current <= 0x3134F); // CJK Unified Ideographs Extension G.
|
||||
const bool long_separatable = separatable && (wofs - backtrack + w + cw > p_width);
|
||||
const bool separation_changed = end > 0 && was_separatable != separatable;
|
||||
if (!just_breaked_in_middle && (long_separatable || separation_changed)) {
|
||||
|
@ -501,8 +501,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
|||
fx_color.a = faded_visibility;
|
||||
}
|
||||
|
||||
bool visible = visible_characters < 0 || ((p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - line_descent - line_ascent, line_ascent + line_descent)) &&
|
||||
faded_visibility > 0.0f);
|
||||
bool visible = visible_characters < 0 || ((p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - line_descent - line_ascent, line_ascent + line_descent)) && faded_visibility > 0.0f);
|
||||
|
||||
const bool previously_visible = visible;
|
||||
|
||||
|
@ -548,7 +547,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
|||
Math::lerp(Math::cos(previous_offset),
|
||||
Math::cos(current_offset),
|
||||
n_time)) *
|
||||
(float)item_shake->strength / 10.0f;
|
||||
(float)item_shake->strength / 10.0f;
|
||||
} else if (item_fx->type == ITEM_WAVE) {
|
||||
ItemWave *item_wave = static_cast<ItemWave *>(item_fx);
|
||||
|
||||
|
|
|
@ -241,12 +241,12 @@ private:
|
|||
|
||||
uint64_t offset_random(int index) {
|
||||
return (_current_rng >> (index % 64)) |
|
||||
(_current_rng << (64 - (index % 64)));
|
||||
(_current_rng << (64 - (index % 64)));
|
||||
}
|
||||
|
||||
uint64_t offset_previous_random(int index) {
|
||||
return (_previous_rng >> (index % 64)) |
|
||||
(_previous_rng << (64 - (index % 64)));
|
||||
(_previous_rng << (64 - (index % 64)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -70,18 +70,18 @@ static bool _is_hex_symbol(CharType c) {
|
|||
|
||||
static bool _is_pair_right_symbol(CharType c) {
|
||||
return c == '"' ||
|
||||
c == '\'' ||
|
||||
c == ')' ||
|
||||
c == ']' ||
|
||||
c == '}';
|
||||
c == '\'' ||
|
||||
c == ')' ||
|
||||
c == ']' ||
|
||||
c == '}';
|
||||
}
|
||||
|
||||
static bool _is_pair_left_symbol(CharType c) {
|
||||
return c == '"' ||
|
||||
c == '\'' ||
|
||||
c == '(' ||
|
||||
c == '[' ||
|
||||
c == '{';
|
||||
c == '\'' ||
|
||||
c == '(' ||
|
||||
c == '[' ||
|
||||
c == '{';
|
||||
}
|
||||
|
||||
static bool _is_pair_symbol(CharType c) {
|
||||
|
|
|
@ -1625,10 +1625,10 @@ void Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
|
|||
Ref<InputEventMouseButton> mb = p_input;
|
||||
|
||||
bool cant_stop_me_now = (mb.is_valid() &&
|
||||
(mb->get_button_index() == BUTTON_WHEEL_DOWN ||
|
||||
mb->get_button_index() == BUTTON_WHEEL_UP ||
|
||||
mb->get_button_index() == BUTTON_WHEEL_LEFT ||
|
||||
mb->get_button_index() == BUTTON_WHEEL_RIGHT));
|
||||
(mb->get_button_index() == BUTTON_WHEEL_DOWN ||
|
||||
mb->get_button_index() == BUTTON_WHEEL_UP ||
|
||||
mb->get_button_index() == BUTTON_WHEEL_LEFT ||
|
||||
mb->get_button_index() == BUTTON_WHEEL_RIGHT));
|
||||
Ref<InputEventPanGesture> pn = p_input;
|
||||
cant_stop_me_now = pn.is_valid() || cant_stop_me_now;
|
||||
|
||||
|
|
|
@ -1526,10 +1526,11 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a
|
|||
float t2 = t * t;
|
||||
float t3 = t2 * t;
|
||||
|
||||
return 0.5f * ((p1 * 2.0f) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3);
|
||||
return 0.5f *
|
||||
((p1 * 2.0f) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3);
|
||||
|
||||
} else if ((vformat & (vformat - 1))) {
|
||||
return p_a; //can't interpolate, mix of types
|
||||
|
|
|
@ -437,8 +437,7 @@ void BodyPairSW::solve(real_t p_step) {
|
|||
Vector3 temp1 = A->get_inv_inertia_tensor().xform(c.rA.cross(tv));
|
||||
Vector3 temp2 = B->get_inv_inertia_tensor().xform(c.rB.cross(tv));
|
||||
|
||||
real_t t = -tvl /
|
||||
(A->get_inv_mass() + B->get_inv_mass() + tv.dot(temp1.cross(c.rA) + temp2.cross(c.rB)));
|
||||
real_t t = -tvl / (A->get_inv_mass() + B->get_inv_mass() + tv.dot(temp1.cross(c.rA) + temp2.cross(c.rB)));
|
||||
|
||||
Vector3 jt = t * tv;
|
||||
|
||||
|
|
|
@ -138,16 +138,18 @@ bool ConeTwistJointSW::setup(real_t p_timestep) {
|
|||
plane_space(normal[0], normal[1], normal[2]);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
memnew_placement(&m_jac[i], JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
|
||||
pivotBInW - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normal[i],
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
memnew_placement(
|
||||
&m_jac[i],
|
||||
JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
|
||||
pivotBInW - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normal[i],
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,8 +203,7 @@ bool ConeTwistJointSW::setup(real_t p_timestep) {
|
|||
real_t swingAxisSign = (b2Axis1.dot(b1Axis1) >= 0.0f) ? 1.0f : -1.0f;
|
||||
m_swingAxis *= swingAxisSign;
|
||||
|
||||
m_kSwing = real_t(1.) / (A->compute_angular_impulse_denominator(m_swingAxis) +
|
||||
B->compute_angular_impulse_denominator(m_swingAxis));
|
||||
m_kSwing = real_t(1.) / (A->compute_angular_impulse_denominator(m_swingAxis) + B->compute_angular_impulse_denominator(m_swingAxis));
|
||||
}
|
||||
|
||||
// Twist limits
|
||||
|
@ -221,8 +222,7 @@ bool ConeTwistJointSW::setup(real_t p_timestep) {
|
|||
m_twistAxis.normalize();
|
||||
m_twistAxis *= -1.0f;
|
||||
|
||||
m_kTwist = real_t(1.) / (A->compute_angular_impulse_denominator(m_twistAxis) +
|
||||
B->compute_angular_impulse_denominator(m_twistAxis));
|
||||
m_kTwist = real_t(1.) / (A->compute_angular_impulse_denominator(m_twistAxis) + B->compute_angular_impulse_denominator(m_twistAxis));
|
||||
|
||||
} else if (twist > m_twistSpan * lockedFreeFactor) {
|
||||
m_twistCorrection = (twist - m_twistSpan);
|
||||
|
@ -231,8 +231,7 @@ bool ConeTwistJointSW::setup(real_t p_timestep) {
|
|||
m_twistAxis = (b2Axis1 + b1Axis1) * 0.5f;
|
||||
m_twistAxis.normalize();
|
||||
|
||||
m_kTwist = real_t(1.) / (A->compute_angular_impulse_denominator(m_twistAxis) +
|
||||
B->compute_angular_impulse_denominator(m_twistAxis));
|
||||
m_kTwist = real_t(1.) / (A->compute_angular_impulse_denominator(m_twistAxis) + B->compute_angular_impulse_denominator(m_twistAxis));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -272,25 +272,30 @@ void Generic6DOFJointSW::calculateTransforms() {
|
|||
void Generic6DOFJointSW::buildLinearJacobian(
|
||||
JacobianEntrySW &jacLinear, const Vector3 &normalWorld,
|
||||
const Vector3 &pivotAInW, const Vector3 &pivotBInW) {
|
||||
memnew_placement(&jacLinear, JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
|
||||
pivotBInW - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normalWorld,
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
memnew_placement(
|
||||
&jacLinear,
|
||||
JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
|
||||
pivotBInW - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normalWorld,
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
}
|
||||
|
||||
void Generic6DOFJointSW::buildAngularJacobian(
|
||||
JacobianEntrySW &jacAngular, const Vector3 &jointAxisW) {
|
||||
memnew_placement(&jacAngular, JacobianEntrySW(jointAxisW,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
memnew_placement(
|
||||
&jacAngular,
|
||||
JacobianEntrySW(
|
||||
jointAxisW,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
}
|
||||
|
||||
bool Generic6DOFJointSW::testAngularLimitMotor(int axis_index) {
|
||||
|
|
|
@ -176,16 +176,18 @@ bool HingeJointSW::setup(real_t p_step) {
|
|||
plane_space(normal[0], normal[1], normal[2]);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
memnew_placement(&m_jac[i], JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
|
||||
pivotBInW - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normal[i],
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
memnew_placement(
|
||||
&m_jac[i],
|
||||
JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
pivotAInW - A->get_transform().origin - A->get_center_of_mass(),
|
||||
pivotBInW - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normal[i],
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,23 +204,32 @@ bool HingeJointSW::setup(real_t p_step) {
|
|||
Vector3 jointAxis1 = A->get_transform().basis.xform(jointAxis1local);
|
||||
Vector3 hingeAxisWorld = A->get_transform().basis.xform(m_rbAFrame.basis.get_axis(2));
|
||||
|
||||
memnew_placement(&m_jacAng[0], JacobianEntrySW(jointAxis0,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
memnew_placement(
|
||||
&m_jacAng[0],
|
||||
JacobianEntrySW(
|
||||
jointAxis0,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
|
||||
memnew_placement(&m_jacAng[1], JacobianEntrySW(jointAxis1,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
memnew_placement(
|
||||
&m_jacAng[1],
|
||||
JacobianEntrySW(
|
||||
jointAxis1,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
|
||||
memnew_placement(&m_jacAng[2], JacobianEntrySW(hingeAxisWorld,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
memnew_placement(
|
||||
&m_jacAng[2],
|
||||
JacobianEntrySW(
|
||||
hingeAxisWorld,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
|
||||
// Compute limit information
|
||||
real_t hingeAngle = get_hinge_angle();
|
||||
|
@ -247,8 +258,7 @@ bool HingeJointSW::setup(real_t p_step) {
|
|||
|
||||
//Compute K = J*W*J' for hinge axis
|
||||
Vector3 axisA = A->get_transform().basis.xform(m_rbAFrame.basis.get_axis(2));
|
||||
m_kHinge = 1.0f / (A->compute_angular_impulse_denominator(axisA) +
|
||||
B->compute_angular_impulse_denominator(axisA));
|
||||
m_kHinge = 1.0f / (A->compute_angular_impulse_denominator(axisA) + B->compute_angular_impulse_denominator(axisA));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -307,7 +317,7 @@ void HingeJointSW::solve(real_t p_step) {
|
|||
if (len > real_t(0.00001)) {
|
||||
Vector3 normal = velrelOrthog.normalized();
|
||||
real_t denom = A->compute_angular_impulse_denominator(normal) +
|
||||
B->compute_angular_impulse_denominator(normal);
|
||||
B->compute_angular_impulse_denominator(normal);
|
||||
// scale for mass and relaxation
|
||||
velrelOrthog *= (real_t(1.) / denom) * m_relaxationFactor;
|
||||
}
|
||||
|
@ -318,7 +328,7 @@ void HingeJointSW::solve(real_t p_step) {
|
|||
if (len2 > real_t(0.00001)) {
|
||||
Vector3 normal2 = angularError.normalized();
|
||||
real_t denom2 = A->compute_angular_impulse_denominator(normal2) +
|
||||
B->compute_angular_impulse_denominator(normal2);
|
||||
B->compute_angular_impulse_denominator(normal2);
|
||||
angularError *= (real_t(1.) / denom2) * relaxation;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,16 +60,18 @@ bool PinJointSW::setup(real_t p_step) {
|
|||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
normal[i] = 1;
|
||||
memnew_placement(&m_jac[i], JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_transform().xform(m_pivotInA) - A->get_transform().origin - A->get_center_of_mass(),
|
||||
B->get_transform().xform(m_pivotInB) - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normal,
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
memnew_placement(
|
||||
&m_jac[i],
|
||||
JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_transform().xform(m_pivotInA) - A->get_transform().origin - A->get_center_of_mass(),
|
||||
B->get_transform().xform(m_pivotInB) - B->get_transform().origin - B->get_center_of_mass(),
|
||||
normal,
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
normal[i] = 0;
|
||||
}
|
||||
|
||||
|
@ -82,9 +84,6 @@ void PinJointSW::solve(real_t p_step) {
|
|||
|
||||
Vector3 normal(0, 0, 0);
|
||||
|
||||
//Vector3 angvelA = A->get_transform().origin.getBasis().transpose() * A->getAngularVelocity();
|
||||
//Vector3 angvelB = B->get_transform().origin.getBasis().transpose() * B->getAngularVelocity();
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
normal[i] = 1;
|
||||
real_t jacDiagABInv = real_t(1.) / m_jac[i].getDiagonal();
|
||||
|
@ -100,12 +99,6 @@ void PinJointSW::solve(real_t p_step) {
|
|||
real_t rel_vel;
|
||||
rel_vel = normal.dot(vel);
|
||||
|
||||
/*
|
||||
//velocity error (first order error)
|
||||
real_t rel_vel = m_jac[i].getRelativeVelocity(A->getLinearVelocity(),angvelA,
|
||||
B->getLinearVelocity(),angvelB);
|
||||
*/
|
||||
|
||||
//positional error (zeroth order error)
|
||||
real_t depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal
|
||||
|
||||
|
|
|
@ -147,16 +147,17 @@ bool SliderJointSW::setup(real_t p_step) {
|
|||
//linear part
|
||||
for (i = 0; i < 3; i++) {
|
||||
normalWorld = m_calculatedTransformA.basis.get_axis(i);
|
||||
memnew_placement(&m_jacLin[i], JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
m_relPosA - A->get_center_of_mass(),
|
||||
m_relPosB - B->get_center_of_mass(),
|
||||
normalWorld,
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
memnew_placement(
|
||||
&m_jacLin[i],
|
||||
JacobianEntrySW(
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
m_relPosA - A->get_center_of_mass(), m_relPosB - B->get_center_of_mass(),
|
||||
normalWorld,
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
B->get_inv_inertia(),
|
||||
B->get_inv_mass()));
|
||||
m_jacLinDiagABInv[i] = real_t(1.) / m_jacLin[i].getDiagonal();
|
||||
m_depth[i] = m_delta.dot(normalWorld);
|
||||
}
|
||||
|
@ -164,12 +165,14 @@ bool SliderJointSW::setup(real_t p_step) {
|
|||
// angular part
|
||||
for (i = 0; i < 3; i++) {
|
||||
normalWorld = m_calculatedTransformA.basis.get_axis(i);
|
||||
memnew_placement(&m_jacAng[i], JacobianEntrySW(
|
||||
normalWorld,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
memnew_placement(
|
||||
&m_jacAng[i],
|
||||
JacobianEntrySW(
|
||||
normalWorld,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
B->get_inv_inertia()));
|
||||
}
|
||||
testAngLimits();
|
||||
Vector3 axisA = m_calculatedTransformA.basis.get_axis(0);
|
||||
|
|
|
@ -2511,16 +2511,16 @@ bool ShaderLanguage::is_scalar_type(DataType p_type) {
|
|||
|
||||
bool ShaderLanguage::is_sampler_type(DataType p_type) {
|
||||
return p_type == TYPE_SAMPLER2D ||
|
||||
p_type == TYPE_ISAMPLER2D ||
|
||||
p_type == TYPE_USAMPLER2D ||
|
||||
p_type == TYPE_SAMPLER2DARRAY ||
|
||||
p_type == TYPE_ISAMPLER2DARRAY ||
|
||||
p_type == TYPE_USAMPLER2DARRAY ||
|
||||
p_type == TYPE_SAMPLER3D ||
|
||||
p_type == TYPE_ISAMPLER3D ||
|
||||
p_type == TYPE_USAMPLER3D ||
|
||||
p_type == TYPE_SAMPLERCUBE ||
|
||||
p_type == TYPE_SAMPLEREXT;
|
||||
p_type == TYPE_ISAMPLER2D ||
|
||||
p_type == TYPE_USAMPLER2D ||
|
||||
p_type == TYPE_SAMPLER2DARRAY ||
|
||||
p_type == TYPE_ISAMPLER2DARRAY ||
|
||||
p_type == TYPE_USAMPLER2DARRAY ||
|
||||
p_type == TYPE_SAMPLER3D ||
|
||||
p_type == TYPE_ISAMPLER3D ||
|
||||
p_type == TYPE_USAMPLER3D ||
|
||||
p_type == TYPE_SAMPLERCUBE ||
|
||||
p_type == TYPE_SAMPLEREXT;
|
||||
}
|
||||
|
||||
Variant ShaderLanguage::constant_value_to_variant(const Vector<ShaderLanguage::ConstantNode::Value> &p_value, DataType p_type, ShaderLanguage::ShaderNode::Uniform::Hint p_hint) {
|
||||
|
@ -2654,16 +2654,16 @@ void ShaderLanguage::get_keyword_list(List<String> *r_keywords) {
|
|||
|
||||
bool ShaderLanguage::is_control_flow_keyword(String p_keyword) {
|
||||
return p_keyword == "break" ||
|
||||
p_keyword == "case" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "default" ||
|
||||
p_keyword == "do" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "switch" ||
|
||||
p_keyword == "while";
|
||||
p_keyword == "case" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "default" ||
|
||||
p_keyword == "do" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "switch" ||
|
||||
p_keyword == "while";
|
||||
}
|
||||
|
||||
void ShaderLanguage::get_builtin_funcs(List<String> *r_keywords) {
|
||||
|
|
Loading…
Reference in a new issue