Merge pull request #54348 from akien-mga/3.x-clang-format-dont-align-operands
This commit is contained in:
commit
14ef65e49b
137 changed files with 960 additions and 1240 deletions
|
@ -12,7 +12,7 @@ AlignAfterOpenBracket: DontAlign
|
|||
# AlignConsecutiveBitFields: None
|
||||
# AlignConsecutiveDeclarations: None
|
||||
# AlignEscapedNewlines: Right
|
||||
# AlignOperands: Align
|
||||
AlignOperands: DontAlign
|
||||
AlignTrailingComments: false
|
||||
# AllowAllArgumentsOnNextLine: true
|
||||
# AllowAllConstructorInitializersOnNextLine: true
|
||||
|
@ -56,7 +56,7 @@ AllowShortFunctionsOnASingleLine: Inline
|
|||
# BreakBeforeBraces: Attach
|
||||
# BreakBeforeInheritanceComma: false
|
||||
# BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: false
|
||||
# BreakBeforeTernaryOperators: true
|
||||
# BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: AfterColon
|
||||
# BreakStringLiterals: true
|
||||
|
|
|
@ -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.
|
||||
|
@ -784,9 +781,9 @@ Quat Basis::get_quat() const {
|
|||
temp[1] = ((m.elements[0][2] - m.elements[2][0]) * s);
|
||||
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);
|
||||
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);
|
||||
int j = (i + 1) % 3;
|
||||
int k = (i + 2) % 3;
|
||||
|
||||
|
|
|
@ -42,23 +42,23 @@ BVHABB_CLASS _logic_abb_merge(const BVHABB_CLASS &a, const BVHABB_CLASS &b) {
|
|||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
@file q3DynamicAABBTree.h
|
||||
@author Randy Gaul
|
||||
@date 10/10/2014
|
||||
Copyright (c) 2014 Randy Gaul http://www.randygaul.net
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
* @file q3DynamicAABBTree.h
|
||||
* @author Randy Gaul
|
||||
* @date 10/10/2014
|
||||
* Copyright (c) 2014 Randy Gaul http://www.randygaul.net
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not
|
||||
* be misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -76,10 +76,10 @@ int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) {
|
|||
}
|
||||
|
||||
/* A
|
||||
/ \
|
||||
B C
|
||||
/ \ / \
|
||||
D E F G
|
||||
* / \
|
||||
* B C
|
||||
* / \ / \
|
||||
* D E F G
|
||||
*/
|
||||
|
||||
CRASH_COND(A->num_children != 2);
|
||||
|
|
|
@ -264,8 +264,7 @@ public:
|
|||
}
|
||||
|
||||
int32_t get_sign() const {
|
||||
return ((int64_t)high < 0) ? -1 : (high || low) ? 1 :
|
||||
0;
|
||||
return ((int64_t)high < 0) ? -1 : ((high || low) ? 1 : 0);
|
||||
}
|
||||
|
||||
bool operator<(const Int128 &b) const {
|
||||
|
@ -736,8 +735,6 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// return (numerator * b.denominator > b.numerator * denominator) ? sign : (numerator * b.denominator < b.numerator * denominator) ? -sign : 0;
|
||||
|
||||
#ifdef USE_X86_64_ASM
|
||||
|
||||
int32_t result;
|
||||
|
@ -758,10 +755,9 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const {
|
|||
: "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy)
|
||||
: "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator)
|
||||
: "%rdx", "cc");
|
||||
return result ? result ^ sign // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
|
||||
// if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
|
||||
// if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero)
|
||||
:
|
||||
0;
|
||||
return result ? result ^ sign : 0;
|
||||
|
||||
#else
|
||||
|
||||
|
@ -794,8 +790,7 @@ int32_t ConvexHullInternal::Rational128::compare(const Rational128 &b) const {
|
|||
int32_t ConvexHullInternal::Rational128::compare(int64_t b) const {
|
||||
if (is_int_64) {
|
||||
int64_t a = sign * (int64_t)numerator.low;
|
||||
return (a > b) ? 1 : (a < b) ? -1 :
|
||||
0;
|
||||
return (a > b) ? 1 : ((a < b) ? -1 : 0);
|
||||
}
|
||||
if (b > 0) {
|
||||
if (sign <= 0) {
|
||||
|
@ -1447,8 +1442,7 @@ void ConvexHullInternal::merge(IntermediateHull &p_h0, IntermediateHull &p_h1) {
|
|||
c1->edges = e;
|
||||
return;
|
||||
} else {
|
||||
int32_t cmp = !min0 ? 1 : !min1 ? -1 :
|
||||
min_cot0.compare(min_cot1);
|
||||
int32_t cmp = !min0 ? 1 : (!min1 ? -1 : min_cot0.compare(min_cot1));
|
||||
#ifdef DEBUG_CONVEX_HULL
|
||||
printf(" -> Result %d\n", cmp);
|
||||
#endif
|
||||
|
|
|
@ -43,17 +43,14 @@ real_t Triangulate::get_area(const Vector<Vector2> &contour) {
|
|||
}
|
||||
|
||||
/*
|
||||
is_inside_triangle decides if a point P is Inside of the triangle
|
||||
defined by A, B, C.
|
||||
* `is_inside_triangle` decides if a point P is inside the triangle
|
||||
* defined by A, B, C.
|
||||
*/
|
||||
|
||||
bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay,
|
||||
real_t Bx, real_t By,
|
||||
real_t Cx, real_t Cy,
|
||||
real_t Px, real_t Py,
|
||||
bool include_edges)
|
||||
|
||||
{
|
||||
bool include_edges) {
|
||||
real_t ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
|
||||
real_t cCROSSap, bCROSScp, aCROSSbp;
|
||||
|
||||
|
@ -79,7 +76,7 @@ bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay,
|
|||
} else {
|
||||
return ((aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
bool Triangulate::snip(const Vector<Vector2> &p_contour, int u, int v, int w, int n, const Vector<int> &V, bool relaxed) {
|
||||
int p;
|
||||
|
|
|
@ -149,7 +149,8 @@ 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) +
|
||||
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);
|
||||
|
|
|
@ -88,7 +88,8 @@ 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) +
|
||||
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);
|
||||
|
@ -106,7 +107,8 @@ 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) +
|
||||
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);
|
||||
|
|
|
@ -1527,7 +1527,8 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const
|
|||
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.",
|
||||
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,7 +136,8 @@ 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" ||
|
||||
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")) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -310,14 +310,6 @@ String String::operator+(const String &p_str) const {
|
|||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
String String::operator+(CharType p_chr) const {
|
||||
|
||||
String res=*this;
|
||||
res+=p_chr;
|
||||
return res;
|
||||
}
|
||||
*/
|
||||
String &String::operator+=(const String &p_str) {
|
||||
if (empty()) {
|
||||
*this = p_str;
|
||||
|
@ -1675,14 +1667,6 @@ CharString String::utf8() const {
|
|||
return utf8s;
|
||||
}
|
||||
|
||||
/*
|
||||
String::String(CharType p_char) {
|
||||
|
||||
shared=NULL;
|
||||
copy_from(p_char);
|
||||
}
|
||||
*/
|
||||
|
||||
String::String(const char *p_str) {
|
||||
copy_from(p_str);
|
||||
}
|
||||
|
@ -1937,7 +1921,8 @@ bool String::is_numeric() const {
|
|||
};
|
||||
|
||||
template <class C>
|
||||
static double built_in_strtod(const C *string, /* A decimal ASCII floating-point number,
|
||||
static double built_in_strtod(
|
||||
/* A decimal ASCII floating-point number,
|
||||
* optionally preceded by white space. Must
|
||||
* have form "-I.FE-X", where I is the integer
|
||||
* part of the mantissa, F is the fractional
|
||||
|
@ -1948,17 +1933,21 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
|||
* necessary unless F is present. The "E" may
|
||||
* actually be an "e". E and X may both be
|
||||
* omitted (but not just one). */
|
||||
C **endPtr = nullptr) /* If non-NULL, store terminating Cacter's
|
||||
const C *string,
|
||||
/* If non-nullptr, store terminating Cacter's
|
||||
* address here. */
|
||||
{
|
||||
static const int maxExponent = 511; /* Largest possible base 10 exponent. Any
|
||||
C **endPtr = nullptr) {
|
||||
/* Largest possible base 10 exponent. Any
|
||||
* exponent larger than this will already
|
||||
* produce underflow or overflow, so there's
|
||||
* no need to worry about additional digits.
|
||||
*/
|
||||
static const double powersOf10[] = { /* Table giving binary powers of 10. Entry */
|
||||
10., /* is 10^2^i. Used to convert decimal */
|
||||
100., /* exponents into floating-point numbers. */
|
||||
* no need to worry about additional digits. */
|
||||
static const int maxExponent = 511;
|
||||
/* Table giving binary powers of 10. Entry
|
||||
* is 10^2^i. Used to convert decimal
|
||||
* exponents into floating-point numbers. */
|
||||
static const double powersOf10[] = {
|
||||
10.,
|
||||
100.,
|
||||
1.0e4,
|
||||
1.0e8,
|
||||
1.0e16,
|
||||
|
@ -1973,8 +1962,9 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
|||
const double *d;
|
||||
const C *p;
|
||||
int c;
|
||||
int exp = 0; /* Exponent read from "EX" field. */
|
||||
int fracExp = 0; /* Exponent that derives from the fractional
|
||||
/* Exponent read from "EX" field. */
|
||||
int exp = 0;
|
||||
/* Exponent that derives from the fractional
|
||||
* part. Under normal circumstances, it is
|
||||
* the negative of the number of digits in F.
|
||||
* However, if I is very long, the last digits
|
||||
|
@ -1983,11 +1973,13 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
|||
* unnecessary overflow on I alone). In this
|
||||
* case, fracExp is incremented one for each
|
||||
* dropped digit. */
|
||||
int mantSize; /* Number of digits in mantissa. */
|
||||
int decPt; /* Number of mantissa digits BEFORE decimal
|
||||
* point. */
|
||||
const C *pExp; /* Temporarily holds location of exponent in
|
||||
* string. */
|
||||
int fracExp = 0;
|
||||
/* Number of digits in mantissa. */
|
||||
int mantSize;
|
||||
/* Number of mantissa digits BEFORE decimal point. */
|
||||
int decPt;
|
||||
/* Temporarily holds location of exponent in string. */
|
||||
const C *pExp;
|
||||
|
||||
/*
|
||||
* Strip off leading blanks and check for a sign.
|
||||
|
@ -2154,7 +2146,6 @@ done:
|
|||
double String::to_double(const char *p_str) {
|
||||
#ifndef NO_USE_STDLIB
|
||||
return built_in_strtod<char>(p_str);
|
||||
//return atof(p_str); DOES NOT WORK ON ANDROID(??)
|
||||
#else
|
||||
return built_in_strtod<char>(p_str);
|
||||
#endif
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -254,8 +254,7 @@ vec3 apply_fxaa(vec3 color, vec2 uv_interp, vec2 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) {
|
||||
|
|
|
@ -628,7 +628,8 @@ 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" ||
|
||||
} 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")) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -4817,9 +4817,9 @@ void EditorNode::_scene_tab_closed(int p_tab, int option) {
|
|||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
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;
|
||||
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"));
|
||||
|
|
|
@ -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);
|
||||
|
@ -5198,10 +5196,6 @@ void CanvasItemEditor::_popup_callback(int p_op) {
|
|||
if (key_pos) {
|
||||
ctrl->set_position(Point2());
|
||||
}
|
||||
/*
|
||||
if (key_scale)
|
||||
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size());
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -352,9 +352,9 @@ 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;
|
||||
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;
|
||||
|
||||
_context_menu->set_item_checked(_context_menu->get_item_index(CONTEXT_LINEAR), is_linear);
|
||||
|
||||
|
|
|
@ -606,15 +606,6 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
|
|||
menu->connect("id_pressed", this, "_handle_option_pressed");
|
||||
|
||||
curve_edit->set_pressed(true);
|
||||
/*
|
||||
collision_polygon_editor = memnew( PathEditor(p_node) );
|
||||
editor->get_viewport()->add_child(collision_polygon_editor);
|
||||
collision_polygon_editor->set_margin(MARGIN_LEFT,200);
|
||||
collision_polygon_editor->set_margin(MARGIN_RIGHT,230);
|
||||
collision_polygon_editor->set_margin(MARGIN_TOP,0);
|
||||
collision_polygon_editor->set_margin(MARGIN_BOTTOM,10);
|
||||
collision_polygon_editor->hide();
|
||||
*/
|
||||
}
|
||||
|
||||
PathEditorPlugin::~PathEditorPlugin() {
|
||||
|
|
|
@ -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,7 +1452,8 @@ 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" ||
|
||||
if (d.has("type") &&
|
||||
(String(d["type"]) == "resource" ||
|
||||
String(d["type"]) == "files" ||
|
||||
String(d["type"]) == "nodes" ||
|
||||
String(d["type"]) == "obj_property" ||
|
||||
|
|
|
@ -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) +
|
||||
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)) /
|
||||
4;
|
||||
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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -82,46 +82,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <stdint.h>
|
||||
|
||||
namespace FBXDocParser {
|
||||
//enum Flag
|
||||
//{
|
||||
// e_unknown_0 = 1 << 0,
|
||||
// e_unknown_1 = 1 << 1,
|
||||
// e_unknown_2 = 1 << 2,
|
||||
// e_unknown_3 = 1 << 3,
|
||||
// e_unknown_4 = 1 << 4,
|
||||
// e_unknown_5 = 1 << 5,
|
||||
// e_unknown_6 = 1 << 6,
|
||||
// e_unknown_7 = 1 << 7,
|
||||
// e_unknown_8 = 1 << 8,
|
||||
// e_unknown_9 = 1 << 9,
|
||||
// e_unknown_10 = 1 << 10,
|
||||
// e_unknown_11 = 1 << 11,
|
||||
// e_unknown_12 = 1 << 12,
|
||||
// e_unknown_13 = 1 << 13,
|
||||
// e_unknown_14 = 1 << 14,
|
||||
// e_unknown_15 = 1 << 15,
|
||||
// e_unknown_16 = 1 << 16,
|
||||
// e_unknown_17 = 1 << 17,
|
||||
// e_unknown_18 = 1 << 18,
|
||||
// e_unknown_19 = 1 << 19,
|
||||
// e_unknown_20 = 1 << 20,
|
||||
// e_unknown_21 = 1 << 21,
|
||||
// e_unknown_22 = 1 << 22,
|
||||
// e_unknown_23 = 1 << 23,
|
||||
// e_flag_field_size_64_bit = 1 << 24, // Not sure what is
|
||||
// e_unknown_25 = 1 << 25,
|
||||
// e_unknown_26 = 1 << 26,
|
||||
// e_unknown_27 = 1 << 27,
|
||||
// e_unknown_28 = 1 << 28,
|
||||
// e_unknown_29 = 1 << 29,
|
||||
// e_unknown_30 = 1 << 30,
|
||||
// e_unknown_31 = 1 << 31
|
||||
//};
|
||||
//
|
||||
//bool check_flag(uint32_t flags, Flag to_check)
|
||||
//{
|
||||
// return (flags & to_check) != 0;
|
||||
//}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Token::Token(const char *sbegin, const char *send, TokenType type, size_t offset) :
|
||||
sbegin(sbegin),
|
||||
|
@ -438,12 +398,6 @@ void TokenizeBinary(TokenList &output_tokens, const char *input, size_t length)
|
|||
//TokenizeError("file is too short",0);
|
||||
}
|
||||
|
||||
//uint32_t offset = 0x15;
|
||||
/* const char* cursor = input + 0x15;
|
||||
const uint32_t flags = ReadWord(input, cursor, input + length);
|
||||
const uint8_t padding_0 = ReadByte(input, cursor, input + length); // unused
|
||||
const uint8_t padding_1 = ReadByte(input, cursor, input + length); // unused*/
|
||||
|
||||
if (strncmp(input, "Kaydara FBX Binary", 18)) {
|
||||
TokenizeError("magic bytes not found", 0);
|
||||
}
|
||||
|
|
|
@ -642,13 +642,6 @@ void ParseVectorDataArray(std::vector<Vector3> &out, const ElementPtr el) {
|
|||
static_cast<real_t>(d[1]),
|
||||
static_cast<real_t>(d[2])));
|
||||
}
|
||||
// for debugging
|
||||
/*for ( size_t i = 0; i < out.size(); i++ ) {
|
||||
aiVector3D vec3( out[ i ] );
|
||||
std::stringstream stream;
|
||||
stream << " vec3.x = " << vec3.x << " vec3.y = " << vec3.y << " vec3.z = " << vec3.z << std::endl;
|
||||
DefaultLogger::get()->info( stream.str() );
|
||||
}*/
|
||||
} else if (type == 'f') {
|
||||
const float *f = reinterpret_cast<const float *>(&buff[0]);
|
||||
for (unsigned int i = 0; i < count3; ++i, f += 3) {
|
||||
|
|
|
@ -352,13 +352,6 @@ Error PluginScript::reload(bool p_keep_state) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
/*for (Set<PlaceHolderScriptInstance*>::Element *E=placeholders.front();E;E=E->next()) {
|
||||
|
||||
_update_placeholder(E->get());
|
||||
}*/
|
||||
#endif
|
||||
|
||||
FREE_SCRIPT_MANIFEST(manifest);
|
||||
return OK;
|
||||
#undef FREE_SCRIPT_MANIFEST
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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() + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3295,10 +3294,10 @@ Error CSharpScript::load_source_code(const String &p_path) {
|
|||
Error ferr = read_all_file_utf8(p_path, source);
|
||||
|
||||
ERR_FAIL_COND_V_MSG(ferr != OK, ferr,
|
||||
ferr == ERR_INVALID_DATA ?
|
||||
"Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode." :
|
||||
"Failed to read file: '" + p_path + "'.");
|
||||
ferr == ERR_INVALID_DATA
|
||||
? "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode."
|
||||
: "Failed to read file: '" + p_path + "'.");
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
source_changed_cache = true;
|
||||
|
|
|
@ -354,8 +354,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
|
|||
xml_output.append(link_target);
|
||||
xml_output.append("</c>");
|
||||
} else if (link_tag == "enum") {
|
||||
StringName search_cname = !target_itype ? target_cname :
|
||||
StringName(target_itype->name + "." + (String)target_cname);
|
||||
StringName search_cname = !target_itype ? target_cname : StringName(target_itype->name + "." + (String)target_cname);
|
||||
|
||||
const Map<StringName, TypeInterface>::Element *enum_match = enum_types.find(search_cname);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
@ -717,10 +716,10 @@ Error ScriptClassParser::parse_file(const String &p_filepath) {
|
|||
Error ferr = read_all_file_utf8(p_filepath, source);
|
||||
|
||||
ERR_FAIL_COND_V_MSG(ferr != OK, ferr,
|
||||
ferr == ERR_INVALID_DATA ?
|
||||
"File '" + p_filepath + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode." :
|
||||
"Failed to read file: '" + p_filepath + "'.");
|
||||
ferr == ERR_INVALID_DATA
|
||||
? "File '" + p_filepath + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode."
|
||||
: "Failed to read file: '" + p_filepath + "'.");
|
||||
|
||||
run_dummy_preprocessor(source, p_filepath);
|
||||
|
||||
|
|
|
@ -584,9 +584,9 @@ bool GDMono::load_assembly_from(const String &p_name, const String &p_path, GDMo
|
|||
ApiAssemblyInfo::Version ApiAssemblyInfo::Version::get_from_loaded_assembly(GDMonoAssembly *p_api_assembly, ApiAssemblyInfo::Type p_api_type) {
|
||||
ApiAssemblyInfo::Version api_assembly_version;
|
||||
|
||||
const char *nativecalls_name = p_api_type == ApiAssemblyInfo::API_CORE ?
|
||||
BINDINGS_CLASS_NATIVECALLS :
|
||||
BINDINGS_CLASS_NATIVECALLS_EDITOR;
|
||||
const char *nativecalls_name = p_api_type == ApiAssemblyInfo::API_CORE
|
||||
? BINDINGS_CLASS_NATIVECALLS
|
||||
: BINDINGS_CLASS_NATIVECALLS_EDITOR;
|
||||
|
||||
GDMonoClass *nativecalls_klass = p_api_assembly->get_class(BINDINGS_NAMESPACE, nativecalls_name);
|
||||
|
||||
|
@ -628,7 +628,9 @@ bool GDMono::copy_prebuilt_api_assembly(ApiAssemblyInfo::Type p_api_type, const
|
|||
String src_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config);
|
||||
String dst_dir = GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config);
|
||||
|
||||
String assembly_name = p_api_type == ApiAssemblyInfo::API_CORE ? CORE_API_ASSEMBLY_NAME : EDITOR_API_ASSEMBLY_NAME;
|
||||
String assembly_name = p_api_type == ApiAssemblyInfo::API_CORE
|
||||
? CORE_API_ASSEMBLY_NAME
|
||||
: EDITOR_API_ASSEMBLY_NAME;
|
||||
|
||||
// Create destination directory if needed
|
||||
if (!DirAccess::exists(dst_dir)) {
|
||||
|
@ -739,12 +741,8 @@ bool GDMono::_temp_domain_load_are_assemblies_out_of_sync(const String &p_config
|
|||
String GDMono::update_api_assemblies_from_prebuilt(const String &p_config, const bool *p_core_api_out_of_sync, const bool *p_editor_api_out_of_sync) {
|
||||
#define FAIL_REASON(m_out_of_sync, m_prebuilt_exists) \
|
||||
( \
|
||||
(m_out_of_sync ? \
|
||||
String("The assembly is invalidated ") : \
|
||||
String("The assembly was not found ")) + \
|
||||
(m_prebuilt_exists ? \
|
||||
String("and the prebuilt assemblies are missing.") : \
|
||||
String("and we failed to copy the prebuilt assemblies.")))
|
||||
(m_out_of_sync ? String("The assembly is invalidated ") : String("The assembly was not found ")) + \
|
||||
(m_prebuilt_exists ? String("and the prebuilt assemblies are missing.") : String("and we failed to copy the prebuilt assemblies.")))
|
||||
|
||||
String dst_assemblies_dir = GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config);
|
||||
|
||||
|
@ -800,9 +798,7 @@ bool GDMono::_load_core_api_assembly(LoadedApiAssembly &r_loaded_api_assembly, c
|
|||
// For the editor and the editor player we want to load it from a specific path to make sure we can keep it up to date
|
||||
|
||||
// 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);
|
||||
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);
|
||||
|
||||
String assembly_path = assembly_dir.plus_file(CORE_API_ASSEMBLY_NAME ".dll");
|
||||
|
||||
|
@ -832,9 +828,7 @@ bool GDMono::_load_editor_api_assembly(LoadedApiAssembly &r_loaded_api_assembly,
|
|||
// For the editor and the editor player we want to load it from a specific path to make sure we can keep it up to date
|
||||
|
||||
// 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);
|
||||
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);
|
||||
|
||||
String assembly_path = assembly_dir.plus_file(EDITOR_API_ASSEMBLY_NAME ".dll");
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -2435,7 +2435,6 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
|
|||
const StringName *f = _call_stack[l].function;
|
||||
|
||||
ERR_FAIL_COND(!_call_stack[l].instance->functions.has(*f));
|
||||
//VisualScriptInstance::Function *func = &_call_stack[l].instance->functions[*f];
|
||||
|
||||
VisualScriptNodeInstance *node = _call_stack[l].instance->instances[*_call_stack[l].current_id];
|
||||
ERR_FAIL_COND(!node);
|
||||
|
@ -2481,23 +2480,8 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
|
|||
p_locals->push_back("working_mem/mem_" + itos(i));
|
||||
p_values->push_back((*_call_stack[l].work_mem)[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
ERR_FAIL_INDEX(p_level,_debug_call_stack_pos);
|
||||
|
||||
|
||||
VisualFunction *f = _call_stack[l].function;
|
||||
|
||||
List<Pair<StringName,int> > locals;
|
||||
|
||||
f->debug_get_stack_member_state(*_call_stack[l].line,&locals);
|
||||
for( List<Pair<StringName,int> >::Element *E = locals.front();E;E=E->next() ) {
|
||||
|
||||
p_locals->push_back(E->get().first);
|
||||
p_values->push_back(_call_stack[l].stack[E->get().second]);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void VisualScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
|
||||
if (_debug_parse_err_node >= 0) {
|
||||
return;
|
||||
|
|
|
@ -857,16 +857,11 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|||
int iofs = ofs + 8;
|
||||
|
||||
string_count = decode_uint32(&p_manifest[iofs]);
|
||||
//styles_count = decode_uint32(&p_manifest[iofs + 4]);
|
||||
// iofs + 4 is `styles_count`.
|
||||
string_flags = decode_uint32(&p_manifest[iofs + 8]);
|
||||
string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
|
||||
//styles_offset = decode_uint32(&p_manifest[iofs + 16]);
|
||||
/*
|
||||
printf("string count: %i\n",string_count);
|
||||
printf("flags: %i\n",string_flags);
|
||||
printf("sdata ofs: %i\n",string_data_offset);
|
||||
printf("styles ofs: %i\n",styles_offset);
|
||||
*/
|
||||
// iofs + 16 is `styles_offset`.
|
||||
|
||||
uint32_t st_offset = iofs + 20;
|
||||
string_table.resize(string_count);
|
||||
uint32_t string_end = 0;
|
||||
|
@ -1441,7 +1436,6 @@ void EditorExportPlatformAndroid::_fix_resources(const Ref<EditorExportPreset> &
|
|||
encode_uint32(ret.size(), &ret.write[4]);
|
||||
|
||||
r_manifest = ret;
|
||||
//printf("end\n");
|
||||
}
|
||||
|
||||
void EditorExportPlatformAndroid::_load_image_data(const Ref<Image> &p_splash_image, Vector<uint8_t> &p_data) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -156,16 +156,16 @@ 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,
|
||||
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)));
|
||||
|
||||
} else {
|
||||
setEGLConfigChooser(translucent ?
|
||||
new RegularConfigChooser(8, 8, 8, 8, 16, stencil) :
|
||||
new RegularConfigChooser(5, 6, 5, 0, 16, stencil));
|
||||
setEGLConfigChooser(translucent
|
||||
? new RegularConfigChooser(8, 8, 8, 8, 16, stencil)
|
||||
: new RegularConfigChooser(5, 6, 5, 0, 16, stencil));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -33,24 +33,24 @@ Adapted from corresponding SDL 2.0 code.
|
|||
*/
|
||||
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
* Simple DirectMedia Layer
|
||||
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "power_android.h"
|
||||
|
|
|
@ -33,24 +33,24 @@ Adapted from corresponding SDL 2.0 code.
|
|||
*/
|
||||
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
* Simple DirectMedia Layer
|
||||
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "power_osx.h"
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -42,9 +42,9 @@ PowerUWP::~PowerUWP() {
|
|||
bool PowerUWP::UpdatePowerInfo() {
|
||||
// TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement UpdatePowerInfo as appropriate. */
|
||||
/* Notes from SDL:
|
||||
- the Win32 function, GetSystemPowerStatus, is not available for use on WinRT
|
||||
- Windows Phone 8 has a 'Battery' class, which is documented as available for C++
|
||||
- More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231
|
||||
* - the Win32 function, GetSystemPowerStatus, is not available for use on WinRT
|
||||
* - Windows Phone 8 has a 'Battery' class, which is documented as available for C++
|
||||
* - More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -33,24 +33,24 @@ Adapted from corresponding SDL 2.0 code.
|
|||
*/
|
||||
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
* Simple DirectMedia Layer
|
||||
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "power_windows.h"
|
||||
|
|
|
@ -468,15 +468,6 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
|||
XISelectEvents(x11_display, x11_window, &xi.all_event_mask, 1);
|
||||
XISelectEvents(x11_display, DefaultRootWindow(x11_display), &xi.all_master_event_mask, 1);
|
||||
|
||||
// Disabled by now since grabbing also blocks mouse events
|
||||
// (they are received as extended events instead of standard events)
|
||||
/*XIClearMask(xi.touch_event_mask.mask, XI_TouchOwnership);
|
||||
|
||||
// Grab touch devices to avoid OS gesture interference
|
||||
for (int i = 0; i < xi.touch_devices.size(); ++i) {
|
||||
XIGrabDevice(x11_display, xi.touch_devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &xi.touch_event_mask);
|
||||
}*/
|
||||
|
||||
/* set the titlebar name */
|
||||
XStoreName(x11_display, x11_window, "Godot");
|
||||
|
||||
|
@ -2469,10 +2460,7 @@ void OS_X11::process_xevents() {
|
|||
xi.last_relative_time = raw_event->time;
|
||||
} break;
|
||||
#ifdef TOUCH_ENABLED
|
||||
case XI_TouchBegin: // Fall-through
|
||||
// Disabled hand-in-hand with the grabbing
|
||||
//XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch);
|
||||
|
||||
case XI_TouchBegin:
|
||||
case XI_TouchEnd: {
|
||||
bool is_begin = event_data->evtype == XI_TouchBegin;
|
||||
|
||||
|
|
|
@ -33,24 +33,24 @@ Adapted from corresponding SDL 2.0 code.
|
|||
*/
|
||||
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
* Simple DirectMedia Layer
|
||||
* Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "power_x11.h"
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
definition of invalidation: global is invalid
|
||||
|
||||
1) If a node sets a LOCAL, it produces an invalidation of everything above
|
||||
a) If above is invalid, don't keep invalidating upwards
|
||||
. a) If above is invalid, don't keep invalidating upwards
|
||||
2) If a node sets a GLOBAL, it is converted to LOCAL (and forces validation of everything pending below)
|
||||
|
||||
drawback: setting/reading globals is useful and used very very often, and using affine inverses is slow
|
||||
|
@ -58,7 +58,7 @@
|
|||
definition of invalidation: NONE dirty, LOCAL dirty, GLOBAL dirty
|
||||
|
||||
1) If a node sets a LOCAL, it must climb the tree and set it as GLOBAL dirty
|
||||
a) marking GLOBALs as dirty up all the tree must be done always
|
||||
. a) marking GLOBALs as dirty up all the tree must be done always
|
||||
2) If a node sets a GLOBAL, it marks local as dirty, and that's all?
|
||||
|
||||
//is clearing the dirty state correct in this case?
|
||||
|
|
|
@ -102,11 +102,11 @@ void Control::_edit_set_position(const Point2 &p_position) {
|
|||
// Unlikely to happen. TODO: enclose all _edit_ functions into TOOLS_ENABLED
|
||||
set_position(p_position);
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
Point2 Control::_edit_get_position() const {
|
||||
return get_position();
|
||||
};
|
||||
}
|
||||
|
||||
void Control::_edit_set_scale(const Size2 &p_scale) {
|
||||
set_scale(p_scale);
|
||||
|
@ -541,14 +541,6 @@ void Control::_notification(int p_notification) {
|
|||
viewport->connect("size_changed", this, "_size_changed");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) {
|
||||
data.theme_owner=data.parent->data.theme_owner;
|
||||
notification(NOTIFICATION_THEME_CHANGED);
|
||||
}
|
||||
*/
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_EXIT_CANVAS: {
|
||||
if (data.parent_canvas_item) {
|
||||
|
@ -675,10 +667,6 @@ bool Control::has_point(const Point2 &p_point) const {
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
/*if (has_stylebox("mask")) {
|
||||
Ref<StyleBox> mask = get_stylebox("mask");
|
||||
return mask->test_mask(p_point,Rect2(Point2(),get_size()));
|
||||
}*/
|
||||
return Rect2(Point2(), get_size()).has_point(p_point);
|
||||
}
|
||||
|
||||
|
@ -2565,16 +2553,6 @@ void Control::warp_mouse(const Point2 &p_to_pos) {
|
|||
}
|
||||
|
||||
bool Control::is_text_field() const {
|
||||
/*
|
||||
if (get_script_instance()) {
|
||||
Variant v=p_point;
|
||||
const Variant *p[2]={&v,&p_data};
|
||||
Variant::CallError ce;
|
||||
Variant ret = get_script_instance()->call("is_text_field",p,2,ce);
|
||||
if (ce.error==Variant::CallError::CALL_OK)
|
||||
return ret;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -1526,7 +1526,8 @@ 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) +
|
||||
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);
|
||||
|
|
|
@ -33,9 +33,11 @@
|
|||
void AudioFilterSW::set_mode(Mode p_mode) {
|
||||
mode = p_mode;
|
||||
}
|
||||
|
||||
void AudioFilterSW::set_cutoff(float p_cutoff) {
|
||||
cutoff = p_cutoff;
|
||||
}
|
||||
|
||||
void AudioFilterSW::set_resonance(float p_resonance) {
|
||||
resonance = p_resonance;
|
||||
}
|
||||
|
@ -178,17 +180,9 @@ void AudioFilterSW::prepare_coefficients(Coeffs *p_coeffs) {
|
|||
p_coeffs->b2 /= a0;
|
||||
p_coeffs->a1 /= 0.0 - a0;
|
||||
p_coeffs->a2 /= 0.0 - a0;
|
||||
|
||||
//undenormalise
|
||||
/* p_coeffs->b0=undenormalise(p_coeffs->b0);
|
||||
p_coeffs->b1=undenormalise(p_coeffs->b1);
|
||||
p_coeffs->b2=undenormalise(p_coeffs->b2);
|
||||
p_coeffs->a1=undenormalise(p_coeffs->a1);
|
||||
p_coeffs->a2=undenormalise(p_coeffs->a2);*/
|
||||
}
|
||||
|
||||
void AudioFilterSW::set_stages(int p_stages) { //adjust for multiple stages
|
||||
|
||||
void AudioFilterSW::set_stages(int p_stages) {
|
||||
stages = p_stages;
|
||||
}
|
||||
|
||||
|
|
|
@ -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,7 +138,9 @@ 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(
|
||||
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(),
|
||||
|
@ -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,7 +272,9 @@ void Generic6DOFJointSW::calculateTransforms() {
|
|||
void Generic6DOFJointSW::buildLinearJacobian(
|
||||
JacobianEntrySW &jacLinear, const Vector3 &normalWorld,
|
||||
const Vector3 &pivotAInW, const Vector3 &pivotBInW) {
|
||||
memnew_placement(&jacLinear, JacobianEntrySW(
|
||||
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(),
|
||||
|
@ -286,7 +288,10 @@ void Generic6DOFJointSW::buildLinearJacobian(
|
|||
|
||||
void Generic6DOFJointSW::buildAngularJacobian(
|
||||
JacobianEntrySW &jacAngular, const Vector3 &jointAxisW) {
|
||||
memnew_placement(&jacAngular, JacobianEntrySW(jointAxisW,
|
||||
memnew_placement(
|
||||
&jacAngular,
|
||||
JacobianEntrySW(
|
||||
jointAxisW,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
|
|
|
@ -152,10 +152,10 @@ public:
|
|||
|
||||
//! Test limit
|
||||
/*!
|
||||
- free means upper < lower,
|
||||
- locked means upper == lower
|
||||
- limited means upper > lower
|
||||
- limitIndex: first 3 are linear, next 3 are angular
|
||||
* - free means upper < lower,
|
||||
* - locked means upper == lower
|
||||
* - limited means upper > lower
|
||||
* - limitIndex: first 3 are linear, next 3 are angular
|
||||
*/
|
||||
inline bool isLimited(int limitIndex) {
|
||||
return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
|
||||
|
@ -239,25 +239,15 @@ public:
|
|||
virtual bool setup(real_t p_timestep);
|
||||
virtual void solve(real_t p_timestep);
|
||||
|
||||
//! Calcs global transform of the offsets
|
||||
/*!
|
||||
Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies.
|
||||
\sa Generic6DOFJointSW.getCalculatedTransformA , Generic6DOFJointSW.getCalculatedTransformB, Generic6DOFJointSW.calculateAngleInfo
|
||||
*/
|
||||
// Calcs the global transform for the joint offset for body A an B, and also calcs the angle differences between the bodies.
|
||||
void calculateTransforms();
|
||||
|
||||
//! Gets the global transform of the offset for body A
|
||||
/*!
|
||||
\sa Generic6DOFJointSW.getFrameOffsetA, Generic6DOFJointSW.getFrameOffsetB, Generic6DOFJointSW.calculateAngleInfo.
|
||||
*/
|
||||
// Gets the global transform of the offset for body A. */
|
||||
const Transform &getCalculatedTransformA() const {
|
||||
return m_calculatedTransformA;
|
||||
}
|
||||
|
||||
//! Gets the global transform of the offset for body B
|
||||
/*!
|
||||
\sa Generic6DOFJointSW.getFrameOffsetA, Generic6DOFJointSW.getFrameOffsetB, Generic6DOFJointSW.calculateAngleInfo.
|
||||
*/
|
||||
// Gets the global transform of the offset for body B.
|
||||
const Transform &getCalculatedTransformB() const {
|
||||
return m_calculatedTransformB;
|
||||
}
|
||||
|
@ -344,10 +334,10 @@ public:
|
|||
|
||||
//! Test limit
|
||||
/*!
|
||||
- free means upper < lower,
|
||||
- locked means upper == lower
|
||||
- limited means upper > lower
|
||||
- limitIndex: first 3 are linear, next 3 are angular
|
||||
* - free means upper < lower,
|
||||
* - locked means upper == lower
|
||||
* - limited means upper > lower
|
||||
* - limitIndex: first 3 are linear, next 3 are angular
|
||||
*/
|
||||
bool isLimited(int limitIndex) {
|
||||
if (limitIndex < 3) {
|
||||
|
|
|
@ -176,7 +176,9 @@ 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(
|
||||
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(),
|
||||
|
@ -202,19 +204,28 @@ 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,
|
||||
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,
|
||||
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,
|
||||
memnew_placement(
|
||||
&m_jacAng[2],
|
||||
JacobianEntrySW(
|
||||
hingeAxisWorld,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
A->get_inv_inertia(),
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,9 @@ bool PinJointSW::setup(real_t p_step) {
|
|||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
normal[i] = 1;
|
||||
memnew_placement(&m_jac[i], JacobianEntrySW(
|
||||
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(),
|
||||
|
@ -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,11 +147,12 @@ 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(
|
||||
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(),
|
||||
m_relPosA - A->get_center_of_mass(), m_relPosB - B->get_center_of_mass(),
|
||||
normalWorld,
|
||||
A->get_inv_inertia(),
|
||||
A->get_inv_mass(),
|
||||
|
@ -164,7 +165,9 @@ 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(
|
||||
memnew_placement(
|
||||
&m_jacAng[i],
|
||||
JacobianEntrySW(
|
||||
normalWorld,
|
||||
A->get_principal_inertia_axes().transposed(),
|
||||
B->get_principal_inertia_axes().transposed(),
|
||||
|
|
|
@ -651,92 +651,3 @@ BroadPhase2DHashGrid::~BroadPhase2DHashGrid() {
|
|||
|
||||
memdelete_arr(hash_table);
|
||||
}
|
||||
|
||||
/* 3D version of voxel traversal:
|
||||
|
||||
public IEnumerable<Point3D> GetCellsOnRay(Ray ray, int maxDepth)
|
||||
{
|
||||
// Implementation is based on:
|
||||
// "A Fast Voxel Traversal Algorithm for Ray Tracing"
|
||||
// John Amanatides, Andrew Woo
|
||||
// http://www.cse.yorku.ca/~amana/research/grid.pdf
|
||||
// https://web.archive.org/web/20100616193049/http://www.devmaster.net/articles/raytracing_series/A%20faster%20voxel%20traversal%20algorithm%20for%20ray%20tracing.pdf
|
||||
|
||||
// NOTES:
|
||||
// * This code assumes that the ray's position and direction are in 'cell coordinates', which means
|
||||
// that one unit equals one cell in all directions.
|
||||
// * When the ray doesn't start within the voxel grid, calculate the first position at which the
|
||||
// ray could enter the grid. If it never enters the grid, there is nothing more to do here.
|
||||
// * Also, it is important to test when the ray exits the voxel grid when the grid isn't infinite.
|
||||
// * The Point3D structure is a simple structure having three integer fields (X, Y and Z).
|
||||
|
||||
// The cell in which the ray starts.
|
||||
Point3D start = GetCellAt(ray.Position); // Rounds the position's X, Y and Z down to the nearest integer values.
|
||||
int x = start.X;
|
||||
int y = start.Y;
|
||||
int z = start.Z;
|
||||
|
||||
// Determine which way we go.
|
||||
int stepX = Math.Sign(ray.Direction.X);
|
||||
int stepY = Math.Sign(ray.Direction.Y);
|
||||
int stepZ = Math.Sign(ray.Direction.Z);
|
||||
|
||||
// Calculate cell boundaries. When the step (i.e. direction sign) is positive,
|
||||
// the next boundary is AFTER our current position, meaning that we have to add 1.
|
||||
// Otherwise, it is BEFORE our current position, in which case we add nothing.
|
||||
Point3D cellBoundary = new Point3D(
|
||||
x + (stepX > 0 ? 1 : 0),
|
||||
y + (stepY > 0 ? 1 : 0),
|
||||
z + (stepZ > 0 ? 1 : 0));
|
||||
|
||||
// NOTE: For the following calculations, the result will be Single.PositiveInfinity
|
||||
// when ray.Direction.X, Y or Z equals zero, which is OK. However, when the left-hand
|
||||
// value of the division also equals zero, the result is Single.NaN, which is not OK.
|
||||
|
||||
// Determine how far we can travel along the ray before we hit a voxel boundary.
|
||||
Vector3 tMax = new Vector3(
|
||||
(cellBoundary.X - ray.Position.X) / ray.Direction.X, // Boundary is a plane on the YZ axis.
|
||||
(cellBoundary.Y - ray.Position.Y) / ray.Direction.Y, // Boundary is a plane on the XZ axis.
|
||||
(cellBoundary.Z - ray.Position.Z) / ray.Direction.Z); // Boundary is a plane on the XY axis.
|
||||
if (Single.IsNaN(tMax.X)) tMax.X = Single.PositiveInfinity;
|
||||
if (Single.IsNaN(tMax.Y)) tMax.Y = Single.PositiveInfinity;
|
||||
if (Single.IsNaN(tMax.Z)) tMax.Z = Single.PositiveInfinity;
|
||||
|
||||
// Determine how far we must travel along the ray before we have crossed a gridcell.
|
||||
Vector3 tDelta = new Vector3(
|
||||
stepX / ray.Direction.X, // Crossing the width of a cell.
|
||||
stepY / ray.Direction.Y, // Crossing the height of a cell.
|
||||
stepZ / ray.Direction.Z); // Crossing the depth of a cell.
|
||||
if (Single.IsNaN(tDelta.X)) tDelta.X = Single.PositiveInfinity;
|
||||
if (Single.IsNaN(tDelta.Y)) tDelta.Y = Single.PositiveInfinity;
|
||||
if (Single.IsNaN(tDelta.Z)) tDelta.Z = Single.PositiveInfinity;
|
||||
|
||||
// For each step, determine which distance to the next voxel boundary is lowest (i.e.
|
||||
// which voxel boundary is nearest) and walk that way.
|
||||
for (int i = 0; i < maxDepth; i++)
|
||||
{
|
||||
// Return it.
|
||||
yield return new Point3D(x, y, z);
|
||||
|
||||
// Do the next step.
|
||||
if (tMax.X < tMax.Y && tMax.X < tMax.Z)
|
||||
{
|
||||
// tMax.X is the lowest, an YZ cell boundary plane is nearest.
|
||||
x += stepX;
|
||||
tMax.X += tDelta.X;
|
||||
}
|
||||
else if (tMax.Y < tMax.Z)
|
||||
{
|
||||
// tMax.Y is the lowest, an XZ cell boundary plane is nearest.
|
||||
y += stepY;
|
||||
tMax.Y += tDelta.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
// tMax.Z is the lowest, an XY cell boundary plane is nearest.
|
||||
z += stepZ;
|
||||
tMax.Z += tDelta.Z;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue