diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/audio/effects/audio_effect_delay.cpp | 3 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_stereo_enhance.cpp | 1 | ||||
-rw-r--r-- | servers/physics_2d/godot_body_pair_2d.cpp | 5 | ||||
-rw-r--r-- | servers/physics_2d/godot_collision_solver_2d_sat.cpp | 4 | ||||
-rw-r--r-- | servers/physics_2d/godot_physics_server_2d.cpp | 13 | ||||
-rw-r--r-- | servers/physics_2d/godot_shape_2d.cpp | 6 | ||||
-rw-r--r-- | servers/physics_3d/gjk_epa.cpp | 2 | ||||
-rw-r--r-- | servers/physics_3d/godot_collision_solver_3d_sat.cpp | 4 | ||||
-rw-r--r-- | servers/physics_3d/godot_physics_server_3d.cpp | 13 | ||||
-rw-r--r-- | servers/physics_3d/godot_shape_3d.cpp | 6 | ||||
-rw-r--r-- | servers/physics_3d/joints/godot_hinge_joint_3d.cpp | 6 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp | 1 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl | 1 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/volumetric_fog_process.glsl | 1 | ||||
-rw-r--r-- | servers/rendering/shader_compiler.cpp | 36 | ||||
-rw-r--r-- | servers/rendering/shader_language.cpp | 3 | ||||
-rw-r--r-- | servers/rendering_server.cpp | 4 |
17 files changed, 9 insertions, 100 deletions
diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp index bddd235204..1909ab6eae 100644 --- a/servers/audio/effects/audio_effect_delay.cpp +++ b/servers/audio/effects/audio_effect_delay.cpp @@ -54,15 +54,12 @@ void AudioEffectDelayInstance::_process_chunk(const AudioFrame *p_src_frames, Au float tap_1_level_f = base->tap_1_active ? Math::db2linear(base->tap_1_level) : 0.0; int tap_1_delay_frames = int((base->tap_1_delay_ms / 1000.0) * mix_rate); - ; float tap_2_level_f = base->tap_2_active ? Math::db2linear(base->tap_2_level) : 0.0; int tap_2_delay_frames = int((base->tap_2_delay_ms / 1000.0) * mix_rate); - ; float feedback_level_f = base->feedback_active ? Math::db2linear(base->feedback_level) : 0.0; unsigned int feedback_delay_frames = int((base->feedback_delay_ms / 1000.0) * mix_rate); - ; AudioFrame tap1_vol = AudioFrame(tap_1_level_f, tap_1_level_f); diff --git a/servers/audio/effects/audio_effect_stereo_enhance.cpp b/servers/audio/effects/audio_effect_stereo_enhance.cpp index 757edd6d43..c81efc55e2 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.cpp +++ b/servers/audio/effects/audio_effect_stereo_enhance.cpp @@ -61,7 +61,6 @@ void AudioEffectStereoEnhanceInstance::process(const AudioFrame *p_src_frames, A //r is delayed r = delay_ringbuff[(ringbuff_pos - delay_frames) & ringbuff_mask]; - ; } p_dst_frames[i].l = l; diff --git a/servers/physics_2d/godot_body_pair_2d.cpp b/servers/physics_2d/godot_body_pair_2d.cpp index 1986191cc3..2bf1e5a1d4 100644 --- a/servers/physics_2d/godot_body_pair_2d.cpp +++ b/servers/physics_2d/godot_body_pair_2d.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "godot_body_pair_2d.h" + #include "godot_collision_solver_2d.h" #include "godot_space_2d.h" @@ -303,7 +304,7 @@ bool GodotBodyPair2D::setup(real_t p_step) { bool valid = false; for (int i = 0; i < contact_count; i++) { Contact &c = contacts[i]; - if (c.normal.dot(direction) > -CMP_EPSILON) { //greater (normal inverted) + if (c.normal.dot(direction) > -CMP_EPSILON) { // Greater (normal inverted). continue; } valid = true; @@ -321,7 +322,7 @@ bool GodotBodyPair2D::setup(real_t p_step) { bool valid = false; for (int i = 0; i < contact_count; i++) { Contact &c = contacts[i]; - if (c.normal.dot(direction) < CMP_EPSILON) { //less (normal ok) + if (c.normal.dot(direction) < CMP_EPSILON) { // Less (normal ok). continue; } valid = true; diff --git a/servers/physics_2d/godot_collision_solver_2d_sat.cpp b/servers/physics_2d/godot_collision_solver_2d_sat.cpp index a965795bee..ded3ff356b 100644 --- a/servers/physics_2d/godot_collision_solver_2d_sat.cpp +++ b/servers/physics_2d/godot_collision_solver_2d_sat.cpp @@ -41,10 +41,6 @@ struct _CollectorCallback2D { Vector2 *sep_axis = nullptr; _FORCE_INLINE_ void call(const Vector2 &p_point_A, const Vector2 &p_point_B) { - /* - if (normal.dot(p_point_A) >= normal.dot(p_point_B)) - return; - */ if (swap) { callback(p_point_B, p_point_A, userdata); } else { diff --git a/servers/physics_2d/godot_physics_server_2d.cpp b/servers/physics_2d/godot_physics_server_2d.cpp index 5e099e27ec..a9b499c6b5 100644 --- a/servers/physics_2d/godot_physics_server_2d.cpp +++ b/servers/physics_2d/godot_physics_server_2d.cpp @@ -1188,14 +1188,6 @@ void GodotPhysicsServer2D::free(RID p_rid) { } else if (body_owner.owns(p_rid)) { GodotBody2D *body = body_owner.get_or_null(p_rid); - /* - if (body->get_state_query()) - _clear_query(body->get_state_query()); - - if (body->get_direct_state_query()) - _clear_query(body->get_direct_state_query()); - */ - body_set_space(p_rid, RID()); while (body->get_shape_count()) { @@ -1208,11 +1200,6 @@ void GodotPhysicsServer2D::free(RID p_rid) { } else if (area_owner.owns(p_rid)) { GodotArea2D *area = area_owner.get_or_null(p_rid); - /* - if (area->get_monitor_query()) - _clear_query(area->get_monitor_query()); - */ - area->set_space(nullptr); while (area->get_shape_count()) { diff --git a/servers/physics_2d/godot_shape_2d.cpp b/servers/physics_2d/godot_shape_2d.cpp index 1e8799a727..b5dbb8a2dd 100644 --- a/servers/physics_2d/godot_shape_2d.cpp +++ b/servers/physics_2d/godot_shape_2d.cpp @@ -544,12 +544,6 @@ bool GodotConvexPolygonShape2D::intersect_segment(const Vector2 &p_begin, const bool inters = false; for (int i = 0; i < point_count; i++) { - //hmm.. no can do.. - /* - if (d.dot(points[i].normal)>=0) - continue; - */ - Vector2 res; if (!Geometry2D::segment_intersects_segment(p_begin, p_end, points[i].pos, points[(i + 1) % point_count].pos, &res)) { diff --git a/servers/physics_3d/gjk_epa.cpp b/servers/physics_3d/gjk_epa.cpp index 928ffe0980..23c8079538 100644 --- a/servers/physics_3d/gjk_epa.cpp +++ b/servers/physics_3d/gjk_epa.cpp @@ -918,7 +918,7 @@ bool Distance( const GodotShape3D* shape0, { results.status = gjk_status==GJK::eStatus::Inside? sResults::Penetrating : - sResults::GJK_Failed ; + sResults::GJK_Failed; return(false); } } diff --git a/servers/physics_3d/godot_collision_solver_3d_sat.cpp b/servers/physics_3d/godot_collision_solver_3d_sat.cpp index 82e04a7e31..ca429040f5 100644 --- a/servers/physics_3d/godot_collision_solver_3d_sat.cpp +++ b/servers/physics_3d/godot_collision_solver_3d_sat.cpp @@ -345,10 +345,6 @@ static void _generate_contacts_face_face(const Vector3 *p_points_A, int p_point_ for (int i = 0; i < clipbuf_len; i++) { real_t d = plane_B.distance_to(clipbuf_src[i]); - /* - if (d>CMP_EPSILON) - continue; - */ Vector3 closest_B = clipbuf_src[i] - plane_B.normal * d; diff --git a/servers/physics_3d/godot_physics_server_3d.cpp b/servers/physics_3d/godot_physics_server_3d.cpp index 4e1680e6ac..a1912dc660 100644 --- a/servers/physics_3d/godot_physics_server_3d.cpp +++ b/servers/physics_3d/godot_physics_server_3d.cpp @@ -1540,14 +1540,6 @@ void GodotPhysicsServer3D::free(RID p_rid) { } else if (body_owner.owns(p_rid)) { GodotBody3D *body = body_owner.get_or_null(p_rid); - /* - if (body->get_state_query()) - _clear_query(body->get_state_query()); - - if (body->get_direct_state_query()) - _clear_query(body->get_direct_state_query()); - */ - body->set_space(nullptr); while (body->get_shape_count()) { @@ -1566,11 +1558,6 @@ void GodotPhysicsServer3D::free(RID p_rid) { } else if (area_owner.owns(p_rid)) { GodotArea3D *area = area_owner.get_or_null(p_rid); - /* - if (area->get_monitor_query()) - _clear_query(area->get_monitor_query()); - */ - area->set_space(nullptr); while (area->get_shape_count()) { diff --git a/servers/physics_3d/godot_shape_3d.cpp b/servers/physics_3d/godot_shape_3d.cpp index 666e773c1c..7762c4829e 100644 --- a/servers/physics_3d/godot_shape_3d.cpp +++ b/servers/physics_3d/godot_shape_3d.cpp @@ -1284,12 +1284,6 @@ Vector3 GodotConcavePolygonShape3D::get_support(const Vector3 &p_normal) const { void GodotConcavePolygonShape3D::_cull_segment(int p_idx, _SegmentCullParams *p_params) const { const BVH *bvh = &p_params->bvh[p_idx]; - /* - if (p_params->dir.dot(bvh->aabb.get_support(-p_params->dir))>p_params->min_d) - return; //test against whole AABB, which isn't very costly - */ - - //printf("addr: %p\n",bvh); if (!bvh->aabb.intersects_segment(p_params->from, p_params->to)) { return; } diff --git a/servers/physics_3d/joints/godot_hinge_joint_3d.cpp b/servers/physics_3d/joints/godot_hinge_joint_3d.cpp index a7a7843499..1c4d5dec23 100644 --- a/servers/physics_3d/joints/godot_hinge_joint_3d.cpp +++ b/servers/physics_3d/joints/godot_hinge_joint_3d.cpp @@ -213,16 +213,12 @@ bool GodotHingeJoint3D::setup(real_t p_step) { m_solveLimit = false; m_accLimitImpulse = real_t(0.); - //if (m_lowerLimit < m_upperLimit) if (m_useLimit && m_lowerLimit <= m_upperLimit) { - //if (hingeAngle <= m_lowerLimit*m_limitSoftness) if (hingeAngle <= m_lowerLimit) { m_correction = (m_lowerLimit - hingeAngle); m_limitSign = 1.0f; m_solveLimit = true; - } - //else if (hingeAngle >= m_upperLimit*m_limitSoftness) - else if (hingeAngle >= m_upperLimit) { + } else if (hingeAngle >= m_upperLimit) { m_correction = m_upperLimit - hingeAngle; m_limitSign = -1.0f; m_solveLimit = true; diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp index cb07c75db4..1a84bafbd0 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp @@ -1894,7 +1894,6 @@ void RendererSceneGIRD::SDFGI::render_static_lights(RID p_render_buffers, uint32 RD::get_singleton()->draw_command_begin_label("SDFGI Render Static Lighs"); update_cascades(); - ; //need cascades updated for this SDFGIShader::Light lights[SDFGI::MAX_STATIC_LIGHTS]; uint32_t light_count[SDFGI::MAX_STATIC_LIGHTS]; diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl index 97f7e0a6e6..5d65b00bee 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl @@ -552,7 +552,6 @@ void cluster_get_item_range(uint p_offset, out uint item_min, out uint item_max, uint item_min_max = cluster_buffer.data[p_offset]; item_min = item_min_max & 0xFFFF; item_max = item_min_max >> 16; - ; item_from = item_min >> 5; item_to = (item_max == 0) ? 0 : ((item_max - 1) >> 5) + 1; //side effect of how it is stored, as item_max 0 means no elements diff --git a/servers/rendering/renderer_rd/shaders/volumetric_fog_process.glsl b/servers/rendering/renderer_rd/shaders/volumetric_fog_process.glsl index 7c8d4f7f99..7a0cea421e 100644 --- a/servers/rendering/renderer_rd/shaders/volumetric_fog_process.glsl +++ b/servers/rendering/renderer_rd/shaders/volumetric_fog_process.glsl @@ -235,7 +235,6 @@ void cluster_get_item_range(uint p_offset, out uint item_min, out uint item_max, uint item_min_max = cluster_buffer.data[p_offset]; item_min = item_min_max & 0xFFFF; item_max = item_min_max >> 16; - ; item_from = item_min >> 5; item_to = (item_max == 0) ? 0 : ((item_max - 1) >> 5) + 1; //side effect of how it is stored, as item_max 0 means no elements diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp index 5b43ca4bcd..a0b0b31a7b 100644 --- a/servers/rendering/shader_compiler.cpp +++ b/servers/rendering/shader_compiler.cpp @@ -609,7 +609,6 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene r_gen_code.uniforms += uniform_defines[i]; } -#if 1 // add up int offset = 0; for (int i = 0; i < uniform_sizes.size(); i++) { @@ -629,41 +628,6 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene if (r_gen_code.uniform_total_size % 16 != 0) { //UBO sizes must be multiples of 16 r_gen_code.uniform_total_size += 16 - (r_gen_code.uniform_total_size % 16); } -#else - // add up - for (int i = 0; i < uniform_sizes.size(); i++) { - if (i > 0) { - int align = uniform_sizes[i - 1] % uniform_alignments[i]; - if (align != 0) { - uniform_sizes[i - 1] += uniform_alignments[i] - align; - } - - uniform_sizes[i] = uniform_sizes[i] + uniform_sizes[i - 1]; - } - } - //offset - r_gen_code.uniform_offsets.resize(uniform_sizes.size()); - for (int i = 0; i < uniform_sizes.size(); i++) { - if (i > 0) - r_gen_code.uniform_offsets[i] = uniform_sizes[i - 1]; - else - r_gen_code.uniform_offsets[i] = 0; - } - /* - for(Map<StringName,SL::ShaderNode::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) { - if (SL::is_sampler_type(E->get().type)) { - continue; - } - - } - -*/ - if (uniform_sizes.size()) { - r_gen_code.uniform_total_size = uniform_sizes[uniform_sizes.size() - 1]; - } else { - r_gen_code.uniform_total_size = 0; - } -#endif uint32_t index = p_default_actions.base_varying_index; diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 91201b2028..7683cf20b3 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "shader_language.h" + #include "core/os/os.h" #include "core/string/print_string.h" #include "servers/rendering_server.h" @@ -632,7 +633,7 @@ ShaderLanguage::Token ShaderLanguage::_get_token() { char32_t last_char = str[str.length() - 1]; - if (hexa_found) { // Integer(hex) + if (hexa_found) { // Integer (hex). if (str.size() > 11 || !str.is_valid_hex_number(true)) { // > 0xFFFFFFFF return _make_token(TK_ERROR, "Invalid (hexadecimal) numeric constant"); } diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 2037268134..a7fcbcce42 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -429,7 +429,7 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint memcpy(&vw[p_offsets[ai] + i * p_vertex_stride], &value, 4); } - } else { // if (type == Variant::PACKED_FLOAT64_ARRAY) + } else { // PACKED_FLOAT64_ARRAY Vector<double> array = p_arrays[ai]; ERR_FAIL_COND_V(array.size() != p_vertex_array_len * 4, ERR_INVALID_PARAMETER); const double *src = array.ptr(); @@ -573,7 +573,7 @@ Error RenderingServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint memcpy(&sw[p_offsets[ai] + i * p_skin_stride], data, 2 * bone_count); } } - } else { // if (type == Variant::PACKED_FLOAT64_ARRAY) + } else { // PACKED_FLOAT64_ARRAY Vector<double> array = p_arrays[ai]; ERR_FAIL_COND_V(array.size() != (int32_t)(p_vertex_array_len * bone_count), ERR_INVALID_PARAMETER); const double *src = array.ptr(); |