summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/audio/effects/audio_effect_eq.h12
-rw-r--r--servers/audio/effects/audio_effect_filter.h28
-rw-r--r--servers/audio/reverb_sw.cpp8
-rw-r--r--servers/physics/area_sw.cpp6
-rw-r--r--servers/physics/body_pair_sw.cpp4
-rw-r--r--servers/physics/body_sw.cpp7
-rw-r--r--servers/physics/collision_object_sw.cpp4
-rw-r--r--servers/physics/collision_solver_sat.cpp3
-rw-r--r--servers/physics/joints/cone_twist_joint_sw.cpp4
-rw-r--r--servers/physics/joints/generic_6dof_joint_sw.cpp8
-rw-r--r--servers/physics/joints/hinge_joint_sw.cpp8
-rw-r--r--servers/physics/joints/jacobian_entry_sw.h18
-rw-r--r--servers/physics/joints/pin_joint_sw.cpp4
-rw-r--r--servers/physics/joints/slider_joint_sw.cpp6
-rw-r--r--servers/physics/joints_sw.h4
-rw-r--r--servers/physics_2d/area_2d_sw.cpp6
-rw-r--r--servers/physics_2d/body_2d_sw.cpp7
-rw-r--r--servers/physics_2d/body_pair_2d_sw.cpp6
-rw-r--r--servers/physics_2d/joints_2d_sw.cpp12
-rw-r--r--servers/physics_2d/joints_2d_sw.h4
-rw-r--r--servers/physics_2d/physics_2d_server_wrap_mt.cpp4
-rw-r--r--servers/physics_2d_server.h15
-rw-r--r--servers/physics_server.h15
-rw-r--r--servers/visual/rasterizer.h4
-rw-r--r--servers/visual/visual_server_raster.h9
-rw-r--r--servers/visual/visual_server_scene.cpp27
-rw-r--r--servers/visual/visual_server_scene.h14
-rw-r--r--servers/visual/visual_server_wrap_mt.cpp4
-rw-r--r--servers/visual/visual_server_wrap_mt.h2
29 files changed, 142 insertions, 111 deletions
diff --git a/servers/audio/effects/audio_effect_eq.h b/servers/audio/effects/audio_effect_eq.h
index 440f46c0c2..5d0c3d9729 100644
--- a/servers/audio/effects/audio_effect_eq.h
+++ b/servers/audio/effects/audio_effect_eq.h
@@ -76,22 +76,22 @@ public:
class AudioEffectEQ6 : public AudioEffectEQ {
GDCLASS(AudioEffectEQ6, AudioEffectEQ)
public:
- AudioEffectEQ6()
- : AudioEffectEQ(EQ::PRESET_6_BANDS) {}
+ AudioEffectEQ6() :
+ AudioEffectEQ(EQ::PRESET_6_BANDS) {}
};
class AudioEffectEQ10 : public AudioEffectEQ {
GDCLASS(AudioEffectEQ10, AudioEffectEQ)
public:
- AudioEffectEQ10()
- : AudioEffectEQ(EQ::PRESET_10_BANDS) {}
+ AudioEffectEQ10() :
+ AudioEffectEQ(EQ::PRESET_10_BANDS) {}
};
class AudioEffectEQ21 : public AudioEffectEQ {
GDCLASS(AudioEffectEQ21, AudioEffectEQ)
public:
- AudioEffectEQ21()
- : AudioEffectEQ(EQ::PRESET_21_BANDS) {}
+ AudioEffectEQ21() :
+ AudioEffectEQ(EQ::PRESET_21_BANDS) {}
};
#endif // AUDIOEFFECTEQ_H
diff --git a/servers/audio/effects/audio_effect_filter.h b/servers/audio/effects/audio_effect_filter.h
index 903977cb97..7fb5ba4c83 100644
--- a/servers/audio/effects/audio_effect_filter.h
+++ b/servers/audio/effects/audio_effect_filter.h
@@ -96,50 +96,50 @@ VARIANT_ENUM_CAST(AudioEffectFilter::FilterDB)
class AudioEffectLowPassFilter : public AudioEffectFilter {
GDCLASS(AudioEffectLowPassFilter, AudioEffectFilter)
public:
- AudioEffectLowPassFilter()
- : AudioEffectFilter(AudioFilterSW::LOWPASS) {}
+ AudioEffectLowPassFilter() :
+ AudioEffectFilter(AudioFilterSW::LOWPASS) {}
};
class AudioEffectHighPassFilter : public AudioEffectFilter {
GDCLASS(AudioEffectHighPassFilter, AudioEffectFilter)
public:
- AudioEffectHighPassFilter()
- : AudioEffectFilter(AudioFilterSW::HIGHPASS) {}
+ AudioEffectHighPassFilter() :
+ AudioEffectFilter(AudioFilterSW::HIGHPASS) {}
};
class AudioEffectBandPassFilter : public AudioEffectFilter {
GDCLASS(AudioEffectBandPassFilter, AudioEffectFilter)
public:
- AudioEffectBandPassFilter()
- : AudioEffectFilter(AudioFilterSW::BANDPASS) {}
+ AudioEffectBandPassFilter() :
+ AudioEffectFilter(AudioFilterSW::BANDPASS) {}
};
class AudioEffectNotchFilter : public AudioEffectFilter {
GDCLASS(AudioEffectNotchFilter, AudioEffectFilter)
public:
- AudioEffectNotchFilter()
- : AudioEffectFilter(AudioFilterSW::NOTCH) {}
+ AudioEffectNotchFilter() :
+ AudioEffectFilter(AudioFilterSW::NOTCH) {}
};
class AudioEffectBandLimitFilter : public AudioEffectFilter {
GDCLASS(AudioEffectBandLimitFilter, AudioEffectFilter)
public:
- AudioEffectBandLimitFilter()
- : AudioEffectFilter(AudioFilterSW::BANDLIMIT) {}
+ AudioEffectBandLimitFilter() :
+ AudioEffectFilter(AudioFilterSW::BANDLIMIT) {}
};
class AudioEffectLowShelfFilter : public AudioEffectFilter {
GDCLASS(AudioEffectLowShelfFilter, AudioEffectFilter)
public:
- AudioEffectLowShelfFilter()
- : AudioEffectFilter(AudioFilterSW::LOWSHELF) {}
+ AudioEffectLowShelfFilter() :
+ AudioEffectFilter(AudioFilterSW::LOWSHELF) {}
};
class AudioEffectHighShelfFilter : public AudioEffectFilter {
GDCLASS(AudioEffectHighShelfFilter, AudioEffectFilter)
public:
- AudioEffectHighShelfFilter()
- : AudioEffectFilter(AudioFilterSW::HIGHSHELF) {}
+ AudioEffectHighShelfFilter() :
+ AudioEffectFilter(AudioFilterSW::HIGHSHELF) {}
};
#endif // AUDIOEFFECTFILTER_H
diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp
index 96d2ad848b..e2bb04c213 100644
--- a/servers/audio/reverb_sw.cpp
+++ b/servers/audio/reverb_sw.cpp
@@ -252,15 +252,13 @@ static ReverbParamsSW *reverb_param_modes[] = {
bool ReverbSW::process(int *p_input, int *p_output, int p_frames, int p_stereo_stride) {
+ // p_input must point to a non-looping buffer.
+ // BOTH p_input and p_output must be touched (use ClearModuleBuffer).
+
if (!reverb_buffer)
return false;
-//
-// p_input must point to a non-looping buffer.
-// BOTH p_input and p_output must be touched (use ClearModuleBuffer).
-
// LOCAL MACROS
-
#undef LM_SETSRCOFFSET
#define LM_SETSRCOFFSET(x) \
(x) = current_params->x + Offset; \
diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp
index 387230a478..9615708f1d 100644
--- a/servers/physics/area_sw.cpp
+++ b/servers/physics/area_sw.cpp
@@ -237,8 +237,10 @@ void AreaSW::call_queries() {
//get_space()->area_remove_from_monitor_query_list(&monitor_query_list);
}
-AreaSW::AreaSW()
- : CollisionObjectSW(TYPE_AREA), monitor_query_list(this), moved_list(this) {
+AreaSW::AreaSW() :
+ CollisionObjectSW(TYPE_AREA),
+ monitor_query_list(this),
+ moved_list(this) {
_set_static(true); //areas are never active
space_override_mode = PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED;
diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp
index ef54eb58cf..80e0ad1b07 100644
--- a/servers/physics/body_pair_sw.cpp
+++ b/servers/physics/body_pair_sw.cpp
@@ -464,8 +464,8 @@ void BodyPairSW::solve(real_t p_step) {
}
}
-BodyPairSW::BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B)
- : ConstraintSW(_arr, 2) {
+BodyPairSW::BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B) :
+ ConstraintSW(_arr, 2) {
A = p_A;
B = p_B;
diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp
index f8cd6ca858..5057c6ab9d 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -740,8 +740,11 @@ void BodySW::set_kinematic_margin(real_t p_margin) {
kinematic_safe_margin = p_margin;
}
-BodySW::BodySW()
- : CollisionObjectSW(TYPE_BODY), active_list(this), inertia_update_list(this), direct_state_query_list(this) {
+BodySW::BodySW() :
+ CollisionObjectSW(TYPE_BODY),
+ active_list(this),
+ inertia_update_list(this),
+ direct_state_query_list(this) {
mode = PhysicsServer::BODY_MODE_RIGID;
active = true;
diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp
index 126f8141ff..ef7cd0780f 100644
--- a/servers/physics/collision_object_sw.cpp
+++ b/servers/physics/collision_object_sw.cpp
@@ -217,8 +217,8 @@ void CollisionObjectSW::_shape_changed() {
_shapes_changed();
}
-CollisionObjectSW::CollisionObjectSW(Type p_type)
- : pending_shape_update_list(this) {
+CollisionObjectSW::CollisionObjectSW(Type p_type) :
+ pending_shape_update_list(this) {
_static = true;
type = p_type;
diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp
index a044df7f31..f56d311a59 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics/collision_solver_sat.cpp
@@ -255,7 +255,8 @@ static void _generate_contacts_from_supports(const Vector3 *p_points_A, int p_po
_generate_contacts_face_face,
},
{
- 0, 0,
+ 0,
+ 0,
_generate_contacts_face_face,
}
};
diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp
index 3c900d4fbe..617ce125b3 100644
--- a/servers/physics/joints/cone_twist_joint_sw.cpp
+++ b/servers/physics/joints/cone_twist_joint_sw.cpp
@@ -85,8 +85,8 @@ static _FORCE_INLINE_ real_t atan2fast(real_t y, real_t x) {
return (y < 0.0f) ? -angle : angle;
}
-ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rbAFrame, const Transform &rbBFrame)
- : JointSW(_arr, 2) {
+ConeTwistJointSW::ConeTwistJointSW(BodySW *rbA, BodySW *rbB, const Transform &rbAFrame, const Transform &rbBFrame) :
+ JointSW(_arr, 2) {
A = rbA;
B = rbB;
diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp
index 1e323be36c..b8234be4d9 100644
--- a/servers/physics/joints/generic_6dof_joint_sw.cpp
+++ b/servers/physics/joints/generic_6dof_joint_sw.cpp
@@ -209,9 +209,11 @@ real_t G6DOFTranslationalLimitMotorSW::solveLinearAxis(
//////////////////////////// G6DOFTranslationalLimitMotorSW ////////////////////////////////////
-Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA)
- : JointSW(_arr, 2), m_frameInA(frameInA), m_frameInB(frameInB),
- m_useLinearReferenceFrameA(useLinearReferenceFrameA) {
+Generic6DOFJointSW::Generic6DOFJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB, bool useLinearReferenceFrameA) :
+ JointSW(_arr, 2),
+ m_frameInA(frameInA),
+ m_frameInB(frameInB),
+ m_useLinearReferenceFrameA(useLinearReferenceFrameA) {
A = rbA;
B = rbB;
A->add_constraint(this, 0);
diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp
index fe20a55b60..2edccc26c2 100644
--- a/servers/physics/joints/hinge_joint_sw.cpp
+++ b/servers/physics/joints/hinge_joint_sw.cpp
@@ -68,8 +68,8 @@ static void plane_space(const Vector3 &n, Vector3 &p, Vector3 &q) {
}
}
-HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, const Transform &frameB)
- : JointSW(_arr, 2) {
+HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, const Transform &frameB) :
+ JointSW(_arr, 2) {
A = rbA;
B = rbB;
@@ -101,8 +101,8 @@ HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameA, co
}
HingeJointSW::HingeJointSW(BodySW *rbA, BodySW *rbB, const Vector3 &pivotInA, const Vector3 &pivotInB,
- const Vector3 &axisInA, const Vector3 &axisInB)
- : JointSW(_arr, 2) {
+ const Vector3 &axisInA, const Vector3 &axisInB) :
+ JointSW(_arr, 2) {
A = rbA;
B = rbB;
diff --git a/servers/physics/joints/jacobian_entry_sw.h b/servers/physics/joints/jacobian_entry_sw.h
index 79ce0e6157..7aeb06ddd8 100644
--- a/servers/physics/joints/jacobian_entry_sw.h
+++ b/servers/physics/joints/jacobian_entry_sw.h
@@ -64,8 +64,8 @@ public:
const Vector3 &inertiaInvA,
const real_t massInvA,
const Vector3 &inertiaInvB,
- const real_t massInvB)
- : m_linearJointAxis(jointAxis) {
+ const real_t massInvB) :
+ m_linearJointAxis(jointAxis) {
m_aJ = world2A.xform(rel_pos1.cross(m_linearJointAxis));
m_bJ = world2B.xform(rel_pos2.cross(-m_linearJointAxis));
m_0MinvJt = inertiaInvA * m_aJ;
@@ -80,8 +80,8 @@ public:
const Basis &world2A,
const Basis &world2B,
const Vector3 &inertiaInvA,
- const Vector3 &inertiaInvB)
- : m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))) {
+ const Vector3 &inertiaInvB) :
+ m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))) {
m_aJ = world2A.xform(jointAxis);
m_bJ = world2B.xform(-jointAxis);
m_0MinvJt = inertiaInvA * m_aJ;
@@ -95,8 +95,10 @@ public:
JacobianEntrySW(const Vector3 &axisInA,
const Vector3 &axisInB,
const Vector3 &inertiaInvA,
- const Vector3 &inertiaInvB)
- : m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))), m_aJ(axisInA), m_bJ(-axisInB) {
+ const Vector3 &inertiaInvB) :
+ m_linearJointAxis(Vector3(real_t(0.), real_t(0.), real_t(0.))),
+ m_aJ(axisInA),
+ m_bJ(-axisInB) {
m_0MinvJt = inertiaInvA * m_aJ;
m_1MinvJt = inertiaInvB * m_bJ;
m_Adiag = m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ);
@@ -110,8 +112,8 @@ public:
const Vector3 &rel_pos1, const Vector3 &rel_pos2,
const Vector3 &jointAxis,
const Vector3 &inertiaInvA,
- const real_t massInvA)
- : m_linearJointAxis(jointAxis) {
+ const real_t massInvA) :
+ m_linearJointAxis(jointAxis) {
m_aJ = world2A.xform(rel_pos1.cross(jointAxis));
m_bJ = world2A.xform(rel_pos2.cross(-jointAxis));
m_0MinvJt = inertiaInvA * m_aJ;
diff --git a/servers/physics/joints/pin_joint_sw.cpp b/servers/physics/joints/pin_joint_sw.cpp
index 779e086858..ab2ab2299a 100644
--- a/servers/physics/joints/pin_joint_sw.cpp
+++ b/servers/physics/joints/pin_joint_sw.cpp
@@ -146,8 +146,8 @@ real_t PinJointSW::get_param(PhysicsServer::PinJointParam p_param) const {
return 0;
}
-PinJointSW::PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_b, const Vector3 &p_pos_b)
- : JointSW(_arr, 2) {
+PinJointSW::PinJointSW(BodySW *p_body_a, const Vector3 &p_pos_a, BodySW *p_body_b, const Vector3 &p_pos_b) :
+ JointSW(_arr, 2) {
A = p_body_a;
B = p_body_b;
diff --git a/servers/physics/joints/slider_joint_sw.cpp b/servers/physics/joints/slider_joint_sw.cpp
index 66585f2605..7777de0324 100644
--- a/servers/physics/joints/slider_joint_sw.cpp
+++ b/servers/physics/joints/slider_joint_sw.cpp
@@ -112,8 +112,10 @@ void SliderJointSW::initParams() {
//-----------------------------------------------------------------------------
-SliderJointSW::SliderJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB)
- : JointSW(_arr, 2), m_frameInA(frameInA), m_frameInB(frameInB) {
+SliderJointSW::SliderJointSW(BodySW *rbA, BodySW *rbB, const Transform &frameInA, const Transform &frameInB) :
+ JointSW(_arr, 2),
+ m_frameInA(frameInA),
+ m_frameInB(frameInB) {
A = rbA;
B = rbB;
diff --git a/servers/physics/joints_sw.h b/servers/physics/joints_sw.h
index b15ae08049..29581c7337 100644
--- a/servers/physics/joints_sw.h
+++ b/servers/physics/joints_sw.h
@@ -37,8 +37,8 @@ class JointSW : public ConstraintSW {
public:
virtual PhysicsServer::JointType get_type() const = 0;
- _FORCE_INLINE_ JointSW(BodySW **p_body_ptr = NULL, int p_body_count = 0)
- : ConstraintSW(p_body_ptr, p_body_count) {
+ _FORCE_INLINE_ JointSW(BodySW **p_body_ptr = NULL, int p_body_count = 0) :
+ ConstraintSW(p_body_ptr, p_body_count) {
}
};
diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp
index 6c0bc2c186..d73619ba13 100644
--- a/servers/physics_2d/area_2d_sw.cpp
+++ b/servers/physics_2d/area_2d_sw.cpp
@@ -238,8 +238,10 @@ void Area2DSW::call_queries() {
//get_space()->area_remove_from_monitor_query_list(&monitor_query_list);
}
-Area2DSW::Area2DSW()
- : CollisionObject2DSW(TYPE_AREA), monitor_query_list(this), moved_list(this) {
+Area2DSW::Area2DSW() :
+ CollisionObject2DSW(TYPE_AREA),
+ monitor_query_list(this),
+ moved_list(this) {
_set_static(true); //areas are not active by default
space_override_mode = Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED;
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index eb5fb5a729..2bdde244df 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -650,8 +650,11 @@ void Body2DSW::set_force_integration_callback(ObjectID p_id, const StringName &p
}
}
-Body2DSW::Body2DSW()
- : CollisionObject2DSW(TYPE_BODY), active_list(this), inertia_update_list(this), direct_state_query_list(this) {
+Body2DSW::Body2DSW() :
+ CollisionObject2DSW(TYPE_BODY),
+ active_list(this),
+ inertia_update_list(this),
+ direct_state_query_list(this) {
mode = Physics2DServer::BODY_MODE_RIGID;
active = true;
diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp
index 828b90e5d0..b106b37db0 100644
--- a/servers/physics_2d/body_pair_2d_sw.cpp
+++ b/servers/physics_2d/body_pair_2d_sw.cpp
@@ -417,7 +417,7 @@ bool BodyPair2DSW::setup(real_t p_step) {
c.bias = -bias * inv_dt * MIN(0.0f, -depth + max_penetration);
c.depth = depth;
-//c.acc_bias_impulse=0;
+ //c.acc_bias_impulse=0;
#ifdef ACCUMULATE_IMPULSES
{
@@ -500,8 +500,8 @@ void BodyPair2DSW::solve(real_t p_step) {
}
}
-BodyPair2DSW::BodyPair2DSW(Body2DSW *p_A, int p_shape_A, Body2DSW *p_B, int p_shape_B)
- : Constraint2DSW(_arr, 2) {
+BodyPair2DSW::BodyPair2DSW(Body2DSW *p_A, int p_shape_A, Body2DSW *p_B, int p_shape_B) :
+ Constraint2DSW(_arr, 2) {
A = p_A;
B = p_B;
diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp
index 897e145a3e..caeb62d74f 100644
--- a/servers/physics_2d/joints_2d_sw.cpp
+++ b/servers/physics_2d/joints_2d_sw.cpp
@@ -178,8 +178,8 @@ real_t PinJoint2DSW::get_param(Physics2DServer::PinJointParam p_param) const {
ERR_FAIL_V(0);
}
-PinJoint2DSW::PinJoint2DSW(const Vector2 &p_pos, Body2DSW *p_body_a, Body2DSW *p_body_b)
- : Joint2DSW(_arr, p_body_b ? 2 : 1) {
+PinJoint2DSW::PinJoint2DSW(const Vector2 &p_pos, Body2DSW *p_body_a, Body2DSW *p_body_b) :
+ Joint2DSW(_arr, p_body_b ? 2 : 1) {
A = p_body_a;
B = p_body_b;
@@ -323,8 +323,8 @@ void GrooveJoint2DSW::solve(real_t p_step) {
B->apply_impulse(rB, j);
}
-GrooveJoint2DSW::GrooveJoint2DSW(const Vector2 &p_a_groove1, const Vector2 &p_a_groove2, const Vector2 &p_b_anchor, Body2DSW *p_body_a, Body2DSW *p_body_b)
- : Joint2DSW(_arr, 2) {
+GrooveJoint2DSW::GrooveJoint2DSW(const Vector2 &p_a_groove1, const Vector2 &p_a_groove2, const Vector2 &p_b_anchor, Body2DSW *p_body_a, Body2DSW *p_body_b) :
+ Joint2DSW(_arr, 2) {
A = p_body_a;
B = p_body_b;
@@ -432,8 +432,8 @@ real_t DampedSpringJoint2DSW::get_param(Physics2DServer::DampedStringParam p_par
ERR_FAIL_V(0);
}
-DampedSpringJoint2DSW::DampedSpringJoint2DSW(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, Body2DSW *p_body_a, Body2DSW *p_body_b)
- : Joint2DSW(_arr, 2) {
+DampedSpringJoint2DSW::DampedSpringJoint2DSW(const Vector2 &p_anchor_a, const Vector2 &p_anchor_b, Body2DSW *p_body_a, Body2DSW *p_body_b) :
+ Joint2DSW(_arr, 2) {
A = p_body_a;
B = p_body_b;
diff --git a/servers/physics_2d/joints_2d_sw.h b/servers/physics_2d/joints_2d_sw.h
index 11cb41d9d1..0e5e8012b6 100644
--- a/servers/physics_2d/joints_2d_sw.h
+++ b/servers/physics_2d/joints_2d_sw.h
@@ -50,8 +50,8 @@ public:
_FORCE_INLINE_ real_t get_max_bias() const { return max_bias; }
virtual Physics2DServer::JointType get_type() const = 0;
- Joint2DSW(Body2DSW **p_body_ptr = NULL, int p_body_count = 0)
- : Constraint2DSW(p_body_ptr, p_body_count) {
+ Joint2DSW(Body2DSW **p_body_ptr = NULL, int p_body_count = 0) :
+ Constraint2DSW(p_body_ptr, p_body_count) {
bias = 0;
max_force = max_bias = 3.40282e+38;
};
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp
index f92ed18de2..0e5bd82599 100644
--- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp
+++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp
@@ -151,8 +151,8 @@ void Physics2DServerWrapMT::finish() {
memdelete(step_sem);
}
-Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer *p_contained, bool p_create_thread)
- : command_queue(p_create_thread) {
+Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer *p_contained, bool p_create_thread) :
+ command_queue(p_create_thread) {
physics_2d_server = p_contained;
create_thread = p_create_thread;
diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h
index d6a988f512..c57503f06e 100644
--- a/servers/physics_2d_server.h
+++ b/servers/physics_2d_server.h
@@ -589,14 +589,17 @@ class Physics2DServerManager {
String name;
CreatePhysics2DServerCallback create_callback;
- ClassInfo()
- : name(""), create_callback(NULL) {}
+ ClassInfo() :
+ name(""),
+ create_callback(NULL) {}
- ClassInfo(String p_name, CreatePhysics2DServerCallback p_create_callback)
- : name(p_name), create_callback(p_create_callback) {}
+ ClassInfo(String p_name, CreatePhysics2DServerCallback p_create_callback) :
+ name(p_name),
+ create_callback(p_create_callback) {}
- ClassInfo(const ClassInfo &p_ci)
- : name(p_ci.name), create_callback(p_ci.create_callback) {}
+ ClassInfo(const ClassInfo &p_ci) :
+ name(p_ci.name),
+ create_callback(p_ci.create_callback) {}
};
static Vector<ClassInfo> physics_2d_servers;
diff --git a/servers/physics_server.h b/servers/physics_server.h
index 9a4155dd8b..4886317224 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server.h
@@ -652,14 +652,17 @@ class PhysicsServerManager {
String name;
CreatePhysicsServerCallback create_callback;
- ClassInfo()
- : name(""), create_callback(NULL) {}
+ ClassInfo() :
+ name(""),
+ create_callback(NULL) {}
- ClassInfo(String p_name, CreatePhysicsServerCallback p_create_callback)
- : name(p_name), create_callback(p_create_callback) {}
+ ClassInfo(String p_name, CreatePhysicsServerCallback p_create_callback) :
+ name(p_name),
+ create_callback(p_create_callback) {}
- ClassInfo(const ClassInfo &p_ci)
- : name(p_ci.name), create_callback(p_ci.create_callback) {}
+ ClassInfo(const ClassInfo &p_ci) :
+ name(p_ci.name),
+ create_callback(p_ci.create_callback) {}
};
static Vector<ClassInfo> physics_servers;
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 4bb34af241..0ee70878dc 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -116,8 +116,8 @@ public:
virtual void base_changed() = 0;
virtual void base_material_changed() = 0;
- InstanceBase()
- : dependency_item(this) {
+ InstanceBase() :
+ dependency_item(this) {
base_type = VS::INSTANCE_NONE;
cast_shadows = VS::SHADOW_CASTING_SETTING_ON;
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 91542625e0..9223d81e32 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -77,8 +77,8 @@ class VisualServerRaster : public VisualServer {
static void _changes_changed() {}
public:
-//if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()
-//#define DEBUG_CHANGES
+ //if editor is redrawing when it shouldn't, enable this and put a breakpoint in _changes_changed()
+ //#define DEBUG_CHANGES
#ifdef DEBUG_CHANGES
_FORCE_INLINE_ static void redraw_request() {
@@ -96,7 +96,6 @@ public:
#define DISPLAY_CHANGED \
changes++;
#endif
-// print_line(String("CHANGED: ") + __FUNCTION__);
#define BIND0R(m_r, m_name) \
m_r m_name() { return BINDBASE->m_name(); }
@@ -451,7 +450,7 @@ public:
BIND2R(int, viewport_get_render_info, RID, ViewportRenderInfo)
BIND2(viewport_set_debug_draw, RID, ViewportDebugDraw)
-/* ENVIRONMENT API */
+ /* ENVIRONMENT API */
#undef BINDBASE
//from now on, calls forwarded to this singleton
@@ -481,7 +480,7 @@ public:
BIND6(environment_set_fog_depth, RID, bool, float, float, bool, float)
BIND5(environment_set_fog_height, RID, bool, float, float, float)
-/* SCENARIO API */
+ /* SCENARIO API */
#undef BINDBASE
#define BINDBASE VSG::scene
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index 9db730ec99..eef4720d22 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -308,6 +308,12 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base) {
//from octree
InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(instance->base_data);
+ //make sure probes are done baking
+ while (!probe_bake_list.empty()) {
+ OS::get_singleton()->delay_usec(1);
+ }
+ //make sure this one is done baking
+
while (gi_probe->dynamic.updating_stage == GI_UPDATE_STAGE_LIGHTING) {
//wait until bake is done if it's baking
OS::get_singleton()->delay_usec(1);
@@ -1327,9 +1333,7 @@ void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_view
p_viewport_size.width / (float)p_viewport_size.height,
camera->znear,
camera->zfar,
- camera->vaspect
-
- );
+ camera->vaspect);
ortho = true;
} break;
case Camera::PERSPECTIVE: {
@@ -1339,9 +1343,7 @@ void VisualServerScene::render_camera(RID p_camera, RID p_scenario, Size2 p_view
p_viewport_size.width / (float)p_viewport_size.height,
camera->znear,
camera->zfar,
- camera->vaspect
-
- );
+ camera->vaspect);
ortho = false;
} break;
@@ -2596,7 +2598,15 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) {
}
//send back to main thread to update un little chunks
+ if (probe_bake_mutex) {
+ probe_bake_mutex->lock();
+ }
+
probe_data->dynamic.updating_stage = GI_UPDATE_STAGE_UPLOADING;
+
+ if (probe_bake_mutex) {
+ probe_bake_mutex->unlock();
+ }
}
bool VisualServerScene::_check_gi_probe(Instance *p_gi_probe) {
@@ -2728,12 +2738,11 @@ void VisualServerScene::render_probes() {
switch (probe->dynamic.updating_stage) {
case GI_UPDATE_STAGE_CHECK: {
- if (_check_gi_probe(instance_probe) || force_lighting) {
- //send to lighting thread
- probe->dynamic.updating_stage = GI_UPDATE_STAGE_LIGHTING;
+ if (_check_gi_probe(instance_probe) || force_lighting) { //send to lighting thread
#ifndef NO_THREADS
probe_bake_mutex->lock();
+ probe->dynamic.updating_stage = GI_UPDATE_STAGE_LIGHTING;
probe_bake_list.push_back(instance_probe);
probe_bake_mutex->unlock();
probe_bake_sem->post();
diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h
index 9af5ffb74d..9e4701de65 100644
--- a/servers/visual/visual_server_scene.h
+++ b/servers/visual/visual_server_scene.h
@@ -229,8 +229,9 @@ public:
singleton->_instance_queue_update(this, false, true);
}
- Instance()
- : scenario_item(this), update_item(this) {
+ Instance() :
+ scenario_item(this),
+ update_item(this) {
octree_id = 0;
scenario = NULL;
@@ -305,8 +306,8 @@ public:
int render_step;
- InstanceReflectionProbeData()
- : update_list(this) {
+ InstanceReflectionProbeData() :
+ update_list(this) {
reflection_dirty = true;
render_step = -1;
@@ -434,10 +435,11 @@ public:
SelfList<InstanceGIProbeData> update_element;
- InstanceGIProbeData()
- : update_element(this) {
+ InstanceGIProbeData() :
+ update_element(this) {
invalid = true;
base_version = 0;
+ dynamic.updating_stage = GI_UPDATE_STAGE_CHECK;
}
};
diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp
index 03c68ab454..b86a0ae3f6 100644
--- a/servers/visual/visual_server_wrap_mt.cpp
+++ b/servers/visual/visual_server_wrap_mt.cpp
@@ -158,8 +158,8 @@ void VisualServerWrapMT::finish() {
canvas_occluder_polygon_free_cached_ids();
}
-VisualServerWrapMT::VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread)
- : command_queue(p_create_thread) {
+VisualServerWrapMT::VisualServerWrapMT(VisualServer *p_contained, bool p_create_thread) :
+ command_queue(p_create_thread) {
visual_server = p_contained;
create_thread = p_create_thread;
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index 1c3b34d16f..b58b1d917e 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -62,7 +62,7 @@ class VisualServerWrapMT : public VisualServer {
int pool_max_size;
-//#define DEBUG_SYNC
+ //#define DEBUG_SYNC
#ifdef DEBUG_SYNC
#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));