Merge pull request #54350 from akien-mga/clang-format-dont-align-operands
This commit is contained in:
commit
f7d852b532
135 changed files with 1051 additions and 1183 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
|
||||
|
|
|
@ -164,10 +164,11 @@ void Input::_bind_methods() {
|
|||
|
||||
void Input::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
|
||||
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);
|
||||
|
||||
|
@ -315,11 +316,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.
|
||||
|
|
|
@ -454,10 +454,10 @@ bool InputEventKey::is_match(const Ref<InputEvent> &p_event, bool p_exact_match)
|
|||
|
||||
if (keycode == 0) {
|
||||
return physical_keycode == key->physical_keycode &&
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
} else {
|
||||
return keycode == key->keycode &&
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -616,7 +616,7 @@ bool InputEventMouseButton::is_match(const Ref<InputEvent> &p_event, bool p_exac
|
|||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
static const char *_mouse_button_descriptions[9] = {
|
||||
|
@ -935,7 +935,7 @@ bool InputEventJoypadMotion::is_match(const Ref<InputEvent> &p_event, bool p_exa
|
|||
}
|
||||
|
||||
return axis == jm->axis &&
|
||||
(!p_exact_match || ((axis_value < 0) == (jm->axis_value < 0)));
|
||||
(!p_exact_match || ((axis_value < 0) == (jm->axis_value < 0)));
|
||||
}
|
||||
|
||||
static const char *_joy_axis_descriptions[JOY_AXIS_MAX] = {
|
||||
|
|
|
@ -41,8 +41,8 @@ class InputMap : public Object {
|
|||
|
||||
public:
|
||||
/**
|
||||
* A special value used to signify that a given Action can be triggered by any device
|
||||
*/
|
||||
* A special value used to signify that a given Action can be triggered by any device
|
||||
*/
|
||||
static int ALL_DEVICES;
|
||||
|
||||
struct Action {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* Image storage class. This is used to store an image in user memory, as well as
|
||||
* providing some basic methods for image manipulation.
|
||||
* Images can be loaded from a file, or registered into the Render object as textures.
|
||||
*/
|
||||
*/
|
||||
|
||||
class Image;
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@ typedef uint32_t uintr_t;
|
|||
#endif
|
||||
|
||||
/**
|
||||
* Miscellaneous helpers for marshalling data types, and encoding
|
||||
* in an endian independent way
|
||||
*/
|
||||
* Miscellaneous helpers for marshalling data types, and encoding
|
||||
* in an endian independent way
|
||||
*/
|
||||
|
||||
union MarshallFloat {
|
||||
uint32_t i; ///< int
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -200,7 +200,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
|
||||
|
@ -288,10 +288,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.
|
||||
|
@ -682,8 +679,8 @@ bool Basis::operator!=(const Basis &p_matrix) const {
|
|||
|
||||
Basis::operator String() const {
|
||||
return "[X: " + get_axis(0).operator String() +
|
||||
", Y: " + get_axis(1).operator String() +
|
||||
", Z: " + get_axis(2).operator String() + "]";
|
||||
", Y: " + get_axis(1).operator String() +
|
||||
", Z: " + get_axis(2).operator String() + "]";
|
||||
}
|
||||
|
||||
Quaternion Basis::get_quaternion() const {
|
||||
|
@ -704,9 +701,9 @@ Quaternion Basis::get_quaternion() 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;
|
||||
|
||||
|
|
|
@ -324,7 +324,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
|
||||
|
|
|
@ -42,24 +42,24 @@ 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.
|
||||
*/
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
// This function is based on the 'Balance' function from Randy Gaul's qu3e
|
||||
|
@ -67,7 +67,7 @@ BVHABB_CLASS _logic_abb_merge(const BVHABB_CLASS &a, const BVHABB_CLASS &b) {
|
|||
// It is MODIFIED from qu3e version.
|
||||
// This is the only function used (and _logic_abb_merge helper function).
|
||||
int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) {
|
||||
// return iA; // uncomment this to bypass balance
|
||||
//return iA; // uncomment this to bypass balance
|
||||
|
||||
TNode *A = &_nodes[iA];
|
||||
|
||||
|
@ -75,12 +75,12 @@ int32_t _logic_balance(int32_t iA, uint32_t p_tree_id) {
|
|||
return iA;
|
||||
}
|
||||
|
||||
/* A
|
||||
/ \
|
||||
B C
|
||||
/ \ / \
|
||||
D E F G
|
||||
*/
|
||||
/* A
|
||||
* / \
|
||||
* B C
|
||||
* / \ / \
|
||||
* D E F G
|
||||
*/
|
||||
|
||||
CRASH_COND(A->num_children != 2);
|
||||
int32_t iB = A->children[0];
|
||||
|
|
|
@ -35,17 +35,17 @@
|
|||
|
||||
float CameraMatrix::determinant() const {
|
||||
return matrix[0][3] * matrix[1][2] * matrix[2][1] * matrix[3][0] - matrix[0][2] * matrix[1][3] * matrix[2][1] * matrix[3][0] -
|
||||
matrix[0][3] * matrix[1][1] * matrix[2][2] * matrix[3][0] + matrix[0][1] * matrix[1][3] * matrix[2][2] * matrix[3][0] +
|
||||
matrix[0][2] * matrix[1][1] * matrix[2][3] * matrix[3][0] - matrix[0][1] * matrix[1][2] * matrix[2][3] * matrix[3][0] -
|
||||
matrix[0][3] * matrix[1][2] * matrix[2][0] * matrix[3][1] + matrix[0][2] * matrix[1][3] * matrix[2][0] * matrix[3][1] +
|
||||
matrix[0][3] * matrix[1][0] * matrix[2][2] * matrix[3][1] - matrix[0][0] * matrix[1][3] * matrix[2][2] * matrix[3][1] -
|
||||
matrix[0][2] * matrix[1][0] * matrix[2][3] * matrix[3][1] + matrix[0][0] * matrix[1][2] * matrix[2][3] * matrix[3][1] +
|
||||
matrix[0][3] * matrix[1][1] * matrix[2][0] * matrix[3][2] - matrix[0][1] * matrix[1][3] * matrix[2][0] * matrix[3][2] -
|
||||
matrix[0][3] * matrix[1][0] * matrix[2][1] * matrix[3][2] + matrix[0][0] * matrix[1][3] * matrix[2][1] * matrix[3][2] +
|
||||
matrix[0][1] * matrix[1][0] * matrix[2][3] * matrix[3][2] - matrix[0][0] * matrix[1][1] * matrix[2][3] * matrix[3][2] -
|
||||
matrix[0][2] * matrix[1][1] * matrix[2][0] * matrix[3][3] + matrix[0][1] * matrix[1][2] * matrix[2][0] * matrix[3][3] +
|
||||
matrix[0][2] * matrix[1][0] * matrix[2][1] * matrix[3][3] - matrix[0][0] * matrix[1][2] * matrix[2][1] * matrix[3][3] -
|
||||
matrix[0][1] * matrix[1][0] * matrix[2][2] * matrix[3][3] + matrix[0][0] * matrix[1][1] * matrix[2][2] * matrix[3][3];
|
||||
matrix[0][3] * matrix[1][1] * matrix[2][2] * matrix[3][0] + matrix[0][1] * matrix[1][3] * matrix[2][2] * matrix[3][0] +
|
||||
matrix[0][2] * matrix[1][1] * matrix[2][3] * matrix[3][0] - matrix[0][1] * matrix[1][2] * matrix[2][3] * matrix[3][0] -
|
||||
matrix[0][3] * matrix[1][2] * matrix[2][0] * matrix[3][1] + matrix[0][2] * matrix[1][3] * matrix[2][0] * matrix[3][1] +
|
||||
matrix[0][3] * matrix[1][0] * matrix[2][2] * matrix[3][1] - matrix[0][0] * matrix[1][3] * matrix[2][2] * matrix[3][1] -
|
||||
matrix[0][2] * matrix[1][0] * matrix[2][3] * matrix[3][1] + matrix[0][0] * matrix[1][2] * matrix[2][3] * matrix[3][1] +
|
||||
matrix[0][3] * matrix[1][1] * matrix[2][0] * matrix[3][2] - matrix[0][1] * matrix[1][3] * matrix[2][0] * matrix[3][2] -
|
||||
matrix[0][3] * matrix[1][0] * matrix[2][1] * matrix[3][2] + matrix[0][0] * matrix[1][3] * matrix[2][1] * matrix[3][2] +
|
||||
matrix[0][1] * matrix[1][0] * matrix[2][3] * matrix[3][2] - matrix[0][0] * matrix[1][1] * matrix[2][3] * matrix[3][2] -
|
||||
matrix[0][2] * matrix[1][1] * matrix[2][0] * matrix[3][3] + matrix[0][1] * matrix[1][2] * matrix[2][0] * matrix[3][3] +
|
||||
matrix[0][2] * matrix[1][0] * matrix[2][1] * matrix[3][3] - matrix[0][0] * matrix[1][2] * matrix[2][1] * matrix[3][3] -
|
||||
matrix[0][1] * matrix[1][0] * matrix[2][2] * matrix[3][3] + matrix[0][0] * matrix[1][1] * matrix[2][2] * matrix[3][3];
|
||||
}
|
||||
|
||||
void CameraMatrix::set_identity() {
|
||||
|
|
|
@ -265,8 +265,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 {
|
||||
|
@ -735,8 +734,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;
|
||||
|
@ -757,10 +754,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, all bits of result are inverted, which changes the sign of result (and again cannot result in zero)
|
||||
:
|
||||
0;
|
||||
// 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)
|
||||
return result ? result ^ sign : 0;
|
||||
|
||||
#else
|
||||
|
||||
|
@ -793,8 +789,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) {
|
||||
|
@ -1446,8 +1441,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
|
||||
|
|
|
@ -48,13 +48,13 @@ public:
|
|||
Vector3 vertex[3];
|
||||
|
||||
/**
|
||||
*
|
||||
* @param p_plane plane used to split the face
|
||||
* @param p_res array of at least 3 faces, amount used in function return
|
||||
* @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in function return
|
||||
* @param _epsilon constant used for numerical error rounding, to add "thickness" to the plane (so coplanar points can happen)
|
||||
* @return amount of faces generated by the split, either 0 (means no split possible), 2 or 3
|
||||
*/
|
||||
*
|
||||
* @param p_plane plane used to split the face
|
||||
* @param p_res array of at least 3 faces, amount used in function return
|
||||
* @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in function return
|
||||
* @param _epsilon constant used for numerical error rounding, to add "thickness" to the plane (so coplanar points can happen)
|
||||
* @return amount of faces generated by the split, either 0 (means no split possible), 2 or 3
|
||||
*/
|
||||
|
||||
int split_by_plane(const Plane &p_plane, Face3 *p_res, bool *p_is_point_over) const;
|
||||
|
||||
|
|
|
@ -116,10 +116,10 @@ enum Corner {
|
|||
};
|
||||
|
||||
/**
|
||||
* The "Real" type is an abstract type used for real numbers, such as 1.5,
|
||||
* in contrast to integer numbers. Precision can be controlled with the
|
||||
* presence or absence of the REAL_T_IS_DOUBLE define.
|
||||
*/
|
||||
* The "Real" type is an abstract type used for real numbers, such as 1.5,
|
||||
* in contrast to integer numbers. Precision can be controlled with the
|
||||
* presence or absence of the REAL_T_IS_DOUBLE define.
|
||||
*/
|
||||
#ifdef REAL_T_IS_DOUBLE
|
||||
typedef double real_t;
|
||||
#else
|
||||
|
|
|
@ -159,7 +159,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
|
||||
|
@ -461,7 +461,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) {
|
||||
|
@ -474,8 +474,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;
|
||||
|
|
|
@ -88,7 +88,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;
|
||||
|
|
|
@ -118,8 +118,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 {
|
||||
|
@ -257,7 +257,7 @@ struct Rect2 {
|
|||
return Vector2(
|
||||
(p_normal.x > 0) ? -half_extents.x : half_extents.x,
|
||||
(p_normal.y > 0) ? -half_extents.y : half_extents.y) +
|
||||
ofs;
|
||||
ofs;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool intersects_filled_polygon(const Vector2 *p_points, int p_point_count) const {
|
||||
|
@ -367,8 +367,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 {
|
||||
|
|
|
@ -298,6 +298,6 @@ Transform2D Transform2D::operator*(const real_t p_val) const {
|
|||
|
||||
Transform2D::operator String() const {
|
||||
return "[X: " + elements[0].operator String() +
|
||||
", Y: " + elements[1].operator String() +
|
||||
", O: " + elements[2].operator String() + "]";
|
||||
", Y: " + elements[1].operator String() +
|
||||
", O: " + elements[2].operator String() + "]";
|
||||
}
|
||||
|
|
|
@ -164,7 +164,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 {
|
||||
|
|
|
@ -175,9 +175,9 @@ Transform3D Transform3D::operator*(const real_t p_val) const {
|
|||
|
||||
Transform3D::operator String() const {
|
||||
return "[X: " + basis.get_axis(0).operator String() +
|
||||
", Y: " + basis.get_axis(1).operator String() +
|
||||
", Z: " + basis.get_axis(2).operator String() +
|
||||
", O: " + origin.operator String() + "]";
|
||||
", Y: " + basis.get_axis(1).operator String() +
|
||||
", Z: " + basis.get_axis(2).operator String() +
|
||||
", O: " + origin.operator String() + "]";
|
||||
}
|
||||
|
||||
Transform3D::Transform3D(const Basis &p_basis, const Vector3 &p_origin) :
|
||||
|
|
|
@ -42,18 +42,13 @@ real_t Triangulate::get_area(const Vector<Vector2> &contour) {
|
|||
return A * 0.5;
|
||||
}
|
||||
|
||||
/*
|
||||
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;
|
||||
|
||||
|
|
|
@ -160,10 +160,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,10 +93,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.0 * 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.0 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -1398,7 +1398,7 @@ void Object::_disconnect(const StringName &p_signal, const Callable &p_callable,
|
|||
SignalData *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));
|
||||
(!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal));
|
||||
ERR_FAIL_COND_MSG(signal_is_valid, "Attempt to disconnect a nonexistent connection from '" + to_string() + "'. Signal: '" + p_signal + "', callable: '" + p_callable + "'.");
|
||||
}
|
||||
ERR_FAIL_COND_MSG(!s, vformat("Disconnecting nonexistent signal '%s' in %s.", p_signal, to_string()));
|
||||
|
|
|
@ -1563,8 +1563,8 @@ const char32_t *TranslationServer::get_accented_version(char32_t p_character) co
|
|||
|
||||
bool TranslationServer::is_placeholder(String &p_message, int p_index) const {
|
||||
return p_message[p_index] == '%' && p_index < p_message.size() - 1 &&
|
||||
(p_message[p_index + 1] == 's' || p_message[p_index + 1] == 'c' || p_message[p_index + 1] == 'd' ||
|
||||
p_message[p_index + 1] == 'o' || p_message[p_index + 1] == 'x' || p_message[p_index + 1] == 'X' || p_message[p_index + 1] == 'f');
|
||||
(p_message[p_index + 1] == 's' || p_message[p_index + 1] == 'c' || p_message[p_index + 1] == 'd' ||
|
||||
p_message[p_index + 1] == 'o' || p_message[p_index + 1] == 'x' || p_message[p_index + 1] == 'X' || p_message[p_index + 1] == 'f');
|
||||
}
|
||||
|
||||
void TranslationServer::_bind_methods() {
|
||||
|
|
|
@ -2317,28 +2317,33 @@ bool String::is_numeric() const {
|
|||
}
|
||||
|
||||
template <class C>
|
||||
static double built_in_strtod(const C *string, /* 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
|
||||
* part of the mantissa, and X is the
|
||||
* exponent. Either of the signs may be "+",
|
||||
* "-", or omitted. Either I or F may be
|
||||
* omitted, or both. The decimal point isn't
|
||||
* 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-nullptr, store terminating Cacter's
|
||||
* address here. */
|
||||
{
|
||||
static const int maxExponent = 511; /* 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. */
|
||||
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
|
||||
* part of the mantissa, and X is the
|
||||
* exponent. Either of the signs may be "+",
|
||||
* "-", or omitted. Either I or F may be
|
||||
* omitted, or both. The decimal point isn't
|
||||
* necessary unless F is present. The "E" may
|
||||
* actually be an "e". E and X may both be
|
||||
* omitted (but not just one). */
|
||||
const C *string,
|
||||
/* If non-nullptr, store terminating Cacter's
|
||||
* address here. */
|
||||
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 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,
|
||||
|
@ -2353,25 +2358,28 @@ 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
|
||||
* part. Under normal circumstances, it is
|
||||
* the negative of the number of digits in F.
|
||||
* However, if I is very long, the last digits
|
||||
* of I get dropped (otherwise a long I with a
|
||||
* large negative exponent could cause an
|
||||
* 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. */
|
||||
/* 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
|
||||
* of I get dropped (otherwise a long I with a
|
||||
* large negative exponent could cause an
|
||||
* unnecessary overflow on I alone). In this
|
||||
* case, fracExp is incremented one for each
|
||||
* dropped digit. */
|
||||
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.
|
||||
*/
|
||||
* Strip off leading blanks and check for a sign.
|
||||
*/
|
||||
|
||||
p = string;
|
||||
while (*p == ' ' || *p == '\t' || *p == '\n') {
|
||||
|
@ -2388,9 +2396,9 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
|||
}
|
||||
|
||||
/*
|
||||
* Count the number of digits in the mantissa (including the decimal
|
||||
* point), and also locate the decimal point.
|
||||
*/
|
||||
* Count the number of digits in the mantissa (including the decimal
|
||||
* point), and also locate the decimal point.
|
||||
*/
|
||||
|
||||
decPt = -1;
|
||||
for (mantSize = 0;; mantSize += 1) {
|
||||
|
@ -2405,11 +2413,11 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
|||
}
|
||||
|
||||
/*
|
||||
* Now suck up the digits in the mantissa. Use two integers to collect 9
|
||||
* digits each (this is faster than using floating-point). If the mantissa
|
||||
* has more than 18 digits, ignore the extras, since they can't affect the
|
||||
* value anyway.
|
||||
*/
|
||||
* Now suck up the digits in the mantissa. Use two integers to collect 9
|
||||
* digits each (this is faster than using floating-point). If the mantissa
|
||||
* has more than 18 digits, ignore the extras, since they can't affect the
|
||||
* value anyway.
|
||||
*/
|
||||
|
||||
pExp = p;
|
||||
p -= mantSize;
|
||||
|
@ -2455,8 +2463,8 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
|||
}
|
||||
|
||||
/*
|
||||
* Skim off the exponent.
|
||||
*/
|
||||
* Skim off the exponent.
|
||||
*/
|
||||
|
||||
p = pExp;
|
||||
if ((*p == 'E') || (*p == 'e')) {
|
||||
|
@ -2486,10 +2494,10 @@ static double built_in_strtod(const C *string, /* A decimal ASCII floating-point
|
|||
}
|
||||
|
||||
/*
|
||||
* Generate a floating-point number that represents the exponent. Do this
|
||||
* by processing the exponent one bit at a time to combine many powers of
|
||||
* 2 of 10. Then combine the exponent with the fraction.
|
||||
*/
|
||||
* Generate a floating-point number that represents the exponent. Do this
|
||||
* by processing the exponent one bit at a time to combine many powers of
|
||||
* 2 of 10. Then combine the exponent with the fraction.
|
||||
*/
|
||||
|
||||
if (exp < 0) {
|
||||
expSign = true;
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
* @param RELATIONSHIP Relationship at which the hash table is resized. if amount of elements is RELATIONSHIP
|
||||
* times bigger than the hash table, table is resized to solve this condition. if RELATIONSHIP is zero, table is always MIN_HASH_TABLE_POWER.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
template <class TKey, class TData, class Hasher = HashMapHasherDefault, class Comparator = HashMapComparatorDefault<TKey>, uint8_t MIN_HASH_TABLE_POWER = 3, uint8_t RELATIONSHIP = 8>
|
||||
class HashMap {
|
||||
|
@ -458,8 +458,8 @@ public:
|
|||
*
|
||||
* print( *k );
|
||||
* }
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
const TKey *next(const TKey *p_key) const {
|
||||
if (unlikely(!hash_table)) {
|
||||
return nullptr;
|
||||
|
|
|
@ -249,29 +249,29 @@ private:
|
|||
|
||||
public:
|
||||
/**
|
||||
* return a const iterator to the beginning of the list.
|
||||
*/
|
||||
* return a const iterator to the beginning of the list.
|
||||
*/
|
||||
_FORCE_INLINE_ const Element *front() const {
|
||||
return _data ? _data->first : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* return an iterator to the beginning of the list.
|
||||
*/
|
||||
* return an iterator to the beginning of the list.
|
||||
*/
|
||||
_FORCE_INLINE_ Element *front() {
|
||||
return _data ? _data->first : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* return a const iterator to the last member of the list.
|
||||
*/
|
||||
* return a const iterator to the last member of the list.
|
||||
*/
|
||||
_FORCE_INLINE_ const Element *back() const {
|
||||
return _data ? _data->last : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* return an iterator to the last member of the list.
|
||||
*/
|
||||
* return an iterator to the last member of the list.
|
||||
*/
|
||||
_FORCE_INLINE_ Element *back() {
|
||||
return _data ? _data->last : nullptr;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* @class Vector
|
||||
* @author Juan Linietsky
|
||||
* Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use Vector for large arrays.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "core/error/error_macros.h"
|
||||
#include "core/os/memory.h"
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -3118,7 +3118,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 RECT2I: {
|
||||
const Rect2i *l = reinterpret_cast<const Rect2i *>(_data._mem);
|
||||
|
@ -3158,7 +3158,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: {
|
||||
|
|
|
@ -3273,10 +3273,10 @@ bool RenderingDeviceVulkan::texture_is_format_supported_for_usage(DataFormat p_f
|
|||
VkRenderPass RenderingDeviceVulkan::_render_pass_create(const Vector<AttachmentFormat> &p_attachments, const Vector<FramebufferPass> &p_passes, InitialAction p_initial_action, FinalAction p_final_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, uint32_t p_view_count, Vector<TextureSamples> *r_samples) {
|
||||
// Set up dependencies from/to external equivalent to the default (implicit) one, and then amend them
|
||||
const VkPipelineStageFlags default_access_mask = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; // From Section 7.1 of Vulkan API Spec v1.1.148
|
||||
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; // From Section 7.1 of Vulkan API Spec v1.1.148
|
||||
|
||||
VkPipelineStageFlags reading_stages = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT;
|
||||
VkSubpassDependency dependencies[2] = { { VK_SUBPASS_EXTERNAL, 0, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, 0, default_access_mask, 0 },
|
||||
|
@ -8980,35 +8980,35 @@ void RenderingDeviceVulkan::capture_timestamp(const String &p_name) {
|
|||
memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
|
||||
memoryBarrier.pNext = nullptr;
|
||||
memoryBarrier.srcAccessMask = VK_ACCESS_INDIRECT_COMMAND_READ_BIT |
|
||||
VK_ACCESS_INDEX_READ_BIT |
|
||||
VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT |
|
||||
VK_ACCESS_UNIFORM_READ_BIT |
|
||||
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_SHADER_READ_BIT |
|
||||
VK_ACCESS_SHADER_WRITE_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_TRANSFER_READ_BIT |
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT |
|
||||
VK_ACCESS_HOST_READ_BIT |
|
||||
VK_ACCESS_HOST_WRITE_BIT;
|
||||
VK_ACCESS_INDEX_READ_BIT |
|
||||
VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT |
|
||||
VK_ACCESS_UNIFORM_READ_BIT |
|
||||
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_SHADER_READ_BIT |
|
||||
VK_ACCESS_SHADER_WRITE_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_TRANSFER_READ_BIT |
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT |
|
||||
VK_ACCESS_HOST_READ_BIT |
|
||||
VK_ACCESS_HOST_WRITE_BIT;
|
||||
memoryBarrier.dstAccessMask = VK_ACCESS_INDIRECT_COMMAND_READ_BIT |
|
||||
VK_ACCESS_INDEX_READ_BIT |
|
||||
VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT |
|
||||
VK_ACCESS_UNIFORM_READ_BIT |
|
||||
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_SHADER_READ_BIT |
|
||||
VK_ACCESS_SHADER_WRITE_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_TRANSFER_READ_BIT |
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT |
|
||||
VK_ACCESS_HOST_READ_BIT |
|
||||
VK_ACCESS_HOST_WRITE_BIT;
|
||||
VK_ACCESS_INDEX_READ_BIT |
|
||||
VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT |
|
||||
VK_ACCESS_UNIFORM_READ_BIT |
|
||||
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_SHADER_READ_BIT |
|
||||
VK_ACCESS_SHADER_WRITE_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
|
||||
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT |
|
||||
VK_ACCESS_TRANSFER_READ_BIT |
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT |
|
||||
VK_ACCESS_HOST_READ_BIT |
|
||||
VK_ACCESS_HOST_WRITE_BIT;
|
||||
|
||||
vkCmdPipelineBarrier(frames[frame].draw_command_buffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 1, &memoryBarrier, 0, nullptr, 0, nullptr);
|
||||
}
|
||||
|
|
|
@ -137,10 +137,10 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanContext::_debug_messenger_callback(
|
|||
}
|
||||
|
||||
String error_message(type_string +
|
||||
" - Message Id Number: " + String::num_int64(pCallbackData->messageIdNumber) +
|
||||
" | Message Id Name: " + pCallbackData->pMessageIdName +
|
||||
"\n\t" + pCallbackData->pMessage +
|
||||
objects_string + labels_string);
|
||||
" - Message Id Number: " + String::num_int64(pCallbackData->messageIdNumber) +
|
||||
" | Message Id Name: " + pCallbackData->pMessageIdName +
|
||||
"\n\t" + pCallbackData->pMessage +
|
||||
objects_string + labels_string);
|
||||
|
||||
// Convert VK severity to our own log macros.
|
||||
switch (messageSeverity) {
|
||||
|
@ -175,7 +175,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanContext::_debug_report_callback(
|
|||
const char *pMessage,
|
||||
void *pUserData) {
|
||||
String debugMessage = String("Vulkan Debug Report: object - ") +
|
||||
String::num_int64(object) + "\n" + pMessage;
|
||||
String::num_int64(object) + "\n" + pMessage;
|
||||
|
||||
switch (flags) {
|
||||
case VK_DEBUG_REPORT_DEBUG_BIT_EXT:
|
||||
|
@ -631,10 +631,10 @@ Error VulkanContext::_create_physical_device() {
|
|||
}
|
||||
|
||||
/*
|
||||
* This is info for a temp callback to use during CreateInstance.
|
||||
* After the instance is created, we use the instance-based
|
||||
* function to register the final callback.
|
||||
*/
|
||||
* This is info for a temp callback to use during CreateInstance.
|
||||
* After the instance is created, we use the instance-based
|
||||
* function to register the final callback.
|
||||
*/
|
||||
VkDebugUtilsMessengerCreateInfoEXT dbg_messenger_create_info;
|
||||
VkDebugReportCallbackCreateInfoEXT dbg_report_callback_create_info{};
|
||||
if (enabled_debug_utils) {
|
||||
|
@ -645,18 +645,18 @@ Error VulkanContext::_create_physical_device() {
|
|||
dbg_messenger_create_info.messageSeverity =
|
||||
VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT;
|
||||
dbg_messenger_create_info.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
|
||||
VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
|
||||
dbg_messenger_create_info.pfnUserCallback = _debug_messenger_callback;
|
||||
dbg_messenger_create_info.pUserData = this;
|
||||
inst_info.pNext = &dbg_messenger_create_info;
|
||||
} else if (enabled_debug_report) {
|
||||
dbg_report_callback_create_info.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
|
||||
dbg_report_callback_create_info.flags = VK_DEBUG_REPORT_INFORMATION_BIT_EXT |
|
||||
VK_DEBUG_REPORT_WARNING_BIT_EXT |
|
||||
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT |
|
||||
VK_DEBUG_REPORT_ERROR_BIT_EXT |
|
||||
VK_DEBUG_REPORT_DEBUG_BIT_EXT;
|
||||
VK_DEBUG_REPORT_WARNING_BIT_EXT |
|
||||
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT |
|
||||
VK_DEBUG_REPORT_ERROR_BIT_EXT |
|
||||
VK_DEBUG_REPORT_DEBUG_BIT_EXT;
|
||||
dbg_report_callback_create_info.pfnCallback = _debug_report_callback;
|
||||
dbg_report_callback_create_info.pUserData = this;
|
||||
inst_info.pNext = &dbg_report_callback_create_info;
|
||||
|
|
|
@ -238,10 +238,16 @@ void InputEventConfigurationDialog::_listen_window_input(const Ref<InputEvent> &
|
|||
Ref<InputEventJoypadButton> joyb = p_event;
|
||||
Ref<InputEventJoypadMotion> joym = p_event;
|
||||
|
||||
int type = k.is_valid() ? INPUT_KEY : joyb.is_valid() ? INPUT_JOY_BUTTON :
|
||||
joym.is_valid() ? INPUT_JOY_MOTION :
|
||||
mb.is_valid() ? INPUT_MOUSE_BUTTON :
|
||||
0;
|
||||
int type = 0;
|
||||
if (k.is_valid()) {
|
||||
type = INPUT_KEY;
|
||||
} else if (joyb.is_valid()) {
|
||||
type = INPUT_JOY_BUTTON;
|
||||
} else if (joym.is_valid()) {
|
||||
type = INPUT_JOY_MOTION;
|
||||
} else if (mb.is_valid()) {
|
||||
type = INPUT_MOUSE_BUTTON;
|
||||
}
|
||||
|
||||
if (!(allowed_input_types & type)) {
|
||||
return;
|
||||
|
|
|
@ -155,7 +155,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);
|
||||
|
|
|
@ -4964,9 +4964,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_button()->set_text(TTR("Save & Close"));
|
||||
save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene->get_scene_file_path() != "" ? scene->get_scene_file_path() : "unsaved scene"));
|
||||
|
|
|
@ -3237,11 +3237,11 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
|
|||
return editor;
|
||||
|
||||
} else if (p_hint == PROPERTY_HINT_LAYERS_2D_PHYSICS ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_2D_RENDER ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_3D_PHYSICS ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_3D_RENDER ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) {
|
||||
p_hint == PROPERTY_HINT_LAYERS_2D_RENDER ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_3D_PHYSICS ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_3D_RENDER ||
|
||||
p_hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) {
|
||||
EditorPropertyLayers::LayerType lt = EditorPropertyLayers::LAYER_RENDER_2D;
|
||||
switch (p_hint) {
|
||||
case PROPERTY_HINT_LAYERS_2D_RENDER:
|
||||
|
@ -3336,13 +3336,13 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
|
|||
}
|
||||
return 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;
|
||||
|
|
|
@ -1371,7 +1371,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;
|
||||
}
|
||||
|
|
|
@ -541,7 +541,10 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &
|
|||
|
||||
COLLADA_PRINT("node name: " + parser.get_node_name());
|
||||
|
||||
if (!parser.is_empty() && (parser.get_node_name() == "profile_COMMON" || parser.get_node_name() == "technique" || parser.get_node_name() == "extra")) {
|
||||
if (!parser.is_empty() &&
|
||||
(parser.get_node_name() == "profile_COMMON" ||
|
||||
parser.get_node_name() == "technique" ||
|
||||
parser.get_node_name() == "extra")) {
|
||||
_parse_effect_material(parser, effect, id); // try again
|
||||
|
||||
} else if (parser.get_node_name() == "newparam") {
|
||||
|
@ -551,9 +554,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) {
|
||||
|
@ -627,10 +630,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;
|
||||
}
|
||||
}
|
||||
|
@ -681,10 +685,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1650,8 +1650,7 @@ void ColladaImport::create_animation(int p_clip, bool p_import_value_tracks) {
|
|||
|
||||
Vector3 s = xform.basis.get_scale();
|
||||
bool singular_matrix = Math::is_zero_approx(s.x) || Math::is_zero_approx(s.y) || Math::is_zero_approx(s.z);
|
||||
Quaternion q = singular_matrix ? Quaternion() :
|
||||
xform.basis.get_rotation_quaternion();
|
||||
Quaternion q = singular_matrix ? Quaternion() : xform.basis.get_rotation_quaternion();
|
||||
Vector3 l = xform.origin;
|
||||
|
||||
if (position_idx >= 0) {
|
||||
|
|
|
@ -1300,27 +1300,28 @@ bool ResourceImporterScene::get_internal_option_visibility(InternalImportCategor
|
|||
if (p_option == "primitive/position" || p_option == "primitive/rotation") {
|
||||
const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int();
|
||||
return generate_physics &&
|
||||
physics_shape >= SHAPE_TYPE_BOX;
|
||||
physics_shape >= SHAPE_TYPE_BOX;
|
||||
}
|
||||
|
||||
if (p_option == "primitive/size") {
|
||||
const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int();
|
||||
return generate_physics &&
|
||||
physics_shape == SHAPE_TYPE_BOX;
|
||||
physics_shape == SHAPE_TYPE_BOX;
|
||||
}
|
||||
|
||||
if (p_option == "primitive/radius") {
|
||||
const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int();
|
||||
return generate_physics && (physics_shape == SHAPE_TYPE_SPHERE ||
|
||||
physics_shape == SHAPE_TYPE_CYLINDER ||
|
||||
physics_shape == SHAPE_TYPE_CAPSULE);
|
||||
return generate_physics &&
|
||||
(physics_shape == SHAPE_TYPE_SPHERE ||
|
||||
physics_shape == SHAPE_TYPE_CYLINDER ||
|
||||
physics_shape == SHAPE_TYPE_CAPSULE);
|
||||
}
|
||||
|
||||
if (p_option == "primitive/height") {
|
||||
const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int();
|
||||
return generate_physics &&
|
||||
(physics_shape == SHAPE_TYPE_CYLINDER ||
|
||||
physics_shape == SHAPE_TYPE_CAPSULE);
|
||||
(physics_shape == SHAPE_TYPE_CYLINDER ||
|
||||
physics_shape == SHAPE_TYPE_CAPSULE);
|
||||
}
|
||||
} break;
|
||||
case INTERNAL_IMPORT_CATEGORY_MESH: {
|
||||
|
|
|
@ -252,13 +252,13 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
|
|||
//loop point info!
|
||||
|
||||
/**
|
||||
* Consider exploring next document:
|
||||
* http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf
|
||||
* Especially on page:
|
||||
* 16 - 17
|
||||
* Timestamp:
|
||||
* 22:38 06.07.2017 GMT
|
||||
**/
|
||||
* Consider exploring next document:
|
||||
* http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf
|
||||
* Especially on page:
|
||||
* 16 - 17
|
||||
* Timestamp:
|
||||
* 22:38 06.07.2017 GMT
|
||||
**/
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
file->get_32(); // i wish to know why should i do this... no doc!
|
||||
|
|
|
@ -2983,18 +2983,16 @@ void CanvasItemEditor::_draw_ruler_tool() {
|
|||
|
||||
const Vector2 end_to_begin = (end - begin);
|
||||
|
||||
real_t 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);
|
||||
real_t 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);
|
||||
real_t arc_1_end_angle = arc_1_start_angle + vertical_angle_rad;
|
||||
// Constrain arc to triangle height & max size
|
||||
real_t arc_1_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.y)), arc_max_radius);
|
||||
|
||||
real_t 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);
|
||||
real_t 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);
|
||||
real_t arc_2_end_angle = arc_2_start_angle + horizontal_angle_rad;
|
||||
// Constrain arc to triangle width & max size
|
||||
real_t arc_2_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.x)), arc_max_radius);
|
||||
|
|
|
@ -354,9 +354,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);
|
||||
|
||||
|
|
|
@ -3641,15 +3641,15 @@ void LightmapGIGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
|
|||
const float c4 = 0.886227;
|
||||
const float c5 = 0.247708;
|
||||
Vector3 light = (c1 * sh_col[8] * (n.x * n.x - n.y * n.y) +
|
||||
c3 * sh_col[6] * n.z * n.z +
|
||||
c4 * sh_col[0] -
|
||||
c5 * sh_col[6] +
|
||||
2.0 * c1 * sh_col[4] * n.x * n.y +
|
||||
2.0 * c1 * sh_col[7] * n.x * n.z +
|
||||
2.0 * c1 * sh_col[5] * n.y * n.z +
|
||||
2.0 * c2 * sh_col[3] * n.x +
|
||||
2.0 * c2 * sh_col[1] * n.y +
|
||||
2.0 * c2 * sh_col[2] * n.z);
|
||||
c3 * sh_col[6] * n.z * n.z +
|
||||
c4 * sh_col[0] -
|
||||
c5 * sh_col[6] +
|
||||
2.0 * c1 * sh_col[4] * n.x * n.y +
|
||||
2.0 * c1 * sh_col[7] * n.x * n.z +
|
||||
2.0 * c1 * sh_col[5] * n.y * n.z +
|
||||
2.0 * c2 * sh_col[3] * n.x +
|
||||
2.0 * c2 * sh_col[1] * n.y +
|
||||
2.0 * c2 * sh_col[2] * n.z);
|
||||
|
||||
colors.push_back(Color(light.x, light.y, light.z, 1));
|
||||
}
|
||||
|
|
|
@ -1855,7 +1855,7 @@ void Node3DEditorViewport::_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) + ")");
|
||||
|
||||
List<Node *> &selection = editor_selection->get_selected_node_list();
|
||||
for (Node *E : selection) {
|
||||
|
@ -1954,7 +1954,7 @@ void Node3DEditorViewport::_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) + ")");
|
||||
|
||||
List<Node *> &selection = editor_selection->get_selected_node_list();
|
||||
for (Node *E : selection) {
|
||||
|
|
|
@ -614,15 +614,6 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) {
|
|||
menu->connect("id_pressed", callable_mp(this, &Path3DEditorPlugin::_handle_option_pressed));
|
||||
|
||||
curve_edit->set_pressed(true);
|
||||
/*
|
||||
collision_polygon_editor = memnew( PathEditor(p_node) );
|
||||
editor->get_main_control()->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();
|
||||
*/
|
||||
}
|
||||
|
||||
Path3DEditorPlugin::~Path3DEditorPlugin() {
|
||||
|
|
|
@ -315,10 +315,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_keycode() == KEY_UP ||
|
||||
k->get_keycode() == KEY_DOWN ||
|
||||
k->get_keycode() == KEY_PAGEUP ||
|
||||
k->get_keycode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_keycode() == KEY_UP || k->get_keycode() == KEY_DOWN || k->get_keycode() == KEY_PAGEUP || k->get_keycode() == KEY_PAGEDOWN)) {
|
||||
search_options->gui_input(k);
|
||||
search_box->accept_event();
|
||||
}
|
||||
|
|
|
@ -1396,11 +1396,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -3207,10 +3207,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos, VisualShaderNod
|
|||
|
||||
void VisualShaderEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> ie = p_ie;
|
||||
if (ie.is_valid() && (ie->get_keycode() == KEY_UP ||
|
||||
ie->get_keycode() == KEY_DOWN ||
|
||||
ie->get_keycode() == KEY_ENTER ||
|
||||
ie->get_keycode() == KEY_KP_ENTER)) {
|
||||
if (ie.is_valid() && (ie->get_keycode() == KEY_UP || ie->get_keycode() == KEY_DOWN || ie->get_keycode() == KEY_ENTER || ie->get_keycode() == KEY_KP_ENTER)) {
|
||||
members->gui_input(ie);
|
||||
node_filter->accept_event();
|
||||
}
|
||||
|
|
|
@ -407,11 +407,11 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
|
|||
return false;
|
||||
|
||||
} else if (hint == PROPERTY_HINT_LAYERS_2D_PHYSICS ||
|
||||
hint == PROPERTY_HINT_LAYERS_2D_RENDER ||
|
||||
hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION ||
|
||||
hint == PROPERTY_HINT_LAYERS_3D_PHYSICS ||
|
||||
hint == PROPERTY_HINT_LAYERS_3D_RENDER ||
|
||||
hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) {
|
||||
hint == PROPERTY_HINT_LAYERS_2D_RENDER ||
|
||||
hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION ||
|
||||
hint == PROPERTY_HINT_LAYERS_3D_PHYSICS ||
|
||||
hint == PROPERTY_HINT_LAYERS_3D_RENDER ||
|
||||
hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) {
|
||||
String basename;
|
||||
switch (hint) {
|
||||
case PROPERTY_HINT_LAYERS_2D_RENDER:
|
||||
|
|
|
@ -626,7 +626,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);
|
||||
(line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
|
||||
}
|
||||
|
||||
void RenameDialog::_insert_text(String text) {
|
||||
|
|
|
@ -923,7 +923,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
// Needs full refactoring to fix properly.
|
||||
main_args.push_back(I->get());
|
||||
} else if (I->get() == "--export" || I->get() == "--export-debug" ||
|
||||
I->get() == "--export-pack") { // Export project
|
||||
I->get() == "--export-pack") { // Export project
|
||||
// Actually handling is done in start().
|
||||
editor = true;
|
||||
cmdline_tool = true;
|
||||
|
@ -1308,10 +1308,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
OS::get_singleton()->_allow_hidpi = GLOBAL_DEF("display/window/dpi/allow_hidpi", false);
|
||||
}
|
||||
|
||||
/* todo restore
|
||||
OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/per_pixel_transparency/allowed", false);
|
||||
video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency/enabled", false);
|
||||
*/
|
||||
// FIXME: Restore support.
|
||||
#if 0
|
||||
//OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/per_pixel_transparency/allowed", false);
|
||||
video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency/enabled", false);
|
||||
#endif
|
||||
|
||||
if (editor || project_manager) {
|
||||
// The editor and project manager always detect and use hiDPI if needed
|
||||
OS::get_singleton()->_allow_hidpi = true;
|
||||
|
|
|
@ -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);
|
||||
|
||||
Vector<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;
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
@ -458,12 +418,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);
|
||||
}
|
||||
|
|
|
@ -70,8 +70,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
*/
|
||||
|
||||
/** @file FBXCommon.h
|
||||
* Some useful constants and enums for dealing with FBX files.
|
||||
*/
|
||||
* Some useful constants and enums for dealing with FBX files.
|
||||
*/
|
||||
#ifndef FBX_COMMON_H
|
||||
#define FBX_COMMON_H
|
||||
|
||||
|
|
|
@ -706,13 +706,13 @@ public:
|
|||
virtual ~AnimationCurve();
|
||||
|
||||
/** get list of keyframe positions (time).
|
||||
* Invariant: |GetKeys()| > 0 */
|
||||
* Invariant: |GetKeys()| > 0 */
|
||||
const KeyTimeList &GetKeys() const {
|
||||
return keys;
|
||||
}
|
||||
|
||||
/** get list of keyframe values.
|
||||
* Invariant: |GetKeys()| == |GetValues()| && |GetKeys()| > 0*/
|
||||
* Invariant: |GetKeys()| == |GetValues()| && |GetKeys()| > 0*/
|
||||
const KeyValueList &GetValues() const {
|
||||
return values;
|
||||
}
|
||||
|
@ -750,8 +750,8 @@ typedef std::weak_ptr<AnimationCurveNode> AnimationCurveNodeWeakPtr;
|
|||
class AnimationCurveNode : public Object {
|
||||
public:
|
||||
/* the optional white list specifies a list of property names for which the caller
|
||||
wants animations for. If the curve node does not match one of these, std::range_error
|
||||
will be thrown. */
|
||||
wants animations for. If the curve node does not match one of these, std::range_error
|
||||
will be thrown. */
|
||||
AnimationCurveNode(uint64_t id, const ElementPtr element, const std::string &name, const Document &doc,
|
||||
const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0);
|
||||
|
||||
|
@ -760,8 +760,8 @@ public:
|
|||
const AnimationMap &Curves() const;
|
||||
|
||||
/** Object the curve is assigned to, this can be nullptr if the
|
||||
* target object has no DOM representation or could not
|
||||
* be read for other reasons.*/
|
||||
* target object has no DOM representation or could not
|
||||
* be read for other reasons.*/
|
||||
Object *Target() const {
|
||||
return target;
|
||||
}
|
||||
|
@ -799,8 +799,8 @@ public:
|
|||
virtual ~AnimationLayer();
|
||||
|
||||
/* the optional white list specifies a list of property names for which the caller
|
||||
wants animations for. Curves not matching this list will not be added to the
|
||||
animation layer. */
|
||||
wants animations for. Curves not matching this list will not be added to the
|
||||
animation layer. */
|
||||
const AnimationCurveNodeList Nodes(const char *const *target_prop_whitelist = nullptr, size_t whitelist_size = 0) const;
|
||||
|
||||
private:
|
||||
|
@ -891,15 +891,15 @@ public:
|
|||
virtual ~Cluster();
|
||||
|
||||
/** get the list of deformer weights associated with this cluster.
|
||||
* Use #GetIndices() to get the associated vertices. Both arrays
|
||||
* have the same size (and may also be empty). */
|
||||
* Use #GetIndices() to get the associated vertices. Both arrays
|
||||
* have the same size (and may also be empty). */
|
||||
const std::vector<float> &GetWeights() const {
|
||||
return weights;
|
||||
}
|
||||
|
||||
/** get indices into the vertex data of the geometry associated
|
||||
* with this cluster. Use #GetWeights() to get the associated weights.
|
||||
* Both arrays have the same size (and may also be empty). */
|
||||
* with this cluster. Use #GetWeights() to get the associated weights.
|
||||
* Both arrays have the same size (and may also be empty). */
|
||||
const std::vector<unsigned int> &GetIndices() const {
|
||||
return indices;
|
||||
}
|
||||
|
@ -998,7 +998,7 @@ public:
|
|||
LazyObject *LazyDestinationObject() const;
|
||||
|
||||
/** return the name of the property the connection is attached to.
|
||||
* this is an empty string for object to object (OO) connections. */
|
||||
* this is an empty string for object to object (OO) connections. */
|
||||
const std::string &PropertyName() const {
|
||||
return prop;
|
||||
}
|
||||
|
|
|
@ -107,12 +107,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;
|
||||
}
|
||||
|
|
|
@ -81,29 +81,29 @@ namespace FBXDocParser {
|
|||
/** FBX import settings, parts of which are publicly accessible via their corresponding AI_CONFIG constants */
|
||||
struct ImportSettings {
|
||||
/** enable strict mode:
|
||||
* - only accept fbx 2012, 2013 files
|
||||
* - on the slightest error, give up.
|
||||
*
|
||||
* Basically, strict mode means that the fbx file will actually
|
||||
* be validated.*/
|
||||
* - only accept fbx 2012, 2013 files
|
||||
* - on the slightest error, give up.
|
||||
*
|
||||
* Basically, strict mode means that the fbx file will actually
|
||||
* be validated.*/
|
||||
bool strictMode = true;
|
||||
|
||||
/** specifies whether all geometry layers are read and scanned for
|
||||
* usable data channels. The FBX spec indicates that many readers
|
||||
* will only read the first channel and that this is in some way
|
||||
* the recommended way- in reality, however, it happens a lot that
|
||||
* vertex data is spread among multiple layers.*/
|
||||
* usable data channels. The FBX spec indicates that many readers
|
||||
* will only read the first channel and that this is in some way
|
||||
* the recommended way- in reality, however, it happens a lot that
|
||||
* vertex data is spread among multiple layers.*/
|
||||
bool readAllLayers = true;
|
||||
|
||||
/** specifies whether all materials are read, or only those that
|
||||
* are referenced by at least one mesh. Reading all materials
|
||||
* may make FBX reading a lot slower since all objects
|
||||
* need to be processed.
|
||||
* This bit is ignored unless readMaterials=true.*/
|
||||
* are referenced by at least one mesh. Reading all materials
|
||||
* may make FBX reading a lot slower since all objects
|
||||
* need to be processed.
|
||||
* This bit is ignored unless readMaterials=true.*/
|
||||
bool readAllMaterials = true;
|
||||
|
||||
/** import materials (true) or skip them and assign a default
|
||||
* material.*/
|
||||
* material.*/
|
||||
bool readMaterials = true;
|
||||
|
||||
/** import embedded textures?*/
|
||||
|
@ -116,35 +116,35 @@ struct ImportSettings {
|
|||
bool readLights = true;
|
||||
|
||||
/** import animations (i.e. animation curves, the node
|
||||
* skeleton is always imported).*/
|
||||
* skeleton is always imported).*/
|
||||
bool readAnimations = true;
|
||||
|
||||
/** read bones (vertex weights and deform info).*/
|
||||
bool readWeights = true;
|
||||
|
||||
/** preserve transformation pivots and offsets. Since these can
|
||||
* not directly be represented in assimp, additional dummy
|
||||
* nodes will be generated. Note that settings this to false
|
||||
* can make animation import a lot slower.
|
||||
*
|
||||
* The naming scheme for the generated nodes is:
|
||||
* <OriginalName>_$AssimpFbx$_<TransformName>
|
||||
*
|
||||
* where <TransformName> is one of
|
||||
* RotationPivot
|
||||
* RotationOffset
|
||||
* PreRotation
|
||||
* PostRotation
|
||||
* ScalingPivot
|
||||
* ScalingOffset
|
||||
* Translation
|
||||
* Scaling
|
||||
* Rotation
|
||||
**/
|
||||
* not directly be represented in assimp, additional dummy
|
||||
* nodes will be generated. Note that settings this to false
|
||||
* can make animation import a lot slower.
|
||||
*
|
||||
* The naming scheme for the generated nodes is:
|
||||
* <OriginalName>_$AssimpFbx$_<TransformName>
|
||||
*
|
||||
* where <TransformName> is one of
|
||||
* RotationPivot
|
||||
* RotationOffset
|
||||
* PreRotation
|
||||
* PostRotation
|
||||
* ScalingPivot
|
||||
* ScalingOffset
|
||||
* Translation
|
||||
* Scaling
|
||||
* Rotation
|
||||
**/
|
||||
bool preservePivots = true;
|
||||
|
||||
/** do not import animation curves that specify a constant
|
||||
* values matching the corresponding node transformation.*/
|
||||
* values matching the corresponding node transformation.*/
|
||||
bool optimizeEmptyAnimationCurves = true;
|
||||
|
||||
/** use legacy naming for embedded textures eg: (*0, *1, *2).*/
|
||||
|
|
|
@ -226,7 +226,7 @@ public:
|
|||
const std::vector<Vector3> &GetVertices() const;
|
||||
|
||||
/** Get a list of all vertex normals or an empty array if
|
||||
* no normals are specified. */
|
||||
* no normals are specified. */
|
||||
const std::vector<Vector3> &GetNormals() const;
|
||||
|
||||
/** Return list of vertex indices. */
|
||||
|
@ -238,8 +238,8 @@ private:
|
|||
std::vector<unsigned int> m_indices;
|
||||
};
|
||||
/**
|
||||
* DOM class for FBX geometry of type "Line"
|
||||
*/
|
||||
* DOM class for FBX geometry of type "Line"
|
||||
*/
|
||||
class LineGeometry : public Geometry {
|
||||
public:
|
||||
/** The class constructor */
|
||||
|
|
|
@ -660,13 +660,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) {
|
||||
|
|
|
@ -187,7 +187,7 @@ private:
|
|||
class Parser {
|
||||
public:
|
||||
/** Parse given a token list. Does not take ownership of the tokens -
|
||||
* the objects must persist during the entire parser lifetime */
|
||||
* the objects must persist during the entire parser lifetime */
|
||||
Parser(const TokenList &tokens, bool is_binary);
|
||||
~Parser();
|
||||
|
||||
|
|
|
@ -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]),
|
||||
|
|
|
@ -169,10 +169,10 @@ char EncodeBase64(char byte) {
|
|||
}
|
||||
|
||||
/** Encodes a block of 4 bytes to base64 encoding
|
||||
* @param bytes Bytes to encode.
|
||||
* @param out_string String to write encoded values to.
|
||||
* @param string_pos Position in out_string.
|
||||
*/
|
||||
* @param bytes Bytes to encode.
|
||||
* @param out_string String to write encoded values to.
|
||||
* @param string_pos Position in out_string.
|
||||
*/
|
||||
void EncodeByteBlock(const char *bytes, std::string &out_string, size_t string_pos) {
|
||||
char b0 = (bytes[0] & 0xFC) >> 2;
|
||||
char b1 = (bytes[0] & 0x03) << 4 | ((bytes[1] & 0xF0) >> 4);
|
||||
|
|
|
@ -87,34 +87,34 @@ namespace Util {
|
|||
const char *TokenTypeString(TokenType t);
|
||||
|
||||
/** Decode a single Base64-encoded character.
|
||||
*
|
||||
* @param ch Character to decode (from base64 to binary).
|
||||
* @return decoded byte value*/
|
||||
*
|
||||
* @param ch Character to decode (from base64 to binary).
|
||||
* @return decoded byte value*/
|
||||
uint8_t DecodeBase64(char ch);
|
||||
|
||||
/** Compute decoded size of a Base64-encoded string
|
||||
*
|
||||
* @param in Characters to decode.
|
||||
* @param inLength Number of characters to decode.
|
||||
* @return size of the decoded data (number of bytes)*/
|
||||
*
|
||||
* @param in Characters to decode.
|
||||
* @param inLength Number of characters to decode.
|
||||
* @return size of the decoded data (number of bytes)*/
|
||||
size_t ComputeDecodedSizeBase64(const char *in, size_t inLength);
|
||||
|
||||
/** Decode a Base64-encoded string
|
||||
*
|
||||
* @param in Characters to decode.
|
||||
* @param inLength Number of characters to decode.
|
||||
* @param out Pointer where we will store the decoded data.
|
||||
* @param maxOutLength Size of output buffer.
|
||||
* @return size of the decoded data (number of bytes)*/
|
||||
*
|
||||
* @param in Characters to decode.
|
||||
* @param inLength Number of characters to decode.
|
||||
* @param out Pointer where we will store the decoded data.
|
||||
* @param maxOutLength Size of output buffer.
|
||||
* @return size of the decoded data (number of bytes)*/
|
||||
size_t DecodeBase64(const char *in, size_t inLength, uint8_t *out, size_t maxOutLength);
|
||||
|
||||
char EncodeBase64(char byte);
|
||||
|
||||
/** Encode bytes in base64-encoding
|
||||
*
|
||||
* @param data Binary data to encode.
|
||||
* @param inLength Number of bytes to encode.
|
||||
* @return base64-encoded string*/
|
||||
*
|
||||
* @param data Binary data to encode.
|
||||
* @param inLength Number of bytes to encode.
|
||||
* @return base64-encoded string*/
|
||||
std::string EncodeBase64(const char *data, size_t length);
|
||||
} // namespace Util
|
||||
} // namespace FBXDocParser
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
/**
|
||||
* Import Utils
|
||||
* Conversion tools / glue code to convert from FBX to Godot
|
||||
*/
|
||||
*/
|
||||
class ImportUtils {
|
||||
public:
|
||||
/// Convert a vector from degrees to radians.
|
||||
|
@ -201,7 +201,7 @@ public:
|
|||
};
|
||||
|
||||
/** Get fbx fps for time mode meta data
|
||||
*/
|
||||
*/
|
||||
static float get_fbx_fps(int32_t time_mode) {
|
||||
switch (time_mode) {
|
||||
case AssetImportFbx::TIME_MODE_DEFAULT:
|
||||
|
@ -258,13 +258,13 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
* Find hardcoded textures from assimp which could be in many different directories
|
||||
*/
|
||||
* Find hardcoded textures from assimp which could be in many different directories
|
||||
*/
|
||||
|
||||
/**
|
||||
* set_texture_mapping_mode
|
||||
* Helper to check the mapping mode of the texture (repeat, clamp and mirror)
|
||||
*/
|
||||
* set_texture_mapping_mode
|
||||
* Helper to check the mapping mode of the texture (repeat, clamp and mirror)
|
||||
*/
|
||||
// static void set_texture_mapping_mode(aiTextureMapMode *map_mode, Ref<ImageTexture> texture) {
|
||||
// ERR_FAIL_COND(texture.is_null());
|
||||
// ERR_FAIL_COND(map_mode == nullptr);
|
||||
|
@ -282,9 +282,9 @@ public:
|
|||
// }
|
||||
|
||||
/**
|
||||
* Load or load from cache image :)
|
||||
* We need to upgrade this in the later version :) should not be hard
|
||||
*/
|
||||
* Load or load from cache image :)
|
||||
* We need to upgrade this in the later version :) should not be hard
|
||||
*/
|
||||
//static Ref<Image> load_image(ImportState &state, const aiScene *p_scene, String p_path){
|
||||
// Map<String, Ref<Image> >::Element *match = state.path_to_image_cache.find(p_path);
|
||||
|
||||
|
|
|
@ -361,13 +361,6 @@ Error PluginScript::reload(bool p_keep_state) {
|
|||
_properties_default_values[pi.name] = v["default_value"];
|
||||
}
|
||||
|
||||
#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
|
||||
|
|
|
@ -2040,15 +2040,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 {
|
||||
|
|
|
@ -3068,9 +3068,9 @@ void GDScriptParser::get_class_doc_comment(int p_line, String &p_brief, String &
|
|||
|
||||
} else {
|
||||
/* Syntax:
|
||||
@tutorial ( The Title Here ) : https://the.url/
|
||||
^ open ^ close ^ colon ^ url
|
||||
*/
|
||||
* @tutorial ( The Title Here ) : https://the.url/
|
||||
* ^ open ^ close ^ colon ^ url
|
||||
*/
|
||||
int open_bracket_pos = begin_scan, close_bracket_pos = 0;
|
||||
while (open_bracket_pos < striped_line.length() && (striped_line[open_bracket_pos] == ' ' || striped_line[open_bracket_pos] == '\t')) {
|
||||
open_bracket_pos++;
|
||||
|
|
|
@ -1110,7 +1110,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 {
|
||||
|
@ -1132,7 +1132,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
if (src->get_type() != Variant::ARRAY) {
|
||||
#ifdef DEBUG_ENABLED
|
||||
err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) +
|
||||
"' to a variable of type '" + +"'.";
|
||||
"' to a variable of type '" + +"'.";
|
||||
#endif
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
|
@ -1158,14 +1158,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
|
||||
|
@ -1195,7 +1195,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;
|
||||
}
|
||||
|
||||
|
@ -1212,7 +1212,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,21 +358,21 @@ struct Command {
|
|||
|
||||
namespace TextDocumentSyncKind {
|
||||
/**
|
||||
* Documents should not be synced at all.
|
||||
*/
|
||||
* Documents should not be synced at all.
|
||||
*/
|
||||
static const int None = 0;
|
||||
|
||||
/**
|
||||
* Documents are synced by always sending the full content
|
||||
* of the document.
|
||||
*/
|
||||
* Documents are synced by always sending the full content
|
||||
* of the document.
|
||||
*/
|
||||
static const int Full = 1;
|
||||
|
||||
/**
|
||||
* Documents are synced by sending the full content on open.
|
||||
* After that only incremental updates to the document are
|
||||
* send.
|
||||
*/
|
||||
* Documents are synced by sending the full content on open.
|
||||
* After that only incremental updates to the document are
|
||||
* send.
|
||||
*/
|
||||
static const int Incremental = 2;
|
||||
}; // namespace TextDocumentSyncKind
|
||||
|
||||
|
@ -667,20 +667,20 @@ struct TextDocumentContentChangeEvent {
|
|||
// Use namespace instead of enumeration to follow the LSP specifications
|
||||
namespace DiagnosticSeverity {
|
||||
/**
|
||||
* Reports an error.
|
||||
*/
|
||||
* Reports an error.
|
||||
*/
|
||||
static const int Error = 1;
|
||||
/**
|
||||
* Reports a warning.
|
||||
*/
|
||||
* Reports a warning.
|
||||
*/
|
||||
static const int Warning = 2;
|
||||
/**
|
||||
* Reports an information.
|
||||
*/
|
||||
* Reports an information.
|
||||
*/
|
||||
static const int Information = 3;
|
||||
/**
|
||||
* Reports a hint.
|
||||
*/
|
||||
* Reports a hint.
|
||||
*/
|
||||
static const int Hint = 4;
|
||||
}; // namespace DiagnosticSeverity
|
||||
|
||||
|
@ -871,18 +871,18 @@ static const int TypeParameter = 25;
|
|||
*/
|
||||
namespace InsertTextFormat {
|
||||
/**
|
||||
* The primary text to be inserted is treated as a plain string.
|
||||
*/
|
||||
* The primary text to be inserted is treated as a plain string.
|
||||
*/
|
||||
static const int PlainText = 1;
|
||||
|
||||
/**
|
||||
* The primary text to be inserted is treated as a snippet.
|
||||
*
|
||||
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
||||
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
||||
* the end of the snippet. Placeholders with equal identifiers are linked,
|
||||
* that is typing in one will update others too.
|
||||
*/
|
||||
* The primary text to be inserted is treated as a snippet.
|
||||
*
|
||||
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
||||
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
||||
* the end of the snippet. Placeholders with equal identifiers are linked,
|
||||
* that is typing in one will update others too.
|
||||
*/
|
||||
static const int Snippet = 2;
|
||||
}; // namespace InsertTextFormat
|
||||
|
||||
|
@ -1359,16 +1359,16 @@ struct NativeSymbolInspectParams {
|
|||
*/
|
||||
namespace FoldingRangeKind {
|
||||
/**
|
||||
* Folding range for a comment
|
||||
*/
|
||||
* Folding range for a comment
|
||||
*/
|
||||
static const String Comment = "comment";
|
||||
/**
|
||||
* Folding range for a imports or includes
|
||||
*/
|
||||
* Folding range for a imports or includes
|
||||
*/
|
||||
static const String Imports = "imports";
|
||||
/**
|
||||
* Folding range for a region (e.g. `#region`)
|
||||
*/
|
||||
* Folding range for a region (e.g. `#region`)
|
||||
*/
|
||||
static const String Region = "region";
|
||||
} // namespace FoldingRangeKind
|
||||
|
||||
|
@ -1419,20 +1419,20 @@ struct FoldingRange {
|
|||
*/
|
||||
namespace CompletionTriggerKind {
|
||||
/**
|
||||
* Completion was triggered by typing an identifier (24x7 code
|
||||
* complete), manual invocation (e.g Ctrl+Space) or via API.
|
||||
*/
|
||||
* Completion was triggered by typing an identifier (24x7 code
|
||||
* complete), manual invocation (e.g Ctrl+Space) or via API.
|
||||
*/
|
||||
static const int Invoked = 1;
|
||||
|
||||
/**
|
||||
* Completion was triggered by a trigger character specified by
|
||||
* the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
|
||||
*/
|
||||
* Completion was triggered by a trigger character specified by
|
||||
* the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
|
||||
*/
|
||||
static const int TriggerCharacter = 2;
|
||||
|
||||
/**
|
||||
* Completion was re-triggered as the current completion list is incomplete.
|
||||
*/
|
||||
* Completion was re-triggered as the current completion list is incomplete.
|
||||
*/
|
||||
static const int TriggerForIncompleteCompletions = 3;
|
||||
} // namespace CompletionTriggerKind
|
||||
|
||||
|
@ -1441,8 +1441,8 @@ static const int TriggerForIncompleteCompletions = 3;
|
|||
*/
|
||||
struct CompletionContext {
|
||||
/**
|
||||
* How the completion was triggered.
|
||||
*/
|
||||
* How the completion was triggered.
|
||||
*/
|
||||
int triggerKind = CompletionTriggerKind::TriggerCharacter;
|
||||
|
||||
/**
|
||||
|
@ -1906,7 +1906,7 @@ struct GodotNativeClassInfo {
|
|||
struct GodotCapabilities {
|
||||
/**
|
||||
* Native class list
|
||||
*/
|
||||
*/
|
||||
List<GodotNativeClassInfo> native_classes;
|
||||
|
||||
Dictionary to_json() {
|
||||
|
|
|
@ -2498,8 +2498,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) {
|
|||
ERR_FAIL_COND_V(!d.has("primitives"), ERR_PARSE_ERROR);
|
||||
|
||||
Array primitives = d["primitives"];
|
||||
const Dictionary &extras = d.has("extras") ? (Dictionary)d["extras"] :
|
||||
Dictionary();
|
||||
const Dictionary &extras = d.has("extras") ? (Dictionary)d["extras"] : Dictionary();
|
||||
Ref<ImporterMesh> import_mesh;
|
||||
import_mesh.instantiate();
|
||||
String mesh_name = "mesh";
|
||||
|
@ -5447,7 +5446,7 @@ void GLTFDocument::_convert_multi_mesh_instance_to_gltf(
|
|||
transform = 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<GLTFNode> new_gltf_node;
|
||||
new_gltf_node.instantiate();
|
||||
|
|
|
@ -73,13 +73,13 @@ class LightmapperRD : public Lightmapper {
|
|||
|
||||
bool operator==(const Vertex &p_vtx) const {
|
||||
return (position[0] == p_vtx.position[0]) &&
|
||||
(position[1] == p_vtx.position[1]) &&
|
||||
(position[2] == p_vtx.position[2]) &&
|
||||
(uv[0] == p_vtx.uv[0]) &&
|
||||
(uv[1] == p_vtx.uv[1]) &&
|
||||
(normal_xy[0] == p_vtx.normal_xy[0]) &&
|
||||
(normal_xy[1] == p_vtx.normal_xy[1]) &&
|
||||
(normal_z == p_vtx.normal_z);
|
||||
(position[1] == p_vtx.position[1]) &&
|
||||
(position[2] == p_vtx.position[2]) &&
|
||||
(uv[0] == p_vtx.uv[0]) &&
|
||||
(uv[1] == p_vtx.uv[1]) &&
|
||||
(normal_xy[0] == p_vtx.normal_xy[0]) &&
|
||||
(normal_xy[1] == p_vtx.normal_xy[1]) &&
|
||||
(normal_z == p_vtx.normal_z);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -313,22 +313,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 {
|
||||
|
@ -3265,8 +3265,7 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) {
|
|||
"Script inherits from native type '" + String(native_name) +
|
||||
"', so it can't be instantiated in object of type: '" + p_this->get_class() + "'");
|
||||
}
|
||||
ERR_FAIL_V_MSG(nullptr, "Script inherits from native type '" + String(native_name) +
|
||||
"', so it can't be instantiated in object of type: '" + p_this->get_class() + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Script inherits from native type '" + String(native_name) + "', so it can't be instantiated in object of type: '" + p_this->get_class() + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3529,10 +3528,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;
|
||||
|
|
|
@ -365,8 +365,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);
|
||||
|
||||
|
@ -1524,7 +1523,7 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte
|
|||
if (getter->return_type.cname != setter_first_arg.type.cname) {
|
||||
// Special case for Node::set_name
|
||||
bool whitelisted = getter->return_type.cname == name_cache.type_StringName &&
|
||||
setter_first_arg.type.cname == name_cache.type_String;
|
||||
setter_first_arg.type.cname == name_cache.type_String;
|
||||
|
||||
ERR_FAIL_COND_V_MSG(!whitelisted, ERR_BUG,
|
||||
"Return type from getter doesn't match first argument of setter for property: '" +
|
||||
|
@ -2481,29 +2480,29 @@ bool BindingsGenerator::_arg_default_value_is_assignable_to_type(const Variant &
|
|||
switch (p_val.get_type()) {
|
||||
case Variant::NIL:
|
||||
return p_arg_type.is_object_type ||
|
||||
name_cache.is_nullable_type(p_arg_type.name);
|
||||
name_cache.is_nullable_type(p_arg_type.name);
|
||||
case Variant::BOOL:
|
||||
return p_arg_type.name == name_cache.type_bool;
|
||||
case Variant::INT:
|
||||
return p_arg_type.name == name_cache.type_sbyte ||
|
||||
p_arg_type.name == name_cache.type_short ||
|
||||
p_arg_type.name == name_cache.type_int ||
|
||||
p_arg_type.name == name_cache.type_byte ||
|
||||
p_arg_type.name == name_cache.type_ushort ||
|
||||
p_arg_type.name == name_cache.type_uint ||
|
||||
p_arg_type.name == name_cache.type_long ||
|
||||
p_arg_type.name == name_cache.type_ulong ||
|
||||
p_arg_type.name == name_cache.type_float ||
|
||||
p_arg_type.name == name_cache.type_double ||
|
||||
p_arg_type.is_enum;
|
||||
p_arg_type.name == name_cache.type_short ||
|
||||
p_arg_type.name == name_cache.type_int ||
|
||||
p_arg_type.name == name_cache.type_byte ||
|
||||
p_arg_type.name == name_cache.type_ushort ||
|
||||
p_arg_type.name == name_cache.type_uint ||
|
||||
p_arg_type.name == name_cache.type_long ||
|
||||
p_arg_type.name == name_cache.type_ulong ||
|
||||
p_arg_type.name == name_cache.type_float ||
|
||||
p_arg_type.name == name_cache.type_double ||
|
||||
p_arg_type.is_enum;
|
||||
case Variant::FLOAT:
|
||||
return p_arg_type.name == name_cache.type_float ||
|
||||
p_arg_type.name == name_cache.type_double;
|
||||
p_arg_type.name == name_cache.type_double;
|
||||
case Variant::STRING:
|
||||
case Variant::STRING_NAME:
|
||||
return p_arg_type.name == name_cache.type_String ||
|
||||
p_arg_type.name == name_cache.type_StringName ||
|
||||
p_arg_type.name == name_cache.type_NodePath;
|
||||
p_arg_type.name == name_cache.type_StringName ||
|
||||
p_arg_type.name == name_cache.type_NodePath;
|
||||
case Variant::NODE_PATH:
|
||||
return p_arg_type.name == name_cache.type_NodePath;
|
||||
case Variant::TRANSFORM2D:
|
||||
|
@ -2535,13 +2534,13 @@ bool BindingsGenerator::_arg_default_value_is_assignable_to_type(const Variant &
|
|||
return p_arg_type.is_object_type;
|
||||
case Variant::VECTOR2I:
|
||||
return p_arg_type.name == name_cache.type_Vector2 ||
|
||||
p_arg_type.name == Variant::get_type_name(p_val.get_type());
|
||||
p_arg_type.name == Variant::get_type_name(p_val.get_type());
|
||||
case Variant::RECT2I:
|
||||
return p_arg_type.name == name_cache.type_Rect2 ||
|
||||
p_arg_type.name == Variant::get_type_name(p_val.get_type());
|
||||
p_arg_type.name == Variant::get_type_name(p_val.get_type());
|
||||
case Variant::VECTOR3I:
|
||||
return p_arg_type.name == name_cache.type_Vector3 ||
|
||||
p_arg_type.name == Variant::get_type_name(p_val.get_type());
|
||||
p_arg_type.name == Variant::get_type_name(p_val.get_type());
|
||||
default:
|
||||
CRASH_NOW_MSG("Unexpected Variant type: " + itos(p_val.get_type()));
|
||||
break;
|
||||
|
@ -2714,7 +2713,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;
|
||||
|
@ -2723,7 +2722,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
imethod.return_type.cname = return_info.class_name;
|
||||
|
||||
bool bad_reference_hint = !imethod.is_virtual && return_info.hint != PROPERTY_HINT_RESOURCE_TYPE &&
|
||||
ClassDB::is_parent_class(return_info.class_name, name_cache.type_RefCounted);
|
||||
ClassDB::is_parent_class(return_info.class_name, name_cache.type_RefCounted);
|
||||
ERR_FAIL_COND_V_MSG(bad_reference_hint, false,
|
||||
String() + "Return type is reference but hint is not '" _STR(PROPERTY_HINT_RESOURCE_TYPE) "'." +
|
||||
" Are you returning a reference type by pointer? Method: '" + itype.name + "." + imethod.name + "'.");
|
||||
|
|
|
@ -151,7 +151,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
|
||||
|
@ -592,9 +592,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);
|
||||
|
||||
|
@ -702,11 +702,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;
|
||||
}
|
||||
|
@ -754,14 +754,10 @@ 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.")))
|
||||
#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.")))
|
||||
|
||||
String dst_assemblies_dir = GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config);
|
||||
|
||||
|
@ -819,14 +815,14 @@ 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");
|
||||
|
||||
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
|
||||
|
@ -834,8 +830,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;
|
||||
}
|
||||
|
@ -852,20 +848,20 @@ 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");
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -985,7 +981,7 @@ bool GDMono::_load_tools_assemblies() {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -1363,8 +1359,8 @@ int32_t GodotSharp::get_scripts_domain_id() {
|
|||
|
||||
bool GodotSharp::is_scripts_domain_loaded() {
|
||||
return GDMono::get_singleton() != nullptr &&
|
||||
GDMono::get_singleton()->is_runtime_initialized() &&
|
||||
GDMono::get_singleton()->get_scripts_domain() != nullptr;
|
||||
GDMono::get_singleton()->is_runtime_initialized() &&
|
||||
GDMono::get_singleton()->get_scripts_domain() != nullptr;
|
||||
}
|
||||
|
||||
bool GodotSharp::_is_domain_finalizing_for_unload(int32_t p_domain_id) {
|
||||
|
|
|
@ -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() {}
|
||||
|
|
|
@ -187,7 +187,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;
|
||||
}
|
||||
|
@ -205,7 +205,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;
|
||||
}
|
||||
|
||||
|
|
|
@ -398,8 +398,7 @@ MonoArray *variant_to_mono_array(const Variant &p_var, GDMonoClass *p_type_class
|
|||
return Array_to_mono_array(p_var.operator ::Array(), array_type->eklass);
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to array of unsupported element type:" +
|
||||
GDMonoClass::get_full_name(array_type->eklass) + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to array of unsupported element type:" + GDMonoClass::get_full_name(array_type->eklass) + "'.");
|
||||
}
|
||||
|
||||
MonoObject *variant_to_mono_object_of_class(const Variant &p_var, GDMonoClass *p_type_class) {
|
||||
|
@ -432,8 +431,7 @@ MonoObject *variant_to_mono_object_of_class(const Variant &p_var, GDMonoClass *p
|
|||
return GDMonoUtils::create_managed_from(p_var.operator Array(), CACHED_CLASS(Array));
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported type: '" +
|
||||
p_type_class->get_full_name() + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported type: '" + p_type_class->get_full_name() + "'.");
|
||||
}
|
||||
|
||||
MonoObject *variant_to_mono_object_of_genericinst(const Variant &p_var, GDMonoClass *p_type_class) {
|
||||
|
@ -488,8 +486,7 @@ MonoObject *variant_to_mono_object_of_genericinst(const Variant &p_var, GDMonoCl
|
|||
return GDMonoUtils::unmanaged_get_managed(p_var.operator Object *());
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported generic type: '" +
|
||||
p_type_class->get_full_name() + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported generic type: '" + p_type_class->get_full_name() + "'.");
|
||||
}
|
||||
|
||||
MonoObject *variant_to_mono_object(const Variant &p_var) {
|
||||
|
@ -824,14 +821,12 @@ void *variant_to_managed_unboxed(const Variant &p_var, const ManagedType &p_type
|
|||
RETURN_TYPE_VAL(uint64_t, val);
|
||||
}
|
||||
default: {
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to enum value of unsupported base type: '" +
|
||||
GDMonoClass::get_full_name(mono_class_from_mono_type(enum_basetype)) + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to enum value of unsupported base type: '" + GDMonoClass::get_full_name(mono_class_from_mono_type(enum_basetype)) + "'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported value type: '" +
|
||||
p_type.type_class->get_full_name() + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported value type: '" + p_type.type_class->get_full_name() + "'.");
|
||||
} break;
|
||||
#undef RETURN_TYPE_VAL
|
||||
case MONO_TYPE_STRING:
|
||||
|
@ -847,8 +842,7 @@ void *variant_to_managed_unboxed(const Variant &p_var, const ManagedType &p_type
|
|||
return variant_to_mono_object(p_var);
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported type with encoding: " +
|
||||
itos(p_type.type_encoding) + ".");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported type with encoding: " + itos(p_type.type_encoding) + ".");
|
||||
}
|
||||
|
||||
MonoObject *variant_to_mono_object(const Variant &p_var, const ManagedType &p_type) {
|
||||
|
@ -981,14 +975,12 @@ MonoObject *variant_to_mono_object(const Variant &p_var, const ManagedType &p_ty
|
|||
return BOX_ENUM(enum_baseclass, val);
|
||||
}
|
||||
default: {
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to enum value of unsupported base type: '" +
|
||||
GDMonoClass::get_full_name(enum_baseclass) + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to enum value of unsupported base type: '" + GDMonoClass::get_full_name(enum_baseclass) + "'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported value type: '" +
|
||||
p_type.type_class->get_full_name() + "'.");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported value type: '" + p_type.type_class->get_full_name() + "'.");
|
||||
} break;
|
||||
case MONO_TYPE_STRING:
|
||||
return (MonoObject *)variant_to_mono_string(p_var);
|
||||
|
@ -1003,8 +995,7 @@ MonoObject *variant_to_mono_object(const Variant &p_var, const ManagedType &p_ty
|
|||
return variant_to_mono_object(p_var);
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported type with encoding: " +
|
||||
itos(p_type.type_encoding) + ".");
|
||||
ERR_FAIL_V_MSG(nullptr, "Attempted to convert Variant to unsupported type with 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) {
|
||||
|
@ -1271,8 +1262,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();
|
||||
}
|
||||
|
@ -1332,7 +1322,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);
|
||||
|
||||
|
@ -1354,7 +1344,7 @@ MonoObject *Dictionary_to_system_generic_dict(const Dictionary &p_dict, GDMonoCl
|
|||
Dictionary system_generic_dict_to_Dictionary(MonoObject *p_obj, [[maybe_unused]] 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);
|
||||
|
||||
|
@ -1746,12 +1736,12 @@ Callable managed_to_callable(const M_Callable &p_managed_callable) {
|
|||
CallableCustom *managed_callable = memnew(ManagedCallable(p_managed_callable.delegate));
|
||||
return Callable(managed_callable);
|
||||
} else {
|
||||
Object *target = p_managed_callable.target ?
|
||||
unbox<Object *>(CACHED_FIELD(GodotObject, ptr)->get_value(p_managed_callable.target)) :
|
||||
nullptr;
|
||||
StringName *method_ptr = p_managed_callable.method_string_name ?
|
||||
unbox<StringName *>(CACHED_FIELD(StringName, ptr)->get_value(p_managed_callable.method_string_name)) :
|
||||
nullptr;
|
||||
Object *target = p_managed_callable.target
|
||||
? unbox<Object *>(CACHED_FIELD(GodotObject, ptr)->get_value(p_managed_callable.target))
|
||||
: nullptr;
|
||||
StringName *method_ptr = p_managed_callable.method_string_name
|
||||
? unbox<StringName *>(CACHED_FIELD(StringName, ptr)->get_value(p_managed_callable.method_string_name))
|
||||
: nullptr;
|
||||
StringName method = method_ptr ? *method_ptr : StringName();
|
||||
return Callable(target, method);
|
||||
}
|
||||
|
@ -1794,12 +1784,12 @@ M_Callable callable_to_managed(const Callable &p_callable) {
|
|||
}
|
||||
|
||||
Signal managed_to_signal_info(const M_SignalInfo &p_managed_signal) {
|
||||
Object *owner = p_managed_signal.owner ?
|
||||
unbox<Object *>(CACHED_FIELD(GodotObject, ptr)->get_value(p_managed_signal.owner)) :
|
||||
nullptr;
|
||||
StringName *name_ptr = p_managed_signal.name_string_name ?
|
||||
unbox<StringName *>(CACHED_FIELD(StringName, ptr)->get_value(p_managed_signal.name_string_name)) :
|
||||
nullptr;
|
||||
Object *owner = p_managed_signal.owner
|
||||
? unbox<Object *>(CACHED_FIELD(GodotObject, ptr)->get_value(p_managed_signal.owner))
|
||||
: nullptr;
|
||||
StringName *name_ptr = p_managed_signal.name_string_name
|
||||
? unbox<StringName *>(CACHED_FIELD(StringName, ptr)->get_value(p_managed_signal.name_string_name))
|
||||
: nullptr;
|
||||
StringName name = name_ptr ? *name_ptr : StringName();
|
||||
return Signal(owner, name);
|
||||
}
|
||||
|
|
|
@ -234,58 +234,58 @@ 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_Vector2i = (MATCHES_int && (sizeof(Vector2i) == (sizeof(int32_t) * 2)) &&
|
||||
offsetof(Vector2i, x) == (sizeof(int32_t) * 0) &&
|
||||
offsetof(Vector2i, y) == (sizeof(int32_t) * 1)),
|
||||
offsetof(Vector2i, x) == (sizeof(int32_t) * 0) &&
|
||||
offsetof(Vector2i, y) == (sizeof(int32_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_Rect2i = (MATCHES_Vector2i && (sizeof(Rect2i) == (sizeof(Vector2i) * 2)) &&
|
||||
offsetof(Rect2i, position) == (sizeof(Vector2i) * 0) &&
|
||||
offsetof(Rect2i, size) == (sizeof(Vector2i) * 1)),
|
||||
offsetof(Rect2i, position) == (sizeof(Vector2i) * 0) &&
|
||||
offsetof(Rect2i, size) == (sizeof(Vector2i) * 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_Vector3i = (MATCHES_int && (sizeof(Vector3i) == (sizeof(int32_t) * 3)) &&
|
||||
offsetof(Vector3i, x) == (sizeof(int32_t) * 0) &&
|
||||
offsetof(Vector3i, y) == (sizeof(int32_t) * 1) &&
|
||||
offsetof(Vector3i, z) == (sizeof(int32_t) * 2)),
|
||||
offsetof(Vector3i, x) == (sizeof(int32_t) * 0) &&
|
||||
offsetof(Vector3i, y) == (sizeof(int32_t) * 1) &&
|
||||
offsetof(Vector3i, z) == (sizeof(int32_t) * 2)),
|
||||
|
||||
MATCHES_Basis = (MATCHES_Vector3 && (sizeof(Basis) == (sizeof(Vector3) * 3))), // No field offset required, it stores an array
|
||||
|
||||
MATCHES_Quaternion = (MATCHES_real_t && (sizeof(Quaternion) == (sizeof(real_t) * 4)) &&
|
||||
offsetof(Quaternion, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Quaternion, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Quaternion, z) == (sizeof(real_t) * 2) &&
|
||||
offsetof(Quaternion, w) == (sizeof(real_t) * 3)),
|
||||
offsetof(Quaternion, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Quaternion, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Quaternion, z) == (sizeof(real_t) * 2) &&
|
||||
offsetof(Quaternion, w) == (sizeof(real_t) * 3)),
|
||||
|
||||
MATCHES_Transform3D = (MATCHES_Basis && MATCHES_Vector3 && (sizeof(Transform3D) == (sizeof(Basis) + sizeof(Vector3))) &&
|
||||
offsetof(Transform3D, basis) == 0 &&
|
||||
offsetof(Transform3D, origin) == sizeof(Basis)),
|
||||
offsetof(Transform3D, basis) == 0 &&
|
||||
offsetof(Transform3D, 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
|
||||
|
|
|
@ -158,7 +158,7 @@ T m2n_arg_cast(Mono_InterpMethodArguments *p_margs, size_t p_idx) {
|
|||
return (T)(size_t)p_margs->iargs[p_idx];
|
||||
} else if constexpr (cookie == 'L') {
|
||||
static_assert(std::is_same_v<T, int64_t> || std::is_same_v<T, uint64_t> ||
|
||||
(sizeof(void *) == 8 && std::is_pointer_v<T>),
|
||||
(sizeof(void *) == 8 && std::is_pointer_v<T>),
|
||||
"Invalid type for cookie 'L'.");
|
||||
|
||||
union {
|
||||
|
|
|
@ -139,24 +139,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) {
|
||||
|
|
|
@ -390,15 +390,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.is_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) {
|
||||
|
|
|
@ -2370,7 +2370,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);
|
||||
|
@ -2416,21 +2415,6 @@ 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) {
|
||||
|
|
|
@ -3417,7 +3417,7 @@ void VisualScriptEditor::connect_seq(Ref<VisualScriptNode> vnode_old, Ref<Visual
|
|||
undo_redo->add_do_method(script.ptr(), "sequence_connect", port_action_node, pass_port, new_id);
|
||||
undo_redo->add_undo_method(script.ptr(), "sequence_disconnect", 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(port_action_node).has(return_port)) {
|
||||
!script->get_output_sequence_ports_connected(port_action_node).has(return_port)) {
|
||||
undo_redo->add_do_method(script.ptr(), "sequence_connect", port_action_node, return_port, new_id);
|
||||
undo_redo->add_undo_method(script.ptr(), "sequence_disconnect", port_action_node, return_port, new_id);
|
||||
} else {
|
||||
|
|
|
@ -133,28 +133,28 @@ static _WinTranslatePair _ak_to_keycode[] = {
|
|||
};
|
||||
/*
|
||||
TODO: map these android key:
|
||||
AKEYCODE_SOFT_LEFT = 1,
|
||||
AKEYCODE_SOFT_RIGHT = 2,
|
||||
AKEYCODE_CALL = 5,
|
||||
AKEYCODE_ENDCALL = 6,
|
||||
AKEYCODE_STAR = 17,
|
||||
AKEYCODE_POUND = 18,
|
||||
AKEYCODE_POWER = 26,
|
||||
AKEYCODE_CAMERA = 27,
|
||||
AKEYCODE_CLEAR = 28,
|
||||
AKEYCODE_SYM = 63,
|
||||
AKEYCODE_ENVELOPE = 65,
|
||||
AKEYCODE_GRAVE = 68,
|
||||
AKEYCODE_SEMICOLON = 74,
|
||||
AKEYCODE_APOSTROPHE = 75,
|
||||
AKEYCODE_AT = 77,
|
||||
AKEYCODE_NUM = 78,
|
||||
AKEYCODE_HEADSETHOOK = 79,
|
||||
AKEYCODE_FOCUS = 80, // *Camera* focus
|
||||
AKEYCODE_NOTIFICATION = 83,
|
||||
AKEYCODE_SEARCH = 84,
|
||||
AKEYCODE_PICTSYMBOLS = 94,
|
||||
AKEYCODE_SWITCH_CHARSET = 95,
|
||||
AKEYCODE_SOFT_LEFT = 1,
|
||||
AKEYCODE_SOFT_RIGHT = 2,
|
||||
AKEYCODE_CALL = 5,
|
||||
AKEYCODE_ENDCALL = 6,
|
||||
AKEYCODE_STAR = 17,
|
||||
AKEYCODE_POUND = 18,
|
||||
AKEYCODE_POWER = 26,
|
||||
AKEYCODE_CAMERA = 27,
|
||||
AKEYCODE_CLEAR = 28,
|
||||
AKEYCODE_SYM = 63,
|
||||
AKEYCODE_ENVELOPE = 65,
|
||||
AKEYCODE_GRAVE = 68,
|
||||
AKEYCODE_SEMICOLON = 74,
|
||||
AKEYCODE_APOSTROPHE = 75,
|
||||
AKEYCODE_AT = 77,
|
||||
AKEYCODE_NUM = 78,
|
||||
AKEYCODE_HEADSETHOOK = 79,
|
||||
AKEYCODE_FOCUS = 80, // *Camera* focus
|
||||
AKEYCODE_NOTIFICATION = 83,
|
||||
AKEYCODE_SEARCH = 84,
|
||||
AKEYCODE_PICTSYMBOLS = 94,
|
||||
AKEYCODE_SWITCH_CHARSET = 95,
|
||||
*/
|
||||
|
||||
unsigned int android_get_keysym(unsigned int p_code);
|
||||
|
|
|
@ -498,11 +498,11 @@ bool EditorExportPlatformAndroid::is_package_name_valid(const String &p_package,
|
|||
|
||||
bool EditorExportPlatformAndroid::_should_compress_asset(const String &p_path, const Vector<uint8_t> &p_data) {
|
||||
/*
|
||||
* By not compressing files with little or not benefit in doing so,
|
||||
* a performance gain is expected attime. Moreover, if the APK is
|
||||
* zip-aligned, assets stored as they are can be efficiently read by
|
||||
* Android by memory-mapping them.
|
||||
*/
|
||||
* By not compressing files with little or not benefit in doing so,
|
||||
* a performance gain is expected attime. Moreover, if the APK is
|
||||
* zip-aligned, assets stored as they are can be efficiently read by
|
||||
* Android by memory-mapping them.
|
||||
*/
|
||||
|
||||
// -- Unconditional uncompress to mimic AAPT plus some other
|
||||
|
||||
|
@ -851,16 +851,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;
|
||||
|
|
|
@ -78,14 +78,13 @@ Vector<PluginConfigAndroid> PluginConfigAndroid::get_prebuilt_plugins(String plu
|
|||
bool PluginConfigAndroid::is_plugin_config_valid(PluginConfigAndroid plugin_config) {
|
||||
bool valid_name = !plugin_config.name.is_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.is_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/driver/driver_name") == "GLES3" &&
|
||||
!ProjectSettings::get_singleton()->get("rendering/driver/fallback_to_gles2");
|
||||
!ProjectSettings::get_singleton()->get("rendering/driver/fallback_to_gles2");
|
||||
return min_gles3 ? " <uses-feature android:glEsVersion=\"0x00030000\" android:required=\"true\" />\n" : "";
|
||||
}
|
||||
|
||||
|
|
|
@ -578,8 +578,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);
|
||||
|
|
|
@ -50,9 +50,9 @@ public class GodotDownloaderService extends DownloaderService {
|
|||
};
|
||||
|
||||
/**
|
||||
* This public key comes from your Android Market publisher account, and it
|
||||
* used by the LVL to validate responses from Market on your behalf.
|
||||
*/
|
||||
* This public key comes from your Android Market publisher account, and it
|
||||
* used by the LVL to validate responses from Market on your behalf.
|
||||
*/
|
||||
@Override
|
||||
public String getPublicKey() {
|
||||
SharedPreferences prefs = getApplicationContext().getSharedPreferences("app_data_keys", Context.MODE_PRIVATE);
|
||||
|
@ -63,20 +63,20 @@ public class GodotDownloaderService extends DownloaderService {
|
|||
}
|
||||
|
||||
/**
|
||||
* This is used by the preference obfuscater to make sure that your
|
||||
* obfuscated preferences are different than the ones used by other
|
||||
* applications.
|
||||
*/
|
||||
* This is used by the preference obfuscater to make sure that your
|
||||
* obfuscated preferences are different than the ones used by other
|
||||
* applications.
|
||||
*/
|
||||
@Override
|
||||
public byte[] getSALT() {
|
||||
return SALT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill this in with the class name for your alarm receiver. We do this
|
||||
* because receivers must be unique across all of Android (it's a good idea
|
||||
* to make sure that your receiver is in your unique package)
|
||||
*/
|
||||
* Fill this in with the class name for your alarm receiver. We do this
|
||||
* because receivers must be unique across all of Android (it's a good idea
|
||||
* to make sure that your receiver is in your unique package)
|
||||
*/
|
||||
@Override
|
||||
public String getAlarmReceiverClassName() {
|
||||
Log.d("GODOT", "getAlarmReceiverClassName()");
|
||||
|
|
|
@ -210,16 +210,16 @@ public class GodotGLRenderView extends GLSurfaceView implements GodotRenderView
|
|||
*/
|
||||
|
||||
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)));
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -191,9 +191,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;
|
||||
}
|
||||
|
|
|
@ -841,7 +841,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;
|
||||
|
@ -1261,8 +1261,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;
|
||||
|
|
|
@ -140,7 +140,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
|
||||
|
|
|
@ -616,7 +616,7 @@ String DisplayServerX11::clipboard_get_primary() const {
|
|||
Bool DisplayServerX11::_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;
|
||||
}
|
||||
|
@ -2485,11 +2485,11 @@ Atom DisplayServerX11::_process_selection_request_target(Atom p_target, Window p
|
|||
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;
|
||||
|
@ -2867,7 +2867,7 @@ void DisplayServerX11::process_events() {
|
|||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2926,10 +2926,7 @@ void DisplayServerX11::process_events() {
|
|||
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;
|
||||
|
||||
|
@ -3756,18 +3753,18 @@ DisplayServerX11::WindowID DisplayServerX11::_create_window(WindowMode p_mode, V
|
|||
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, wd.x11_window, CWEventMask, &new_attr);
|
||||
|
||||
|
@ -4137,7 +4134,6 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
|
|||
}
|
||||
show_window(main_window);
|
||||
|
||||
//create RenderingDevice if used
|
||||
#if defined(VULKAN_ENABLED)
|
||||
if (rendering_driver == "vulkan") {
|
||||
//temporary
|
||||
|
@ -4148,13 +4144,6 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
|
|||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
rendering_server = memnew(RenderingServerDefault);
|
||||
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
|
||||
rendering_server = memnew(RenderingServerWrapMT(rendering_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
|
||||
}
|
||||
*/
|
||||
|
||||
{
|
||||
//set all event master mask
|
||||
XIEventMask all_master_event_mask;
|
||||
|
@ -4167,15 +4156,6 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
|
|||
XISelectEvents(x11_display, DefaultRootWindow(x11_display), &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);
|
||||
}*/
|
||||
|
||||
cursor_size = XcursorGetDefaultSize(x11_display);
|
||||
cursor_theme = XcursorGetTheme(x11_display);
|
||||
|
||||
|
|
|
@ -325,11 +325,11 @@ void EditorExportPlatformOSX::_fix_plist(const Ref<EditorExportPreset> &p_preset
|
|||
}
|
||||
|
||||
/**
|
||||
If we're running the OSX version of the Godot editor we'll:
|
||||
- export our application bundle to a temporary folder
|
||||
- attempt to code sign it
|
||||
- and then wrap it up in a DMG
|
||||
**/
|
||||
* If we're running the OSX version of the Godot editor we'll:
|
||||
* - export our application bundle to a temporary folder
|
||||
* - attempt to code sign it
|
||||
* - and then wrap it up in a DMG
|
||||
*/
|
||||
|
||||
Error EditorExportPlatformOSX::_notarize(const Ref<EditorExportPreset> &p_preset, const String &p_path) {
|
||||
#ifdef OSX_ENABLED
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue