diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-16 16:55:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 16:55:07 +0100 |
commit | 51a00c2855009ce4cd6475c09209ebd22641f448 (patch) | |
tree | 56b249dbe446b5e24946c16ee13bd8241a119de6 /tests | |
parent | 33c7f52f361961c64432cfd772909ed3ba76cd51 (diff) | |
parent | b8b45804485f7ca18f035f1eeb7a1ac0cf591cac (diff) |
Merge pull request #58182 from akien-mga/style-cleanup-if-semicolons-deadcode
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/string/test_string.h | 2 | ||||
-rw-r--r-- | tests/servers/test_physics_2d.cpp | 30 |
2 files changed, 4 insertions, 28 deletions
diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index bf78298450..87016dddf6 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -39,7 +39,7 @@ namespace TestString { int u32scmp(const char32_t *l, const char32_t *r) { for (; *l == *r && *l && *r; l++, r++) { - ; + // Continue. } return *l - *r; } diff --git a/tests/servers/test_physics_2d.cpp b/tests/servers/test_physics_2d.cpp index 8b77458a33..138412ec09 100644 --- a/tests/servers/test_physics_2d.cpp +++ b/tests/servers/test_physics_2d.cpp @@ -84,6 +84,7 @@ class TestPhysics2DMainLoop : public MainLoop { body_shape_data[PhysicsServer2D::SHAPE_SEGMENT].shape = segment_shape; } + // CIRCLE { @@ -182,10 +183,7 @@ class TestPhysics2DMainLoop : public MainLoop { } void _do_ray_query() { - /* - PhysicsServer2D *ps = PhysicsServer2D::get_singleton(); - ps->query_intersection_segment(ray_query,ray_from,ray_to); - */ + // FIXME: Do something? } protected: @@ -231,11 +229,10 @@ protected: ps->body_set_continuous_collision_detection_mode(body, PhysicsServer2D::CCD_MODE_CAST_SHAPE); ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, p_xform); - //print_line("add body with xform: "+p_xform); RID sprite = vs->canvas_item_create(); vs->canvas_item_set_parent(sprite, canvas); vs->canvas_item_set_transform(sprite, p_xform); - Size2 imgsize(5, 5); //vs->texture_get_width(body_shape_data[p_shape].image), vs->texture_get_height(body_shape_data[p_shape].image)); + Size2 imgsize(5, 5); vs->canvas_item_add_texture_rect(sprite, Rect2(-imgsize / 2.0, imgsize), body_shape_data[p_shape].image); ps->body_set_force_integration_callback(body, callable_mp(this, &TestPhysics2DMainLoop::_body_moved), sprite); @@ -326,21 +323,11 @@ public: vs->viewport_set_size(vp, screen_size.x, screen_size.y); vs->viewport_attach_to_screen(vp, Rect2(Vector2(), screen_size)); vs->viewport_set_active(vp, true); - - Transform2D smaller; - //smaller.scale(Vector2(0.6,0.6)); - //smaller.elements[2]=Vector2(100,0); - - //view_xform = smaller; vs->viewport_set_canvas_transform(vp, canvas, view_xform); } ray = vs->canvas_item_create(); vs->canvas_item_set_parent(ray, canvas); - //ray_query = ps->query_create(this,"_ray_query_callback",Variant()); - //ps->query_intersection(ray_query,space); - - _create_body_shape_data(); for (int i = 0; i < 32; i++) { PhysicsServer2D::ShapeType types[4] = { @@ -352,17 +339,9 @@ public: }; PhysicsServer2D::ShapeType type = types[i % 4]; - //type=PhysicsServer2D::SHAPE_SEGMENT; _add_body(type, Transform2D(i * 0.8, Point2(152 + i * 40, 100 - 40 * i))); - /* - if (i==0) - ps->body_set_mode(b,PhysicsServer2D::BODY_MODE_STATIC); - */ } - //RID b= _add_body(PhysicsServer2D::SHAPE_CIRCLE,Transform2D(0,Point2(101,140))); - //ps->body_set_mode(b,PhysicsServer2D::BODY_MODE_STATIC); - Point2 prev; Vector<Point2> parr; @@ -376,9 +355,6 @@ public: } _add_concave(parr); - //_add_world_boundary(Vector2(0.0,-1).normalized(),-300); - //_add_world_boundary(Vector2(1,0).normalized(),50); - //_add_world_boundary(Vector2(-1,0).normalized(),-600); } virtual bool process(double p_time) override { |