diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/audio/effects/audio_effect_record.cpp | 2 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_record.h | 2 | ||||
-rw-r--r-- | servers/physics/joints/generic_6dof_joint_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics/joints/generic_6dof_joint_sw.h | 6 | ||||
-rw-r--r-- | servers/physics/shape_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/body_pair_2d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/step_2d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/visual/rasterizer.h | 1 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 10 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.h | 7 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.h | 1 | ||||
-rw-r--r-- | servers/visual_server.cpp | 2 | ||||
-rw-r--r-- | servers/visual_server.h | 2 |
13 files changed, 23 insertions, 18 deletions
diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp index 78ba658ed8..a0094f66b8 100644 --- a/servers/audio/effects/audio_effect_record.cpp +++ b/servers/audio/effects/audio_effect_record.cpp @@ -44,7 +44,7 @@ void AudioEffectRecordInstance::process(const AudioFrame *p_src_frames, AudioFra } } -bool AudioEffectRecordInstance::process_silence() { +bool AudioEffectRecordInstance::process_silence() const { return true; } diff --git a/servers/audio/effects/audio_effect_record.h b/servers/audio/effects/audio_effect_record.h index edf8565c06..4b8ee2bcdd 100644 --- a/servers/audio/effects/audio_effect_record.h +++ b/servers/audio/effects/audio_effect_record.h @@ -66,7 +66,7 @@ class AudioEffectRecordInstance : public AudioEffectInstance { public: void init(); virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count); - virtual bool process_silence(); + virtual bool process_silence() const; AudioEffectRecordInstance() : thread_active(false) {} diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp index 9b1a41e80d..60505c08c5 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -83,7 +83,7 @@ int G6DOFRotationalLimitMotorSW::testLimitValue(real_t test_value) { real_t G6DOFRotationalLimitMotorSW::solveAngularLimits( real_t timeStep, Vector3 &axis, real_t jacDiagABInv, BodySW *body0, BodySW *body1) { - if (needApplyTorques() == false) return 0.0f; + if (!needApplyTorques()) return 0.0f; real_t target_velocity = m_targetVelocity; real_t maxMotorForce = m_maxMotorForce; diff --git a/servers/physics/joints/generic_6dof_joint_sw.h b/servers/physics/joints/generic_6dof_joint_sw.h index b350546c5d..035525c9e6 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.h +++ b/servers/physics/joints/generic_6dof_joint_sw.h @@ -118,14 +118,12 @@ public: //! Is limited bool isLimited() { - if (m_loLimit >= m_hiLimit) return false; - return true; + return (m_loLimit < m_hiLimit); } //! Need apply correction bool needApplyTorques() { - if (m_currentLimit == 0 && m_enableMotor == false) return false; - return true; + return (m_enableMotor || m_currentLimit != 0); } //! calculates error diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index e1c985f44f..e7fc821c2c 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -1047,7 +1047,7 @@ void FaceShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_su /** FIND SUPPORT VERTEX **/ int vert_support_idx = -1; - real_t support_max; + real_t support_max = 0; for (int i = 0; i < 3; i++) { diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp index 2633edf7bb..93a05b74ef 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -138,7 +138,7 @@ void BodyPair2DSW::_validate_contacts() { Contact &c = contacts[i]; bool erase = false; - if (c.reused == false) { + if (!c.reused) { //was left behind in previous frame erase = true; } else { diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp index 0fb7af0c94..e4e1b03623 100644 --- a/servers/physics_2d/step_2d_sw.cpp +++ b/servers/physics_2d/step_2d_sw.cpp @@ -222,7 +222,7 @@ void Step2DSW::step(Space2DSW *p_space, real_t p_delta, int p_iterations) { Constraint2DSW *prev_ci = NULL; while (ci) { - if (_setup_island(ci, p_delta) == true) { + if (_setup_island(ci, p_delta)) { //removed the root from the island graph because it is not to be processed diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 207f13ac1a..8c3736a1bf 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -1104,6 +1104,7 @@ public: virtual void restore_render_target() = 0; virtual void clear_render_target(const Color &p_color) = 0; virtual void blit_render_target_to_screen(RID p_render_target, const Rect2 &p_screen_rect, int p_screen = 0) = 0; + virtual void output_lens_distorted_to_screen(RID p_render_target, const Rect2 &p_screen_rect, float p_k1, float p_k2, const Vector2 &p_eye_center, float p_oversample) = 0; virtual void end_frame(bool p_swap_buffers) = 0; virtual void finalize() = 0; diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index cd0702d20b..654994b83f 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -2831,7 +2831,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { RID rid = E->key(); const InstanceGIProbeData::LightCache &lc = E->get(); - if ((!probe_data->dynamic.light_cache_changes.has(rid) || !(probe_data->dynamic.light_cache_changes[rid] == lc)) && lc.visible) { + if ((!probe_data->dynamic.light_cache_changes.has(rid) || probe_data->dynamic.light_cache_changes[rid] != lc) && lc.visible) { //erase light data _bake_gi_probe_light(header, cells, local_data, leaves, leaf_count, lc, -1); @@ -2844,7 +2844,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { RID rid = E->key(); const InstanceGIProbeData::LightCache &lc = E->get(); - if ((!probe_data->dynamic.light_cache.has(rid) || !(probe_data->dynamic.light_cache[rid] == lc)) && lc.visible) { + if ((!probe_data->dynamic.light_cache.has(rid) || probe_data->dynamic.light_cache[rid] != lc) && lc.visible) { //add light data _bake_gi_probe_light(header, cells, local_data, leaves, leaf_count, lc, 1); @@ -3061,7 +3061,7 @@ bool VisualServerScene::_check_gi_probe(Instance *p_gi_probe) { lc.transform = probe_data->dynamic.light_to_cell_xform * E->get()->transform; lc.visible = E->get()->visible; - if (!probe_data->dynamic.light_cache.has(E->get()->self) || !(probe_data->dynamic.light_cache[E->get()->self] == lc)) { + if (!probe_data->dynamic.light_cache.has(E->get()->self) || probe_data->dynamic.light_cache[E->get()->self] != lc) { all_equal = false; } @@ -3081,7 +3081,7 @@ bool VisualServerScene::_check_gi_probe(Instance *p_gi_probe) { lc.transform = probe_data->dynamic.light_to_cell_xform * E->get()->transform; lc.visible = E->get()->visible; - if (!probe_data->dynamic.light_cache.has(E->get()->self) || !(probe_data->dynamic.light_cache[E->get()->self] == lc)) { + if (!probe_data->dynamic.light_cache.has(E->get()->self) || probe_data->dynamic.light_cache[E->get()->self] != lc) { all_equal = false; } @@ -3164,7 +3164,7 @@ void VisualServerScene::render_probes() { force_lighting = true; } - if (probe->invalid == false && probe->dynamic.enabled) { + if (!probe->invalid && probe->dynamic.enabled) { switch (probe->dynamic.updating_stage) { case GI_UPDATE_STAGE_CHECK: { diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index 87e19bc6b0..0d4737f268 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -355,6 +355,11 @@ public: visible == p_cache.visible); } + bool operator!=(const LightCache &p_cache) { + + return !operator==(p_cache); + } + LightCache() { type = VS::LIGHT_DIRECTIONAL; @@ -544,7 +549,7 @@ public: bool free(RID p_rid); VisualServerScene(); - ~VisualServerScene(); + virtual ~VisualServerScene(); }; #endif // VISUALSERVERSCENE_H diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h index 978d6ae4ae..cb7912d6f4 100644 --- a/servers/visual/visual_server_viewport.h +++ b/servers/visual/visual_server_viewport.h @@ -194,6 +194,7 @@ public: bool free(RID p_rid); VisualServerViewport(); + virtual ~VisualServerViewport() {} }; #endif // VISUALSERVERVIEWPORT_H diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 18a239b019..9d684d33d6 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -2283,7 +2283,7 @@ void VisualServer::_bind_methods() { BIND_ENUM_CONSTANT(GLOW_BLEND_MODE_REPLACE); BIND_ENUM_CONSTANT(ENV_TONE_MAPPER_LINEAR); - BIND_ENUM_CONSTANT(ENV_TONE_MAPPER_REINHARDT); + BIND_ENUM_CONSTANT(ENV_TONE_MAPPER_REINHARD); BIND_ENUM_CONSTANT(ENV_TONE_MAPPER_FILMIC); BIND_ENUM_CONSTANT(ENV_TONE_MAPPER_ACES); diff --git a/servers/visual_server.h b/servers/visual_server.h index 100bc06db6..9d98fca21b 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -737,7 +737,7 @@ public: enum EnvironmentToneMapper { ENV_TONE_MAPPER_LINEAR, - ENV_TONE_MAPPER_REINHARDT, + ENV_TONE_MAPPER_REINHARD, ENV_TONE_MAPPER_FILMIC, ENV_TONE_MAPPER_ACES }; |