Style: Apply new clang-format 5.0 style to all files

This commit is contained in:
Rémi Verschelde 2017-12-06 21:36:34 +01:00
parent a8ceb7e3f2
commit 13c2ff9320
199 changed files with 954 additions and 875 deletions

View file

@ -49,10 +49,10 @@ struct MethodDefinition {
StringName name;
Vector<StringName> args;
MethodDefinition() {}
MethodDefinition(const char *p_name)
: name(p_name) {}
MethodDefinition(const StringName &p_name)
: name(p_name) {}
MethodDefinition(const char *p_name) :
name(p_name) {}
MethodDefinition(const StringName &p_name) :
name(p_name) {}
};
MethodDefinition D_METHOD(const char *p_name);

View file

@ -31,22 +31,22 @@
CoreStringNames *CoreStringNames::singleton = NULL;
CoreStringNames::CoreStringNames()
: _free(StaticCString::create("free")),
changed(StaticCString::create("changed")),
_meta(StaticCString::create("__meta__")),
_script(StaticCString::create("script")),
script_changed(StaticCString::create("script_changed")),
___pdcdata(StaticCString::create("___pdcdata")),
__getvar(StaticCString::create("__getvar")),
_iter_init(StaticCString::create("_iter_init")),
_iter_next(StaticCString::create("_iter_next")),
_iter_get(StaticCString::create("_iter_get")),
get_rid(StaticCString::create("get_rid")),
CoreStringNames::CoreStringNames() :
_free(StaticCString::create("free")),
changed(StaticCString::create("changed")),
_meta(StaticCString::create("__meta__")),
_script(StaticCString::create("script")),
script_changed(StaticCString::create("script_changed")),
___pdcdata(StaticCString::create("___pdcdata")),
__getvar(StaticCString::create("__getvar")),
_iter_init(StaticCString::create("_iter_init")),
_iter_next(StaticCString::create("_iter_next")),
_iter_get(StaticCString::create("_iter_get")),
get_rid(StaticCString::create("get_rid")),
#ifdef TOOLS_ENABLED
_sections_unfolded(StaticCString::create("_sections_unfolded")),
_sections_unfolded(StaticCString::create("_sections_unfolded")),
#endif
_custom_features(StaticCString::create("_custom_features")) {
_custom_features(StaticCString::create("_custom_features")) {
x = StaticCString::create("x");
y = StaticCString::create("y");

View file

@ -149,7 +149,7 @@ class PoolVector {
}
if (old_alloc->refcount.unref() == true) {
//this should never happen but..
//this should never happen but..
#ifdef DEBUG_ENABLED
MemoryPool::alloc_mutex->lock();

View file

@ -41,9 +41,9 @@ public:
struct Singleton {
StringName name;
Object *ptr;
Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL)
: name(p_name),
ptr(p_ptr) {
Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) :
name(p_name),
ptr(p_ptr) {
}
};

View file

@ -45,15 +45,15 @@ struct _GlobalConstant {
_GlobalConstant() {}
#ifdef DEBUG_METHODS_ENABLED
_GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value)
: enum_name(p_enum_name),
name(p_name),
value(p_value) {
_GlobalConstant(const StringName &p_enum_name, const char *p_name, int p_value) :
enum_name(p_enum_name),
name(p_name),
value(p_value) {
}
#else
_GlobalConstant(const char *p_name, int p_value)
: name(p_name),
value(p_value) {
_GlobalConstant(const char *p_name, int p_value) :
name(p_name),
value(p_value) {
}
#endif
};

View file

@ -63,9 +63,9 @@ public:
TData data;
Pair() {}
Pair(const TKey &p_key, const TData &p_data)
: key(p_key),
data(p_data) {
Pair(const TKey &p_key, const TData &p_data) :
key(p_key),
data(p_data) {
}
};

View file

@ -44,10 +44,10 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
ERR_FAIL_COND_V(p_target.get_type() != p_source.get_type(), p_target);
switch (p_source.get_type()) {
/* clang-format makes a mess of this macro usage */
/* clang-format off */
/* clang-format makes a mess of this macro usage */
/* clang-format off */
switch (p_source.get_type()) {
case Variant::VECTOR2: {
@ -174,9 +174,8 @@ Variant fieldwise_assign(const Variant &p_target, const Variant &p_source, const
default: {
ERR_FAIL_V(p_target);
}
/* clang-format on */
}
/* clang-format on */
}
#endif // TOOLS_ENABLED

View file

@ -313,9 +313,9 @@ bool FileAccessPack::file_exists(const String &p_name) {
return false;
}
FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file)
: pf(p_file),
f(FileAccess::open(pf.pack, FileAccess::READ)) {
FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) :
pf(p_file),
f(FileAccess::open(pf.pack, FileAccess::READ)) {
if (!f) {
ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack));
ERR_FAIL_COND(!f);

View file

@ -159,8 +159,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
r_variant = str;
} break;
// math types
// math types
case Variant::VECTOR2: {
ERR_FAIL_COND_V(len < (int)4 * 2, ERR_INVALID_DATA);
@ -959,8 +959,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
_encode_string(p_variant, buf, r_len);
} break;
// math types
// math types
case Variant::VECTOR2: {
if (buf) {

View file

@ -90,9 +90,9 @@ public:
PropertyInfo option;
Variant default_value;
ImportOption(const PropertyInfo &p_info, const Variant &p_default)
: option(p_info),
default_value(p_default) {
ImportOption(const PropertyInfo &p_info, const Variant &p_default) :
option(p_info),
default_value(p_default) {
}
ImportOption() {}
};

View file

@ -59,8 +59,8 @@ class AStar : public Reference {
Point *prev_point;
real_t distance;
Point()
: list(this) {}
Point() :
list(this) {}
};
Map<int, Point *> points;

View file

@ -101,9 +101,9 @@ public:
operator String() const;
_FORCE_INLINE_ AABB() {}
inline AABB(const Vector3 &p_pos, const Vector3 &p_size)
: position(p_pos),
size(p_size) {
inline AABB(const Vector3 &p_pos, const Vector3 &p_size) :
position(p_pos),
size(p_size) {
}
};

View file

@ -577,11 +577,11 @@ BSP_Tree::BSP_Tree(const PoolVector<Face3> &p_faces, real_t p_error_radius) {
error_radius = p_error_radius;
}
BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB &p_aabb, real_t p_error_radius)
: nodes(p_nodes),
planes(p_planes),
aabb(p_aabb),
error_radius(p_error_radius) {
BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB &p_aabb, real_t p_error_radius) :
nodes(p_nodes),
planes(p_planes),
aabb(p_aabb),
error_radius(p_error_radius) {
}
BSP_Tree::~BSP_Tree() {

View file

@ -195,9 +195,8 @@ bool Face3::intersects_aabb(const AABB &p_aabb) const {
if (!p_aabb.intersects_plane(get_plane()))
return false;
/** TEST FACE AXIS */
#define TEST_AXIS(m_ax) \
/** TEST FACE AXIS */ \
{ \
real_t aabb_min = p_aabb.position.m_ax; \
real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \

View file

@ -385,13 +385,13 @@ struct Rect2 {
operator String() const { return String(position) + ", " + String(size); }
Rect2() {}
Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height)
: position(Point2(p_x, p_y)),
size(Size2(p_width, p_height)) {
Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) :
position(Point2(p_x, p_y)),
size(Size2(p_width, p_height)) {
}
Rect2(const Point2 &p_pos, const Size2 &p_size)
: position(p_pos),
size(p_size) {
Rect2(const Point2 &p_pos, const Size2 &p_size) :
position(p_pos),
size(p_size) {
}
};
@ -578,18 +578,18 @@ struct Rect2i {
operator String() const { return String(position) + ", " + String(size); }
operator Rect2() const { return Rect2(position, size); }
Rect2i(const Rect2 &p_r2)
: position(p_r2.position),
size(p_r2.size) {
Rect2i(const Rect2 &p_r2) :
position(p_r2.position),
size(p_r2.size) {
}
Rect2i() {}
Rect2i(int p_x, int p_y, int p_width, int p_height)
: position(Point2(p_x, p_y)),
size(Size2(p_width, p_height)) {
Rect2i(int p_x, int p_y, int p_width, int p_height) :
position(Point2(p_x, p_y)),
size(Size2(p_width, p_height)) {
}
Rect2i(const Point2 &p_pos, const Size2 &p_size)
: position(p_pos),
size(p_size) {
Rect2i(const Point2 &p_pos, const Size2 &p_size) :
position(p_pos),
size(p_size) {
}
};

View file

@ -272,7 +272,7 @@ public:
#elif defined(_MSC_VER) && _MSC_VER < 1800
__asm fld a __asm fistp b
/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
// use AT&T inline assembly style, document that
// we use memory as output (=m) and input (m)
__asm__ __volatile__ (

View file

@ -74,9 +74,9 @@ public:
operator String() const;
_FORCE_INLINE_ Plane() { d = 0; }
_FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d)
: normal(p_a, p_b, p_c),
d(p_d){};
_FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) :
normal(p_a, p_b, p_c),
d(p_d){};
_FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d);
_FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal);
@ -100,14 +100,14 @@ bool Plane::has_point(const Vector3 &p_point, real_t _epsilon) const {
return (dist <= _epsilon);
}
Plane::Plane(const Vector3 &p_normal, real_t p_d)
: normal(p_normal),
d(p_d) {
Plane::Plane(const Vector3 &p_normal, real_t p_d) :
normal(p_normal),
d(p_d) {
}
Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal)
: normal(p_normal),
d(p_normal.dot(p_point)) {
Plane::Plane(const Vector3 &p_point, const Vector3 &p_normal) :
normal(p_normal),
d(p_normal.dot(p_point)) {
}
Plane::Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir) {

View file

@ -208,7 +208,7 @@ Transform::operator String() const {
return basis.operator String() + " - " + origin.operator String();
}
Transform::Transform(const Basis &p_basis, const Vector3 &p_origin)
: basis(p_basis),
origin(p_origin) {
Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) :
basis(p_basis),
origin(p_origin) {
}

View file

@ -126,9 +126,9 @@ MethodInfo::operator Dictionary() const {
return d;
}
MethodInfo::MethodInfo()
: flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo() :
flags(METHOD_FLAG_NORMAL),
id(0) {
}
MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
@ -164,48 +164,48 @@ MethodInfo MethodInfo::from_dict(const Dictionary &p_dict) {
return mi;
}
MethodInfo::MethodInfo(const String &p_name)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const String &p_name) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
}
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
}
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
}
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
}
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
arguments.push_back(p_param4);
}
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
@ -213,48 +213,48 @@ MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const
arguments.push_back(p_param5);
}
MethodInfo::MethodInfo(Variant::Type ret)
: flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(Variant::Type ret) :
flags(METHOD_FLAG_NORMAL),
id(0) {
return_val.type = ret;
}
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
return_val.type = ret;
}
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
return_val.type = ret;
arguments.push_back(p_param1);
}
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
}
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
}
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
@ -262,10 +262,10 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn
arguments.push_back(p_param4);
}
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
id(0) {
return_val.type = ret;
arguments.push_back(p_param1);
arguments.push_back(p_param2);
@ -274,56 +274,56 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyIn
arguments.push_back(p_param5);
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name)
: name(p_name),
flags(METHOD_FLAG_NORMAL),
return_val(p_ret),
id(0) {
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name) :
name(p_name),
flags(METHOD_FLAG_NORMAL),
return_val(p_ret),
id(0) {
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1)
: name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1) :
name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2)
: name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3)
: name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3) :
name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4)
: name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4) :
name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);
arguments.push_back(p_param4);
}
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5)
: name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
MethodInfo::MethodInfo(const PropertyInfo &p_ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2, const PropertyInfo &p_param3, const PropertyInfo &p_param4, const PropertyInfo &p_param5) :
name(p_name),
return_val(p_ret),
flags(METHOD_FLAG_NORMAL),
id(0) {
arguments.push_back(p_param1);
arguments.push_back(p_param2);
arguments.push_back(p_param3);

View file

@ -1,4 +1,4 @@
/*************************************************************************/
/*************************************************************************/
/* object.h */
/*************************************************************************/
/* This file is part of: */
@ -144,18 +144,18 @@ struct PropertyInfo {
static PropertyInfo from_dict(const Dictionary &p_dict);
PropertyInfo()
: type(Variant::NIL),
hint(PROPERTY_HINT_NONE),
usage(PROPERTY_USAGE_DEFAULT) {
PropertyInfo() :
type(Variant::NIL),
hint(PROPERTY_HINT_NONE),
usage(PROPERTY_USAGE_DEFAULT) {
}
PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName())
: type(p_type),
name(p_name),
hint(p_hint),
hint_string(p_hint_string),
usage(p_usage) {
PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) :
type(p_type),
name(p_name),
hint(p_hint),
hint_string(p_hint_string),
usage(p_usage) {
if (hint == PROPERTY_HINT_RESOURCE_TYPE) {
class_name = hint_string;
@ -164,11 +164,11 @@ struct PropertyInfo {
}
}
PropertyInfo(const StringName &p_class_name)
: type(Variant::OBJECT),
class_name(p_class_name),
hint(PROPERTY_HINT_NONE),
usage(PROPERTY_USAGE_DEFAULT) {
PropertyInfo(const StringName &p_class_name) :
type(Variant::OBJECT),
class_name(p_class_name),
hint(PROPERTY_HINT_NONE),
usage(PROPERTY_USAGE_DEFAULT) {
}
bool operator<(const PropertyInfo &p_info) const {
@ -428,9 +428,9 @@ private:
_FORCE_INLINE_ bool operator<(const Target &p_target) const { return (_id == p_target._id) ? (method < p_target.method) : (_id < p_target._id); }
Target(const ObjectID &p_id, const StringName &p_method)
: _id(p_id),
method(p_method) {
Target(const ObjectID &p_id, const StringName &p_method) :
_id(p_id),
method(p_method) {
}
Target() { _id = 0; }
};

View file

@ -68,8 +68,10 @@ public:
}
public:
_FORCE_INLINE_ Element()
: list_element(NULL), prev_element(NULL), next_element(NULL) {
_FORCE_INLINE_ Element() :
list_element(NULL),
prev_element(NULL),
next_element(NULL) {
}
Element next() const {
@ -80,10 +82,10 @@ public:
return Element(prev_element);
}
Element(const Element &other)
: list_element(other.list_element),
prev_element(other.prev_element),
next_element(other.next_element) {
Element(const Element &other) :
list_element(other.list_element),
prev_element(other.prev_element),
next_element(other.next_element) {
}
Element &operator=(const Element &other) {
@ -135,17 +137,17 @@ public:
const typename InternalList::Element *list_element;
ConstElement(const typename InternalList::Element *p_element)
: list_element(p_element) {
ConstElement(const typename InternalList::Element *p_element) :
list_element(p_element) {
}
public:
_FORCE_INLINE_ ConstElement()
: list_element(NULL) {
_FORCE_INLINE_ ConstElement() :
list_element(NULL) {
}
ConstElement(const ConstElement &other)
: list_element(other.list_element) {
ConstElement(const ConstElement &other) :
list_element(other.list_element) {
}
ConstElement &operator=(const ConstElement &other) {

View file

@ -37,9 +37,9 @@ struct Pair {
S second;
Pair() {}
Pair(F p_first, const S &p_second)
: first(p_first),
second(p_second) {
Pair(F p_first, const S &p_second) :
first(p_first),
second(p_second) {
}
};

View file

@ -58,18 +58,18 @@ protected:
Variant initial;
bool hide_from_editor;
bool overrided;
VariantContainer()
: order(0),
persist(false),
hide_from_editor(false),
overrided(false) {
VariantContainer() :
order(0),
persist(false),
hide_from_editor(false),
overrided(false) {
}
VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false)
: order(p_order),
persist(p_persist),
variant(p_variant),
hide_from_editor(false),
overrided(false) {
VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) :
order(p_order),
persist(p_persist),
variant(p_variant),
hide_from_editor(false),
overrided(false) {
}
};

View file

@ -378,8 +378,8 @@ void Resource::_bind_methods() {
BIND_VMETHOD(MethodInfo("_setup_local_to_scene"));
}
Resource::Resource()
: remapped_list(this) {
Resource::Resource() :
remapped_list(this) {
#ifdef TOOLS_ENABLED
last_modified_time = 0;

View file

@ -57,7 +57,7 @@
return m_val; \
}
_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw) {
_ALWAYS_INLINE_ uint32_t _atomic_conditional_increment_impl(register uint32_t *pw){
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONG, InterlockedCompareExchange, uint32_t)
}
@ -82,12 +82,12 @@ _ALWAYS_INLINE_ uint32_t _atomic_add_impl(register uint32_t *pw, register uint32
return InterlockedAdd((LONG volatile *)pw, val);
}
_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val) {
_ALWAYS_INLINE_ uint32_t _atomic_exchange_if_greater_impl(register uint32_t *pw, register uint32_t val){
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONG, InterlockedCompareExchange, uint32_t)
}
_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw) {
_ALWAYS_INLINE_ uint64_t _atomic_conditional_increment_impl(register uint64_t *pw){
ATOMIC_CONDITIONAL_INCREMENT_BODY(pw, LONGLONG, InterlockedCompareExchange64, uint64_t)
}
@ -112,7 +112,7 @@ _ALWAYS_INLINE_ uint64_t _atomic_add_impl(register uint64_t *pw, register uint64
return InterlockedAdd64((LONGLONG volatile *)pw, val);
}
_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val) {
_ALWAYS_INLINE_ uint64_t _atomic_exchange_if_greater_impl(register uint64_t *pw, register uint64_t val){
ATOMIC_EXCHANGE_IF_GREATER_BODY(pw, val, LONGLONG, InterlockedCompareExchange64, uint64_t)
}

View file

@ -989,25 +989,25 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
ScriptDebuggerRemote::ScriptDebuggerRemote()
: profiling(false),
max_frame_functions(16),
skip_profile_frame(false),
reload_all_scripts(false),
tcp_client(StreamPeerTCP::create_ref()),
packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))),
last_perf_time(0),
performance(Engine::get_singleton()->get_singleton_object("Performance")),
requested_quit(false),
mutex(Mutex::create()),
max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")),
char_count(0),
last_msec(0),
msec_count(0),
locking(false),
poll_every(0),
request_scene_tree(NULL),
live_edit_funcs(NULL) {
ScriptDebuggerRemote::ScriptDebuggerRemote() :
profiling(false),
max_frame_functions(16),
skip_profile_frame(false),
reload_all_scripts(false),
tcp_client(StreamPeerTCP::create_ref()),
packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))),
last_perf_time(0),
performance(Engine::get_singleton()->get_singleton_object("Performance")),
requested_quit(false),
mutex(Mutex::create()),
max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")),
char_count(0),
last_msec(0),
msec_count(0),
locking(false),
poll_every(0),
request_scene_tree(NULL),
live_edit_funcs(NULL) {
packet_peer_stream->set_stream_peer(tcp_client);
packet_peer_stream->set_output_buffer_max_size(1024 * 1024 * 8); //8mb should be way more than enough

View file

@ -387,10 +387,10 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c
//change notify
}
PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner)
: owner(p_owner),
language(p_language),
script(p_script) {
PlaceHolderScriptInstance::PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref<Script> p_script, Object *p_owner) :
owner(p_owner),
language(p_language),
script(p_script) {
}
PlaceHolderScriptInstance::~PlaceHolderScriptInstance() {

View file

@ -876,8 +876,8 @@ void Translation::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "locale"), "set_locale", "get_locale");
}
Translation::Translation()
: locale("en") {
Translation::Translation() :
locale("en") {
}
///////////////////////////////////////////////
@ -1163,9 +1163,9 @@ void TranslationServer::load_translations() {
}
}
TranslationServer::TranslationServer()
: locale("en"),
enabled(true) {
TranslationServer::TranslationServer() :
locale("en"),
enabled(true) {
singleton = this;
for (int i = 0; locale_list[i]; ++i) {

View file

@ -73,7 +73,7 @@ T *_nullptr() {
#define OFFSET_OF(st, m) \
((size_t)((char *)&(_nullptr<st>()->m) - (char *)0))
/**
/**
* Some platforms (devices) not define NULL
*/
@ -81,7 +81,7 @@ T *_nullptr() {
#define NULL 0
#endif
/**
/**
* Windows defines a lot of badly stuff we'll never ever use. undefine it.
*/
@ -103,7 +103,7 @@ T *_nullptr() {
#include "error_list.h"
#include "error_macros.h"
/** Generic ABS function, for math uses please use Math::abs */
/** Generic ABS function, for math uses please use Math::abs */
#ifndef ABS
#define ABS(m_v) ((m_v < 0) ? (-(m_v)) : (m_v))

View file

@ -67,7 +67,6 @@ String Variant::get_type_name(Variant::Type p_type) {
} break;
// math types
case VECTOR2: {
return "Vector2";
@ -725,7 +724,6 @@ bool Variant::is_zero() const {
} break;
// math types
case VECTOR2: {
return *reinterpret_cast<const Vector2 *>(_data._mem) == Vector2();
@ -934,7 +932,6 @@ void Variant::reference(const Variant &p_variant) {
} break;
// math types
case VECTOR2: {
memnew_placement(_data._mem, Vector2(*reinterpret_cast<const Vector2 *>(p_variant._data._mem)));
@ -2506,7 +2503,6 @@ void Variant::operator=(const Variant &p_variant) {
} break;
// math types
case VECTOR2: {
*reinterpret_cast<Vector2 *>(_data._mem) = *reinterpret_cast<const Vector2 *>(p_variant._data._mem);
@ -2645,8 +2641,8 @@ uint32_t Variant::hash() const {
return reinterpret_cast<const String *>(_data._mem)->hash();
} break;
// math types
// math types
case VECTOR2: {
uint32_t hash = hash_djb2_one_float(reinterpret_cast<const Vector2 *>(_data._mem)->x);

View file

@ -130,9 +130,9 @@ struct _VariantCall {
StringName name;
Variant::Type type;
Arg() { type = Variant::NIL; }
Arg(Variant::Type p_type, const StringName &p_name)
: name(p_name),
type(p_type) {
Arg(Variant::Type p_type, const StringName &p_name) :
name(p_name),
type(p_type) {
}
};

View file

@ -153,7 +153,7 @@ static Vector<Vector<Vector2> > _b2d_decompose(const Vector<Vector2> &p_polygon)
delete p;
return res; // pdarray; //needs to be deleted after body is created
}
}
} // namespace b2ConvexDecomp
Vector<Vector<Vector2> > b2d_decompose(const Vector<Vector2> &p_polygon) {

View file

@ -1134,18 +1134,6 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
state.current_depth_draw = p_material->shader->spatial.depth_draw_mode;
}
//glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
/*
if (p_material->flags[VS::MATERIAL_FLAG_WIREFRAME])
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
else
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
if (p_material->line_width)
glLineWidth(p_material->line_width);
*/
#if 0
//blend mode
if (state.current_blend_mode!=p_material->shader->spatial.blend_mode) {

View file

@ -486,8 +486,8 @@ public:
bool uses_vertex_time;
bool uses_fragment_time;
Shader()
: dirty_list(this) {
Shader() :
dirty_list(this) {
shader = NULL;
ubo_size = 0;
@ -540,8 +540,9 @@ public:
bool can_cast_shadow_cache;
bool is_animated_cache;
Material()
: list(this), dirty_list(this) {
Material() :
list(this),
dirty_list(this) {
can_cast_shadow_cache = false;
is_animated_cache = false;
shader = NULL;
@ -764,8 +765,9 @@ public:
bool dirty_aabb;
bool dirty_data;
MultiMesh()
: update_list(this), mesh_list(this) {
MultiMesh() :
update_list(this),
mesh_list(this) {
dirty_aabb = true;
dirty_data = true;
xform_floats = 0;
@ -865,8 +867,8 @@ public:
SelfList<Skeleton> update_list;
Set<RasterizerScene::InstanceBase *> instances; //instances using skeleton
Skeleton()
: update_list(this) {
Skeleton() :
update_list(this) {
size = 0;
use_2d = false;
@ -1116,8 +1118,8 @@ public:
Transform emission_transform;
Particles()
: particle_element(this) {
Particles() :
particle_element(this) {
cycle_number = 0;
emitting = false;
one_shot = false;

View file

@ -149,10 +149,7 @@ void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const {
while (true) {
addrs = (IP_ADAPTER_ADDRESSES *)memalloc(buf_size);
int err = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST |
GAA_FLAG_SKIP_MULTICAST |
GAA_FLAG_SKIP_DNS_SERVER |
GAA_FLAG_SKIP_FRIENDLY_NAME,
int err = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME,
NULL, addrs, &buf_size);
if (err == NO_ERROR) {
break;

View file

@ -48,8 +48,8 @@ class AudioDriverXAudio2 : public AudioDriver {
struct XAudio2DriverVoiceCallback : public IXAudio2VoiceCallback {
HANDLE buffer_end_event;
XAudio2DriverVoiceCallback()
: buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {}
XAudio2DriverVoiceCallback() :
buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {}
void STDMETHODCALLTYPE OnBufferEnd(void *pBufferContext) { /*print_line("buffer ended");*/
SetEvent(buffer_end_event);
}

View file

@ -122,8 +122,9 @@ struct SharedObject {
String path;
Vector<String> tags;
SharedObject(const String &p_path, const Vector<String> &p_tags)
: path(p_path), tags(p_tags) {
SharedObject(const String &p_path, const Vector<String> &p_tags) :
path(p_path),
tags(p_tags) {
}
SharedObject() {}

View file

@ -128,10 +128,12 @@ private:
String path;
bool is_file;
FileOrFolder()
: path(""), is_file(false) {}
FileOrFolder(const String &p_path, bool p_is_file)
: path(p_path), is_file(p_is_file) {}
FileOrFolder() :
path(""),
is_file(false) {}
FileOrFolder(const String &p_path, bool p_is_file) :
path(p_path),
is_file(p_is_file) {}
};
FileOrFolder to_rename;
Vector<FileOrFolder> to_move;

View file

@ -1913,8 +1913,6 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
/*************************************** SCENE ***********************************/
/*********************************************************************************/
#define DEBUG_ANIMATION
uint32_t EditorSceneImporterCollada::get_import_flags() const {
return IMPORT_SCENE | IMPORT_ANIMATION;

View file

@ -32,18 +32,21 @@
#include "canvas_item_editor_plugin.h"
#include "core/os/keyboard.h"
AbstractPolygon2DEditor::Vertex::Vertex()
: polygon(-1), vertex(-1) {
AbstractPolygon2DEditor::Vertex::Vertex() :
polygon(-1),
vertex(-1) {
// invalid vertex
}
AbstractPolygon2DEditor::Vertex::Vertex(int p_vertex)
: polygon(-1), vertex(p_vertex) {
AbstractPolygon2DEditor::Vertex::Vertex(int p_vertex) :
polygon(-1),
vertex(p_vertex) {
// vertex p_vertex of current wip polygon
}
AbstractPolygon2DEditor::Vertex::Vertex(int p_polygon, int p_vertex)
: polygon(p_polygon), vertex(p_vertex) {
AbstractPolygon2DEditor::Vertex::Vertex(int p_polygon, int p_vertex) :
polygon(p_polygon),
vertex(p_vertex) {
// vertex p_vertex of polygon p_polygon
}
@ -66,12 +69,14 @@ AbstractPolygon2DEditor::PosVertex::PosVertex() {
// invalid vertex
}
AbstractPolygon2DEditor::PosVertex::PosVertex(const Vertex &p_vertex, const Vector2 &p_pos)
: Vertex(p_vertex.polygon, p_vertex.vertex), pos(p_pos) {
AbstractPolygon2DEditor::PosVertex::PosVertex(const Vertex &p_vertex, const Vector2 &p_pos) :
Vertex(p_vertex.polygon, p_vertex.vertex),
pos(p_pos) {
}
AbstractPolygon2DEditor::PosVertex::PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos)
: Vertex(p_polygon, p_vertex), pos(p_pos) {
AbstractPolygon2DEditor::PosVertex::PosVertex(int p_polygon, int p_vertex, const Vector2 &p_pos) :
Vertex(p_polygon, p_vertex),
pos(p_pos) {
}
bool AbstractPolygon2DEditor::_is_empty() const {

View file

@ -69,8 +69,8 @@ class SnapDialog : public ConfirmationDialog {
SpinBox *rotation_step;
public:
SnapDialog()
: ConfirmationDialog() {
SnapDialog() :
ConfirmationDialog() {
const int SPIN_BOX_GRID_RANGE = 256;
const int SPIN_BOX_ROTATION_RANGE = 360;
Label *label;

View file

@ -39,10 +39,10 @@ void CollisionPolygon2DEditor::_set_node(Node *p_polygon) {
node = Object::cast_to<CollisionPolygon2D>(p_polygon);
}
CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor)
: AbstractPolygon2DEditor(p_editor) {
CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) :
AbstractPolygon2DEditor(p_editor) {
}
CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node)
: AbstractPolygon2DEditorPlugin(p_node, memnew(CollisionPolygon2DEditor(p_node)), "CollisionPolygon2D") {
CollisionPolygon2DEditorPlugin::CollisionPolygon2DEditorPlugin(EditorNode *p_node) :
AbstractPolygon2DEditorPlugin(p_node, memnew(CollisionPolygon2DEditor(p_node)), "CollisionPolygon2D") {
}

View file

@ -586,8 +586,10 @@ struct CanvasItemPlotCurve {
Color color1;
Color color2;
CanvasItemPlotCurve(CanvasItem &p_ci, Color p_color1, Color p_color2)
: ci(p_ci), color1(p_color1), color2(p_color2) {}
CanvasItemPlotCurve(CanvasItem &p_ci, Color p_color1, Color p_color2) :
ci(p_ci),
color1(p_color1),
color2(p_color2) {}
void operator()(Vector2 pos0, Vector2 pos1, bool in_definition) {
ci.draw_line(pos0, pos1, in_definition ? color1 : color2);

View file

@ -61,10 +61,10 @@ void Line2DEditor::_action_set_polygon(int p_idx, const Variant &p_previous, con
undo_redo->add_undo_method(node, "set_points", p_previous);
}
Line2DEditor::Line2DEditor(EditorNode *p_editor)
: AbstractPolygon2DEditor(p_editor) {
Line2DEditor::Line2DEditor(EditorNode *p_editor) :
AbstractPolygon2DEditor(p_editor) {
}
Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node)
: AbstractPolygon2DEditorPlugin(p_node, memnew(Line2DEditor(p_node)), "Line2D") {
Line2DEditorPlugin::Line2DEditorPlugin(EditorNode *p_node) :
AbstractPolygon2DEditorPlugin(p_node, memnew(Line2DEditor(p_node)), "Line2D") {
}

View file

@ -120,10 +120,10 @@ void NavigationPolygonEditor::_create_resource() {
_menu_option(MODE_CREATE);
}
NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor)
: AbstractPolygon2DEditor(p_editor) {
NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) :
AbstractPolygon2DEditor(p_editor) {
}
NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin(EditorNode *p_node)
: AbstractPolygon2DEditorPlugin(p_node, memnew(NavigationPolygonEditor(p_node)), "NavigationPolygonInstance") {
NavigationPolygonEditorPlugin::NavigationPolygonEditorPlugin(EditorNode *p_node) :
AbstractPolygon2DEditorPlugin(p_node, memnew(NavigationPolygonEditor(p_node)), "NavigationPolygonInstance") {
}

View file

@ -459,8 +459,8 @@ Vector2 Polygon2DEditor::snap_point(Vector2 p_target) const {
return p_target;
}
Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor)
: AbstractPolygon2DEditor(p_editor) {
Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
AbstractPolygon2DEditor(p_editor) {
snap_step = Vector2(10, 10);
use_snap = false;
@ -609,6 +609,6 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor)
uv_edit_draw->set_clip_contents(true);
}
Polygon2DEditorPlugin::Polygon2DEditorPlugin(EditorNode *p_node)
: AbstractPolygon2DEditorPlugin(p_node, memnew(Polygon2DEditor(p_node)), "Polygon2D") {
Polygon2DEditorPlugin::Polygon2DEditorPlugin(EditorNode *p_node) :
AbstractPolygon2DEditorPlugin(p_node, memnew(Polygon2DEditor(p_node)), "Polygon2D") {
}

View file

@ -3740,8 +3740,8 @@ void PropertyEditor::_item_edited() {
_edit_set(name, item->get_text(1), refresh_all);
}
} break;
// math types
// math types
case Variant::VECTOR3: {
} break;

1
main/main.cpp Executable file → Normal file
View file

@ -168,7 +168,6 @@ static String get_full_version_string() {
}
//#define DEBUG_INIT
#ifdef DEBUG_INIT
#define MAIN_PRINT(m_txt) print_line(m_txt)
#else

View file

@ -1057,7 +1057,7 @@ MainLoop *test(TestType p_type) {
return NULL;
}
}
} // namespace TestGDScript
#else
@ -1067,6 +1067,6 @@ MainLoop *test(TestType p_type) {
return NULL;
}
}
} // namespace TestGDScript
#endif

View file

@ -42,6 +42,6 @@ enum TestType {
};
MainLoop *test(TestType p_type);
}
} // namespace TestGDScript
#endif // TEST_GDSCRIPT_H

View file

@ -65,4 +65,4 @@ MainLoop *test() {
return memnew(TestMainLoop);
}
}
} // namespace TestImage

View file

@ -118,7 +118,7 @@ MainLoop *test() {
return memnew(TestMainLoop);
}
}
} // namespace TestIO
#else
@ -128,5 +128,5 @@ MainLoop *test() {
return NULL;
}
}
} // namespace TestIO
#endif

View file

@ -684,4 +684,4 @@ MainLoop *test() {
return NULL;
}
}
} // namespace TestMath

View file

@ -435,4 +435,4 @@ MainLoop *test() {
return memnew(TestPhysicsMainLoop);
}
}
} // namespace TestPhysics

View file

@ -431,4 +431,4 @@ MainLoop *test() {
return memnew(TestPhysics2DMainLoop);
}
}
} // namespace TestPhysics2D

View file

@ -241,4 +241,4 @@ MainLoop *test() {
return memnew(TestMainLoop);
}
}
} // namespace TestRender

View file

@ -339,4 +339,4 @@ MainLoop *test() {
return NULL;
}
}
} // namespace TestShaderLang

View file

@ -919,4 +919,4 @@ MainLoop *test() {
return NULL;
}
}
} // namespace TestString

View file

@ -37,19 +37,19 @@
#include "collision_object_bullet.h"
#include "space_bullet.h"
AreaBullet::AreaBullet()
: RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA),
monitorable(true),
isScratched(false),
spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED),
spOv_gravityPoint(false),
spOv_gravityPointDistanceScale(0),
spOv_gravityPointAttenuation(1),
spOv_gravityVec(0, -1, 0),
spOv_gravityMag(10),
spOv_linearDump(0.1),
spOv_angularDump(1),
spOv_priority(0) {
AreaBullet::AreaBullet() :
RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA),
monitorable(true),
isScratched(false),
spOv_mode(PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED),
spOv_gravityPoint(false),
spOv_gravityPointDistanceScale(0),
spOv_gravityPointAttenuation(1),
spOv_gravityVec(0, -1, 0),
spOv_gravityMag(10),
spOv_linearDump(0.1),
spOv_angularDump(1),
spOv_priority(0) {
btGhost = bulletnew(btGhostObject);
btGhost->setCollisionShape(compoundShape);

View file

@ -47,8 +47,8 @@ public:
ObjectID event_callback_id;
StringName event_callback_method;
InOutEventCallback()
: event_callback_id(0) {}
InOutEventCallback() :
event_callback_id(0) {}
};
enum OverlapState {
@ -62,10 +62,12 @@ public:
CollisionObjectBullet *object;
OverlapState state;
OverlappingObjectData()
: object(NULL), state(OVERLAP_STATE_ENTER) {}
OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state)
: object(p_object), state(p_state) {}
OverlappingObjectData() :
object(NULL),
state(OVERLAP_STATE_ENTER) {}
OverlappingObjectData(CollisionObjectBullet *p_object, OverlapState p_state) :
object(p_object),
state(p_state) {}
OverlappingObjectData(const OverlappingObjectData &other) {
operator=(other);
}

View file

@ -33,9 +33,9 @@
#include "LinearMath/btAabbUtil2.h"
#include "math/math_funcs.h"
btRayShape::btRayShape(btScalar length)
: btConvexInternalShape(),
m_shapeAxis(0, 0, 1) {
btRayShape::btRayShape(btScalar length) :
btConvexInternalShape(),
m_shapeAxis(0, 0, 1) {
m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE;
setLength(length);
}

View file

@ -78,10 +78,10 @@ void BulletPhysicsServer::_bind_methods() {
//ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer::DoTest);
}
BulletPhysicsServer::BulletPhysicsServer()
: PhysicsServer(),
active(true),
active_spaces_count(0) {}
BulletPhysicsServer::BulletPhysicsServer() :
PhysicsServer(),
active(true),
active_spaces_count(0) {}
BulletPhysicsServer::~BulletPhysicsServer() {}

View file

@ -50,8 +50,14 @@ void CollisionObjectBullet::ShapeWrapper::set_transform(const btTransform &p_tra
transform = p_transform;
}
CollisionObjectBullet::CollisionObjectBullet(Type p_type)
: RIDBullet(), space(NULL), type(p_type), collisionsEnabled(true), m_isStatic(false), bt_collision_object(NULL), body_scale(1., 1., 1.) {}
CollisionObjectBullet::CollisionObjectBullet(Type p_type) :
RIDBullet(),
space(NULL),
type(p_type),
collisionsEnabled(true),
m_isStatic(false),
bt_collision_object(NULL),
body_scale(1., 1., 1.) {}
CollisionObjectBullet::~CollisionObjectBullet() {
// Remove all overlapping
@ -165,8 +171,9 @@ const btTransform &CollisionObjectBullet::get_transform__bullet() const {
return bt_collision_object->getWorldTransform();
}
RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type)
: CollisionObjectBullet(p_type), compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) {
RigidCollisionObjectBullet::RigidCollisionObjectBullet(Type p_type) :
CollisionObjectBullet(p_type),
compoundShape(bulletnew(btCompoundShape(enableDynamicAabbTree, initialChildCapacity))) {
}
RigidCollisionObjectBullet::~RigidCollisionObjectBullet() {

View file

@ -70,16 +70,22 @@ public:
btTransform transform;
bool active;
ShapeWrapper()
: shape(NULL), bt_shape(NULL), active(true) {}
ShapeWrapper() :
shape(NULL),
bt_shape(NULL),
active(true) {}
ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active)
: shape(p_shape), bt_shape(NULL), active(p_active) {
ShapeWrapper(ShapeBullet *p_shape, const btTransform &p_transform, bool p_active) :
shape(p_shape),
bt_shape(NULL),
active(p_active) {
set_transform(p_transform);
}
ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active)
: shape(p_shape), bt_shape(NULL), active(p_active) {
ShapeWrapper(ShapeBullet *p_shape, const Transform &p_transform, bool p_active) :
shape(p_shape),
bt_shape(NULL),
active(p_active) {
set_transform(p_transform);
}
~ShapeWrapper();

View file

@ -35,8 +35,8 @@
#include "bullet_utilities.h"
#include "rigid_body_bullet.h"
ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame)
: JointBullet() {
ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &rbAFrame, const Transform &rbBFrame) :
JointBullet() {
btTransform btFrameA;
G_TO_B(rbAFrame, btFrameA);
if (rbB) {

View file

@ -33,8 +33,9 @@
#include "collision_object_bullet.h"
#include "space_bullet.h"
ConstraintBullet::ConstraintBullet()
: space(NULL), constraint(NULL) {}
ConstraintBullet::ConstraintBullet() :
space(NULL),
constraint(NULL) {}
void ConstraintBullet::setup(btTypedConstraint *p_constraint) {
constraint = p_constraint;

View file

@ -35,8 +35,8 @@
#include "bullet_utilities.h"
#include "rigid_body_bullet.h"
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA)
: JointBullet() {
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) :
JointBullet() {
btTransform btFrameA;
G_TO_B(frameInA, btFrameA);

View file

@ -34,8 +34,8 @@
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
#include "godot_ray_world_algorithm.h"
GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo)
: btDefaultCollisionConfiguration(constructionInfo) {
GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo) :
btDefaultCollisionConfiguration(constructionInfo) {
void *mem = NULL;

View file

@ -34,8 +34,8 @@
const int GodotCollisionDispatcher::CASTED_TYPE_AREA = static_cast<int>(CollisionObjectBullet::TYPE_AREA);
GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration)
: btCollisionDispatcher(collisionConfiguration) {}
GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration) :
btCollisionDispatcher(collisionConfiguration) {}
bool GodotCollisionDispatcher::needsCollision(const btCollisionObject *body0, const btCollisionObject *body1) {
if (body0->getUserIndex() == CASTED_TYPE_AREA || body1->getUserIndex() == CASTED_TYPE_AREA) {

View file

@ -51,10 +51,10 @@ class GodotMotionState : public btMotionState {
RigidBodyBullet *owner;
public:
GodotMotionState(RigidBodyBullet *p_owner)
: bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
owner(p_owner) {}
GodotMotionState(RigidBodyBullet *p_owner) :
bodyKinematicWorldTransf(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
bodyCurrentWorldTransform(btMatrix3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), btVector3(0., 0., 0.)),
owner(p_owner) {}
/// IMPORTANT DON'T USE THIS FUNCTION TO KNOW THE CURRENT BODY TRANSFORM
/// This class is used internally by Bullet

View file

@ -34,18 +34,18 @@
#include "btRayShape.h"
#include "collision_object_bullet.h"
GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world)
: m_world(world) {}
GodotRayWorldAlgorithm::CreateFunc::CreateFunc(const btDiscreteDynamicsWorld *world) :
m_world(world) {}
GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world)
: m_world(world) {}
GodotRayWorldAlgorithm::SwappedCreateFunc::SwappedCreateFunc(const btDiscreteDynamicsWorld *world) :
m_world(world) {}
GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
: btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap),
m_manifoldPtr(mf),
m_ownManifold(false),
m_world(world),
m_isSwapped(isSwapped) {}
GodotRayWorldAlgorithm::GodotRayWorldAlgorithm(const btDiscreteDynamicsWorld *world, btPersistentManifold *mf, const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped) :
btActivatingCollisionAlgorithm(ci, body0Wrap, body1Wrap),
m_manifoldPtr(mf),
m_ownManifold(false),
m_world(world),
m_isSwapped(isSwapped) {}
GodotRayWorldAlgorithm::~GodotRayWorldAlgorithm() {
if (m_ownManifold && m_manifoldPtr) {

View file

@ -52,8 +52,10 @@ struct GodotClosestRayResultCallback : public btCollisionWorld::ClosestRayResult
bool m_pickRay;
public:
GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude)
: btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld), m_exclude(p_exclude), m_pickRay(false) {}
GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude) :
btCollisionWorld::ClosestRayResultCallback(rayFromWorld, rayToWorld),
m_exclude(p_exclude),
m_pickRay(false) {}
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
};
@ -66,8 +68,11 @@ public:
int count;
const Set<RID> *m_exclude;
GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude)
: m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), count(0) {}
GodotAllConvexResultCallback(PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) :
m_results(p_results),
m_exclude(p_exclude),
m_resultMax(p_resultMax),
count(0) {}
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
@ -79,8 +84,10 @@ public:
const RigidBodyBullet *m_self_object;
const bool m_ignore_areas;
GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas)
: btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_self_object(p_self_object), m_ignore_areas(p_ignore_areas) {}
GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_ignore_areas) :
btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld),
m_self_object(p_self_object),
m_ignore_areas(p_ignore_areas) {}
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
};
@ -90,8 +97,9 @@ public:
const Set<RID> *m_exclude;
int m_shapeId;
GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude)
: btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_exclude(p_exclude) {}
GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude) :
btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld),
m_exclude(p_exclude) {}
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
@ -106,8 +114,12 @@ public:
int m_count;
const Set<RID> *m_exclude;
GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude)
: m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {}
GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude) :
m_self_object(p_self_object),
m_results(p_results),
m_exclude(p_exclude),
m_resultMax(p_resultMax),
m_count(0) {}
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
@ -123,8 +135,12 @@ public:
int m_count;
const Set<RID> *m_exclude;
GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude)
: m_self_object(p_self_object), m_results(p_results), m_exclude(p_exclude), m_resultMax(p_resultMax), m_count(0) {}
GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude) :
m_self_object(p_self_object),
m_results(p_results),
m_exclude(p_exclude),
m_resultMax(p_resultMax),
m_count(0) {}
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
@ -141,8 +157,12 @@ public:
btVector3 m_rest_info_bt_point;
const Set<RID> *m_exclude;
GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude)
: m_self_object(p_self_object), m_result(p_result), m_exclude(p_exclude), m_collided(false), m_min_distance(0) {}
GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState::ShapeRestInfo *p_result, const Set<RID> *p_exclude) :
m_self_object(p_self_object),
m_result(p_result),
m_exclude(p_exclude),
m_collided(false),
m_min_distance(0) {}
virtual bool needsCollision(btBroadphaseProxy *proxy0) const;
@ -158,12 +178,12 @@ struct GodotDeepPenetrationContactResultCallback : public btManifoldResult {
btScalar m_most_penetrated_distance;
GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
: btManifoldResult(body0Wrap, body1Wrap),
m_pointCollisionObject(NULL),
m_penetration_distance(0),
m_other_compound_shape_index(0),
m_most_penetrated_distance(1e20) {}
GodotDeepPenetrationContactResultCallback(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap) :
btManifoldResult(body0Wrap, body1Wrap),
m_pointCollisionObject(NULL),
m_penetration_distance(0),
m_other_compound_shape_index(0),
m_most_penetrated_distance(1e20) {}
void reset() {
m_pointCollisionObject = NULL;

View file

@ -35,8 +35,8 @@
#include "bullet_utilities.h"
#include "rigid_body_bullet.h"
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB)
: JointBullet() {
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameA, const Transform &frameB) :
JointBullet() {
btTransform btFrameA;
G_TO_B(frameA, btFrameA);
@ -53,8 +53,8 @@ HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, c
setup(hingeConstraint);
}
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB)
: JointBullet() {
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB, const Vector3 &axisInA, const Vector3 &axisInB) :
JointBullet() {
btVector3 btPivotA;
btVector3 btAxisA;

View file

@ -32,7 +32,7 @@
#include "joint_bullet.h"
#include "space_bullet.h"
JointBullet::JointBullet()
: ConstraintBullet() {}
JointBullet::JointBullet() :
ConstraintBullet() {}
JointBullet::~JointBullet() {}

View file

@ -34,8 +34,8 @@
#include "bullet_types_converter.h"
#include "rigid_body_bullet.h"
PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b)
: JointBullet() {
PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b) :
JointBullet() {
if (p_body_b) {
btVector3 btPivotA;

View file

@ -176,9 +176,9 @@ PhysicsDirectSpaceState *BulletPhysicsDirectBodyState::get_space_state() {
return body->get_space()->get_direct_state();
}
RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner)
: owner(p_owner),
safe_margin(0.001) {
RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner) :
owner(p_owner),
safe_margin(0.001) {
}
RigidBodyBullet::KinematicUtilities::~KinematicUtilities() {
@ -250,22 +250,22 @@ void RigidBodyBullet::KinematicUtilities::just_delete_shapes(int new_size) {
shapes.resize(new_size);
}
RigidBodyBullet::RigidBodyBullet()
: RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY),
kinematic_utilities(NULL),
gravity_scale(1),
mass(1),
linearDamp(0),
angularDamp(0),
can_sleep(true),
force_integration_callback(NULL),
isTransformChanged(false),
maxCollisionsDetection(0),
collisionsCount(0),
maxAreasWhereIam(10),
areaWhereIamCount(0),
countGravityPointSpaces(0),
isScratchedSpaceOverrideModificator(false) {
RigidBodyBullet::RigidBodyBullet() :
RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY),
kinematic_utilities(NULL),
gravity_scale(1),
mass(1),
linearDamp(0),
angularDamp(0),
can_sleep(true),
force_integration_callback(NULL),
isTransformChanged(false),
maxCollisionsDetection(0),
collisionsCount(0),
maxAreasWhereIam(10),
areaWhereIamCount(0),
countGravityPointSpaces(0),
isScratchedSpaceOverrideModificator(false) {
godotMotionState = bulletnew(GodotMotionState(this));

View file

@ -156,8 +156,8 @@ public:
class btConvexShape *shape;
btTransform transform;
KinematicShape()
: shape(NULL) {}
KinematicShape() :
shape(NULL) {}
const bool is_active() const { return shape; }
};

View file

@ -130,8 +130,8 @@ btRayShape *ShapeBullet::create_shape_ray(real_t p_length) {
/* PLANE */
PlaneShapeBullet::PlaneShapeBullet()
: ShapeBullet() {}
PlaneShapeBullet::PlaneShapeBullet() :
ShapeBullet() {}
void PlaneShapeBullet::set_data(const Variant &p_data) {
setup(p_data);
@ -158,8 +158,8 @@ btCollisionShape *PlaneShapeBullet::create_bt_shape() {
/* Sphere */
SphereShapeBullet::SphereShapeBullet()
: ShapeBullet() {}
SphereShapeBullet::SphereShapeBullet() :
ShapeBullet() {}
void SphereShapeBullet::set_data(const Variant &p_data) {
setup(p_data);
@ -183,8 +183,8 @@ btCollisionShape *SphereShapeBullet::create_bt_shape() {
}
/* Box */
BoxShapeBullet::BoxShapeBullet()
: ShapeBullet() {}
BoxShapeBullet::BoxShapeBullet() :
ShapeBullet() {}
void BoxShapeBullet::set_data(const Variant &p_data) {
setup(p_data);
@ -211,8 +211,8 @@ btCollisionShape *BoxShapeBullet::create_bt_shape() {
/* Capsule */
CapsuleShapeBullet::CapsuleShapeBullet()
: ShapeBullet() {}
CapsuleShapeBullet::CapsuleShapeBullet() :
ShapeBullet() {}
void CapsuleShapeBullet::set_data(const Variant &p_data) {
Dictionary d = p_data;
@ -244,8 +244,8 @@ btCollisionShape *CapsuleShapeBullet::create_bt_shape() {
/* Convex polygon */
ConvexPolygonShapeBullet::ConvexPolygonShapeBullet()
: ShapeBullet() {}
ConvexPolygonShapeBullet::ConvexPolygonShapeBullet() :
ShapeBullet() {}
void ConvexPolygonShapeBullet::set_data(const Variant &p_data) {
setup(p_data);
@ -286,8 +286,9 @@ btCollisionShape *ConvexPolygonShapeBullet::create_bt_shape() {
/* Concave polygon */
ConcavePolygonShapeBullet::ConcavePolygonShapeBullet()
: ShapeBullet(), meshShape(NULL) {}
ConcavePolygonShapeBullet::ConcavePolygonShapeBullet() :
ShapeBullet(),
meshShape(NULL) {}
ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() {
if (meshShape) {
@ -359,8 +360,8 @@ btCollisionShape *ConcavePolygonShapeBullet::create_bt_shape() {
/* Height map shape */
HeightMapShapeBullet::HeightMapShapeBullet()
: ShapeBullet() {}
HeightMapShapeBullet::HeightMapShapeBullet() :
ShapeBullet() {}
void HeightMapShapeBullet::set_data(const Variant &p_data) {
ERR_FAIL_COND(p_data.get_type() != Variant::DICTIONARY);
@ -411,8 +412,9 @@ btCollisionShape *HeightMapShapeBullet::create_bt_shape() {
}
/* Ray shape */
RayShapeBullet::RayShapeBullet()
: ShapeBullet(), length(1) {}
RayShapeBullet::RayShapeBullet() :
ShapeBullet(),
length(1) {}
void RayShapeBullet::set_data(const Variant &p_data) {
setup(p_data);

View file

@ -35,8 +35,8 @@
#include "bullet_utilities.h"
#include "rigid_body_bullet.h"
SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB)
: JointBullet() {
SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) :
JointBullet() {
btTransform btFrameA;
G_TO_B(frameInA, btFrameA);
if (rbB) {

View file

@ -36,8 +36,18 @@
#include "scene/3d/immediate_geometry.h"
SoftBodyBullet::SoftBodyBullet()
: CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY), mass(1), simulation_precision(5), stiffness(0.5f), pressure_coefficient(50), damping_coefficient(0.005), drag_coefficient(0.005), bt_soft_body(NULL), soft_shape_type(SOFT_SHAPETYPE_NONE), isScratched(false), soft_body_shape_data(NULL) {
SoftBodyBullet::SoftBodyBullet() :
CollisionObjectBullet(CollisionObjectBullet::TYPE_SOFT_BODY),
mass(1),
simulation_precision(5),
stiffness(0.5f),
pressure_coefficient(50),
damping_coefficient(0.005),
drag_coefficient(0.005),
bt_soft_body(NULL),
soft_shape_type(SOFT_SHAPETYPE_NONE),
isScratched(false),
soft_body_shape_data(NULL) {
test_geometry = memnew(ImmediateGeometry);

View file

@ -50,8 +50,9 @@
#include "ustring.h"
#include <assert.h>
BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space)
: PhysicsDirectSpaceState(), space(p_space) {}
BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) :
PhysicsDirectSpaceState(),
space(p_space) {}
int BulletPhysicsDirectSpaceState::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_mask) {
@ -330,18 +331,18 @@ Vector3 BulletPhysicsDirectSpaceState::get_closest_point_to_object_volume(RID p_
}
}
SpaceBullet::SpaceBullet(bool p_create_soft_world)
: broadphase(NULL),
dispatcher(NULL),
solver(NULL),
collisionConfiguration(NULL),
dynamicsWorld(NULL),
soft_body_world_info(NULL),
ghostPairCallback(NULL),
godotFilterCallback(NULL),
gravityDirection(0, -1, 0),
gravityMagnitude(10),
contactDebugCount(0) {
SpaceBullet::SpaceBullet(bool p_create_soft_world) :
broadphase(NULL),
dispatcher(NULL),
solver(NULL),
collisionConfiguration(NULL),
dynamicsWorld(NULL),
soft_body_world_info(NULL),
ghostPairCallback(NULL),
godotFilterCallback(NULL),
gravityDirection(0, -1, 0),
gravityMagnitude(10),
contactDebugCount(0) {
create_empty_world(p_create_soft_world);
direct_access = memnew(BulletPhysicsDirectSpaceState(this));
@ -939,14 +940,14 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
r_result->collider_shape = r_recover_result.other_compound_shape_index;
r_result->collision_local_shape = r_recover_result.local_shape_most_recovered;
//{ /// Add manifold point to manage collisions
// btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid);
// btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance);
// manifoldPoint.m_index0 = r_result->collision_local_shape;
// manifoldPoint.m_index1 = r_result->collider_shape;
// manifold->addManifoldPoint(manifoldPoint);
// p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold);
//}
//{ /// Add manifold point to manage collisions
// btPersistentManifold* manifold = dynamicsWorld->getDispatcher()->getNewManifold(p_body->getBtBody(), btRigid);
// btManifoldPoint manifoldPoint(result_callabck.m_pointWorld, result_callabck.m_pointWorld, result_callabck.m_pointNormalWorld, result_callabck.m_penetration_distance);
// manifoldPoint.m_index0 = r_result->collision_local_shape;
// manifoldPoint.m_index1 = r_result->collider_shape;
// manifold->addManifoldPoint(manifoldPoint);
// p_body->get_kinematic_utilities()->m_generatedManifold.push_back(manifold);
//}
#if debug_test_motion
Vector3 sup_line2;
@ -979,10 +980,10 @@ public:
Vector<btCollisionObject *> result_collision_objects;
public:
RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask)
: self_collision_object(p_self_collision_object),
collision_layer(p_collision_layer),
collision_mask(p_collision_mask) {}
RecoverPenetrationBroadPhaseCallback(const btCollisionObject *p_self_collision_object, uint32_t p_collision_layer, uint32_t p_collision_mask) :
self_collision_object(p_self_collision_object),
collision_layer(p_collision_layer),
collision_mask(p_collision_mask) {}
virtual ~RecoverPenetrationBroadPhaseCallback() {}

View file

@ -185,8 +185,8 @@ private:
const btCollisionObject *other_collision_object;
int local_shape_most_recovered;
RecoverResult()
: hasPenetration(false) {}
RecoverResult() :
hasPenetration(false) {}
};
bool recover_from_penetration(RigidBodyBullet *p_body, const btTransform &p_from, btVector3 &r_recover_position, RecoverResult *r_recover_result = NULL);

View file

@ -219,7 +219,7 @@ extern "C" {
void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface) {
Ref<ARVRInterfaceGDNative> new_interface;
new_interface.instance();
new_interface->set_interface((godot_arvr_interface_gdnative * const)p_interface);
new_interface->set_interface((godot_arvr_interface_gdnative *const)p_interface);
ARVRServer::get_singleton()->add_interface(new_interface);
}

View file

@ -106,8 +106,8 @@ struct GDNativeCallRegistry {
return singleton;
}
inline GDNativeCallRegistry()
: native_calls() {}
inline GDNativeCallRegistry() :
native_calls() {}
Map<StringName, native_call_cb> native_calls;

View file

@ -468,8 +468,6 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) {
return source;
}
//
#endif
/*

View file

@ -437,11 +437,11 @@ NativeScript::~NativeScript() {
#endif
}
//
//
// ScriptInstance stuff
//
//
//
//
// ScriptInstance stuff
//
//
#define GET_SCRIPT_DESC() script->get_script_desc()

View file

@ -76,12 +76,12 @@ struct NativeScriptDesc {
bool is_tool;
inline NativeScriptDesc()
: methods(),
properties(),
signals_(),
base(),
base_native_type() {
inline NativeScriptDesc() :
methods(),
properties(),
signals_(),
base(),
base_native_type() {
zeromem(&create_func, sizeof(godot_instance_create_func));
zeromem(&destroy_func, sizeof(godot_instance_destroy_func));
}

View file

@ -410,8 +410,8 @@ void PluginScriptLanguage::unlock() {
#endif
}
PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc)
: _desc(*desc) {
PluginScriptLanguage::PluginScriptLanguage(const godot_pluginscript_language_desc *desc) :
_desc(*desc) {
_resource_loader = memnew(ResourceFormatLoaderPluginScript(this));
_resource_saver = memnew(ResourceFormatSaverPluginScript(this));

View file

@ -423,8 +423,11 @@ ScriptInstance::RPCMode PluginScript::get_rset_mode(const StringName &p_variable
}
}
PluginScript::PluginScript()
: _data(NULL), _tool(false), _valid(false), _script_list(this) {
PluginScript::PluginScript() :
_data(NULL),
_tool(false),
_valid(false),
_script_list(this) {
}
void PluginScript::init(PluginScriptLanguage *language) {

View file

@ -100,7 +100,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco
#endif
instance->owner->set_script_instance(instance);
/* STEP 2, INITIALIZE AND CONSRTUCT */
/* STEP 2, INITIALIZE AND CONSRTUCT */
#ifndef NO_THREADS
GDScriptLanguage::singleton->lock->lock();
@ -876,8 +876,8 @@ void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
#endif
}
GDScript::GDScript()
: script_list(this) {
GDScript::GDScript() :
script_list(this) {
_static_ref = this;
valid = false;

View file

@ -806,8 +806,8 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::
ERR_FAIL_COND_V(on->arguments.size() != 2, -1);
if (on->arguments[0]->type == GDScriptParser::Node::TYPE_OPERATOR && (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX || static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED)) {
//SET (chained) MODE!!
// SET (chained) MODE!
#ifdef DEBUG_ENABLED
if (static_cast<GDScriptParser::OperatorNode *>(on->arguments[0])->op == GDScriptParser::OperatorNode::OP_INDEX_NAMED) {
const GDScriptParser::OperatorNode *inon = static_cast<GDScriptParser::OperatorNode *>(on->arguments[0]);

View file

@ -1795,8 +1795,8 @@ static void _find_type_arguments(GDScriptCompletionContext &context, const GDScr
}
} else {
//regular method
//regular method
#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
if (p_argidx < m->get_argument_count()) {
PropertyInfo pi = m->get_argument_info(p_argidx);

View file

@ -250,7 +250,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#ifdef DEBUG_ENABLED
//GDScriptLanguage::get_singleton()->calls++;
//GDScriptLanguage::get_singleton()->calls++;
#endif
@ -1432,8 +1432,8 @@ void GDScriptFunction::debug_get_stack_member_state(int p_line, List<Pair<String
}
}
GDScriptFunction::GDScriptFunction()
: function_list(this) {
GDScriptFunction::GDScriptFunction() :
function_list(this) {
_stack_size = 0;
_call_size = 0;

View file

@ -253,9 +253,9 @@ bool GDScriptTokenizer::is_token_literal(int p_offset, bool variable_safe) const
case TK_BUILT_IN_FUNC:
case TK_OP_IN:
//case TK_OP_NOT:
//case TK_OP_OR:
//case TK_OP_AND:
//case TK_OP_NOT:
//case TK_OP_OR:
//case TK_OP_AND:
case TK_PR_CLASS:
case TK_PR_CONST:
@ -1125,7 +1125,7 @@ void GDScriptTokenizerText::advance(int p_amount) {
_advance();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
#define BYTECODE_VERSION 12

View file

@ -461,6 +461,7 @@ MobileVRInterface::MobileVRInterface() {
glGenBuffers(1, &half_screen_quad);
glBindBuffer(GL_ARRAY_BUFFER, half_screen_quad);
{
/* clang-format off */
const float qv[16] = {
0, -1,
-1, -1,
@ -471,6 +472,7 @@ MobileVRInterface::MobileVRInterface() {
1, -1,
1, -1,
};
/* clang-format on */
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 16, qv, GL_STATIC_DRAW);
}

View file

@ -1885,8 +1885,8 @@ StringName CSharpScript::get_script_name() const {
return name;
}
CSharpScript::CSharpScript()
: script_list(this) {
CSharpScript::CSharpScript() :
script_list(this) {
_clear();

View file

@ -117,4 +117,4 @@ void add_item(const String &p_project_path, const String &p_item_type, const Str
ERR_FAIL();
}
}
} // CSharpProject
} // namespace CSharpProject

View file

@ -39,6 +39,6 @@ String generate_editor_api_project(const String &p_dir, const String &p_core_dll
String generate_game_project(const String &p_dir, const String &p_name, const Vector<String> &p_files = Vector<String>());
void add_item(const String &p_project_path, const String &p_item_type, const String &p_include);
}
} // namespace CSharpProject
#endif // CSHARP_PROJECT_H

View file

@ -192,4 +192,4 @@ String get_project_csproj_path() {
return _GodotSharpDirs::get_singleton().csproj_filepath;
}
#endif
}
} // namespace GodotSharpDirs

View file

@ -53,6 +53,6 @@ String get_custom_project_settings_dir();
String get_project_sln_path();
String get_project_csproj_path();
}
} // namespace GodotSharpDirs
#endif // GODOTSHARP_DIRS_H

Some files were not shown because too many files have changed in this diff Show more