Merge pull request #54348 from akien-mga/3.x-clang-format-dont-align-operands
This commit is contained in:
commit
14ef65e49b
137 changed files with 960 additions and 1240 deletions
|
@ -12,7 +12,7 @@ AlignAfterOpenBracket: DontAlign
|
|||
# AlignConsecutiveBitFields: None
|
||||
# AlignConsecutiveDeclarations: None
|
||||
# AlignEscapedNewlines: Right
|
||||
# AlignOperands: Align
|
||||
AlignOperands: DontAlign
|
||||
AlignTrailingComments: false
|
||||
# AllowAllArgumentsOnNextLine: true
|
||||
# AllowAllConstructorInitializersOnNextLine: true
|
||||
|
@ -56,7 +56,7 @@ AllowShortFunctionsOnASingleLine: Inline
|
|||
# BreakBeforeBraces: Attach
|
||||
# BreakBeforeInheritanceComma: false
|
||||
# BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: false
|
||||
# BreakBeforeTernaryOperators: true
|
||||
# BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: AfterColon
|
||||
# BreakStringLiterals: true
|
||||
|
|
|
@ -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 {
|
||||
|
@ -454,8 +454,8 @@ public:
|
|||
*
|
||||
* print( *k );
|
||||
* }
|
||||
*
|
||||
*/
|
||||
*
|
||||
*/
|
||||
const TKey *next(const TKey *p_key) const {
|
||||
if (unlikely(!hash_table)) {
|
||||
return nullptr;
|
||||
|
|
|
@ -42,7 +42,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;
|
||||
|
||||
|
|
|
@ -39,8 +39,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 {
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
#include "core/variant.h"
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
16
core/list.h
16
core/list.h
|
@ -176,29 +176,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;
|
||||
};
|
||||
|
|
|
@ -239,7 +239,7 @@ bool AStar::are_points_connected(int p_id, int p_with_id, bool bidirectional) co
|
|||
const Set<Segment>::Element *element = segments.find(s);
|
||||
|
||||
return element != nullptr &&
|
||||
(bidirectional || (element->get().direction & s.direction) == s.direction);
|
||||
(bidirectional || (element->get().direction & s.direction) == s.direction);
|
||||
}
|
||||
|
||||
void AStar::clear() {
|
||||
|
|
|
@ -183,7 +183,7 @@ Vector3 AABB::get_support(const Vector3 &p_normal) const {
|
|||
(p_normal.x > 0) ? -half_extents.x : half_extents.x,
|
||||
(p_normal.y > 0) ? -half_extents.y : half_extents.y,
|
||||
(p_normal.z > 0) ? -half_extents.z : half_extents.z) +
|
||||
ofs;
|
||||
ofs;
|
||||
}
|
||||
|
||||
Vector3 AABB::get_endpoint(int p_point) const {
|
||||
|
|
|
@ -58,8 +58,8 @@ void Basis::invert() {
|
|||
cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1)
|
||||
};
|
||||
real_t det = elements[0][0] * co[0] +
|
||||
elements[0][1] * co[1] +
|
||||
elements[0][2] * co[2];
|
||||
elements[0][1] * co[1] +
|
||||
elements[0][2] * co[2];
|
||||
#ifdef MATH_CHECKS
|
||||
ERR_FAIL_COND(det == 0);
|
||||
#endif
|
||||
|
@ -272,10 +272,7 @@ Vector3 Basis::get_scale() const {
|
|||
//
|
||||
// The rotation part of this decomposition is returned by get_rotation* functions.
|
||||
real_t det_sign = SGN(determinant());
|
||||
return det_sign * Vector3(
|
||||
Vector3(elements[0][0], elements[1][0], elements[2][0]).length(),
|
||||
Vector3(elements[0][1], elements[1][1], elements[2][1]).length(),
|
||||
Vector3(elements[0][2], elements[1][2], elements[2][2]).length());
|
||||
return det_sign * get_scale_abs();
|
||||
}
|
||||
|
||||
// Decomposes a Basis into a rotation-reflection matrix (an element of the group O(3)) and a positive scaling matrix as B = O.S.
|
||||
|
@ -784,9 +781,9 @@ Quat Basis::get_quat() const {
|
|||
temp[1] = ((m.elements[0][2] - m.elements[2][0]) * s);
|
||||
temp[2] = ((m.elements[1][0] - m.elements[0][1]) * s);
|
||||
} else {
|
||||
int i = m.elements[0][0] < m.elements[1][1] ?
|
||||
(m.elements[1][1] < m.elements[2][2] ? 2 : 1) :
|
||||
(m.elements[0][0] < m.elements[2][2] ? 2 : 0);
|
||||
int i = m.elements[0][0] < m.elements[1][1]
|
||||
? (m.elements[1][1] < m.elements[2][2] ? 2 : 1)
|
||||
: (m.elements[0][0] < m.elements[2][2] ? 2 : 0);
|
||||
int j = (i + 1) % 3;
|
||||
int k = (i + 2) % 3;
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ Vector3 Basis::xform_inv(const Vector3 &p_vector) const {
|
|||
|
||||
real_t Basis::determinant() const {
|
||||
return elements[0][0] * (elements[1][1] * elements[2][2] - elements[2][1] * elements[1][2]) -
|
||||
elements[1][0] * (elements[0][1] * elements[2][2] - elements[2][1] * elements[0][2]) +
|
||||
elements[2][0] * (elements[0][1] * elements[1][2] - elements[1][1] * elements[0][2]);
|
||||
elements[1][0] * (elements[0][1] * elements[2][2] - elements[2][1] * elements[0][2]) +
|
||||
elements[2][0] * (elements[0][1] * elements[1][2] - elements[1][1] * elements[0][2]);
|
||||
}
|
||||
#endif // BASIS_H
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -264,8 +264,7 @@ public:
|
|||
}
|
||||
|
||||
int32_t get_sign() const {
|
||||
return ((int64_t)high < 0) ? -1 : (high || low) ? 1 :
|
||||
0;
|
||||
return ((int64_t)high < 0) ? -1 : ((high || low) ? 1 : 0);
|
||||
}
|
||||
|
||||
bool operator<(const Int128 &b) const {
|
||||
|
@ -736,8 +735,6 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// return (numerator * b.denominator > b.numerator * denominator) ? sign : (numerator * b.denominator < b.numerator * denominator) ? -sign : 0;
|
||||
|
||||
#ifdef USE_X86_64_ASM
|
||||
|
||||
int32_t result;
|
||||
|
@ -758,10 +755,9 @@ int32_t ConvexHullInternal::Rational64::compare(const Rational64 &b) const {
|
|||
: "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy)
|
||||
: "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator)
|
||||
: "%rdx", "cc");
|
||||
return result ? result ^ sign // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
|
||||
// if sign is -1, 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
|
||||
|
||||
|
@ -794,8 +790,7 @@ int32_t ConvexHullInternal::Rational128::compare(const Rational128 &b) const {
|
|||
int32_t ConvexHullInternal::Rational128::compare(int64_t b) const {
|
||||
if (is_int_64) {
|
||||
int64_t a = sign * (int64_t)numerator.low;
|
||||
return (a > b) ? 1 : (a < b) ? -1 :
|
||||
0;
|
||||
return (a > b) ? 1 : ((a < b) ? -1 : 0);
|
||||
}
|
||||
if (b > 0) {
|
||||
if (sign <= 0) {
|
||||
|
@ -1447,8 +1442,7 @@ void ConvexHullInternal::merge(IntermediateHull &p_h0, IntermediateHull &p_h1) {
|
|||
c1->edges = e;
|
||||
return;
|
||||
} else {
|
||||
int32_t cmp = !min0 ? 1 : !min1 ? -1 :
|
||||
min_cot0.compare(min_cot1);
|
||||
int32_t cmp = !min0 ? 1 : (!min1 ? -1 : min_cot0.compare(min_cot1));
|
||||
#ifdef DEBUG_CONVEX_HULL
|
||||
printf(" -> Result %d\n", cmp);
|
||||
#endif
|
||||
|
|
|
@ -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 functio return
|
||||
* @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in functio 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 functio return
|
||||
* @param p_is_point_over array of at least 3 booleans, determining which face is over the plane, amount used in functio 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;
|
||||
|
||||
|
|
|
@ -102,10 +102,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
|
||||
|
|
|
@ -156,7 +156,7 @@ public:
|
|||
} ieee754;
|
||||
ieee754.f = p_val;
|
||||
return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 &&
|
||||
((unsigned)ieee754.u == 0);
|
||||
((unsigned)ieee754.u == 0);
|
||||
#else
|
||||
return isinf(p_val);
|
||||
#endif
|
||||
|
@ -454,7 +454,7 @@ public:
|
|||
mantissa = 0;
|
||||
}
|
||||
hf = (((uint16_t)sign) << 15) | (uint16_t)((0x1F << 10)) |
|
||||
(uint16_t)(mantissa >> 13);
|
||||
(uint16_t)(mantissa >> 13);
|
||||
}
|
||||
// check if exponent is <= -15
|
||||
else if (exp <= 0x38000000) {
|
||||
|
@ -467,8 +467,8 @@ public:
|
|||
hf = 0; //denormals do not work for 3D, convert to zero
|
||||
} else {
|
||||
hf = (((uint16_t)sign) << 15) |
|
||||
(uint16_t)((exp - 0x38000000) >> 13) |
|
||||
(uint16_t)(mantissa >> 13);
|
||||
(uint16_t)((exp - 0x38000000) >> 13) |
|
||||
(uint16_t)(mantissa >> 13);
|
||||
}
|
||||
|
||||
return hf;
|
||||
|
|
|
@ -91,7 +91,7 @@ bool Plane::intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r
|
|||
*r_result = ((vec3_cross(normal1, normal2) * p_plane0.d) +
|
||||
(vec3_cross(normal2, normal0) * p_plane1.d) +
|
||||
(vec3_cross(normal0, normal1) * p_plane2.d)) /
|
||||
denom;
|
||||
denom;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -116,8 +116,8 @@ struct Rect2 {
|
|||
|
||||
inline bool encloses(const Rect2 &p_rect) const {
|
||||
return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
|
||||
((p_rect.position.x + p_rect.size.x) <= (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) <= (position.y + size.y));
|
||||
((p_rect.position.x + p_rect.size.x) <= (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) <= (position.y + size.y));
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool has_no_area() const {
|
||||
|
@ -287,8 +287,8 @@ struct Rect2i {
|
|||
|
||||
inline bool encloses(const Rect2i &p_rect) const {
|
||||
return (p_rect.position.x >= position.x) && (p_rect.position.y >= position.y) &&
|
||||
((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
|
||||
((p_rect.position.x + p_rect.size.x) < (position.x + size.x)) &&
|
||||
((p_rect.position.y + p_rect.size.y) < (position.y + size.y));
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool has_no_area() const {
|
||||
|
|
|
@ -149,7 +149,7 @@ Vector2 Transform2D::xform(const Vector2 &p_vec) const {
|
|||
return Vector2(
|
||||
tdotx(p_vec),
|
||||
tdoty(p_vec)) +
|
||||
elements[2];
|
||||
elements[2];
|
||||
}
|
||||
Vector2 Transform2D::xform_inv(const Vector2 &p_vec) const {
|
||||
Vector2 v = p_vec - elements[2];
|
||||
|
|
|
@ -43,17 +43,14 @@ real_t Triangulate::get_area(const Vector<Vector2> &contour) {
|
|||
}
|
||||
|
||||
/*
|
||||
is_inside_triangle decides if a point P is Inside of the triangle
|
||||
defined by A, B, C.
|
||||
*/
|
||||
|
||||
* `is_inside_triangle` decides if a point P is inside the triangle
|
||||
* defined by A, B, C.
|
||||
*/
|
||||
bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay,
|
||||
real_t Bx, real_t By,
|
||||
real_t Cx, real_t Cy,
|
||||
real_t Px, real_t Py,
|
||||
bool include_edges)
|
||||
|
||||
{
|
||||
bool include_edges) {
|
||||
real_t ax, ay, bx, by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
|
||||
real_t cCROSSap, bCROSScp, aCROSSbp;
|
||||
|
||||
|
@ -79,7 +76,7 @@ bool Triangulate::is_inside_triangle(real_t Ax, real_t Ay,
|
|||
} else {
|
||||
return ((aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
bool Triangulate::snip(const Vector<Vector2> &p_contour, int u, int v, int w, int n, const Vector<int> &V, bool relaxed) {
|
||||
int p;
|
||||
|
|
|
@ -149,10 +149,11 @@ Vector2 Vector2::cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, c
|
|||
real_t t3 = t2 * t;
|
||||
|
||||
Vector2 out;
|
||||
out = 0.5 * ((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
out = 0.5 *
|
||||
((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,10 +88,11 @@ Vector3 Vector3::cubic_interpolaten(const Vector3 &p_b, const Vector3 &p_pre_a,
|
|||
real_t t3 = t2 * t;
|
||||
|
||||
Vector3 out;
|
||||
out = 0.5 * ((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
out = 0.5 *
|
||||
((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -106,10 +107,11 @@ Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, c
|
|||
real_t t3 = t2 * t;
|
||||
|
||||
Vector3 out;
|
||||
out = 0.5 * ((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
out = 0.5 *
|
||||
((p1 * 2.0) +
|
||||
(-p0 + p2) * t +
|
||||
(2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -1526,9 +1526,10 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const
|
|||
Signal *s = signal_map.getptr(p_signal);
|
||||
if (!s) {
|
||||
bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal) ||
|
||||
(!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal));
|
||||
ERR_FAIL_COND_MSG(signal_is_valid, vformat("Attempt to disconnect a nonexistent connection to signal '%s' in %s, with target '%s' in %s.",
|
||||
p_signal, to_string(), p_to_method, p_to_object->to_string()));
|
||||
(!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal));
|
||||
ERR_FAIL_COND_MSG(signal_is_valid,
|
||||
vformat("Attempt to disconnect a nonexistent connection to signal '%s' in %s, with target '%s' in %s.",
|
||||
p_signal, to_string(), p_to_method, p_to_object->to_string()));
|
||||
}
|
||||
ERR_FAIL_COND_MSG(!s, vformat("Disconnecting nonexistent signal '%s' in %s.", p_signal, to_string()));
|
||||
|
||||
|
|
|
@ -136,10 +136,11 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
|
|||
const String quote_style = EDITOR_DEF("text_editor/completion/use_single_quotes", false) ? "'" : "\"";
|
||||
|
||||
String pf = p_function;
|
||||
if (p_idx == 0 && (pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" ||
|
||||
pf == "is_action_just_pressed" || pf == "is_action_just_released" ||
|
||||
pf == "get_action_strength" || pf == "get_action_raw_strength" ||
|
||||
pf == "get_axis" || pf == "get_vector")) {
|
||||
if (p_idx == 0 &&
|
||||
(pf == "is_action_pressed" || pf == "action_press" || pf == "action_release" ||
|
||||
pf == "is_action_just_pressed" || pf == "is_action_just_released" ||
|
||||
pf == "get_action_strength" || pf == "get_action_raw_strength" ||
|
||||
pf == "get_axis" || pf == "get_vector")) {
|
||||
List<PropertyInfo> pinfo;
|
||||
ProjectSettings::get_singleton()->get_property_list(&pinfo);
|
||||
|
||||
|
|
|
@ -331,10 +331,10 @@ bool InputEventKey::shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_
|
|||
|
||||
if (scancode == 0) {
|
||||
return physical_scancode == key->physical_scancode &&
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
} else {
|
||||
return scancode == key->scancode &&
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -497,7 +497,7 @@ bool InputEventMouseButton::shortcut_match(const Ref<InputEvent> &p_event, bool
|
|||
}
|
||||
|
||||
return button_index == mb->button_index &&
|
||||
(!p_exact_match || get_modifiers_mask() == mb->get_modifiers_mask());
|
||||
(!p_exact_match || get_modifiers_mask() == mb->get_modifiers_mask());
|
||||
}
|
||||
|
||||
String InputEventMouseButton::as_text() const {
|
||||
|
@ -773,7 +773,7 @@ bool InputEventJoypadMotion::shortcut_match(const Ref<InputEvent> &p_event, bool
|
|||
}
|
||||
|
||||
return axis == jm->axis &&
|
||||
(!p_exact_match || ((axis_value < 0) == (jm->axis_value < 0)));
|
||||
(!p_exact_match || ((axis_value < 0) == (jm->axis_value < 0)));
|
||||
}
|
||||
|
||||
String InputEventJoypadMotion::as_text() const {
|
||||
|
|
|
@ -66,18 +66,12 @@ String OS::get_iso_date_time(bool local) const {
|
|||
timezone = "Z";
|
||||
}
|
||||
|
||||
return itos(date.year).pad_zeros(2) +
|
||||
"-" +
|
||||
itos(date.month).pad_zeros(2) +
|
||||
"-" +
|
||||
itos(date.day).pad_zeros(2) +
|
||||
"T" +
|
||||
itos(time.hour).pad_zeros(2) +
|
||||
":" +
|
||||
itos(time.min).pad_zeros(2) +
|
||||
":" +
|
||||
itos(time.sec).pad_zeros(2) +
|
||||
timezone;
|
||||
return itos(date.year).pad_zeros(2) + "-" +
|
||||
itos(date.month).pad_zeros(2) + "-" +
|
||||
itos(date.day).pad_zeros(2) + "T" +
|
||||
itos(time.hour).pad_zeros(2) + ":" +
|
||||
itos(time.min).pad_zeros(2) + ":" +
|
||||
itos(time.sec).pad_zeros(2) + timezone;
|
||||
}
|
||||
|
||||
uint64_t OS::get_splash_tick_msec() const {
|
||||
|
|
|
@ -60,7 +60,7 @@ struct TypeInherits {
|
|||
static char (&test(...))[2];
|
||||
|
||||
static bool const value = sizeof(test(get_d())) == sizeof(char) &&
|
||||
!TypesAreSame<B volatile const, void volatile const>::value;
|
||||
!TypesAreSame<B volatile const, void volatile const>::value;
|
||||
};
|
||||
|
||||
namespace GodotTypeInfo {
|
||||
|
|
131
core/ustring.cpp
131
core/ustring.cpp
|
@ -310,14 +310,6 @@ String String::operator+(const String &p_str) const {
|
|||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
String String::operator+(CharType p_chr) const {
|
||||
|
||||
String res=*this;
|
||||
res+=p_chr;
|
||||
return res;
|
||||
}
|
||||
*/
|
||||
String &String::operator+=(const String &p_str) {
|
||||
if (empty()) {
|
||||
*this = p_str;
|
||||
|
@ -1675,14 +1667,6 @@ CharString String::utf8() const {
|
|||
return utf8s;
|
||||
}
|
||||
|
||||
/*
|
||||
String::String(CharType p_char) {
|
||||
|
||||
shared=NULL;
|
||||
copy_from(p_char);
|
||||
}
|
||||
*/
|
||||
|
||||
String::String(const char *p_str) {
|
||||
copy_from(p_str);
|
||||
}
|
||||
|
@ -1937,28 +1921,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-NULL, 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,
|
||||
|
@ -1973,25 +1962,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') {
|
||||
|
@ -2008,9 +2000,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) {
|
||||
|
@ -2025,11 +2017,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;
|
||||
|
@ -2075,8 +2067,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')) {
|
||||
|
@ -2106,10 +2098,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;
|
||||
|
@ -2154,7 +2146,6 @@ done:
|
|||
double String::to_double(const char *p_str) {
|
||||
#ifndef NO_USE_STDLIB
|
||||
return built_in_strtod<char>(p_str);
|
||||
//return atof(p_str); DOES NOT WORK ON ANDROID(??)
|
||||
#else
|
||||
return built_in_strtod<char>(p_str);
|
||||
#endif
|
||||
|
|
|
@ -2777,7 +2777,7 @@ bool Variant::hash_compare(const Variant &p_variant) const {
|
|||
const Rect2 *r = reinterpret_cast<const Rect2 *>(p_variant._data._mem);
|
||||
|
||||
return (hash_compare_vector2(l->position, r->position)) &&
|
||||
(hash_compare_vector2(l->size, r->size));
|
||||
(hash_compare_vector2(l->size, r->size));
|
||||
} break;
|
||||
|
||||
case TRANSFORM2D: {
|
||||
|
@ -2805,7 +2805,7 @@ bool Variant::hash_compare(const Variant &p_variant) const {
|
|||
const Plane *r = reinterpret_cast<const Plane *>(p_variant._data._mem);
|
||||
|
||||
return (hash_compare_vector3(l->normal, r->normal)) &&
|
||||
(hash_compare_scalar(l->d, r->d));
|
||||
(hash_compare_scalar(l->d, r->d));
|
||||
} break;
|
||||
|
||||
case AABB: {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* @class Vector
|
||||
* @author Juan Linietsky
|
||||
* Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use PoolVector for large arrays.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "core/cowdata.h"
|
||||
#include "core/error_macros.h"
|
||||
|
|
|
@ -838,10 +838,9 @@ void RasterizerCanvasBaseGLES2::canvas_light_shadow_buffer_update(RID p_buffer,
|
|||
|
||||
if (transformed_cull_cache != VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
|
||||
(p_light_xform.basis_determinant() * instance->xform_cache.basis_determinant()) < 0) {
|
||||
transformed_cull_cache =
|
||||
transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
transformed_cull_cache = (transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE)
|
||||
? VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE
|
||||
: VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
}
|
||||
|
||||
if (cull != transformed_cull_cache) {
|
||||
|
|
|
@ -172,7 +172,7 @@ void main() {
|
|||
vec3(1.00000, 1.00000, 1.00000),
|
||||
vec3(0.00000, -0.34413, 1.77200),
|
||||
vec3(1.40200, -0.71414, 0.00000)) *
|
||||
color.rgb;
|
||||
color.rgb;
|
||||
#endif
|
||||
|
||||
#ifdef USE_NO_ALPHA
|
||||
|
|
|
@ -1004,7 +1004,7 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture2D(tex, p0) + g1x * texture2D(tex, p1))) +
|
||||
(g1(fuv.y) * (g0x * texture2D(tex, p2) + g1x * texture2D(tex, p3)));
|
||||
(g1(fuv.y) * (g0x * texture2D(tex, p2) + g1x * texture2D(tex, p3)));
|
||||
}
|
||||
#endif //USE_LIGHTMAP_FILTER_BICUBIC
|
||||
#endif
|
||||
|
@ -1544,7 +1544,7 @@ float sample_shadow(highp sampler2D shadow, highp vec4 spos) {
|
|||
SAMPLE_SHADOW_TEXEL(shadow, pos + vec2(2.0 * shadow_pixel_size.x, 2.0 * shadow_pixel_size.y), depth),
|
||||
f.x),
|
||||
f.y)) *
|
||||
(1.0 / 9.0);
|
||||
(1.0 / 9.0);
|
||||
#endif
|
||||
|
||||
#ifdef SHADOW_MODE_PCF_5
|
||||
|
|
|
@ -317,7 +317,7 @@ highp mat3 inverse(highp mat3 m) {
|
|||
return mat3(c01, (-m[2].z * m[0].y + m[0].z * m[2].y), (m[1].z * m[0].y - m[0].z * m[1].y),
|
||||
c11, (m[2].z * m[0].x - m[0].z * m[2].x), (-m[1].z * m[0].x + m[0].z * m[1].x),
|
||||
c21, (-m[2].y * m[0].x + m[0].y * m[2].x), (m[1].y * m[0].x - m[0].y * m[1].x)) *
|
||||
d;
|
||||
d;
|
||||
}
|
||||
|
||||
highp mat4 inverse(highp mat4 m) {
|
||||
|
|
|
@ -168,7 +168,7 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv, int p_lod) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture2DLod(tex, p0, lod) + g1x * texture2DLod(tex, p1, lod))) +
|
||||
(g1(fuv.y) * (g0x * texture2DLod(tex, p2, lod) + g1x * texture2DLod(tex, p3, lod)));
|
||||
(g1(fuv.y) * (g0x * texture2DLod(tex, p2, lod) + g1x * texture2DLod(tex, p3, lod)));
|
||||
}
|
||||
|
||||
#define GLOW_TEXTURE_SAMPLE(m_tex, m_uv, m_lod) texture2D_bicubic(m_tex, m_uv, m_lod)
|
||||
|
@ -244,18 +244,17 @@ vec3 apply_fxaa(vec3 color, vec2 uv_interp, vec2 pixel_size) {
|
|||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
FXAA_REDUCE_MIN);
|
||||
|
||||
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
|
||||
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
|
||||
dir * rcpDirMin)) *
|
||||
pixel_size;
|
||||
pixel_size;
|
||||
|
||||
vec3 rgbA = 0.5 * (texture2DLod(source, uv_interp + dir * (1.0 / 3.0 - 0.5), 0.0).xyz + texture2DLod(source, uv_interp + dir * (2.0 / 3.0 - 0.5), 0.0).xyz);
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * (texture2DLod(source, uv_interp + dir * -0.5, 0.0).xyz +
|
||||
texture2DLod(source, uv_interp + dir * 0.5, 0.0).xyz);
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * (texture2DLod(source, uv_interp + dir * -0.5, 0.0).xyz + texture2DLod(source, uv_interp + dir * 0.5, 0.0).xyz);
|
||||
|
||||
float lumaB = dot(rgbB, luma);
|
||||
if ((lumaB < lumaMin) || (lumaB > lumaMax)) {
|
||||
|
|
|
@ -897,10 +897,9 @@ void RasterizerCanvasBaseGLES3::canvas_light_shadow_buffer_update(RID p_buffer,
|
|||
|
||||
if (transformed_cull_cache != VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED &&
|
||||
(p_light_xform.basis_determinant() * instance->xform_cache.basis_determinant()) < 0) {
|
||||
transformed_cull_cache =
|
||||
transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE ?
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE :
|
||||
VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
transformed_cull_cache = (transformed_cull_cache == VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE)
|
||||
? VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE
|
||||
: VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE;
|
||||
}
|
||||
|
||||
if (cull != transformed_cull_cache) {
|
||||
|
|
|
@ -1192,9 +1192,9 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
|
|||
uint32_t a = px >> 30 & 0xFF;
|
||||
|
||||
ptr[ofs] = (px >> 2 & 0xFF) |
|
||||
(px >> 12 & 0xFF) << 8 |
|
||||
(px >> 22 & 0xFF) << 16 |
|
||||
(a | a << 2 | a << 4 | a << 6) << 24;
|
||||
(px >> 12 & 0xFF) << 8 |
|
||||
(px >> 22 & 0xFF) << 16 |
|
||||
(a | a << 2 | a << 4 | a << 6) << 24;
|
||||
}
|
||||
} else {
|
||||
img_format = real_format;
|
||||
|
|
|
@ -253,28 +253,28 @@ VERTEX_SHADER_CODE
|
|||
m = mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.x;
|
||||
bone_weights.x;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.y % 256, (bone_indicesi.y / 256) * 2);
|
||||
|
||||
m += mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.y;
|
||||
bone_weights.y;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.z % 256, (bone_indicesi.z / 256) * 2);
|
||||
|
||||
m += mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.z;
|
||||
bone_weights.z;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.w % 256, (bone_indicesi.w / 256) * 2);
|
||||
|
||||
m += mat2x4(
|
||||
texelFetch(skeleton_texture, tex_ofs, 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0)) *
|
||||
bone_weights.w;
|
||||
bone_weights.w;
|
||||
|
||||
mat4 bone_matrix = skeleton_transform * transpose(mat4(m[0], m[1], vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0))) * skeleton_transform_inverse;
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ void main() {
|
|||
vec3(1.00000, 1.00000, 1.00000),
|
||||
vec3(0.00000, -0.18732, 1.85560),
|
||||
vec3(1.57481, -0.46813, 0.00000)) *
|
||||
color.rgb;
|
||||
color.rgb;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.x;
|
||||
bone_weights.x;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.y % 256, (bone_indicesi.y / 256) * 3);
|
||||
|
||||
|
@ -457,7 +457,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.y;
|
||||
bone_weights.y;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.z % 256, (bone_indicesi.z / 256) * 3);
|
||||
|
||||
|
@ -466,7 +466,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.z;
|
||||
bone_weights.z;
|
||||
|
||||
tex_ofs = ivec2(bone_indicesi.w % 256, (bone_indicesi.w / 256) * 3);
|
||||
|
||||
|
@ -475,7 +475,7 @@ void main() {
|
|||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 1), 0),
|
||||
texelFetch(skeleton_texture, tex_ofs + ivec2(0, 2), 0),
|
||||
vec4(0.0, 0.0, 0.0, 1.0)) *
|
||||
bone_weights.w;
|
||||
bone_weights.w;
|
||||
|
||||
world_matrix = world_matrix * transpose(m);
|
||||
}
|
||||
|
@ -1562,7 +1562,7 @@ vec4 texture_bicubic(sampler2D tex, vec2 uv) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture(tex, p0) + g1x * texture(tex, p1))) +
|
||||
(g1(fuv.y) * (g0x * texture(tex, p2) + g1x * texture(tex, p3)));
|
||||
(g1(fuv.y) * (g0x * texture(tex, p2) + g1x * texture(tex, p3)));
|
||||
}
|
||||
|
||||
vec4 textureArray_bicubic(sampler2DArray tex, vec3 uv) {
|
||||
|
@ -1586,7 +1586,7 @@ vec4 textureArray_bicubic(sampler2DArray tex, vec3 uv) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture(tex, vec3(p0, uv.z)) + g1x * texture(tex, vec3(p1, uv.z)))) +
|
||||
(g1(fuv.y) * (g0x * texture(tex, vec3(p2, uv.z)) + g1x * texture(tex, vec3(p3, uv.z))));
|
||||
(g1(fuv.y) * (g0x * texture(tex, vec3(p2, uv.z)) + g1x * texture(tex, vec3(p3, uv.z))));
|
||||
}
|
||||
|
||||
#define LIGHTMAP_TEXTURE_SAMPLE(m_tex, m_uv) texture_bicubic(m_tex, m_uv)
|
||||
|
|
|
@ -123,7 +123,7 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv, int p_lod) {
|
|||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - vec2(0.5f)) * texel_size;
|
||||
|
||||
return (g0(fuv.y) * (g0x * textureLod(tex, p0, lod) + g1x * textureLod(tex, p1, lod))) +
|
||||
(g1(fuv.y) * (g0x * textureLod(tex, p2, lod) + g1x * textureLod(tex, p3, lod)));
|
||||
(g1(fuv.y) * (g0x * textureLod(tex, p2, lod) + g1x * textureLod(tex, p3, lod)));
|
||||
}
|
||||
|
||||
#define GLOW_TEXTURE_SAMPLE(m_tex, m_uv, m_lod) texture2D_bicubic(m_tex, m_uv, m_lod)
|
||||
|
@ -332,14 +332,14 @@ vec3 apply_fxaa(vec3 color, float exposure, vec2 uv_interp, vec2 pixel_size) {
|
|||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||||
|
||||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
(0.25 * FXAA_REDUCE_MUL),
|
||||
FXAA_REDUCE_MIN);
|
||||
|
||||
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||||
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
|
||||
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
|
||||
dir * rcpDirMin)) *
|
||||
pixel_size;
|
||||
pixel_size;
|
||||
|
||||
vec3 rgbA = 0.5 * exposure * (textureLod(source, uv_interp + dir * (1.0 / 3.0 - 0.5), 0.0).xyz + textureLod(source, uv_interp + dir * (2.0 / 3.0 - 0.5), 0.0).xyz);
|
||||
vec3 rgbB = rgbA * 0.5 + 0.25 * exposure * (textureLod(source, uv_interp + dir * -0.5, 0.0).xyz + textureLod(source, uv_interp + dir * 0.5, 0.0).xyz);
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* Fast single-threaded growable array for POD types.
|
||||
* For use in render drivers, not for general use.
|
||||
* TO BE REPLACED by local_vector.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "core/os/memory.h"
|
||||
#include "core/vector.h"
|
||||
|
|
|
@ -552,9 +552,9 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &
|
|||
COLLADA_PRINT("param: " + name + " value:" + String(value));
|
||||
|
||||
} else if (parser.get_node_name() == "constant" ||
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn") {
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn") {
|
||||
COLLADA_PRINT("shade model: " + parser.get_node_name());
|
||||
while (parser.read() == OK) {
|
||||
if (parser.get_node_type() == XMLParser::NODE_ELEMENT) {
|
||||
|
@ -628,10 +628,11 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &
|
|||
} else if (what == "shininess") {
|
||||
effect.shininess = _parse_param(parser);
|
||||
}
|
||||
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && (parser.get_node_name() == "constant" ||
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn")) {
|
||||
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END &&
|
||||
(parser.get_node_name() == "constant" ||
|
||||
parser.get_node_name() == "lambert" ||
|
||||
parser.get_node_name() == "phong" ||
|
||||
parser.get_node_name() == "blinn")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -682,10 +683,10 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &
|
|||
parser.skip_section();
|
||||
}
|
||||
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END &&
|
||||
(parser.get_node_name() == "effect" ||
|
||||
parser.get_node_name() == "profile_COMMON" ||
|
||||
parser.get_node_name() == "technique" ||
|
||||
parser.get_node_name() == "extra")) {
|
||||
(parser.get_node_name() == "effect" ||
|
||||
parser.get_node_name() == "profile_COMMON" ||
|
||||
parser.get_node_name() == "technique" ||
|
||||
parser.get_node_name() == "extra")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,10 +124,7 @@ void CreateDialog::_text_changed(const String &p_newtext) {
|
|||
|
||||
void CreateDialog::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> k = p_ie;
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP ||
|
||||
k->get_scancode() == KEY_DOWN ||
|
||||
k->get_scancode() == KEY_PAGEUP ||
|
||||
k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_PAGEUP || k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
search_options->call("_gui_input", k);
|
||||
search_box->accept_event();
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ EditorAbout::EditorAbout() {
|
|||
Label *about_text = memnew(Label);
|
||||
about_text->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
|
||||
about_text->set_text(String::utf8("\xc2\xa9 2007-2021 Juan Linietsky, Ariel Manzur.\n\xc2\xa9 2014-2021 ") +
|
||||
TTR("Godot Engine contributors") + "\n");
|
||||
TTR("Godot Engine contributors") + "\n");
|
||||
version_info_vbc->add_child(about_text);
|
||||
|
||||
hbc->add_child(version_info_vbc);
|
||||
|
|
|
@ -4817,9 +4817,9 @@ void EditorNode::_scene_tab_closed(int p_tab, int option) {
|
|||
return;
|
||||
}
|
||||
|
||||
bool unsaved = (p_tab == editor_data.get_edited_scene()) ?
|
||||
saved_version != editor_data.get_undo_redo().get_version() :
|
||||
editor_data.get_scene_version(p_tab) != 0;
|
||||
bool unsaved = (p_tab == editor_data.get_edited_scene())
|
||||
? saved_version != editor_data.get_undo_redo().get_version()
|
||||
: editor_data.get_scene_version(p_tab) != 0;
|
||||
if (unsaved) {
|
||||
save_confirmation->get_ok()->set_text(TTR("Save & Close"));
|
||||
save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene->get_filename() != "" ? scene->get_filename() : "unsaved scene"));
|
||||
|
|
|
@ -2719,13 +2719,13 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
|
|||
}
|
||||
add_property_editor(p_path, editor);
|
||||
} else if (p_hint == PROPERTY_HINT_METHOD_OF_VARIANT_TYPE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_SCRIPT ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) {
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_METHOD_OF_SCRIPT ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_BASE_TYPE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE ||
|
||||
p_hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) {
|
||||
EditorPropertyMember *editor = memnew(EditorPropertyMember);
|
||||
|
||||
EditorPropertyMember::Type type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE;
|
||||
|
|
|
@ -1336,7 +1336,7 @@ void FileSystemDock::_make_dir_confirm() {
|
|||
EditorNode::get_singleton()->show_warning(TTR("No name provided."));
|
||||
return;
|
||||
} else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.find("*") != -1 ||
|
||||
dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) {
|
||||
dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters."));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -409,7 +409,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
|||
tex_flags |= Texture::FLAG_REPEAT;
|
||||
|
||||
const bool min_gles3 = GLOBAL_GET("rendering/quality/driver/driver_name") == "GLES3" &&
|
||||
!GLOBAL_GET("rendering/quality/driver/fallback_to_gles2");
|
||||
!GLOBAL_GET("rendering/quality/driver/fallback_to_gles2");
|
||||
if (!min_gles3 && !image->is_size_po2()) {
|
||||
// The project can be run using GLES2. GLES2 does not guarantee that
|
||||
// repeating textures with a non-power-of-two size will be displayed
|
||||
|
|
|
@ -249,13 +249,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!
|
||||
|
|
|
@ -3175,18 +3175,16 @@ void CanvasItemEditor::_draw_ruler_tool() {
|
|||
|
||||
const Vector2 end_to_begin = (end - begin);
|
||||
|
||||
float arc_1_start_angle =
|
||||
end_to_begin.x < 0 ?
|
||||
(end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 - vertical_angle_rad : Math_PI / 2.0) :
|
||||
(end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 : Math_PI / 2.0 - vertical_angle_rad);
|
||||
float arc_1_start_angle = end_to_begin.x < 0
|
||||
? (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 - vertical_angle_rad : Math_PI / 2.0)
|
||||
: (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 : Math_PI / 2.0 - vertical_angle_rad);
|
||||
float arc_1_end_angle = arc_1_start_angle + vertical_angle_rad;
|
||||
// Constrain arc to triangle height & max size
|
||||
float arc_1_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.y)), arc_max_radius);
|
||||
|
||||
float arc_2_start_angle =
|
||||
end_to_begin.x < 0 ?
|
||||
(end_to_begin.y < 0 ? 0.0 : -horizontal_angle_rad) :
|
||||
(end_to_begin.y < 0 ? Math_PI - horizontal_angle_rad : Math_PI);
|
||||
float arc_2_start_angle = end_to_begin.x < 0
|
||||
? (end_to_begin.y < 0 ? 0.0 : -horizontal_angle_rad)
|
||||
: (end_to_begin.y < 0 ? Math_PI - horizontal_angle_rad : Math_PI);
|
||||
float arc_2_end_angle = arc_2_start_angle + horizontal_angle_rad;
|
||||
// Constrain arc to triangle width & max size
|
||||
float arc_2_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.x)), arc_max_radius);
|
||||
|
@ -5198,10 +5196,6 @@ void CanvasItemEditor::_popup_callback(int p_op) {
|
|||
if (key_pos) {
|
||||
ctrl->set_position(Point2());
|
||||
}
|
||||
/*
|
||||
if (key_scale)
|
||||
AnimationPlayerEditor::singleton->get_track_editor()->insert_node_value_key(ctrl,"rect/size",ctrl->get_size());
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6519,13 +6513,13 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian
|
|||
}
|
||||
memdelete(instanced_scene);
|
||||
} else if (type == "Texture" ||
|
||||
type == "ImageTexture" ||
|
||||
type == "ViewportTexture" ||
|
||||
type == "CurveTexture" ||
|
||||
type == "GradientTexture" ||
|
||||
type == "StreamTexture" ||
|
||||
type == "AtlasTexture" ||
|
||||
type == "LargeTexture") {
|
||||
type == "ImageTexture" ||
|
||||
type == "ViewportTexture" ||
|
||||
type == "CurveTexture" ||
|
||||
type == "GradientTexture" ||
|
||||
type == "StreamTexture" ||
|
||||
type == "AtlasTexture" ||
|
||||
type == "LargeTexture") {
|
||||
Ref<Texture> texture = Ref<Texture>(Object::cast_to<Texture>(*res));
|
||||
if (!texture.is_valid()) {
|
||||
continue;
|
||||
|
|
|
@ -352,9 +352,9 @@ void CurveEditor::open_context_menu(Vector2 pos) {
|
|||
|
||||
_context_menu->add_check_item(TTR("Linear"), CONTEXT_LINEAR);
|
||||
|
||||
bool is_linear = _selected_tangent == TANGENT_LEFT ?
|
||||
_curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR :
|
||||
_curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
|
||||
bool is_linear = _selected_tangent == TANGENT_LEFT
|
||||
? _curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR
|
||||
: _curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR;
|
||||
|
||||
_context_menu->set_item_checked(_context_menu->get_item_index(CONTEXT_LINEAR), is_linear);
|
||||
|
||||
|
|
|
@ -606,15 +606,6 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
|
|||
menu->connect("id_pressed", this, "_handle_option_pressed");
|
||||
|
||||
curve_edit->set_pressed(true);
|
||||
/*
|
||||
collision_polygon_editor = memnew( PathEditor(p_node) );
|
||||
editor->get_viewport()->add_child(collision_polygon_editor);
|
||||
collision_polygon_editor->set_margin(MARGIN_LEFT,200);
|
||||
collision_polygon_editor->set_margin(MARGIN_RIGHT,230);
|
||||
collision_polygon_editor->set_margin(MARGIN_TOP,0);
|
||||
collision_polygon_editor->set_margin(MARGIN_BOTTOM,10);
|
||||
collision_polygon_editor->hide();
|
||||
*/
|
||||
}
|
||||
|
||||
PathEditorPlugin::~PathEditorPlugin() {
|
||||
|
|
|
@ -156,10 +156,7 @@ void ScriptEditorQuickOpen::_text_changed(const String &p_newtext) {
|
|||
void ScriptEditorQuickOpen::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> k = p_ie;
|
||||
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP ||
|
||||
k->get_scancode() == KEY_DOWN ||
|
||||
k->get_scancode() == KEY_PAGEUP ||
|
||||
k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_PAGEUP || k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
search_options->call("_gui_input", k);
|
||||
search_box->accept_event();
|
||||
}
|
||||
|
|
|
@ -1452,11 +1452,12 @@ Variant ScriptTextEditor::get_drag_data_fw(const Point2 &p_point, Control *p_fro
|
|||
|
||||
bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
|
||||
Dictionary d = p_data;
|
||||
if (d.has("type") && (String(d["type"]) == "resource" ||
|
||||
String(d["type"]) == "files" ||
|
||||
String(d["type"]) == "nodes" ||
|
||||
String(d["type"]) == "obj_property" ||
|
||||
String(d["type"]) == "files_and_dirs")) {
|
||||
if (d.has("type") &&
|
||||
(String(d["type"]) == "resource" ||
|
||||
String(d["type"]) == "files" ||
|
||||
String(d["type"]) == "nodes" ||
|
||||
String(d["type"]) == "obj_property" ||
|
||||
String(d["type"]) == "files_and_dirs")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1609,7 +1609,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
motion_snapped.snap(Vector3(snap, snap, snap));
|
||||
// This might not be necessary anymore after issue #288 is solved (in 4.0?).
|
||||
set_message(TTR("Scaling: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " +
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
|
||||
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
|
||||
Spatial *sp = Object::cast_to<Spatial>(E->get());
|
||||
|
@ -1731,7 +1731,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
Vector3 motion_snapped = motion;
|
||||
motion_snapped.snap(Vector3(snap, snap, snap));
|
||||
set_message(TTR("Translating: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " +
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")");
|
||||
|
||||
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
|
||||
Spatial *sp = Object::cast_to<Spatial>(E->get());
|
||||
|
|
|
@ -387,10 +387,7 @@ void TileMapEditor::_text_changed(const String &p_text) {
|
|||
void TileMapEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> k = p_ie;
|
||||
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP ||
|
||||
k->get_scancode() == KEY_DOWN ||
|
||||
k->get_scancode() == KEY_PAGEUP ||
|
||||
k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
if (k.is_valid() && (k->get_scancode() == KEY_UP || k->get_scancode() == KEY_DOWN || k->get_scancode() == KEY_PAGEUP || k->get_scancode() == KEY_PAGEDOWN)) {
|
||||
palette->call("_gui_input", k);
|
||||
search_box->accept_event();
|
||||
}
|
||||
|
|
|
@ -1663,10 +1663,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos) {
|
|||
|
||||
void VisualShaderEditor::_sbox_input(const Ref<InputEvent> &p_ie) {
|
||||
Ref<InputEventKey> ie = p_ie;
|
||||
if (ie.is_valid() && (ie->get_scancode() == KEY_UP ||
|
||||
ie->get_scancode() == KEY_DOWN ||
|
||||
ie->get_scancode() == KEY_ENTER ||
|
||||
ie->get_scancode() == KEY_KP_ENTER)) {
|
||||
if (ie.is_valid() && (ie->get_scancode() == KEY_UP || ie->get_scancode() == KEY_DOWN || ie->get_scancode() == KEY_ENTER || ie->get_scancode() == KEY_KP_ENTER)) {
|
||||
members->call("_gui_input", ie);
|
||||
node_filter->accept_event();
|
||||
}
|
||||
|
|
|
@ -632,8 +632,7 @@ void RenameDialog::reset() {
|
|||
}
|
||||
|
||||
bool RenameDialog::_is_main_field(LineEdit *line_edit) {
|
||||
return line_edit &&
|
||||
(line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
|
||||
return line_edit && (line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
|
||||
}
|
||||
|
||||
void RenameDialog::_insert_text(String text) {
|
||||
|
|
|
@ -170,11 +170,11 @@ Vector2 Input::get_vector(const StringName &p_negative_x, const StringName &p_po
|
|||
|
||||
if (p_deadzone < 0.0f) {
|
||||
// If the deadzone isn't specified, get it from the average of the actions.
|
||||
p_deadzone = (InputMap::get_singleton()->action_get_deadzone(p_positive_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_positive_y) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_y)) /
|
||||
4;
|
||||
p_deadzone = 0.25 *
|
||||
(InputMap::get_singleton()->action_get_deadzone(p_positive_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_x) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_positive_y) +
|
||||
InputMap::get_singleton()->action_get_deadzone(p_negative_y));
|
||||
}
|
||||
|
||||
// Circular length limiting and deadzone.
|
||||
|
|
|
@ -248,8 +248,7 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
|
|||
}
|
||||
// Don't rely on sizeof(bmp_file_header) as structure padding
|
||||
// adds 2 bytes offset leading to misaligned color table reading
|
||||
uint32_t ct_offset = BITMAP_FILE_HEADER_SIZE +
|
||||
bmp_header.bmp_info_header.bmp_header_size;
|
||||
uint32_t ct_offset = BITMAP_FILE_HEADER_SIZE + bmp_header.bmp_info_header.bmp_header_size;
|
||||
f->seek(ct_offset);
|
||||
|
||||
uint32_t color_table_size = 0;
|
||||
|
@ -271,8 +270,7 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
|
|||
|
||||
f->seek(bmp_header.bmp_file_header.bmp_file_offset);
|
||||
|
||||
uint32_t bmp_buffer_size = (bmp_header.bmp_file_header.bmp_file_size -
|
||||
bmp_header.bmp_file_header.bmp_file_offset);
|
||||
uint32_t bmp_buffer_size = (bmp_header.bmp_file_header.bmp_file_size - bmp_header.bmp_file_header.bmp_file_offset);
|
||||
|
||||
PoolVector<uint8_t> bmp_buffer;
|
||||
err = bmp_buffer.resize(bmp_buffer_size);
|
||||
|
|
|
@ -156,8 +156,8 @@ inline bool is_point_in_triangle(const Vector3 &p_point, const Vector3 p_vertice
|
|||
|
||||
inline static bool is_triangle_degenerate(const Vector2 p_vertices[3], real_t p_vertex_snap2) {
|
||||
real_t det = p_vertices[0].x * p_vertices[1].y - p_vertices[0].x * p_vertices[2].y +
|
||||
p_vertices[0].y * p_vertices[2].x - p_vertices[0].y * p_vertices[1].x +
|
||||
p_vertices[1].x * p_vertices[2].y - p_vertices[1].y * p_vertices[2].x;
|
||||
p_vertices[0].y * p_vertices[2].x - p_vertices[0].y * p_vertices[1].x +
|
||||
p_vertices[1].x * p_vertices[2].y - p_vertices[1].y * p_vertices[2].x;
|
||||
|
||||
return det < p_vertex_snap2;
|
||||
}
|
||||
|
|
|
@ -217,8 +217,7 @@ struct EditorSceneImporterAssetImportInterpolate {
|
|||
float t2 = t * t;
|
||||
float t3 = t2 * t;
|
||||
|
||||
return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 +
|
||||
(-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3);
|
||||
return 0.5f * ((2.0f * p1) + (-p0 + p2) * t + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3);
|
||||
}
|
||||
|
||||
T bezier(T start, T control_1, T control_2, T end, float t) {
|
||||
|
|
|
@ -82,46 +82,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <stdint.h>
|
||||
|
||||
namespace FBXDocParser {
|
||||
//enum Flag
|
||||
//{
|
||||
// e_unknown_0 = 1 << 0,
|
||||
// e_unknown_1 = 1 << 1,
|
||||
// e_unknown_2 = 1 << 2,
|
||||
// e_unknown_3 = 1 << 3,
|
||||
// e_unknown_4 = 1 << 4,
|
||||
// e_unknown_5 = 1 << 5,
|
||||
// e_unknown_6 = 1 << 6,
|
||||
// e_unknown_7 = 1 << 7,
|
||||
// e_unknown_8 = 1 << 8,
|
||||
// e_unknown_9 = 1 << 9,
|
||||
// e_unknown_10 = 1 << 10,
|
||||
// e_unknown_11 = 1 << 11,
|
||||
// e_unknown_12 = 1 << 12,
|
||||
// e_unknown_13 = 1 << 13,
|
||||
// e_unknown_14 = 1 << 14,
|
||||
// e_unknown_15 = 1 << 15,
|
||||
// e_unknown_16 = 1 << 16,
|
||||
// e_unknown_17 = 1 << 17,
|
||||
// e_unknown_18 = 1 << 18,
|
||||
// e_unknown_19 = 1 << 19,
|
||||
// e_unknown_20 = 1 << 20,
|
||||
// e_unknown_21 = 1 << 21,
|
||||
// e_unknown_22 = 1 << 22,
|
||||
// e_unknown_23 = 1 << 23,
|
||||
// e_flag_field_size_64_bit = 1 << 24, // Not sure what is
|
||||
// e_unknown_25 = 1 << 25,
|
||||
// e_unknown_26 = 1 << 26,
|
||||
// e_unknown_27 = 1 << 27,
|
||||
// e_unknown_28 = 1 << 28,
|
||||
// e_unknown_29 = 1 << 29,
|
||||
// e_unknown_30 = 1 << 30,
|
||||
// e_unknown_31 = 1 << 31
|
||||
//};
|
||||
//
|
||||
//bool check_flag(uint32_t flags, Flag to_check)
|
||||
//{
|
||||
// return (flags & to_check) != 0;
|
||||
//}
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Token::Token(const char *sbegin, const char *send, TokenType type, size_t offset) :
|
||||
sbegin(sbegin),
|
||||
|
@ -438,12 +398,6 @@ void TokenizeBinary(TokenList &output_tokens, const char *input, size_t length)
|
|||
//TokenizeError("file is too short",0);
|
||||
}
|
||||
|
||||
//uint32_t offset = 0x15;
|
||||
/* const char* cursor = input + 0x15;
|
||||
const uint32_t flags = ReadWord(input, cursor, input + length);
|
||||
const uint8_t padding_0 = ReadByte(input, cursor, input + length); // unused
|
||||
const uint8_t padding_1 = ReadByte(input, cursor, input + length); // unused*/
|
||||
|
||||
if (strncmp(input, "Kaydara FBX Binary", 18)) {
|
||||
TokenizeError("magic bytes not found", 0);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -740,13 +740,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;
|
||||
}
|
||||
|
@ -784,8 +784,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);
|
||||
|
||||
|
@ -798,8 +798,8 @@ public:
|
|||
const AnimationMap &Curves() const;
|
||||
|
||||
/** Object the curve is assigned to, this can be NULL 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;
|
||||
}
|
||||
|
@ -843,8 +843,8 @@ public:
|
|||
}
|
||||
|
||||
/* 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:
|
||||
|
@ -952,15 +952,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;
|
||||
}
|
||||
|
@ -1059,7 +1059,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;
|
||||
}
|
||||
|
|
|
@ -114,12 +114,12 @@ const T *ProcessSimpleConnection(const Connection &con,
|
|||
const char **propNameOut = nullptr) {
|
||||
if (is_object_property_conn && !con.PropertyName().length()) {
|
||||
DOMWarning("expected incoming " + std::string(name) +
|
||||
" link to be an object-object connection, ignoring",
|
||||
" link to be an object-object connection, ignoring",
|
||||
element);
|
||||
return nullptr;
|
||||
} else if (!is_object_property_conn && con.PropertyName().length()) {
|
||||
DOMWarning("expected incoming " + std::string(name) +
|
||||
" link to be an object-property connection, ignoring",
|
||||
" link to be an object-property connection, ignoring",
|
||||
element);
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -86,30 +86,30 @@ 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. Strict mode is off by default. */
|
||||
* - only accept fbx 2012, 2013 files
|
||||
* - on the slightest error, give up.
|
||||
*
|
||||
* Basically, strict mode means that the fbx file will actually
|
||||
* be validated. Strict mode is off by default. */
|
||||
bool strictMode;
|
||||
|
||||
/** 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. The default
|
||||
* value for this option is true.*/
|
||||
* 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. The default
|
||||
* value for this option is true.*/
|
||||
bool readAllLayers;
|
||||
|
||||
/** 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;
|
||||
|
||||
/** import materials (true) or skip them and assign a default
|
||||
* material. The default value is true.*/
|
||||
* material. The default value is true.*/
|
||||
bool readMaterials;
|
||||
|
||||
/** import embedded textures? Default value is true.*/
|
||||
|
@ -122,50 +122,50 @@ struct ImportSettings {
|
|||
bool readLights;
|
||||
|
||||
/** import animations (i.e. animation curves, the node
|
||||
* skeleton is always imported). Default value is true. */
|
||||
* skeleton is always imported). Default value is true. */
|
||||
bool readAnimations;
|
||||
|
||||
/** read bones (vertex weights and deform info).
|
||||
* Default value is true. */
|
||||
* Default value is true. */
|
||||
bool readWeights;
|
||||
|
||||
/** 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 default value
|
||||
* is true.
|
||||
*
|
||||
* 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 default value
|
||||
* is true.
|
||||
*
|
||||
* 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;
|
||||
|
||||
/** do not import animation curves that specify a constant
|
||||
* values matching the corresponding node transformation.
|
||||
* The default value is true. */
|
||||
* values matching the corresponding node transformation.
|
||||
* The default value is true. */
|
||||
bool optimizeEmptyAnimationCurves;
|
||||
|
||||
/** use legacy naming for embedded textures eg: (*0, *1, *2)
|
||||
*/
|
||||
*/
|
||||
bool useLegacyEmbeddedTextureNaming;
|
||||
|
||||
/** Empty bones shall be removed
|
||||
*/
|
||||
*/
|
||||
bool removeEmptyBones;
|
||||
|
||||
/** Set to true to perform a conversion from cm to meter after the import
|
||||
*/
|
||||
*/
|
||||
bool convertToMeters;
|
||||
};
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -642,13 +642,6 @@ void ParseVectorDataArray(std::vector<Vector3> &out, const ElementPtr el) {
|
|||
static_cast<real_t>(d[1]),
|
||||
static_cast<real_t>(d[2])));
|
||||
}
|
||||
// for debugging
|
||||
/*for ( size_t i = 0; i < out.size(); i++ ) {
|
||||
aiVector3D vec3( out[ i ] );
|
||||
std::stringstream stream;
|
||||
stream << " vec3.x = " << vec3.x << " vec3.y = " << vec3.y << " vec3.z = " << vec3.z << std::endl;
|
||||
DefaultLogger::get()->info( stream.str() );
|
||||
}*/
|
||||
} else if (type == 'f') {
|
||||
const float *f = reinterpret_cast<const float *>(&buff[0]);
|
||||
for (unsigned int i = 0; i < count3; ++i, f += 3) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 == NULL);
|
||||
|
@ -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);
|
||||
|
|
|
@ -352,13 +352,6 @@ Error PluginScript::reload(bool p_keep_state) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
/*for (Set<PlaceHolderScriptInstance*>::Element *E=placeholders.front();E;E=E->next()) {
|
||||
|
||||
_update_placeholder(E->get());
|
||||
}*/
|
||||
#endif
|
||||
|
||||
FREE_SCRIPT_MANIFEST(manifest);
|
||||
return OK;
|
||||
#undef FREE_SCRIPT_MANIFEST
|
||||
|
|
|
@ -1782,15 +1782,15 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const {
|
|||
|
||||
bool GDScriptLanguage::is_control_flow_keyword(String p_keyword) const {
|
||||
return p_keyword == "break" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "elif" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "match" ||
|
||||
p_keyword == "pass" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "while";
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "elif" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "match" ||
|
||||
p_keyword == "pass" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "while";
|
||||
}
|
||||
|
||||
bool GDScriptLanguage::handles_global_class_type(const String &p_type) const {
|
||||
|
|
|
@ -745,7 +745,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
} else {
|
||||
#ifdef DEBUG_ENABLED
|
||||
err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) +
|
||||
"' to a variable of type '" + Variant::get_type_name(var_type) + "'.";
|
||||
"' to a variable of type '" + Variant::get_type_name(var_type) + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
} else {
|
||||
|
@ -768,14 +768,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
GD_ERR_BREAK(!nc);
|
||||
if (src->get_type() != Variant::OBJECT && src->get_type() != Variant::NIL) {
|
||||
err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) +
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
Object *src_obj = src->operator Object *();
|
||||
|
||||
if (src_obj && !ClassDB::is_parent_class(src_obj->get_class_name(), nc->get_name())) {
|
||||
err_text = "Trying to assign value of type '" + src_obj->get_class_name() +
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
"' to a variable of type '" + nc->get_name() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
|
@ -805,7 +805,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
ScriptInstance *scr_inst = src->operator Object *()->get_script_instance();
|
||||
if (!scr_inst) {
|
||||
err_text = "Trying to assign value of type '" + src->operator Object *()->get_class_name() +
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
|
||||
|
@ -822,7 +822,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
|
|||
|
||||
if (!valid) {
|
||||
err_text = "Trying to assign value of type '" + src->operator Object *()->get_script_instance()->get_script()->get_path().get_file() +
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
|
||||
OPCODE_BREAK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4864,14 +4864,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
if (current_class->constant_expressions.has(member.identifier)) {
|
||||
_set_error("A constant named \"" + String(member.identifier) + "\" already exists in this class (at line: " +
|
||||
itos(current_class->constant_expressions[member.identifier].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[member.identifier].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == member.identifier) {
|
||||
_set_error("Variable \"" + String(member.identifier) + "\" already exists in this class (at line: " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5123,14 +5123,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
if (current_class->constant_expressions.has(const_id)) {
|
||||
_set_error("Constant \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == const_id) {
|
||||
_set_error("A variable named \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5201,14 +5201,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
|
||||
if (current_class->constant_expressions.has(enum_name)) {
|
||||
_set_error("A constant named \"" + String(enum_name) + "\" already exists in this class (at line " +
|
||||
itos(current_class->constant_expressions[enum_name].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[enum_name].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == enum_name) {
|
||||
_set_error("A variable named \"" + String(enum_name) + "\" already exists in this class (at line " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5293,14 +5293,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
} else {
|
||||
if (current_class->constant_expressions.has(const_id)) {
|
||||
_set_error("A constant named \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
itos(current_class->constant_expressions[const_id].expression->line) + ").");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < current_class->variables.size(); i++) {
|
||||
if (current_class->variables[i].identifier == const_id) {
|
||||
_set_error("A variable named \"" + String(const_id) + "\" already exists in this class (at line " +
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
itos(current_class->variables[i].line) + ").");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5952,8 +5952,8 @@ GDScriptParser::DataType GDScriptParser::_resolve_type(const DataType &p_source,
|
|||
} else {
|
||||
base = result.to_string();
|
||||
}
|
||||
_set_error("The identifier \"" + String(id) + "\" isn't a valid type (not a script or class), or couldn't be found on base \"" +
|
||||
base + "\".",
|
||||
_set_error("The identifier \"" + String(id) +
|
||||
"\" isn't a valid type (not a script or class), or couldn't be found on base \"" + base + "\".",
|
||||
p_line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6449,7 +6449,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
|
||||
if (!valid) {
|
||||
_set_error("Invalid cast. Cannot convert from \"" + source_type.to_string() +
|
||||
"\" to \"" + cn->cast_type.to_string() + "\".",
|
||||
"\" to \"" + cn->cast_type.to_string() + "\".",
|
||||
cn->line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6537,7 +6537,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
|
||||
if (check_types && !valid) {
|
||||
_set_error("Invalid operand type (\"" + argument_type.to_string() +
|
||||
"\") to unary operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
"\") to unary operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
op->line, op->column);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6581,7 +6581,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
|
||||
if (check_types && !valid) {
|
||||
_set_error("Invalid operand types (\"" + argument_a_type.to_string() + "\" and \"" +
|
||||
argument_b_type.to_string() + "\") to operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
argument_b_type.to_string() + "\") to operator \"" + Variant::get_operator_name(var_op) + "\".",
|
||||
op->line, op->column);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6667,7 +6667,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
result = _type_from_variant(res);
|
||||
} else if (check_types) {
|
||||
_set_error("Can't get index \"" + String(member_id->name.operator String()) + "\" on base \"" +
|
||||
base_type.to_string() + "\".",
|
||||
base_type.to_string() + "\".",
|
||||
op->line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -6794,7 +6794,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||
node_type.is_constant = false;
|
||||
} else if (check_types) {
|
||||
_set_error("Can't get index \"" + String(cn->value) + "\" on base \"" +
|
||||
base_type.to_string() + "\".",
|
||||
base_type.to_string() + "\".",
|
||||
op->line);
|
||||
return DataType();
|
||||
}
|
||||
|
@ -7388,8 +7388,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||
// Supertypes are acceptable for dynamic compliance
|
||||
if (!_is_type_compatible(par_type, arg_types[i - arg_diff])) {
|
||||
_set_error("At \"" + callee_name + "()\" call, argument " + itos(i - arg_diff + 1) + ". The passed argument's type (" +
|
||||
par_type.to_string() + ") doesn't match the function's expected argument type (" +
|
||||
arg_types[i - arg_diff].to_string() + ").",
|
||||
par_type.to_string() + ") doesn't match the function's expected argument type (" +
|
||||
arg_types[i - arg_diff].to_string() + ").",
|
||||
p_call->line);
|
||||
return DataType();
|
||||
} else {
|
||||
|
@ -7873,7 +7873,7 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
// Try with implicit conversion
|
||||
if (v.data_type.kind != DataType::BUILTIN || !_is_type_compatible(v.data_type, expr_type, true)) {
|
||||
_set_error("The assigned expression's type (" + expr_type.to_string() + ") doesn't match the variable's type (" +
|
||||
v.data_type.to_string() + ").",
|
||||
v.data_type.to_string() + ").",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -7918,7 +7918,7 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
DataType export_type = _type_from_property(v._export);
|
||||
if (!_is_type_compatible(v.data_type, export_type, true)) {
|
||||
_set_error("The export hint's type (" + export_type.to_string() + ") doesn't match the variable's type (" +
|
||||
v.data_type.to_string() + ").",
|
||||
v.data_type.to_string() + ").",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -7939,14 +7939,14 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
if (setter->get_required_argument_count() != 1 &&
|
||||
!(setter->get_required_argument_count() == 0 && setter->default_values.size() > 0)) {
|
||||
_set_error("The setter function needs to receive exactly 1 argument. See \"" + setter->name +
|
||||
"()\" definition at line " + itos(setter->line) + ".",
|
||||
"()\" definition at line " + itos(setter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
if (!_is_type_compatible(v.data_type, setter->argument_types[0])) {
|
||||
_set_error("The setter argument's type (" + setter->argument_types[0].to_string() +
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() + "). See \"" +
|
||||
setter->name + "()\" definition at line " + itos(setter->line) + ".",
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() + "). See \"" +
|
||||
setter->name + "()\" definition at line " + itos(setter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -7958,14 +7958,14 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) {
|
|||
|
||||
if (getter->get_required_argument_count() != 0) {
|
||||
_set_error("The getter function can't receive arguments. See \"" + getter->name +
|
||||
"()\" definition at line " + itos(getter->line) + ".",
|
||||
"()\" definition at line " + itos(getter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
if (!_is_type_compatible(v.data_type, getter->get_datatype())) {
|
||||
_set_error("The getter return type (" + getter->get_datatype().to_string() +
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() +
|
||||
"). See \"" + getter->name + "()\" definition at line " + itos(getter->line) + ".",
|
||||
") doesn't match the variable's type (" + v.data_type.to_string() +
|
||||
"). See \"" + getter->name + "()\" definition at line " + itos(getter->line) + ".",
|
||||
v.line);
|
||||
return;
|
||||
}
|
||||
|
@ -8088,7 +8088,7 @@ void GDScriptParser::_check_function_types(FunctionNode *p_function) {
|
|||
if (!_is_type_compatible(p_function->argument_types[i], def_type, true)) {
|
||||
String arg_name = p_function->arguments[i];
|
||||
_set_error("Value type (" + def_type.to_string() + ") doesn't match the type of argument '" +
|
||||
arg_name + "' (" + p_function->argument_types[i].to_string() + ").",
|
||||
arg_name + "' (" + p_function->argument_types[i].to_string() + ").",
|
||||
p_function->line);
|
||||
}
|
||||
}
|
||||
|
@ -8301,7 +8301,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
// Try implicit conversion
|
||||
if (lv->datatype.kind != DataType::BUILTIN || !_is_type_compatible(lv->datatype, assign_type, true)) {
|
||||
_set_error("The assigned value type (" + assign_type.to_string() + ") doesn't match the variable's type (" +
|
||||
lv->datatype.to_string() + ").",
|
||||
lv->datatype.to_string() + ").",
|
||||
lv->line);
|
||||
return;
|
||||
}
|
||||
|
@ -8407,7 +8407,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
|
||||
if (check_types && !valid) {
|
||||
_set_error("Invalid operand types (\"" + lh_type.to_string() + "\" and \"" + arg_type.to_string() +
|
||||
"\") to assignment operator \"" + Variant::get_operator_name(oper) + "\".",
|
||||
"\") to assignment operator \"" + Variant::get_operator_name(oper) + "\".",
|
||||
op->line);
|
||||
return;
|
||||
}
|
||||
|
@ -8439,7 +8439,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
// Try implicit conversion
|
||||
if (lh_type.kind != DataType::BUILTIN || !_is_type_compatible(lh_type, rh_type, true)) {
|
||||
_set_error("The assigned value's type (" + rh_type.to_string() + ") doesn't match the variable's type (" +
|
||||
lh_type.to_string() + ").",
|
||||
lh_type.to_string() + ").",
|
||||
op->line);
|
||||
return;
|
||||
}
|
||||
|
@ -8548,7 +8548,7 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
|
||||
if (!_is_type_compatible(function_type, ret_type)) {
|
||||
_set_error("The returned value type (" + ret_type.to_string() + ") doesn't match the function return type (" +
|
||||
function_type.to_string() + ").",
|
||||
function_type.to_string() + ").",
|
||||
cf->line, cf->column);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -5430,7 +5430,7 @@ void GLTFDocument::_convert_mult_mesh_instance_to_gltf(MultiMeshInstance *p_mult
|
|||
p_multi_mesh_instance->get_transform() * transform;
|
||||
} else if (multi_mesh->get_transform_format() == MultiMesh::TRANSFORM_3D) {
|
||||
transform = p_multi_mesh_instance->get_transform() *
|
||||
multi_mesh->get_instance_transform(instance_i);
|
||||
multi_mesh->get_instance_transform(instance_i);
|
||||
}
|
||||
Ref<ArrayMesh> mm = multi_mesh->get_mesh();
|
||||
if (mm.is_valid()) {
|
||||
|
|
|
@ -293,22 +293,22 @@ void CSharpLanguage::get_reserved_words(List<String> *p_words) const {
|
|||
|
||||
bool CSharpLanguage::is_control_flow_keyword(String p_keyword) const {
|
||||
return p_keyword == "break" ||
|
||||
p_keyword == "case" ||
|
||||
p_keyword == "catch" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "default" ||
|
||||
p_keyword == "do" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "finally" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "foreach" ||
|
||||
p_keyword == "goto" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "switch" ||
|
||||
p_keyword == "throw" ||
|
||||
p_keyword == "try" ||
|
||||
p_keyword == "while";
|
||||
p_keyword == "case" ||
|
||||
p_keyword == "catch" ||
|
||||
p_keyword == "continue" ||
|
||||
p_keyword == "default" ||
|
||||
p_keyword == "do" ||
|
||||
p_keyword == "else" ||
|
||||
p_keyword == "finally" ||
|
||||
p_keyword == "for" ||
|
||||
p_keyword == "foreach" ||
|
||||
p_keyword == "goto" ||
|
||||
p_keyword == "if" ||
|
||||
p_keyword == "return" ||
|
||||
p_keyword == "switch" ||
|
||||
p_keyword == "throw" ||
|
||||
p_keyword == "try" ||
|
||||
p_keyword == "while";
|
||||
}
|
||||
|
||||
void CSharpLanguage::get_comment_delimiters(List<String> *p_delimiters) const {
|
||||
|
@ -3023,8 +3023,7 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) {
|
|||
if (ScriptDebugger::get_singleton()) {
|
||||
CSharpLanguage::get_singleton()->debug_break_parse(get_path(), 0, "Script inherits from native type '" + native_name + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'");
|
||||
}
|
||||
ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + native_name +
|
||||
"', so it can't be instanced in object of type: '" + p_this->get_class() + "'.");
|
||||
ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + native_name + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3295,10 +3294,10 @@ Error CSharpScript::load_source_code(const String &p_path) {
|
|||
Error ferr = read_all_file_utf8(p_path, source);
|
||||
|
||||
ERR_FAIL_COND_V_MSG(ferr != OK, ferr,
|
||||
ferr == ERR_INVALID_DATA ?
|
||||
"Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode." :
|
||||
"Failed to read file: '" + p_path + "'.");
|
||||
ferr == ERR_INVALID_DATA
|
||||
? "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode."
|
||||
: "Failed to read file: '" + p_path + "'.");
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
source_changed_cache = true;
|
||||
|
|
|
@ -354,8 +354,7 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf
|
|||
xml_output.append(link_target);
|
||||
xml_output.append("</c>");
|
||||
} else if (link_tag == "enum") {
|
||||
StringName search_cname = !target_itype ? target_cname :
|
||||
StringName(target_itype->name + "." + (String)target_cname);
|
||||
StringName search_cname = !target_itype ? target_cname : StringName(target_itype->name + "." + (String)target_cname);
|
||||
|
||||
const Map<StringName, TypeInterface>::Element *enum_match = enum_types.find(search_cname);
|
||||
|
||||
|
@ -2350,7 +2349,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
if (itype.cname != name_cache.type_Object || imethod.name != "free") {
|
||||
WARN_PRINT("Notification: New unexpected virtual non-overridable method found."
|
||||
" We only expected Object.free, but found '" +
|
||||
itype.name + "." + imethod.name + "'.");
|
||||
itype.name + "." + imethod.name + "'.");
|
||||
}
|
||||
} else if (return_info.type == Variant::INT && return_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) {
|
||||
imethod.return_type.cname = return_info.class_name;
|
||||
|
|
|
@ -638,8 +638,7 @@ static String get_preprocessor_directive(const String &p_line, int p_from) {
|
|||
CRASH_COND(p_line[p_from] != '#');
|
||||
p_from++;
|
||||
int i = p_from;
|
||||
while (i < p_line.length() && (p_line[i] == '_' || (p_line[i] >= 'A' && p_line[i] <= 'Z') ||
|
||||
(p_line[i] >= 'a' && p_line[i] <= 'z') || p_line[i] > 127)) {
|
||||
while (i < p_line.length() && (p_line[i] == '_' || (p_line[i] >= 'A' && p_line[i] <= 'Z') || (p_line[i] >= 'a' && p_line[i] <= 'z') || p_line[i] > 127)) {
|
||||
i++;
|
||||
}
|
||||
return p_line.substr(p_from, i - p_from);
|
||||
|
@ -717,10 +716,10 @@ Error ScriptClassParser::parse_file(const String &p_filepath) {
|
|||
Error ferr = read_all_file_utf8(p_filepath, source);
|
||||
|
||||
ERR_FAIL_COND_V_MSG(ferr != OK, ferr,
|
||||
ferr == ERR_INVALID_DATA ?
|
||||
"File '" + p_filepath + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode." :
|
||||
"Failed to read file: '" + p_filepath + "'.");
|
||||
ferr == ERR_INVALID_DATA
|
||||
? "File '" + p_filepath + "' contains invalid unicode (UTF-8), so it was not loaded."
|
||||
" Please ensure that scripts are saved in valid UTF-8 unicode."
|
||||
: "Failed to read file: '" + p_filepath + "'.");
|
||||
|
||||
run_dummy_preprocessor(source, p_filepath);
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ void gd_mono_debug_init() {
|
|||
|
||||
if (da_args.length() == 0) {
|
||||
da_args = String("--debugger-agent=transport=dt_socket,address=127.0.0.1:" + itos(da_port) +
|
||||
",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n"))
|
||||
",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n"))
|
||||
.utf8();
|
||||
}
|
||||
#else
|
||||
|
@ -584,9 +584,9 @@ bool GDMono::load_assembly_from(const String &p_name, const String &p_path, GDMo
|
|||
ApiAssemblyInfo::Version ApiAssemblyInfo::Version::get_from_loaded_assembly(GDMonoAssembly *p_api_assembly, ApiAssemblyInfo::Type p_api_type) {
|
||||
ApiAssemblyInfo::Version api_assembly_version;
|
||||
|
||||
const char *nativecalls_name = p_api_type == ApiAssemblyInfo::API_CORE ?
|
||||
BINDINGS_CLASS_NATIVECALLS :
|
||||
BINDINGS_CLASS_NATIVECALLS_EDITOR;
|
||||
const char *nativecalls_name = p_api_type == ApiAssemblyInfo::API_CORE
|
||||
? BINDINGS_CLASS_NATIVECALLS
|
||||
: BINDINGS_CLASS_NATIVECALLS_EDITOR;
|
||||
|
||||
GDMonoClass *nativecalls_klass = p_api_assembly->get_class(BINDINGS_NAMESPACE, nativecalls_name);
|
||||
|
||||
|
@ -628,7 +628,9 @@ bool GDMono::copy_prebuilt_api_assembly(ApiAssemblyInfo::Type p_api_type, const
|
|||
String src_dir = GodotSharpDirs::get_data_editor_prebuilt_api_dir().plus_file(p_config);
|
||||
String dst_dir = GodotSharpDirs::get_res_assemblies_base_dir().plus_file(p_config);
|
||||
|
||||
String assembly_name = p_api_type == ApiAssemblyInfo::API_CORE ? CORE_API_ASSEMBLY_NAME : EDITOR_API_ASSEMBLY_NAME;
|
||||
String assembly_name = p_api_type == ApiAssemblyInfo::API_CORE
|
||||
? CORE_API_ASSEMBLY_NAME
|
||||
: EDITOR_API_ASSEMBLY_NAME;
|
||||
|
||||
// Create destination directory if needed
|
||||
if (!DirAccess::exists(dst_dir)) {
|
||||
|
@ -685,11 +687,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;
|
||||
}
|
||||
|
@ -737,14 +739,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);
|
||||
|
||||
|
@ -800,14 +798,12 @@ 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
|
||||
|
@ -815,8 +811,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;
|
||||
}
|
||||
|
@ -832,20 +828,18 @@ 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;
|
||||
}
|
||||
|
@ -958,7 +952,7 @@ bool GDMono::_load_tools_assemblies() {
|
|||
return true;
|
||||
|
||||
bool success = load_assembly(TOOLS_ASM_NAME, &tools_assembly) &&
|
||||
load_assembly(TOOLS_PROJECT_EDITOR_ASM_NAME, &tools_project_editor_assembly);
|
||||
load_assembly(TOOLS_PROJECT_EDITOR_ASM_NAME, &tools_project_editor_assembly);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -54,8 +54,8 @@ struct Version {
|
|||
|
||||
bool operator==(const Version &p_other) const {
|
||||
return godot_api_hash == p_other.godot_api_hash &&
|
||||
bindings_version == p_other.bindings_version &&
|
||||
cs_glue_version == p_other.cs_glue_version;
|
||||
bindings_version == p_other.bindings_version &&
|
||||
cs_glue_version == p_other.cs_glue_version;
|
||||
}
|
||||
|
||||
Version() :
|
||||
|
|
|
@ -180,7 +180,7 @@ void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base
|
|||
#ifdef DEBUG_ENABLED
|
||||
String fullname = method->get_ret_type_full_name() + " " + name + "(" + method->get_signature_desc(true) + ")";
|
||||
WARN_PRINT("Method '" + fullname + "' is hidden by Godot API method. Should be '" +
|
||||
method->get_full_name_no_class() + "'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
method->get_full_name_no_class() + "'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base
|
|||
// found
|
||||
String fullname = m->get_ret_type_full_name() + " " + name + "(" + m->get_signature_desc(true) + ")";
|
||||
WARN_PRINT("Method '" + fullname + "' should be '" + m->get_full_name_no_class() +
|
||||
"'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
"'. In class '" + namespace_name + "." + class_name + "'.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -712,8 +712,7 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty
|
|||
} break;
|
||||
}
|
||||
|
||||
ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to an unmarshallable managed type. Name: '" +
|
||||
p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
ERR_FAIL_V_MSG(NULL, "Attempted to convert Variant to an unmarshallable managed type. Name: '" + p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
}
|
||||
|
||||
Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type, bool p_fail_with_err = true) {
|
||||
|
@ -925,8 +924,7 @@ Variant mono_object_to_variant_impl(MonoObject *p_obj, const ManagedType &p_type
|
|||
}
|
||||
|
||||
if (p_fail_with_err) {
|
||||
ERR_FAIL_V_MSG(Variant(), "Attempted to convert an unmarshallable managed type to Variant. Name: '" +
|
||||
p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
ERR_FAIL_V_MSG(Variant(), "Attempted to convert an unmarshallable managed type to Variant. Name: '" + p_type.type_class->get_name() + "' Encoding: " + itos(p_type.type_encoding) + ".");
|
||||
} else {
|
||||
return Variant();
|
||||
}
|
||||
|
@ -982,7 +980,7 @@ String mono_object_to_variant_string(MonoObject *p_obj, MonoException **r_exc) {
|
|||
|
||||
MonoObject *Dictionary_to_system_generic_dict(const Dictionary &p_dict, GDMonoClass *p_class, MonoReflectionType *p_key_reftype, MonoReflectionType *p_value_reftype) {
|
||||
String ctor_desc = ":.ctor(System.Collections.Generic.IDictionary`2<" + GDMonoUtils::get_type_desc(p_key_reftype) +
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
GDMonoMethod *ctor = p_class->get_method_with_desc(ctor_desc, true);
|
||||
CRASH_COND(ctor == nullptr);
|
||||
|
||||
|
@ -1004,7 +1002,7 @@ MonoObject *Dictionary_to_system_generic_dict(const Dictionary &p_dict, GDMonoCl
|
|||
Dictionary system_generic_dict_to_Dictionary(MonoObject *p_obj, GDMonoClass *p_class, MonoReflectionType *p_key_reftype, MonoReflectionType *p_value_reftype) {
|
||||
GDMonoClass *godot_dict_class = GDMonoUtils::Marshal::make_generic_dictionary_type(p_key_reftype, p_value_reftype);
|
||||
String ctor_desc = ":.ctor(System.Collections.Generic.IDictionary`2<" + GDMonoUtils::get_type_desc(p_key_reftype) +
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
", " + GDMonoUtils::get_type_desc(p_value_reftype) + ">)";
|
||||
GDMonoMethod *godot_dict_ctor = godot_dict_class->get_method_with_desc(ctor_desc, true);
|
||||
CRASH_COND(godot_dict_ctor == nullptr);
|
||||
|
||||
|
|
|
@ -187,45 +187,45 @@ enum {
|
|||
#endif
|
||||
|
||||
MATCHES_Vector2 = (MATCHES_real_t && (sizeof(Vector2) == (sizeof(real_t) * 2)) &&
|
||||
offsetof(Vector2, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector2, y) == (sizeof(real_t) * 1)),
|
||||
offsetof(Vector2, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector2, y) == (sizeof(real_t) * 1)),
|
||||
|
||||
MATCHES_Rect2 = (MATCHES_Vector2 && (sizeof(Rect2) == (sizeof(Vector2) * 2)) &&
|
||||
offsetof(Rect2, position) == (sizeof(Vector2) * 0) &&
|
||||
offsetof(Rect2, size) == (sizeof(Vector2) * 1)),
|
||||
offsetof(Rect2, position) == (sizeof(Vector2) * 0) &&
|
||||
offsetof(Rect2, size) == (sizeof(Vector2) * 1)),
|
||||
|
||||
MATCHES_Transform2D = (MATCHES_Vector2 && (sizeof(Transform2D) == (sizeof(Vector2) * 3))), // No field offset required, it stores an array
|
||||
|
||||
MATCHES_Vector3 = (MATCHES_real_t && (sizeof(Vector3) == (sizeof(real_t) * 3)) &&
|
||||
offsetof(Vector3, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector3, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Vector3, z) == (sizeof(real_t) * 2)),
|
||||
offsetof(Vector3, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Vector3, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Vector3, z) == (sizeof(real_t) * 2)),
|
||||
|
||||
MATCHES_Basis = (MATCHES_Vector3 && (sizeof(Basis) == (sizeof(Vector3) * 3))), // No field offset required, it stores an array
|
||||
|
||||
MATCHES_Quat = (MATCHES_real_t && (sizeof(Quat) == (sizeof(real_t) * 4)) &&
|
||||
offsetof(Quat, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Quat, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Quat, z) == (sizeof(real_t) * 2) &&
|
||||
offsetof(Quat, w) == (sizeof(real_t) * 3)),
|
||||
offsetof(Quat, x) == (sizeof(real_t) * 0) &&
|
||||
offsetof(Quat, y) == (sizeof(real_t) * 1) &&
|
||||
offsetof(Quat, z) == (sizeof(real_t) * 2) &&
|
||||
offsetof(Quat, w) == (sizeof(real_t) * 3)),
|
||||
|
||||
MATCHES_Transform = (MATCHES_Basis && MATCHES_Vector3 && (sizeof(Transform) == (sizeof(Basis) + sizeof(Vector3))) &&
|
||||
offsetof(Transform, basis) == 0 &&
|
||||
offsetof(Transform, origin) == sizeof(Basis)),
|
||||
offsetof(Transform, basis) == 0 &&
|
||||
offsetof(Transform, origin) == sizeof(Basis)),
|
||||
|
||||
MATCHES_AABB = (MATCHES_Vector3 && (sizeof(AABB) == (sizeof(Vector3) * 2)) &&
|
||||
offsetof(AABB, position) == (sizeof(Vector3) * 0) &&
|
||||
offsetof(AABB, size) == (sizeof(Vector3) * 1)),
|
||||
offsetof(AABB, position) == (sizeof(Vector3) * 0) &&
|
||||
offsetof(AABB, size) == (sizeof(Vector3) * 1)),
|
||||
|
||||
MATCHES_Color = (MATCHES_float && (sizeof(Color) == (sizeof(float) * 4)) &&
|
||||
offsetof(Color, r) == (sizeof(float) * 0) &&
|
||||
offsetof(Color, g) == (sizeof(float) * 1) &&
|
||||
offsetof(Color, b) == (sizeof(float) * 2) &&
|
||||
offsetof(Color, a) == (sizeof(float) * 3)),
|
||||
offsetof(Color, r) == (sizeof(float) * 0) &&
|
||||
offsetof(Color, g) == (sizeof(float) * 1) &&
|
||||
offsetof(Color, b) == (sizeof(float) * 2) &&
|
||||
offsetof(Color, a) == (sizeof(float) * 3)),
|
||||
|
||||
MATCHES_Plane = (MATCHES_Vector3 && MATCHES_real_t && (sizeof(Plane) == (sizeof(Vector3) + sizeof(real_t))) &&
|
||||
offsetof(Plane, normal) == 0 &&
|
||||
offsetof(Plane, d) == sizeof(Vector3))
|
||||
offsetof(Plane, normal) == 0 &&
|
||||
offsetof(Plane, d) == sizeof(Vector3))
|
||||
};
|
||||
|
||||
// In the future we may force this if we want to ref return these structs
|
||||
|
|
|
@ -173,7 +173,7 @@ template <typename T>
|
|||
struct m2n_arg_cast_helper<T, 'L'> {
|
||||
static T cast(Mono_InterpMethodArguments *p_margs, size_t p_idx) {
|
||||
static_assert(std::is_same<T, int64_t>::value || std::is_same<T, uint64_t>::value ||
|
||||
(sizeof(void *) == 8 && std::is_pointer<T>::value),
|
||||
(sizeof(void *) == 8 && std::is_pointer<T>::value),
|
||||
"Invalid type for cookie 'L'.");
|
||||
|
||||
union {
|
||||
|
|
|
@ -135,24 +135,24 @@ bool is_csharp_keyword(const String &p_name) {
|
|||
// Reserved keywords
|
||||
|
||||
return p_name == "abstract" || p_name == "as" || p_name == "base" || p_name == "bool" ||
|
||||
p_name == "break" || p_name == "byte" || p_name == "case" || p_name == "catch" ||
|
||||
p_name == "char" || p_name == "checked" || p_name == "class" || p_name == "const" ||
|
||||
p_name == "continue" || p_name == "decimal" || p_name == "default" || p_name == "delegate" ||
|
||||
p_name == "do" || p_name == "double" || p_name == "else" || p_name == "enum" ||
|
||||
p_name == "event" || p_name == "explicit" || p_name == "extern" || p_name == "false" ||
|
||||
p_name == "finally" || p_name == "fixed" || p_name == "float" || p_name == "for" ||
|
||||
p_name == "forech" || p_name == "goto" || p_name == "if" || p_name == "implicit" ||
|
||||
p_name == "in" || p_name == "int" || p_name == "interface" || p_name == "internal" ||
|
||||
p_name == "is" || p_name == "lock" || p_name == "long" || p_name == "namespace" ||
|
||||
p_name == "new" || p_name == "null" || p_name == "object" || p_name == "operator" ||
|
||||
p_name == "out" || p_name == "override" || p_name == "params" || p_name == "private" ||
|
||||
p_name == "protected" || p_name == "public" || p_name == "readonly" || p_name == "ref" ||
|
||||
p_name == "return" || p_name == "sbyte" || p_name == "sealed" || p_name == "short" ||
|
||||
p_name == "sizeof" || p_name == "stackalloc" || p_name == "static" || p_name == "string" ||
|
||||
p_name == "struct" || p_name == "switch" || p_name == "this" || p_name == "throw" ||
|
||||
p_name == "true" || p_name == "try" || p_name == "typeof" || p_name == "uint" || p_name == "ulong" ||
|
||||
p_name == "unchecked" || p_name == "unsafe" || p_name == "ushort" || p_name == "using" ||
|
||||
p_name == "virtual" || p_name == "volatile" || p_name == "void" || p_name == "while";
|
||||
p_name == "break" || p_name == "byte" || p_name == "case" || p_name == "catch" ||
|
||||
p_name == "char" || p_name == "checked" || p_name == "class" || p_name == "const" ||
|
||||
p_name == "continue" || p_name == "decimal" || p_name == "default" || p_name == "delegate" ||
|
||||
p_name == "do" || p_name == "double" || p_name == "else" || p_name == "enum" ||
|
||||
p_name == "event" || p_name == "explicit" || p_name == "extern" || p_name == "false" ||
|
||||
p_name == "finally" || p_name == "fixed" || p_name == "float" || p_name == "for" ||
|
||||
p_name == "forech" || p_name == "goto" || p_name == "if" || p_name == "implicit" ||
|
||||
p_name == "in" || p_name == "int" || p_name == "interface" || p_name == "internal" ||
|
||||
p_name == "is" || p_name == "lock" || p_name == "long" || p_name == "namespace" ||
|
||||
p_name == "new" || p_name == "null" || p_name == "object" || p_name == "operator" ||
|
||||
p_name == "out" || p_name == "override" || p_name == "params" || p_name == "private" ||
|
||||
p_name == "protected" || p_name == "public" || p_name == "readonly" || p_name == "ref" ||
|
||||
p_name == "return" || p_name == "sbyte" || p_name == "sealed" || p_name == "short" ||
|
||||
p_name == "sizeof" || p_name == "stackalloc" || p_name == "static" || p_name == "string" ||
|
||||
p_name == "struct" || p_name == "switch" || p_name == "this" || p_name == "throw" ||
|
||||
p_name == "true" || p_name == "try" || p_name == "typeof" || p_name == "uint" || p_name == "ulong" ||
|
||||
p_name == "unchecked" || p_name == "unsafe" || p_name == "ushort" || p_name == "using" ||
|
||||
p_name == "virtual" || p_name == "volatile" || p_name == "void" || p_name == "while";
|
||||
}
|
||||
|
||||
String escape_csharp_keyword(const String &p_name) {
|
||||
|
|
|
@ -398,15 +398,15 @@ static void get_modulation_value(int x, int y, const int p_2bit, const int p_mod
|
|||
rep_vals0[p_modulation[y + 1][x]] +
|
||||
rep_vals0[p_modulation[y][x - 1]] +
|
||||
rep_vals0[p_modulation[y][x + 1]] + 2) /
|
||||
4;
|
||||
4;
|
||||
} else if (p_modulation_modes[y][x] == 2) {
|
||||
mod_val = (rep_vals0[p_modulation[y][x - 1]] +
|
||||
rep_vals0[p_modulation[y][x + 1]] + 1) /
|
||||
2;
|
||||
2;
|
||||
} else {
|
||||
mod_val = (rep_vals0[p_modulation[y - 1][x]] +
|
||||
rep_vals0[p_modulation[y + 1][x]] + 1) /
|
||||
2;
|
||||
2;
|
||||
}
|
||||
} else {
|
||||
mod_val = rep_vals1[p_modulation[y][x]];
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
|
||||
bool UPNP::is_common_device(const String &dev) const {
|
||||
return dev.empty() ||
|
||||
dev.find("InternetGatewayDevice") >= 0 ||
|
||||
dev.find("WANIPConnection") >= 0 ||
|
||||
dev.find("WANPPPConnection") >= 0 ||
|
||||
dev.find("rootdevice") >= 0;
|
||||
dev.find("InternetGatewayDevice") >= 0 ||
|
||||
dev.find("WANIPConnection") >= 0 ||
|
||||
dev.find("WANPPPConnection") >= 0 ||
|
||||
dev.find("rootdevice") >= 0;
|
||||
}
|
||||
|
||||
int UPNP::discover(int timeout, int ttl, const String &device_filter) {
|
||||
|
|
|
@ -2435,7 +2435,6 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
|
|||
const StringName *f = _call_stack[l].function;
|
||||
|
||||
ERR_FAIL_COND(!_call_stack[l].instance->functions.has(*f));
|
||||
//VisualScriptInstance::Function *func = &_call_stack[l].instance->functions[*f];
|
||||
|
||||
VisualScriptNodeInstance *node = _call_stack[l].instance->instances[*_call_stack[l].current_id];
|
||||
ERR_FAIL_COND(!node);
|
||||
|
@ -2481,23 +2480,8 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, List<String
|
|||
p_locals->push_back("working_mem/mem_" + itos(i));
|
||||
p_values->push_back((*_call_stack[l].work_mem)[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
ERR_FAIL_INDEX(p_level,_debug_call_stack_pos);
|
||||
|
||||
|
||||
VisualFunction *f = _call_stack[l].function;
|
||||
|
||||
List<Pair<StringName,int> > locals;
|
||||
|
||||
f->debug_get_stack_member_state(*_call_stack[l].line,&locals);
|
||||
for( List<Pair<StringName,int> >::Element *E = locals.front();E;E=E->next() ) {
|
||||
|
||||
p_locals->push_back(E->get().first);
|
||||
p_values->push_back(_call_stack[l].stack[E->get().second]);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void VisualScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
|
||||
if (_debug_parse_err_node >= 0) {
|
||||
return;
|
||||
|
|
|
@ -3799,7 +3799,7 @@ void VisualScriptEditor::connect_seq(Ref<VisualScriptNode> vnode_old, Ref<Visual
|
|||
undo_redo->add_do_method(script.ptr(), "sequence_connect", func, port_action_node, pass_port, new_id);
|
||||
undo_redo->add_undo_method(script.ptr(), "sequence_disconnect", func, port_action_node, pass_port, new_id);
|
||||
} else if (vnode_old->get_output_value_port_info(port_action_output).name == String("return") &&
|
||||
!script->get_output_sequence_ports_connected(func, port_action_node).has(return_port)) {
|
||||
!script->get_output_sequence_ports_connected(func, port_action_node).has(return_port)) {
|
||||
undo_redo->add_do_method(script.ptr(), "sequence_connect", func, port_action_node, return_port, new_id);
|
||||
undo_redo->add_undo_method(script.ptr(), "sequence_disconnect", func, port_action_node, return_port, new_id);
|
||||
} else {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -502,11 +502,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
|
||||
|
||||
|
@ -831,7 +831,7 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|||
OS::get_singleton()->get_screen_orientation_from_string(GLOBAL_GET("display/window/handheld/orientation")));
|
||||
|
||||
bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES3" &&
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
bool screen_support_small = p_preset->get("screen/support_small");
|
||||
bool screen_support_normal = p_preset->get("screen/support_normal");
|
||||
bool screen_support_large = p_preset->get("screen/support_large");
|
||||
|
@ -857,16 +857,11 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|||
int iofs = ofs + 8;
|
||||
|
||||
string_count = decode_uint32(&p_manifest[iofs]);
|
||||
//styles_count = decode_uint32(&p_manifest[iofs + 4]);
|
||||
// iofs + 4 is `styles_count`.
|
||||
string_flags = decode_uint32(&p_manifest[iofs + 8]);
|
||||
string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
|
||||
//styles_offset = decode_uint32(&p_manifest[iofs + 16]);
|
||||
/*
|
||||
printf("string count: %i\n",string_count);
|
||||
printf("flags: %i\n",string_flags);
|
||||
printf("sdata ofs: %i\n",string_data_offset);
|
||||
printf("styles ofs: %i\n",styles_offset);
|
||||
*/
|
||||
// iofs + 16 is `styles_offset`.
|
||||
|
||||
uint32_t st_offset = iofs + 20;
|
||||
string_table.resize(string_count);
|
||||
uint32_t string_end = 0;
|
||||
|
@ -1441,7 +1436,6 @@ void EditorExportPlatformAndroid::_fix_resources(const Ref<EditorExportPreset> &
|
|||
encode_uint32(ret.size(), &ret.write[4]);
|
||||
|
||||
r_manifest = ret;
|
||||
//printf("end\n");
|
||||
}
|
||||
|
||||
void EditorExportPlatformAndroid::_load_image_data(const Ref<Image> &p_splash_image, Vector<uint8_t> &p_data) {
|
||||
|
|
|
@ -96,13 +96,13 @@ Vector<PluginConfigAndroid> PluginConfigAndroid::get_prebuilt_plugins(String plu
|
|||
bool PluginConfigAndroid::is_plugin_config_valid(PluginConfigAndroid plugin_config) {
|
||||
bool valid_name = !plugin_config.name.empty();
|
||||
bool valid_binary_type = plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_LOCAL ||
|
||||
plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE;
|
||||
plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE;
|
||||
|
||||
bool valid_binary = false;
|
||||
if (valid_binary_type) {
|
||||
valid_binary = !plugin_config.binary.empty() &&
|
||||
(plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE ||
|
||||
FileAccess::exists(plugin_config.binary));
|
||||
(plugin_config.binary_type == PluginConfigAndroid::BINARY_TYPE_REMOTE ||
|
||||
FileAccess::exists(plugin_config.binary));
|
||||
}
|
||||
|
||||
bool valid_local_dependencies = true;
|
||||
|
|
|
@ -191,7 +191,7 @@ String bool_to_string(bool v) {
|
|||
|
||||
String _get_gles_tag() {
|
||||
bool min_gles3 = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name") == "GLES3" &&
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
!ProjectSettings::get_singleton()->get("rendering/quality/driver/fallback_to_gles2");
|
||||
return min_gles3 ? " <uses-feature android:glEsVersion=\"0x00030000\" android:required=\"true\" />\n" : "";
|
||||
}
|
||||
|
||||
|
|
|
@ -683,8 +683,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
|
|||
|
||||
if (!pack_valid) {
|
||||
Intent notifierIntent = new Intent(activity, activity.getClass());
|
||||
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
|
||||
Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
notifierIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(activity, 0,
|
||||
notifierIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
|
|
@ -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()");
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue