From f40f360a2c4ca8e6f2a651dbcca3ae82e2abe7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 8 Jul 2016 00:32:28 +0200 Subject: [PATCH] Remove unused variables (fourth pass) + dead code Also fix a potential regression from 3fcb9b1ec179b99d979d4cfea9b5e3c80e4a3e33. --- core/image_quantize.cpp | 5 ----- core/io/marshalls.cpp | 3 --- core/io/resource_format_xml.cpp | 2 -- core/io/resource_loader.cpp | 1 - core/io/translation_loader_po.cpp | 3 --- core/math/triangle_mesh.cpp | 14 ------------ core/object.cpp | 2 +- core/path_db.cpp | 2 -- core/pool_allocator.cpp | 1 - core/ustring.cpp | 1 - scene/2d/camera_2d.cpp | 1 - scene/2d/navigation2d.cpp | 7 ------ scene/2d/visibility_notifier_2d.cpp | 12 +--------- scene/3d/physics_joint.cpp | 6 ----- scene/3d/vehicle_body.cpp | 12 +++------- scene/3d/visibility_notifier.cpp | 15 ++----------- scene/resources/animation.cpp | 3 --- scene/resources/dynamic_font.cpp | 2 +- scene/resources/mesh.cpp | 4 ++-- scene/resources/packed_scene.cpp | 22 ------------------- servers/audio/audio_mixer_sw.cpp | 6 +---- servers/physics/body_pair_sw.cpp | 4 ---- servers/physics/collision_solver_sat.cpp | 1 - servers/physics/shape_sw.cpp | 4 ---- servers/physics/space_sw.cpp | 4 ---- servers/physics_2d/shape_2d_sw.cpp | 3 --- servers/physics_2d/space_2d_sw.cpp | 4 ---- .../spatial_sound_2d_server_sw.cpp | 17 -------------- servers/visual/shader_language.cpp | 16 -------------- servers/visual/visual_server_raster.cpp | 8 ------- servers/visual_server.cpp | 1 - tools/editor/dependency_editor.cpp | 1 + 32 files changed, 12 insertions(+), 175 deletions(-) diff --git a/core/image_quantize.cpp b/core/image_quantize.cpp index b8d4658fda7..f6fe7a88a03 100644 --- a/core/image_quantize.cpp +++ b/core/image_quantize.cpp @@ -59,7 +59,6 @@ int Image::MCBlock::get_longest_axis_index() const { for(int i=0;i<4;i++) { int d = max_color.color.col[i]-min_color.color.col[i]; - //printf(" ai:%i - %i\n",i,d); if (d>max_dist) { max_index=i; max_dist=d; @@ -71,13 +70,11 @@ int Image::MCBlock::get_longest_axis_index() const { int Image::MCBlock::get_longest_axis_length() const { int max_dist=-1; - int max_index=0; for(int i=0;i<4;i++) { int d = max_color.color.col[i]-min_color.color.col[i]; if (d>max_dist) { - max_index=i; max_dist=d; } } @@ -117,8 +114,6 @@ void Image::MCBlock::shrink() { void Image::quantize() { - Image::Format orig_format=format; - bool has_alpha = detect_alpha()!=ALPHA_NONE; bool quantize_fast=OS::get_singleton()->has_environment("QUANTIZE_FAST"); diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 60617e12371..c9bd38c6542 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -685,7 +685,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (count) { varray.resize(count); DVector::Write w = varray.write(); - const float *r = (const float*)buf; for(int i=0;i<(int)count;i++) { @@ -724,7 +723,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (count) { varray.resize(count); DVector::Write w = varray.write(); - const float *r = (const float*)buf; for(int i=0;i<(int)count;i++) { @@ -764,7 +762,6 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (count) { carray.resize(count); DVector::Write w = carray.write(); - const float *r = (const float*)buf; for(int i=0;i<(int)count;i++) { diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp index a42a922baf0..0d545b16f58 100644 --- a/core/io/resource_format_xml.cpp +++ b/core/io/resource_format_xml.cpp @@ -1862,8 +1862,6 @@ void ResourceInteractiveLoaderXML::open(FileAccess *p_f) { } int major = version.get_slicec('.',0).to_int(); - int minor = version.get_slicec('.',1).to_int(); - if (major>VERSION_MAJOR) { error=ERR_FILE_UNRECOGNIZED; diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 1bb80e74eb3..f414f85df85 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -443,7 +443,6 @@ String ResourceLoader::get_resource_type(const String &p_path) { String remapped_path = PathRemap::get_singleton()->get_remap(local_path); String extension=remapped_path.extension(); - bool found=false; for (int i=0;iget_resource_type(local_path); diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 4ddb276a270..a22c57b941d 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -47,7 +47,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S String msg_id; String msg_str; String config; - int msg_line=0; if (r_error) *r_error=ERR_FILE_CORRUPT; @@ -97,7 +96,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S status=STATUS_READING_ID; msg_id=""; msg_str=""; - msg_line=line; } if (l.begins_with("msgstr")) { @@ -111,7 +109,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S l=l.substr(6,l.length()).strip_edges(); status=STATUS_READING_STRING; - msg_line=line; } if (l=="" || l.begins_with("#")) { diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index adb9861092b..7aea32a8a0b 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -195,9 +195,6 @@ Vector3 TriangleMesh::get_area_normal(const AABB& p_aabb) const { int n_count=0; Vector3 n; - //for(int i=0;i::Read trianglesr = triangles.read(); @@ -205,7 +202,6 @@ Vector3 TriangleMesh::get_area_normal(const AABB& p_aabb) const { DVector::Read bvhr=bvh.read(); const Triangle *triangleptr=trianglesr.ptr(); - const Vector3 *vertexptr=verticesr.ptr(); int pos=bvh.size()-1; const BVH *bvhptr = bvhr.ptr(); @@ -301,14 +297,7 @@ bool TriangleMesh::intersect_segment(const Vector3& p_begin,const Vector3& p_end real_t d=1e10; bool inters=false; - //for(int i=0;i::Read trianglesr = triangles.read(); DVector::Read verticesr=vertices.read(); @@ -431,9 +420,6 @@ bool TriangleMesh::intersect_ray(const Vector3& p_begin,const Vector3& p_dir,Vec real_t d=1e20; bool inters=false; - //for(int i=0;i::Read trianglesr = triangles.read(); diff --git a/core/object.cpp b/core/object.cpp index 99d4a1f46af..dc3d5319279 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1495,7 +1495,7 @@ void Object::disconnect(const StringName& p_signal, Object *p_to_object, const S ERR_EXPLAIN("Disconnecting nonexistent signal '"+p_signal+"', slot: "+itos(target._id)+":"+target.method); ERR_FAIL(); } - int prev = p_to_object->connections.size(); + p_to_object->connections.erase(s->slot_map[target].cE); s->slot_map.erase(target); diff --git a/core/path_db.cpp b/core/path_db.cpp index 75450889788..0956c4cd3f3 100644 --- a/core/path_db.cpp +++ b/core/path_db.cpp @@ -329,7 +329,6 @@ NodePath::NodePath(const String& p_path) { Vector subpath; int absolute=(path[0]=='/')?1:0;; - bool valid=false; bool last_is_slash=true; int slices=0; int subpath_pos=path.find(":"); @@ -373,7 +372,6 @@ NodePath::NodePath(const String& p_path) { if (last_is_slash) slices++; - valid=true; last_is_slash=false; } } diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index 849fd75f507..9f5fcf5f507 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -372,7 +372,6 @@ Error PoolAllocator::resize(ID p_mem,int p_new_size) { } //p_new_size = align(p_new_size) - int _total = pool_size; // - static_area_size; int _free = free_mem; // - static_area_size; if ((_free + aligned(e->len)) - alloc_size < 0) { diff --git a/core/ustring.cpp b/core/ustring.cpp index 3c22de35f1f..6788ada1bba 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3836,7 +3836,6 @@ String String::lpad(int min_length, const String& character) const { String String::sprintf(const Array& values, bool* error) const { String formatted; CharType* self = (CharType*)c_str(); - int num_items = values.size(); bool in_format = false; int value_index = 0; int min_chars; diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 85256be9409..27e07a35be0 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -44,7 +44,6 @@ void Camera2D::_update_scroll() { if (current) { Matrix32 xform = get_camera_transform(); - RID vp = viewport->get_viewport(); if (viewport) { viewport->set_canvas_transform( xform ); } diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index b4332cc75d5..82c1327a8f1 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -552,7 +552,6 @@ debug path if (p_optimize) { //string pulling - Polygon *apex_poly=end_poly; Vector2 apex_point=end_point; Vector2 portal_left=apex_point; Vector2 portal_right=apex_point; @@ -613,12 +612,9 @@ debug path //print_line("***ADVANCE LEFT"); } else { - //_clip_path(path,apex_poly,portal_right,right_poly); - apex_point=portal_right; p=right_poly; left_poly=p; - apex_poly=p; portal_left=apex_point; portal_right=apex_point; if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON) @@ -637,12 +633,9 @@ debug path //print_line("***ADVANCE RIGHT"); } else { - //_clip_path(path,apex_poly,portal_left,left_poly); - apex_point=portal_left; p=left_poly; right_poly=p; - apex_poly=p; portal_right=apex_point; portal_left=apex_point; if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON) diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 12524a21924..5411950976c 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -270,9 +270,6 @@ void VisibilityEnabler2D::_notification(int p_what){ return; - Node *from = this; - //find where current scene starts - for (Map::Element *E=nodes.front();E;E=E->next()) { if (!visible) @@ -293,14 +290,7 @@ void VisibilityEnabler2D::_change_node_state(Node* p_node,bool p_enabled) { RigidBody2D *rb = p_node->cast_to(); if (rb) { - if (p_enabled) { - RigidBody2D::Mode mode = RigidBody2D::Mode(nodes[p_node].operator int()); - //rb->set_mode(mode); - rb->set_sleeping(false); - } else { - //rb->set_mode(RigidBody2D::MODE_STATIC); - rb->set_sleeping(true); - } + rb->set_sleeping(!p_enabled); } } diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index 3f03b2aab3a..084d96975fe 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -369,9 +369,6 @@ RID HingeJoint::_configure_joint(PhysicsBody *body_a,PhysicsBody *body_b) { Transform gt = get_global_transform(); - Vector3 hingepos = gt.origin; - Vector3 hingedir = gt.basis.get_axis(2); - Transform ainv = body_a->get_global_transform().affine_inverse(); Transform local_a = ainv * gt; @@ -532,9 +529,6 @@ RID SliderJoint::_configure_joint(PhysicsBody *body_a,PhysicsBody *body_b) { Transform gt = get_global_transform(); - Vector3 sliderpos = gt.origin; - Vector3 sliderdir = gt.basis.get_axis(2); - Transform ainv = body_a->get_global_transform().affine_inverse(); Transform local_a = ainv * gt; diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 6ccf07db1e9..7c7957640f6 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -488,7 +488,6 @@ real_t VehicleBody::_ray_cast(int p_idx,PhysicsDirectBodyState *s) { void VehicleBody::_update_suspension(PhysicsDirectBodyState *s) { - real_t deltaTime = s->get_step(); real_t chassisMass = mass; for (int w_it=0; w_itget_linear_velocity(), s->get_transform().basis.transposed().xform(s->get_angular_velocity()), b2lv, b2trans.xform(b2av)); - real_t a; - a=jacDiagABInv; rel_vel = normal.dot(vel); - //todo: move this into proper structure + //TODO: move this into proper structure real_t contactDamping = real_t(0.4); #define ONLY_USE_LINEAR_MASS #ifdef ONLY_USE_LINEAR_MASS @@ -642,16 +636,16 @@ VehicleBody::btVehicleWheelContactPoint::btVehicleWheelContactPoint(PhysicsDirec denom0= s->get_inverse_mass() + frictionDirectionWorld.dot(vec); } + /* TODO: Why is this code unused? if (body1) { Vector3 r0 = frictionPosWorld - body1->get_global_transform().origin; Vector3 c0 = (r0).cross(frictionDirectionWorld); Vector3 vec = s->get_inverse_inertia_tensor().xform_inv(c0).cross(r0); //denom1= body1->get_inverse_mass() + frictionDirectionWorld.dot(vec); - denom1=0; } - + */ real_t relaxation = 1.f; m_jacDiagABInv = relaxation/(denom0+denom1); diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index 60097ad4823..f3b5cde0eb4 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -221,9 +221,6 @@ void VisibilityEnabler::_notification(int p_what){ return; - Node *from = this; - //find where current scene starts - for (Map::Element *E=nodes.front();E;E=E->next()) { if (!visible) @@ -242,17 +239,9 @@ void VisibilityEnabler::_change_node_state(Node* p_node,bool p_enabled) { { RigidBody *rb = p_node->cast_to(); - if (rb) { + if (rb) - if (p_enabled) { - RigidBody::Mode mode = RigidBody::Mode(nodes[p_node].operator int()); - //rb->set_mode(mode); - rb->set_sleeping(false); - } else { - //rb->set_mode(RigidBody::MODE_STATIC); - rb->set_sleeping(true); - } - } + rb->set_sleeping(!p_enabled); } { diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 098801bcf5f..1d15b6f2bcf 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1997,9 +1997,6 @@ void Animation::_transform_track_optimize(int p_idx,float p_alowed_linear_err,fl void Animation::optimize(float p_allowed_linear_err,float p_allowed_angular_err,float p_angle_max) { - - int total_tt=0; - for(int i=0;itype==TYPE_TRANSFORM) diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index c3b40f7add6..67587a8f8ba 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -434,7 +434,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { int w = slot->bitmap.width; int h = slot->bitmap.rows; - int p = slot->bitmap.pitch; + //int p = slot->bitmap.pitch; int yofs=slot->bitmap_top; int xofs=slot->bitmap_left; int advance=slot->advance.x>>6; diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index a1a1f0a9357..921466585d7 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -30,7 +30,8 @@ #include "scene/resources/concave_polygon_shape.h" #include "scene/resources/convex_polygon_shape.h" #include "surface_tool.h" -static const char*_array_name[]={ + +static const char* _array_name[]={ "vertex_array", "normal_array", "tangent_array", @@ -847,7 +848,6 @@ Ref Mesh::create_outline(float p_margin) const { } { - int tc=0; DVector::Write ir; DVector indices =arrays[ARRAY_INDEX]; bool has_indices=false; diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 4f5eed87960..c36480420b3 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -471,7 +471,6 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map plist; p_node->get_property_list(&plist); - bool saved_script=false; - for (List::Element *E=plist.front();E;E=E->next()) { @@ -528,23 +525,7 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Mapget_script_instance()) { - //if this is an overriden value by another script, save it anyway - //as the script change will erase it - //https://github.com/godotengine/godot/issues/2958 - bool valid=false; - p_node->get_script_instance()->get_property_type(name,&valid); - if (valid) { - exists=false; - isdefault=false; - } - } - -#endif if (exists) { @@ -577,9 +558,6 @@ https://github.com/godotengine/godot/issues/3127 } } - if (name=="script/script") - saved_script=true; - NodeData::Property prop; prop.name=_nm_get_string( name,name_map); prop.value=_vm_get_variant( value, variant_map); diff --git a/servers/audio/audio_mixer_sw.cpp b/servers/audio/audio_mixer_sw.cpp index 64369182b12..17f8c36c9a2 100644 --- a/servers/audio/audio_mixer_sw.cpp +++ b/servers/audio/audio_mixer_sw.cpp @@ -75,7 +75,7 @@ void AudioMixerSW::do_resample(const Depth* p_src, int32_t *p_dst, ResamplerStat for(int i=0;i<(is_stereo?2:1);i++) { - int16_t nibble,signed_nibble,diff,step; + int16_t nibble,diff,step; p_state->ima_adpcm[i].last_nibble++; const uint8_t *src_ptr=p_state->ima_adpcm[i].ptr; @@ -92,10 +92,6 @@ void AudioMixerSW::do_resample(const Depth* p_src, int32_t *p_dst, ResamplerStat if (p_state->ima_adpcm[i].step_index>88) p_state->ima_adpcm[i].step_index=88; - /* - signed_nibble = (nibble&7) * ((nibble&8)?-1:1); - diff = (2 * signed_nibble + 1) * step / 4; */ - diff = step >> 3 ; if (nibble & 1) diff += step >> 2 ; diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index 40e906c36c3..3202e52abb0 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -307,10 +307,6 @@ bool BodyPairSW::setup(float p_step) { } #endif - - int gather_A = A->can_report_contacts(); - int gather_B = B->can_report_contacts(); - c.rA = global_A; c.rB = global_B-offset_B; diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index 8789663f631..3e7719e5eb9 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -1230,7 +1230,6 @@ static void _collision_capsule_convex_polygon(const ShapeSW *p_a,const Transform const Geometry::MeshData::Edge *edges = mesh.edges.ptr(); int edge_count = mesh.edges.size(); const Vector3 *vertices = mesh.vertices.ptr(); - int vertex_count = mesh.vertices.size(); // faces of B for (int i=0;i support_max) { diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index 1e6f42aa020..7077146420f 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -150,7 +150,6 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transfo int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); - bool collided=false; int cc=0; //Transform ai = p_xform.affine_inverse(); @@ -269,7 +268,6 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform& for(int i=0;i<8;i++) { //steps should be customizable.. - Transform xfa = p_xform; float ofs = (low+hi)*0.5; Vector3 sep=mnormal; //important optimization for this to work fast enough @@ -337,7 +335,6 @@ bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform& p_sh int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); bool collided=false; - int cc=0; r_result_count=0; PhysicsServerSW::CollCbkData cbk; @@ -457,7 +454,6 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform& p_shape_ if (rcd.best_object->get_type()==CollisionObjectSW::TYPE_BODY) { const BodySW *body = static_cast(rcd.best_object); - Vector3 rel_vec = r_info->point-body->get_transform().get_origin(); r_info->linear_velocity = body->get_linear_velocity() + (body->get_angular_velocity()).cross(body->get_transform().origin-rcd.best_contact);// * mPos); diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 8b583dd3c62..9291aa6c171 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -243,7 +243,6 @@ bool SegmentShape2DSW::intersect_segment(const Vector2& p_begin,const Vector2& p if (!Geometry::segment_intersects_segment_2d(p_begin,p_end,a,b,&r_point)) return false; - Vector2 d = p_end-p_begin; if (n.dot(p_begin) > n.dot(a)) { r_normal=n; } else { @@ -825,7 +824,6 @@ bool ConcavePolygonShape2DSW::intersect_segment(const Vector2& p_begin,const Vec const Segment *segmentptr=&segments[0]; const Vector2 *pointptr=&points[0]; const BVH *bvhptr = &bvh[0]; - int pos=bvh.size()-1; stack[0]=0; @@ -1088,7 +1086,6 @@ void ConcavePolygonShape2DSW::cull(const Rect2& p_local_aabb,Callback p_callback const Segment *segmentptr=&segments[0]; const Vector2 *pointptr=&points[0]; const BVH *bvhptr = &bvh[0]; - int pos=bvh.size()-1; stack[0]=0; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index ddef5fc86bb..5fde6f567b4 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -200,7 +200,6 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Matri int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,p_result_max,space->intersection_query_subindex_results); - bool collided=false; int cc=0; for(int i=0;ibroadphase->cull_aabb(aabb,space->intersection_query_results,Space2DSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); bool collided=false; - int cc=0; r_result_count=0; Physics2DServerSW::CollCbkData cbk; @@ -768,7 +765,6 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body,const Vector2&p_motion,float p for(int i=0;i<8;i++) { //steps should be customizable.. - //Matrix32 xfa = p_xform; float ofs = (low+hi)*0.5; Vector2 sep=mnormal; //important optimization for this to work fast enough diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp index d27b322c21a..6c42c2f5273 100644 --- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp +++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp @@ -851,23 +851,6 @@ void SpatialSound2DServerSW::update(float p_delta) { //this could be optimized at some point... am not sure Space *space=space_owner.get(source->space); Room *room=room_owner.get(space->default_room); - int max_level=-0x80000000; - /* - int rooms_culled = space->octree.cull_point(source->transform.origin,cull_rooms,MAX_CULL_ROOMS); - for(int i=0;ibounds.is_empty() ); // how did this happen?? - if (r->level<=max_level) //ignore optimization (level too low) - continue; - Vector2 local_point = r->inverse_transform.xform(source->transform.origin); - if (!r->bounds.point_is_inside(local_point)) - continue; - room=r; - max_level=r->level; - - } - */ //compute mixing weights (support for multiple listeners in the same output) float total_distance=0; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 0b2a282c04d..09b3ada509e 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -2539,8 +2539,6 @@ Error ShaderLanguage::parse_block(Parser& parser,BlockNode *p_block) { Error ShaderLanguage::parse(const Vector& p_tokens,ShaderType p_type,CompileFunc p_compile_func,void *p_userdata,String *r_error,int *r_err_line,int *r_err_column) { - uint64_t t = OS::get_singleton()->get_ticks_usec(); - Parser parser(p_tokens); parser.program = parser.create_node(NULL); parser.program->body = parser.create_node(parser.program); @@ -2605,18 +2603,10 @@ Error ShaderLanguage::parse(const Vector& p_tokens,ShaderType p_type,Comp return err; } - double tf = (OS::get_singleton()->get_ticks_usec()-t)/1000.0; - //print_line("parse time: "+rtos(tf)); - - t = OS::get_singleton()->get_ticks_usec(); - if (p_compile_func) { err = p_compile_func(p_userdata,parser.program); } - tf = (OS::get_singleton()->get_ticks_usec()-t)/1000.0; - //print_line("compile time: "+rtos(tf)); - //clean up nodes created while(parser.nodegc.size()) { @@ -2633,22 +2623,16 @@ Error ShaderLanguage::compile(const String& p_code,ShaderType p_type,CompileFunc *r_err_column=0; Vector tokens; - uint64_t t = OS::get_singleton()->get_ticks_usec(); - Error err = tokenize(p_code,&tokens,r_error,r_err_line,r_err_column); if (err!=OK) { print_line("tokenizer error!"); } - double tf = (OS::get_singleton()->get_ticks_usec()-t)/1000.0; - //print_line("tokenize time: "+rtos(tf)); - if (err!=OK) { return err; } err = parse(tokens,p_type,p_compile_func,p_userdata,r_error,r_err_line,r_err_column); if (err!=OK) { - //print_line("LDEBUG: "+lex_debug(p_code)); return err; } return OK; diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 532247d94ce..526179c41f7 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -4843,11 +4843,6 @@ void VisualServerRaster::_instance_draw(Instance *p_instance) { switch(p_instance->base_type) { case INSTANCE_MESH: { - const float *morphs = NULL; - if (!p_instance->data.morph_values.empty()) { - morphs=&p_instance->data.morph_values[0]; - } - rasterizer->add_mesh(p_instance->base_rid, &p_instance->data); } break; case INSTANCE_MULTIMESH: { @@ -5227,8 +5222,6 @@ void VisualServerRaster::_light_instance_update_lispsm_shadow(Instance *p_light, Vector3 light_vec = -p_light->data.transform.basis.get_axis(2); Vector3 view_vec = -p_camera->transform.basis.get_axis(2); - float viewdot = light_vec.normalized().dot(view_vec.normalized()); - float near_dist=1; @@ -6466,7 +6459,6 @@ void VisualServerRaster::_render_no_camera(Viewport *p_viewport,Camera *p_camera void VisualServerRaster::_render_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario) { - uint64_t t = OS::get_singleton()->get_ticks_usec(); render_pass++; uint32_t camera_layer_mask=p_camera->visible_layers; diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index fafc09f5542..9ec02f50712 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -757,7 +757,6 @@ void VisualServer::mesh_add_surface_from_mesh_data( RID p_mesh, const Geometry:: } } - int s = mesh_get_surface_count(p_mesh); Array d; d.resize(VS::ARRAY_MAX); d[ARRAY_VERTEX]=vertices; diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index ef667b75e14..049bcefc75f 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -418,6 +418,7 @@ void DependencyRemoveDialog::show(const Vector &to_erase) { exist=false; owners->clear(); files.clear(); + owners->create_item(); // root for(int i=0;i