diff options
Diffstat (limited to 'scene')
375 files changed, 512 insertions, 4701 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 366c3a8bd8..26241df660 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index 80defac079..6c660d0381 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 8f405dd314..1124904963 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index 12d71f3911..c56cf651a1 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/back_buffer_copy.cpp b/scene/2d/back_buffer_copy.cpp index 44bee20d0a..2858ddaad5 100644 --- a/scene/2d/back_buffer_copy.cpp +++ b/scene/2d/back_buffer_copy.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/back_buffer_copy.h b/scene/2d/back_buffer_copy.h index 4080f50696..2424dd7b19 100644 --- a/scene/2d/back_buffer_copy.h +++ b/scene/2d/back_buffer_copy.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 6cbac4ed3b..e39e6fc6da 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index 8d9e76be85..dfcadf65a6 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index ea32953d68..4f00966e75 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index c6180e07b6..3a99e917eb 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index a132c5e18c..05831609fc 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/canvas_modulate.h b/scene/2d/canvas_modulate.h index 37d9d47ba5..4195c1386c 100644 --- a/scene/2d/canvas_modulate.h +++ b/scene/2d/canvas_modulate.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index d3bb5a8d4e..ce56b85a9e 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 36bf39ff4e..a828d8d8ea 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index f136de5166..e2764a6e8d 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -79,11 +79,6 @@ void CollisionPolygon2D::_build_polygon() { Vector<Vector<Vector2> > CollisionPolygon2D::_decompose_in_convex() { Vector<Vector<Vector2> > decomp; -#if 0 - //fast but imprecise triangulator, gave us problems - decomp = Geometry::decompose_polygon(polygon); -#else - List<TriangulatorPoly> in_poly, out_poly; TriangulatorPoly inp; @@ -116,8 +111,6 @@ Vector<Vector<Vector2> > CollisionPolygon2D::_decompose_in_convex() { idx++; } -#endif - return decomp; } diff --git a/scene/2d/collision_polygon_2d.h b/scene/2d/collision_polygon_2d.h index f0666ba9de..c9ec860e36 100644 --- a/scene/2d/collision_polygon_2d.h +++ b/scene/2d/collision_polygon_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 3bb53a5e11..0758f4a9bf 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h index 1f2b96b91f..04203a75b4 100644 --- a/scene/2d/collision_shape_2d.h +++ b/scene/2d/collision_shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 726f57d42e..69bad1623f 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/joints_2d.h b/scene/2d/joints_2d.h index f854ce51ee..685299abc6 100644 --- a/scene/2d/joints_2d.h +++ b/scene/2d/joints_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 219574cbfd..4abb51ef7c 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h index 90e55aeda4..66b0aa2299 100644 --- a/scene/2d/light_2d.h +++ b/scene/2d/light_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index 680adeea69..92e0d8a2f6 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/light_occluder_2d.h b/scene/2d/light_occluder_2d.h index 30c30b1a47..cca7bfecd6 100644 --- a/scene/2d/light_occluder_2d.h +++ b/scene/2d/light_occluder_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp index 6e7bfe63c8..c87a9a5b1e 100644 --- a/scene/2d/line_2d.cpp +++ b/scene/2d/line_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/line_2d.h b/scene/2d/line_2d.h index e8ca5e6e7c..017ccf13ff 100644 --- a/scene/2d/line_2d.h +++ b/scene/2d/line_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index 3c1410edbb..9eea5191b9 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/line_builder.h b/scene/2d/line_builder.h index 0e1a2aaf50..227e0abd08 100644 --- a/scene/2d/line_builder.h +++ b/scene/2d/line_builder.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index 383236b4ca..fa488b6b23 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -236,42 +236,6 @@ void Navigation2D::navpoly_remove(int p_id) { _navpoly_unlink(p_id); navpoly_map.erase(p_id); } -#if 0 -void Navigation2D::_clip_path(Vector<Vector2>& path, Polygon *from_poly, const Vector2& p_to_point, Polygon* p_to_poly) { - - Vector2 from = path[path.size()-1]; - - if (from.distance_to(p_to_point)<CMP_EPSILON) - return; - Plane cut_plane; - cut_plane.normal = (from-p_to_point).cross(up); - if (cut_plane.normal==Vector2()) - return; - cut_plane.normal.normalize(); - cut_plane.d = cut_plane.normal.dot(from); - - - while(from_poly!=p_to_poly) { - - int pe = from_poly->prev_edge; - Vector2 a = _get_vertex(from_poly->edges[pe].point); - Vector2 b = _get_vertex(from_poly->edges[(pe+1)%from_poly->edges.size()].point); - - from_poly=from_poly->edges[pe].C; - ERR_FAIL_COND(!from_poly); - - if (a.distance_to(b)>CMP_EPSILON) { - - Vector2 inters; - if (cut_plane.intersects_segment(a,b,&inters)) { - if (inters.distance_to(p_to_point)>CMP_EPSILON && inters.distance_to(path[path.size()-1])>CMP_EPSILON) { - path.push_back(inters); - } - } - } - } -} -#endif Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vector2 &p_end, bool p_optimize) { @@ -498,29 +462,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2 &p_start, const Vect open_list.erase(least_cost_poly); } -#if 0 -debug path - { - Polygon *p=end_poly; - int idx=0; - - while(true) { - int prev = p->prev_edge; - int prev_n = (p->prev_edge+1)%p->edges.size(); - Vector2 point = (_get_vertex(p->edges[prev].point) + _get_vertex(p->edges[prev_n].point))*0.5; - String points; - for(int i=0;i<p->edges.size();i++) { - if (i>0) - points+=", "; - points+=_get_vertex(p->edges[i].point); - } - //print_line("poly "+itos(idx++)+" - "+points); - p = p->edges[prev].C; - if (p==begin_poly) - break; - } - } -#endif + if (found_route) { Vector<Vector2> path; diff --git a/scene/2d/navigation2d.h b/scene/2d/navigation2d.h index 54e89de9e2..e87b01f7c5 100644 --- a/scene/2d/navigation2d.h +++ b/scene/2d/navigation2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -153,9 +153,7 @@ class Navigation2D : public Node2D { float cell_size; Map<int, NavMesh> navpoly_map; int last_id; -#if 0 - void _clip_path(Vector<Vector2>& path,Polygon *from_poly, const Vector2& p_to_point, Polygon* p_to_poly); -#endif + protected: static void _bind_methods(); diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 0d5d06bef7..352ec3b300 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/navigation_polygon.h b/scene/2d/navigation_polygon.h index f6e6ed210a..5576a3abd2 100644 --- a/scene/2d/navigation_polygon.h +++ b/scene/2d/navigation_polygon.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index af5834c5b6..0c7685a858 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index a6009851c7..19aafc81ff 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index bdb4bd2b16..0ddcb7b51b 100644 --- a/scene/2d/parallax_background.cpp +++ b/scene/2d/parallax_background.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h index fce1bbd928..0dad1daeab 100644 --- a/scene/2d/parallax_background.h +++ b/scene/2d/parallax_background.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 40d688b708..8fe651cb5f 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/parallax_layer.h b/scene/2d/parallax_layer.h index f2d0053342..95ca27c41a 100644 --- a/scene/2d/parallax_layer.h +++ b/scene/2d/parallax_layer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index b0c00c4a64..c146ac08c2 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index a6ac0c37d3..6946f2a799 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index d2474d9557..1d7bd8fc2a 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h index e80817cd3c..88a0abdea9 100644 --- a/scene/2d/path_2d.h +++ b/scene/2d/path_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/path_texture.cpp b/scene/2d/path_texture.cpp index e06c79dabd..13644f71cf 100644 --- a/scene/2d/path_texture.cpp +++ b/scene/2d/path_texture.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/path_texture.h b/scene/2d/path_texture.h index 163e914e4a..4639a6072b 100644 --- a/scene/2d/path_texture.h +++ b/scene/2d/path_texture.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 30ede699fa..6ac946ea37 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -182,29 +182,6 @@ real_t StaticBody2D::get_constant_angular_velocity() const { return constant_angular_velocity; } -#if 0 -void StaticBody2D::_update_xform() { - - if (!pre_xform || !pending) - return; - - setting=true; - - - Transform2D new_xform = get_global_transform(); //obtain the new one - - set_block_transform_notify(true); - Physics2DServer::get_singleton()->body_set_state(get_rid(),Physics2DServer::BODY_STATE_TRANSFORM,*pre_xform); //then simulate motion! - set_global_transform(*pre_xform); //but restore state to previous one in both visual and physics - set_block_transform_notify(false); - - Physics2DServer::get_singleton()->body_static_simulate_motion(get_rid(),new_xform); //then simulate motion! - - setting=false; - pending=false; - -} -#endif void StaticBody2D::set_friction(real_t p_friction) { diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index 54bd263b15..1a4b0c0f5c 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index cde5724069..197c74352e 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h index eb47f4d8d1..20c3324a50 100644 --- a/scene/2d/polygon_2d.h +++ b/scene/2d/polygon_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp index 7688faa23b..cde665d422 100644 --- a/scene/2d/position_2d.cpp +++ b/scene/2d/position_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/position_2d.h b/scene/2d/position_2d.h index 67ff2c610d..af54fb919a 100644 --- a/scene/2d/position_2d.h +++ b/scene/2d/position_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 2d2a00847d..f90331c411 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/ray_cast_2d.h b/scene/2d/ray_cast_2d.h index 244f4302ad..338de814d2 100644 --- a/scene/2d/ray_cast_2d.h +++ b/scene/2d/ray_cast_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index a2d53f0c7b..c139573853 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/remote_transform_2d.h b/scene/2d/remote_transform_2d.h index d58ec14a95..30d5fd1e7c 100644 --- a/scene/2d/remote_transform_2d.h +++ b/scene/2d/remote_transform_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index c39b12fc9a..c9bf6675d2 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h index 2a5935aaf1..7647070b26 100644 --- a/scene/2d/screen_button.h +++ b/scene/2d/screen_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index b7b68d8060..c53faab5f9 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/sprite.h b/scene/2d/sprite.h index d3f9a5f032..64d30325f2 100644 --- a/scene/2d/sprite.h +++ b/scene/2d/sprite.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 6af6231f2c..d41db1dce5 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 082e9d1018..f401d51eeb 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index a641828df8..8fc8b65217 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visibility_notifier_2d.h index 38da69faef..ef0e1affd3 100644 --- a/scene/2d/visibility_notifier_2d.h +++ b/scene/2d/visibility_notifier_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/y_sort.cpp b/scene/2d/y_sort.cpp index f258b7e2e0..e0fb3f0645 100644 --- a/scene/2d/y_sort.cpp +++ b/scene/2d/y_sort.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/2d/y_sort.h b/scene/2d/y_sort.h index 3564cfc151..de7aa3a317 100644 --- a/scene/2d/y_sort.h +++ b/scene/2d/y_sort.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index c19b361cdd..217cb71230 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/area.h b/scene/3d/area.h index 5df308fc47..7ea97d0a8c 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index 8a02c54907..545be8bc5f 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h index 936519126b..4c14be71b5 100644 --- a/scene/3d/arvr_nodes.h +++ b/scene/3d/arvr_nodes.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index 067e151c65..e1a5329fb0 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/bone_attachment.h b/scene/3d/bone_attachment.h index 65908d98a8..159d16157a 100644 --- a/scene/3d/bone_attachment.h +++ b/scene/3d/bone_attachment.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 9db7253fd6..02a7845e0b 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -339,15 +339,8 @@ Vector3 Camera::project_local_ray_normal(const Point2 &p_pos) const { ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); } -#if 0 - Size2 viewport_size = get_viewport()->get_visible_rect().size; - Vector2 cpos = p_pos; -#else - Size2 viewport_size = get_viewport()->get_camera_rect_size(); Vector2 cpos = get_viewport()->get_camera_coords(p_pos); -#endif - Vector3 ray; if (mode == PROJECTION_ORTHOGONAL) { @@ -371,17 +364,9 @@ Vector3 Camera::project_ray_origin(const Point2 &p_pos) const { ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); } -#if 0 - Size2 viewport_size = get_viewport()->get_visible_rect().size; - Vector2 cpos = p_pos; -#else - Size2 viewport_size = get_viewport()->get_camera_rect_size(); Vector2 cpos = get_viewport()->get_camera_coords(p_pos); -#endif - ERR_FAIL_COND_V(viewport_size.y == 0, Vector3()); - //float aspect = viewport_size.x / viewport_size.y; if (mode == PROJECTION_PERSPECTIVE) { diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 70849791e5..243a7b9b39 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/character_camera.cpp b/scene/3d/character_camera.cpp deleted file mode 100644 index 9feda1b72f..0000000000 --- a/scene/3d/character_camera.cpp +++ /dev/null @@ -1,718 +0,0 @@ -/*************************************************************************/ -/* character_camera.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "character_camera.h" - -#include "physics_body.h" -#if 0 -void CharacterCamera::_set(const String& p_name, const Variant& p_value) { - - if (p_name=="type") - set_camera_type((CameraType)((int)(p_value))); - else if (p_name=="orbit") - set_orbit(p_value); - else if (p_name=="height") - set_height(p_value); - else if (p_name=="inclination") - set_inclination(p_value); - else if (p_name=="max_orbit_x") - set_max_orbit_x(p_value); - else if (p_name=="min_orbit_x") - set_min_orbit_x(p_value); - else if (p_name=="max_distance") - set_max_distance(p_value); - else if (p_name=="min_distance") - set_min_distance(p_value); - else if (p_name=="distance") - set_distance(p_value); - else if (p_name=="clip") - set_clip(p_value); - else if (p_name=="autoturn") - set_autoturn(p_value); - else if (p_name=="autoturn_tolerance") - set_autoturn_tolerance(p_value); - else if (p_name=="autoturn_speed") - set_autoturn_speed(p_value); - -} -Variant CharacterCamera::_get(const String& p_name) const { - - if (p_name=="type") - return get_camera_type(); - else if (p_name=="orbit") - return get_orbit(); - else if (p_name=="height") - return get_height(); - else if (p_name=="inclination") - return get_inclination(); - else if (p_name=="max_orbit_x") - return get_max_orbit_x(); - else if (p_name=="min_orbit_x") - return get_min_orbit_x(); - else if (p_name=="max_distance") - return get_max_distance(); - else if (p_name=="min_distance") - return get_min_distance(); - else if (p_name=="distance") - return get_distance(); - else if (p_name=="clip") - return has_clip(); - else if (p_name=="autoturn") - return has_autoturn(); - else if (p_name=="autoturn_tolerance") - return get_autoturn_tolerance(); - else if (p_name=="autoturn_speed") - return get_autoturn_speed(); - - return Variant(); -} - -void CharacterCamera::_get_property_list( List<PropertyInfo> *p_list) const { - - p_list->push_back( PropertyInfo( Variant::INT, "type", PROPERTY_HINT_ENUM, "Fixed,Follow") ); - p_list->push_back( PropertyInfo( Variant::VECTOR2, "orbit" ) ); - p_list->push_back( PropertyInfo( Variant::REAL, "height", PROPERTY_HINT_RANGE,"-1024,1024,0.01" ) ); - p_list->push_back( PropertyInfo( Variant::REAL, "inclination", PROPERTY_HINT_RANGE,"-90,90,0.01" ) ); - p_list->push_back( PropertyInfo( Variant::REAL, "max_orbit_x", PROPERTY_HINT_RANGE,"-90,90,0.01" ) ); - p_list->push_back( PropertyInfo( Variant::REAL, "min_orbit_x", PROPERTY_HINT_RANGE,"-90,90,0.01" ) ); - p_list->push_back( PropertyInfo( Variant::REAL, "min_distance", PROPERTY_HINT_RANGE,"0,100,0.01" ) ); - p_list->push_back( PropertyInfo( Variant::REAL, "max_distance", PROPERTY_HINT_RANGE,"0,100,0.01" ) ); - p_list->push_back( PropertyInfo( Variant::REAL, "distance", PROPERTY_HINT_RANGE,"0.01,1024,0,01") ); - p_list->push_back( PropertyInfo( Variant::BOOL, "clip") ); - p_list->push_back( PropertyInfo( Variant::BOOL, "autoturn") ); - p_list->push_back( PropertyInfo( Variant::REAL, "autoturn_tolerance", PROPERTY_HINT_RANGE,"1,90,0.01") ); - p_list->push_back( PropertyInfo( Variant::REAL, "autoturn_speed", PROPERTY_HINT_RANGE,"1,90,0.01") ); - - -} - -void CharacterCamera::_compute_camera() { - - - // update the transform with the next proposed transform (camera is 1 logic frame delayed) - - /* - float time = get_root_node()->get_frame_time(); - Vector3 oldp = accepted.get_origin(); - Vector3 newp = proposed.get_origin(); - - float frame_dist = time * - if (oldp.distance_to(newp) > - */ - - float time = get_root_node()->get_frame_time(); - - if (true) { - - if (clip_ray[0].clipped && clip_ray[1].clipped && clip_ray[2].clipped) { - //all have been clipped - proposed.origin=clip_ray[1].clip_pos; - - - } else { - - Vector3 rel=proposed.origin-target_pos; - - if (clip_ray[0].clipped && !clip_ray[2].clipped) { - - float distance = target_pos.distance_to(clip_ray[0].clip_pos); - real_t amount = 1.0-(distance/clip_len); - amount = CLAMP(amount,0,1); - - - rel=Matrix3(Vector3(0,1,0)), - rotate_orbit(Vector2(0,autoturn_speed*time*amount)); - } - if (clip_ray[2].clipped && !clip_ray[0].clipped) { - - float distance = target_pos.distance_to(clip_ray[2].clip_pos); - real_t amount = 1.0-(distance/clip_len); - amount = CLAMP(amount,0,1); - - rotate_orbit(Vector2(0,-autoturn_speed*time*amount)); - } - - } - } - - - Transform final; - - static float pos_ratio = 0.9; - static float rot_ratio = 10; - - Vector3 vec1 = accepted.origin; - Vector3 vec2 = proposed.origin; - final.origin = vec2.linear_interpolate(vec1, pos_ratio * time); - - Quat q1 = accepted.basis; - Quat q2 = proposed.basis; - final.basis = q1.slerp(q2, rot_ratio * time); - - accepted=final; - - _update_camera(); - - // calculate the next proposed transform - - - Vector3 new_pos; - Vector3 character_pos = get_global_transform().origin; - character_pos.y+=height; // height compensate - - if(type==CAMERA_FOLLOW) { - - - - /* calculate some variables */ - - Vector3 rel = follow_pos - character_pos; - - float l = rel.length(); - Vector3 rel_n = (l > 0) ? (rel/l) : Vector3(); -#if 1 - float ang = Math::acos(rel_n.dot( Vector3(0,1,0) )); - - Vector3 tangent = rel_n; - tangent.y=0; // get rid of y - if (tangent.length_squared() < CMP_EPSILON2) - tangent=Vector3(0,0,1); // use Z as tangent if rel is parallel to y - else - tangent.normalize(); - - /* now start applying the rules */ - - //clip distance - if (l > max_distance) - l=max_distance; - if (l < min_distance) - l=min_distance; - - //fix angle - - float ang_min = Math_PI * 0.5 + Math::deg2rad(min_orbit_x); - float ang_max = Math_PI * 0.5 + Math::deg2rad(max_orbit_x); - - if (ang<ang_min) - ang=ang_min; - if (ang>ang_max) - ang=ang_max; - - /* finally, rebuild the validated camera position */ - - new_pos=Vector3(0,Math::cos(ang),0); - new_pos+=tangent*Math::sin(ang); - new_pos*=l; - new_pos+=character_pos; -#else - if (l > max_distance) - l=max_distance; - if (l < min_distance) - l=min_distance; - - new_pos = character_pos + rel_n * l; - -#endif - follow_pos=new_pos; - - } else if (type==CAMERA_FIXED) { - - - if (distance<min_distance) - distance=min_distance; - if (distance>max_distance) - distance=max_distance; - - if (orbit.x<min_orbit_x) - orbit.x=min_orbit_x; - if (orbit.x>max_orbit_x) - orbit.x=max_orbit_x; - - Matrix3 m; - m.rotate(Vector3(0,1,0),-Math::deg2rad(orbit.y)); - m.rotate(Vector3(1,0,0),-Math::deg2rad(orbit.x)); - - new_pos = (m.get_axis(2) * distance) + character_pos; - - if (use_lookat_target) { - - Transform t = get_global_transform(); - Vector3 y = t.basis.get_axis(1).normalized(); - Vector3 z = lookat_target - character_pos; - z= (z - y * y.dot(z)).normalized(); - orbit.y = -Math::rad2deg(Math::atan2(z.x,z.z)) + 180; - - /* - Transform t = get_global_transform(); - Vector3 y = t.basis.get_axis(1).normalized(); - Vector3 z = lookat_target - t.origin; - z= (z - y * y.dot(z)).normalized(); - Vector3 x = z.cross(y).normalized(); - Transform t2; - t2.basis.set_axis(0,x); - t2.basis.set_axis(1,y); - t2.basis.set_axis(2,z); - t2.origin=t.origin; - - Vector3 local = t2.xform_inv(camera_pos); - - float ang = Math::atan2(local.x,local.y); - */ - - /* - - Vector3 vec1 = lookat_target - new_pos; - vec1.normalize(); - Vector3 vec2 = character_pos - new_pos; - vec2.normalize(); - - float dot = vec1.dot(vec2); - printf("dot %f\n", dot); - if ( dot < 0.5) { - - rotate_orbit(Vector2(0, 90)); - }; - */ - - - }; - } - - Vector3 target; - if (use_lookat_target) { - - target = lookat_target; - } else { - target = character_pos; - }; - - proposed.set_look_at(new_pos,target,Vector3(0,1,0)); - proposed = proposed * Transform(Matrix3(Vector3(1,0,0),Math::deg2rad(inclination)),Vector3()); //inclination - - - Vector<RID> exclude; - exclude.push_back(target_body); - - - - Vector3 rel = new_pos-target; - - for(int i=0;i<3;i++) { - - PhysicsServer::get_singleton()->query_intersection(clip_ray[i].query,get_world().get_space(),exclude); - PhysicsServer::get_singleton()->query_intersection_segment(clip_ray[i].query,target,target+Matrix3(Vector3(0,1,0),Math::deg2rad(autoturn_tolerance*(i-1.0))).xform(rel)); - clip_ray[i].clipped=false; - clip_ray[i].clip_pos=Vector3(); - } - target_pos=target; - clip_len=rel.length(); - - - -} - -void CharacterCamera::set_use_lookat_target(bool p_use, const Vector3 &p_lookat) { - - use_lookat_target = p_use; - lookat_target = p_lookat; -}; - - -void CharacterCamera::_notification(int p_what) { - - switch(p_what) { - - case NOTIFICATION_PROCESS: { - - - _compute_camera(); - } break; - - case NOTIFICATION_ENTER_SCENE: { - - if (type==CAMERA_FOLLOW) { - - set_orbit(orbit); - set_distance(distance); - } - - accepted=get_global_transform(); - proposed=accepted; - - target_body = RID(); - - Node* parent = get_parent(); - while (parent) { - PhysicsBody* p = Object::cast_to<PhysicsBody>(parent); - if (p) { - target_body = p->get_body(); - break; - }; - parent = parent->get_parent(); - }; - - } break; - - case NOTIFICATION_TRANSFORM_CHANGED: { - - } break; - case NOTIFICATION_EXIT_SCENE: { - - if (type==CAMERA_FOLLOW) { - distance=get_distance(); - orbit=get_orbit(); - - } - } break; - - case NOTIFICATION_BECAME_CURRENT: { - - set_process(true); - } break; - case NOTIFICATION_LOST_CURRENT: { - - set_process(false); - } break; - } - -} - - -void CharacterCamera::set_camera_type(CameraType p_camera_type) { - - - if (p_camera_type==type) - return; - - type=p_camera_type; - - // do conversions -} - -CharacterCamera::CameraType CharacterCamera::get_camera_type() const { - - return type; - -} - -void CharacterCamera::set_orbit(const Vector2& p_orbit) { - - orbit=p_orbit; - - if(type == CAMERA_FOLLOW && is_inside_scene()) { - - Vector3 char_pos = get_global_transform().origin; - char_pos.y+=height; - float d = char_pos.distance_to(follow_pos); - - Matrix3 m; - m.rotate(Vector3(0,1,0),-orbit.y); - m.rotate(Vector3(1,0,0),-orbit.x); - - follow_pos=char_pos + m.get_axis(2) * d; - - } - -} -void CharacterCamera::set_orbit_x(float p_x) { - - orbit.x=p_x; - if(type == CAMERA_FOLLOW && is_inside_scene()) - set_orbit(Vector2( p_x, get_orbit().y )); -} -void CharacterCamera::set_orbit_y(float p_y) { - - - orbit.y=p_y; - if(type == CAMERA_FOLLOW && is_inside_scene()) - set_orbit(Vector2( get_orbit().x, p_y )); - -} -Vector2 CharacterCamera::get_orbit() const { - - - if (type == CAMERA_FOLLOW && is_inside_scene()) { - - Vector3 char_pos = get_global_transform().origin; - char_pos.y+=height; - Vector3 rel = (follow_pos - char_pos).normalized(); - Vector2 ret_orbit; - ret_orbit.x = Math::acos( Vector3(0,1,0).dot( rel ) ) - Math_PI * 0.5; - ret_orbit.y = Math::atan2(rel.x,rel.z); - return ret_orbit; - } - return orbit; -} - -void CharacterCamera::rotate_orbit(const Vector2& p_relative) { - - if (type == CAMERA_FOLLOW && is_inside_scene()) { - - Matrix3 m; - m.rotate(Vector3(0,1,0),-Math::deg2rad(p_relative.y)); - m.rotate(Vector3(1,0,0),-Math::deg2rad(p_relative.x)); - - Vector3 char_pos = get_global_transform().origin; - char_pos.y+=height; - Vector3 rel = (follow_pos - char_pos); - rel = m.xform(rel); - follow_pos=char_pos+rel; - - } - - orbit+=p_relative; -} - -void CharacterCamera::set_height(float p_height) { - - - height=p_height; -} - -float CharacterCamera::get_height() const { - - return height; - -} - -void CharacterCamera::set_max_orbit_x(float p_max) { - - max_orbit_x=p_max; -} - -float CharacterCamera::get_max_orbit_x() const { - - return max_orbit_x; -} - -void CharacterCamera::set_min_orbit_x(float p_min) { - - min_orbit_x=p_min; -} - -float CharacterCamera::get_min_orbit_x() const { - - return min_orbit_x; -} - -float CharacterCamera::get_min_distance() const { - - return min_distance; -} -float CharacterCamera::get_max_distance() const { - - return max_distance; -} - -void CharacterCamera::set_min_distance(float p_min) { - - min_distance=p_min; -} - -void CharacterCamera::set_max_distance(float p_max) { - - max_distance = p_max; -} - - -void CharacterCamera::set_distance(float p_distance) { - - if (type == CAMERA_FOLLOW && is_inside_scene()) { - - Vector3 char_pos = get_global_transform().origin; - char_pos.y+=height; - Vector3 rel = (follow_pos - char_pos).normalized(); - rel*=p_distance; - follow_pos=char_pos+rel; - - } - - distance=p_distance; -} - -float CharacterCamera::get_distance() const { - - if (type == CAMERA_FOLLOW && is_inside_scene()) { - - Vector3 char_pos = get_global_transform().origin; - char_pos.y+=height; - return (follow_pos - char_pos).length(); - - } - - return distance; -} - -void CharacterCamera::set_clip(bool p_enabled) { - - - clip=p_enabled; -} - -bool CharacterCamera::has_clip() const { - - return clip; - -} - - -void CharacterCamera::set_autoturn(bool p_enabled) { - - - autoturn=p_enabled; -} - -bool CharacterCamera::has_autoturn() const { - - return autoturn; - -} - -void CharacterCamera::set_autoturn_tolerance(float p_degrees) { - - - autoturn_tolerance=p_degrees; -} -float CharacterCamera::get_autoturn_tolerance() const { - - - return autoturn_tolerance; -} - -void CharacterCamera::set_inclination(float p_degrees) { - - - inclination=p_degrees; -} -float CharacterCamera::get_inclination() const { - - - return inclination; -} - - -void CharacterCamera::set_autoturn_speed(float p_speed) { - - - autoturn_speed=p_speed; -} -float CharacterCamera::get_autoturn_speed() const { - - return autoturn_speed; - -} - - - - - -void CharacterCamera::_bind_methods() { - - ClassDB::bind_method(D_METHOD("set_camera_type","type"),&CharacterCamera::set_camera_type); - ClassDB::bind_method(D_METHOD("get_camera_type"),&CharacterCamera::get_camera_type); - ClassDB::bind_method(D_METHOD("set_orbit","orbit"),&CharacterCamera::set_orbit); - ClassDB::bind_method(D_METHOD("get_orbit"),&CharacterCamera::get_orbit); - ClassDB::bind_method(D_METHOD("set_orbit_x","x"),&CharacterCamera::set_orbit_x); - ClassDB::bind_method(D_METHOD("set_orbit_y","y"),&CharacterCamera::set_orbit_y); - ClassDB::bind_method(D_METHOD("set_min_orbit_x","x"),&CharacterCamera::set_min_orbit_x); - ClassDB::bind_method(D_METHOD("get_min_orbit_x"),&CharacterCamera::get_min_orbit_x); - ClassDB::bind_method(D_METHOD("set_max_orbit_x","x"),&CharacterCamera::set_max_orbit_x); - ClassDB::bind_method(D_METHOD("get_max_orbit_x"),&CharacterCamera::get_max_orbit_x); - ClassDB::bind_method(D_METHOD("rotate_orbit"),&CharacterCamera::rotate_orbit); - ClassDB::bind_method(D_METHOD("set_distance","distance"),&CharacterCamera::set_distance); - ClassDB::bind_method(D_METHOD("get_distance"),&CharacterCamera::get_distance); - ClassDB::bind_method(D_METHOD("set_clip","enable"),&CharacterCamera::set_clip); - ClassDB::bind_method(D_METHOD("has_clip"),&CharacterCamera::has_clip); - ClassDB::bind_method(D_METHOD("set_autoturn","enable"),&CharacterCamera::set_autoturn); - ClassDB::bind_method(D_METHOD("has_autoturn"),&CharacterCamera::has_autoturn); - ClassDB::bind_method(D_METHOD("set_autoturn_tolerance","degrees"),&CharacterCamera::set_autoturn_tolerance); - ClassDB::bind_method(D_METHOD("get_autoturn_tolerance"),&CharacterCamera::get_autoturn_tolerance); - ClassDB::bind_method(D_METHOD("set_autoturn_speed","speed"),&CharacterCamera::set_autoturn_speed); - ClassDB::bind_method(D_METHOD("get_autoturn_speed"),&CharacterCamera::get_autoturn_speed); - ClassDB::bind_method(D_METHOD("set_use_lookat_target","use","lookat"),&CharacterCamera::set_use_lookat_target, DEFVAL(Vector3())); - - ClassDB::bind_method(D_METHOD("_ray_collision"),&CharacterCamera::_ray_collision); - - BIND_ENUM_CONSTANT( CAMERA_FIXED ); - BIND_ENUM_CONSTANT( CAMERA_FOLLOW ); -} - -void CharacterCamera::_ray_collision(Vector3 p_point, Vector3 p_normal, int p_subindex, ObjectID p_against,int p_idx) { - - - clip_ray[p_idx].clip_pos=p_point; - clip_ray[p_idx].clipped=true; -}; - -Transform CharacterCamera::get_camera_transform() const { - - return accepted; -} - - -CharacterCamera::CharacterCamera() { - - - type=CAMERA_FOLLOW; - height=1; - - orbit=Vector2(0,0); - - distance=3; - min_distance=2; - max_distance=5; - - autoturn=false; - autoturn_tolerance=15; - autoturn_speed=20; - - min_orbit_x=-50; - max_orbit_x=70; - inclination=0; - - clip=false; - use_lookat_target = false; - - for(int i=0;i<3;i++) { - clip_ray[i].query=PhysicsServer::get_singleton()->query_create(this, "_ray_collision", i, true); - clip_ray[i].clipped=false; - } - - -} - -CharacterCamera::~CharacterCamera() { - - for(int i=0;i<3;i++) { - PhysicsServer::get_singleton()->free(clip_ray[i].query); - } - - -} -#endif diff --git a/scene/3d/character_camera.h b/scene/3d/character_camera.h deleted file mode 100644 index c3a1c70d5e..0000000000 --- a/scene/3d/character_camera.h +++ /dev/null @@ -1,167 +0,0 @@ -/*************************************************************************/ -/* character_camera.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef CHARACTER_CAMERA_H -#define CHARACTER_CAMERA_H - -#include "scene/3d/camera.h" -#if 0 -class CharacterCamera : public Camera { - - GDCLASS( CharacterCamera, Camera ); -public: - - enum CameraType { - CAMERA_FIXED, - CAMERA_FOLLOW - }; - -private: - - - CameraType type; - - //used for follow - Vector3 follow_pos; - //used for fixed - Vector2 orbit; - float distance; - - float height; - - float min_distance; - float max_distance; - - float max_orbit_x; - float min_orbit_x; - - float inclination; - - bool clip; - bool autoturn; - float autoturn_tolerance; - float autoturn_speed; - - - - struct ClipRay { - RID query; - bool clipped; - Vector3 clip_pos; - }; - - ClipRay clip_ray[3]; - Vector3 target_pos; - float clip_len; - - - Transform accepted; - Vector3 proposed_pos; - - bool use_lookat_target; - Vector3 lookat_target; - - void _compute_camera(); - - RID ray_query; - RID left_turn_query; - RID right_turn_query; - RID target_body; - -protected: - - virtual void _request_camera_update() {} //ignore - - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; - void _notification(int p_what); - - static void _bind_methods(); - - void _ray_collision(Vector3 p_point, Vector3 p_normal, int p_subindex, ObjectID p_against,int p_idx); - -public: - - - void set_camera_type(CameraType p_camera_type); - CameraType get_camera_type() const; - - void set_orbit(const Vector2& p_orbit); - void set_orbit_x(float p_x); - void set_orbit_y(float p_y); - Vector2 get_orbit() const; - - void set_height(float p_height); - float get_height() const; - - void set_inclination(float p_degrees); - float get_inclination() const; - - void set_max_orbit_x(float p_max); - float get_max_orbit_x() const; - - void set_min_orbit_x(float p_min); - float get_min_orbit_x() const; - - void rotate_orbit(const Vector2& p_relative); - - void set_distance(float p_distance); - float get_distance() const; - - float get_min_distance() const; - float get_max_distance() const; - void set_min_distance(float p_min); - void set_max_distance(float p_max); - - - void set_clip(bool p_enabled); - bool has_clip() const; - - void set_autoturn(bool p_enabled); - bool has_autoturn() const; - - void set_autoturn_tolerance(float p_degrees); - float get_autoturn_tolerance() const; - - void set_autoturn_speed(float p_speed); - float get_autoturn_speed() const; - - void set_use_lookat_target(bool p_use, const Vector3 &p_lookat = Vector3()); - - virtual Transform get_camera_transform() const; - - CharacterCamera(); - ~CharacterCamera(); -}; - -VARIANT_ENUM_CAST( CharacterCamera::CameraType ); - -#endif -#endif // CHARACTER_CAMERA_H diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 1aba26673c..c121ef4566 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "collision_object.h" + #include "scene/scene_string_names.h" #include "servers/physics_server.h" diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h index 6c13e5d505..ac35de697c 100644 --- a/scene/3d/collision_object.h +++ b/scene/3d/collision_object.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index 2087938de8..382cbb8f38 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h index beefae182c..dbed1d7154 100644 --- a/scene/3d/collision_polygon.h +++ b/scene/3d/collision_polygon.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index 6a0ed08fee..4d4ed30d03 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/collision_shape.h b/scene/3d/collision_shape.h index 277e0dfa77..6d849f42af 100644 --- a/scene/3d/collision_shape.h +++ b/scene/3d/collision_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index b5b6dfe7e3..0232ce7653 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 8346437ebd..5a06984a47 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index 060e088750..64d3f4fcab 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h index bc8452c7e0..b2bcb5af1a 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index 4f28ac6b3e..157ae42571 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/interpolated_camera.h b/scene/3d/interpolated_camera.h index c302c32fc9..26e7278c99 100644 --- a/scene/3d/interpolated_camera.h +++ b/scene/3d/interpolated_camera.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index f4b5cc5731..5b48ee4af8 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/light.h b/scene/3d/light.h index 788e948536..93dd4828da 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -38,8 +38,6 @@ @author Juan Linietsky <reduzio@gmail.com> */ -class BakedLight; - class Light : public VisualInstance { GDCLASS(Light, VisualInstance); diff --git a/scene/3d/listener.cpp b/scene/3d/listener.cpp index c7d3bac2f8..51cf9fb89b 100644 --- a/scene/3d/listener.cpp +++ b/scene/3d/listener.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/listener.h b/scene/3d/listener.h index b66fc7fc38..2c800443b4 100644 --- a/scene/3d/listener.h +++ b/scene/3d/listener.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 578e3900fa..c8215971c4 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index 1bb2c97d10..8e8c12a592 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index b51953f27c..f90489f1f0 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index 7e14d567ac..cd0e7b463c 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index 1d74c7bbcc..d8c7a78648 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h index 80699fce72..010d16dedd 100644 --- a/scene/3d/navigation.h +++ b/scene/3d/navigation.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 46d177df71..7a55f956e0 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h index e5a3dc7b43..36fe3ee34b 100644 --- a/scene/3d/navigation_mesh.h +++ b/scene/3d/navigation_mesh.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 70f46e3a0a..80c706898d 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 9c1436a47b..2c109d6ec8 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 19c9761091..ed4d88417c 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -33,24 +33,6 @@ #include "scene/scene_string_names.h" void Path::_notification(int p_what) { -#if 0 - if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_scene() && Engine::get_singleton()->is_editor_hint()) { - //draw the curve!! - - for(int i=0;i<curve->get_point_count();i++) { - - Vector2 prev_p=curve->get_point_pos(i); - - for(int j=1;j<=8;j++) { - - real_t frac = j/8.0; - Vector2 p = curve->interpolate(i,frac); - draw_line(prev_p,p,Color(0.5,0.6,1.0,0.7),2); - prev_p=p; - } - } - } -#endif } void Path::_curve_changed() { diff --git a/scene/3d/path.h b/scene/3d/path.h index eeae0668a7..0f9a169f72 100644 --- a/scene/3d/path.h +++ b/scene/3d/path.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index a1bee9a0ed..b149dcd2dc 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index 83811a1d93..23d752ad76 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index af6e7f48fa..aa127ab79f 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -973,301 +973,3 @@ Generic6DOFJoint::Generic6DOFJoint() { set_flag_z(FLAG_ENABLE_LINEAR_LIMIT, true); set_flag_z(FLAG_ENABLE_MOTOR, false); } - -#if 0 - -void PhysicsJoint::_set(const String& p_name, const Variant& p_value) { - - if (p_name=="body_A") - set_body_a(p_value); - else if (p_name=="body_B") - set_body_b(p_value); - else if (p_name=="active") - set_active(p_value); - else if (p_name=="no_collision") - set_disable_collision(p_value); -} -Variant PhysicsJoint::_get(const String& p_name) const { - - if (p_name=="body_A") - return get_body_a(); - else if (p_name=="body_B") - return get_body_b(); - else if (p_name=="active") - return is_active(); - else if (p_name=="no_collision") - return has_disable_collision(); - - return Variant(); -} -void PhysicsJoint::_get_property_list( List<PropertyInfo> *p_list) const { - - - p_list->push_back( PropertyInfo( Variant::NODE_PATH, "body_A" ) ); - p_list->push_back( PropertyInfo( Variant::NODE_PATH, "body_B" ) ); - p_list->push_back( PropertyInfo( Variant::BOOL, "active" ) ); - p_list->push_back( PropertyInfo( Variant::BOOL, "no_collision" ) ); -} -void PhysicsJoint::_notification(int p_what) { - - - switch(p_what) { - - case NOTIFICATION_PARENT_CONFIGURED: { - - _connect(); - if (get_root_node()->get_editor() && !indicator.is_valid()) { - - indicator=VisualServer::get_singleton()->poly_create(); - RID mat=VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_UNSHADED, true ); - VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_ONTOP, true ); - VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_WIREFRAME, true ); - VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_DOUBLE_SIDED, true ); - VisualServer::get_singleton()->material_set_line_width( mat, 3 ); - - VisualServer::get_singleton()->poly_set_material(indicator,mat,true); - _update_indicator(); - - } - - if (indicator.is_valid()) { - - indicator_instance=VisualServer::get_singleton()->instance_create(indicator,get_world()->get_scenario()); - VisualServer::get_singleton()->instance_attach_object_instance_id( indicator_instance,get_instance_id() ); - } - } break; - case NOTIFICATION_TRANSFORM_CHANGED: { - - if (indicator_instance.is_valid()) { - - VisualServer::get_singleton()->instance_set_transform(indicator_instance,get_global_transform()); - } - } break; - case NOTIFICATION_EXIT_SCENE: { - - if (indicator_instance.is_valid()) { - - VisualServer::get_singleton()->free(indicator_instance); - } - _disconnect(); - - } break; - - } -} - - -RID PhysicsJoint::_get_visual_instance_rid() const { - - return indicator_instance; - -} - -void PhysicsJoint::_bind_methods() { - - ClassDB::bind_method(D_METHOD("_get_visual_instance_rid"),&PhysicsJoint::_get_visual_instance_rid); - ClassDB::bind_method(D_METHOD("set_body_a","path"),&PhysicsJoint::set_body_a); - ClassDB::bind_method(D_METHOD("set_body_b"),&PhysicsJoint::set_body_b); - ClassDB::bind_method(D_METHOD("get_body_a","path"),&PhysicsJoint::get_body_a); - ClassDB::bind_method(D_METHOD("get_body_b"),&PhysicsJoint::get_body_b); - - ClassDB::bind_method(D_METHOD("set_active","active"),&PhysicsJoint::set_active); - ClassDB::bind_method(D_METHOD("is_active"),&PhysicsJoint::is_active); - - ClassDB::bind_method(D_METHOD("set_disable_collision","disable"),&PhysicsJoint::set_disable_collision); - ClassDB::bind_method(D_METHOD("has_disable_collision"),&PhysicsJoint::has_disable_collision); - - - ClassDB::bind_method("reconnect",&PhysicsJoint::reconnect); - - ClassDB::bind_method(D_METHOD("get_rid"),&PhysicsJoint::get_rid); - -} - -void PhysicsJoint::set_body_a(const NodePath& p_path) { - - _disconnect(); - body_A=p_path; - _connect(); - _change_notify("body_A"); -} -void PhysicsJoint::set_body_b(const NodePath& p_path) { - - _disconnect(); - body_B=p_path; - _connect(); - _change_notify("body_B"); - -} -NodePath PhysicsJoint::get_body_a() const { - - return body_A; -} -NodePath PhysicsJoint::get_body_b() const { - - return body_B; -} - -void PhysicsJoint::set_active(bool p_active) { - - active=p_active; - if (is_inside_scene()) { - PhysicsServer::get_singleton()->joint_set_active(joint,active); - } - _change_notify("active"); -} - -void PhysicsJoint::set_disable_collision(bool p_active) { - - if (no_collision==p_active) - return; - _disconnect(); - no_collision=p_active; - _connect(); - - _change_notify("no_collision"); -} -bool PhysicsJoint::has_disable_collision() const { - - return no_collision; -} - - - -bool PhysicsJoint::is_active() const { - - return active; -} - -void PhysicsJoint::_disconnect() { - - if (!is_inside_scene()) - return; - - if (joint.is_valid()) - PhysicsServer::get_singleton()->free(joint); - - joint=RID(); - - Node *nA = get_node(body_A); - Node *nB = get_node(body_B); - - PhysicsBody *A = Object::cast_to<PhysicsBody>(nA); - PhysicsBody *B = Object::cast_to<PhysicsBody>(nB); - - if (!A ||!B) - return; - - if (no_collision) - PhysicsServer::get_singleton()->body_remove_collision_exception(A->get_body(),B->get_body()); - -} -void PhysicsJoint::_connect() { - - if (!is_inside_scene()) - return; - - ERR_FAIL_COND(joint.is_valid()); - - Node *nA = get_node(body_A); - Node *nB = get_node(body_B); - - PhysicsBody *A = Object::cast_to<PhysicsBody>(nA); - PhysicsBody *B = Object::cast_to<PhysicsBody>(nB); - - if (!A && !B) - return; - - if (B && !A) - SWAP(B,A); - - joint = create(A,B); - - if (A<B) - SWAP(A,B); - - if (no_collision) - PhysicsServer::get_singleton()->body_add_collision_exception(A->get_body(),B->get_body()); - - - -} - -void PhysicsJoint::reconnect() { - - _disconnect(); - _connect(); - -} - - -RID PhysicsJoint::get_rid() { - - return joint; -} - - -PhysicsJoint::PhysicsJoint() { - - active=true; - no_collision=true; -} - - -PhysicsJoint::~PhysicsJoint() { - - if (indicator.is_valid()) { - - VisualServer::get_singleton()->free(indicator); - } - -} - -/* PIN */ - -void PhysicsJointPin::_update_indicator() { - - - VisualServer::get_singleton()->poly_clear(indicator); - - Vector<Color> colors; - colors.push_back( Color(0.3,0.9,0.2,0.7) ); - colors.push_back( Color(0.3,0.9,0.2,0.7) ); - - Vector<Vector3> points; - points.resize(2); - points[0]=Vector3(Vector3(-0.2,0,0)); - points[1]=Vector3(Vector3(0.2,0,0)); - VisualServer::get_singleton()->poly_add_primitive(indicator,points,Vector<Vector3>(),colors,Vector<Vector3>()); - - points[0]=Vector3(Vector3(0,-0.2,0)); - points[1]=Vector3(Vector3(0,0.2,0)); - VisualServer::get_singleton()->poly_add_primitive(indicator,points,Vector<Vector3>(),colors,Vector<Vector3>()); - - points[0]=Vector3(Vector3(0,0,-0.2)); - points[1]=Vector3(Vector3(0,0,0.2)); - VisualServer::get_singleton()->poly_add_primitive(indicator,points,Vector<Vector3>(),colors,Vector<Vector3>()); - -} - -RID PhysicsJointPin::create(PhysicsBody*A,PhysicsBody*B) { - - RID body_A = A->get_body(); - RID body_B = B?B->get_body():RID(); - - ERR_FAIL_COND_V( !body_A.is_valid(), RID() ); - - Vector3 pin_pos = get_global_transform().origin; - - if (body_B.is_valid()) - return PhysicsServer::get_singleton()->joint_create_double_pin_global(body_A,pin_pos,body_B,pin_pos); - else - return PhysicsServer::get_singleton()->joint_create_pin(body_A,A->get_global_transform().xform_inv(pin_pos),pin_pos); -} - -PhysicsJointPin::PhysicsJointPin() { - - -} -#endif diff --git a/scene/3d/physics_joint.h b/scene/3d/physics_joint.h index b834aaf6d2..b94297da30 100644 --- a/scene/3d/physics_joint.h +++ b/scene/3d/physics_joint.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -321,73 +321,4 @@ public: VARIANT_ENUM_CAST(Generic6DOFJoint::Param); VARIANT_ENUM_CAST(Generic6DOFJoint::Flag); -#if 0 -class PhysicsJoint : public Spatial { - - GDCLASS(PhysicsJoint,Spatial); - OBJ_CATEGORY("3D Physics Nodes"); - - NodePath body_A; - NodePath body_B; - bool active; - bool no_collision; - - - RID indicator_instance; - - RID _get_visual_instance_rid() const; -protected: - - RID joint; - RID indicator; - - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; - void _notification(int p_what); - static void _bind_methods(); - - virtual RID create(PhysicsBody*A,PhysicsBody*B)=0; - virtual void _update_indicator()=0; - - void _disconnect(); - void _connect(); -public: - - void set_body_a(const NodePath& p_path); - void set_body_b(const NodePath& p_path); - NodePath get_body_a() const; - NodePath get_body_b() const; - - void set_active(bool p_active); - bool is_active() const; - - void set_disable_collision(bool p_active); - bool has_disable_collision() const; - - void reconnect(); - - RID get_rid(); - - PhysicsJoint(); - ~PhysicsJoint(); -}; - - - -class PhysicsJointPin : public PhysicsJoint { - - GDCLASS( PhysicsJointPin, PhysicsJoint ); - -protected: - - virtual void _update_indicator(); - virtual RID create(PhysicsBody*A,PhysicsBody*B); -public: - - - PhysicsJointPin(); -}; - #endif // PHYSICS_JOINT_H -#endif diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index f79f7f6949..6c14f7dbc9 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -32,6 +32,7 @@ #include "scene/resources/surface_tool.h" #include "servers/visual_server.h" +// FIXME: This will be removed, kept as reference for new implementation #if 0 bool Portal::_set(const StringName &p_name, const Variant &p_value) { diff --git a/scene/3d/portal.h b/scene/3d/portal.h index 9cc5d280a1..6de3df8553 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/position_3d.cpp b/scene/3d/position_3d.cpp index 4e66ef13c0..d0df985ac4 100644 --- a/scene/3d/position_3d.cpp +++ b/scene/3d/position_3d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/position_3d.h b/scene/3d/position_3d.h index 0adde19342..8083c33196 100644 --- a/scene/3d/position_3d.h +++ b/scene/3d/position_3d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index d0410f2c55..2288d8b08b 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/proximity_group.h b/scene/3d/proximity_group.h index fec3add41f..d003d2f525 100644 --- a/scene/3d/proximity_group.h +++ b/scene/3d/proximity_group.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 019bb219ee..72b7706b77 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h index e9b34c4f75..fd566cd343 100644 --- a/scene/3d/ray_cast.h +++ b/scene/3d/ray_cast.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index 194146b6b3..46b105cd21 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h index d2a5facb5f..7c328a8f16 100644 --- a/scene/3d/reflection_probe.h +++ b/scene/3d/reflection_probe.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp index a4dfeb8adf..3d402fa5af 100644 --- a/scene/3d/remote_transform.cpp +++ b/scene/3d/remote_transform.cpp @@ -4,7 +4,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/remote_transform.h b/scene/3d/remote_transform.h index c25b57966e..51a0bf35a3 100644 --- a/scene/3d/remote_transform.h +++ b/scene/3d/remote_transform.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 81ddf4a667..439b6bfdf8 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -31,6 +31,7 @@ #include "servers/visual_server.h" +// FIXME: Will be removed, kept as reference for new implementation #if 0 #include "geometry.h" #include "project_settings.h" diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index 5b9886671f..b9a64b6670 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp index 0780ce22ff..8102b3f15c 100644 --- a/scene/3d/scenario_fx.cpp +++ b/scene/3d/scenario_fx.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/scenario_fx.h b/scene/3d/scenario_fx.h index d1e0a63130..acf6a18526 100644 --- a/scene/3d/scenario_fx.h +++ b/scene/3d/scenario_fx.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index 94db247d7a..d0e0937eca 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index a6546af64e..fdc1100472 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 2c1ef5c00b..7db3bb18bd 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -286,37 +286,6 @@ Transform Spatial::get_global_transform() const { return data.global_transform; } -#if 0 -void Spatial::add_child_notify(Node *p_child) { -/* - Spatial *s=Object::cast_to<Spatial>(p_child); - if (!s) - return; - - ERR_FAIL_COND(data.children_lock>0); - - s->data.dirty=DIRTY_GLOBAL; // don't allow global transform to be valid - s->data.parent=this; - data.children.push_back(s); - s->data.C=data.children.back(); -*/ -} - -void Spatial::remove_child_notify(Node *p_child) { -/* - Spatial *s=Object::cast_to<Spatial>(p_child); - if (!s) - return; - - ERR_FAIL_COND(data.children_lock>0); - - if (s->data.C) - data.children.erase(s->data.C); - s->data.parent=NULL; - s->data.C=NULL; -*/ -} -#endif Spatial *Spatial::get_parent_spatial() const { diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index 3e647927ae..3f205ea86b 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/spatial_indexer.cpp b/scene/3d/spatial_indexer.cpp deleted file mode 100644 index 7090c974a3..0000000000 --- a/scene/3d/spatial_indexer.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************/ -/* spatial_indexer.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "spatial_indexer.h" - -#if 0 - -#include "camera.h" -#include "proximity_area.h" -#include "scene/scene_string_names.h" - -void SpatialIndexer::add_camera(Camera* p_camera) { - - cameras.insert(p_camera); -} - -void SpatialIndexer::remove_camera(Camera* p_camera){ - - for (Set<ProximityArea*>::Element *F=proximity_areas.front();F;F=F->next()) { - - ProximityArea *prox = F->get(); - TK<Camera> k; - k.against=p_camera; - k.area=prox; - if (camera_pairs.has(k)) { - camera_pairs.erase(k); - prox->area_exit(ProximityArea::TRACK_CAMERAS,p_camera); - } - } - cameras.erase(p_camera); - -} - -void SpatialIndexer::update_camera(Camera* p_camera) { - - - _request_update(); -} - -void SpatialIndexer::_update_pairs() { - - // brute force interseciton code, no broadphase - // will implement broadphase in the future - - for (Set<Camera*>::Element *E=cameras.front();E;E=E->next()) { - - Camera *cam = E->get(); - Vector<Plane> cplanes = cam->get_frustum(); - - for (Set<ProximityArea*>::Element *F=proximity_areas.front();F;F=F->next()) { - - ProximityArea *prox = F->get(); - - bool inters=false; - - if (prox->get_track_flag(ProximityArea::TRACK_CAMERAS)) { - - AABB aabb = prox->get_global_transform().xform(prox->get_aabb()); - if (aabb.intersects_convex_shape(cplanes.ptr(),cplanes.size())) - inters=true; - } - - TK<Camera> k; - k.against=cam; - k.area=prox; - - bool has = camera_pairs.has(k); - - if (inters==has) - continue; - - if (inters) { - camera_pairs.insert(k); - prox->area_enter(ProximityArea::TRACK_CAMERAS,cam); - } else { - - camera_pairs.erase(k); - prox->area_exit(ProximityArea::TRACK_CAMERAS,cam); - } - } - - } - - pending_update=false; -} - -void SpatialIndexer::_bind_methods() { - - - ClassDB::bind_method(D_METHOD("_update_pairs"),&SpatialIndexer::_update_pairs); -} - - -void SpatialIndexer::add_proximity_area(ProximityArea* p_area) { - - proximity_areas.insert(p_area); - -} - -void SpatialIndexer::remove_proximity_area(ProximityArea* p_area) { - - for (Set<Camera*>::Element *E=cameras.front();E;E=E->next()) { - - Camera *cam = E->get(); - TK<Camera> k; - k.against=cam; - k.area=p_area; - if (camera_pairs.has(k)) { - camera_pairs.erase(k); - p_area->area_exit(ProximityArea::TRACK_CAMERAS,cam); - } - } - proximity_areas.erase(p_area); - -} - -void SpatialIndexer::_request_update() { - - if (pending_update) - return; - pending_update=true; - call_deferred(SceneStringNames::get_singleton()->_update_pairs); - -} - -void SpatialIndexer::update_proximity_area_transform(ProximityArea* p_area) { - - _request_update(); -} - -void SpatialIndexer::update_proximity_area_flags(ProximityArea* p_area) { - - _request_update(); -} - -SpatialIndexer::SpatialIndexer() { - - pending_update=false; -} -#endif diff --git a/scene/3d/spatial_indexer.h b/scene/3d/spatial_indexer.h deleted file mode 100644 index c8bdf8950d..0000000000 --- a/scene/3d/spatial_indexer.h +++ /dev/null @@ -1,84 +0,0 @@ -/*************************************************************************/ -/* spatial_indexer.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef SPATIAL_INDEXER_H -#define SPATIAL_INDEXER_H - -#include "scene/3d/spatial.h" -#if 0 - -class Camera; -class ProximityArea; - -class SpatialIndexer : public Object { - - GDCLASS( SpatialIndexer, Object ); - - template<class T> - struct TK { - - T *against; - ProximityArea *area; - bool operator<(const TK<T>& p_k) const { return against==p_k.against ? area < p_k.area : against < p_k.against; } - }; - - - Set<Camera*> cameras; //cameras - Set<ProximityArea*> proximity_areas; - - Set<TK<Camera> > camera_pairs; - - bool pending_update; - void _update_pairs(); - void _request_update(); - -protected: - - static void _bind_methods(); - -friend class ProximityArea; -friend class Camera; - - void add_proximity_area(ProximityArea* p_area); - void remove_proximity_area(ProximityArea* p_area); - void update_proximity_area_transform(ProximityArea* p_area); - void update_proximity_area_flags(ProximityArea* p_area); - - void add_camera(Camera* p_camera); - void remove_camera(Camera* p_camera); - void update_camera(Camera* p_camera); - -public: - - - SpatialIndexer(); - -}; -#endif -#endif // SPATIAL_INDEXER_H diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index a49fd17746..49a3205f21 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -598,219 +598,6 @@ Sprite3D::Sprite3D() { //////////////////////////////////////// -#if 0 - -void AnimatedSprite3D::_draw() { - - RID immediate = get_immediate(); - VS::get_singleton()->immediate_clear(immediate); - - if (!frames.is_valid() || !frames->get_frame_count(animation) || frame<0 || frame>=frames->get_frame_count(animation)) { - return; - } - - Ref<Texture> texture = frames->get_frame(animation,frame); - if (!texture.is_valid()) - return; //no texuture no life - Vector2 tsize = texture->get_size(); - if (tsize.x==0 || tsize.y==0) - return; - - Size2i s=tsize; - Rect2i src_rect; - - src_rect.size=s; - - Point2i ofs=get_offset(); - if (is_centered()) - ofs-=s/2; - - Rect2i dst_rect(ofs,s); - - - Rect2 final_rect; - Rect2 final_src_rect; - if (!texture->get_rect_region(dst_rect,src_rect,final_rect,final_src_rect)) - return; - - - if (final_rect.size.x==0 || final_rect.size.y==0) - return; - - Color color=_get_color_accum(); - color.a*=get_opacity(); - - float pixel_size=get_pixel_size(); - - Vector2 vertices[4]={ - - (final_rect.pos+Vector2(0,final_rect.size.y)) * pixel_size, - (final_rect.pos+final_rect.size) * pixel_size, - (final_rect.pos+Vector2(final_rect.size.x,0)) * pixel_size, - final_rect.pos * pixel_size, - - - }; - Vector2 uvs[4]={ - final_src_rect.pos / tsize, - (final_src_rect.pos+Vector2(final_src_rect.size.x,0)) / tsize, - (final_src_rect.pos+final_src_rect.size) / tsize, - (final_src_rect.pos+Vector2(0,final_src_rect.size.y)) / tsize, - }; - - if (is_flipped_h()) { - SWAP(uvs[0],uvs[1]); - SWAP(uvs[2],uvs[3]); - } - if (is_flipped_v()) { - - SWAP(uvs[0],uvs[3]); - SWAP(uvs[1],uvs[2]); - } - - - Vector3 normal; - int axis = get_axis(); - normal[axis]=1.0; - - RID mat = VS::get_singleton()->material_2d_get(get_draw_flag(FLAG_SHADED),get_draw_flag(FLAG_TRANSPARENT),get_alpha_cut_mode()==ALPHA_CUT_DISCARD,get_alpha_cut_mode()==ALPHA_CUT_OPAQUE_PREPASS); - VS::get_singleton()->immediate_set_material(immediate,mat); - - VS::get_singleton()->immediate_begin(immediate,VS::PRIMITIVE_TRIANGLE_FAN,texture->get_rid()); - - int x_axis = ((axis + 1) % 3); - int y_axis = ((axis + 2) % 3); - - if (axis!=Vector3::AXIS_Z) { - SWAP(x_axis,y_axis); - - for(int i=0;i<4;i++) { - //uvs[i] = Vector2(1.0,1.0)-uvs[i]; - //SWAP(vertices[i].x,vertices[i].y); - if (axis==Vector3::AXIS_Y) { - vertices[i].y = - vertices[i].y; - } else if (axis==Vector3::AXIS_X) { - vertices[i].x = - vertices[i].x; - } - } - } - - AABB aabb; - - for(int i=0;i<4;i++) { - VS::get_singleton()->immediate_normal(immediate,normal); - VS::get_singleton()->immediate_color(immediate,color); - VS::get_singleton()->immediate_uv(immediate,uvs[i]); - - Vector3 vtx; - vtx[x_axis]=vertices[i][0]; - vtx[y_axis]=vertices[i][1]; - VS::get_singleton()->immediate_vertex(immediate,vtx); - if (i==0) { - aabb.pos=vtx; - aabb.size=Vector3(); - } else { - aabb.expand_to(vtx); - } - } - set_aabb(aabb); - VS::get_singleton()->immediate_end(immediate); - -} - -void AnimatedSprite3D::_bind_methods(){ - - ClassDB::bind_method(D_METHOD("set_sprite_frames","sprite_frames"),&AnimatedSprite3D::set_sprite_frames); - ClassDB::bind_method(D_METHOD("get_sprite_frames"),&AnimatedSprite3D::get_sprite_frames); - ClassDB::bind_method(D_METHOD("set_frame","frame"),&AnimatedSprite3D::set_frame); - ClassDB::bind_method(D_METHOD("get_frame"),&AnimatedSprite3D::get_frame); - - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), "set_sprite_frames","get_sprite_frames"); - ADD_PROPERTY( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), "set_frame","get_frame"); - - ADD_SIGNAL(MethodInfo("frame_changed")); - -} - - - - -void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames>& p_sprite_frames) { - - - if (frames==p_sprite_frames) - return; - - if (frames.is_valid()) - frames->disconnect("changed",this,"_queue_update"); - frames=p_sprite_frames; - if (frames.is_valid()) - frames->connect("changed",this,"_queue_update"); - - if (!frames.is_valid() || frame >=frames->get_frame_count(animation)) { - frame=0; - - } - _queue_update(); - -} - -Ref<SpriteFrames> AnimatedSprite3D::get_sprite_frames() const{ - - return frames; -} - -void AnimatedSprite3D::set_frame(int p_frame){ - - if (frames.is_null()) - return; - - ERR_FAIL_INDEX(p_frame,frames->get_frame_count(animation)); - - if (frame==p_frame) - return; - - frame=p_frame; - _queue_update(); - emit_signal(SceneStringNames::get_singleton()->frame_changed); - -} -int AnimatedSprite3D::get_frame() const{ - - return frame; -} - -Rect2 AnimatedSprite3D::get_item_rect() const { - - if (!frames.is_valid() || !frames->get_frame_count(animation) || frame<0 || frame>=frames->get_frame_count(animation)) { - return Rect2(0,0,1,1); - } - - Ref<Texture> t = frames->get_frame(animation,frame); - if (t.is_null()) - return Rect2(0,0,1,1); - Size2i s = t->get_size(); - - Point2i ofs=get_offset(); - if (is_centered()) - ofs-=s/2; - - if (s==Size2(0,0)) - s=Size2(1,1); - - return Rect2(ofs,s); -} - - - -AnimatedSprite3D::AnimatedSprite3D() { - - animation="current"; - frame=0; -} - -#endif - void AnimatedSprite3D::_draw() { RID immediate = get_immediate(); @@ -1022,63 +809,6 @@ void AnimatedSprite3D::_notification(int p_what) { timeout -= to_process; } } break; -#if 0 - case NOTIFICATION_DRAW: { - - if (frames.is_null()) { - print_line("no draw no faemos"); - return; - } - - if (frame<0) { - print_line("no draw frame <0"); - return; - } - - if (!frames->has_animation(animation)) { - print_line("no draw no anim: "+String(animation)); - return; - } - - - - Ref<Texture> texture = frames->get_frame(animation,frame); - if (texture.is_null()) { - print_line("no draw texture is null"); - return; - } - - //print_line("DECIDED TO DRAW"); - - RID ci = get_canvas_item(); - - /* - texture->draw(ci,Point2()); - break; - */ - - Size2i s; - s = texture->get_size(); - Point2 ofs=offset; - if (centered) - ofs-=s/2; - - if (OS::get_singleton()->get_use_pixel_snap()) { - ofs=ofs.floor(); - } - Rect2 dst_rect(ofs,s); - - if (hflip) - dst_rect.size.x=-dst_rect.size.x; - if (vflip) - dst_rect.size.y=-dst_rect.size.y; - - //texture->draw_rect(ci,dst_rect,false,modulate); - texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size()),modulate); - //VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); - - } break; -#endif } } diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index 7dc4cd4ffb..1165392cb2 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -181,37 +181,6 @@ public: //~Sprite3D(); }; -#if 0 -class AnimatedSprite3D : public SpriteBase3D { - - GDCLASS(AnimatedSprite3D,SpriteBase3D); - Ref<SpriteFrames> frames; - - - StringName animation; - int frame; - -protected: - virtual void _draw(); - static void _bind_methods(); -public: - - - - void set_sprite_frames(const Ref<SpriteFrames>& p_sprite_frames); - Ref<SpriteFrames> get_sprite_frames() const; - - void set_frame(int p_frame); - int get_frame() const; - - - virtual Rect2 get_item_rect() const; - - AnimatedSprite3D(); - //~AnimatedSprite3D(); -}; -#endif - class AnimatedSprite3D : public SpriteBase3D { GDCLASS(AnimatedSprite3D, SpriteBase3D); diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 69b938b886..d6b3206fbf 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index d778800814..d67209c58f 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index 76bca2b975..d3203bacec 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h index 316b2c3575..0b83e0534e 100644 --- a/scene/3d/visibility_notifier.h +++ b/scene/3d/visibility_notifier.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 1ca6ec42d9..0464a82f65 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index 4751d109e6..c405236d2c 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -76,8 +76,6 @@ public: ~VisualInstance(); }; -class BakedLight; - class GeometryInstance : public VisualInstance { GDCLASS(GeometryInstance, VisualInstance); diff --git a/scene/SCsub b/scene/SCsub index df52e9c6cb..513adeffda 100644 --- a/scene/SCsub +++ b/scene/SCsub @@ -27,7 +27,6 @@ SConscript('2d/SCsub') SConscript('animation/SCsub') SConscript('audio/SCsub') SConscript('resources/SCsub') -SConscript('io/SCsub') # Build it all as a library diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index 557858f24c..b35b2568d1 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h index 6687098d00..e593668df6 100644 --- a/scene/animation/animation_cache.h +++ b/scene/animation/animation_cache.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index b941157756..be0b652276 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -608,16 +608,6 @@ void AnimationPlayer::_animation_update_transforms() { ERR_CONTINUE(pa->accum_pass != accum_pass); -#if 1 - /* switch(pa->special) { - - - case SP_NONE: pa->object->set(pa->prop,pa->value_accum); break; //you are not speshul - case SP_NODE2D_POS: static_cast<Node2D*>(pa->object)->set_position(pa->value_accum); break; - case SP_NODE2D_ROT: static_cast<Node2D*>(pa->object)->set_rot(Math::deg2rad(pa->value_accum)); break; - case SP_NODE2D_SCALE: static_cast<Node2D*>(pa->object)->set_scale(pa->value_accum); break; - }*/ - switch (pa->special) { case SP_NONE: { @@ -657,10 +647,6 @@ void AnimationPlayer::_animation_update_transforms() { static_cast<Node2D *>(pa->object)->set_scale(pa->value_accum); } break; } -#else - - pa->object->set(pa->prop, pa->value_accum); -#endif } cache_update_prop_size = 0; @@ -668,8 +654,6 @@ void AnimationPlayer::_animation_update_transforms() { void AnimationPlayer::_animation_process(float p_delta) { - //bool any_active=false; - if (playback.current.from) { end_notify = false; diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 01b709205a..c6e52145a8 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 1c4a66a607..e2330eb0d4 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index 47f18795bd..71d7277118 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 45994ba050..3cd953773f 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 43234fab86..929d63a7fc 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 434f4df3e1..8f543a575a 100644 --- a/scene/animation/tween_interpolaters.cpp +++ b/scene/animation/tween_interpolaters.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp index 5f3ff9efe7..5d71f702df 100644 --- a/scene/audio/audio_player.cpp +++ b/scene/audio/audio_player.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/audio/audio_player.h b/scene/audio/audio_player.h index 8bd6844dec..4bfa84f766 100644 --- a/scene/audio/audio_player.h +++ b/scene/audio/audio_player.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 9054063a4b..8fd19e8655 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "base_button.h" + #include "os/keyboard.h" #include "print_string.h" #include "scene/main/viewport.h" diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h index dfcf3b0f8a..0c08dc53a3 100644 --- a/scene/gui/base_button.h +++ b/scene/gui/base_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index e0c73e4788..739fd84b38 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h index d544ff79d1..4d00a2011f 100644 --- a/scene/gui/box_container.h +++ b/scene/gui/box_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index c8838f3eca..1fa03f81f4 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/button.h b/scene/gui/button.h index 499e44c0e1..dd6e730b86 100644 --- a/scene/gui/button.h +++ b/scene/gui/button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index fbc2cd8cce..336c88fe9d 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/button_group.h b/scene/gui/button_group.h index 93c3aaaeb3..6ebc0575d2 100644 --- a/scene/gui/button_group.h +++ b/scene/gui/button_group.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/center_container.cpp b/scene/gui/center_container.cpp index 2bd07d3849..8c9c9d8720 100644 --- a/scene/gui/center_container.cpp +++ b/scene/gui/center_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/center_container.h b/scene/gui/center_container.h index 30b526e893..4397539046 100644 --- a/scene/gui/center_container.h +++ b/scene/gui/center_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index b61d516599..21e2269141 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/check_box.h b/scene/gui/check_box.h index ec8e097bae..4a1adb5f2f 100644 --- a/scene/gui/check_box.h +++ b/scene/gui/check_box.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index 1c3d4df308..e68159e27f 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/check_button.h b/scene/gui/check_button.h index 8634858cfe..af3b80fe04 100644 --- a/scene/gui/check_button.h +++ b/scene/gui/check_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index cdb4a19232..704c00b1d6 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index d35182e062..7de67a707c 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp index 0641302b1c..6b5247648e 100644 --- a/scene/gui/color_rect.cpp +++ b/scene/gui/color_rect.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/color_rect.h b/scene/gui/color_rect.h index 65da3d9a7c..382648fddf 100644 --- a/scene/gui/color_rect.h +++ b/scene/gui/color_rect.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 31a03dc597..ba5d92620b 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/container.h b/scene/gui/container.h index bff24c6d55..60a7a9efcb 100644 --- a/scene/gui/container.h +++ b/scene/gui/container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 96cda69bb2..e2da5e4981 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/control.h b/scene/gui/control.h index d73ca3f7c9..da5c4d0908 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -33,7 +33,7 @@ #include "math_2d.h" #include "rid.h" #include "scene/2d/canvas_item.h" -#include "scene/gui/input_action.h" +#include "scene/gui/shortcut.h" #include "scene/main/node.h" #include "scene/main/timer.h" #include "scene/resources/theme.h" diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 88d3860fb0..140d002387 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index 9d8f113caa..54cc290b05 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 0b898c4d2e..990c0f3d96 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 9873a677b2..34cecfe4d0 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp index 22de28ea7f..c9ce5e2143 100644 --- a/scene/gui/gradient_edit.cpp +++ b/scene/gui/gradient_edit.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/gradient_edit.h b/scene/gui/gradient_edit.h index 6c4ae6fd15..026e4f783b 100644 --- a/scene/gui/gradient_edit.h +++ b/scene/gui/gradient_edit.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 5703564ce2..5b00aab2ef 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "graph_edit.h" + #include "os/input.h" #include "os/keyboard.h" #include "scene/gui/box_container.h" @@ -593,8 +594,6 @@ void GraphEdit::_bake_segment2d(Vector<Vector2> &points, Vector<Color> &colors, void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const Vector2 &p_to, const Color &p_color, const Color &p_to_color) { -#if 1 - //cubic bezier code float diff = p_to.x - p_from.x; float cp_offset; @@ -621,84 +620,53 @@ void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const colors.push_back(p_to_color); p_where->draw_polyline_colors(points, colors, 2, true); - -#else - - static const int steps = 20; - - //old cosine code - Rect2 r; - r.pos = p_from; - r.expand_to(p_to); - Vector2 sign = Vector2((p_from.x < p_to.x) ? 1 : -1, (p_from.y < p_to.y) ? 1 : -1); - bool flip = sign.x * sign.y < 0; - - Vector2 prev; - for (int i = 0; i <= steps; i++) { - - float d = i / float(steps); - float c = -Math::cos(d * Math_PI) * 0.5 + 0.5; - if (flip) - c = 1.0 - c; - Vector2 p = r.pos + Vector2(d * r.size.width, c * r.size.height); - - if (i > 0) { - - p_where->draw_line(prev, p, p_color.linear_interpolate(p_to_color, d), 2); - } - - prev = p; - } -#endif } void GraphEdit::_connections_layer_draw() { - { - //draw connections - List<List<Connection>::Element *> to_erase; - for (List<Connection>::Element *E = connections.front(); E; E = E->next()) { - - NodePath fromnp(E->get().from); + //draw connections + List<List<Connection>::Element *> to_erase; + for (List<Connection>::Element *E = connections.front(); E; E = E->next()) { - Node *from = get_node(fromnp); - if (!from) { - to_erase.push_back(E); - continue; - } + NodePath fromnp(E->get().from); - GraphNode *gfrom = Object::cast_to<GraphNode>(from); + Node *from = get_node(fromnp); + if (!from) { + to_erase.push_back(E); + continue; + } - if (!gfrom) { - to_erase.push_back(E); - continue; - } + GraphNode *gfrom = Object::cast_to<GraphNode>(from); - NodePath tonp(E->get().to); - Node *to = get_node(tonp); - if (!to) { - to_erase.push_back(E); - continue; - } + if (!gfrom) { + to_erase.push_back(E); + continue; + } - GraphNode *gto = Object::cast_to<GraphNode>(to); + NodePath tonp(E->get().to); + Node *to = get_node(tonp); + if (!to) { + to_erase.push_back(E); + continue; + } - if (!gto) { - to_erase.push_back(E); - continue; - } + GraphNode *gto = Object::cast_to<GraphNode>(to); - Vector2 frompos = gfrom->get_connection_output_pos(E->get().from_port) + gfrom->get_offset() * zoom; - Color color = gfrom->get_connection_output_color(E->get().from_port); - Vector2 topos = gto->get_connection_input_pos(E->get().to_port) + gto->get_offset() * zoom; - Color tocolor = gto->get_connection_input_color(E->get().to_port); - _draw_cos_line(connections_layer, frompos, topos, color, tocolor); + if (!gto) { + to_erase.push_back(E); + continue; } - while (to_erase.size()) { - connections.erase(to_erase.front()->get()); - to_erase.pop_front(); - } + Vector2 frompos = gfrom->get_connection_output_pos(E->get().from_port) + gfrom->get_offset() * zoom; + Color color = gfrom->get_connection_output_color(E->get().from_port); + Vector2 topos = gto->get_connection_input_pos(E->get().to_port) + gto->get_offset() * zoom; + Color tocolor = gto->get_connection_input_color(E->get().to_port); + _draw_cos_line(connections_layer, frompos, topos, color, tocolor); + } + + while (to_erase.size()) { + connections.erase(to_erase.front()->get()); + to_erase.pop_front(); } } diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index e908829d5f..4656b50133 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index f69b1bf147..8730be0c06 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h index a7d9e8ddb0..416d711aab 100644 --- a/scene/gui/graph_node.h +++ b/scene/gui/graph_node.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 1a224d1026..5dd5667f46 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/grid_container.h b/scene/gui/grid_container.h index aaa6a295ff..45e26ed48e 100644 --- a/scene/gui/grid_container.h +++ b/scene/gui/grid_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index c7889a6cf2..9bad871ef9 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index a80727f568..8166975408 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index cf7303cbe7..5fe3dd0129 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/label.h b/scene/gui/label.h index dce68f4422..7c1905af7d 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index c5360b0df0..66b4e6cec1 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 7d04e4618b..52a4a29a33 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index 632e9ec4fc..9fe94fc464 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/link_button.h b/scene/gui/link_button.h index 98a3dc66f6..386eb452ae 100644 --- a/scene/gui/link_button.h +++ b/scene/gui/link_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/margin_container.cpp b/scene/gui/margin_container.cpp index a9f8d9c384..14991f5d44 100644 --- a/scene/gui/margin_container.cpp +++ b/scene/gui/margin_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/margin_container.h b/scene/gui/margin_container.h index 1cdb3a36cc..9703d9ebe0 100644 --- a/scene/gui/margin_container.h +++ b/scene/gui/margin_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index 99e78d8851..ac450616d6 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h index 6bb23452dd..c7f1d976ff 100644 --- a/scene/gui/menu_button.h +++ b/scene/gui/menu_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 00df266a09..b4d0799945 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index db921b8b97..a06c540678 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp index f3c6142f9e..536b655f75 100644 --- a/scene/gui/panel.cpp +++ b/scene/gui/panel.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/panel.h b/scene/gui/panel.h index eac8f2d4e8..cc7ca47319 100644 --- a/scene/gui/panel.h +++ b/scene/gui/panel.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp index 45bb81ac75..a0c75d1330 100644 --- a/scene/gui/panel_container.cpp +++ b/scene/gui/panel_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/panel_container.h b/scene/gui/panel_container.h index f8f1fb6494..5d8f1ee64b 100644 --- a/scene/gui/panel_container.h +++ b/scene/gui/panel_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp index 71cbef495c..6b2deeb209 100644 --- a/scene/gui/patch_9_rect.cpp +++ b/scene/gui/patch_9_rect.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/patch_9_rect.h b/scene/gui/patch_9_rect.h index 636b9127e7..4cf93e4c05 100644 --- a/scene/gui/patch_9_rect.h +++ b/scene/gui/patch_9_rect.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 348d0aa460..5a2a552943 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -59,17 +59,10 @@ void Popup::_notification(int p_what) { void Popup::_fix_size() { -#if 0 - Point2 pos = get_position(); - Size2 size = get_size(); - Point2 window_size = window==this ? get_parent_area_size() :window->get_size(); -#else - Point2 pos = get_global_position(); Size2 size = get_size(); Point2 window_size = get_viewport_rect().size; -#endif if (pos.x + size.width > window_size.width) pos.x = window_size.width - size.width; if (pos.x < 0) @@ -79,14 +72,8 @@ void Popup::_fix_size() { pos.y = window_size.height - size.height; if (pos.y < 0) pos.y = 0; -#if 0 - if (pos!=get_pos()) - set_position(pos); -#else if (pos != get_position()) set_global_position(pos); - -#endif } void Popup::set_as_minsize() { diff --git a/scene/gui/popup.h b/scene/gui/popup.h index 0543ae1937..6739c580f2 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 79caf1c836..f3711b86b6 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 37714ee989..c9e9c8e311 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index 13d368d253..6953d03384 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/progress_bar.h b/scene/gui/progress_bar.h index 1121a78aab..c5a9252123 100644 --- a/scene/gui/progress_bar.h +++ b/scene/gui/progress_bar.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index 74e3b39e04..1dbec6e5a1 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/range.h b/scene/gui/range.h index fdcbbb09ee..daa8af824a 100644 --- a/scene/gui/range.h +++ b/scene/gui/range.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/reference_rect.cpp b/scene/gui/reference_rect.cpp index 441c3e721b..e2f4abe04a 100644 --- a/scene/gui/reference_rect.cpp +++ b/scene/gui/reference_rect.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/reference_rect.h b/scene/gui/reference_rect.h index b118425eb6..9b826a1145 100644 --- a/scene/gui/reference_rect.h +++ b/scene/gui/reference_rect.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index f0efbdc517..a3f116c883 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 71fa766958..74bf180b5d 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 737765aa1a..16d1b320b7 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,9 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "scroll_bar.h" + #include "os/keyboard.h" #include "os/os.h" #include "print_string.h" + bool ScrollBar::focus_by_default = false; void ScrollBar::set_can_focus_by_default(bool p_can_focus) { @@ -686,138 +688,6 @@ bool ScrollBar::is_smooth_scroll_enabled() const { return smooth_scroll_enabled; } -#if 0 - -void ScrollBar::mouse_button(const Point2& p_pos, int b->get_button_index(),bool b->is_pressed(),int p_modifier_mask) { - - // wheel! - - if (b->get_button_index()==BUTTON_WHEEL_UP && b->is_pressed()) { - - if (orientation==VERTICAL) - set_val( get_val() - get_page() / 4.0 ); - else - set_val( get_val() + get_page() / 4.0 ); - - } - if (b->get_button_index()==BUTTON_WHEEL_DOWN && b->is_pressed()) { - - if (orientation==HORIZONTAL) - set_val( get_val() - get_page() / 4.0 ); - else - set_val( get_val() + get_page() / 4.0 ); - } - - if (b->get_button_index()!=BUTTON_LEFT) - return; - - if (b->is_pressed()) { - - int ofs = orientation==VERTICAL ? p_pos.y : p_pos.x ; - int grabber_ofs = get_grabber_offset(); - int grabber_size = get_grabber_size(); - - if ( ofs < grabber_ofs ) { - - set_val( get_val() - get_page() ); - - } else if (ofs > grabber_ofs + grabber_size ) { - - set_val( get_val() + get_page() ); - - } else { - - - drag.active=true; - drag.pos_at_click=get_click_pos(p_pos); - drag.value_at_click=get_unit_value(); - } - - - } else { - - drag.active=false; - } - -} -void ScrollBar::mouse_motion(const Point2& p_pos, const Point2& p_rel, int b->get_button_index()_mask) { - - if (!drag.active) - return; - - double value_ofs=drag.value_at_click+(get_click_pos(p_pos)-drag.pos_at_click); - - - value_ofs=value_ofs*( get_max() - get_min() ); - if (value_ofs<get_min()) - value_ofs=get_min(); - if (value_ofs>(get_max()-get_page())) - value_ofs=get_max()-get_page(); - if (get_val()==value_ofs) - return; //don't bother if the value is the same - - set_val( value_ofs ); - -} - -bool ScrollBar::key(unsigned long p_unicode, unsigned long p_scan_code,bool b->is_pressed(),bool p_repeat,int p_modifier_mask) { - - if (!b->is_pressed()) - return false; - - switch (p_scan_code) { - - case KEY_LEFT: { - - if (orientation!=HORIZONTAL) - return false; - set_val( get_val() - get_step() ); - - } break; - case KEY_RIGHT: { - - if (orientation!=HORIZONTAL) - return false; - set_val( get_val() + get_step() ); - - } break; - case KEY_UP: { - - if (orientation!=VERTICAL) - return false; - - set_val( get_val() - get_step() ); - - - } break; - case KEY_DOWN: { - - if (orientation!=VERTICAL) - return false; - set_val( get_val() + get_step() ); - - } break; - case KEY_HOME: { - - set_val( get_min() ); - - } break; - case KEY_END: { - - set_val( get_max() ); - - } break; - - default: - return false; - - } - - return true; -} - -#endif - void ScrollBar::_bind_methods() { ClassDB::bind_method(D_METHOD("_gui_input"), &ScrollBar::_gui_input); diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index e22d4da46d..373483a8a0 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index db94146970..e182e491d3 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h index e5df3e5e1c..9076be0d72 100644 --- a/scene/gui/scroll_container.h +++ b/scene/gui/scroll_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp index 3b00ab4605..3db234f7cc 100644 --- a/scene/gui/separator.cpp +++ b/scene/gui/separator.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/separator.h b/scene/gui/separator.h index 9a5fe2ac66..be2f1e8e77 100644 --- a/scene/gui/separator.h +++ b/scene/gui/separator.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/input_action.cpp b/scene/gui/shortcut.cpp index c08059a049..f37410e77b 100644 --- a/scene/gui/input_action.cpp +++ b/scene/gui/shortcut.cpp @@ -1,9 +1,9 @@ /*************************************************************************/ -/* input_action.cpp */ +/* shortcut.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -27,7 +27,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "input_action.h" +#include "shortcut.h" + #include "os/keyboard.h" void ShortCut::set_shortcut(const Ref<InputEvent> &p_shortcut) { @@ -52,61 +53,6 @@ String ShortCut::get_as_text() const { return shortcut->as_text(); else return "None"; -#if 0 - switch (shortcut.type) { - - case Ref<InputEvent>::NONE: { - - return "None"; - } break; - case Ref<InputEvent>::KEY: { - - String str; - if (shortcut->get_shift()) - str += RTR("Shift+"); - if (shortcut->get_alt()) - str += RTR("Alt+"); - if (shortcut->get_control()) - str += RTR("Ctrl+"); - if (shortcut->get_metakey()) - str += RTR("Meta+"); - - str += keycode_get_string(shortcut->get_scancode()).capitalize(); - - return str; - } break; - case Ref<InputEvent>::JOYPAD_BUTTON: { - - String str = RTR("Device") + " " + itos(shortcut.device) + ", " + RTR("Button") + " " + itos(shortcut.joy_button->get_button_index()); - str += "."; - - return str; - } break; - case Ref<InputEvent>::MOUSE_BUTTON: { - - String str = RTR("Device") + " " + itos(shortcut.device) + ", "; - switch (shortcut->get_button_index()) { - case BUTTON_LEFT: str += RTR("Left Button."); break; - case BUTTON_RIGHT: str += RTR("Right Button."); break; - case BUTTON_MIDDLE: str += RTR("Middle Button."); break; - case BUTTON_WHEEL_UP: str += RTR("Wheel Up."); break; - case BUTTON_WHEEL_DOWN: str += RTR("Wheel Down."); break; - default: str += RTR("Button") + " " + itos(shortcut->get_button_index()) + "."; - } - - return str; - } break; - case Ref<InputEvent>::JOYPAD_MOTION: { - - int ax = shortcut.joy_motion.axis; - String str = RTR("Device") + " " + itos(shortcut.device) + ", " + RTR("Axis") + " " + itos(ax) + "."; - - return str; - } break; - } - - return ""; -#endif } bool ShortCut::is_valid() const { diff --git a/scene/gui/input_action.h b/scene/gui/shortcut.h index 5c91d2be28..8d85bb920f 100644 --- a/scene/gui/input_action.h +++ b/scene/gui/shortcut.h @@ -1,9 +1,9 @@ /*************************************************************************/ -/* input_action.h */ +/* shortcut.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -27,8 +27,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef INPUTACTION_H -#define INPUTACTION_H +#ifndef SHORTCUT_H +#define SHORTCUT_H #include "os/input_event.h" #include "resource.h" @@ -53,4 +53,4 @@ public: ShortCut(); }; -#endif // INPUTACTION_H +#endif // SHORTCUT_H diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 9ba17ce34f..4661f54526 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/slider.h b/scene/gui/slider.h index f3cf3c6f48..a2334a69fc 100644 --- a/scene/gui/slider.h +++ b/scene/gui/slider.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 751edc5a43..f462989f53 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h index 683ed0c344..0c562bd744 100644 --- a/scene/gui/spin_box.h +++ b/scene/gui/spin_box.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index 5515c0f0cd..4420a936d2 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index 87a210f24c..8ec21b5eaa 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 8afcc896a3..461ae3444b 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index 3e1a2c1598..be59a16b3f 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index b0dc88bbb4..085f6de6b8 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 86ad128dcd..73fa40bbb8 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index d585562dc6..7a9daea73e 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -27,13 +27,12 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ - #include "text_edit.h" + +#include "message_queue.h" #include "os/input.h" #include "os/keyboard.h" #include "os/os.h" - -#include "message_queue.h" #include "project_settings.h" #include "scene/main/viewport.h" @@ -3190,6 +3189,11 @@ void TextEdit::adjust_viewport_to_cursor() { if (cursor.line < cursor.line_ofs) cursor.line_ofs = cursor.line; + if (cursor.line_ofs + visible_rows > text.size() && !scroll_past_end_of_file_enabled) { + cursor.line_ofs = text.size() - visible_rows; + v_scroll->set_value(text.size() - visible_rows); + } + int cursor_x = get_column_x_offset(cursor.column, text[cursor.line]); if (cursor_x > (cursor.x_ofs + visible_width)) @@ -3662,10 +3666,10 @@ void TextEdit::cut() { String clipboard = _base_get_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); OS::get_singleton()->set_clipboard(clipboard); - cursor_set_line(selection.from_line); + _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); + cursor_set_line(selection.from_line); // set afterwards else it causes the view to be offset cursor_set_column(selection.from_column); - _remove_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column); selection.active = false; selection.selecting_mode = Selection::MODE_NONE; update(); @@ -4466,18 +4470,6 @@ void TextEdit::_update_completion_candidates() { // The top of the list is the best match completion_current = completion_options[0]; - -#if 0 // even there's only one option, user still get the chance to choose using it or not - if (completion_options.size()==1) { - //one option to complete, just complete it automagically - _confirm_completion(); - //insert_text_at_cursor(completion_options[0].substr(s.length(),completion_options[0].length()-s.length())); - _cancel_completion(); - return; - - } -#endif - completion_enabled = true; } @@ -4904,24 +4896,6 @@ TextEdit::TextEdit() { click_select_held->set_wait_time(0.05); click_select_held->connect("timeout", this, "_click_selection_held"); -#if 0 - syntax_coloring=true; - keywords["void"]=Color(0.3,0.0,0.1); - keywords["int"]=Color(0.3,0.0,0.1); - keywords["function"]=Color(0.3,0.0,0.1); - keywords["class"]=Color(0.3,0.0,0.1); - keywords["extends"]=Color(0.3,0.0,0.1); - keywords["constructor"]=Color(0.3,0.0,0.1); - symbol_color=Color(0.1,0.0,0.3,1.0); - - color_regions.push_back(ColorRegion("/*","*/",Color(0.4,0.6,0,4))); - color_regions.push_back(ColorRegion("//","",Color(0.6,0.6,0.4))); - color_regions.push_back(ColorRegion("\"","\"",Color(0.4,0.7,0.7))); - color_regions.push_back(ColorRegion("'","'",Color(0.4,0.8,0.8))); - color_regions.push_back(ColorRegion("#","",Color(0.2,1.0,0.2))); - -#endif - current_op.type = TextOperation::TYPE_NONE; undo_enabled = true; undo_stack_pos = NULL; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 7ab26322e7..68ef559f46 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index d307b463d9..77bc876201 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index 8df30cd35a..94f372decf 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index 59cff84719..aad7c6b96b 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/texture_progress.h b/scene/gui/texture_progress.h index 20546bd11f..04096d35e3 100644 --- a/scene/gui/texture_progress.h +++ b/scene/gui/texture_progress.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp index db340fd4d7..38f90fe7b5 100644 --- a/scene/gui/texture_rect.cpp +++ b/scene/gui/texture_rect.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/texture_rect.h b/scene/gui/texture_rect.h index dcc6c3f9bd..8a2b715488 100644 --- a/scene/gui/texture_rect.h +++ b/scene/gui/texture_rect.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/tool_button.cpp b/scene/gui/tool_button.cpp index 5fc4b6ecf8..4dfa3d8f37 100644 --- a/scene/gui/tool_button.cpp +++ b/scene/gui/tool_button.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/tool_button.h b/scene/gui/tool_button.h index d243b5559f..4c5ea685de 100644 --- a/scene/gui/tool_button.h +++ b/scene/gui/tool_button.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index a40d1acb8f..5e15bceb7d 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "tree.h" + #include "os/input.h" #include "os/keyboard.h" #include "os/os.h" @@ -990,41 +991,10 @@ void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, co rect.size.x -= bmsize.x + cache.hseparation; } - /* - if (p_tool) - rect.size.x-=Math::floor(rect.size.y/2); - */ - rect.position.y += Math::floor((rect.size.y - font->get_height()) / 2.0) + font->get_ascent(); font->draw(ci, rect.position, text, p_color, rect.size.x); } -#if 0 -void Tree::draw_item_text(String p_text,const Ref<Texture>& p_icon,int p_icon_max_w,bool p_tool,Rect2i p_rect,const Color& p_color) { - - RID ci = get_canvas_item(); - if (!p_icon.is_null()) { - Size2i bmsize = p_icon->get_size(); - if (p_icon_max_w>0 && bmsize.width > p_icon_max_w) { - bmsize.height = bmsize.height * p_icon_max_w / bmsize.width; - bmsize.width=p_icon_max_w; - } - - draw_texture_rect(p_icon,Rect2(p_rect.pos + Size2i(0,Math::floor((p_rect.size.y-bmsize.y)/2)),bmsize)); - p_rect.pos.x+=bmsize.x+cache.hseparation; - p_rect.size.x-=bmsize.x+cache.hseparation; - - } - - if (p_tool) - p_rect.size.x-=Math::floor(p_rect.size.y/2); - - Ref<Font> font = cache.font; - - p_rect.pos.y+=Math::floor((p_rect.size.y-font->get_height())/2.0) +font->get_ascent(); - font->draw(ci,p_rect.pos,p_text,p_color,p_rect.size.x); -} -#endif int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item) { if (p_pos.y - cache.offset.y > (p_draw_size.height)) diff --git a/scene/gui/tree.h b/scene/gui/tree.h index a87f6d89e2..1fb1eb2792 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 37d10fb63e..a92155cc4f 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,27 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "video_player.h" + #include "os/os.h" #include "servers/audio_server.h" -/* - -int VideoPlayer::InternalStream::get_channel_count() const { - - return player->sp_get_channel_count(); -} -void VideoPlayer::InternalStream::set_mix_rate(int p_rate){ - - return player->sp_set_mix_rate(p_rate); -} -bool VideoPlayer::InternalStream::mix(int32_t *p_buffer,int p_frames){ - - return player->sp_mix(p_buffer,p_frames); -} -void VideoPlayer::InternalStream::update(){ - - player->sp_update(); -} -*/ int VideoPlayer::sp_get_channel_count() const { @@ -69,31 +51,6 @@ bool VideoPlayer::sp_mix(int32_t *p_buffer, int p_frames) { return false; } -void VideoPlayer::sp_update() { -#if 0 - _THREAD_SAFE_METHOD_ - //update is unused - if (!paused && playback.is_valid()) { - - if (!playback->is_playing()) { - //stream depleted data, but there's still audio in the ringbuffer - //check that all this audio has been flushed before stopping the stream - int to_mix = resampler.get_total() - resampler.get_todo(); - if (to_mix==0) { - stop(); - return; - } - - return; - } - - int todo =resampler.get_todo(); - int wrote = playback->mix(resampler.get_write_buffer(),todo); - resampler.write(wrote); - } -#endif -} - int VideoPlayer::_audio_mix_callback(void *p_udata, const int16_t *p_data, int p_frames) { VideoPlayer *vp = (VideoPlayer *)p_udata; diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index 87c452509b..b78f3aabe7 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -38,23 +38,12 @@ class VideoPlayer : public Control { GDCLASS(VideoPlayer, Control); - /* struct InternalStream : public AudioServer::AudioStream { - VideoPlayer *player; - virtual int get_channel_count() const; - virtual void set_mix_rate(int p_rate); //notify the stream of the mix rate - virtual bool mix(int32_t *p_buffer,int p_frames); - virtual void update(); - }; -*/ - - // InternalStream internal_stream; Ref<VideoStreamPlayback> playback; Ref<VideoStream> stream; int sp_get_channel_count() const; void sp_set_mix_rate(int p_rate); //notify the stream of the mix rate bool sp_mix(int32_t *p_buffer, int p_frames); - void sp_update(); RID stream_rid; @@ -118,4 +107,4 @@ public: ~VideoPlayer(); }; -#endif +#endif // VIDEO_PLAYER_H diff --git a/scene/gui/viewport_container.cpp b/scene/gui/viewport_container.cpp index 2eb8eaa7d1..c321b873fd 100644 --- a/scene/gui/viewport_container.cpp +++ b/scene/gui/viewport_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/gui/viewport_container.h b/scene/gui/viewport_container.h index 27eb6ec81b..630523b5fb 100644 --- a/scene/gui/viewport_container.h +++ b/scene/gui/viewport_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/io/SCsub b/scene/io/SCsub deleted file mode 100644 index bf9125be7f..0000000000 --- a/scene/io/SCsub +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python - -Import('env') - -env.add_source_files(env.scene_sources, "*.cpp") - -Export('env') diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp deleted file mode 100644 index 04b6177c3c..0000000000 --- a/scene/io/resource_format_image.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/*************************************************************************/ -/* resource_format_image.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "resource_format_image.h" - -#if 0 -#include "io/image_loader.h" -#include "os/os.h" -#include "project_settings.h" -#include "scene/resources/texture.h" -RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_original_path, Error *r_error) { - - if (r_error) - *r_error=ERR_CANT_OPEN; - - if (p_path.get_extension()=="cube") { - // open as cubemap txture - - CubeMap* ptr = memnew(CubeMap); - Ref<CubeMap> cubemap( ptr ); - - Error err; - FileAccess *f = FileAccess::open(p_path,FileAccess::READ,&err); - if (err) { - - ERR_FAIL_COND_V( err, RES() ); - } - - String base_path=p_path.substr( 0, p_path.find_last("/")+1 ); - - for(int i=0;i<6;i++) { - - String file = f->get_line().strip_edges(); - Image image; - - Error err = ImageLoader::load_image(base_path+file,&image); - - - if (err) { - - memdelete(f); - ERR_FAIL_COND_V( err, RES() ); - } - - if (i==0) { - - //cubemap->create(image.get_width(),image.get_height(),image.get_format(),Texture::FLAGS_DEFAULT|Texture::FLAG_CUBEMAP); - } - - static const CubeMap::Side cube_side[6]= { - CubeMap::SIDE_LEFT, - CubeMap::SIDE_RIGHT, - CubeMap::SIDE_BOTTOM, - CubeMap::SIDE_TOP, - CubeMap::SIDE_FRONT, - CubeMap::SIDE_BACK - }; - - cubemap->set_side(cube_side[i],image); - } - - memdelete(f); - - cubemap->set_name(p_path.get_file()); - if (r_error) - *r_error=OK; - - return cubemap; - - } else { - // simple image - - ImageTexture* ptr = memnew(ImageTexture); - Ref<ImageTexture> texture( ptr ); - - uint64_t begtime; - double total; - - Image image; - - if (debug_load_times) - begtime=OS::get_singleton()->get_ticks_usec(); - - - Error err = ImageLoader::load_image(p_path,&image); - - if (!err && debug_load_times) { - double total=USEC_TO_SEC((OS::get_singleton()->get_ticks_usec()-begtime)); - print_line("IMAGE: "+itos(image.get_width())+"x"+itos(image.get_height())); - print_line(" -load: "+rtos(total)); - } - - - ERR_EXPLAIN("Failed loading image: "+p_path); - ERR_FAIL_COND_V(err, RES()); - if (r_error) - *r_error=ERR_FILE_CORRUPT; - -#ifdef DEBUG_ENABLED -#ifdef TOOLS_ENABLED - - if (max_texture_size && (image.get_width() > max_texture_size || image.get_height() > max_texture_size)) { - - - if (bool(ProjectSettings::get_singleton()->get("debug/image_loader/max_texture_size_alert"))) { - OS::get_singleton()->alert("Texture is too large: '"+p_path+"', at "+itos(image.get_width())+"x"+itos(image.get_height())+". Max allowed size is: "+itos(max_texture_size)+"x"+itos(max_texture_size)+".","BAD ARTIST, NO COOKIE!"); - } - - ERR_EXPLAIN("Texture is too large: '"+p_path+"', at "+itos(image.get_width())+"x"+itos(image.get_height())+". Max allowed size is: "+itos(max_texture_size)+"x"+itos(max_texture_size)+"."); - ERR_FAIL_V(RES()); - } -#endif -#endif - - - uint32_t flags=load_image_flags(p_path); - - if (debug_load_times) - begtime=OS::get_singleton()->get_ticks_usec(); - - //print_line("img: "+p_path+" flags: "+itos(flags)); - texture->create_from_image( image,flags ); - texture->set_name(p_path.get_file()); - - - if (debug_load_times) { - total=USEC_TO_SEC(OS::get_singleton()->get_ticks_usec()-begtime); - print_line(" -make texture: "+rtos(total)); - } - - if (r_error) - *r_error=OK; - - return RES( texture ); - } - - -} - -uint32_t ResourceFormatLoaderImage::load_image_flags(const String &p_path) { - - - FileAccess *f2 = FileAccess::open(p_path+".flags",FileAccess::READ); - Map<String,bool> flags_found; - if (f2) { - - while(!f2->eof_reached()) { - String l2 = f2->get_line(); - int eqpos = l2.find("="); - if (eqpos!=-1) { - String flag=l2.substr(0,eqpos).strip_edges(); - String val=l2.substr(eqpos+1,l2.length()).strip_edges().to_lower(); - flags_found[flag]=(val=="true" || val=="1")?true:false; - } - } - memdelete(f2); - } - - - uint32_t flags=0; - - if (flags_found.has("filter")) { - if (flags_found["filter"]) - flags|=Texture::FLAG_FILTER; - } else if (bool(GLOBAL_DEF("rendering/image_loader/filter",true))) { - flags|=Texture::FLAG_FILTER; - } - - - if (flags_found.has("gen_mipmaps")) { - if (flags_found["gen_mipmaps"]) - flags|=Texture::FLAG_MIPMAPS; - } else if (bool(GLOBAL_DEF("rendering/image_loader/gen_mipmaps",true))) { - flags|=Texture::FLAG_MIPMAPS; - } - - if (flags_found.has("repeat")) { - if (flags_found["repeat"]) - flags|=Texture::FLAG_REPEAT; - } else if (bool(GLOBAL_DEF("rendering/image_loader/repeat",true))) { - flags|=Texture::FLAG_REPEAT; - } - - if (flags_found.has("anisotropic")) { - if (flags_found["anisotropic"]) - flags|=Texture::FLAG_ANISOTROPIC_FILTER; - } - - if (flags_found.has("tolinear")) { - if (flags_found["tolinear"]) - flags|=Texture::FLAG_CONVERT_TO_LINEAR; - } - - if (flags_found.has("mirroredrepeat")) { - if (flags_found["mirroredrepeat"]) - flags|=Texture::FLAG_MIRRORED_REPEAT; - } - - return flags; -} - -bool ResourceFormatLoaderImage::handles_type(const String& p_type) const { - - return ClassDB::is_parent_class(p_type,"Texture") || ClassDB::is_parent_class(p_type,"CubeMap"); -} - -void ResourceFormatLoaderImage::get_recognized_extensions(List<String> *p_extensions) const { - - ImageLoader::get_recognized_extensions(p_extensions); - p_extensions->push_back("cube"); -} - -String ResourceFormatLoaderImage::get_resource_type(const String &p_path) const { - - String ext=p_path.get_extension().to_lower(); - if (ext=="cube") - return "CubeMap"; - - List<String> extensions; - ImageLoader::get_recognized_extensions(&extensions); - - for(List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get()==ext) - return "ImageTexture"; - } - return ""; -} - - -ResourceFormatLoaderImage::ResourceFormatLoaderImage() { - - max_texture_size = GLOBAL_DEF("debug/image_loader/max_texture_size",0); - GLOBAL_DEF("debug/image_loader/max_texture_size_alert",false); - debug_load_times=GLOBAL_DEF("debug/image_loader/image_load_times",false); - GLOBAL_DEF("rendering/image_loader/filter",true); - GLOBAL_DEF("rendering/image_loader/gen_mipmaps",true); - GLOBAL_DEF("rendering/image_loader/repeat",false); - -} -#endif diff --git a/scene/io/resource_format_image.h b/scene/io/resource_format_image.h deleted file mode 100644 index 2cf6315f17..0000000000 --- a/scene/io/resource_format_image.h +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************/ -/* resource_format_image.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef RESOURCE_FORMAT_IMAGE_H -#define RESOURCE_FORMAT_IMAGE_H - -#if 0 - -#include "io/resource_loader.h" -#include "io/resource_saver.h" -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ -class ResourceFormatLoaderImage : public ResourceFormatLoader { - - bool debug_load_times; - int max_texture_size; -public: - virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); - static uint32_t load_image_flags(const String &p_path); - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; - virtual String get_resource_type(const String &p_path) const; - - ResourceFormatLoaderImage(); -}; - -#endif -#endif diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp deleted file mode 100644 index dabbb79de3..0000000000 --- a/scene/io/resource_format_wav.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/*************************************************************************/ -/* resource_format_wav.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#if 0 -#include "resource_format_wav.h" -#include "os/file_access.h" -#include "scene/resources/sample.h" - - -RES ResourceFormatLoaderWAV::load(const String &p_path, const String& p_original_path, Error *r_error) { - if (r_error) - *r_error=ERR_FILE_CANT_OPEN; - - Error err; - FileAccess *file=FileAccess::open(p_path, FileAccess::READ,&err); - - ERR_FAIL_COND_V( err!=OK, RES() ); - - if (r_error) - *r_error=ERR_FILE_CORRUPT; - - /* CHECK RIFF */ - char riff[5]; - riff[4]=0; - file->get_buffer((uint8_t*)&riff,4); //RIFF - - if (riff[0]!='R' || riff[1]!='I' || riff[2]!='F' || riff[3]!='F') { - - file->close(); - memdelete(file); - ERR_FAIL_V( RES() ); - } - - - /* GET FILESIZE */ - uint32_t filesize=file->get_32(); - - /* CHECK WAVE */ - - char wave[4]; - - file->get_buffer((uint8_t*)&wave,4); //RIFF - - if (wave[0]!='W' || wave[1]!='A' || wave[2]!='V' || wave[3]!='E') { - - - file->close(); - memdelete(file); - ERR_EXPLAIN("Not a WAV file (no WAVE RIFF Header)") - ERR_FAIL_V( RES() ); - } - - bool format_found=false; - bool data_found=false; - int format_bits=0; - int format_channels=0; - int format_freq=0; - Sample::LoopFormat loop=Sample::LOOP_NONE; - int loop_begin=0; - int loop_end=0; - - - Ref<Sample> sample( memnew( Sample ) ); - - - while (!file->eof_reached()) { - - - /* chunk */ - char chunkID[4]; - file->get_buffer((uint8_t*)&chunkID,4); //RIFF - - /* chunk size */ - uint32_t chunksize=file->get_32(); - uint32_t file_pos=file->get_position(); //save file pos, so we can skip to next chunk safely - - if (file->eof_reached()) { - - //ERR_PRINT("EOF REACH"); - break; - } - - if (chunkID[0]=='f' && chunkID[1]=='m' && chunkID[2]=='t' && chunkID[3]==' ' && !format_found) { - /* IS FORMAT CHUNK */ - - uint16_t compression_code=file->get_16(); - - - if (compression_code!=1) { - ERR_PRINT("Format not supported for WAVE file (not PCM). Save WAVE files as uncompressed PCM instead."); - break; - } - - format_channels=file->get_16(); - if (format_channels!=1 && format_channels !=2) { - - ERR_PRINT("Format not supported for WAVE file (not stereo or mono)"); - break; - - } - - format_freq=file->get_32(); //sampling rate - - file->get_32(); // average bits/second (unused) - file->get_16(); // block align (unused) - format_bits=file->get_16(); // bits per sample - - if (format_bits%8) { - - ERR_PRINT("Strange number of bits in sample (not 8,16,24,32)"); - break; - } - - /* Don't need anything else, continue */ - format_found=true; - } - - - if (chunkID[0]=='d' && chunkID[1]=='a' && chunkID[2]=='t' && chunkID[3]=='a' && !data_found) { - /* IS FORMAT CHUNK */ - data_found=true; - - if (!format_found) { - ERR_PRINT("'data' chunk before 'format' chunk found."); - break; - - } - - int frames=chunksize; - - frames/=format_channels; - frames/=(format_bits>>3); - - /*print_line("chunksize: "+itos(chunksize)); - print_line("channels: "+itos(format_channels)); - print_line("bits: "+itos(format_bits)); -*/ - sample->create( - (format_bits==8) ? Sample::FORMAT_PCM8 : Sample::FORMAT_PCM16, - (format_channels==2)?true:false, - frames ); - sample->set_mix_rate( format_freq ); - - int len=frames; - if (format_channels==2) - len*=2; - if (format_bits>8) - len*=2; - - PoolVector<uint8_t> data; - data.resize(len); - PoolVector<uint8_t>::Write dataw = data.write(); - void * data_ptr = dataw.ptr(); - - for (int i=0;i<frames;i++) { - - - for (int c=0;c<format_channels;c++) { - - - if (format_bits==8) { - // 8 bit samples are UNSIGNED - - uint8_t s = file->get_8(); - s-=128; - int8_t *sp=(int8_t*)&s; - - int8_t *data_ptr8=&((int8_t*)data_ptr)[i*format_channels+c]; - - *data_ptr8=*sp; - - } else { - //16+ bits samples are SIGNED - // if sample is > 16 bits, just read extra bytes - - uint32_t data=0; - for (int b=0;b<(format_bits>>3);b++) { - - data|=((uint32_t)file->get_8())<<(b*8); - } - data<<=(32-format_bits); - - - int32_t s=data; - - int16_t *data_ptr16=&((int16_t*)data_ptr)[i*format_channels+c]; - - *data_ptr16=s>>16; - } - } - - } - - dataw=PoolVector<uint8_t>::Write(); - - sample->set_data(data); - - - if (file->eof_reached()) { - file->close(); - memdelete(file); - ERR_EXPLAIN("Premature end of file."); - ERR_FAIL_V(RES()); - } - } - - if (chunkID[0]=='s' && chunkID[1]=='m' && chunkID[2]=='p' && chunkID[3]=='l') { - //loop point info! - - for(int i=0;i<10;i++) - file->get_32(); // i wish to know why should i do this... no doc! - - loop=file->get_32()?Sample::LOOP_PING_PONG:Sample::LOOP_FORWARD; - loop_begin=file->get_32(); - loop_end=file->get_32(); - - } - file->seek( file_pos+chunksize ); - } - - sample->set_loop_format(loop); - sample->set_loop_begin(loop_begin); - sample->set_loop_end(loop_end); - - file->close(); - memdelete(file); - - if (r_error) - *r_error=OK; - - - return sample; - -} -void ResourceFormatLoaderWAV::get_recognized_extensions(List<String> *p_extensions) const { - - p_extensions->push_back("wav"); -} -bool ResourceFormatLoaderWAV::handles_type(const String& p_type) const { - - return (p_type=="Sample"); -} - -String ResourceFormatLoaderWAV::get_resource_type(const String &p_path) const { - - if (p_path.get_extension().to_lower()=="wav") - return "Sample"; - return ""; -} - -#endif diff --git a/scene/io/resource_format_wav.h b/scene/io/resource_format_wav.h deleted file mode 100644 index 9105689670..0000000000 --- a/scene/io/resource_format_wav.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************/ -/* resource_format_wav.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef RESOURCE_FORMAT_WAV_H -#define RESOURCE_FORMAT_WAV_H - -#if 0 -#include "io/resource_loader.h" - -class ResourceFormatLoaderWAV : public ResourceFormatLoader { -public: - virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; - virtual String get_resource_type(const String &p_path) const; - -}; - -#endif -#endif // RESOURCE_FORMAT_WAV_H diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index b168dcfccc..ce8714e574 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index b14a915fe8..fbee87f487 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index e57cd857f8..1e1e4f2d5f 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/http_request.h b/scene/main/http_request.h index 104f529eae..790ff5f7ef 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index 5580ef486e..cbe30e05dd 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/instance_placeholder.h b/scene/main/instance_placeholder.h index ec4520e1c8..375c87a035 100644 --- a/scene/main/instance_placeholder.h +++ b/scene/main/instance_placeholder.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/node.cpp b/scene/main/node.cpp index adc52c501a..c3d9d97c5a 100755 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "node.h" + #include "instance_placeholder.h" #include "io/resource_loader.h" #include "message_queue.h" @@ -360,18 +361,6 @@ void Node::add_child_notify(Node *p_child) { // to be used when not wanted } -/* -void Node::remove_and_delete_child(Node *p_child) { - - ERR_FAIL_NULL( p_child ); - ERR_FAIL_COND( p_child->get_parent()!=this ); - - remove_child(p_child); - memdelete(p_child); - -} -*/ - void Node::remove_child_notify(Node *p_child) { // to be used when not wanted @@ -675,31 +664,6 @@ Variant Node::_rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Va return Variant(); } -#if 0 -Variant Node::_rpc_bind(const Variant** p_args, int p_argcount, Variant::CallError& r_error) { - - if (p_argcount<1) { - r_error.error=Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; - r_error.argument=1; - return Variant(); - } - - if (p_args[0]->get_type()!=Variant::STRING) { - r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; - r_error.argument=0; - r_error.expected=Variant::STRING; - return Variant(); - } - - StringName method = *p_args[0]; - - rpcp(method,&p_args[1],p_argcount-1); - - r_error.error=Variant::CallError::CALL_OK; - return Variant(); -} - -#endif void Node::rpcp(int p_peer_id, bool p_unreliable, const StringName &p_method, const Variant **p_arg, int p_argcount) { ERR_FAIL_COND(!is_inside_tree()); @@ -2070,59 +2034,6 @@ HashMap<NodePath, int> Node::get_editable_instances() const { return data.editable_instances; } -#if 0 - -void Node::generate_instance_state() { - - List<PropertyInfo> properties; - get_property_list(&properties); - - data.instance_state.clear(); - - for( List<PropertyInfo>::Element *E=properties.front();E;E=E->next() ) { - - PropertyInfo &pi=E->get(); - if ((pi.usage&PROPERTY_USAGE_NO_INSTANCE_STATE) || !(pi.usage&PROPERTY_USAGE_EDITOR) || !(pi.usage&PROPERTY_USAGE_STORAGE)) - continue; - - data.instance_state[pi.name]=get(pi.name); - } - - List<GroupInfo> groups; - get_groups(&groups); - for(List<GroupInfo>::Element *E=groups.front();E;E=E->next()) { - - if (!E->get().persistent) - continue; - data.instance_groups.push_back(E->get().name); - } - - List<MethodInfo> signal_list; - - get_signal_list(&signal_list); - - for(List<MethodInfo>::Element *E=signal_list.front();E;E=E->next()) { - - StringName name = E->get().name; - List<Connection> connections; - get_signal_connection_list(name,&connections); - - for(List<Connection>::Element *F=connections.front();F;F=F->next()) { - - if (F->get().flags&CONNECT_PERSIST) - data.instance_connections.push_back(F->get()); - } - - } -} - -Dictionary Node::get_instance_state() const { - - return data.instance_state; -} - -#endif - void Node::set_scene_instance_state(const Ref<SceneState> &p_state) { data.instance_state = p_state; @@ -2752,7 +2663,6 @@ void Node::_bind_methods() { ClassDB::bind_method(D_METHOD("get_name"), &Node::get_name); ClassDB::bind_method(D_METHOD("add_child", "node", "legible_unique_name"), &Node::add_child, DEFVAL(false)); ClassDB::bind_method(D_METHOD("remove_child", "node"), &Node::remove_child); - //ClassDB::bind_method(D_METHOD("remove_and_delete_child","node"),&Node::remove_and_delete_child); ClassDB::bind_method(D_METHOD("get_child_count"), &Node::get_child_count); ClassDB::bind_method(D_METHOD("get_children"), &Node::_get_children); ClassDB::bind_method(D_METHOD("get_child", "idx"), &Node::get_child); @@ -2864,7 +2774,6 @@ void Node::_bind_methods() { BIND_CONSTANT(NOTIFICATION_ENTER_TREE); BIND_CONSTANT(NOTIFICATION_EXIT_TREE); BIND_CONSTANT(NOTIFICATION_MOVED_IN_PARENT); - //BIND_CONSTANT( NOTIFICATION_PARENT_DECONFIGURED ); BIND_CONSTANT(NOTIFICATION_READY); BIND_CONSTANT(NOTIFICATION_FIXED_PROCESS); BIND_CONSTANT(NOTIFICATION_PROCESS); diff --git a/scene/main/node.h b/scene/main/node.h index b5ce6682d8..12d6310062 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -192,7 +192,6 @@ protected: virtual void add_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child); virtual void move_child_notify(Node *p_child); - //void remove_and_delete_child(Node *p_child); void _propagate_replace_owner(Node *p_owner, Node *p_by_owner); @@ -212,7 +211,6 @@ public: NOTIFICATION_EXIT_TREE = 11, NOTIFICATION_MOVED_IN_PARENT = 12, NOTIFICATION_READY = 13, - //NOTIFICATION_PARENT_DECONFIGURED =15, - it's confusing, it's going away NOTIFICATION_PAUSED = 14, NOTIFICATION_UNPAUSED = 15, NOTIFICATION_FIXED_PROCESS = 16, diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index ae323ba021..35bb6ef7e8 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h index a54781dc81..40e900a492 100644 --- a/scene/main/resource_preloader.h +++ b/scene/main/resource_preloader.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 99af8face0..65aeb23609 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -29,18 +29,15 @@ /*************************************************************************/ #include "scene_tree.h" +#include "editor/editor_node.h" +#include "io/marshalls.h" +#include "io/resource_loader.h" #include "message_queue.h" #include "node.h" #include "os/keyboard.h" #include "os/os.h" #include "print_string.h" #include "project_settings.h" -#include <stdio.h> -//#include "servers/spatial_sound_2d_server.h" - -#include "editor/editor_node.h" -#include "io/marshalls.h" -#include "io/resource_loader.h" #include "scene/resources/material.h" #include "scene/resources/mesh.h" #include "scene/resources/packed_scene.h" @@ -49,6 +46,8 @@ #include "servers/physics_server.h" #include "viewport.h" +#include <stdio.h> + void SceneTreeTimer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_time_left", "time"), &SceneTreeTimer::set_time_left); @@ -413,19 +412,7 @@ void SceneTree::input_event(const Ref<InputEvent> &p_event) { root_lock++; if (!input_handled) { - -#if 0 - _call_input_pause("unhandled_input","_unhandled_input",ev); - //call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_input","_unhandled_input",ev); - if (!input_handled && ev.type==InputEvent::KEY) { - _call_input_pause("unhandled_key_input","_unhandled_key_input",ev); - //call_group(GROUP_CALL_REVERSE|GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"unhandled_key_input","_unhandled_key_input",ev); - } -#else - call_group_flags(GROUP_CALL_REALTIME, "_viewports", "_vp_unhandled_input", ev); //special one for GUI, as controls use their own process check - -#endif input_handled = true; _flush_ugc(); root_lock--; diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 1de9a2ce8c..594b806cef 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 42690ab93a..df7d609ac0 100755 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/timer.h b/scene/main/timer.h index dd4711ec37..0cd92f12de 100755 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index b4eabaa540..02da926e50 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,28 +28,23 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "viewport.h" + #include "os/input.h" #include "os/os.h" -#include "scene/3d/spatial.h" -#include "servers/physics_2d_server.h" -//#include "scene/3d/camera.h" - +#include "project_settings.h" +#include "scene/2d/collision_object_2d.h" #include "scene/3d/camera.h" #include "scene/3d/collision_object.h" #include "scene/3d/listener.h" -#include "scene/3d/spatial_indexer.h" +#include "scene/3d/scenario_fx.h" +#include "scene/3d/spatial.h" #include "scene/gui/control.h" -#include "scene/resources/mesh.h" - -#include "scene/2d/collision_object_2d.h" - #include "scene/gui/label.h" #include "scene/gui/panel.h" #include "scene/main/timer.h" +#include "scene/resources/mesh.h" #include "scene/scene_string_names.h" - -#include "project_settings.h" -#include "scene/3d/scenario_fx.h" +#include "servers/physics_2d_server.h" void ViewportTexture::setup_local_to_scene() { @@ -1180,44 +1175,7 @@ bool Viewport::is_size_override_stretch_enabled() const { return size_override_stretch; } -#if 0 -void Viewport::set_as_render_target(bool p_enable){ - -/* if (render_target==p_enable) - return; - - render_target=p_enable; - VS::get_singleton()->viewport_set_as_render_target(viewport,p_enable); - if (is_inside_tree()) { - - if (p_enable) - _vp_exit_tree(); - else - _vp_enter_tree(); - } - - if (p_enable) { - - texture_rid = VS::get_singleton()->viewport_get_texture(viewport); - } else { - - texture_rid=RID(); - } - - texture->set_flags(texture->flags); - texture->emit_changed(); - - update_configuration_warning(); - */ -} - -bool Viewport::is_set_as_render_target() const{ - - return render_target; - -} -#endif void Viewport::set_update_mode(UpdateMode p_mode) { update_mode = p_mode; @@ -1227,7 +1185,6 @@ Viewport::UpdateMode Viewport::get_update_mode() const { return update_mode; } -//RID get_texture() const; Ref<ViewportTexture> Viewport::get_texture() const { @@ -2735,7 +2692,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "arvr"), "set_use_arvr", "use_arvr"); - ADD_PROPERTY(PropertyInfo(Variant::RECT2, "size"), "set_size", "get_size"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "own_world"), "set_use_own_world", "is_using_own_world"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "world", PROPERTY_HINT_RESOURCE_TYPE, "World"), "set_world", "get_world"); //ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world_2d",PROPERTY_HINT_RESOURCE_TYPE,"World2D"), "set_world_2d", "get_world_2d") ; diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 83c989db54..f527fa4f5b 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 283514dd53..e01f5e3cdf 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -108,8 +108,6 @@ #include "scene/gui/tree.h" #include "scene/gui/video_player.h" #include "scene/gui/viewport_container.h" -#include "scene/io/resource_format_image.h" -#include "scene/io/resource_format_wav.h" #include "scene/main/canvas_layer.h" #include "scene/main/http_request.h" #include "scene/main/instance_placeholder.h" diff --git a/scene/register_scene_types.h b/scene/register_scene_types.h index dee0af9063..956b12a7cd 100644 --- a/scene/register_scene_types.h +++ b/scene/register_scene_types.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 8878e59e71..1a2c8333ef 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "animation.h" + #include "geometry.h" bool Animation::_set(const StringName &p_name, const Variant &p_value) { @@ -83,44 +84,6 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { TransformTrack *tt = static_cast<TransformTrack *>(tracks[track]); PoolVector<float> values = p_value; int vcount = values.size(); - -#if 0 // old compatibility hack - if ((vcount%11) == 0) { - - - PoolVector<float>::Read r = values.read(); - - tt->transforms.resize(vcount/11); - - - for(int i=0;i<(vcount/11);i++) { - - - TKey<TransformKey> &tk=tt->transforms[i]; - const float *ofs=&r[i*11]; - tk.time=ofs[0]; - - tk.value.loc.x=ofs[1]; - tk.value.loc.y=ofs[2]; - tk.value.loc.z=ofs[3]; - - tk.value.rot.x=ofs[4]; - tk.value.rot.y=ofs[5]; - tk.value.rot.z=ofs[6]; - tk.value.rot.w=ofs[7]; - - tk.value.scale.x=ofs[8]; - tk.value.scale.y=ofs[9]; - tk.value.scale.z=ofs[10]; - - - } - return true; - - - - } -#endif ERR_FAIL_COND_V(vcount % 12, false); // shuld be multiple of 11 PoolVector<float>::Read r = values.read(); diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 27c58aba8c..e653f6b124 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp deleted file mode 100644 index 1b1d6f8587..0000000000 --- a/scene/resources/audio_stream_resampled.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/*************************************************************************/ -/* audio_stream_resampled.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "audio_stream_resampled.h" -#include "project_settings.h" - -#if 0 -int AudioStreamResampled::get_channel_count() const { - - if (!rb) - return 0; - - return channels; -} - - -template<int C> -uint32_t AudioStreamResampled::_resample(int32_t *p_dest,int p_todo,int32_t p_increment) { - - uint32_t read=offset&MIX_FRAC_MASK; - - for (int i=0;i<p_todo;i++) { - - offset = (offset + p_increment)&(((1<<(rb_bits+MIX_FRAC_BITS))-1)); - read+=p_increment; - uint32_t pos = offset >> MIX_FRAC_BITS; - uint32_t frac = offset & MIX_FRAC_MASK; -#ifndef FAST_AUDIO - ERR_FAIL_COND_V(pos>=rb_len,0); -#endif - uint32_t pos_next = (pos+1)&rb_mask; - //printf("rb pos %i\n",pos); - - // since this is a template with a known compile time value (C), conditionals go away when compiling. - if (C==1) { - - int32_t v0 = rb[pos]; - int32_t v0n=rb[pos_next]; -#ifndef FAST_AUDIO - v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS; -#endif - v0<<=16; - p_dest[i]=v0; - - } - if (C==2) { - - int32_t v0 = rb[(pos<<1)+0]; - int32_t v1 = rb[(pos<<1)+1]; - int32_t v0n=rb[(pos_next<<1)+0]; - int32_t v1n=rb[(pos_next<<1)+1]; - -#ifndef FAST_AUDIO - v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS; - v1+=(v1n-v1)*(int32_t)frac >> MIX_FRAC_BITS; -#endif - v0<<=16; - v1<<=16; - p_dest[(i<<1)+0]=v0; - p_dest[(i<<1)+1]=v1; - - } - - if (C==4) { - - int32_t v0 = rb[(pos<<2)+0]; - int32_t v1 = rb[(pos<<2)+1]; - int32_t v2 = rb[(pos<<2)+2]; - int32_t v3 = rb[(pos<<2)+3]; - int32_t v0n = rb[(pos_next<<2)+0]; - int32_t v1n=rb[(pos_next<<2)+1]; - int32_t v2n=rb[(pos_next<<2)+2]; - int32_t v3n=rb[(pos_next<<2)+3]; - -#ifndef FAST_AUDIO - v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS; - v1+=(v1n-v1)*(int32_t)frac >> MIX_FRAC_BITS; - v2+=(v2n-v2)*(int32_t)frac >> MIX_FRAC_BITS; - v3+=(v3n-v3)*(int32_t)frac >> MIX_FRAC_BITS; -#endif - v0<<=16; - v1<<=16; - v2<<=16; - v3<<=16; - p_dest[(i<<2)+0]=v0; - p_dest[(i<<2)+1]=v1; - p_dest[(i<<2)+2]=v2; - p_dest[(i<<2)+3]=v3; - - } - - if (C==6) { - - int32_t v0 = rb[(pos*6)+0]; - int32_t v1 = rb[(pos*6)+1]; - int32_t v2 = rb[(pos*6)+2]; - int32_t v3 = rb[(pos*6)+3]; - int32_t v4 = rb[(pos*6)+4]; - int32_t v5 = rb[(pos*6)+5]; - int32_t v0n = rb[(pos_next*6)+0]; - int32_t v1n=rb[(pos_next*6)+1]; - int32_t v2n=rb[(pos_next*6)+2]; - int32_t v3n=rb[(pos_next*6)+3]; - int32_t v4n=rb[(pos_next*6)+4]; - int32_t v5n=rb[(pos_next*6)+5]; - -#ifndef FAST_AUDIO - v0+=(v0n-v0)*(int32_t)frac >> MIX_FRAC_BITS; - v1+=(v1n-v1)*(int32_t)frac >> MIX_FRAC_BITS; - v2+=(v2n-v2)*(int32_t)frac >> MIX_FRAC_BITS; - v3+=(v3n-v3)*(int32_t)frac >> MIX_FRAC_BITS; - v4+=(v4n-v4)*(int32_t)frac >> MIX_FRAC_BITS; - v5+=(v5n-v5)*(int32_t)frac >> MIX_FRAC_BITS; -#endif - v0<<=16; - v1<<=16; - v2<<=16; - v3<<=16; - v4<<=16; - v5<<=16; - p_dest[(i*6)+0]=v0; - p_dest[(i*6)+1]=v1; - p_dest[(i*6)+2]=v2; - p_dest[(i*6)+3]=v3; - p_dest[(i*6)+4]=v4; - p_dest[(i*6)+5]=v5; - - } - - - } - - - return read>>MIX_FRAC_BITS;//rb_read_pos=offset>>MIX_FRAC_BITS; - -} - - -bool AudioStreamResampled::mix(int32_t *p_dest, int p_frames) { - - - if (!rb || !_can_mix()) - return false; - - int write_pos_cache=rb_write_pos; - - int32_t increment=(mix_rate*MIX_FRAC_LEN)/get_mix_rate(); - - int rb_todo; - - if (write_pos_cache==rb_read_pos) { - return false; //out of buffer - - } else if (rb_read_pos<write_pos_cache) { - - rb_todo=write_pos_cache-rb_read_pos; //-1? - } else { - - rb_todo=(rb_len-rb_read_pos)+write_pos_cache; //-1? - } - - int todo = MIN( ((int64_t(rb_todo)<<MIX_FRAC_BITS)/increment)+1, p_frames ); -#if 0 - if (int(mix_rate)==get_mix_rate()) { - - - if (channels==6) { - - for(int i=0;i<p_frames;i++) { - - int from = ((rb_read_pos+i)&rb_mask)*6; - int to = i*6; - - p_dest[from+0]=int32_t(rb[to+0])<<16; - p_dest[from+1]=int32_t(rb[to+1])<<16; - p_dest[from+2]=int32_t(rb[to+2])<<16; - p_dest[from+3]=int32_t(rb[to+3])<<16; - p_dest[from+4]=int32_t(rb[to+4])<<16; - p_dest[from+5]=int32_t(rb[to+5])<<16; - } - - } else { - int len=p_frames*channels; - int from=rb_read_pos*channels; - int mask=0; - switch(channels) { - case 1: mask=rb_len-1; break; - case 2: mask=(rb_len*2)-1; break; - case 4: mask=(rb_len*4)-1; break; - } - - for(int i=0;i<len;i++) { - - p_dest[i]=int32_t(rb[(from+i)&mask])<<16; - } - } - - rb_read_pos = (rb_read_pos+p_frames)&rb_mask; - } else -#endif - { - - uint32_t read=0; - switch(channels) { - case 1: read=_resample<1>(p_dest,todo,increment); break; - case 2: read=_resample<2>(p_dest,todo,increment); break; - case 4: read=_resample<4>(p_dest,todo,increment); break; - case 6: read=_resample<6>(p_dest,todo,increment); break; - } -#if 1 - //end of stream, fadeout - int remaining = p_frames-todo; - if (remaining && todo>0) { - - //print_line("fadeout"); - for(int c=0;c<channels;c++) { - - for(int i=0;i<todo;i++) { - - int32_t samp = p_dest[i*channels+c]>>8; - uint32_t mul = (todo-i) * 256 /todo; - //print_line("mul: "+itos(i)+" "+itos(mul)); - p_dest[i*channels+c]=samp*mul; - } - - } - - } - -#else - int remaining = p_frames-todo; - if (remaining && todo>0) { - - - for(int c=0;c<channels;c++) { - - int32_t from = p_dest[(todo-1)*channels+c]>>8; - - for(int i=0;i<remaining;i++) { - - uint32_t mul = (remaining-i) * 256 /remaining; - p_dest[(todo+i)*channels+c]=from*mul; - } - - } - - } -#endif - - //zero out what remains there to avoid glitches - for(int i=todo*channels;i<int(p_frames)*channels;i++) { - - p_dest[i]=0; - } - - if (read>rb_todo) - read=rb_todo; - - rb_read_pos = (rb_read_pos+read)&rb_mask; - - - - - } - - return true; -} - - -Error AudioStreamResampled::_setup(int p_channels,int p_mix_rate,int p_minbuff_needed) { - - ERR_FAIL_COND_V(p_channels!=1 && p_channels!=2 && p_channels!=4 && p_channels!=6,ERR_INVALID_PARAMETER); - - - float buffering_sec = int(GLOBAL_DEF("audio/stream_buffering_ms",500))/1000.0; - int desired_rb_bits =nearest_shift(MAX(buffering_sec*p_mix_rate,p_minbuff_needed)); - - bool recreate=!rb; - - if (rb && (uint32_t(desired_rb_bits)!=rb_bits || channels!=uint32_t(p_channels))) { - //recreate - - memdelete_arr(rb); - memdelete_arr(read_buf); - recreate=true; - - } - - if (recreate) { - - channels=p_channels; - rb_bits=desired_rb_bits; - rb_len=(1<<rb_bits); - rb_mask=rb_len-1; - rb = memnew_arr( int16_t, rb_len * p_channels ); - read_buf = memnew_arr( int16_t, rb_len * p_channels ); - - } - - mix_rate=p_mix_rate; - offset=0; - rb_read_pos=0; - rb_write_pos=0; - - //avoid maybe strange noises upon load - for (int i=0;i<(rb_len*channels);i++) { - - rb[i]=0; - read_buf[i]=0; - } - - return OK; - -} - -void AudioStreamResampled::_clear() { - - if (!rb) - return; - - AudioServer::get_singleton()->lock(); - //should be stopped at this point but just in case - if (rb) { - memdelete_arr(rb); - memdelete_arr(read_buf); - } - rb=NULL; - offset=0; - rb_read_pos=0; - rb_write_pos=0; - read_buf=NULL; - AudioServer::get_singleton()->unlock(); - -} - -AudioStreamResampled::AudioStreamResampled() { - - rb=NULL; - offset=0; - read_buf=NULL; - rb_read_pos=0; - rb_write_pos=0; - - rb_bits=0; - rb_len=0; - rb_mask=0; - read_buff_len=0; - channels=0; - mix_rate=0; - -} - -AudioStreamResampled::~AudioStreamResampled() { - - if (rb) { - memdelete_arr(rb); - memdelete_arr(read_buf); - } - -} - -#endif diff --git a/scene/resources/audio_stream_resampled.h b/scene/resources/audio_stream_resampled.h deleted file mode 100644 index 53fa3bd0b9..0000000000 --- a/scene/resources/audio_stream_resampled.h +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************/ -/* audio_stream_resampled.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef AUDIO_STREAM_RESAMPLED_H -#define AUDIO_STREAM_RESAMPLED_H - -//#include "scene/resources/audio_stream.h" - -#if 0 - -class AudioStreamResampled : public AudioStream { - GDCLASS(AudioStreamResampled,AudioStream); - - uint32_t rb_bits; - uint32_t rb_len; - uint32_t rb_mask; - uint32_t read_buff_len; - uint32_t channels; - uint32_t mix_rate; - - volatile int rb_read_pos; - volatile int rb_write_pos; - - int32_t offset; //contains the fractional remainder of the resampler - enum { - MIX_FRAC_BITS=13, - MIX_FRAC_LEN=(1<<MIX_FRAC_BITS), - MIX_FRAC_MASK=MIX_FRAC_LEN-1, - }; - - int16_t *read_buf; - int16_t *rb; - - - template<int C> - uint32_t _resample(int32_t *p_dest,int p_todo,int32_t p_increment); - - -protected: - - _FORCE_INLINE_ int get_total() const { - - return rb_len; - } - - _FORCE_INLINE_ int get_todo() const { //return amount of frames to mix - - int todo; - int read_pos_cache=rb_read_pos; - - if (read_pos_cache==rb_write_pos) { - todo=rb_len-1; - } else if (read_pos_cache>rb_write_pos) { - - todo=read_pos_cache-rb_write_pos-1; - } else { - - todo=(rb_len-rb_write_pos)+read_pos_cache-1; - } - - return todo; - } - - //Stream virtual funcs - virtual int get_channel_count() const; - virtual bool mix(int32_t *p_dest, int p_frames); - - _FORCE_INLINE_ void _flush() { - rb_read_pos=0; - rb_write_pos=0; - } - - _FORCE_INLINE_ int16_t *get_write_buffer() { return read_buf; } - _FORCE_INLINE_ void write(uint32_t p_frames) { - - ERR_FAIL_COND(p_frames >= rb_len); - - switch(channels) { - case 1: { - - for(uint32_t i=0;i<p_frames;i++) { - - rb[ rb_write_pos ] = read_buf[i]; - rb_write_pos=(rb_write_pos+1)&rb_mask; - } - } break; - case 2: { - - for(uint32_t i=0;i<p_frames;i++) { - - rb[ (rb_write_pos<<1)+0 ] = read_buf[(i<<1)+0]; - rb[ (rb_write_pos<<1)+1 ] = read_buf[(i<<1)+1]; - rb_write_pos=(rb_write_pos+1)&rb_mask; - } - } break; - case 4: { - - for(uint32_t i=0;i<p_frames;i++) { - - rb[ (rb_write_pos<<2)+0 ] = read_buf[(i<<2)+0]; - rb[ (rb_write_pos<<2)+1 ] = read_buf[(i<<2)+1]; - rb[ (rb_write_pos<<2)+2 ] = read_buf[(i<<2)+2]; - rb[ (rb_write_pos<<2)+3 ] = read_buf[(i<<2)+3]; - rb_write_pos=(rb_write_pos+1)&rb_mask; - } - } break; - case 6: { - - for(uint32_t i=0;i<p_frames;i++) { - - rb[ (rb_write_pos*6)+0 ] = read_buf[(i*6)+0]; - rb[ (rb_write_pos*6)+1 ] = read_buf[(i*6)+1]; - rb[ (rb_write_pos*6)+2 ] = read_buf[(i*6)+2]; - rb[ (rb_write_pos*6)+3 ] = read_buf[(i*6)+3]; - rb[ (rb_write_pos*6)+4 ] = read_buf[(i*6)+4]; - rb[ (rb_write_pos*6)+5 ] = read_buf[(i*6)+5]; - rb_write_pos=(rb_write_pos+1)&rb_mask; - } - } break; - - - } - - } - - virtual bool _can_mix() const =0; - - _FORCE_INLINE_ bool _is_ready() const{ - return rb!=NULL; - } - - Error _setup(int p_channels,int p_mix_rate,int p_minbuff_needed=-1); - void _clear(); - -public: - AudioStreamResampled(); - ~AudioStreamResampled(); -}; -#endif -#endif // AUDIO_STREAM_RESAMPLED_H diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index c8f6007e60..659322897a 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/audio_stream_sample.h b/scene/resources/audio_stream_sample.h index 680f037f15..6cb255fedf 100644 --- a/scene/resources/audio_stream_sample.h +++ b/scene/resources/audio_stream_sample.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index a473067937..be994e3b33 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/bit_mask.h b/scene/resources/bit_mask.h index 5ab7a3134d..72090f2ebe 100644 --- a/scene/resources/bit_mask.h +++ b/scene/resources/bit_mask.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/bounds.cpp b/scene/resources/bounds.cpp index b088426013..ee1e750c82 100644 --- a/scene/resources/bounds.cpp +++ b/scene/resources/bounds.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/bounds.h b/scene/resources/bounds.h index 8c0d1dcf6e..3378101836 100644 --- a/scene/resources/bounds.h +++ b/scene/resources/bounds.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index d5c25b718e..bbc85ce0f6 100644 --- a/scene/resources/box_shape.cpp +++ b/scene/resources/box_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/box_shape.h b/scene/resources/box_shape.h index fdf1e98020..8884c9b75a 100644 --- a/scene/resources/box_shape.h +++ b/scene/resources/box_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/canvas.cpp b/scene/resources/canvas.cpp index b6a909f3fa..f5bf0ad78e 100644 --- a/scene/resources/canvas.cpp +++ b/scene/resources/canvas.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/canvas.h b/scene/resources/canvas.h index 331a997914..b9977e11b9 100644 --- a/scene/resources/canvas.h +++ b/scene/resources/canvas.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp index 1fcc9da5b6..e11b98f82e 100644 --- a/scene/resources/capsule_shape.cpp +++ b/scene/resources/capsule_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/capsule_shape.h b/scene/resources/capsule_shape.h index 2864e7e23f..9b43823c83 100644 --- a/scene/resources/capsule_shape.h +++ b/scene/resources/capsule_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 20177692a1..56a09bc3bf 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/capsule_shape_2d.h b/scene/resources/capsule_shape_2d.h index 93e7d846a4..610f9a4cf9 100644 --- a/scene/resources/capsule_shape_2d.h +++ b/scene/resources/capsule_shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index 1b7e09ddfb..ecfc98ea60 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/circle_shape_2d.h b/scene/resources/circle_shape_2d.h index a4a4601e66..3ba5ec949c 100644 --- a/scene/resources/circle_shape_2d.h +++ b/scene/resources/circle_shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/color_ramp.cpp b/scene/resources/color_ramp.cpp index 68f707220f..9f6150ae63 100644 --- a/scene/resources/color_ramp.cpp +++ b/scene/resources/color_ramp.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/color_ramp.h b/scene/resources/color_ramp.h index d9f14205bb..816152d51f 100644 --- a/scene/resources/color_ramp.h +++ b/scene/resources/color_ramp.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index 47cc49c631..6ae4fde85e 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/concave_polygon_shape.h b/scene/resources/concave_polygon_shape.h index a8f9d50674..82e052fee7 100644 --- a/scene/resources/concave_polygon_shape.h +++ b/scene/resources/concave_polygon_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index b8c931421e..7f4abf7ae0 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/concave_polygon_shape_2d.h index d4c102e0d6..e766e88a4b 100644 --- a/scene/resources/concave_polygon_shape_2d.h +++ b/scene/resources/concave_polygon_shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index 10e92b43ae..bba52bd5ff 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/convex_polygon_shape.h b/scene/resources/convex_polygon_shape.h index 4340b0ef7c..e103f2d90c 100644 --- a/scene/resources/convex_polygon_shape.h +++ b/scene/resources/convex_polygon_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index e13f7faf70..7588909d90 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/convex_polygon_shape_2d.h b/scene/resources/convex_polygon_shape_2d.h index ba4a5ae8aa..3354199e05 100644 --- a/scene/resources/convex_polygon_shape_2d.h +++ b/scene/resources/convex_polygon_shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index fe0759fcba..7fbaa1f73c 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "curve.h" + #include "core_string_names.h" template <class T> @@ -42,344 +43,6 @@ static _FORCE_INLINE_ T _bezier_interp(real_t t, T start, T control_1, T control return start * omt3 + control_1 * omt2 * t * 3.0 + control_2 * omt * t2 * 3.0 + end * t3; } -#if 0 - -int Curve2D::get_point_count() const { - - return points.size(); -} -void Curve2D::add_point(const Vector2& p_pos, const Vector2& p_in, const Vector2& p_out) { - - Point n; - n.pos=p_pos; - n.in=p_in; - n.out=p_out; - points.push_back(n); - emit_signal(CoreStringNames::get_singleton()->changed); -} -void Curve2D::set_point_pos(int p_index, const Vector2& p_pos) { - - ERR_FAIL_INDEX(p_index,points.size()); - - points[p_index].pos=p_pos; - emit_signal(CoreStringNames::get_singleton()->changed); - -} -Vector2 Curve2D::get_point_pos(int p_index) const { - - ERR_FAIL_INDEX_V(p_index,points.size(),Vector2()); - return points[p_index].pos; - -} - - -void Curve2D::set_point_in(int p_index, const Vector2& p_in) { - - ERR_FAIL_INDEX(p_index,points.size()); - - points[p_index].in=p_in; - emit_signal(CoreStringNames::get_singleton()->changed); - -} -Vector2 Curve2D::get_point_in(int p_index) const { - - ERR_FAIL_INDEX_V(p_index,points.size(),Vector2()); - return points[p_index].in; - -} - -void Curve2D::set_point_out(int p_index, const Vector2& p_out) { - - ERR_FAIL_INDEX(p_index,points.size()); - - points[p_index].out=p_out; - emit_signal(CoreStringNames::get_singleton()->changed); -} - -Vector2 Curve2D::get_point_out(int p_index) const { - - ERR_FAIL_INDEX_V(p_index,points.size(),Vector2()); - return points[p_index].out; - -} - - -void Curve2D::remove_point(int p_index) { - - ERR_FAIL_INDEX(p_index,points.size()); - points.remove(p_index); - emit_signal(CoreStringNames::get_singleton()->changed); -} - -Vector2 Curve2D::interpolate(int p_index, float p_offset) const { - - int pc = points.size(); - ERR_FAIL_COND_V(pc==0,Vector2()); - - if (p_index >= pc-1) - return points[pc-1].pos; - else if (p_index<0) - return points[0].pos; - - Vector2 p0 = points[p_index].pos; - Vector2 p1 = p0+points[p_index].out; - Vector2 p3 = points[p_index+1].pos; - Vector2 p2 = p3+points[p_index+1].in; - - return _bezier_interp(p_offset,p0,p1,p2,p3); -} - -Vector2 Curve2D::interpolatef(real_t p_findex) const { - - - if (p_findex<0) - p_findex=0; - else if (p_findex>=points.size()) - p_findex=points.size(); - - return interpolate((int)p_findex,Math::fmod(p_findex,1.0)); - -} - -PoolVector<Point2> Curve2D::bake(int p_subdivs) const { - - int pc = points.size(); - - PoolVector<Point2> ret; - if (pc<2) - return ret; - - ret.resize((pc-1)*p_subdivs+1); - - PoolVector<Point2>::Write w = ret.write(); - const Point *r = points.ptr(); - - for(int i=0;i<pc;i++) { - - int ofs = pc*p_subdivs; - - int limit=(i==pc-1)?p_subdivs+1:p_subdivs; - - for(int j=0;j<limit;j++) { - - Vector2 p0 = r[i].pos; - Vector2 p1 = p0+r[i].out; - Vector2 p3 = r[i].pos; - Vector2 p2 = p3+r[i].in; - real_t t = j/(real_t)p_subdivs; - - w[ofs+j]=_bezier_interp(t,p0,p1,p2,p3); - - } - } - - w = PoolVector<Point2>::Write(); - - return ret; -} - -void Curve2D::advance(real_t p_distance,int &r_index, real_t &r_pos) const { - - int pc = points.size(); - ERR_FAIL_COND(pc<2); - if (r_index<0 || r_index>=(pc-1)) - return; - - Vector2 pos = interpolate(r_index,r_pos); - - float sign=p_distance<0 ? -1 : 1; - p_distance=Math::abs(p_distance); - - real_t base = r_index+r_pos; - real_t top = 0.1; //a tenth is in theory representative - int iterations=32; - - - - for(int i=0;i<iterations;i++) { - - - real_t o=base+top*sign; - if (sign>0 && o >=pc) { - top=pc-base; - break; - } else if (sign<0 && o <0) { - top=-base; - break; - } - - Vector2 new_d = interpolatef(o); - - if (new_d.distance_to(pos) > p_distance) - break; - top*=2.0; - } - - - real_t bottom = 0.0; - iterations=8; - real_t final_offset; - - - for(int i=0;i<iterations;i++) { - - real_t middle = (bottom+top)*0.5; - real_t o=base+middle*sign; - Vector2 new_d = interpolatef(o); - - if (new_d.distance_to(pos) > p_distance) { - bottom=middle; - } else { - top=middle; - } - final_offset=o; - } - - r_index=(int)final_offset; - r_pos=Math::fmod(final_offset,1.0); - -} - -void Curve2D::get_approx_position_from_offset(real_t p_offset,int &r_index, real_t &r_pos,int p_subdivs) const { - - ERR_FAIL_COND(points.size()<2); - - real_t accum=0; - - - - for(int i=0;i<points.size();i++) { - - Vector2 prev_p=interpolate(i,0); - - - for(int j=1;j<=p_subdivs;j++) { - - real_t frac = j/(real_t)p_subdivs; - Vector2 p = interpolate(i,frac); - real_t d = p.distance_to(prev_p); - - accum+=d; - if (accum>p_offset) { - - - r_index=j-1; - if (d>0) { - real_t mf = (p_offset-(accum-d)) / d; - r_pos=frac-(1.0-mf); - } else { - r_pos=frac; - } - - return; - } - - prev_p=p; - } - } - - r_index=points.size()-1; - r_pos=1.0; - - -} - -void Curve2D::set_points_in(const Vector2Array& p_points) { - - points.resize(p_points.size()); - for (int i=0; i<p_points.size(); i++) { - - Point p = points[i]; - p.in = p_points[i]; - points[i] = p; - }; -}; - -void Curve2D::set_points_out(const Vector2Array& p_points) { - - points.resize(p_points.size()); - for (int i=0; i<p_points.size(); i++) { - - Point p = points[i]; - p.out = p_points[i]; - points[i] = p; - }; -}; - -void Curve2D::set_points_pos(const Vector2Array& p_points) { - - points.resize(p_points.size()); - for (int i=0; i<p_points.size(); i++) { - - Point p = points[i]; - p.pos = p_points[i]; - points[i] = p; - }; -}; - -Vector2Array Curve2D::get_points_in() const { - Vector2Array ret; - ret.resize(points.size()); - for (int i=0; i<points.size(); i++) { - ret.set(i, points[i].in); - }; - return ret; -}; - -Vector2Array Curve2D::get_points_out() const { - Vector2Array ret; - ret.resize(points.size()); - for (int i=0; i<points.size(); i++) { - ret.set(i, points[i].out); - }; - return ret; -}; - -Vector2Array Curve2D::get_points_pos() const { - Vector2Array ret; - ret.resize(points.size()); - for (int i=0; i<points.size(); i++) { - ret.set(i, points[i].pos); - }; - return ret; -}; - - -void Curve2D::_bind_methods() { - - ClassDB::bind_method(D_METHOD("get_point_count"),&Curve2D::get_point_count); - ClassDB::bind_method(D_METHOD("add_point","pos","in","out"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2())); - ClassDB::bind_method(D_METHOD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); - ClassDB::bind_method(D_METHOD("get_point_pos","idx"),&Curve2D::get_point_pos); - ClassDB::bind_method(D_METHOD("set_point_in","idx","pos"),&Curve2D::set_point_in); - ClassDB::bind_method(D_METHOD("get_point_in","idx"),&Curve2D::get_point_in); - ClassDB::bind_method(D_METHOD("set_point_out","idx","pos"),&Curve2D::set_point_out); - ClassDB::bind_method(D_METHOD("get_point_out","idx"),&Curve2D::get_point_out); - ClassDB::bind_method(D_METHOD("remove_point","idx"),&Curve2D::remove_point); - ClassDB::bind_method(D_METHOD("interpolate","idx","t"),&Curve2D::interpolate); - ClassDB::bind_method(D_METHOD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); - - - ClassDB::bind_method(D_METHOD("set_points_in"),&Curve2D::set_points_in); - ClassDB::bind_method(D_METHOD("set_points_out"),&Curve2D::set_points_out); - ClassDB::bind_method(D_METHOD("set_points_pos"),&Curve2D::set_points_pos); - - ClassDB::bind_method(D_METHOD("get_points_in"),&Curve2D::get_points_in); - ClassDB::bind_method(D_METHOD("get_points_out"),&Curve2D::get_points_out); - ClassDB::bind_method(D_METHOD("get_points_pos"),&Curve2D::get_points_pos); - - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_in"), "set_points_in","get_points_in"); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_out"), "set_points_out","get_points_out"); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_pos"), "set_points_pos","get_points_pos"); -} - - -Curve2D::Curve2D() -{ -} - -#endif - const char *Curve::SIGNAL_RANGE_CHANGED = "range_changed"; Curve::Curve() { diff --git a/scene/resources/curve.h b/scene/resources/curve.h index e302f1e0af..3071aee5de 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -31,56 +31,6 @@ #define CURVE_H #include "resource.h" -#if 0 -class Curve2D : public Resource { - - GDCLASS(Curve2D,Resource); - - struct Point { - - Vector2 in; - Vector2 out; - Vector2 pos; - }; - - - Vector<Point> points; - -protected: - - static void _bind_methods(); - - void set_points_in(const Vector2Array& p_points_in); - void set_points_out(const Vector2Array& p_points_out); - void set_points_pos(const Vector2Array& p_points_pos); - - Vector2Array get_points_in() const; - Vector2Array get_points_out() const; - Vector2Array get_points_pos() const; - -public: - - - int get_point_count() const; - void add_point(const Vector2& p_pos, const Vector2& p_in=Vector2(), const Vector2& p_out=Vector2()); - void set_point_pos(int p_index, const Vector2& p_pos); - Vector2 get_point_pos(int p_index) const; - void set_point_in(int p_index, const Vector2& p_in); - Vector2 get_point_in(int p_index) const; - void set_point_out(int p_index, const Vector2& p_out); - Vector2 get_point_out(int p_index) const; - void remove_point(int p_index); - - Vector2 interpolate(int p_index, float p_offset) const; - Vector2 interpolatef(real_t p_findex) const; - PoolVector<Point2> bake(int p_subdivs=10) const; - void advance(real_t p_distance,int &r_index, real_t &r_pos) const; - void get_approx_position_from_offset(real_t p_offset,int &r_index, real_t &r_pos,int p_subdivs=16) const; - - Curve2D(); -}; - -#endif // y(x) curve class Curve : public Resource { diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 03288e45bf..08de33175a 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/default_theme/default_theme.h b/scene/resources/default_theme/default_theme.h index 6fd57b6f22..9032b71775 100644 --- a/scene/resources/default_theme/default_theme.h +++ b/scene/resources/default_theme/default_theme.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 57b860583e..82739b58a0 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h index b8ff2845e7..52c3f30590 100644 --- a/scene/resources/dynamic_font.h +++ b/scene/resources/dynamic_font.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index fa8cf4723b..91263fb125 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/dynamic_font_stb.h b/scene/resources/dynamic_font_stb.h index a2c081a925..24d764e716 100644 --- a/scene/resources/dynamic_font_stb.h +++ b/scene/resources/dynamic_font_stb.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 60a700aad8..7de2c85633 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/environment.h b/scene/resources/environment.h index 3a6906aa27..6337981b95 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 035e514eac..d9ccd31f88 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/font.h b/scene/resources/font.h index a04ffbdd4b..3bb7aeac85 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index f01d9f841b..77563121df 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/material.h b/scene/resources/material.h index 140b2142c9..b82e8d8cbd 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index ebba0ba67f..aa7827a61a 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -1035,6 +1035,7 @@ void ArrayMesh::_bind_methods() { BIND_ENUM_CONSTANT(ARRAY_BONES); BIND_ENUM_CONSTANT(ARRAY_WEIGHTS); BIND_ENUM_CONSTANT(ARRAY_INDEX); + BIND_ENUM_CONSTANT(ARRAY_MAX); BIND_ENUM_CONSTANT(ARRAY_FORMAT_VERTEX); BIND_ENUM_CONSTANT(ARRAY_FORMAT_NORMAL); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index bccb39e8cd..53c6eb2d89 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index f1092a90cb..116ddc4ac6 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/mesh_data_tool.h b/scene/resources/mesh_data_tool.h index ad771edbd1..119b49161b 100644 --- a/scene/resources/mesh_data_tool.h +++ b/scene/resources/mesh_data_tool.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index 7d51a2617e..4e1ffd2ab3 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -43,9 +43,15 @@ bool MeshLibrary::_set(const StringName &p_name, const Variant &p_value) { set_item_name(idx, p_value); else if (what == "mesh") set_item_mesh(idx, p_value); - else if (what == "shape") - set_item_shape(idx, p_value); - else if (what == "preview") + else if (what == "shape") { + Vector<ShapeData> shapes; + ShapeData sd; + sd.shape = p_value; + shapes.push_back(sd); + set_item_shapes(idx, shapes); + } else if (what == "shapes") { + _set_item_shapes(idx, p_value); + } else if (what == "preview") set_item_preview(idx, p_value); else if (what == "navmesh") set_item_navmesh(idx, p_value); @@ -69,8 +75,8 @@ bool MeshLibrary::_get(const StringName &p_name, Variant &r_ret) const { r_ret = get_item_name(idx); else if (what == "mesh") r_ret = get_item_mesh(idx); - else if (what == "shape") - r_ret = get_item_shape(idx); + else if (what == "shapes") + r_ret = _get_item_shapes(idx); else if (what == "navmesh") r_ret = get_item_navmesh(idx); else if (what == "preview") @@ -88,7 +94,7 @@ void MeshLibrary::_get_property_list(List<PropertyInfo> *p_list) const { String name = "item/" + itos(E->key()) + "/"; p_list->push_back(PropertyInfo(Variant::STRING, name + "name")); p_list->push_back(PropertyInfo(Variant::OBJECT, name + "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh")); - p_list->push_back(PropertyInfo(Variant::OBJECT, name + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape")); + p_list->push_back(PropertyInfo(Variant::ARRAY, name + "shapes")); p_list->push_back(PropertyInfo(Variant::OBJECT, name + "navmesh", PROPERTY_HINT_RESOURCE_TYPE, "NavigationMesh")); p_list->push_back(PropertyInfo(Variant::OBJECT, name + "preview", PROPERTY_HINT_RESOURCE_TYPE, "Texture", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_EDITOR_HELPER)); } @@ -118,10 +124,10 @@ void MeshLibrary::set_item_mesh(int p_item, const Ref<Mesh> &p_mesh) { _change_notify(); } -void MeshLibrary::set_item_shape(int p_item, const Ref<Shape> &p_shape) { +void MeshLibrary::set_item_shapes(int p_item, const Vector<ShapeData> &p_shapes) { ERR_FAIL_COND(!item_map.has(p_item)); - item_map[p_item].shape = p_shape; + item_map[p_item].shapes = p_shapes; _change_notify(); notify_change_to_owners(); emit_changed(); @@ -156,10 +162,10 @@ Ref<Mesh> MeshLibrary::get_item_mesh(int p_item) const { return item_map[p_item].mesh; } -Ref<Shape> MeshLibrary::get_item_shape(int p_item) const { +Vector<MeshLibrary::ShapeData> MeshLibrary::get_item_shapes(int p_item) const { - ERR_FAIL_COND_V(!item_map.has(p_item), Ref<Shape>()); - return item_map[p_item].shape; + ERR_FAIL_COND_V(!item_map.has(p_item), Vector<ShapeData>()); + return item_map[p_item].shapes; } Ref<NavigationMesh> MeshLibrary::get_item_navmesh(int p_item) const { @@ -226,17 +232,48 @@ int MeshLibrary::get_last_unused_item_id() const { return item_map.back()->key() + 1; } +void MeshLibrary::_set_item_shapes(int p_item, const Array &p_shapes) { + + ERR_FAIL_COND(p_shapes.size() & 1); + Vector<ShapeData> shapes; + for (int i = 0; i < p_shapes.size(); i += 2) { + ShapeData sd; + sd.shape = p_shapes[i + 0]; + sd.local_transform = p_shapes[i + 1]; + + if (sd.shape.is_valid()) { + shapes.push_back(sd); + } + } + + set_item_shapes(p_item, shapes); +} + +Array MeshLibrary::_get_item_shapes(int p_item) const { + + Vector<ShapeData> shapes = get_item_shapes(p_item); + Array ret; + for (int i = 0; i < shapes.size(); i++) { + ret.push_back(shapes[i].shape); + ret.push_back(shapes[i].local_transform); + } + + return ret; +} + void MeshLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("create_item", "id"), &MeshLibrary::create_item); ClassDB::bind_method(D_METHOD("set_item_name", "id", "name"), &MeshLibrary::set_item_name); ClassDB::bind_method(D_METHOD("set_item_mesh", "id", "mesh"), &MeshLibrary::set_item_mesh); ClassDB::bind_method(D_METHOD("set_item_navmesh", "id", "navmesh"), &MeshLibrary::set_item_navmesh); - ClassDB::bind_method(D_METHOD("set_item_shape", "id", "shape"), &MeshLibrary::set_item_shape); + ClassDB::bind_method(D_METHOD("set_item_shapes", "id", "shapes"), &MeshLibrary::_set_item_shapes); + ClassDB::bind_method(D_METHOD("set_item_preview", "id", "texture"), &MeshLibrary::set_item_preview); ClassDB::bind_method(D_METHOD("get_item_name", "id"), &MeshLibrary::get_item_name); ClassDB::bind_method(D_METHOD("get_item_mesh", "id"), &MeshLibrary::get_item_mesh); ClassDB::bind_method(D_METHOD("get_item_navmesh", "id"), &MeshLibrary::get_item_navmesh); - ClassDB::bind_method(D_METHOD("get_item_shape", "id"), &MeshLibrary::get_item_shape); + ClassDB::bind_method(D_METHOD("get_item_shapes", "id"), &MeshLibrary::_get_item_shapes); + ClassDB::bind_method(D_METHOD("get_item_preview", "id"), &MeshLibrary::get_item_preview); ClassDB::bind_method(D_METHOD("remove_item", "id"), &MeshLibrary::remove_item); ClassDB::bind_method(D_METHOD("clear"), &MeshLibrary::clear); ClassDB::bind_method(D_METHOD("get_item_list"), &MeshLibrary::get_item_list); diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h index cc39110a99..99b6b48d61 100644 --- a/scene/resources/mesh_library.h +++ b/scene/resources/mesh_library.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -41,16 +41,24 @@ class MeshLibrary : public Resource { GDCLASS(MeshLibrary, Resource); RES_BASE_EXTENSION("meshlib"); +public: + struct ShapeData { + Ref<Shape> shape; + Transform local_transform; + }; struct Item { String name; Ref<Mesh> mesh; - Ref<Shape> shape; + Vector<ShapeData> shapes; Ref<Texture> preview; Ref<NavigationMesh> navmesh; }; Map<int, Item> item_map; + void _set_item_shapes(int p_item, const Array &p_shapes); + Array _get_item_shapes(int p_item) const; + protected: bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; @@ -63,12 +71,12 @@ public: void set_item_name(int p_item, const String &p_name); void set_item_mesh(int p_item, const Ref<Mesh> &p_mesh); void set_item_navmesh(int p_item, const Ref<NavigationMesh> &p_navmesh); - void set_item_shape(int p_item, const Ref<Shape> &p_shape); + void set_item_shapes(int p_item, const Vector<ShapeData> &p_shapes); void set_item_preview(int p_item, const Ref<Texture> &p_preview); String get_item_name(int p_item) const; Ref<Mesh> get_item_mesh(int p_item) const; Ref<NavigationMesh> get_item_navmesh(int p_item) const; - Ref<Shape> get_item_shape(int p_item) const; + Vector<ShapeData> get_item_shapes(int p_item) const; Ref<Texture> get_item_preview(int p_item) const; void remove_item(int p_item); diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index b65800ebbd..15f1e15542 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h index 7d6a0ce44f..7ca66b0b46 100644 --- a/scene/resources/multimesh.h +++ b/scene/resources/multimesh.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 3ce44e2c31..19fab5d587 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "packed_scene.h" + #include "core/core_string_names.h" #include "io/resource_loader.h" #include "project_settings.h" @@ -35,6 +36,7 @@ #include "scene/3d/spatial.h" #include "scene/gui/control.h" #include "scene/main/instance_placeholder.h" + #define PACK_VERSION 2 bool SceneState::can_instance() const { @@ -451,60 +453,6 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map } } -#if 0 - - Ref<SceneState> base_scene = p_node->get_scene_inherited_state(); //for inheritance - Ref<SceneState> instance_state; - int instance_state_node=-1; - - if (base_scene.is_valid() && (p_node==p_owner || p_node->get_owner()==p_owner)) { - //scene inheritance in use, see if this node is actually inherited - NodePath path = p_owner->get_path_to(p_node); - instance_state_node = base_scene->find_node_by_path(path); - if (instance_state_node>=0) { - instance_state=base_scene; - } - } - - // check that this is a directly instanced scene from the scene being packed, if so - // this information must be saved. Of course, if using scene instancing and this node - // does belong to base scene, ignore. - - if (instance_state.is_null() && p_node!=p_owner && p_node->get_owner()==p_owner && p_node->get_filename()!="") { - - //instanced, only direct sub-scnes are supported of course - Ref<PackedScene> instance = ResourceLoader::load(p_node->get_filename()); - if (!instance.is_valid()) { - return ERR_CANT_OPEN; - } - - nd.instance=_vm_get_variant(instance,variant_map); - - } else { - - nd.instance=-1; - } - - // finally, if this does not belong to scene inheritance, check - // if it belongs to scene instancing - - if (instance_state.is_null() && p_node!=p_owner) { - //if not affected by scene inheritance, this may be - if (p_node->get_owner()==p_owner && p_node->get_filename()!=String()) { - instance_state=p_node->get_scene_instance_state(); - if (instance_state.is_valid()) { - instance_state_node=instance_state->find_node_by_path(p_node->get_path_to(p_node)); - } - - } else if (p_node->get_owner()!=p_owner && p_owner->is_editable_instance(p_node->get_owner())) { - instance_state=p_node->get_owner()->get_scene_instance_state(); - if (instance_state.is_valid()) { - instance_state_node=instance_state->find_node_by_path(p_node->get_owner()->get_path_to(p_node)); - } - } - } -#endif - // all setup, we then proceed to check all properties for the node // and save the ones that are worth saving @@ -641,27 +589,6 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map } else { nd.owner = -1; -#if 0 - // this is pointless, if this was instanced by something else, - // the owner will already be set. - - if (node_map.has(p_node->get_owner())) { - //maybe an existing saved node - nd.owner=node_map[p_node->get_owner()]; - } else { - //not saved, use nodepath map - int sidx; - if (nodepath_map.has(p_node->get_owner())) { - sidx=nodepath_map[p_node->get_owner()]; - } else { - sidx=nodepath_map.size(); - nodepath_map[p_node->get_owner()]=sidx; - } - - nd.owner=FLAG_ID_IS_PATH|sidx; - - } -#endif } // Save the right type. If this node was created by an instance diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 2f18f5c263..20bfb19b1f 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp index d3ad454afc..2b1e890a5d 100644 --- a/scene/resources/plane_shape.cpp +++ b/scene/resources/plane_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/plane_shape.h b/scene/resources/plane_shape.h index 2ed297a97e..1384b7521b 100644 --- a/scene/resources/plane_shape.h +++ b/scene/resources/plane_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp index 80b413630a..053369e8d8 100644 --- a/scene/resources/polygon_path_finder.cpp +++ b/scene/resources/polygon_path_finder.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/polygon_path_finder.h b/scene/resources/polygon_path_finder.h index 2d2fb1678e..9b760caa2e 100644 --- a/scene/resources/polygon_path_finder.h +++ b/scene/resources/polygon_path_finder.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 2b8c0ddedd..cfc1468533 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index bcd5d30dd3..34fb75a196 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index 3abb2a4fa1..ccce7660c6 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/ray_shape.h b/scene/resources/ray_shape.h index 5a17e9414e..06b68adbae 100644 --- a/scene/resources/ray_shape.h +++ b/scene/resources/ray_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index bd9ec8cbc4..507dbce861 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/rectangle_shape_2d.h index 23db58ba07..81d9cb1f4a 100644 --- a/scene/resources/rectangle_shape_2d.h +++ b/scene/resources/rectangle_shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp index de238ebcc0..487975dd4e 100644 --- a/scene/resources/room.cpp +++ b/scene/resources/room.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -30,6 +30,8 @@ #include "room.h" #include "servers/visual_server.h" + +// FIXME: Left for reference for reimplementation using Area #if 0 RID RoomBounds::get_rid() const { diff --git a/scene/resources/room.h b/scene/resources/room.h index 4b8c837458..aadee858c2 100644 --- a/scene/resources/room.h +++ b/scene/resources/room.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 0cccdc4fbf..fea5c11dec 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h index 1ea6465c21..193bcf7112 100644 --- a/scene/resources/scene_format_text.h +++ b/scene/resources/scene_format_text.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 99062d693b..1171db5c02 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/segment_shape_2d.h b/scene/resources/segment_shape_2d.h index 22fc1ab6e3..eb9c228c83 100644 --- a/scene/resources/segment_shape_2d.h +++ b/scene/resources/segment_shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index acd04a9321..ec41630258 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shader.h b/scene/resources/shader.h index 0e8e48d82e..5cc70629c7 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index ed63e84d4c..2ca9a14562 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,8 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "shader_graph.h" + #include "scene/scene_string_names.h" +// FIXME: Needs to be ported to the new 3.0 shader API #if 0 Array ShaderGraph::_get_node_list(ShaderType p_type) const { @@ -397,79 +399,6 @@ void ShaderGraph::_bind_methods() { BIND_ENUM_CONSTANT( VEC_MAX_FUNC ); ADD_SIGNAL(MethodInfo("updated")); - -#if 0 - ClassDB::bind_method(D_METHOD("node_add"),&ShaderGraph::node_add ); - ClassDB::bind_method(D_METHOD("node_remove"),&ShaderGraph::node_remove ); - ClassDB::bind_method(D_METHOD("node_set_param"),&ShaderGraph::node_set_param ); - ClassDB::bind_method(D_METHOD("node_set_pos"),&ShaderGraph::node_set_pos ); - - ClassDB::bind_method(D_METHOD("node_get_pos"),&ShaderGraph::node_get_pos ); - ClassDB::bind_method(D_METHOD("node_get_param"),&ShaderGraph::node_get_param); - ClassDB::bind_method(D_METHOD("node_get_type"),&ShaderGraph::node_get_type); - - ClassDB::bind_method(D_METHOD("connect"),&ShaderGraph::connect ); - ClassDB::bind_method(D_METHOD("disconnect"),&ShaderGraph::disconnect ); - - ClassDB::bind_method(D_METHOD("get_connections"),&ShaderGraph::_get_connections_helper ); - - ClassDB::bind_method(D_METHOD("clear"),&ShaderGraph::clear ); - - BIND_ENUM_CONSTANT( NODE_IN ); ///< param 0: name - BIND_ENUM_CONSTANT( NODE_OUT ); ///< param 0: name - BIND_ENUM_CONSTANT( NODE_CONSTANT ); ///< param 0: value - BIND_ENUM_CONSTANT( NODE_PARAMETER ); ///< param 0: name - BIND_ENUM_CONSTANT( NODE_ADD ); - BIND_ENUM_CONSTANT( NODE_SUB ); - BIND_ENUM_CONSTANT( NODE_MUL ); - BIND_ENUM_CONSTANT( NODE_DIV ); - BIND_ENUM_CONSTANT( NODE_MOD ); - BIND_ENUM_CONSTANT( NODE_SIN ); - BIND_ENUM_CONSTANT( NODE_COS ); - BIND_ENUM_CONSTANT( NODE_TAN ); - BIND_ENUM_CONSTANT( NODE_ARCSIN ); - BIND_ENUM_CONSTANT( NODE_ARCCOS ); - BIND_ENUM_CONSTANT( NODE_ARCTAN ); - BIND_ENUM_CONSTANT( NODE_POW ); - BIND_ENUM_CONSTANT( NODE_LOG ); - BIND_ENUM_CONSTANT( NODE_MAX ); - BIND_ENUM_CONSTANT( NODE_MIN ); - BIND_ENUM_CONSTANT( NODE_COMPARE ); - BIND_ENUM_CONSTANT( NODE_TEXTURE ); ///< param 0: texture - BIND_ENUM_CONSTANT( NODE_TIME ); ///< param 0: interval length - BIND_ENUM_CONSTANT( NODE_NOISE ); - BIND_ENUM_CONSTANT( NODE_PASS ); - BIND_ENUM_CONSTANT( NODE_VEC_IN ); ///< param 0: name - BIND_ENUM_CONSTANT( NODE_VEC_OUT ); ///< param 0: name - BIND_ENUM_CONSTANT( NODE_VEC_CONSTANT ); ///< param 0: value - BIND_ENUM_CONSTANT( NODE_VEC_PARAMETER ); ///< param 0: name - BIND_ENUM_CONSTANT( NODE_VEC_ADD ); - BIND_ENUM_CONSTANT( NODE_VEC_SUB ); - BIND_ENUM_CONSTANT( NODE_VEC_MUL ); - BIND_ENUM_CONSTANT( NODE_VEC_DIV ); - BIND_ENUM_CONSTANT( NODE_VEC_MOD ); - BIND_ENUM_CONSTANT( NODE_VEC_CROSS ); - BIND_ENUM_CONSTANT( NODE_VEC_DOT ); - BIND_ENUM_CONSTANT( NODE_VEC_POW ); - BIND_ENUM_CONSTANT( NODE_VEC_NORMALIZE ); - BIND_ENUM_CONSTANT( NODE_VEC_TRANSFORM3 ); - BIND_ENUM_CONSTANT( NODE_VEC_TRANSFORM4 ); - BIND_ENUM_CONSTANT( NODE_VEC_COMPARE ); - BIND_ENUM_CONSTANT( NODE_VEC_TEXTURE_2D ); - BIND_ENUM_CONSTANT( NODE_VEC_TEXTURE_CUBE ); - BIND_ENUM_CONSTANT( NODE_VEC_NOISE ); - BIND_ENUM_CONSTANT( NODE_VEC_0 ); - BIND_ENUM_CONSTANT( NODE_VEC_1 ); - BIND_ENUM_CONSTANT( NODE_VEC_2 ); - BIND_ENUM_CONSTANT( NODE_VEC_BUILD ); - BIND_ENUM_CONSTANT( NODE_VEC_PASS ); - BIND_ENUM_CONSTANT( NODE_COLOR_CONSTANT ); - BIND_ENUM_CONSTANT( NODE_COLOR_PARAMETER ); - BIND_ENUM_CONSTANT( NODE_TEXTURE_PARAMETER ); - BIND_ENUM_CONSTANT( NODE_TEXTURE_2D_PARAMETER ); - BIND_ENUM_CONSTANT( NODE_TEXTURE_CUBE_PARAMETER ); - BIND_ENUM_CONSTANT( NODE_TYPE_MAX ); -#endif } diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index 36578ce1f7..9a74b6c53a 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -30,6 +30,7 @@ #ifndef SHADER_GRAPH_H #define SHADER_GRAPH_H +// FIXME: Needs to be ported to the new 3.0 shader API #if 0 #include "map.h" #include "scene/resources/shader.h" diff --git a/scene/resources/shape.cpp b/scene/resources/shape.cpp index d719aa5403..0046ff58a8 100644 --- a/scene/resources/shape.cpp +++ b/scene/resources/shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shape.h b/scene/resources/shape.h index c15638aeed..bc75e723e9 100644 --- a/scene/resources/shape.h +++ b/scene/resources/shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 818c749e8c..4423c78bbe 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shape_2d.h b/scene/resources/shape_2d.h index c020fb9141..fffc7011f1 100644 --- a/scene/resources/shape_2d.h +++ b/scene/resources/shape_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index c38ae04eff..4dcc5ac981 100644 --- a/scene/resources/shape_line_2d.cpp +++ b/scene/resources/shape_line_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/shape_line_2d.h b/scene/resources/shape_line_2d.h index 3e59bbc687..68298b63be 100644 --- a/scene/resources/shape_line_2d.h +++ b/scene/resources/shape_line_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp index b7f2feb58d..9af8c42110 100644 --- a/scene/resources/sky_box.cpp +++ b/scene/resources/sky_box.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/sky_box.h b/scene/resources/sky_box.h index 9bd60cddaf..8934463b6f 100644 --- a/scene/resources/sky_box.h +++ b/scene/resources/sky_box.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/space_2d.cpp b/scene/resources/space_2d.cpp index 2a618bb868..4177364de7 100644 --- a/scene/resources/space_2d.cpp +++ b/scene/resources/space_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/space_2d.h b/scene/resources/space_2d.h index 3e08612d99..8ba392f85d 100644 --- a/scene/resources/space_2d.h +++ b/scene/resources/space_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index 960554562f..00203c2b4b 100644 --- a/scene/resources/sphere_shape.cpp +++ b/scene/resources/sphere_shape.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/sphere_shape.h b/scene/resources/sphere_shape.h index a3b5d2424b..43d7956246 100644 --- a/scene/resources/sphere_shape.h +++ b/scene/resources/sphere_shape.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 7b2a9ffbc2..f646e3667d 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index 30eb9543e8..db41333b7e 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 9320676016..7342164841 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h index fcc94753ca..2a90c2743d 100644 --- a/scene/resources/surface_tool.h +++ b/scene/resources/surface_tool.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index f542d2a8de..9751d6e711 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 6c20c71af0..207436e4a7 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index c2c7c37762..e2e29b037b 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/theme.h b/scene/resources/theme.h index 5744c142d4..5b375d5585 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 44fe676ddc..50e8c28c22 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 7d7855811f..fe782ff987 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp index 1b0e34b8db..2298e2ca9f 100644 --- a/scene/resources/video_stream.cpp +++ b/scene/resources/video_stream.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index 544973f581..e08be02a07 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -30,7 +30,6 @@ #ifndef VIDEO_STREAM_H #define VIDEO_STREAM_H -#include "audio_stream_resampled.h" #include "scene/resources/texture.h" class VideoStreamPlayback : public Resource { diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index b0d14125a0..af159975ca 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,10 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "world.h" + #include "camera_matrix.h" #include "octree.h" #include "scene/3d/camera.h" -#include "scene/3d/spatial_indexer.h" #include "scene/3d/visibility_notifier.h" #include "scene/scene_string_names.h" diff --git a/scene/resources/world.h b/scene/resources/world.h index 158086974c..767d1b5b6e 100644 --- a/scene/resources/world.h +++ b/scene/resources/world.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 2f43f903ba..a644793bd8 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h index f968b08a15..63d32473e0 100644 --- a/scene/resources/world_2d.h +++ b/scene/resources/world_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index f247e7cde8..6b7168a529 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 0b70cd36ff..8676b8436e 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ |