diff options
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/navigation2d.cpp | 11 | ||||
-rw-r--r-- | scene/2d/navigation_polygon.cpp | 2 | ||||
-rw-r--r-- | scene/2d/particles_2d.cpp | 18 | ||||
-rw-r--r-- | scene/2d/particles_2d.h | 2 | ||||
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 7 | ||||
-rw-r--r-- | scene/2d/polygon_2d.cpp | 3 |
6 files changed, 11 insertions, 32 deletions
diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index e3b048fd74..9eec8e6cc3 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -121,7 +121,6 @@ void Navigation2D::_navpoly_link(int p_id) { pending.edge = j; p.edges.write[j].P = C->get().pending.push_back(pending); continue; - //print_line(String()+_get_vertex(ek.a)+" -> "+_get_vertex(ek.b)); } C->get().B = &p; @@ -144,8 +143,6 @@ void Navigation2D::_navpoly_unlink(int p_id) { NavMesh &nm = navpoly_map[p_id]; ERR_FAIL_COND(!nm.linked); - //print_line("UNLINK"); - for (List<Polygon>::Element *E = nm.polygons.front(); E; E = E->next()) { Polygon &p = E->get(); @@ -341,7 +338,6 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect path.resize(2); path.write[0] = begin_point; path.write[1] = end_point; - //print_line("Direct Path"); return path; } @@ -379,7 +375,6 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect while (!found_route) { if (open_list.size() == 0) { - //print_line("NOU OPEN LIST"); break; } //check open list @@ -526,7 +521,6 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect if (portal_left.distance_squared_to(apex_point) < CMP_EPSILON || CLOCK_TANGENT(apex_point, left, portal_right) > 0) { left_poly = p; portal_left = left; - //print_line("***ADVANCE LEFT"); } else { apex_point = portal_right; @@ -537,8 +531,6 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect if (!path.size() || path[path.size() - 1].distance_to(apex_point) > CMP_EPSILON) path.push_back(apex_point); skip = true; - //print_line("addpoint left"); - //print_line("***CLIP LEFT"); } } @@ -547,7 +539,6 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect if (portal_right.distance_squared_to(apex_point) < CMP_EPSILON || CLOCK_TANGENT(apex_point, right, portal_left) < 0) { right_poly = p; portal_right = right; - //print_line("***ADVANCE RIGHT"); } else { apex_point = portal_left; @@ -557,8 +548,6 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect portal_left = apex_point; if (!path.size() || path[path.size() - 1].distance_to(apex_point) > CMP_EPSILON) path.push_back(apex_point); - //print_line("addpoint right"); - //print_line("***CLIP RIGHT"); } } diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 2d6679272a..84b12b0bfe 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -257,7 +257,7 @@ void NavigationPolygon::make_polygons_from_outlines() { TriangulatorPartition tpart; if (tpart.ConvexPartition_HM(&in_poly, &out_poly) == 0) { //failed! - print_line("convex partition failed!"); + ERR_PRINTS("NavigationPolygon: Convex partition failed!"); return; } diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 1da1d44b17..a4c3057416 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -74,14 +74,14 @@ void Particles2D::set_randomness_ratio(float p_ratio) { randomness_ratio = p_ratio; VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio); } -void Particles2D::set_visibility_rect(const Rect2 &p_aabb) { +void Particles2D::set_visibility_rect(const Rect2 &p_visibility_rect) { - visibility_rect = p_aabb; + visibility_rect = p_visibility_rect; AABB aabb; - aabb.position.x = p_aabb.position.x; - aabb.position.y = p_aabb.position.y; - aabb.size.x = p_aabb.size.x; - aabb.size.y = p_aabb.size.y; + aabb.position.x = p_visibility_rect.position.x; + aabb.position.y = p_visibility_rect.position.y; + aabb.size.x = p_visibility_rect.size.x; + aabb.size.y = p_visibility_rect.size.y; VS::get_singleton()->particles_set_custom_aabb(particles, aabb); @@ -326,7 +326,7 @@ void Particles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pre_process_time", "secs"), &Particles2D::set_pre_process_time); ClassDB::bind_method(D_METHOD("set_explosiveness_ratio", "ratio"), &Particles2D::set_explosiveness_ratio); ClassDB::bind_method(D_METHOD("set_randomness_ratio", "ratio"), &Particles2D::set_randomness_ratio); - ClassDB::bind_method(D_METHOD("set_visibility_rect", "aabb"), &Particles2D::set_visibility_rect); + ClassDB::bind_method(D_METHOD("set_visibility_rect", "visibility_rect"), &Particles2D::set_visibility_rect); ClassDB::bind_method(D_METHOD("set_use_local_coordinates", "enable"), &Particles2D::set_use_local_coordinates); ClassDB::bind_method(D_METHOD("set_fixed_fps", "fps"), &Particles2D::set_fixed_fps); ClassDB::bind_method(D_METHOD("set_fractional_delta", "enable"), &Particles2D::set_fractional_delta); @@ -372,13 +372,13 @@ void Particles2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "get_one_shot"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "preprocess", PROPERTY_HINT_RANGE, "0.00,600.0,0.01"), "set_pre_process_time", "get_pre_process_time"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0.01,64,0.01"), "set_speed_scale", "get_speed_scale"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed_scale", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_speed_scale", "get_speed_scale"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "explosiveness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_explosiveness_ratio", "get_explosiveness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "randomness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_randomness_ratio", "get_randomness_ratio"); ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_fps", PROPERTY_HINT_RANGE, "0,1000,1"), "set_fixed_fps", "get_fixed_fps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fract_delta"), "set_fractional_delta", "get_fractional_delta"); ADD_GROUP("Drawing", ""); - ADD_PROPERTY(PropertyInfo(Variant::AABB, "visibility_rect"), "set_visibility_rect", "get_visibility_rect"); + ADD_PROPERTY(PropertyInfo(Variant::RECT2, "visibility_rect"), "set_visibility_rect", "get_visibility_rect"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "local_coords"), "set_use_local_coordinates", "get_use_local_coordinates"); ADD_PROPERTY(PropertyInfo(Variant::INT, "draw_order", PROPERTY_HINT_ENUM, "Index,Lifetime"), "set_draw_order", "get_draw_order"); ADD_GROUP("Process Material", "process_"); diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index f367095581..31a66afb2a 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -84,7 +84,7 @@ public: void set_pre_process_time(float p_time); void set_explosiveness_ratio(float p_ratio); void set_randomness_ratio(float p_ratio); - void set_visibility_rect(const Rect2 &p_aabb); + void set_visibility_rect(const Rect2 &p_visibility_rect); void set_use_local_coordinates(bool p_enable); void set_process_material(const Ref<Material> &p_material); void set_speed_scale(float p_scale); diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 02213e07d0..8e31688d90 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -365,13 +365,6 @@ void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shap ERR_FAIL_COND(!contact_monitor); Map<ObjectID, BodyState>::Element *E = contact_monitor->body_map.find(objid); - /*if (obj) { - if (body_in) - print_line("in: "+String(obj->call("get_name"))); - else - print_line("out: "+String(obj->call("get_name"))); - }*/ - ERR_FAIL_COND(!body_in && !E); if (body_in) { diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 34f4ccc03e..fc0741cc5c 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -253,7 +253,6 @@ void Polygon2D::_notification(int p_what) { //normalize for (int j = 0; j < 4; j++) { weightsw[i * 4 + j] /= tw; - // print_line("point " + itos(i) + " idx " + itos(j) + " index: " + itos(bonesw[i * 4 + j]) + " weight: " + rtos(weightsw[i * 4 + j])); } } } @@ -345,8 +344,6 @@ void Polygon2D::_notification(int p_what) { } } - //print_line("loops: " + itos(loops.size()) + " indices: " + itos(indices.size())); - VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID()); } |