diff options
Diffstat (limited to 'scene')
355 files changed, 1271 insertions, 1335 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 458246671c..1ed508aed3 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index 425f516b14..da4f1b99af 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 5038752b22..50a115174d 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -383,7 +383,11 @@ void Area2D::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame, this should not be an error + continue; + //ERR_CONTINUE(!node); + if (!E->get().in_tree) continue; @@ -416,13 +420,13 @@ void Area2D::_notification(int p_what) { void Area2D::set_enable_monitoring(bool p_enable) { - if (locked) { - ERR_EXPLAIN("This function can't be used during the in/out signal."); - } - ERR_FAIL_COND(locked); if (p_enable==monitoring) return; + if (locked) { + ERR_EXPLAIN("Function blocked during in/out signal. Use call_deferred(\"set_enable_monitoring\",true/false)"); + } + ERR_FAIL_COND(locked); monitoring=p_enable; diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index 2b74655109..7f3f9c93cf 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index b7b99f935a..67c1733759 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -503,7 +503,7 @@ void Camera2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_camera_pos"),&Camera2D::get_camera_pos); ObjectTypeDB::bind_method(_MD("get_camera_screen_center"),&Camera2D::get_camera_screen_center); - ObjectTypeDB::bind_method(_MD("set_zoom"),&Camera2D::set_zoom); + ObjectTypeDB::bind_method(_MD("set_zoom","zoom"),&Camera2D::set_zoom); ObjectTypeDB::bind_method(_MD("get_zoom"),&Camera2D::get_zoom); diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index dcf98d4295..3c51bbf220 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 275e4d0304..35b453d71d 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -389,8 +389,8 @@ Matrix32 CanvasItem::get_global_transform_with_canvas() const { if (last_valid->canvas_layer) return last_valid->canvas_layer->get_transform() * xform; - else - return xform; + else if (is_inside_tree()) + return get_viewport()->get_canvas_transform() * xform; } Matrix32 CanvasItem::get_global_transform() const { @@ -548,6 +548,7 @@ void CanvasItem::_notification(int p_what) { get_parent()->cast_to<CanvasItem>()->children_items.erase(C); C=NULL; } + global_invalid=true; } break; case NOTIFICATION_DRAW: { @@ -773,7 +774,7 @@ void CanvasItem::draw_set_transform(const Point2& p_offset, float p_rot, const S Matrix32 xform(p_rot,p_offset); xform.scale_basis(p_scale); - VisualServer::get_singleton()->canvas_item_set_transform(canvas_item,xform); + VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item,xform); } void CanvasItem::draw_polygon(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, Ref<Texture> p_texture) { @@ -1080,7 +1081,7 @@ void CanvasItem::_bind_methods() { ObjectTypeDB::bind_method(_MD("draw_line","from","to","color","width"),&CanvasItem::draw_line,DEFVAL(1.0)); ObjectTypeDB::bind_method(_MD("draw_rect","rect","color"),&CanvasItem::draw_rect); ObjectTypeDB::bind_method(_MD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle); - ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos"),&CanvasItem::draw_texture); + ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1))); ObjectTypeDB::bind_method(_MD("draw_texture_rect","texture:Texture","rect","tile","modulate","transpose"),&CanvasItem::draw_texture_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("draw_texture_rect_region","texture:Texture","rect","src_rect","modulate","transpose"),&CanvasItem::draw_texture_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box); diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index 4c0386b953..5d10523261 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -197,7 +197,7 @@ public: void set_blend_mode(BlendMode p_blend_mode); BlendMode get_blend_mode() const; - void set_light_mask(int p_light_mask); + virtual void set_light_mask(int p_light_mask); int get_light_mask() const; void set_opacity(float p_opacity); diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index 82dd8012a5..77203a7110 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -5,10 +5,19 @@ void CanvasModulate::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_CANVAS) { - VS::get_singleton()->canvas_set_modulate(get_canvas(),color); + if (is_visible()) + VS::get_singleton()->canvas_set_modulate(get_canvas(),color); } else if (p_what==NOTIFICATION_EXIT_CANVAS) { - VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + if (is_visible()) + VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + } else if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + if (is_visible()) { + VS::get_singleton()->canvas_set_modulate(get_canvas(),color); + } else { + VS::get_singleton()->canvas_set_modulate(get_canvas(),Color(1,1,1,1)); + } } } diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 8b8caf13d3..9b0c24ffd6 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 473f13d0ff..fc50c5c7cd 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 616d3da7c9..2a40a6207d 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,7 +30,7 @@ #include "collision_object_2d.h" #include "scene/resources/concave_polygon_shape_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" - +#include "triangulator.h" void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) { if (unparenting || !can_update_body) @@ -48,7 +48,7 @@ void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) { //here comes the sun, lalalala //decompose concave into multiple convex polygons and add them - Vector< Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon); + Vector< Vector<Vector2> > decomp = _decompose_in_convex(); shape_from=co->get_shape_count(); for(int i=0;i<decomp.size();i++) { Ref<ConvexPolygonShape2D> convex = memnew( ConvexPolygonShape2D ); @@ -106,6 +106,51 @@ void CollisionPolygon2D::_update_parent() { co->_update_shapes_from_children(); } +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; + inp.Init(polygon.size()); + for(int i=0;i<polygon.size();i++) { + inp.GetPoint(i)=polygon[i]; + } + inp.SetOrientation(TRIANGULATOR_CCW); + in_poly.push_back(inp); + TriangulatorPartition tpart; + if (tpart.ConvexPartition_HM(&in_poly,&out_poly)==0) { //failed! + ERR_PRINT("Convex decomposing failed!"); + return decomp; + } + + decomp.resize(out_poly.size()); + int idx=0; + + for(List<TriangulatorPoly>::Element*I = out_poly.front();I;I=I->next()) { + + TriangulatorPoly& tp = I->get(); + + decomp[idx].resize(tp.GetNumPoints()); + + for(int i=0;i<tp.GetNumPoints();i++) { + + decomp[idx][i]=tp.GetPoint(i); + } + + idx++; + } + +#endif + + return decomp; +} + void CollisionPolygon2D::_notification(int p_what) { @@ -152,10 +197,11 @@ void CollisionPolygon2D::_notification(int p_what) { Vector2 n = polygon[(i+1)%polygon.size()]; draw_line(p,n,Color(0.9,0.2,0.0,0.8),3); } -//#define DEBUG_DECOMPOSE +#define DEBUG_DECOMPOSE #if defined(TOOLS_ENABLED) && defined (DEBUG_DECOMPOSE) - Vector< Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon); + Vector< Vector<Vector2> > decomp = _decompose_in_convex(); + Color c(0.4,0.9,0.1); for(int i=0;i<decomp.size();i++) { @@ -257,10 +303,10 @@ void CollisionPolygon2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon2D::set_polygon); ObjectTypeDB::bind_method(_MD("get_polygon"),&CollisionPolygon2D::get_polygon); - ObjectTypeDB::bind_method(_MD("set_build_mode"),&CollisionPolygon2D::set_build_mode); + ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon2D::set_build_mode); ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon2D::get_build_mode); - ObjectTypeDB::bind_method(_MD("set_trigger"),&CollisionPolygon2D::set_trigger); + ObjectTypeDB::bind_method(_MD("set_trigger","trigger"),&CollisionPolygon2D::set_trigger); ObjectTypeDB::bind_method(_MD("is_trigger"),&CollisionPolygon2D::is_trigger); ObjectTypeDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon2D::_set_shape_range); diff --git a/scene/2d/collision_polygon_2d.h b/scene/2d/collision_polygon_2d.h index 4bc9713c8a..b2bd4d189d 100644 --- a/scene/2d/collision_polygon_2d.h +++ b/scene/2d/collision_polygon_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,6 +63,7 @@ protected: void _set_shape_range(const Vector2& p_range); Vector2 _get_shape_range() const; + Vector< Vector<Vector2> > _decompose_in_convex(); protected: diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 56f68ae634..405310450b 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h index 82e1137174..b14dad73ba 100644 --- a/scene/2d/collision_shape_2d.h +++ b/scene/2d/collision_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index adb2904a0a..053fc2c9c2 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -164,11 +164,17 @@ void PinJoint2D::_notification(int p_what) { switch(p_what) { case NOTIFICATION_DRAW: { - if (is_inside_tree() && get_tree()->is_editor_hint()) { - draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(0,-10),Point2(0,+10),Color(0.7,0.6,0.0,0.5),3); + if (!is_inside_tree()) + break; + + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { + break; } + + + draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(0,-10),Point2(0,+10),Color(0.7,0.6,0.0,0.5),3); } break; } @@ -241,13 +247,17 @@ void GrooveJoint2D::_notification(int p_what) { switch(p_what) { case NOTIFICATION_DRAW: { - if (is_inside_tree() && get_tree()->is_editor_hint()) { + if (!is_inside_tree()) + break; - draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(-10,initial_offset),Point2(+10,initial_offset),Color(0.8,0.8,0.9,0.5),5); + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { + break; } + + draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(-10,initial_offset),Point2(+10,initial_offset),Color(0.8,0.8,0.9,0.5),5); } break; } } @@ -339,12 +349,17 @@ void DampedSpringJoint2D::_notification(int p_what) { switch(p_what) { case NOTIFICATION_DRAW: { - if (is_inside_tree() && get_tree()->is_editor_hint()) { - draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); - draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); + if (!is_inside_tree()) + break; + + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) { + break; } + + draw_line(Point2(-10,0),Point2(+10,0),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(-10,length),Point2(+10,length),Color(0.7,0.6,0.0,0.5),3); + draw_line(Point2(0,0),Point2(0,length),Color(0.7,0.6,0.0,0.5),3); } break; } } diff --git a/scene/2d/joints_2d.h b/scene/2d/joints_2d.h index d468f3a6b5..52ffd86e7c 100644 --- a/scene/2d/joints_2d.h +++ b/scene/2d/joints_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index a2112c7d37..9715afeaa4 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -34,10 +34,19 @@ Rect2 Light2D::get_item_rect() const { } +void Light2D::_update_light_visibility() { + + if (!is_inside_tree()) + return; + + VS::get_singleton()->canvas_light_set_enabled(canvas_light,enabled && is_visible()); +} + void Light2D::set_enabled( bool p_enabled) { - VS::get_singleton()->canvas_light_set_enabled(canvas_light,p_enabled); + enabled=p_enabled; + _update_light_visibility(); } bool Light2D::is_enabled() const { @@ -253,16 +262,22 @@ void Light2D::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { VS::get_singleton()->canvas_light_attach_to_canvas( canvas_light, get_canvas() ); + _update_light_visibility(); } if (p_what==NOTIFICATION_TRANSFORM_CHANGED) { VS::get_singleton()->canvas_light_set_transform( canvas_light, get_global_transform()); } + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + _update_light_visibility(); + } if (p_what==NOTIFICATION_EXIT_TREE) { VS::get_singleton()->canvas_light_attach_to_canvas( canvas_light, RID() ); + _update_light_visibility(); } } diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h index 0828d9ac33..ca437769e7 100644 --- a/scene/2d/light_2d.h +++ b/scene/2d/light_2d.h @@ -35,6 +35,7 @@ private: Ref<Texture> texture; Vector2 texture_offset; + void _update_light_visibility(); protected: void _notification(int p_what); diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index 6ebd499f71..d98bed0ea3 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -93,12 +93,17 @@ void LightOccluder2D::_notification(int p_what) { VS::get_singleton()->canvas_light_occluder_attach_to_canvas(occluder,get_canvas()); VS::get_singleton()->canvas_light_occluder_set_transform(occluder,get_global_transform()); + VS::get_singleton()->canvas_light_occluder_set_enabled(occluder,is_visible()); } if (p_what==NOTIFICATION_TRANSFORM_CHANGED) { VS::get_singleton()->canvas_light_occluder_set_transform(occluder,get_global_transform()); } + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + VS::get_singleton()->canvas_light_occluder_set_enabled(occluder,is_visible()); + } if (p_what==NOTIFICATION_DRAW) { diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index b7d51730a0..c7542407cb 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -494,7 +494,26 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect open_list.erase(least_cost_poly); } - + { + 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; + } + } if (found_route) { Vector<Vector2> path; @@ -538,22 +557,29 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect bool skip=false; - /* print_line("-----\nAPEX: "+(apex_point-end_point)); + /* + print_line("-----\nAPEX: "+(apex_point-end_point)); print_line("LEFT:"); print_line("\tPortal: "+(portal_left-end_point)); print_line("\tPoint: "+(left-end_point)); - print_line("\tFree: "+itos(CLOCK_TANGENT(apex_point,portal_left,left) >= 0)); + print_line("\tLeft Tangent: "+rtos(CLOCK_TANGENT(apex_point,portal_left,left))); + print_line("\tLeft Distance: "+rtos(portal_left.distance_squared_to(apex_point))); + print_line("\tLeft Test: "+rtos(CLOCK_TANGENT(apex_point,left,portal_right))); print_line("RIGHT:"); print_line("\tPortal: "+(portal_right-end_point)); print_line("\tPoint: "+(right-end_point)); - print_line("\tFree: "+itos(CLOCK_TANGENT(apex_point,portal_right,right) <= 0)); -*/ + print_line("\tRight Tangent: "+rtos(CLOCK_TANGENT(apex_point,portal_right,right))); + print_line("\tRight Distance: "+rtos(portal_right.distance_squared_to(apex_point))); + print_line("\tRight Test: "+rtos(CLOCK_TANGENT(apex_point,right,portal_left))); + */ + if (CLOCK_TANGENT(apex_point,portal_left,left) >= 0){ //process if (portal_left.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,left,portal_right) > 0) { left_poly=p; portal_left=left; + //print_line("***ADVANCE LEFT"); } else { //_clip_path(path,apex_poly,portal_right,right_poly); @@ -568,6 +594,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect path.push_back(apex_point); skip=true; //print_line("addpoint left"); + //print_line("***CLIP LEFT"); } } @@ -576,6 +603,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect if (portal_right.distance_squared_to(apex_point)<CMP_EPSILON || CLOCK_TANGENT(apex_point,right,portal_left) < 0) { right_poly=p; portal_right=right; + //print_line("***ADVANCE RIGHT"); } else { //_clip_path(path,apex_poly,portal_left,left_poly); @@ -589,6 +617,7 @@ Vector<Vector2> Navigation2D::get_simple_path(const Vector2& p_start, const Vect if (path[path.size()-1].distance_to(apex_point)>CMP_EPSILON) path.push_back(apex_point); //print_line("addpoint right"); + //print_line("***CLIP RIGHT"); } } diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 792f079ab0..4c00d8cec9 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -273,7 +273,7 @@ void NavigationPolygonInstance::set_enabled(bool p_enabled) { if (navpoly.is_valid()) { - nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this); + nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this); } } @@ -309,7 +309,7 @@ void NavigationPolygonInstance::_notification(int p_what) { if (enabled && navpoly.is_valid()) { - nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this); + nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this); } break; } @@ -321,7 +321,7 @@ void NavigationPolygonInstance::_notification(int p_what) { case NOTIFICATION_TRANSFORM_CHANGED: { if (navigation && nav_id!=-1) { - navigation->navpoly_set_transform(nav_id,get_relative_transform(navigation)); + navigation->navpoly_set_transform(nav_id,get_relative_transform_to_parent(navigation)); } } break; @@ -409,7 +409,7 @@ void NavigationPolygonInstance::set_navigation_polygon(const Ref<NavigationPolyg } if (navigation && navpoly.is_valid() && enabled) { - nav_id = navigation->navpoly_create(navpoly,get_relative_transform(navigation),this); + nav_id = navigation->navpoly_create(navpoly,get_relative_transform_to_parent(navigation),this); } //update_gizmo(); _change_notify("navpoly"); diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index 52b112f090..7ef81306b6 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -333,17 +333,18 @@ int Node2D::get_z() const{ return z; } -Matrix32 Node2D::get_relative_transform(const Node *p_parent) const { +Matrix32 Node2D::get_relative_transform_to_parent(const Node *p_parent) const { if (p_parent==this) return Matrix32(); Node2D *parent_2d = get_parent()->cast_to<Node2D>(); + ERR_FAIL_COND_V(!parent_2d,Matrix32()); if (p_parent==parent_2d) return get_transform(); else - return parent_2d->get_relative_transform(p_parent) * get_transform(); + return parent_2d->get_relative_transform_to_parent(p_parent) * get_transform(); } @@ -394,9 +395,9 @@ void Node2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_z_as_relative","enable"),&Node2D::set_z_as_relative); ObjectTypeDB::bind_method(_MD("is_z_relative"),&Node2D::is_z_relative); - ObjectTypeDB::bind_method(_MD("edit_set_pivot"),&Node2D::edit_set_pivot); + ObjectTypeDB::bind_method(_MD("edit_set_pivot","pivot"),&Node2D::edit_set_pivot); - ObjectTypeDB::bind_method(_MD("get_relative_transform"),&Node2D::get_relative_transform); + ObjectTypeDB::bind_method(_MD("get_relative_transform_to_parent","parent"),&Node2D::get_relative_transform_to_parent); ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"transform/pos"),_SCS("set_pos"),_SCS("get_pos")); ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"transform/rot",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),_SCS("_set_rotd"),_SCS("_get_rotd")); diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index 8efce33cda..49d616fc1f 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -99,7 +99,7 @@ public: void set_z_as_relative(bool p_enabled); bool is_z_relative() const; - Matrix32 get_relative_transform(const Node *p_parent) const; + Matrix32 get_relative_transform_to_parent(const Node *p_parent) const; diff --git a/scene/2d/node_2d_singleton.cpp b/scene/2d/node_2d_singleton.cpp index 361edf7587..b26804fedf 100644 --- a/scene/2d/node_2d_singleton.cpp +++ b/scene/2d/node_2d_singleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/node_2d_singleton.h b/scene/2d/node_2d_singleton.h index 6a21db2221..0aa6bbf992 100644 --- a/scene/2d/node_2d_singleton.h +++ b/scene/2d/node_2d_singleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index 8bb4eb55ba..7f2e9efd96 100644 --- a/scene/2d/parallax_background.cpp +++ b/scene/2d/parallax_background.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -193,7 +193,7 @@ void ParallaxBackground::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_limit_begin"),&ParallaxBackground::get_limit_begin); ObjectTypeDB::bind_method(_MD("set_limit_end","ofs"),&ParallaxBackground::set_limit_end); ObjectTypeDB::bind_method(_MD("get_limit_end"),&ParallaxBackground::get_limit_end); - ObjectTypeDB::bind_method(_MD("set_ignore_camera_zoom"), &ParallaxBackground::set_ignore_camera_zoom); + ObjectTypeDB::bind_method(_MD("set_ignore_camera_zoom","ignore"), &ParallaxBackground::set_ignore_camera_zoom); ObjectTypeDB::bind_method(_MD("is_ignore_camera_zoom"), &ParallaxBackground::is_ignore_camera_zoom); diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h index 8dede07a16..bdaf7d241f 100644 --- a/scene/2d/parallax_background.h +++ b/scene/2d/parallax_background.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 70612d7c9a..7a898e43c9 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/parallax_layer.h b/scene/2d/parallax_layer.h index 8fe2846897..6c24a9b9f7 100644 --- a/scene/2d/parallax_layer.h +++ b/scene/2d/parallax_layer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 8f805ceba2..5b13c32d93 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -697,7 +697,7 @@ bool Particles2D::is_emitting() const { void Particles2D::set_amount(int p_amount) { - ERR_FAIL_INDEX(p_amount,1024); + ERR_FAIL_INDEX(p_amount,1024+1); particles.resize(p_amount); } @@ -719,7 +719,7 @@ float Particles2D::get_emit_timeout() const { void Particles2D::set_lifetime(float p_lifetime) { - ERR_FAIL_INDEX(p_lifetime,3600); + ERR_FAIL_INDEX(p_lifetime,3600+1); lifetime=p_lifetime; } @@ -994,6 +994,15 @@ DVector<Vector2> Particles2D::get_emission_points() const{ return emission_points; } +void Particles2D::reset() { + + for(int i=0;i<particles.size();i++) { + particles[i].active=false; + } + time=0; + active_count=0; +} + void Particles2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_emitting","active"),&Particles2D::set_emitting); @@ -1057,6 +1066,7 @@ void Particles2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos); ObjectTypeDB::bind_method(_MD("pre_process","time"),&Particles2D::pre_process); + ObjectTypeDB::bind_method(_MD("reset"),&Particles2D::reset); ObjectTypeDB::bind_method(_MD("set_use_local_space","enable"),&Particles2D::set_use_local_space); ObjectTypeDB::bind_method(_MD("is_using_local_space"),&Particles2D::is_using_local_space); diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index 4ee0fcf8da..101395589e 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -248,6 +248,7 @@ public: DVector<Vector2> get_emission_points() const; void pre_process(float p_delta); + void reset(); Particles2D(); }; diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 8f110b3931..bd7415aa04 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,9 +31,13 @@ void Path2D::_notification(int p_what) { - if (p_what==NOTIFICATION_DRAW && curve.is_valid() && is_inside_tree() && get_tree()->is_editor_hint()) { + if (p_what==NOTIFICATION_DRAW && curve.is_valid()) { //draw the curve!! + if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) { + return; + } + for(int i=0;i<curve->get_point_count();i++) { Vector2 prev_p=curve->get_point_pos(i); @@ -70,6 +74,8 @@ void Path2D::set_curve(const Ref<Curve2D>& p_curve) { curve->connect("changed",this,"_curve_changed"); } + _curve_changed(); + } Ref<Curve2D> Path2D::get_curve() const{ diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h index c9114c5d7d..486a8ac9ac 100644 --- a/scene/2d/path_2d.h +++ b/scene/2d/path_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index c30921eb69..cc2e5c0d72 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -310,14 +310,20 @@ void RigidBody2D::_body_enter_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(E->get().in_scene); + contact_monitor->locked=true; + E->get().in_scene=true; emit_signal(SceneStringNames::get_singleton()->body_enter,node); + for(int i=0;i<E->get().shapes.size();i++) { emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + contact_monitor->locked=false; + + } void RigidBody2D::_body_exit_tree(ObjectID p_id) { @@ -329,11 +335,18 @@ void RigidBody2D::_body_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_scene); E->get().in_scene=false; + + contact_monitor->locked=true; + emit_signal(SceneStringNames::get_singleton()->body_exit,node); + for(int i=0;i<E->get().shapes.size();i++) { emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + + contact_monitor->locked=false; + } void RigidBody2D::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) { @@ -439,6 +452,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { if (contact_monitor) { + contact_monitor->locked=true; + //untag all int rc=0; for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { @@ -520,6 +535,8 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { _body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape); } + contact_monitor->locked=false; + } set_block_transform_notify(true); // don't want notify (would feedback loop) @@ -803,6 +820,11 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { if (!p_enabled) { + if (contact_monitor->locked) { + ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead"); + } + ERR_FAIL_COND(contact_monitor->locked); + for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { //clean up mess @@ -813,6 +835,7 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { } else { contact_monitor = memnew( ContactMonitor ); + contact_monitor->locked=false; } } @@ -1250,7 +1273,7 @@ void KinematicBody2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity); ObjectTypeDB::bind_method(_MD("get_collider:Object"),&KinematicBody2D::_get_collider); ObjectTypeDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape); - ObjectTypeDB::bind_method(_MD("get_collider_metadata"),&KinematicBody2D::get_collider_metadata); + ObjectTypeDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata); ObjectTypeDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin); ObjectTypeDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index b70fdd59cf..999e63dd5d 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -190,7 +190,7 @@ private: struct ContactMonitor { - + bool locked; Map<ObjectID,BodyState> body_map; }; diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp index f1591b5242..c293305cb2 100644 --- a/scene/2d/position_2d.cpp +++ b/scene/2d/position_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/position_2d.h b/scene/2d/position_2d.h index 16404e6ce8..23821e62d4 100644 --- a/scene/2d/position_2d.h +++ b/scene/2d/position_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index 4a199e3418..4a774b0198 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/ray_cast_2d.h b/scene/2d/ray_cast_2d.h index 8c3ce8b3b3..54ec42c53e 100644 --- a/scene/2d/ray_cast_2d.h +++ b/scene/2d/ray_cast_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 0fbd140cfb..6dcd980822 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/remote_transform_2d.h b/scene/2d/remote_transform_2d.h index 506bde8cd8..4a5f5f72ea 100644 --- a/scene/2d/remote_transform_2d.h +++ b/scene/2d/remote_transform_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sample_player_2d.cpp b/scene/2d/sample_player_2d.cpp index ec17ffc55e..bf09130238 100644 --- a/scene/2d/sample_player_2d.cpp +++ b/scene/2d/sample_player_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sample_player_2d.h b/scene/2d/sample_player_2d.h index c0f2734ad1..eddf84f77b 100644 --- a/scene/2d/sample_player_2d.h +++ b/scene/2d/sample_player_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index 0c3987e6b1..fac94f19dc 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -102,6 +102,10 @@ void TouchScreenButton::_notification(int p_what) { action_id=-1; } } break; + case NOTIFICATION_EXIT_TREE: { + if (is_pressed()) + Input::get_singleton()->action_release(action); + } break; } } @@ -161,7 +165,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (finger_pressed==-1 || p_event.screen_touch.index==finger_pressed) { - Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); bool touched=false; if (bitmask.is_valid()) { @@ -238,7 +242,7 @@ void TouchScreenButton::_input(const InputEvent& p_event) { if (finger_pressed!=-1) return; //already fingering - Point2 coord = (get_global_transform()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); + Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(Point2(p_event.screen_touch.x,p_event.screen_touch.y)); bool touched=false; if (bitmask.is_valid()) { diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h index 159b829079..ff3b50bf5e 100644 --- a/scene/2d/screen_button.h +++ b/scene/2d/screen_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sound_player_2d.cpp b/scene/2d/sound_player_2d.cpp index 0eb18866af..41ce87faf9 100644 --- a/scene/2d/sound_player_2d.cpp +++ b/scene/2d/sound_player_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sound_player_2d.h b/scene/2d/sound_player_2d.h index a376cdbed7..0e75887235 100644 --- a/scene/2d/sound_player_2d.h +++ b/scene/2d/sound_player_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 89d9966958..001a1366a9 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/sprite.h b/scene/2d/sprite.h index ad782e746b..cbcaec9aeb 100644 --- a/scene/2d/sprite.h +++ b/scene/2d/sprite.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 1d48a9c8a0..179d1f451a 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -118,7 +118,7 @@ void TileMap::_update_quadrant_transform() { Matrix32 nav_rel; if (navigation) - nav_rel = get_relative_transform(navigation); + nav_rel = get_relative_transform_to_parent(navigation); for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) { @@ -223,6 +223,14 @@ void TileMap::_fix_cell_transform(Matrix32& xform,const Cell& p_cell, const Vect Size2 s=p_sc; Vector2 offset = p_offset; + if (s.y > s.x) { + if ((p_cell.flip_h && (p_cell.flip_v || p_cell.transpose)) || (p_cell.flip_v && !p_cell.transpose)) + offset.y += s.y - s.x; + } else if (s.y < s.x) { + if ((p_cell.flip_v && (p_cell.flip_h || p_cell.transpose)) || (p_cell.flip_h && !p_cell.transpose)) + offset.x += s.x - s.y; + } + if (p_cell.transpose) { SWAP(xform.elements[0].x, xform.elements[0].y); SWAP(xform.elements[1].x, xform.elements[1].y); @@ -261,7 +269,7 @@ void TileMap::_update_dirty_quadrants() { Vector2 tcenter = cell_size/2; Matrix32 nav_rel; if (navigation) - nav_rel = get_relative_transform(navigation); + nav_rel = get_relative_transform_to_parent(navigation); Vector2 qofs; @@ -333,6 +341,8 @@ void TileMap::_update_dirty_quadrants() { Matrix32 xform; xform.set_origin( q.pos ); vs->canvas_item_set_transform( canvas_item, xform ); + vs->canvas_item_set_light_mask(canvas_item,get_light_mask()); + q.canvas_items.push_back(canvas_item); if (debug_shapes) { @@ -374,13 +384,28 @@ void TileMap::_update_dirty_quadrants() { rect.pos=offset.floor(); rect.size=s; + if (rect.size.y > rect.size.x) { + if ((c.flip_h && (c.flip_v || c.transpose)) || (c.flip_v && !c.transpose)) + tile_ofs.y += rect.size.y - rect.size.x; + } else if (rect.size.y < rect.size.x) { + if ((c.flip_v && (c.flip_h || c.transpose)) || (c.flip_h && !c.transpose)) + tile_ofs.x += rect.size.x - rect.size.y; + } + /* rect.size.x+=fp_adjust; rect.size.y+=fp_adjust;*/ - if (c.flip_h) + if (c.transpose) + SWAP(tile_ofs.x, tile_ofs.y); + + if (c.flip_h) { rect.size.x=-rect.size.x; - if (c.flip_v) + tile_ofs.x=-tile_ofs.x; + } + if (c.flip_v) { rect.size.y=-rect.size.y; + tile_ofs.y=-tile_ofs.y; + } Vector2 center_ofs; @@ -1105,7 +1130,16 @@ int TileMap::get_occluder_light_mask() const{ return occluder_light_mask; } +void TileMap::set_light_mask(int p_light_mask) { + + CanvasItem::set_light_mask(p_light_mask); + for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) { + for (List<RID>::Element *F=E->get().canvas_items.front();F;F=F->next()) { + VisualServer::get_singleton()->canvas_item_set_light_mask(F->get(),get_light_mask()); + } + } +} void TileMap::_bind_methods() { diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 4676d1ef7a..14cb52b736 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -253,6 +253,8 @@ public: void set_occluder_light_mask(int p_mask); int get_occluder_light_mask() const; + virtual void set_light_mask(int p_light_mask); + void clear(); TileMap(); diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index dc72c9a267..60fa7f69c8 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visibility_notifier_2d.h index 1f7e4c6d45..6ec24fd4d0 100644 --- a/scene/2d/visibility_notifier_2d.h +++ b/scene/2d/visibility_notifier_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 47cebd25a2..7d4235e051 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/area.h b/scene/3d/area.h index 529a116937..c250d27fb1 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp index b54cbfe0f9..3a47371de3 100644 --- a/scene/3d/body_shape.cpp +++ b/scene/3d/body_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -402,7 +402,7 @@ int CollisionShape::_get_update_shape_index() const{ void CollisionShape::_bind_methods() { //not sure if this should do anything - ObjectTypeDB::bind_method(_MD("resource_changed"),&CollisionShape::resource_changed); + ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&CollisionShape::resource_changed); ObjectTypeDB::bind_method(_MD("set_shape","shape"),&CollisionShape::set_shape); ObjectTypeDB::bind_method(_MD("get_shape"),&CollisionShape::get_shape); ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape::_add_to_collision_object); diff --git a/scene/3d/body_shape.h b/scene/3d/body_shape.h index 6c0b89da56..dd005c0edd 100644 --- a/scene/3d/body_shape.h +++ b/scene/3d/body_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index 9cc1719f94..1628ccc15e 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/bone_attachment.h b/scene/3d/bone_attachment.h index ca36cc3694..f1c27a9650 100644 --- a/scene/3d/bone_attachment.h +++ b/scene/3d/bone_attachment.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index dce5060a44..3e78fef147 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -125,7 +125,7 @@ bool Camera::_get(const StringName& p_name,Variant &r_ret) const { r_ret= int(keep_aspect); else if (p_name=="current") { - if (is_inside_tree() && get_tree()->is_editor_hint()) { + if (is_inside_tree() && get_tree()->is_node_being_edited(this)) { r_ret=current; } else { r_ret=is_current(); @@ -192,12 +192,11 @@ void Camera::_update_camera() { // here goes listener stuff // if (viewport_ptr && is_inside_scene() && is_current()) -// viewport_ptr->_camera_transform_changed_notify(); +// get_viewport()->_camera_transform_changed_notify(); if (is_inside_tree() && is_current()) { - if (viewport_ptr) { - viewport_ptr->_camera_transform_changed_notify(); - } + get_viewport()->_camera_transform_changed_notify(); + } if (is_current() && get_world().is_valid()) { @@ -213,29 +212,10 @@ void Camera::_notification(int p_what) { case NOTIFICATION_ENTER_WORLD: { - viewport_ptr=NULL; - - { //find viewport stuff - Node *parent=get_parent(); - while(parent) { - - Viewport* viewport = parent->cast_to<Viewport>(); - - if (viewport) { - viewport_ptr=viewport; - break; - } - parent=parent->get_parent(); - } - - } - - camera_group = "_vp_cameras"+itos(get_viewport()->get_instance_ID()); - add_to_group(camera_group); - if (viewport_ptr) - viewport_ptr->cameras.insert(this); - if (current) + bool first_camera = get_viewport()->cameras.size()==0; + get_viewport()->cameras.insert(this); + if (!get_tree()->is_node_being_edited(this) && (current || first_camera)) make_current(); @@ -246,17 +226,17 @@ void Camera::_notification(int p_what) { } break; case NOTIFICATION_EXIT_WORLD: { - if (is_current()) { - clear_current(); - current=true; //keep it true + if (!get_tree()->is_node_being_edited(this)) { + if (is_current()) { + clear_current(); + current=true; //keep it true - } else { - current=false; + } else { + current=false; + } } - if (viewport_ptr) - viewport_ptr->cameras.erase(this); - viewport_ptr=NULL; - remove_from_group(camera_group); + + get_viewport()->cameras.erase(this); } break; @@ -324,25 +304,12 @@ void Camera::make_current() { if (!is_inside_tree()) return; - if (viewport_ptr) { - viewport_ptr->_set_camera(this); - } + get_viewport()->_set_camera(this); //get_scene()->call_group(SceneMainLoop::GROUP_CALL_REALTIME,camera_group,"_camera_make_current",this); } -void Camera::_camera_make_next_current(Node *p_exclude) { - - if (this==p_exclude) - return; - if (!is_inside_tree()) - return; - if (get_viewport()->get_camera()!=NULL) - return; - - make_current(); -} void Camera::clear_current() { @@ -351,12 +318,20 @@ void Camera::clear_current() { if (!is_inside_tree()) return; - if (viewport_ptr) { - if (viewport_ptr->get_camera()==this) { - viewport_ptr->_set_camera(NULL); - //a group is used beause this needs to be in order to be deterministic - get_tree()->call_group(SceneTree::GROUP_CALL_REALTIME,camera_group,"_camera_make_next_current",this); + if (get_viewport()->get_camera()==this) { + get_viewport()->_set_camera(NULL); + //a group is used beause this needs to be in order to be deterministic + + for (Set<Camera*>::Element *E=get_viewport()->cameras.front();E;E=E->next()) { + if (this==E->get()) + continue; + if (!E->get()->is_inside_tree()) + continue; + if (get_viewport()->get_camera()!=NULL) + return; + + E->get()->make_current(); } } @@ -364,9 +339,9 @@ void Camera::clear_current() { bool Camera::is_current() const { - if (is_inside_tree()) { - if (viewport_ptr) - return viewport_ptr->get_camera()==this; + if (is_inside_tree() && !get_tree()->is_node_being_edited(this)) { + + return get_viewport()->get_camera()==this; } else return current; @@ -481,12 +456,12 @@ Vector3 Camera::project_local_ray_normal(const Point2& p_pos) const { #if 0 - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; Vector2 cpos = p_pos; #else - Size2 viewport_size = viewport_ptr->get_camera_rect_size(); - Vector2 cpos = viewport_ptr->get_camera_coords(p_pos); + Size2 viewport_size = get_viewport()->get_camera_rect_size(); + Vector2 cpos = get_viewport()->get_camera_coords(p_pos); #endif Vector3 ray; @@ -514,12 +489,12 @@ Vector3 Camera::project_ray_origin(const Point2& p_pos) const { } #if 0 - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; Vector2 cpos = p_pos; #else - Size2 viewport_size = viewport_ptr->get_camera_rect_size(); - Vector2 cpos = viewport_ptr->get_camera_coords(p_pos); + 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() ); @@ -566,7 +541,7 @@ Point2 Camera::unproject_position(const Vector3& p_pos) const { ERR_FAIL_COND_V(!is_inside_tree(),Vector2()); } - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; CameraMatrix cm; @@ -597,7 +572,7 @@ Vector3 Camera::project_position(const Point2& p_point) const { ERR_FAIL_COND_V(!is_inside_tree(),Vector3()); } - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; CameraMatrix cm; @@ -692,7 +667,6 @@ void Camera::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_environment:Environment"),&Camera::get_environment); ObjectTypeDB::bind_method(_MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode); ObjectTypeDB::bind_method(_MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode); - ObjectTypeDB::bind_method(_MD("_camera_make_next_current"),&Camera::_camera_make_next_current); //ObjectTypeDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current ); BIND_CONSTANT( PROJECTION_PERSPECTIVE ); @@ -745,7 +719,7 @@ Vector<Plane> Camera::get_frustum() const { ERR_FAIL_COND_V(!is_inside_world(),Vector<Plane>()); - Size2 viewport_size = viewport_ptr->get_visible_rect().size; + Size2 viewport_size = get_viewport()->get_visible_rect().size; CameraMatrix cm; if (mode==PROJECTION_PERSPECTIVE) cm.set_perspective(fov,viewport_size.get_aspect(),near,far,keep_aspect==KEEP_WIDTH); @@ -789,7 +763,6 @@ Camera::Camera() { near=0; far=0; current=false; - viewport_ptr=NULL; force_change=false; mode=PROJECTION_PERSPECTIVE; set_perspective(60.0,0.1,100.0); diff --git a/scene/3d/camera.h b/scene/3d/camera.h index e21f4865ec..02ca6ffb9a 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,18 +68,15 @@ private: RID camera; RID scenario_id; - String camera_group; + //String camera_group; uint32_t layers; - Viewport *viewport_ptr; Ref<Environment> environment; virtual bool _can_gizmo_scale() const; virtual RES _get_gizmo_geometry() const; - void _camera_make_next_current(Node *p_exclude); - //void _camera_make_current(Node *p_camera); friend class Viewport; diff --git a/scene/3d/character_camera.cpp b/scene/3d/character_camera.cpp index 19332bd056..2b22026fe9 100644 --- a/scene/3d/character_camera.cpp +++ b/scene/3d/character_camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/character_camera.h b/scene/3d/character_camera.h index 99b41c6eda..d636b4b1a5 100644 --- a/scene/3d/character_camera.h +++ b/scene/3d/character_camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 5ecadb48b8..b50878da07 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h index 548c9fb85b..f8daeb3ed2 100644 --- a/scene/3d/collision_object.h +++ b/scene/3d/collision_object.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index bb0a1fca12..3b14e1d767 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -236,7 +236,7 @@ void CollisionPolygon::_bind_methods() { ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon::_add_to_collision_object); - ObjectTypeDB::bind_method(_MD("set_build_mode"),&CollisionPolygon::set_build_mode); + ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon::set_build_mode); ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon::get_build_mode); ObjectTypeDB::bind_method(_MD("set_depth","depth"),&CollisionPolygon::set_depth); diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index f44713e8a0..96306d1180 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/interpolated_camera.h b/scene/3d/interpolated_camera.h index a8ed649c42..dbe84327fb 100644 --- a/scene/3d/interpolated_camera.h +++ b/scene/3d/interpolated_camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 9f9c87b675..18463742c6 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -487,9 +487,9 @@ bool Light::is_editor_only() const{ void Light::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_parameter","variable","value"), &Light::set_parameter ); - ObjectTypeDB::bind_method(_MD("get_parameter"), &Light::get_parameter ); + ObjectTypeDB::bind_method(_MD("get_parameter","variable"), &Light::get_parameter ); ObjectTypeDB::bind_method(_MD("set_color","color","value"), &Light::set_color ); - ObjectTypeDB::bind_method(_MD("get_color"), &Light::get_color ); + ObjectTypeDB::bind_method(_MD("get_color","color"), &Light::get_color ); ObjectTypeDB::bind_method(_MD("set_project_shadows","enable"), &Light::set_project_shadows ); ObjectTypeDB::bind_method(_MD("has_project_shadows"), &Light::has_project_shadows ); ObjectTypeDB::bind_method(_MD("set_projector","projector:Texture"), &Light::set_projector ); diff --git a/scene/3d/light.h b/scene/3d/light.h index fb77ac9e64..b74085b7a9 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 62b32729c3..997d2dea7c 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index 76a0eeea60..f26ef52000 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index cd620ff447..0e97a97943 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index be6b3677e2..7cd9a8ea82 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/optimized_spatial_scene.cpp b/scene/3d/optimized_spatial_scene.cpp index 85c1b79a9a..27631c7a74 100644 --- a/scene/3d/optimized_spatial_scene.cpp +++ b/scene/3d/optimized_spatial_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/optimized_spatial_scene.h b/scene/3d/optimized_spatial_scene.h index a55b5235da..e1e6e14f73 100644 --- a/scene/3d/optimized_spatial_scene.h +++ b/scene/3d/optimized_spatial_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 6868646c48..dfd5c38266 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -422,14 +422,14 @@ void Particles::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_variable","variable","value"),&Particles::set_variable); ObjectTypeDB::bind_method(_MD("get_variable","variable"),&Particles::get_variable); ObjectTypeDB::bind_method(_MD("set_randomness","variable","randomness"),&Particles::set_randomness); - ObjectTypeDB::bind_method(_MD("get_randomness"),&Particles::get_randomness); + ObjectTypeDB::bind_method(_MD("get_randomness","variable"),&Particles::get_randomness); ObjectTypeDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos); ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos); ObjectTypeDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color); ObjectTypeDB::bind_method(_MD("get_color_phase_color","phase"),&Particles::get_color_phase_color); ObjectTypeDB::bind_method(_MD("set_material","material:Material"),&Particles::set_material); ObjectTypeDB::bind_method(_MD("get_material:Material"),&Particles::get_material); - ObjectTypeDB::bind_method(_MD("set_emit_timeout"),&Particles::set_emit_timeout); + ObjectTypeDB::bind_method(_MD("set_emit_timeout","timeout"),&Particles::set_emit_timeout); ObjectTypeDB::bind_method(_MD("get_emit_timeout"),&Particles::get_emit_timeout); ObjectTypeDB::bind_method(_MD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity); ObjectTypeDB::bind_method(_MD("has_height_from_velocity"),&Particles::has_height_from_velocity); diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 260573fe5f..b9cae332e2 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index 9cd41b25f6..d6cd3da7c3 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/path.h b/scene/3d/path.h index 1b40ec413d..2e3573df3e 100644 --- a/scene/3d/path.h +++ b/scene/3d/path.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index de50484a1e..1a2665b6ad 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -207,6 +207,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) { ERR_FAIL_COND(E->get().in_tree); E->get().in_tree=true; + + contact_monitor->locked=true; + emit_signal(SceneStringNames::get_singleton()->body_enter,node); for(int i=0;i<E->get().shapes.size();i++) { @@ -214,6 +217,9 @@ void RigidBody::_body_enter_tree(ObjectID p_id) { emit_signal(SceneStringNames::get_singleton()->body_enter_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + contact_monitor->locked=false; + + } void RigidBody::_body_exit_tree(ObjectID p_id) { @@ -225,11 +231,18 @@ void RigidBody::_body_exit_tree(ObjectID p_id) { ERR_FAIL_COND(!E); ERR_FAIL_COND(!E->get().in_tree); E->get().in_tree=false; + + contact_monitor->locked=true; + emit_signal(SceneStringNames::get_singleton()->body_exit,node); + for(int i=0;i<E->get().shapes.size();i++) { emit_signal(SceneStringNames::get_singleton()->body_exit_shape,p_id,node,E->get().shapes[i].body_shape,E->get().shapes[i].local_shape); } + + contact_monitor->locked=false; + } void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,int p_local_shape) { @@ -317,6 +330,8 @@ void RigidBody::_direct_state_changed(Object *p_state) { if (contact_monitor) { + contact_monitor->locked=true; + //untag all int rc=0; for( Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { @@ -396,6 +411,8 @@ void RigidBody::_direct_state_changed(Object *p_state) { _body_inout(1,toadd[i].id,toadd[i].shape,toadd[i].local_shape); } + contact_monitor->locked=false; + } set_ignore_transform_notification(true); @@ -648,6 +665,11 @@ void RigidBody::set_contact_monitor(bool p_enabled) { if (!p_enabled) { + if (contact_monitor->locked) { + ERR_EXPLAIN("Can't disable contact monitoring during in/out callback. Use call_deferred(\"set_contact_monitor\",false) instead"); + } + ERR_FAIL_COND(contact_monitor->locked); + for(Map<ObjectID,BodyState>::Element *E=contact_monitor->body_map.front();E;E=E->next()) { //clean up mess @@ -658,6 +680,8 @@ void RigidBody::set_contact_monitor(bool p_enabled) { } else { contact_monitor = memnew( ContactMonitor ); + contact_monitor->locked=false; + } } diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index 0e63b77118..da79d63f00 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -175,7 +175,7 @@ private: struct ContactMonitor { - + bool locked; Map<ObjectID,BodyState> body_map; }; diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index f4facb7c3f..3f03b2aab3 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -141,7 +141,7 @@ void Joint::_notification(int p_what) { case NOTIFICATION_EXIT_TREE: { if (joint.is_valid()) { _update_joint(true); - PhysicsServer::get_singleton()->free(joint); + //PhysicsServer::get_singleton()->free(joint); joint=RID(); } } break; diff --git a/scene/3d/physics_joint.h b/scene/3d/physics_joint.h index 3f5a0e91a6..55c26f296e 100644 --- a/scene/3d/physics_joint.h +++ b/scene/3d/physics_joint.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index 34499578aa..84f94402d5 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/portal.h b/scene/3d/portal.h index 14c1275312..388eac4dd3 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/position_3d.cpp b/scene/3d/position_3d.cpp index d692c0f249..27130cbe6a 100644 --- a/scene/3d/position_3d.cpp +++ b/scene/3d/position_3d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/position_3d.h b/scene/3d/position_3d.h index 265c0b48c7..6bac540fcb 100644 --- a/scene/3d/position_3d.h +++ b/scene/3d/position_3d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index 334246b033..a2182302a0 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/proximity_group.h b/scene/3d/proximity_group.h index 35e3f3dd98..6d5c703827 100644 --- a/scene/3d/proximity_group.h +++ b/scene/3d/proximity_group.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index 43bde8dc61..1a7eeef180 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/quad.h b/scene/3d/quad.h index 5ef4af8b81..be55b0d1c9 100644 --- a/scene/3d/quad.h +++ b/scene/3d/quad.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 5f2c8e0ba3..ab2c4fc8dc 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h index 06e9e31396..520b4d5313 100644 --- a/scene/3d/ray_cast.h +++ b/scene/3d/ray_cast.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 2ae75b8b68..e358da136b 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index 09fccc5ebc..c7df4ceadd 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp index 59c8b5e0df..2e22ab36d3 100644 --- a/scene/3d/scenario_fx.cpp +++ b/scene/3d/scenario_fx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/scenario_fx.h b/scene/3d/scenario_fx.h index b877cccc19..a3c13e03a1 100644 --- a/scene/3d/scenario_fx.h +++ b/scene/3d/scenario_fx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index cb81228dff..64133f67b5 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index 6678722d12..033f212a58 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 7d48420a83..0c1e1e2d1c 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index b1e3a82868..23f1c6d103 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_indexer.cpp b/scene/3d/spatial_indexer.cpp index 2f7aee5c67..d5be36b2cb 100644 --- a/scene/3d/spatial_indexer.cpp +++ b/scene/3d/spatial_indexer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_indexer.h b/scene/3d/spatial_indexer.h index bc19b54d8f..13ce8badea 100644 --- a/scene/3d/spatial_indexer.h +++ b/scene/3d/spatial_indexer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_player.cpp b/scene/3d/spatial_player.cpp index 5948c01ff8..c7cf03e284 100644 --- a/scene/3d/spatial_player.cpp +++ b/scene/3d/spatial_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_player.h b/scene/3d/spatial_player.h index 2f54497847..5a8687b854 100644 --- a/scene/3d/spatial_player.h +++ b/scene/3d/spatial_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_sample_player.cpp b/scene/3d/spatial_sample_player.cpp index 28b8fdd01e..7114fd4b77 100644 --- a/scene/3d/spatial_sample_player.cpp +++ b/scene/3d/spatial_sample_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_sample_player.h b/scene/3d/spatial_sample_player.h index 1d7bb8e238..9b3220458e 100644 --- a/scene/3d/spatial_sample_player.h +++ b/scene/3d/spatial_sample_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp index 7ed2335fcb..dfef0faf4b 100644 --- a/scene/3d/spatial_stream_player.cpp +++ b/scene/3d/spatial_stream_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -60,7 +60,7 @@ void SpatialStreamPlayer::sp_set_mix_rate(int p_rate){ bool SpatialStreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) { - if (resampler.is_ready()) { + if (resampler.is_ready() && !paused) { return resampler.mix(p_buffer,p_frames); } @@ -332,7 +332,7 @@ void SpatialStreamPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_stream","stream:Stream"),&SpatialStreamPlayer::set_stream); ObjectTypeDB::bind_method(_MD("get_stream:Stream"),&SpatialStreamPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play"),&SpatialStreamPlayer::play,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("play","offset"),&SpatialStreamPlayer::play,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop"),&SpatialStreamPlayer::stop); ObjectTypeDB::bind_method(_MD("is_playing"),&SpatialStreamPlayer::is_playing); diff --git a/scene/3d/spatial_stream_player.h b/scene/3d/spatial_stream_player.h index f2775a4982..0732b3fc10 100644 --- a/scene/3d/spatial_stream_player.h +++ b/scene/3d/spatial_stream_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/test_cube.cpp b/scene/3d/test_cube.cpp index 0acd1b3351..6440d95d55 100644 --- a/scene/3d/test_cube.cpp +++ b/scene/3d/test_cube.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/test_cube.h b/scene/3d/test_cube.h index 2dbd7c9856..21f2b3c794 100644 --- a/scene/3d/test_cube.h +++ b/scene/3d/test_cube.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index ad62f6d809..60097ad482 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h index 85c26bec94..a4709b7cf4 100644 --- a/scene/3d/visibility_notifier.h +++ b/scene/3d/visibility_notifier.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index 41e8b6bf54..723b0a9af5 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index 3c69f09978..e49f4fb82f 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index b1d6da7294..b1123897b2 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h index e94530d924..c9b4ff298c 100644 --- a/scene/animation/animation_cache.h +++ b/scene/animation/animation_cache.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index b040e59d16..f6d058c2fd 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 18cedee796..853526c80a 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index eeb2e6aa32..77d9f77bb5 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index fb1c9016ff..0fec9a9551 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/transitioner.cpp b/scene/animation/transitioner.cpp index d210f29db0..adcf73d489 100644 --- a/scene/animation/transitioner.cpp +++ b/scene/animation/transitioner.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/transitioner.h b/scene/animation/transitioner.h index dba83cddd8..8b7ec4f3fa 100644 --- a/scene/animation/transitioner.h +++ b/scene/animation/transitioner.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 73d93e50ec..31f30dd1d9 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/tween.h b/scene/animation/tween.h index d504c63d8a..f06ca1e9e7 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 9128d220de..80588d643e 100644 --- a/scene/animation/tween_interpolaters.cpp +++ b/scene/animation/tween_interpolaters.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/event_player.cpp b/scene/audio/event_player.cpp index 1bd692431d..b49b285f76 100644 --- a/scene/audio/event_player.cpp +++ b/scene/audio/event_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -312,16 +312,14 @@ void EventPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_pos"),&EventPlayer::get_pos); ObjectTypeDB::bind_method(_MD("seek_pos","time"),&EventPlayer::seek_pos); + ObjectTypeDB::bind_method(_MD("get_length"),&EventPlayer::get_length); + ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&EventPlayer::set_autoplay); ObjectTypeDB::bind_method(_MD("has_autoplay"),&EventPlayer::has_autoplay); ObjectTypeDB::bind_method(_MD("set_channel_volume","idx","channel_volume"),&EventPlayer::set_channel_volume); - ObjectTypeDB::bind_method(_MD("get_channel_volume""idx"),&EventPlayer::get_channel_volume); - - ObjectTypeDB::bind_method(_MD("get_length"),&EventPlayer::get_length); - - - ObjectTypeDB::bind_method(_MD("get_channel_last_note_time"),&EventPlayer::get_channel_last_note_time); + ObjectTypeDB::bind_method(_MD("get_channel_volume","idx"),&EventPlayer::get_channel_volume); + ObjectTypeDB::bind_method(_MD("get_channel_last_note_time","idx"),&EventPlayer::get_channel_last_note_time); ObjectTypeDB::bind_method(_MD("_set_play","play"),&EventPlayer::_set_play); ObjectTypeDB::bind_method(_MD("_get_play"),&EventPlayer::_get_play); diff --git a/scene/audio/event_player.h b/scene/audio/event_player.h index 05e78040d2..c04e85fe77 100644 --- a/scene/audio/event_player.h +++ b/scene/audio/event_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sample_player.cpp b/scene/audio/sample_player.cpp index 7c0a926324..d7605ed1a9 100644 --- a/scene/audio/sample_player.cpp +++ b/scene/audio/sample_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sample_player.h b/scene/audio/sample_player.h index 75a01aff86..1821c671dc 100644 --- a/scene/audio/sample_player.h +++ b/scene/audio/sample_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sound_room_params.cpp b/scene/audio/sound_room_params.cpp index 8886113e03..bb2285c97f 100644 --- a/scene/audio/sound_room_params.cpp +++ b/scene/audio/sound_room_params.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/sound_room_params.h b/scene/audio/sound_room_params.h index 8af2ae8c12..4ca1eae2ce 100644 --- a/scene/audio/sound_room_params.h +++ b/scene/audio/sound_room_params.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp index d08fdd0c76..f7cfc31b03 100644 --- a/scene/audio/stream_player.cpp +++ b/scene/audio/stream_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -58,7 +58,7 @@ void StreamPlayer::sp_set_mix_rate(int p_rate){ bool StreamPlayer::sp_mix(int32_t *p_buffer,int p_frames) { - if (resampler.is_ready()) { + if (resampler.is_ready() && !paused) { return resampler.mix(p_buffer,p_frames); } @@ -170,6 +170,7 @@ void StreamPlayer::stop() { stop_request=false; playback->stop(); resampler.flush(); + emit_signal("finished"); //set_idle_process(false); } @@ -333,7 +334,7 @@ void StreamPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_stream","stream:Stream"),&StreamPlayer::set_stream); ObjectTypeDB::bind_method(_MD("get_stream:Stream"),&StreamPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play"),&StreamPlayer::play,DEFVAL(0)); + ObjectTypeDB::bind_method(_MD("play","offset"),&StreamPlayer::play,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop"),&StreamPlayer::stop); ObjectTypeDB::bind_method(_MD("is_playing"),&StreamPlayer::is_playing); @@ -378,6 +379,8 @@ void StreamPlayer::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); + + ADD_SIGNAL(MethodInfo("finished")); } diff --git a/scene/audio/stream_player.h b/scene/audio/stream_player.h index 0a29e78de7..30840137e2 100644 --- a/scene/audio/stream_player.h +++ b/scene/audio/stream_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 0c63a3bc74..698dbce2b5 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h index e187a85eae..83c66326c5 100644 --- a/scene/gui/base_button.h +++ b/scene/gui/base_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index b63b3de530..6fff90809e 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h index c357814baf..6e63e8bdac 100644 --- a/scene/gui/box_container.h +++ b/scene/gui/box_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index edeb18bfc1..b9ce46d738 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -137,8 +137,10 @@ void Button::_notification(int p_what) { text_ofs.y+=font->get_ascent(); font->draw( ci, text_ofs.floor(), text, color,clip_text?text_clip:-1); if (!_icon.is_null()) { + + int valign = size.height-style->get_minimum_size().y; - _icon->draw(ci,Point2(style->get_offset().x, Math::floor( (size.height-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); + _icon->draw(ci,style->get_offset()+Point2(0, Math::floor( (valign-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); } diff --git a/scene/gui/button.h b/scene/gui/button.h index 690179b90c..bd244f5087 100644 --- a/scene/gui/button.h +++ b/scene/gui/button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_array.cpp b/scene/gui/button_array.cpp index b86e32dda7..9e3476899f 100644 --- a/scene/gui/button_array.cpp +++ b/scene/gui/button_array.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_array.h b/scene/gui/button_array.h index ea2c1e4968..39661eaabd 100644 --- a/scene/gui/button_array.h +++ b/scene/gui/button_array.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index c92d7f2696..04ba5fc06d 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/button_group.h b/scene/gui/button_group.h index 74e847e937..38c61991b7 100644 --- a/scene/gui/button_group.h +++ b/scene/gui/button_group.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/center_container.cpp b/scene/gui/center_container.cpp index 8a22a38980..844175e4c1 100644 --- a/scene/gui/center_container.cpp +++ b/scene/gui/center_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/center_container.h b/scene/gui/center_container.h index 4d8d06ac8c..dc95533525 100644 --- a/scene/gui/center_container.h +++ b/scene/gui/center_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index 2aa82bc5f5..1381d6eb60 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_box.h b/scene/gui/check_box.h index 171fd55351..95dd4891d4 100644 --- a/scene/gui/check_box.h +++ b/scene/gui/check_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index d765aefe5e..ecaea251a5 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_button.h b/scene/gui/check_button.h index b90bb31c2d..022ade2193 100644 --- a/scene/gui/check_button.h +++ b/scene/gui/check_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index c30d473610..7d6c986d96 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 0756e88cf2..95c26a9c6f 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 2ff51d22c4..920c6bf1e6 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/container.h b/scene/gui/container.h index 04d5d6ab36..1c7587c155 100644 --- a/scene/gui/container.h +++ b/scene/gui/container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ec4886a6ac..5a8ecfeffe 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -862,6 +862,13 @@ bool Control::window_has_modal_stack() const { return data.window->window->modal_stack.size(); } +bool Control::is_window_modal_on_top() const { + + if (window_has_modal_stack()) + return data.window->window->modal_stack.back()->get()==this; + return false; +} + void Control::_window_cancel_tooltip() { window->tooltip=NULL; @@ -916,6 +923,7 @@ void Control::_window_show_tooltip() { void Control::_window_call_input(Control *p_control,const InputEvent& p_input) { +// _block(); while(p_control) { @@ -932,6 +940,9 @@ void Control::_window_call_input(Control *p_control,const InputEvent& p_input) { break; p_control=p_control->data.parent; } + + //_unblock(); + } void Control::_window_input_event(InputEvent p_event) { @@ -1067,6 +1078,7 @@ void Control::_window_input_event(InputEvent p_event) { Size2 pos = mpos; pos = window->focus_inv_xform.xform(pos); + window->mouse_over->drop_data(pos,window->drag_data); window->drag_data=Variant(); //change mouse accordingly diff --git a/scene/gui/control.h b/scene/gui/control.h index 09a4b48e6b..0ead632aab 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -270,6 +270,8 @@ public: void set_custom_minimum_size(const Size2& p_custom); Size2 get_custom_minimum_size() const; + bool is_window_modal_on_top() const; + bool is_window() const; Control *get_window() const; Control *get_parent_control() const; diff --git a/scene/gui/custom_button.cpp b/scene/gui/custom_button.cpp index 53a3bf0914..a70af05418 100644 --- a/scene/gui/custom_button.cpp +++ b/scene/gui/custom_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/custom_button.h b/scene/gui/custom_button.h index 49fcf7408f..2492750489 100644 --- a/scene/gui/custom_button.h +++ b/scene/gui/custom_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index efda8a66e1..9f08b6f845 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index 67c574a420..7c06ded866 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 22e3a81e52..5b57395e58 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -49,14 +49,49 @@ void FileDialog::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - refresh->set_icon(get_icon("Reload","EditorIcons")); + refresh->set_icon(get_icon("reload")); } if (p_what==NOTIFICATION_DRAW) { //RID ci = get_canvas_item(); //get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size())); - } + } + + if (p_what==NOTIFICATION_POPUP_HIDE) { + + set_process_unhandled_input(false); + } +} + +void FileDialog::_unhandled_input(const InputEvent& p_event) { + + if (p_event.type==InputEvent::KEY && is_window_modal_on_top()) { + + const InputEventKey &k=p_event.key; + + if (k.pressed) { + + bool handled=true; + + switch (k.scancode) { + + case KEY_H: { + + if (k.mod.command) { + set_show_hidden_files(!show_hidden_files); + } else { + handled=false; + } + + } break; + default: { handled=false; } + } + + if (handled) + accept_event(); + } + } } void FileDialog::set_enable_multiple_selection(bool p_enable) { @@ -114,6 +149,8 @@ void FileDialog::_post_popup() { else tree->grab_focus(); + set_process_unhandled_input(true); + } void FileDialog::_action_pressed() { @@ -628,6 +665,8 @@ bool FileDialog::default_show_hidden_files=false; void FileDialog::_bind_methods() { + ObjectTypeDB::bind_method(_MD("_unhandled_input"),&FileDialog::_unhandled_input); + ObjectTypeDB::bind_method(_MD("_tree_selected"),&FileDialog::_tree_selected); ObjectTypeDB::bind_method(_MD("_tree_db_selected"),&FileDialog::_tree_dc_selected); ObjectTypeDB::bind_method(_MD("_dir_entered"),&FileDialog::_dir_entered); @@ -650,7 +689,7 @@ void FileDialog::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&FileDialog::get_vbox); ObjectTypeDB::bind_method(_MD("set_access","access"),&FileDialog::set_access); ObjectTypeDB::bind_method(_MD("get_access"),&FileDialog::get_access); - ObjectTypeDB::bind_method(_MD("set_show_hidden_files"),&FileDialog::set_show_hidden_files); + ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&FileDialog::set_show_hidden_files); ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&FileDialog::is_showing_hidden_files); ObjectTypeDB::bind_method(_MD("_select_drive"),&FileDialog::_select_drive); ObjectTypeDB::bind_method(_MD("_make_dir"),&FileDialog::_make_dir); diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 370088b215..b71a157fa7 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -117,6 +117,8 @@ private: void _update_drives(); + void _unhandled_input(const InputEvent& p_event); + virtual void _post_popup(); protected: diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 105f66f368..a514f1b3d7 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/grid_container.h b/scene/gui/grid_container.h index 8d8bc27293..588bb17fa1 100644 --- a/scene/gui/grid_container.h +++ b/scene/gui/grid_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 002e49cbcf..e8097c79a4 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/label.h b/scene/gui/label.h index 4ea9f5d377..3c14add60d 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 10ba20a833..fdced3f62f 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -245,12 +245,26 @@ void LineEdit::_input_event(InputEvent p_event) { delete_char(); } } break; + case KEY_KP_4: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_left + } case KEY_LEFT: { shift_selection_check_pre(k.mod.shift); set_cursor_pos(get_cursor_pos()-1); shift_selection_check_post(k.mod.shift); } break; + case KEY_KP_6: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_right + } case KEY_RIGHT: { shift_selection_check_pre(k.mod.shift); @@ -271,12 +285,26 @@ void LineEdit::_input_event(InputEvent p_event) { } } break; + case KEY_KP_7: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_home + } case KEY_HOME: { shift_selection_check_pre(k.mod.shift); set_cursor_pos(0); shift_selection_check_post(k.mod.shift); } break; + case KEY_KP_1: { + if (k.unicode != 0) { + handled = false; + break; + } + // numlock disabled. fallthrough to key_end + } case KEY_END: { shift_selection_check_pre(k.mod.shift); @@ -287,26 +315,29 @@ void LineEdit::_input_event(InputEvent p_event) { default: { - if (k.unicode>=32 && k.scancode!=KEY_DELETE) { - - if (editable) { - selection_delete(); - CharType ucodestr[2]={(CharType)k.unicode,0}; - append_at_cursor(ucodestr); - emit_signal("text_changed",text); - _change_notify("text"); - } - - } else { - handled=false; - } + handled=false; } break; } - if (handled) + if (handled) { accept_event(); - else - return; + } else { + if (k.unicode>=32 && k.scancode!=KEY_DELETE) { + + if (editable) { + selection_delete(); + CharType ucodestr[2]={(CharType)k.unicode,0}; + append_at_cursor(ucodestr); + emit_signal("text_changed",text); + _change_notify("text"); + + accept_event(); + } + + } else { + return; + } + } selection.old_shift=k.mod.shift; diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index f28136d66e..bf6459361a 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/margin_container.cpp b/scene/gui/margin_container.cpp index f10ca6353a..fde5df6b72 100644 --- a/scene/gui/margin_container.cpp +++ b/scene/gui/margin_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/margin_container.h b/scene/gui/margin_container.h index 56f2344ea7..df9a5c9361 100644 --- a/scene/gui/margin_container.h +++ b/scene/gui/margin_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index be7a6b468a..26540843de 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h index 47e7382d34..2df632811f 100644 --- a/scene/gui/menu_button.h +++ b/scene/gui/menu_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 3cc5acc1a6..5c8e5a7381 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -304,7 +304,7 @@ void OptionButton::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_item_count"),&OptionButton::get_item_count); ObjectTypeDB::bind_method(_MD("add_separator"),&OptionButton::add_separator); ObjectTypeDB::bind_method(_MD("clear"),&OptionButton::clear); - ObjectTypeDB::bind_method(_MD("select"),&OptionButton::select); + ObjectTypeDB::bind_method(_MD("select","idx"),&OptionButton::select); ObjectTypeDB::bind_method(_MD("get_selected"),&OptionButton::get_selected); ObjectTypeDB::bind_method(_MD("get_selected_ID"),&OptionButton::get_selected_ID); ObjectTypeDB::bind_method(_MD("get_selected_metadata"),&OptionButton::get_selected_metadata); diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index 7d850479aa..34e2bdd384 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp index d9ba20810b..d40daa972c 100644 --- a/scene/gui/panel.cpp +++ b/scene/gui/panel.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel.h b/scene/gui/panel.h index 7e6be62923..ee4bcd139e 100644 --- a/scene/gui/panel.h +++ b/scene/gui/panel.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp index 5ee061356e..bcf75b79f8 100644 --- a/scene/gui/panel_container.cpp +++ b/scene/gui/panel_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel_container.h b/scene/gui/panel_container.h index c09479241c..a40519c9f2 100644 --- a/scene/gui/panel_container.h +++ b/scene/gui/panel_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 5ce7e2e0d3..03ef50c491 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,6 +45,16 @@ void Popup::_notification(int p_what) { emit_signal("popup_hide"); } } + + if (p_what==NOTIFICATION_ENTER_TREE) { + //small helper to make editing of these easier in editor +#ifdef TOOLS_ENABLED + if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + set_as_toplevel(false); + } +#endif + } + } void Popup::_fix_size() { diff --git a/scene/gui/popup.h b/scene/gui/popup.h index 6c72a3c82b..9c66e6d7bd 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 9dc03272b2..a93d8e524f 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -898,7 +898,7 @@ void PopupMenu::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_item_icon","idx","icon"),&PopupMenu::set_item_icon); ObjectTypeDB::bind_method(_MD("set_item_accelerator","idx","accel"),&PopupMenu::set_item_accelerator); ObjectTypeDB::bind_method(_MD("set_item_metadata","idx","metadata"),&PopupMenu::set_item_metadata); - ObjectTypeDB::bind_method(_MD("set_item_checked","idx"),&PopupMenu::set_item_checked); + ObjectTypeDB::bind_method(_MD("set_item_checked","idx","checked"),&PopupMenu::set_item_checked); ObjectTypeDB::bind_method(_MD("set_item_disabled","idx","disabled"),&PopupMenu::set_item_disabled); ObjectTypeDB::bind_method(_MD("set_item_submenu","idx","submenu"),&PopupMenu::set_item_submenu); ObjectTypeDB::bind_method(_MD("set_item_as_separator","idx","enable"),&PopupMenu::set_item_as_separator); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 30223469a3..624f4f542a 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index e7e2c88f4a..fc0e7be34f 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/progress_bar.h b/scene/gui/progress_bar.h index 33b0d5c185..f50df346ac 100644 --- a/scene/gui/progress_bar.h +++ b/scene/gui/progress_bar.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index 7103ee651f..ffcdf98519 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,20 +48,20 @@ void Range::Shared::emit_value_changed() { } } -void Range::_changed_notify() { +void Range::_changed_notify(const char *p_what) { emit_signal("changed",shared->val); update(); - _change_notify(); + _change_notify(p_what); } -void Range::Shared::emit_changed() { +void Range::Shared::emit_changed(const char *p_what) { for (Set<Range*>::Element *E=owners.front();E;E=E->next()) { Range *r=E->get(); if (!r->is_inside_tree()) continue; - r->_changed_notify(); + r->_changed_notify(p_what); } } @@ -77,7 +77,11 @@ void Range::set_val(double p_val) { if (p_val<shared->min) p_val=shared->min; - + + //avoid to set -0 + if (p_val == 0) + p_val = 0; + if (shared->val==p_val) return; @@ -90,20 +94,20 @@ void Range::set_min(double p_min) { shared->min=p_min; set_val(shared->val); - shared->emit_changed(); + shared->emit_changed("range/min"); } void Range::set_max(double p_max) { shared->max=p_max; set_val(shared->val); - shared->emit_changed(); + shared->emit_changed("range/max"); } void Range::set_step(double p_step) { shared->step=p_step; - shared->emit_changed(); + shared->emit_changed("range/step"); } void Range::set_page(double p_page) { @@ -111,7 +115,7 @@ void Range::set_page(double p_page) { shared->page=p_page; set_val(shared->val); - shared->emit_changed(); + shared->emit_changed("range/page"); } double Range::get_val() const { @@ -216,11 +220,10 @@ void Range::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_val"),&Range::get_val); ObjectTypeDB::bind_method(_MD("get_value"),&Range::get_val); ObjectTypeDB::bind_method(_MD("get_min"),&Range::get_min); - ObjectTypeDB::bind_method(_MD("get_max"),&Range::get_max); - ObjectTypeDB::bind_method(_MD("get_step"),&Range::get_step); - ObjectTypeDB::bind_method(_MD("get_page"),&Range::get_page); - ObjectTypeDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value); - ObjectTypeDB::bind_method(_MD("get_rounded_values"),&Range::get_rounded_values); + ObjectTypeDB::bind_method(_MD("get_max"),&Range::get_max); + ObjectTypeDB::bind_method(_MD("get_step"),&Range::get_step); + ObjectTypeDB::bind_method(_MD("get_page"),&Range::get_page); + ObjectTypeDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value); ObjectTypeDB::bind_method(_MD("set_val","value"),&Range::set_val); ObjectTypeDB::bind_method(_MD("set_value","value"),&Range::set_val); ObjectTypeDB::bind_method(_MD("set_min","minimum"),&Range::set_min); @@ -228,7 +231,8 @@ void Range::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_step","step"),&Range::set_step); ObjectTypeDB::bind_method(_MD("set_page","pagesize"),&Range::set_page); ObjectTypeDB::bind_method(_MD("set_unit_value","value"),&Range::set_unit_value); - ObjectTypeDB::bind_method(_MD("set_rounded_values"),&Range::set_rounded_values); + ObjectTypeDB::bind_method(_MD("set_rounded_values","enabled"),&Range::set_rounded_values); + ObjectTypeDB::bind_method(_MD("is_rounded_values"),&Range::is_rounded_values); ObjectTypeDB::bind_method(_MD("set_exp_unit_value","enabled"),&Range::set_exp_unit_value); ObjectTypeDB::bind_method(_MD("is_unit_value_exp"),&Range::is_unit_value_exp); @@ -244,16 +248,18 @@ void Range::_bind_methods() { ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/page" ), _SCS("set_page"), _SCS("get_page") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/value" ), _SCS("set_val"), _SCS("get_val") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded_values" ), _SCS("set_rounded_values"), _SCS("get_rounded_values") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/rounded" ), _SCS("set_rounded_values"), _SCS("is_rounded_values") ); } -void Range::set_rounded_values(bool p){ - _rounded_values = p; +void Range::set_rounded_values(bool p_enable) { + + _rounded_values = p_enable; } -bool Range::get_rounded_values() const{ - return _rounded_values; +bool Range::is_rounded_values() const { + + return _rounded_values; } void Range::set_exp_unit_value(bool p_enable) { diff --git a/scene/gui/range.h b/scene/gui/range.h index 48361ddb0e..d96ecdfb0b 100644 --- a/scene/gui/range.h +++ b/scene/gui/range.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class Range : public Control { bool exp_unit_value; Set<Range*> owners; void emit_value_changed(); - void emit_changed(); + void emit_changed(const char *p_what=""); }; Shared *shared; @@ -55,7 +55,7 @@ class Range : public Control { void _share(Node *p_range); void _value_changed_notify(); - void _changed_notify(); + void _changed_notify(const char *p_what=""); protected: @@ -72,22 +72,23 @@ public: void set_step(double p_step); void set_page(double p_page); void set_unit_value(double p_value); - void set_rounded_values(bool); - + double get_val() const; double get_min() const; double get_max() const; double get_step() const; double get_page() const; double get_unit_value() const; - bool get_rounded_values() const; + + void set_rounded_values(bool p_enable); + bool is_rounded_values() const; void set_exp_unit_value(bool p_enable); bool is_unit_value_exp() const; void share(Range *p_range); void unshare(); - + Range(); ~Range(); diff --git a/scene/gui/reference_frame.cpp b/scene/gui/reference_frame.cpp index b90ea8292d..d037664a62 100644 --- a/scene/gui/reference_frame.cpp +++ b/scene/gui/reference_frame.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/reference_frame.h b/scene/gui/reference_frame.h index 8915b1df0c..5d3694e6e8 100644 --- a/scene/gui/reference_frame.h +++ b/scene/gui/reference_frame.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index c8ac816ffd..d4ac2652dc 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -123,6 +123,8 @@ void RichTextLabel::_process_line(ItemFrame *p_frame,const Vector2& p_ofs,int &y int wofs=margin; int spaces_size=0; + int align_ofs=0; + if (p_mode!=PROCESS_CACHE && align!=ALIGN_FILL) wofs+=line_ofs; @@ -153,7 +155,7 @@ void RichTextLabel::_process_line(ItemFrame *p_frame,const Vector2& p_ofs,int &y case ALIGN_LEFT: l.offset_caches.push_back(0); break;\ case ALIGN_CENTER: l.offset_caches.push_back(((p_width-margin)-used)/2); break;\ case ALIGN_RIGHT: l.offset_caches.push_back(((p_width-margin)-used)); break;\ - case ALIGN_FILL: l.offset_caches.push_back((p_width-margin)-used+spaces_size); break;\ + case ALIGN_FILL: l.offset_caches.push_back((p_width-margin)-used/*+spaces_size*/); break;\ }\ l.height_caches.push_back(line_height);\ l.space_caches.push_back(spaces);\ @@ -163,6 +165,7 @@ void RichTextLabel::_process_line(ItemFrame *p_frame,const Vector2& p_ofs,int &y spaces=0;\ spaces_size=0;\ wofs=begin;\ + align_ofs=0;\ if (p_mode!=PROCESS_CACHE) {\ lh=line<l.height_caches.size()?l.height_caches[line]:1;\ }\ @@ -279,6 +282,8 @@ if (m_height > line_height) {\ if (c[end]==' ') { + fw+=cw; + /* if (p_mode==PROCESS_CACHE) { fw+=cw; } else if (align==ALIGN_FILL && line<l.space_caches.size() && l.space_caches[line]>0) { @@ -287,7 +292,7 @@ if (m_height > line_height) {\ found_space=true; } else { fw+=cw; - } + }*/ } else { fw+=cw; } @@ -295,22 +300,26 @@ if (m_height > line_height) {\ end++; } - ENSURE_WIDTH(w); - //print_line("END: "+String::chr(c[end])+"."); if (end && c[end-1]==' ') { - spaces++; if (p_mode==PROCESS_CACHE) { spaces_size+=font->get_char_size(' ').width; + } else if (align==ALIGN_FILL) { + int ln = MIN(l.offset_caches.size()-1,line); + if (l.space_caches[ln]) { + align_ofs = spaces * l.offset_caches[ln] / l.space_caches[ln]; + } } + spaces++; + /* if (found_space) { int ln = MIN(l.offset_caches.size()-1,line); fw+=l.offset_caches[ln]/l.space_caches[ln]; - } + }*/ } @@ -335,7 +344,7 @@ if (m_height > line_height) {\ cw=tab_size*font->get_char_size(' ').width; } - if (p_click_pos.x-cw/2>p_ofs.x+pofs) { + if (p_click_pos.x-cw/2>p_ofs.x+align_ofs+pofs) { rchar=int((&c[i])-cf); //print_line("GOT: "+itos(rchar)); @@ -371,11 +380,11 @@ if (m_height > line_height) {\ cw = font->get_char_size(c[i],c[i+1]).x; draw_rect(Rect2(p_ofs.x+pofs,p_ofs.y+y,cw,lh),selection_bg); if (visible) - font->draw_char(ci,p_ofs+Point2(pofs,y+lh-(fh-ascent)),c[i],c[i+1],selection_fg); + font->draw_char(ci,p_ofs+Point2(align_ofs+pofs,y+lh-(fh-ascent)),c[i],c[i+1],selection_fg); } else { if (visible) - cw=font->draw_char(ci,p_ofs+Point2(pofs,y+lh-(fh-ascent)),c[i],c[i+1],color); + cw=font->draw_char(ci,p_ofs+Point2(align_ofs+pofs,y+lh-(fh-ascent)),c[i],c[i+1],color); } p_char_count++; @@ -391,7 +400,7 @@ if (m_height > line_height) {\ uc.a*=0.5; //VS::get_singleton()->canvas_item_add_line(ci,Point2(pofs,y+ascent+2),Point2(pofs+cw,y+ascent+2),uc); int uy = y+lh-fh+ascent+2; - VS::get_singleton()->canvas_item_add_line(ci,p_ofs+Point2(pofs,uy),p_ofs+Point2(pofs+cw,uy),uc); + VS::get_singleton()->canvas_item_add_line(ci,p_ofs+Point2(align_ofs+pofs,uy),p_ofs+Point2(align_ofs+pofs+cw,uy),uc); } ofs+=cw; } @@ -429,7 +438,7 @@ if (m_height > line_height) {\ bool visible = visible_characters<0 || p_char_count<visible_characters; if (p_mode==PROCESS_DRAW && visible) { - img->image->draw(ci,p_ofs+Point2(wofs,y+lh-font->get_descent()-img->image->get_height())); + img->image->draw(ci,p_ofs+Point2(align_ofs+wofs,y+lh-font->get_descent()-img->image->get_height())); } p_char_count++; @@ -475,6 +484,7 @@ if (m_height > line_height) {\ int vseparation=get_constant("table_vseparation"); Color ccolor = _find_color(table,p_base_color); Vector2 draw_ofs = Point2(wofs,y); + int max_y=get_size().height; if (p_mode==PROCESS_CACHE) { @@ -547,7 +557,7 @@ if (m_height > line_height) {\ - Point2 offset(hseparation,vseparation); + Point2 offset(align_ofs+hseparation,vseparation); int row_height=0; //draw using computed caches @@ -562,13 +572,22 @@ if (m_height > line_height) {\ int yofs=0; + int lines_h = frame->lines[frame->lines.size()-1].height_accum_cache - (frame->lines[0].height_accum_cache - frame->lines[0].height_cache); + int lines_ofs = p_ofs.y+offset.y+draw_ofs.y; + + bool visible = lines_ofs < get_size().height && lines_ofs+lines_h >=0; + for(int i=0;i<frame->lines.size();i++) { - if (p_mode==PROCESS_DRAW) { - _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_DRAW,cfont,ccolor); - } else if (p_mode==PROCESS_POINTER) { - _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_POINTER,cfont,ccolor,p_click_pos,r_click_item,r_click_char,r_outside); + + if (visible) { + if (p_mode==PROCESS_DRAW) { + _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_DRAW,cfont,ccolor); + } else if (p_mode==PROCESS_POINTER) { + _process_line(frame,p_ofs+offset+draw_ofs+Vector2(0,yofs),ly,table->columns[column].width,i,PROCESS_POINTER,cfont,ccolor,p_click_pos,r_click_item,r_click_char,r_outside); + } } + yofs+=frame->lines[i].height_cache; if (p_mode==PROCESS_CACHE) { frame->lines[i].height_accum_cache=offset.y+draw_ofs.y+frame->lines[i].height_cache; @@ -1929,7 +1948,7 @@ void RichTextLabel::_bind_methods() { ObjectTypeDB::bind_method(_MD("push_meta","data"),&RichTextLabel::push_meta); ObjectTypeDB::bind_method(_MD("push_underline"),&RichTextLabel::push_underline); ObjectTypeDB::bind_method(_MD("push_table","columns"),&RichTextLabel::push_table); - ObjectTypeDB::bind_method(_MD("set_table_column_expand","column","expand"),&RichTextLabel::set_table_column_expand); + ObjectTypeDB::bind_method(_MD("set_table_column_expand","column","expand","ratio"),&RichTextLabel::set_table_column_expand); ObjectTypeDB::bind_method(_MD("push_cell"),&RichTextLabel::push_cell); ObjectTypeDB::bind_method(_MD("pop"),&RichTextLabel::pop); @@ -1946,7 +1965,7 @@ void RichTextLabel::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_v_scroll"),&RichTextLabel::get_v_scroll); - ObjectTypeDB::bind_method(_MD("scroll_to_line"),&RichTextLabel::scroll_to_line); + ObjectTypeDB::bind_method(_MD("scroll_to_line","line"),&RichTextLabel::scroll_to_line); ObjectTypeDB::bind_method(_MD("set_tab_size","spaces"),&RichTextLabel::set_tab_size); ObjectTypeDB::bind_method(_MD("get_tab_size"),&RichTextLabel::get_tab_size); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index bc45ded4ad..635fe87ad4 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index b1fd914fcd..0fd4286f38 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index 367bc3eb53..a629ddc56c 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index e5b5d531a0..a2fc038f9e 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h index b8d37be08c..50ae236714 100644 --- a/scene/gui/scroll_container.h +++ b/scene/gui/scroll_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp index 5e822a10ad..626b093a2f 100644 --- a/scene/gui/separator.cpp +++ b/scene/gui/separator.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/separator.h b/scene/gui/separator.h index 17e9c11e34..7a7dc92b93 100644 --- a/scene/gui/separator.h +++ b/scene/gui/separator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 78b5dabeb4..7ef9d4216b 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/slider.h b/scene/gui/slider.h index 5850c48ce3..f85e6d1807 100644 --- a/scene/gui/slider.h +++ b/scene/gui/slider.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 051a8dd018..38c61ded2c 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h index 1b3bc6d817..acaea822ab 100644 --- a/scene/gui/spin_box.h +++ b/scene/gui/spin_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index a525eb121d..b0d089fcf3 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index d7f56c6fb4..c8cfa3d69b 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 6fa701340d..91d0fc157e 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index 602d248b46..979ce927a0 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 5f4215a1d5..a26acc9c05 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -65,8 +65,8 @@ Size2 Tabs::get_minimum_size() const { ms.height=MAX(bms.height+tab_bg->get_minimum_size().height,ms.height); } - if (tabs[i].close_button.is_valid()) { - Ref<Texture> cb=tabs[i].close_button; + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) { + Ref<Texture> cb=get_icon("close"); Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size(); bms.width+=get_constant("hseparation"); ms.width+=bms.width; @@ -108,14 +108,6 @@ void Tabs::_input_event(const InputEvent& p_event) { for(int i=0;i<tabs.size();i++) { // test hovering tab to display close button if policy says so - if (cb_displaypolicy == SHOW_HOVER) { - int ofs=tabs[i].ofs_cache; - int size = tabs[i].ofs_cache; - if (pos.x >=tabs[i].ofs_cache && pos.x<tabs[i].ofs_cache+tabs[i].size_cache) { - hover=i; - } - } - // test hovering right button and close button if (tabs[i].rb_rect.has_point(pos)) { @@ -260,12 +252,14 @@ void Tabs::_notification(int p_what) { Ref<Font> font = get_font("font"); Color color_fg = get_color("font_color_fg"); Color color_bg = get_color("font_color_bg"); + Ref<Texture> close=get_icon("close"); int h = get_size().height; int label_valign_fg = get_constant("label_valign_fg"); int label_valign_bg = get_constant("label_valign_bg"); + int w=0; int mw = 0; @@ -277,32 +271,12 @@ void Tabs::_notification(int p_what) { for(int i=0;i<tabs.size();i++) { - Ref<Texture> tex = tabs[i].icon; - if (tex.is_valid()) { - if (tabs[i].text!="") - mw+=get_constant("hseparation"); + int sz = get_tab_width(i); + + tabs[i].ofs_cache=mw; + mw+=sz; - } - mw+=font->get_string_size(tabs[i].text).width; - if (current==i) - mw+=tab_fg->get_minimum_size().width; - else - mw+=tab_bg->get_minimum_size().width; - - if (tabs[i].right_button.is_valid()) { - Ref<Texture> rb=tabs[i].right_button; - Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size(); - bms.width+=get_constant("hseparation"); - - mw+=bms.width; - } - if (tabs[i].close_button.is_valid()) { - Ref<Texture> cb=tabs[i].close_button; - Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size(); - bms.width+=get_constant("hseparation"); - mw+=bms.width; - } } } @@ -364,56 +338,15 @@ void Tabs::_notification(int p_what) { } - // Close button - switch (cb_displaypolicy) { - case SHOW_ALWAYS: { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> rb=tabs[i].close_button; - - lsize+=get_constant("hseparation"); - //lsize+=style->get_margin(MARGIN_LEFT); - lsize+=rb->get_width(); - //lsize+=style->get_margin(MARGIN_RIGHT); - } - } break; - case SHOW_ACTIVE_ONLY: { - if (i==current) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> rb=tabs[i].close_button; - - lsize+=get_constant("hseparation"); - //lsize+=style->get_margin(MARGIN_LEFT); - lsize+=rb->get_width(); - //lsize+=style->get_margin(MARGIN_RIGHT); - - } - } - } break; - case SHOW_HOVER: { - if (i==current || i==hover) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> rb=tabs[i].close_button; - - lsize+=get_constant("hseparation"); - //lsize+=style->get_margin(MARGIN_LEFT); - lsize+=rb->get_width(); - //lsize+=style->get_margin(MARGIN_RIGHT); - - } - } - } break; - case SHOW_NEVER: // by default, never show close button - default: { - // do nothing - } break; + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) { + lsize+=get_constant("hseparation"); + //lsize+=style->get_margin(MARGIN_LEFT); + lsize+=close->get_width(); + //lsize+=style->get_margin(MARGIN_RIGHT); } - if (w+lsize > limit) { max_drawn_tab=i-1; missing_right=true; @@ -487,100 +420,31 @@ void Tabs::_notification(int p_what) { } + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i==current)) { + Ref<StyleBox> style = get_stylebox("button"); + Ref<Texture> cb=close; - // Close button - switch (cb_displaypolicy) { - case SHOW_ALWAYS: { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> cb=tabs[i].close_button; - - w+=get_constant("hseparation"); - - Rect2 cb_rect; - cb_rect.size=style->get_minimum_size()+cb->get_size(); - cb_rect.pos.x=w; - cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - - if (cb_hover==i) { - if (cb_pressing) - get_stylebox("button_pressed")->draw(ci,cb_rect); - else - style->draw(ci,cb_rect); - } + w+=get_constant("hseparation"); - //w+=style->get_margin(MARGIN_LEFT); + Rect2 cb_rect; + cb_rect.size=style->get_minimum_size()+cb->get_size(); + cb_rect.pos.x=w; + cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); - w+=cb->get_width(); - //w+=style->get_margin(MARGIN_RIGHT); - tabs[i].cb_rect=cb_rect; - } - } break; - case SHOW_ACTIVE_ONLY: { - if (current==i) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> cb=tabs[i].close_button; - - w+=get_constant("hseparation"); - - Rect2 cb_rect; - cb_rect.size=style->get_minimum_size()+cb->get_size(); - cb_rect.pos.x=w; - cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - - if (cb_hover==i) { - if (cb_pressing) - get_stylebox("button_pressed")->draw(ci,cb_rect); - else - style->draw(ci,cb_rect); - } - - //w+=style->get_margin(MARGIN_LEFT); - - cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); - w+=cb->get_width(); - //w+=style->get_margin(MARGIN_RIGHT); - tabs[i].cb_rect=cb_rect; - } - } - } break; - case SHOW_HOVER: { - if (current==i || hover==i) { - if (tabs[i].close_button.is_valid()) { - Ref<StyleBox> style = get_stylebox("button"); - Ref<Texture> cb=tabs[i].close_button; - - w+=get_constant("hseparation"); - - Rect2 cb_rect; - cb_rect.size=style->get_minimum_size()+cb->get_size(); - cb_rect.pos.x=w; - cb_rect.pos.y=sb->get_margin(MARGIN_TOP)+((sb_rect.size.y-sb_ms.y)-(cb_rect.size.y))/2; - - if (cb_hover==i) { - if (cb_pressing) - get_stylebox("button_pressed")->draw(ci,cb_rect); - else - style->draw(ci,cb_rect); - } - - //w+=style->get_margin(MARGIN_LEFT); - - cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); - w+=cb->get_width(); - //w+=style->get_margin(MARGIN_RIGHT); - tabs[i].cb_rect=cb_rect; - } + if (cb_hover==i) { + if (cb_pressing) + get_stylebox("button_pressed")->draw(ci,cb_rect); + else + style->draw(ci,cb_rect); } - } break; - case SHOW_NEVER: - default: { - // show nothing - } break; + //w+=style->get_margin(MARGIN_LEFT); + + cb->draw(ci,Point2i( w,cb_rect.pos.y+style->get_margin(MARGIN_TOP) )); + w+=cb->get_width(); + //w+=style->get_margin(MARGIN_RIGHT); + tabs[i].cb_rect=cb_rect; } w+=sb->get_margin(MARGIN_RIGHT); @@ -687,20 +551,6 @@ Ref<Texture> Tabs::get_tab_right_button(int p_tab) const{ } -void Tabs::set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button) { - ERR_FAIL_INDEX(p_tab, tabs.size()); - tabs[p_tab].close_button=p_close_button; - update(); - minimum_size_changed(); -} - - -Ref<Texture> Tabs::get_tab_close_button(int p_tab) const{ - - ERR_FAIL_INDEX_V(p_tab,tabs.size(),Ref<Texture>()); - return tabs[p_tab].close_button; - -} void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) { @@ -708,8 +558,6 @@ void Tabs::add_tab(const String& p_str,const Ref<Texture>& p_icon) { t.text=p_str; t.icon=p_icon; - t.close_button = get_icon("Close","EditorIcons"); - tabs.push_back(t); update(); @@ -741,10 +589,6 @@ void Tabs::remove_tab(int p_idx) { } -void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy) { - cb_displaypolicy = p_cb_displaypolicy; -} - void Tabs::set_tab_align(TabAlign p_align) { @@ -757,6 +601,94 @@ Tabs::TabAlign Tabs::get_tab_align() const { return tab_align; } +int Tabs::get_tab_width(int p_idx) const { + + ERR_FAIL_INDEX_V(p_idx,tabs.size(),0); + + Ref<StyleBox> tab_bg = get_stylebox("tab_bg"); + Ref<StyleBox> tab_fg = get_stylebox("tab_fg"); + Ref<Font> font = get_font("font"); + Ref<Texture> close=get_icon("close"); + + int x=0; + + Ref<Texture> tex = tabs[p_idx].icon; + if (tex.is_valid()) { + if (tabs[p_idx].text!="") + x+=get_constant("hseparation"); + + } + + + x+=font->get_string_size(tabs[p_idx].text).width; + if (current==p_idx) + x+=tab_fg->get_minimum_size().width; + else + x+=tab_bg->get_minimum_size().width; + + if (tabs[p_idx].right_button.is_valid()) { + print_line("has right"); + Ref<Texture> rb=tabs[p_idx].right_button; + Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size(); + bms.width+=get_constant("hseparation"); + + x+=bms.width; + } + + if (cb_displaypolicy==CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy==CLOSE_BUTTON_SHOW_ACTIVE_ONLY && p_idx==current)) { + + Size2 bms = close->get_size();//+get_stylebox("button")->get_minimum_size(); + bms.width+=get_constant("hseparation"); + x+=bms.width; + } + + return x; +} + +void Tabs::ensure_tab_visible(int p_idx) { + + if (!is_inside_tree()) + return; + + ERR_FAIL_INDEX(p_idx,tabs.size()); + + if (p_idx<=offset) { + offset=p_idx; + update(); + return; + } + + Ref<Texture> incr = get_icon("increment"); + Ref<Texture> decr = get_icon("decrement"); + + int limit=get_size().width-incr->get_width()-decr->get_width(); + + + + int x=0; + for(int i=0;i<tabs.size();i++) { + + if (i<offset) + continue; + + int sz = get_tab_width(i); + tabs[i].x_cache=x; + tabs[i].x_size_cache=sz; + x+=sz; + + } + + while(offset<tabs.size() && ( (tabs[p_idx].x_cache + tabs[p_idx].x_size_cache) - tabs[offset].x_cache) > limit) { + offset++; + } + + update(); +} + +void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) { + cb_displaypolicy=p_policy; + update(); +} void Tabs::_bind_methods() { @@ -772,6 +704,7 @@ void Tabs::_bind_methods() { ObjectTypeDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab); ObjectTypeDB::bind_method(_MD("set_tab_align","align"),&Tabs::set_tab_align); ObjectTypeDB::bind_method(_MD("get_tab_align"),&Tabs::get_tab_align); + ObjectTypeDB::bind_method(_MD("ensure_tab_visible","idx"),&Tabs::ensure_tab_visible); ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab"))); ADD_SIGNAL(MethodInfo("right_button_pressed",PropertyInfo(Variant::INT,"tab"))); @@ -784,10 +717,10 @@ void Tabs::_bind_methods() { BIND_CONSTANT( ALIGN_CENTER ); BIND_CONSTANT( ALIGN_RIGHT ); - BIND_CONSTANT( SHOW_ACTIVE_ONLY ); - BIND_CONSTANT( SHOW_ALWAYS ); - BIND_CONSTANT( SHOW_HOVER ); - BIND_CONSTANT( SHOW_NEVER ); + BIND_CONSTANT( CLOSE_BUTTON_SHOW_ACTIVE_ONLY ); + BIND_CONSTANT( CLOSE_BUTTON_SHOW_ALWAYS ); + BIND_CONSTANT( CLOSE_BUTTON_SHOW_NEVER ); + } @@ -801,7 +734,9 @@ Tabs::Tabs() { cb_hover=-1; cb_pressing=false; - cb_displaypolicy = SHOW_NEVER; // Default : no close button + cb_displaypolicy = CLOSE_BUTTON_SHOW_NEVER; // Default : no close button offset=0; max_drawn_tab=0; + + } diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 48fbed1f76..7f85280853 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,10 +45,9 @@ public: enum CloseButtonDisplayPolicy { - SHOW_ALWAYS, - SHOW_ACTIVE_ONLY, - SHOW_HOVER, - SHOW_NEVER + CLOSE_BUTTON_SHOW_NEVER, + CLOSE_BUTTON_SHOW_ACTIVE_ONLY, + CLOSE_BUTTON_SHOW_ALWAYS, }; private: @@ -59,10 +58,13 @@ private: Ref<Texture> icon; int ofs_cache; int size_cache; + int x_cache; + int x_size_cache; + Ref<Texture> right_button; Rect2 rb_rect; - Ref<Texture> close_button; Rect2 cb_rect; + }; @@ -85,6 +87,8 @@ private: int hover; // hovered tab + int get_tab_width(int p_idx) const; + protected: void _input_event(const InputEvent& p_event); @@ -104,13 +108,11 @@ public: void set_tab_right_button(int p_tab,const Ref<Texture>& p_right_button); Ref<Texture> get_tab_right_button(int p_tab) const; - void set_tab_close_button(int p_tab, const Ref<Texture>& p_close_button); - Ref<Texture> get_tab_close_button(int p_tab) const; - void set_tab_close_display_policy(CloseButtonDisplayPolicy p_cb_displaypolicy); - void set_tab_align(TabAlign p_align); TabAlign get_tab_align() const; + void set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy); + int get_tab_count() const; void set_current_tab(int p_current); int get_current_tab() const; @@ -119,6 +121,8 @@ public: void clear_tabs(); + void ensure_tab_visible(int p_idx); + Size2 get_minimum_size() const; Tabs(); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 29969b65e6..7f7c8c023c 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -839,7 +839,7 @@ void TextEdit::_notification(int p_what) { } - if (cursor.column==str.length() && cursor.line==line) { + if (cursor.column==str.length() && cursor.line==line && (char_ofs+char_margin)>=xmargin_beg) { cursor_pos=Point2i( char_ofs+char_margin, ofs_y ); VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.font_color); @@ -1740,6 +1740,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } } break; + case KEY_KP_4: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_left + } case KEY_LEFT: { if (k.mod.shift) @@ -1786,6 +1793,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _post_shift_selection(); } break; + case KEY_KP_6: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_right + } case KEY_RIGHT: { if (k.mod.shift) @@ -1829,6 +1843,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _post_shift_selection(); } break; + case KEY_KP_8: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_up + } case KEY_UP: { if (k.mod.shift) @@ -1849,6 +1870,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _cancel_code_hint(); } break; + case KEY_KP_2: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_down + } case KEY_DOWN: { if (k.mod.shift) @@ -1937,6 +1965,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { update(); } break; + case KEY_KP_7: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_home + } #ifdef APPLE_STYLE_KEYS case KEY_HOME: { @@ -1950,18 +1985,6 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { _post_shift_selection(); } break; - case KEY_END: { - - if (k.mod.shift) - _pre_shift_selection(); - - cursor_set_line(text.size()-1); - - if (k.mod.shift) - _post_shift_selection(); - - } break; - #else case KEY_HOME: { @@ -1992,6 +2015,27 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { completion_hint=""; } break; +#endif + case KEY_KP_1: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_end + } +#ifdef APPLE_STYLE_KEYS + case KEY_END: { + + if (k.mod.shift) + _pre_shift_selection(); + + cursor_set_line(text.size()-1); + + if (k.mod.shift) + _post_shift_selection(); + + } break; +#else case KEY_END: { if (k.mod.shift) @@ -2009,6 +2053,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } break; #endif + case KEY_KP_9: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_pageup + } case KEY_PAGEUP: { if (k.mod.shift) @@ -2024,6 +2075,13 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } break; + case KEY_KP_3: { + if (k.unicode != 0) { + scancode_handled = false; + break; + } + // numlock disabled. fallthrough to key_pageup + } case KEY_PAGEDOWN: { if (k.mod.shift) @@ -3742,10 +3800,10 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_line_count"),&TextEdit::get_line_count); ObjectTypeDB::bind_method(_MD("get_text"),&TextEdit::get_text); - ObjectTypeDB::bind_method(_MD("get_line"),&TextEdit::get_line); + ObjectTypeDB::bind_method(_MD("get_line","line"),&TextEdit::get_line); - ObjectTypeDB::bind_method(_MD("cursor_set_column","column"),&TextEdit::cursor_set_column); - ObjectTypeDB::bind_method(_MD("cursor_set_line","line"),&TextEdit::cursor_set_line); + ObjectTypeDB::bind_method(_MD("cursor_set_column","column","adjust_viewport"),&TextEdit::cursor_set_column,DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("cursor_set_line","line","adjust_viewport"),&TextEdit::cursor_set_line,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("cursor_get_column"),&TextEdit::cursor_get_column); ObjectTypeDB::bind_method(_MD("cursor_get_line"),&TextEdit::cursor_get_line); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index f8e8ef3b9a..2ca5ab054a 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index 7e6bf2cbdf..c885b2d73e 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,22 +42,22 @@ Size2 TextureButton::get_minimum_size() const { else rscale= hover->get_size(); } else - rscale= pressed->get_size()*scale; + rscale=pressed->get_size(); } else rscale= normal->get_size(); - return rscale*scale; + return rscale*scale.abs(); } bool TextureButton::has_point(const Point2& p_point) const { - if (scale[0] <= 0 || scale[1] <= 0) { + if (scale[0] == 0 || scale[1] == 0) { return false; } - Point2 ppos = p_point/scale; + Point2 ppos = p_point/scale.abs(); if (click_mask.is_valid()) { diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index 49687986c4..0556df8061 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_frame.cpp index 5a6bc86638..73fecf591a 100644 --- a/scene/gui/texture_frame.cpp +++ b/scene/gui/texture_frame.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_frame.h b/scene/gui/texture_frame.h index 0ccbf5a591..f6fe6ae89d 100644 --- a/scene/gui/texture_frame.h +++ b/scene/gui/texture_frame.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index c8930add6e..e05d35a81d 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/texture_progress.h b/scene/gui/texture_progress.h index 7187fd5f07..a4bbd71e94 100644 --- a/scene/gui/texture_progress.h +++ b/scene/gui/texture_progress.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tool_button.cpp b/scene/gui/tool_button.cpp index d5bcb73476..fd27800384 100644 --- a/scene/gui/tool_button.cpp +++ b/scene/gui/tool_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tool_button.h b/scene/gui/tool_button.h index 648d776b51..f48d7d413c 100644 --- a/scene/gui/tool_button.h +++ b/scene/gui/tool_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 1b204cff65..8d28180490 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -672,7 +672,7 @@ void TreeItem::_bind_methods() { ObjectTypeDB::bind_method(_MD("clear_custom_bg_color","column"),&TreeItem::clear_custom_bg_color); ObjectTypeDB::bind_method(_MD("get_custom_bg_color","column"),&TreeItem::get_custom_bg_color); - ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture"),&TreeItem::add_button); + ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture","button_idx"),&TreeItem::add_button); ObjectTypeDB::bind_method(_MD("get_button_count","column"),&TreeItem::get_button_count); ObjectTypeDB::bind_method(_MD("get_button:Texture","column","button_idx"),&TreeItem::get_button); ObjectTypeDB::bind_method(_MD("erase_button","column","button_idx"),&TreeItem::erase_button); @@ -2128,8 +2128,7 @@ void Tree::_input_event(InputEvent p_event) { float diff_y = -b.relative_y; diff_y=Math::pow(ABS(diff_y),1.8)*SGN(diff_y); diff_y*=0.1; - range_drag_base=CLAMP(range_drag_base + c.step * diff_y, c.min, c.max); - + range_drag_base=CLAMP(range_drag_base + c.step * diff_y, c.min, c.max); popup_edited_item->set_range(popup_edited_item_col,range_drag_base); item_edited(popup_edited_item_col,popup_edited_item); @@ -3193,11 +3192,11 @@ void Tree::_bind_methods() { ObjectTypeDB::bind_method(_MD("create_item:TreeItem","parent:TreeItem"),&Tree::_create_item,DEFVAL((Object*)NULL)); ObjectTypeDB::bind_method(_MD("get_root:TreeItem"),&Tree::get_root); - ObjectTypeDB::bind_method(_MD("set_column_min_width"),&Tree::set_column_min_width); - ObjectTypeDB::bind_method(_MD("set_column_expand"),&Tree::set_column_expand); - ObjectTypeDB::bind_method(_MD("get_column_width"),&Tree::get_column_width); + ObjectTypeDB::bind_method(_MD("set_column_min_width","column","min_width"),&Tree::set_column_min_width); + ObjectTypeDB::bind_method(_MD("set_column_expand","column","expand"),&Tree::set_column_expand); + ObjectTypeDB::bind_method(_MD("get_column_width","column"),&Tree::get_column_width); - ObjectTypeDB::bind_method(_MD("set_hide_root"),&Tree::set_hide_root); + ObjectTypeDB::bind_method(_MD("set_hide_root","enable"),&Tree::set_hide_root); ObjectTypeDB::bind_method(_MD("get_next_selected:TreeItem","from:TreeItem"),&Tree::_get_next_selected); ObjectTypeDB::bind_method(_MD("get_selected:TreeItem"),&Tree::get_selected); ObjectTypeDB::bind_method(_MD("get_selected_column"),&Tree::get_selected_column); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 55ccc16d01..54e6a9c6b9 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 58683a07ad..517cd414c5 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -271,6 +271,7 @@ void VideoPlayer::set_paused(bool p_paused) { playback->set_paused(p_paused); set_process(!p_paused); }; + last_audio_time = 0; }; bool VideoPlayer::is_paused() const { diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index b14d3936b9..9ce1ba78f4 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp index f67d50b56c..c80975dbfe 100644 --- a/scene/io/resource_format_image.cpp +++ b/scene/io/resource_format_image.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_image.h b/scene/io/resource_format_image.h index b5ec5a1200..6388aa641f 100644 --- a/scene/io/resource_format_image.h +++ b/scene/io/resource_format_image.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp index 00b800b28b..9cf349eb7b 100644 --- a/scene/io/resource_format_wav.cpp +++ b/scene/io/resource_format_wav.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_wav.h b/scene/io/resource_format_wav.h index a74da041c1..4918d5c2e7 100644 --- a/scene/io/resource_format_wav.h +++ b/scene/io/resource_format_wav.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index ee3d7f5afd..e921795628 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index edd00c1a7a..809b3fae7f 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/misc.cpp b/scene/main/misc.cpp index 108621baa5..35d8b4cdfb 100644 --- a/scene/main/misc.cpp +++ b/scene/main/misc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/misc.h b/scene/main/misc.h index e7894aa68d..1c5bc7208e 100644 --- a/scene/main/misc.h +++ b/scene/main/misc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/node.cpp b/scene/main/node.cpp index a832162994..0780a4bdaf 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -802,6 +802,7 @@ void Node::remove_child(Node *p_child) { } ERR_FAIL_COND( idx==-1 ); + //ERR_FAIL_COND( p_child->data.blocked > 0 ); //if (data.scene) { does not matter @@ -856,7 +857,10 @@ Node *Node::_get_child_by_name(const StringName& p_name) const { Node *Node::_get_node(const NodePath& p_path) const { - ERR_FAIL_COND_V( !data.inside_tree && p_path.is_absolute(), NULL ); + if (!data.inside_tree && p_path.is_absolute()) { + ERR_EXPLAIN("Can't use get_node() with absolute paths from outside the active scene tree."); + ERR_FAIL_V(NULL); + } Node *current=NULL; Node *root=NULL; @@ -2001,7 +2005,7 @@ void Node::_bind_methods() { ObjectTypeDB::bind_method(_MD("is_greater_than","node:Node"),&Node::is_greater_than); ObjectTypeDB::bind_method(_MD("get_path"),&Node::get_path); ObjectTypeDB::bind_method(_MD("get_path_to","node:Node"),&Node::get_path_to); - ObjectTypeDB::bind_method(_MD("add_to_group","group"),&Node::add_to_group,DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("add_to_group","group","persistent"),&Node::add_to_group,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("remove_from_group","group"),&Node::remove_from_group); ObjectTypeDB::bind_method(_MD("is_in_group","group"),&Node::is_in_group); ObjectTypeDB::bind_method(_MD("move_child","child_node:Node","to_pos"),&Node::move_child); @@ -2063,6 +2067,8 @@ void Node::_bind_methods() { BIND_CONSTANT( NOTIFICATION_UNPARENTED ); BIND_CONSTANT( NOTIFICATION_PAUSED ); BIND_CONSTANT( NOTIFICATION_UNPAUSED ); + BIND_CONSTANT( NOTIFICATION_INSTANCED ); + BIND_CONSTANT( PAUSE_MODE_INHERIT ); diff --git a/scene/main/node.h b/scene/main/node.h index 196c4a06eb..4d05dd381c 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index f49f626e78..219eea770a 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h index b3e7496fb7..b06e558b59 100644 --- a/scene/main/resource_preloader.h +++ b/scene/main/resource_preloader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index adf053f5c9..a18eb1249f 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -620,6 +620,14 @@ void SceneTree::set_editor_hint(bool p_enabled) { editor_hint=p_enabled; } +bool SceneTree::is_node_being_edited(const Node* p_node) const { +#ifdef TOOLS_ENABLED + return editor_hint && edited_scene_root && edited_scene_root->is_a_parent_of(p_node); +#else + return false; +#endif +} + bool SceneTree::is_editor_hint() const { return editor_hint; @@ -965,6 +973,10 @@ Array SceneTree::_get_nodes_in_group(const StringName& p_group) { return ret; } +bool SceneTree::has_group(const StringName& p_identifier) const { + + return group_map.has(p_identifier); +} void SceneTree::get_nodes_in_group(const StringName& p_group,List<Node*> *p_list) { @@ -1586,9 +1598,10 @@ void SceneTree::_bind_methods() { ObjectTypeDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); ObjectTypeDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group); - ObjectTypeDB::bind_method(_MD("get_nodes_in_group"),&SceneTree::_get_nodes_in_group); + ObjectTypeDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root); + ObjectTypeDB::bind_method(_MD("has_group","name"),&SceneTree::has_group); ObjectTypeDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit); diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h index 8d9021d24e..c6fc124345 100644 --- a/scene/main/scene_main_loop.h +++ b/scene/main/scene_main_loop.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -279,6 +279,8 @@ public: void set_editor_hint(bool p_enabled); bool is_editor_hint() const; + bool is_node_being_edited(const Node* p_node) const; + void set_pause(bool p_enabled); bool is_paused() const; @@ -318,6 +320,8 @@ public: void queue_delete(Object *p_object); void get_nodes_in_group(const StringName& p_group,List<Node*> *p_list); + bool has_group(const StringName& p_identifier) const; + void set_screen_stretch(StretchMode p_mode,StretchAspect p_aspect,const Size2 p_minsize); diff --git a/scene/main/scene_singleton.cpp b/scene/main/scene_singleton.cpp index 69eb6e24d9..3dcc6b1204 100644 --- a/scene/main/scene_singleton.cpp +++ b/scene/main/scene_singleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/scene_singleton.h b/scene/main/scene_singleton.h index 25157a26ac..0b209f7944 100644 --- a/scene/main/scene_singleton.h +++ b/scene/main/scene_singleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 1bd22a9db1..2c23b62b12 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/timer.h b/scene/main/timer.h index 4b9cecba84..0baea76fad 100644 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index d19b5767c2..330f855006 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -577,7 +577,7 @@ void Viewport::_notification(int p_what) { PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space()); if (space) { - bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF); + bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true); ObjectID new_collider=0; if (col) { @@ -617,7 +617,7 @@ void Viewport::_notification(int p_what) { PhysicsDirectSpaceState *space = PhysicsServer::get_singleton()->space_get_direct_state(find_world()->get_space()); if (space) { - bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF); + bool col = space->intersect_ray(from,from+dir*10000,result,Set<RID>(),0xFFFFFFFF,0xFFFFFFFF,true); ObjectID new_collider=0; if (col) { if (result.collider) { @@ -1456,7 +1456,7 @@ void Viewport::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d); ObjectTypeDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d); - ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect"), &Viewport::set_render_target_to_screen_rect); + ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect","rect"), &Viewport::set_render_target_to_screen_rect); ObjectTypeDB::bind_method(_MD("get_mouse_pos"), &Viewport::get_mouse_pos); ObjectTypeDB::bind_method(_MD("warp_mouse","to_pos"), &Viewport::warp_mouse); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 843a1fd9b7..7d86c5f334 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index b3a9ab922e..6c4fe1be79 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -221,7 +221,7 @@ static ResourceFormatLoaderImage *resource_loader_image=NULL; static ResourceFormatLoaderWAV *resource_loader_wav=NULL; -static ResourceFormatLoaderBitMap *resource_loader_bitmap=NULL; + #ifdef TOOLS_ENABLED @@ -249,8 +249,6 @@ void register_scene_types() { resource_loader_wav = memnew( ResourceFormatLoaderWAV ); ResourceLoader::add_resource_format_loader( resource_loader_wav ); - resource_loader_bitmap = memnew( ResourceFormatLoaderBitMap ); - ResourceLoader::add_resource_format_loader( resource_loader_bitmap ); #ifdef TOOLS_ENABLED @@ -631,7 +629,6 @@ void unregister_scene_types() { memdelete( resource_loader_image ); memdelete( resource_loader_wav ); - memdelete( resource_loader_bitmap ); #ifdef TOOLS_ENABLED diff --git a/scene/register_scene_types.h b/scene/register_scene_types.h index 7d36dbc101..15e1eb2980 100644 --- a/scene/register_scene_types.h +++ b/scene/register_scene_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index afd4dc5304..e8bd6c14ad 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 256826a4bb..405b8b6a05 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream.cpp b/scene/resources/audio_stream.cpp index 569ed8620d..1dd702abd2 100644 --- a/scene/resources/audio_stream.cpp +++ b/scene/resources/audio_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream.h b/scene/resources/audio_stream.h index b16e62b8c7..a4a2ad7599 100644 --- a/scene/resources/audio_stream.h +++ b/scene/resources/audio_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp index edbca60bd3..3e10048f57 100644 --- a/scene/resources/audio_stream_resampled.cpp +++ b/scene/resources/audio_stream_resampled.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream_resampled.h b/scene/resources/audio_stream_resampled.h index 570c311878..64f9d17d88 100644 --- a/scene/resources/audio_stream_resampled.h +++ b/scene/resources/audio_stream_resampled.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index 9a6452797a..f5bfce3ef8 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -204,57 +204,3 @@ BitMap::BitMap() { ////////////////////////////////////// - -RES ResourceFormatLoaderBitMap::load(const String &p_path, const String& p_original_path, Error *r_error) { - - if (r_error) - *r_error=ERR_FILE_CANT_OPEN; - - BitMap* ptr = memnew(BitMap); - Ref<BitMap> bitmap( ptr ); - - - Image image; - - Error err = ImageLoader::load_image(p_path,&image); - - ERR_EXPLAIN("Failed loading image for BitMap: "+p_path); - ERR_FAIL_COND_V(err, RES()); - - bitmap->create_from_image_alpha(image); - if (r_error) - *r_error=OK; - - return bitmap; - -} - -bool ResourceFormatLoaderBitMap::handles_type(const String& p_type) const { - - return (p_type=="BitMap"); -} - -void ResourceFormatLoaderBitMap::get_recognized_extensions(List<String> *p_extensions) const { - - ImageLoader::get_recognized_extensions(p_extensions); -} - -String ResourceFormatLoaderBitMap::get_resource_type(const String &p_path) const { - - List<String> extensions; - ImageLoader::get_recognized_extensions(&extensions); - String ext=p_path.extension().to_lower(); - for(List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get()==ext) - return "BitMap"; - } - return ""; -} - - -ResourceFormatLoaderBitMap::ResourceFormatLoaderBitMap() { - - -} - - diff --git a/scene/resources/bit_mask.h b/scene/resources/bit_mask.h index a6b29bb919..b245ea1542 100644 --- a/scene/resources/bit_mask.h +++ b/scene/resources/bit_mask.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,16 +62,5 @@ public: BitMap(); }; -class ResourceFormatLoaderBitMap : 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; - - ResourceFormatLoaderBitMap(); -}; #endif // BIT_MASK_H diff --git a/scene/resources/bounds.cpp b/scene/resources/bounds.cpp index 7382d60535..65ce5e49e8 100644 --- a/scene/resources/bounds.cpp +++ b/scene/resources/bounds.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/bounds.h b/scene/resources/bounds.h index 68aca6f6a0..a1610e2b57 100644 --- a/scene/resources/bounds.h +++ b/scene/resources/bounds.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index ba29a1b601..9a6fedeb0b 100644 --- a/scene/resources/box_shape.cpp +++ b/scene/resources/box_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/box_shape.h b/scene/resources/box_shape.h index 9667515657..88fca65eea 100644 --- a/scene/resources/box_shape.h +++ b/scene/resources/box_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/canvas.cpp b/scene/resources/canvas.cpp index 51953d9683..0c87d0473d 100644 --- a/scene/resources/canvas.cpp +++ b/scene/resources/canvas.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/canvas.h b/scene/resources/canvas.h index 71dc080e64..5120301a67 100644 --- a/scene/resources/canvas.h +++ b/scene/resources/canvas.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp index 67ceed6be0..4c53645d2d 100644 --- a/scene/resources/capsule_shape.cpp +++ b/scene/resources/capsule_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape.h b/scene/resources/capsule_shape.h index e516d0e3c7..4263c3a554 100644 --- a/scene/resources/capsule_shape.h +++ b/scene/resources/capsule_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 923a509ad5..1887ec11d7 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/capsule_shape_2d.h b/scene/resources/capsule_shape_2d.h index dc679966f9..18b5c12a52 100644 --- a/scene/resources/capsule_shape_2d.h +++ b/scene/resources/capsule_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index c77395612c..7171af9670 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/circle_shape_2d.h b/scene/resources/circle_shape_2d.h index a5902b189c..c36e00d106 100644 --- a/scene/resources/circle_shape_2d.h +++ b/scene/resources/circle_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index 7aeac04a22..34bea038f4 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape.h b/scene/resources/concave_polygon_shape.h index fae98ee046..a4845e9220 100644 --- a/scene/resources/concave_polygon_shape.h +++ b/scene/resources/concave_polygon_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index 01b7531f14..2c66155cb8 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/concave_polygon_shape_2d.h index 29666c88c1..89b8914741 100644 --- a/scene/resources/concave_polygon_shape_2d.h +++ b/scene/resources/concave_polygon_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index 6a405c9c94..7fcc9e97c0 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape.h b/scene/resources/convex_polygon_shape.h index 48454deb2b..a4e504ee24 100644 --- a/scene/resources/convex_polygon_shape.h +++ b/scene/resources/convex_polygon_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index 86cf818ac3..5c0dadefc2 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/convex_polygon_shape_2d.h b/scene/resources/convex_polygon_shape_2d.h index 1af7787f67..e1792a1075 100644 --- a/scene/resources/convex_polygon_shape_2d.h +++ b/scene/resources/convex_polygon_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index c1a389942f..7dec4029fc 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 4818632dc3..262f22b7d1 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 68033b6682..f0b3519b4a 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ @@ -543,7 +543,11 @@ void make_default_theme() { t->set_constant("close_v_ofs","WindowDialog", 20 ); t->set_constant("titlebar_height","WindowDialog", 18 ); t->set_constant("title_height","WindowDialog", 20 ); - + + + // File Dialog + + t->set_icon("reload","FileDialog",make_icon( icon_reload_png )); // Popup @@ -713,6 +717,7 @@ void make_default_theme() { t->set_icon("increment_hilite","Tabs",make_icon( scroll_button_right_hl_png)); t->set_icon("decrement","Tabs",make_icon( scroll_button_left_png)); t->set_icon("decrement_hilite","Tabs",make_icon( scroll_button_left_hl_png)); + t->set_icon("close","Tabs",make_icon( tab_close_png)); t->set_font("font","Tabs", default_font ); diff --git a/scene/resources/default_theme/default_theme.h b/scene/resources/default_theme/default_theme.h index ddd8af46f0..44569ba192 100644 --- a/scene/resources/default_theme/default_theme.h +++ b/scene/resources/default_theme/default_theme.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /*************************************************/ /* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ +/* (c) 2007-2016 Juan Linietsky, Ariel Manzur */ /* All Rights Reserved. */ /*************************************************/ diff --git a/scene/resources/default_theme/icon_reload.png b/scene/resources/default_theme/icon_reload.png Binary files differnew file mode 100644 index 0000000000..f7c6530d77 --- /dev/null +++ b/scene/resources/default_theme/icon_reload.png diff --git a/scene/resources/default_theme/tab_close.png b/scene/resources/default_theme/tab_close.png Binary files differnew file mode 100644 index 0000000000..10e56d5bb8 --- /dev/null +++ b/scene/resources/default_theme/tab_close.png diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index c338126d3a..e0b5736d99 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -194,6 +194,11 @@ static const unsigned char icon_play_png[]={ }; +static const unsigned char icon_reload_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x94,0x49,0x44,0x41,0x54,0x38,0x8d,0x85,0xd3,0xbd,0x6a,0x55,0x41,0x14,0xc5,0xf1,0xdf,0xb9,0x1f,0x91,0x20,0x5a,0x89,0xd8,0x8,0x4b,0xd0,0x42,0x1f,0xc0,0x42,0x4,0x4b,0xb,0x1b,0x9b,0xbc,0x80,0x58,0x45,0xc5,0x56,0x51,0x50,0x6b,0x21,0x9d,0xa5,0x6f,0x20,0x88,0x20,0xa8,0xad,0xa8,0xa0,0x2f,0x60,0x21,0xe8,0x4e,0x63,0xa9,0x85,0x22,0x31,0x37,0x37,0xb1,0xb8,0x73,0xc2,0xf1,0x23,0x38,0xd5,0x9c,0x61,0xaf,0x3d,0x7b,0xfe,0x6b,0x9d,0xce,0x1e,0xab,0xaa,0xc6,0x18,0xa1,0xc3,0xe,0xb6,0x92,0xec,0xfc,0x59,0x37,0xda,0x43,0x8,0xc7,0x70,0x9,0x37,0xb0,0xd2,0xd7,0x56,0x55,0x57,0x55,0xbb,0xf5,0xdd,0x1f,0xe2,0xae,0x9,0x9f,0xe2,0x24,0xb6,0x6,0x97,0x8c,0xf0,0x32,0xc9,0xb9,0xaa,0x9a,0x62,0x96,0x64,0xd1,0xa0,0x75,0x1c,0xe3,0x2,0x9e,0x34,0xc1,0x2b,0x3c,0xc6,0x3a,0x8e,0xe3,0x76,0xab,0x59,0xc6,0x41,0xfc,0xc0,0xbc,0x6f,0x30,0xc6,0x61,0x7c,0x6e,0xe2,0x53,0x49,0xde,0x57,0xd5,0x12,0xb6,0xd1,0x25,0x99,0x55,0xd5,0x3,0xac,0x36,0x1e,0xd3,0x5d,0x6,0x49,0xe6,0x78,0xd4,0xc4,0xe7,0xf1,0xa9,0x9d,0x6f,0x26,0xd9,0xc2,0xac,0x7d,0x5f,0xc1,0x73,0xcc,0xab,0xea,0x7a,0x55,0x4d,0x7b,0x30,0x37,0x71,0x6,0xdf,0x70,0x34,0xc9,0xc6,0x90,0x4d,0x92,0x21,0xa3,0x15,0xec,0xc3,0x6a,0x92,0x59,0x57,0x55,0x13,0x4c,0xdb,0x9b,0x36,0x92,0x2c,0x57,0xd5,0xb8,0x4d,0xf5,0xcf,0x55,0x55,0x33,0x4c,0x92,0x74,0xa3,0x46,0x7a,0x8e,0x13,0x38,0xd8,0x1a,0xfe,0x53,0x3c,0xb0,0xef,0x4b,0xbf,0x19,0xb5,0xf1,0x36,0xf1,0x31,0xc9,0xcc,0x22,0x34,0xff,0x5b,0x87,0xf1,0x95,0xbf,0x73,0xb0,0x86,0x5b,0xf8,0x89,0xed,0xfe,0xed,0x83,0xdb,0x97,0x70,0x19,0x6b,0x78,0x88,0xab,0xbd,0x8d,0x13,0x9c,0xc6,0x6b,0xac,0x27,0x49,0xb3,0x70,0x96,0x64,0xa7,0xc1,0x9b,0xe0,0x90,0x66,0x75,0x92,0xae,0xaa,0xba,0xde,0xc6,0xad,0x24,0x6f,0xf0,0xc,0x47,0xaa,0xea,0x3b,0x2e,0xe,0xb2,0xbf,0xdf,0x22,0xd2,0x7d,0x4e,0xce,0xb7,0x34,0xee,0xec,0x26,0x71,0x60,0xd5,0x5d,0xdc,0xb1,0x0,0xd9,0xff,0x17,0x2c,0xb2,0x30,0xc5,0x59,0xbc,0xee,0xeb,0xfb,0x9,0x86,0x84,0xef,0xe1,0x0,0xee,0xe3,0x2d,0x3e,0xe0,0x5,0xae,0x25,0xe9,0xf0,0x6e,0xc8,0xe6,0x37,0x88,0x3,0x58,0x1d,0xc6,0x2d,0x85,0xfd,0xf9,0x92,0x85,0x5b,0x86,0xd,0x7e,0x1,0x82,0x4c,0xaa,0x69,0x77,0x3c,0x4b,0x15,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + static const unsigned char icon_stop_png[]={ 0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xde,0x9,0xf,0x14,0x33,0x24,0x62,0xd4,0x2f,0x95,0x0,0x0,0x0,0x39,0x49,0x44,0x41,0x54,0x38,0x8d,0x63,0x60,0xa0,0x6,0xf8,0xf0,0xe1,0x3,0x33,0xb9,0x7a,0x18,0x61,0x2,0xf,0x1f,0x3e,0xfc,0x4f,0x8a,0x1,0xf2,0xf2,0xf2,0x8c,0xc,0xc,0xc,0xc,0x4c,0xa4,0xda,0x8c,0xe,0x46,0xd,0x18,0x35,0x60,0x70,0x18,0xc0,0xc0,0xc0,0x40,0x59,0x66,0xa2,0x18,0x0,0x0,0x2a,0xc7,0xf,0x64,0xd5,0xe,0x11,0x85,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; @@ -394,6 +399,11 @@ static const unsigned char tab_behind_png[]={ }; +static const unsigned char tab_close_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x12,0x0,0x0,0xb,0x12,0x1,0xd2,0xdd,0x7e,0xfc,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x1,0x1b,0x49,0x44,0x41,0x54,0x38,0x8d,0xcd,0x52,0xbb,0x4e,0xc4,0x40,0xc,0x9c,0x73,0xd2,0x50,0x38,0xd1,0x8a,0x82,0x36,0x3d,0x8,0xc4,0x43,0x88,0x13,0x12,0x20,0xf8,0x67,0x8a,0xfb,0x1,0xe,0x89,0x13,0x3d,0x47,0xb1,0x7f,0xb0,0x85,0x53,0x41,0xce,0xa6,0xd9,0x45,0xbe,0x24,0x1f,0x70,0x96,0x56,0x96,0xed,0x9d,0x91,0x3d,0x36,0x70,0x50,0x96,0x52,0xaa,0xbd,0x1f,0xd5,0xaa,0xb9,0x1a,0x79,0xb0,0x99,0x9d,0xc4,0x18,0x4d,0x55,0x2f,0xfd,0xc7,0x94,0x12,0xa9,0xea,0x53,0x8c,0xd1,0xcc,0xac,0xf1,0xb5,0x85,0x67,0x8b,0x31,0x1a,0x0,0x5,0x40,0xcc,0x7c,0x4b,0x44,0x9f,0x0,0x54,0x55,0x5f,0x44,0x64,0x5,0x60,0x7,0xa0,0xea,0xba,0x6e,0x31,0x21,0x48,0x29,0xd5,0xaa,0x7a,0x25,0x22,0xef,0x25,0xc7,0xcc,0x4b,0x33,0xb,0x7d,0xdf,0xbf,0xba,0xdc,0x29,0x11,0x7d,0x85,0x10,0x86,0x49,0x7,0x99,0xe4,0x5a,0x44,0xd6,0x73,0x1a,0x65,0xf0,0x77,0x8,0xe1,0x67,0xa2,0x1,0x0,0x84,0x10,0x6,0x22,0xda,0x30,0xf3,0x7d,0x4e,0x59,0x7e,0x60,0xe6,0xb,0x22,0xda,0x7a,0xf0,0x84,0x20,0x9b,0x9a,0x59,0xeb,0xe2,0xd2,0x65,0x53,0xc8,0x30,0x53,0x2c,0x23,0x54,0xaa,0xfa,0x9c,0x5,0x9b,0x1b,0xe1,0x8e,0x88,0x36,0x65,0xfe,0xbd,0xe,0x32,0xf8,0xd1,0x83,0x99,0xf9,0x9c,0x99,0x1f,0x4a,0x2c,0x22,0xeb,0xf1,0x8a,0xe7,0xd6,0xb8,0x3,0x50,0x65,0xc1,0xb6,0x0,0x4c,0x55,0x6f,0x44,0xe4,0xd,0xc0,0x0,0xa0,0xf6,0x6b,0xdc,0x3b,0xa4,0xa6,0x69,0x8e,0x33,0xf8,0x2c,0xab,0xfd,0x9b,0x85,0xfd,0x60,0xe6,0x25,0x80,0xaa,0x6d,0xdb,0xa3,0xb9,0x4b,0xfd,0x27,0xf1,0x7e,0xac,0x8f,0xf7,0x87,0x63,0x7f,0xc3,0xca,0xa9,0x49,0x35,0x25,0x97,0x14,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + static const unsigned char tab_container_bg_png[]={ 0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x10,0x8,0x6,0x0,0x0,0x0,0x1f,0xf3,0xff,0x61,0x0,0x0,0xa,0x45,0x69,0x43,0x43,0x50,0x49,0x43,0x43,0x20,0x70,0x72,0x6f,0x66,0x69,0x6c,0x65,0x0,0x0,0x78,0xda,0x9d,0x53,0x67,0x54,0x53,0xe9,0x16,0x3d,0xf7,0xde,0xf4,0x42,0x4b,0x88,0x80,0x94,0x4b,0x6f,0x52,0x15,0x8,0x20,0x52,0x42,0x8b,0x80,0x14,0x91,0x26,0x2a,0x21,0x9,0x10,0x4a,0x88,0x21,0xa1,0xd9,0x15,0x51,0xc1,0x11,0x45,0x45,0x4,0x1b,0xc8,0xa0,0x88,0x3,0x8e,0x8e,0x80,0x8c,0x15,0x51,0x2c,0xc,0x8a,0xa,0xd8,0x7,0xe4,0x21,0xa2,0x8e,0x83,0xa3,0x88,0x8a,0xca,0xfb,0xe1,0x7b,0xa3,0x6b,0xd6,0xbc,0xf7,0xe6,0xcd,0xfe,0xb5,0xd7,0x3e,0xe7,0xac,0xf3,0x9d,0xb3,0xcf,0x7,0xc0,0x8,0xc,0x96,0x48,0x33,0x51,0x35,0x80,0xc,0xa9,0x42,0x1e,0x11,0xe0,0x83,0xc7,0xc4,0xc6,0xe1,0xe4,0x2e,0x40,0x81,0xa,0x24,0x70,0x0,0x10,0x8,0xb3,0x64,0x21,0x73,0xfd,0x23,0x1,0x0,0xf8,0x7e,0x3c,0x3c,0x2b,0x22,0xc0,0x7,0xbe,0x0,0x1,0x78,0xd3,0xb,0x8,0x0,0xc0,0x4d,0x9b,0xc0,0x30,0x1c,0x87,0xff,0xf,0xea,0x42,0x99,0x5c,0x1,0x80,0x84,0x1,0xc0,0x74,0x91,0x38,0x4b,0x8,0x80,0x14,0x0,0x40,0x7a,0x8e,0x42,0xa6,0x0,0x40,0x46,0x1,0x80,0x9d,0x98,0x26,0x53,0x0,0xa0,0x4,0x0,0x60,0xcb,0x63,0x62,0xe3,0x0,0x50,0x2d,0x0,0x60,0x27,0x7f,0xe6,0xd3,0x0,0x80,0x9d,0xf8,0x99,0x7b,0x1,0x0,0x5b,0x94,0x21,0x15,0x1,0xa0,0x91,0x0,0x20,0x13,0x65,0x88,0x44,0x0,0x68,0x3b,0x0,0xac,0xcf,0x56,0x8a,0x45,0x0,0x58,0x30,0x0,0x14,0x66,0x4b,0xc4,0x39,0x0,0xd8,0x2d,0x0,0x30,0x49,0x57,0x66,0x48,0x0,0xb0,0xb7,0x0,0xc0,0xce,0x10,0xb,0xb2,0x0,0x8,0xc,0x0,0x30,0x51,0x88,0x85,0x29,0x0,0x4,0x7b,0x0,0x60,0xc8,0x23,0x23,0x78,0x0,0x84,0x99,0x0,0x14,0x46,0xf2,0x57,0x3c,0xf1,0x2b,0xae,0x10,0xe7,0x2a,0x0,0x0,0x78,0x99,0xb2,0x3c,0xb9,0x24,0x39,0x45,0x81,0x5b,0x8,0x2d,0x71,0x7,0x57,0x57,0x2e,0x1e,0x28,0xce,0x49,0x17,0x2b,0x14,0x36,0x61,0x2,0x61,0x9a,0x40,0x2e,0xc2,0x79,0x99,0x19,0x32,0x81,0x34,0xf,0xe0,0xf3,0xcc,0x0,0x0,0xa0,0x91,0x15,0x11,0xe0,0x83,0xf3,0xfd,0x78,0xce,0xe,0xae,0xce,0xce,0x36,0x8e,0xb6,0xe,0x5f,0x2d,0xea,0xbf,0x6,0xff,0x22,0x62,0x62,0xe3,0xfe,0xe5,0xcf,0xab,0x70,0x40,0x0,0x0,0xe1,0x74,0x7e,0xd1,0xfe,0x2c,0x2f,0xb3,0x1a,0x80,0x3b,0x6,0x80,0x6d,0xfe,0xa2,0x25,0xee,0x4,0x68,0x5e,0xb,0xa0,0x75,0xf7,0x8b,0x66,0xb2,0xf,0x40,0xb5,0x0,0xa0,0xe9,0xda,0x57,0xf3,0x70,0xf8,0x7e,0x3c,0x3c,0x45,0xa1,0x90,0xb9,0xd9,0xd9,0xe5,0xe4,0xe4,0xd8,0x4a,0xc4,0x42,0x5b,0x61,0xca,0x57,0x7d,0xfe,0x67,0xc2,0x5f,0xc0,0x57,0xfd,0x6c,0xf9,0x7e,0x3c,0xfc,0xf7,0xf5,0xe0,0xbe,0xe2,0x24,0x81,0x32,0x5d,0x81,0x47,0x4,0xf8,0xe0,0xc2,0xcc,0xf4,0x4c,0xa5,0x1c,0xcf,0x92,0x9,0x84,0x62,0xdc,0xe6,0x8f,0x47,0xfc,0xb7,0xb,0xff,0xfc,0x1d,0xd3,0x22,0xc4,0x49,0x62,0xb9,0x58,0x2a,0x14,0xe3,0x51,0x12,0x71,0x8e,0x44,0x9a,0x8c,0xf3,0x32,0xa5,0x22,0x89,0x42,0x92,0x29,0xc5,0x25,0xd2,0xff,0x64,0xe2,0xdf,0x2c,0xfb,0x3,0x3e,0xdf,0x35,0x0,0xb0,0x6a,0x3e,0x1,0x7b,0x91,0x2d,0xa8,0x5d,0x63,0x3,0xf6,0x4b,0x27,0x10,0x58,0x74,0xc0,0xe2,0xf7,0x0,0x0,0xf2,0xbb,0x6f,0xc1,0xd4,0x28,0x8,0x3,0x80,0x68,0x83,0xe1,0xcf,0x77,0xff,0xef,0x3f,0xfd,0x47,0xa0,0x25,0x0,0x80,0x66,0x49,0x92,0x71,0x0,0x0,0x5e,0x44,0x24,0x2e,0x54,0xca,0xb3,0x3f,0xc7,0x8,0x0,0x0,0x44,0xa0,0x81,0x2a,0xb0,0x41,0x1b,0xf4,0xc1,0x18,0x2c,0xc0,0x6,0x1c,0xc1,0x5,0xdc,0xc1,0xb,0xfc,0x60,0x36,0x84,0x42,0x24,0xc4,0xc2,0x42,0x10,0x42,0xa,0x64,0x80,0x1c,0x72,0x60,0x29,0xac,0x82,0x42,0x28,0x86,0xcd,0xb0,0x1d,0x2a,0x60,0x2f,0xd4,0x40,0x1d,0x34,0xc0,0x51,0x68,0x86,0x93,0x70,0xe,0x2e,0xc2,0x55,0xb8,0xe,0x3d,0x70,0xf,0xfa,0x61,0x8,0x9e,0xc1,0x28,0xbc,0x81,0x9,0x4,0x41,0xc8,0x8,0x13,0x61,0x21,0xda,0x88,0x1,0x62,0x8a,0x58,0x23,0x8e,0x8,0x17,0x99,0x85,0xf8,0x21,0xc1,0x48,0x4,0x12,0x8b,0x24,0x20,0xc9,0x88,0x14,0x51,0x22,0x4b,0x91,0x35,0x48,0x31,0x52,0x8a,0x54,0x20,0x55,0x48,0x1d,0xf2,0x3d,0x72,0x2,0x39,0x87,0x5c,0x46,0xba,0x91,0x3b,0xc8,0x0,0x32,0x82,0xfc,0x86,0xbc,0x47,0x31,0x94,0x81,0xb2,0x51,0x3d,0xd4,0xc,0xb5,0x43,0xb9,0xa8,0x37,0x1a,0x84,0x46,0xa2,0xb,0xd0,0x64,0x74,0x31,0x9a,0x8f,0x16,0xa0,0x9b,0xd0,0x72,0xb4,0x1a,0x3d,0x8c,0x36,0xa1,0xe7,0xd0,0xab,0x68,0xf,0xda,0x8f,0x3e,0x43,0xc7,0x30,0xc0,0xe8,0x18,0x7,0x33,0xc4,0x6c,0x30,0x2e,0xc6,0xc3,0x42,0xb1,0x38,0x2c,0x9,0x93,0x63,0xcb,0xb1,0x22,0xac,0xc,0xab,0xc6,0x1a,0xb0,0x56,0xac,0x3,0xbb,0x89,0xf5,0x63,0xcf,0xb1,0x77,0x4,0x12,0x81,0x45,0xc0,0x9,0x36,0x4,0x77,0x42,0x20,0x61,0x1e,0x41,0x48,0x58,0x4c,0x58,0x4e,0xd8,0x48,0xa8,0x20,0x1c,0x24,0x34,0x11,0xda,0x9,0x37,0x9,0x3,0x84,0x51,0xc2,0x27,0x22,0x93,0xa8,0x4b,0xb4,0x26,0xba,0x11,0xf9,0xc4,0x18,0x62,0x32,0x31,0x87,0x58,0x48,0x2c,0x23,0xd6,0x12,0x8f,0x13,0x2f,0x10,0x7b,0x88,0x43,0xc4,0x37,0x24,0x12,0x89,0x43,0x32,0x27,0xb9,0x90,0x2,0x49,0xb1,0xa4,0x54,0xd2,0x12,0xd2,0x46,0xd2,0x6e,0x52,0x23,0xe9,0x2c,0xa9,0x9b,0x34,0x48,0x1a,0x23,0x93,0xc9,0xda,0x64,0x6b,0xb2,0x7,0x39,0x94,0x2c,0x20,0x2b,0xc8,0x85,0xe4,0x9d,0xe4,0xc3,0xe4,0x33,0xe4,0x1b,0xe4,0x21,0xf2,0x5b,0xa,0x9d,0x62,0x40,0x71,0xa4,0xf8,0x53,0xe2,0x28,0x52,0xca,0x6a,0x4a,0x19,0xe5,0x10,0xe5,0x34,0xe5,0x6,0x65,0x98,0x32,0x41,0x55,0xa3,0x9a,0x52,0xdd,0xa8,0xa1,0x54,0x11,0x35,0x8f,0x5a,0x42,0xad,0xa1,0xb6,0x52,0xaf,0x51,0x87,0xa8,0x13,0x34,0x75,0x9a,0x39,0xcd,0x83,0x16,0x49,0x4b,0xa5,0xad,0xa2,0x95,0xd3,0x1a,0x68,0x17,0x68,0xf7,0x69,0xaf,0xe8,0x74,0xba,0x11,0xdd,0x95,0x1e,0x4e,0x97,0xd0,0x57,0xd2,0xcb,0xe9,0x47,0xe8,0x97,0xe8,0x3,0xf4,0x77,0xc,0xd,0x86,0x15,0x83,0xc7,0x88,0x67,0x28,0x19,0x9b,0x18,0x7,0x18,0x67,0x19,0x77,0x18,0xaf,0x98,0x4c,0xa6,0x19,0xd3,0x8b,0x19,0xc7,0x54,0x30,0x37,0x31,0xeb,0x98,0xe7,0x99,0xf,0x99,0x6f,0x55,0x58,0x2a,0xb6,0x2a,0x7c,0x15,0x91,0xca,0xa,0x95,0x4a,0x95,0x26,0x95,0x1b,0x2a,0x2f,0x54,0xa9,0xaa,0xa6,0xaa,0xde,0xaa,0xb,0x55,0xf3,0x55,0xcb,0x54,0x8f,0xa9,0x5e,0x53,0x7d,0xae,0x46,0x55,0x33,0x53,0xe3,0xa9,0x9,0xd4,0x96,0xab,0x55,0xaa,0x9d,0x50,0xeb,0x53,0x1b,0x53,0x67,0xa9,0x3b,0xa8,0x87,0xaa,0x67,0xa8,0x6f,0x54,0x3f,0xa4,0x7e,0x59,0xfd,0x89,0x6,0x59,0xc3,0x4c,0xc3,0x4f,0x43,0xa4,0x51,0xa0,0xb1,0x5f,0xe3,0xbc,0xc6,0x20,0xb,0x63,0x19,0xb3,0x78,0x2c,0x21,0x6b,0xd,0xab,0x86,0x75,0x81,0x35,0xc4,0x26,0xb1,0xcd,0xd9,0x7c,0x76,0x2a,0xbb,0x98,0xfd,0x1d,0xbb,0x8b,0x3d,0xaa,0xa9,0xa1,0x39,0x43,0x33,0x4a,0x33,0x57,0xb3,0x52,0xf3,0x94,0x66,0x3f,0x7,0xe3,0x98,0x71,0xf8,0x9c,0x74,0x4e,0x9,0xe7,0x28,0xa7,0x97,0xf3,0x7e,0x8a,0xde,0x14,0xef,0x29,0xe2,0x29,0x1b,0xa6,0x34,0x4c,0xb9,0x31,0x65,0x5c,0x6b,0xaa,0x96,0x97,0x96,0x58,0xab,0x48,0xab,0x51,0xab,0x47,0xeb,0xbd,0x36,0xae,0xed,0xa7,0x9d,0xa6,0xbd,0x45,0xbb,0x59,0xfb,0x81,0xe,0x41,0xc7,0x4a,0x27,0x5c,0x27,0x47,0x67,0x8f,0xce,0x5,0x9d,0xe7,0x53,0xd9,0x53,0xdd,0xa7,0xa,0xa7,0x16,0x4d,0x3d,0x3a,0xf5,0xae,0x2e,0xaa,0x6b,0xa5,0x1b,0xa1,0xbb,0x44,0x77,0xbf,0x6e,0xa7,0xee,0x98,0x9e,0xbe,0x5e,0x80,0x9e,0x4c,0x6f,0xa7,0xde,0x79,0xbd,0xe7,0xfa,0x1c,0x7d,0x2f,0xfd,0x54,0xfd,0x6d,0xfa,0xa7,0xf5,0x47,0xc,0x58,0x6,0xb3,0xc,0x24,0x6,0xdb,0xc,0xce,0x18,0x3c,0xc5,0x35,0x71,0x6f,0x3c,0x1d,0x2f,0xc7,0xdb,0xf1,0x51,0x43,0x5d,0xc3,0x40,0x43,0xa5,0x61,0x95,0x61,0x97,0xe1,0x84,0x91,0xb9,0xd1,0x3c,0xa3,0xd5,0x46,0x8d,0x46,0xf,0x8c,0x69,0xc6,0x5c,0xe3,0x24,0xe3,0x6d,0xc6,0x6d,0xc6,0xa3,0x26,0x6,0x26,0x21,0x26,0x4b,0x4d,0xea,0x4d,0xee,0x9a,0x52,0x4d,0xb9,0xa6,0x29,0xa6,0x3b,0x4c,0x3b,0x4c,0xc7,0xcd,0xcc,0xcd,0xa2,0xcd,0xd6,0x99,0x35,0x9b,0x3d,0x31,0xd7,0x32,0xe7,0x9b,0xe7,0x9b,0xd7,0x9b,0xdf,0xb7,0x60,0x5a,0x78,0x5a,0x2c,0xb6,0xa8,0xb6,0xb8,0x65,0x49,0xb2,0xe4,0x5a,0xa6,0x59,0xee,0xb6,0xbc,0x6e,0x85,0x5a,0x39,0x59,0xa5,0x58,0x55,0x5a,0x5d,0xb3,0x46,0xad,0x9d,0xad,0x25,0xd6,0xbb,0xad,0xbb,0xa7,0x11,0xa7,0xb9,0x4e,0x93,0x4e,0xab,0x9e,0xd6,0x67,0xc3,0xb0,0xf1,0xb6,0xc9,0xb6,0xa9,0xb7,0x19,0xb0,0xe5,0xd8,0x6,0xdb,0xae,0xb6,0x6d,0xb6,0x7d,0x61,0x67,0x62,0x17,0x67,0xb7,0xc5,0xae,0xc3,0xee,0x93,0xbd,0x93,0x7d,0xba,0x7d,0x8d,0xfd,0x3d,0x7,0xd,0x87,0xd9,0xe,0xab,0x1d,0x5a,0x1d,0x7e,0x73,0xb4,0x72,0x14,0x3a,0x56,0x3a,0xde,0x9a,0xce,0x9c,0xee,0x3f,0x7d,0xc5,0xf4,0x96,0xe9,0x2f,0x67,0x58,0xcf,0x10,0xcf,0xd8,0x33,0xe3,0xb6,0x13,0xcb,0x29,0xc4,0x69,0x9d,0x53,0x9b,0xd3,0x47,0x67,0x17,0x67,0xb9,0x73,0x83,0xf3,0x88,0x8b,0x89,0x4b,0x82,0xcb,0x2e,0x97,0x3e,0x2e,0x9b,0x1b,0xc6,0xdd,0xc8,0xbd,0xe4,0x4a,0x74,0xf5,0x71,0x5d,0xe1,0x7a,0xd2,0xf5,0x9d,0x9b,0xb3,0x9b,0xc2,0xed,0xa8,0xdb,0xaf,0xee,0x36,0xee,0x69,0xee,0x87,0xdc,0x9f,0xcc,0x34,0x9f,0x29,0x9e,0x59,0x33,0x73,0xd0,0xc3,0xc8,0x43,0xe0,0x51,0xe5,0xd1,0x3f,0xb,0x9f,0x95,0x30,0x6b,0xdf,0xac,0x7e,0x4f,0x43,0x4f,0x81,0x67,0xb5,0xe7,0x23,0x2f,0x63,0x2f,0x91,0x57,0xad,0xd7,0xb0,0xb7,0xa5,0x77,0xaa,0xf7,0x61,0xef,0x17,0x3e,0xf6,0x3e,0x72,0x9f,0xe3,0x3e,0xe3,0x3c,0x37,0xde,0x32,0xde,0x59,0x5f,0xcc,0x37,0xc0,0xb7,0xc8,0xb7,0xcb,0x4f,0xc3,0x6f,0x9e,0x5f,0x85,0xdf,0x43,0x7f,0x23,0xff,0x64,0xff,0x7a,0xff,0xd1,0x0,0xa7,0x80,0x25,0x1,0x67,0x3,0x89,0x81,0x41,0x81,0x5b,0x2,0xfb,0xf8,0x7a,0x7c,0x21,0xbf,0x8e,0x3f,0x3a,0xdb,0x65,0xf6,0xb2,0xd9,0xed,0x41,0x8c,0xa0,0xb9,0x41,0x15,0x41,0x8f,0x82,0xad,0x82,0xe5,0xc1,0xad,0x21,0x68,0xc8,0xec,0x90,0xad,0x21,0xf7,0xe7,0x98,0xce,0x91,0xce,0x69,0xe,0x85,0x50,0x7e,0xe8,0xd6,0xd0,0x7,0x61,0xe6,0x61,0x8b,0xc3,0x7e,0xc,0x27,0x85,0x87,0x85,0x57,0x86,0x3f,0x8e,0x70,0x88,0x58,0x1a,0xd1,0x31,0x97,0x35,0x77,0xd1,0xdc,0x43,0x73,0xdf,0x44,0xfa,0x44,0x96,0x44,0xde,0x9b,0x67,0x31,0x4f,0x39,0xaf,0x2d,0x4a,0x35,0x2a,0x3e,0xaa,0x2e,0x6a,0x3c,0xda,0x37,0xba,0x34,0xba,0x3f,0xc6,0x2e,0x66,0x59,0xcc,0xd5,0x58,0x9d,0x58,0x49,0x6c,0x4b,0x1c,0x39,0x2e,0x2a,0xae,0x36,0x6e,0x6c,0xbe,0xdf,0xfc,0xed,0xf3,0x87,0xe2,0x9d,0xe2,0xb,0xe3,0x7b,0x17,0x98,0x2f,0xc8,0x5d,0x70,0x79,0xa1,0xce,0xc2,0xf4,0x85,0xa7,0x16,0xa9,0x2e,0x12,0x2c,0x3a,0x96,0x40,0x4c,0x88,0x4e,0x38,0x94,0xf0,0x41,0x10,0x2a,0xa8,0x16,0x8c,0x25,0xf2,0x13,0x77,0x25,0x8e,0xa,0x79,0xc2,0x1d,0xc2,0x67,0x22,0x2f,0xd1,0x36,0xd1,0x88,0xd8,0x43,0x5c,0x2a,0x1e,0x4e,0xf2,0x48,0x2a,0x4d,0x7a,0x92,0xec,0x91,0xbc,0x35,0x79,0x24,0xc5,0x33,0xa5,0x2c,0xe5,0xb9,0x84,0x27,0xa9,0x90,0xbc,0x4c,0xd,0x4c,0xdd,0x9b,0x3a,0x9e,0x16,0x9a,0x76,0x20,0x6d,0x32,0x3d,0x3a,0xbd,0x31,0x83,0x92,0x91,0x90,0x71,0x42,0xaa,0x21,0x4d,0x93,0xb6,0x67,0xea,0x67,0xe6,0x66,0x76,0xcb,0xac,0x65,0x85,0xb2,0xfe,0xc5,0x6e,0x8b,0xb7,0x2f,0x1e,0x95,0x7,0xc9,0x6b,0xb3,0x90,0xac,0x5,0x59,0x2d,0xa,0xb6,0x42,0xa6,0xe8,0x54,0x5a,0x28,0xd7,0x2a,0x7,0xb2,0x67,0x65,0x57,0x66,0xbf,0xcd,0x89,0xca,0x39,0x96,0xab,0x9e,0x2b,0xcd,0xed,0xcc,0xb3,0xca,0xdb,0x90,0x37,0x9c,0xef,0x9f,0xff,0xed,0x12,0xc2,0x12,0xe1,0x92,0xb6,0xa5,0x86,0x4b,0x57,0x2d,0x1d,0x58,0xe6,0xbd,0xac,0x6a,0x39,0xb2,0x3c,0x71,0x79,0xdb,0xa,0xe3,0x15,0x5,0x2b,0x86,0x56,0x6,0xac,0x3c,0xb8,0x8a,0xb6,0x2a,0x6d,0xd5,0x4f,0xab,0xed,0x57,0x97,0xae,0x7e,0xbd,0x26,0x7a,0x4d,0x6b,0x81,0x5e,0xc1,0xca,0x82,0xc1,0xb5,0x1,0x6b,0xeb,0xb,0x55,0xa,0xe5,0x85,0x7d,0xeb,0xdc,0xd7,0xed,0x5d,0x4f,0x58,0x2f,0x59,0xdf,0xb5,0x61,0xfa,0x86,0x9d,0x1b,0x3e,0x15,0x89,0x8a,0xae,0x14,0xdb,0x17,0x97,0x15,0x7f,0xd8,0x28,0xdc,0x78,0xe5,0x1b,0x87,0x6f,0xca,0xbf,0x99,0xdc,0x94,0xb4,0xa9,0xab,0xc4,0xb9,0x64,0xcf,0x66,0xd2,0x66,0xe9,0xe6,0xde,0x2d,0x9e,0x5b,0xe,0x96,0xaa,0x97,0xe6,0x97,0xe,0x6e,0xd,0xd9,0xda,0xb4,0xd,0xdf,0x56,0xb4,0xed,0xf5,0xf6,0x45,0xdb,0x2f,0x97,0xcd,0x28,0xdb,0xbb,0x83,0xb6,0x43,0xb9,0xa3,0xbf,0x3c,0xb8,0xbc,0x65,0xa7,0xc9,0xce,0xcd,0x3b,0x3f,0x54,0xa4,0x54,0xf4,0x54,0xfa,0x54,0x36,0xee,0xd2,0xdd,0xb5,0x61,0xd7,0xf8,0x6e,0xd1,0xee,0x1b,0x7b,0xbc,0xf6,0x34,0xec,0xd5,0xdb,0x5b,0xbc,0xf7,0xfd,0x3e,0xc9,0xbe,0xdb,0x55,0x1,0x55,0x4d,0xd5,0x66,0xd5,0x65,0xfb,0x49,0xfb,0xb3,0xf7,0x3f,0xae,0x89,0xaa,0xe9,0xf8,0x96,0xfb,0x6d,0x5d,0xad,0x4e,0x6d,0x71,0xed,0xc7,0x3,0xd2,0x3,0xfd,0x7,0x23,0xe,0xb6,0xd7,0xb9,0xd4,0xd5,0x1d,0xd2,0x3d,0x54,0x52,0x8f,0xd6,0x2b,0xeb,0x47,0xe,0xc7,0x1f,0xbe,0xfe,0x9d,0xef,0x77,0x2d,0xd,0x36,0xd,0x55,0x8d,0x9c,0xc6,0xe2,0x23,0x70,0x44,0x79,0xe4,0xe9,0xf7,0x9,0xdf,0xf7,0x1e,0xd,0x3a,0xda,0x76,0x8c,0x7b,0xac,0xe1,0x7,0xd3,0x1f,0x76,0x1d,0x67,0x1d,0x2f,0x6a,0x42,0x9a,0xf2,0x9a,0x46,0x9b,0x53,0x9a,0xfb,0x5b,0x62,0x5b,0xba,0x4f,0xcc,0x3e,0xd1,0xd6,0xea,0xde,0x7a,0xfc,0x47,0xdb,0x1f,0xf,0x9c,0x34,0x3c,0x59,0x79,0x4a,0xf3,0x54,0xc9,0x69,0xda,0xe9,0x82,0xd3,0x93,0x67,0xf2,0xcf,0x8c,0x9d,0x95,0x9d,0x7d,0x7e,0x2e,0xf9,0xdc,0x60,0xdb,0xa2,0xb6,0x7b,0xe7,0x63,0xce,0xdf,0x6a,0xf,0x6f,0xef,0xba,0x10,0x74,0xe1,0xd2,0x45,0xff,0x8b,0xe7,0x3b,0xbc,0x3b,0xce,0x5c,0xf2,0xb8,0x74,0xf2,0xb2,0xdb,0xe5,0x13,0x57,0xb8,0x57,0x9a,0xaf,0x3a,0x5f,0x6d,0xea,0x74,0xea,0x3c,0xfe,0x93,0xd3,0x4f,0xc7,0xbb,0x9c,0xbb,0x9a,0xae,0xb9,0x5c,0x6b,0xb9,0xee,0x7a,0xbd,0xb5,0x7b,0x66,0xf7,0xe9,0x1b,0x9e,0x37,0xce,0xdd,0xf4,0xbd,0x79,0xf1,0x16,0xff,0xd6,0xd5,0x9e,0x39,0x3d,0xdd,0xbd,0xf3,0x7a,0x6f,0xf7,0xc5,0xf7,0xf5,0xdf,0x16,0xdd,0x7e,0x72,0x27,0xfd,0xce,0xcb,0xbb,0xd9,0x77,0x27,0xee,0xad,0xbc,0x4f,0xbc,0x5f,0xf4,0x40,0xed,0x41,0xd9,0x43,0xdd,0x87,0xd5,0x3f,0x5b,0xfe,0xdc,0xd8,0xef,0xdc,0x7f,0x6a,0xc0,0x77,0xa0,0xf3,0xd1,0xdc,0x47,0xf7,0x6,0x85,0x83,0xcf,0xfe,0x91,0xf5,0x8f,0xf,0x43,0x5,0x8f,0x99,0x8f,0xcb,0x86,0xd,0x86,0xeb,0x9e,0x38,0x3e,0x39,0x39,0xe2,0x3f,0x72,0xfd,0xe9,0xfc,0xa7,0x43,0xcf,0x64,0xcf,0x26,0x9e,0x17,0xfe,0xa2,0xfe,0xcb,0xae,0x17,0x16,0x2f,0x7e,0xf8,0xd5,0xeb,0xd7,0xce,0xd1,0x98,0xd1,0xa1,0x97,0xf2,0x97,0x93,0xbf,0x6d,0x7c,0xa5,0xfd,0xea,0xc0,0xeb,0x19,0xaf,0xdb,0xc6,0xc2,0xc6,0x1e,0xbe,0xc9,0x78,0x33,0x31,0x5e,0xf4,0x56,0xfb,0xed,0xc1,0x77,0xdc,0x77,0x1d,0xef,0xa3,0xdf,0xf,0x4f,0xe4,0x7c,0x20,0x7f,0x28,0xff,0x68,0xf9,0xb1,0xf5,0x53,0xd0,0xa7,0xfb,0x93,0x19,0x93,0x93,0xff,0x4,0x3,0x98,0xf3,0xfc,0xef,0x35,0x94,0x82,0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xdf,0xa,0x15,0x0,0x5,0x21,0x33,0xd5,0x5f,0x4d,0x0,0x0,0x1,0x3a,0x49,0x44,0x41,0x54,0x38,0xcb,0xa5,0x93,0x41,0x4a,0x3,0x51,0xc,0x86,0xbf,0x37,0xef,0xd1,0x11,0x5d,0x74,0x40,0xc1,0x5a,0xea,0x45,0xc4,0xa5,0x27,0xf0,0x34,0x73,0x84,0xe2,0x61,0x3c,0x81,0xee,0xc4,0x8b,0x8,0x76,0xd3,0xea,0x14,0x5a,0xe8,0x74,0xde,0x4b,0x5c,0x4c,0x46,0x2a,0xd4,0x3a,0xc5,0x40,0x20,0x8b,0xe4,0x4f,0xfe,0xf0,0xff,0xe,0x8,0xc0,0x0,0xc8,0x81,0x13,0xab,0x3d,0x90,0xf1,0x33,0x4,0x48,0xc0,0x16,0xd8,0x0,0x35,0xb0,0xed,0x86,0xcf,0x80,0x2,0x18,0x5a,0x9d,0x3,0xce,0x12,0x40,0x2d,0x6b,0x60,0xd,0x2c,0x81,0xa,0xdb,0x9e,0x3,0xc5,0xed,0xcd,0xdd,0xfd,0xf8,0xea,0xba,0x8c,0x29,0x16,0xaa,0xec,0xd,0xe7,0x20,0xf8,0x50,0xbd,0xcf,0xde,0xa6,0x2f,0xaf,0x4f,0x8f,0x40,0xc,0x76,0xf6,0x70,0x3c,0x9a,0x94,0xd5,0xe7,0xa2,0x88,0x31,0xa2,0xec,0x47,0x70,0x38,0x42,0x8,0xc5,0x78,0x34,0x29,0x81,0x67,0x60,0xf5,0x4d,0xa1,0x89,0x4d,0xd1,0xc4,0xe6,0xd7,0xe1,0x96,0x87,0xd2,0xc4,0x86,0x26,0x36,0x85,0x51,0x1d,0x4,0x7b,0x58,0x2e,0x22,0x88,0xa,0x7f,0x85,0xa2,0x88,0x8,0x46,0xdd,0x7,0xfb,0xb6,0x53,0x51,0x54,0x94,0x3e,0x61,0x7d,0xe,0xc8,0x42,0x47,0x2f,0x69,0xea,0x75,0x1,0x40,0xd2,0xd4,0x1,0x10,0x76,0x51,0x55,0x8f,0xba,0x80,0x5d,0x0,0x55,0x3d,0x2,0xa0,0xed,0xd3,0xe,0x40,0x5a,0xd0,0x84,0xf6,0xa4,0x20,0x2d,0x5,0x5,0x24,0x98,0x3c,0x6b,0x84,0xde,0x4f,0xa4,0xdd,0x53,0x3,0x29,0x33,0x6d,0xaf,0x71,0x59,0x95,0x79,0x8f,0xa8,0x1e,0xcc,0xcc,0x7b,0x70,0x59,0x65,0x92,0xde,0x6,0x33,0xc6,0x72,0xbe,0x98,0x4d,0x2f,0xce,0x2f,0xcb,0x24,0xa9,0xe0,0x80,0x96,0x7d,0x16,0x3e,0xe6,0x8b,0xd9,0x83,0xf9,0x61,0xe3,0x80,0xd3,0x7f,0x98,0x69,0x1d,0x8c,0x2,0x40,0x4,0x56,0xc7,0xda,0xf9,0xb,0x57,0x2d,0xbb,0xf5,0x2d,0xe4,0x89,0x1b,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index ffa02e819c..4551aff0ef 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/environment.h b/scene/resources/environment.h index bee45b78cd..4620bf567a 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/event_stream.cpp b/scene/resources/event_stream.cpp index e8cd08c064..8667bcc5db 100644 --- a/scene/resources/event_stream.cpp +++ b/scene/resources/event_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/event_stream.h b/scene/resources/event_stream.h index f9a5e3785a..6ee9b76717 100644 --- a/scene/resources/event_stream.h +++ b/scene/resources/event_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index aad5e7cfdd..0aae6fd978 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -517,7 +517,7 @@ void Font::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_descent"),&Font::get_descent); ObjectTypeDB::bind_method(_MD("add_kerning_pair","char_a","char_b","kerning"),&Font::add_kerning_pair); - ObjectTypeDB::bind_method(_MD("get_kerning_pair"),&Font::get_kerning_pair); + ObjectTypeDB::bind_method(_MD("get_kerning_pair","char_a","char_b"),&Font::get_kerning_pair); ObjectTypeDB::bind_method(_MD("add_texture","texture:Texture"),&Font::add_texture); ObjectTypeDB::bind_method(_MD("add_char","character","texture","rect","align","advance"),&Font::add_char,DEFVAL(Point2()),DEFVAL(-1)); diff --git a/scene/resources/font.h b/scene/resources/font.h index 27e3045eaa..61f0352992 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/gibberish_stream.cpp b/scene/resources/gibberish_stream.cpp index 7af81bd992..9d67069a6c 100644 --- a/scene/resources/gibberish_stream.cpp +++ b/scene/resources/gibberish_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/gibberish_stream.h b/scene/resources/gibberish_stream.h index 77393db9f4..e06dc5eff2 100644 --- a/scene/resources/gibberish_stream.h +++ b/scene/resources/gibberish_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/height_map_shape.cpp b/scene/resources/height_map_shape.cpp index 2c7c5384fa..e7b53c92c2 100644 --- a/scene/resources/height_map_shape.cpp +++ b/scene/resources/height_map_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/height_map_shape.h b/scene/resources/height_map_shape.h index 46d49dab08..5494075107 100644 --- a/scene/resources/height_map_shape.h +++ b/scene/resources/height_map_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 51d8be3294..e56314c1f8 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/material.h b/scene/resources/material.h index 7b7bc50567..96b33ce129 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 8cb0904415..9537fa269f 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -971,7 +971,7 @@ void Mesh::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_morph_target_mode","mode"),&Mesh::set_morph_target_mode); ObjectTypeDB::bind_method(_MD("get_morph_target_mode"),&Mesh::get_morph_target_mode); - ObjectTypeDB::bind_method(_MD("add_surface","primitive","arrays","morph_arrays"),&Mesh::add_surface,DEFVAL(Array())); + ObjectTypeDB::bind_method(_MD("add_surface","primitive","arrays","morph_arrays","alphasort"),&Mesh::add_surface,DEFVAL(Array()),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_surface_count"),&Mesh::get_surface_count); ObjectTypeDB::bind_method(_MD("surface_remove","surf_idx"),&Mesh::surface_remove); ObjectTypeDB::bind_method(_MD("surface_get_array_len","surf_idx"),&Mesh::surface_get_array_len); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index 50463ce80e..e0d9bdf7a8 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index 42aaed39e1..fb0fc2a247 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_data_tool.h b/scene/resources/mesh_data_tool.h index e7e7924e98..4a26fc2628 100644 --- a/scene/resources/mesh_data_tool.h +++ b/scene/resources/mesh_data_tool.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index 5ebab9be76..8643e96303 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h index a6a7b71669..9a468d5555 100644 --- a/scene/resources/mesh_library.h +++ b/scene/resources/mesh_library.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 0755d101b2..c5ade63124 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -224,13 +224,13 @@ void MultiMesh::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MultiMesh::set_mesh); ObjectTypeDB::bind_method(_MD("get_mesh:Mesh"),&MultiMesh::get_mesh); - ObjectTypeDB::bind_method(_MD("set_instance_count"),&MultiMesh::set_instance_count); + ObjectTypeDB::bind_method(_MD("set_instance_count","count"),&MultiMesh::set_instance_count); ObjectTypeDB::bind_method(_MD("get_instance_count"),&MultiMesh::get_instance_count); - ObjectTypeDB::bind_method(_MD("set_instance_transform"),&MultiMesh::set_instance_transform); - ObjectTypeDB::bind_method(_MD("get_instance_transform"),&MultiMesh::get_instance_transform); - ObjectTypeDB::bind_method(_MD("set_instance_color"),&MultiMesh::set_instance_color); - ObjectTypeDB::bind_method(_MD("get_instance_color"),&MultiMesh::get_instance_color); - ObjectTypeDB::bind_method(_MD("set_aabb"),&MultiMesh::set_aabb); + ObjectTypeDB::bind_method(_MD("set_instance_transform","instance","transform"),&MultiMesh::set_instance_transform); + ObjectTypeDB::bind_method(_MD("get_instance_transform","instance"),&MultiMesh::get_instance_transform); + ObjectTypeDB::bind_method(_MD("set_instance_color","instance","color"),&MultiMesh::set_instance_color); + ObjectTypeDB::bind_method(_MD("get_instance_color","instance"),&MultiMesh::get_instance_color); + ObjectTypeDB::bind_method(_MD("set_aabb","visibility_aabb"),&MultiMesh::set_aabb); ObjectTypeDB::bind_method(_MD("get_aabb"),&MultiMesh::get_aabb); ObjectTypeDB::bind_method(_MD("generate_aabb"),&MultiMesh::generate_aabb); diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h index c2736e3070..0cf9e92def 100644 --- a/scene/resources/multimesh.h +++ b/scene/resources/multimesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 443d1630a7..03127620f7 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1597,6 +1597,16 @@ Node *PackedScene::instance(bool p_gen_edit_state) const { return s; } +void PackedScene::replace_state(Ref<SceneState> p_by) { + + state=p_by; + state->set_path(get_path()); +#ifdef TOOLS_ENABLED + state->set_last_modified_time(get_last_modified_time()); +#endif + +} + void PackedScene::recreate_state() { state = Ref<SceneState>( memnew( SceneState )); diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index 67d0f4ba01..00a812f16a 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,6 @@ class SceneState : public Reference { FLAG_INSTANCE_IS_PLACEHOLDER=(1<<30), FLAG_MASK=(1<<24)-1, NO_PARENT_SAVED=0x7FFFFFFF, - TYPE_INSTANCED=0x7FFFFFFF, }; @@ -106,6 +105,10 @@ class SceneState : public Reference { static bool disable_placeholders; public: + enum { + TYPE_INSTANCED=0x7FFFFFFF + }; + static void set_disable_placeholders(bool p_disable); int find_node_by_path(const NodePath& p_node) const; @@ -195,6 +198,7 @@ public: Node *instance(bool p_gen_edit_state=false) const; void recreate_state(); + void replace_state(Ref<SceneState> p_by); virtual void set_path(const String& p_path,bool p_take_over=false); #ifdef TOOLS_ENABLED diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp index 760a36a91e..f551414f61 100644 --- a/scene/resources/plane_shape.cpp +++ b/scene/resources/plane_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/plane_shape.h b/scene/resources/plane_shape.h index dd285171c4..543c433965 100644 --- a/scene/resources/plane_shape.h +++ b/scene/resources/plane_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index ee55cc6e37..73ce4de976 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/ray_shape.h b/scene/resources/ray_shape.h index edb29b83b5..0218045247 100644 --- a/scene/resources/ray_shape.h +++ b/scene/resources/ray_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index 7903d88736..bc0f86f0a7 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/rectangle_shape_2d.h index 96de02fb70..1ffbe1e356 100644 --- a/scene/resources/rectangle_shape_2d.h +++ b/scene/resources/rectangle_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rich_text.cpp b/scene/resources/rich_text.cpp index 7e58a19ac3..8acf5ff39b 100644 --- a/scene/resources/rich_text.cpp +++ b/scene/resources/rich_text.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/rich_text.h b/scene/resources/rich_text.h index 9dfffbfeb3..c74a391b10 100644 --- a/scene/resources/rich_text.h +++ b/scene/resources/rich_text.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp index 3673b18394..0f9eb85244 100644 --- a/scene/resources/room.cpp +++ b/scene/resources/room.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/room.h b/scene/resources/room.h index f621d8f1bf..c5aaea311e 100644 --- a/scene/resources/room.h +++ b/scene/resources/room.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp index 0a785e7bf6..4b25a2c490 100644 --- a/scene/resources/sample.cpp +++ b/scene/resources/sample.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -210,11 +210,11 @@ void Sample::_bind_methods(){ ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"), _SCS("_get_data") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "stereo"), _SCS(""), _SCS("is_stereo") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "length"), _SCS(""), _SCS("get_length") ); + ADD_PROPERTY( PropertyInfo( Variant::INT, "length",PROPERTY_HINT_RANGE,"0,999999999"), _SCS(""), _SCS("get_length") ); ADD_PROPERTY( PropertyInfo( Variant::INT, "mix_rate", PROPERTY_HINT_RANGE,"1,192000,1" ), _SCS("set_mix_rate"), _SCS("get_mix_rate") ); ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_format", PROPERTY_HINT_ENUM,"None,Forward,PingPong" ), _SCS("set_loop_format"), _SCS("get_loop_format") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(99999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") ); + ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_begin", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_begin"), _SCS("get_loop_begin") ); + ADD_PROPERTY( PropertyInfo( Variant::INT, "loop_end", PROPERTY_HINT_RANGE,"0,"+itos(999999999)+",1"), _SCS("set_loop_end"), _SCS("get_loop_end") ); BIND_CONSTANT( FORMAT_PCM8 ); BIND_CONSTANT( FORMAT_PCM16 ); diff --git a/scene/resources/sample.h b/scene/resources/sample.h index 4877e0b841..0a88167233 100644 --- a/scene/resources/sample.h +++ b/scene/resources/sample.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sample_library.cpp b/scene/resources/sample_library.cpp index ffcaa1e675..5b70ee0e11 100644 --- a/scene/resources/sample_library.cpp +++ b/scene/resources/sample_library.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sample_library.h b/scene/resources/sample_library.h index 88519e7035..8377967106 100644 --- a/scene/resources/sample_library.h +++ b/scene/resources/sample_library.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 851083aecf..5450b9e2ac 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -12,12 +12,6 @@ #define _printerr() ERR_PRINT(String(res_path+":"+itos(lines)+" - Parse Error: "+error_text).utf8().get_data()); -Error ResourceInteractiveLoaderText::parse_property(Variant& r_v, String &r_name) { - - return OK; -} - - /// @@ -308,6 +302,10 @@ Error ResourceInteractiveLoaderText::poll() { if (error) { if (error!=ERR_FILE_EOF) { _printerr(); + } else { + if (!ResourceCache::has(res_path)) { + resource->set_path(res_path); + } } return error; } @@ -368,18 +366,15 @@ Error ResourceInteractiveLoaderText::poll() { parent=packed_scene->get_state()->add_node_path(next_tag.fields["parent"]); } - if (next_tag.fields.has("owner")) { - owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]); - } else { - if (parent!=-1) - owner=0; //if no owner, owner is root - } if (next_tag.fields.has("type")) { type=packed_scene->get_state()->add_name(next_tag.fields["type"]); + } else { + type=SceneState::TYPE_INSTANCED; //no type? assume this was instanced } + if (next_tag.fields.has("instance")) { instance=packed_scene->get_state()->add_value(next_tag.fields["instance"]); @@ -390,6 +385,13 @@ Error ResourceInteractiveLoaderText::poll() { } } + if (next_tag.fields.has("owner")) { + owner=packed_scene->get_state()->add_node_path(next_tag.fields["owner"]); + } else { + if (parent!=-1 && !(type==SceneState::TYPE_INSTANCED && instance==-1)) + owner=0; //if no owner, owner is root + } + int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance); @@ -405,6 +407,9 @@ Error ResourceInteractiveLoaderText::poll() { _printerr(); } else { resource=packed_scene; + if (!ResourceCache::has(res_path)) { + packed_scene->set_path(res_path); + } } return error; } @@ -479,8 +484,8 @@ Error ResourceInteractiveLoaderText::poll() { } Vector<int> bind_ints; - for(int i=9;i<binds.size();i++) { - bind_ints.push_back( packed_scene->get_state()->add_value( bind_ints[i] ) ); + for(int i=0;i<binds.size();i++) { + bind_ints.push_back( packed_scene->get_state()->add_value( binds[i] ) ); } packed_scene->get_state()->add_connection( @@ -1026,431 +1031,37 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path,const M /*****************************************************************************************************/ -void ResourceFormatSaverTextInstance::write_property(const String& p_name,const Variant& p_property,bool *r_ok) { - - if (r_ok) - *r_ok=false; - - if (p_name!=String()) { - f->store_string(p_name+" = "); - } - - switch( p_property.get_type() ) { - - case Variant::NIL: { - f->store_string("null"); - } break; - case Variant::BOOL: { - - f->store_string(p_property.operator bool() ? "true":"false" ); - } break; - case Variant::INT: { - - f->store_string( itos(p_property.operator int()) ); - } break; - case Variant::REAL: { - - f->store_string( rtoss(p_property.operator real_t()) ); - } break; - case Variant::STRING: { - - String str=p_property; - - str="\""+str.c_escape()+"\""; - f->store_string( str ); - } break; - case Variant::VECTOR2: { - - Vector2 v = p_property; - f->store_string("Vector2( "+rtoss(v.x) +", "+rtoss(v.y)+" )" ); - } break; - case Variant::RECT2: { - - Rect2 aabb = p_property; - f->store_string("Rect2( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y)+" )" ); - - } break; - case Variant::VECTOR3: { - - Vector3 v = p_property; - f->store_string("Vector3( "+rtoss(v.x) +", "+rtoss(v.y)+", "+rtoss(v.z)+" )"); - } break; - case Variant::PLANE: { - - Plane p = p_property; - f->store_string("Plane( "+rtoss(p.normal.x) +", "+rtoss(p.normal.y)+", "+rtoss(p.normal.z)+", "+rtoss(p.d)+" )" ); - - } break; - case Variant::_AABB: { - - AABB aabb = p_property; - f->store_string("AABB( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.pos.z) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y) +", "+rtoss(aabb.size.z)+" )" ); - - } break; - case Variant::QUAT: { - - Quat quat = p_property; - f->store_string("Quat( "+rtoss(quat.x)+", "+rtoss(quat.y)+", "+rtoss(quat.z)+", "+rtoss(quat.w)+" )"); - - } break; - case Variant::MATRIX32: { - - String s="Matrix32( "; - Matrix32 m3 = p_property; - for (int i=0;i<3;i++) { - for (int j=0;j<2;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - f->store_string(s+" )"); - - } break; - case Variant::MATRIX3: { - - String s="Matrix3( "; - Matrix3 m3 = p_property; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - f->store_string(s+" )"); - - } break; - case Variant::TRANSFORM: { - - String s="Transform( "; - Transform t = p_property; - Matrix3 &m3 = t.basis; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - s=s+", "+rtoss(t.origin.x) +", "+rtoss(t.origin.y)+", "+rtoss(t.origin.z); - - f->store_string(s+" )"); - } break; - - // misc types - case Variant::COLOR: { - - Color c = p_property; - f->store_string("Color( "+rtoss(c.r) +", "+rtoss(c.g)+", "+rtoss(c.b)+", "+rtoss(c.a)+" )"); - - } break; - case Variant::IMAGE: { - - - Image img=p_property; - - if (img.empty()) { - f->store_string("Image()"); - break; - } - - String imgstr="Image( "; - imgstr+=itos(img.get_width()); - imgstr+=", "+itos(img.get_height()); - imgstr+=", "+itos(img.get_mipmaps()); - imgstr+=", "; - - switch(img.get_format()) { - - case Image::FORMAT_GRAYSCALE: imgstr+="GRAYSCALE"; break; - case Image::FORMAT_INTENSITY: imgstr+="INTENSITY"; break; - case Image::FORMAT_GRAYSCALE_ALPHA: imgstr+="GRAYSCALE_ALPHA"; break; - case Image::FORMAT_RGB: imgstr+="RGB"; break; - case Image::FORMAT_RGBA: imgstr+="RGBA"; break; - case Image::FORMAT_INDEXED : imgstr+="INDEXED"; break; - case Image::FORMAT_INDEXED_ALPHA: imgstr+="INDEXED_ALPHA"; break; - case Image::FORMAT_BC1: imgstr+="BC1"; break; - case Image::FORMAT_BC2: imgstr+="BC2"; break; - case Image::FORMAT_BC3: imgstr+="BC3"; break; - case Image::FORMAT_BC4: imgstr+="BC4"; break; - case Image::FORMAT_BC5: imgstr+="BC5"; break; - case Image::FORMAT_PVRTC2: imgstr+="PVRTC2"; break; - case Image::FORMAT_PVRTC2_ALPHA: imgstr+="PVRTC2_ALPHA"; break; - case Image::FORMAT_PVRTC4: imgstr+="PVRTC4"; break; - case Image::FORMAT_PVRTC4_ALPHA: imgstr+="PVRTC4_ALPHA"; break; - case Image::FORMAT_ETC: imgstr+="ETC"; break; - case Image::FORMAT_ATC: imgstr+="ATC"; break; - case Image::FORMAT_ATC_ALPHA_EXPLICIT: imgstr+="ATC_ALPHA_EXPLICIT"; break; - case Image::FORMAT_ATC_ALPHA_INTERPOLATED: imgstr+="ATC_ALPHA_INTERPOLATED"; break; - case Image::FORMAT_CUSTOM: imgstr+="CUSTOM"; break; - default: {} - } - - - String s; - - DVector<uint8_t> data = img.get_data(); - int len = data.size(); - DVector<uint8_t>::Read r = data.read(); - const uint8_t *ptr=r.ptr();; - for (int i=0;i<len;i++) { - - if (i>0) - s+=", "; - s+=itos(ptr[i]); - } - - imgstr+=", "; - f->store_string(imgstr); - f->store_string(s); - f->store_string(" )"); - } break; - case Variant::NODE_PATH: { - - String str=p_property; - - str="NodePath(\""+str.c_escape()+"\")"; - f->store_string(str); - - } break; - - case Variant::OBJECT: { - - RES res = p_property; - if (res.is_null()) { - f->store_string("null"); - if (r_ok) - *r_ok=true; - - break; // don't save it - } - - if (external_resources.has(res)) { - - f->store_string("ExtResource( "+itos(external_resources[res]+1)+" )"); - } else { - - if (internal_resources.has(res)) { - f->store_string("SubResource( "+itos(internal_resources[res])+" )"); - } else if (res->get_path().length() && res->get_path().find("::")==-1) { - - //external resource - String path=relative_paths?local_path.path_to_file(res->get_path()):res->get_path(); - f->store_string("Resource( \""+path+"\" )"); - } else { - f->store_string("null"); - ERR_EXPLAIN("Resource was not pre cached for the resource section, bug?"); - ERR_BREAK(true); - //internal resource - } - } - - } break; - case Variant::INPUT_EVENT: { - - f->store_string("InputEvent()"); //will be added later - } break; - case Variant::DICTIONARY: { - - Dictionary dict = p_property; - - List<Variant> keys; - dict.get_key_list(&keys); - keys.sort(); - - f->store_string("{ "); - for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - - //if (!_check_type(dict[E->get()])) - // continue; - bool ok; - write_property("",E->get(),&ok); - ERR_CONTINUE(!ok); - - f->store_string(":"); - write_property("",dict[E->get()],&ok); - if (!ok) - write_property("",Variant()); //at least make the file consistent.. - if (E->next()) - f->store_string(", "); - } - - - f->store_string(" }"); - - - } break; - case Variant::ARRAY: { - - f->store_string("[ "); - Array array = p_property; - int len=array.size(); - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - write_property("",array[i]); - - - } - f->store_string(" ]"); - - } break; - - case Variant::RAW_ARRAY: { - - f->store_string("ByteArray( "); - String s; - DVector<uint8_t> data = p_property; - int len = data.size(); - DVector<uint8_t>::Read r = data.read(); - const uint8_t *ptr=r.ptr();; - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - - f->store_string(itos(ptr[i])); - - } - - f->store_string(" )"); - - } break; - case Variant::INT_ARRAY: { - - f->store_string("IntArray( "); - DVector<int> data = p_property; - int len = data.size(); - DVector<int>::Read r = data.read(); - const int *ptr=r.ptr();; - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - - f->store_string(itos(ptr[i])); - } - - - f->store_string(" )"); +String ResourceFormatSaverTextInstance::_write_resources(void *ud,const RES& p_resource) { - } break; - case Variant::REAL_ARRAY: { - - f->store_string("FloatArray( "); - DVector<real_t> data = p_property; - int len = data.size(); - DVector<real_t>::Read r = data.read(); - const real_t *ptr=r.ptr();; - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - f->store_string(rtoss(ptr[i])); - } - - f->store_string(" )"); - - } break; - case Variant::STRING_ARRAY: { - - f->store_string("StringArray( "); - DVector<String> data = p_property; - int len = data.size(); - DVector<String>::Read r = data.read(); - const String *ptr=r.ptr();; - String s; - //write_string("\n"); - - - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - String str=ptr[i]; - f->store_string(""+str.c_escape()+"\""); - } - - f->store_string(" )"); - - } break; - case Variant::VECTOR2_ARRAY: { - - f->store_string("Vector2Array( "); - DVector<Vector2> data = p_property; - int len = data.size(); - DVector<Vector2>::Read r = data.read(); - const Vector2 *ptr=r.ptr();; - - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - f->store_string(rtoss(ptr[i].x)+", "+rtoss(ptr[i].y) ); - } - - f->store_string(" )"); - - } break; - case Variant::VECTOR3_ARRAY: { - - f->store_string("Vector3Array( "); - DVector<Vector3> data = p_property; - int len = data.size(); - DVector<Vector3>::Read r = data.read(); - const Vector3 *ptr=r.ptr();; + ResourceFormatSaverTextInstance *rsi=(ResourceFormatSaverTextInstance*)ud; + return rsi->_write_resource(p_resource); - for (int i=0;i<len;i++) { - - if (i>0) - f->store_string(", "); - f->store_string(rtoss(ptr[i].x)+", "+rtoss(ptr[i].y)+", "+rtoss(ptr[i].z) ); - } - - f->store_string(" )"); - - } break; - case Variant::COLOR_ARRAY: { - - f->store_string("ColorArray( "); - - DVector<Color> data = p_property; - int len = data.size(); - DVector<Color>::Read r = data.read(); - const Color *ptr=r.ptr();; - - for (int i=0;i<len;i++) { +} - if (i>0) - f->store_string(", "); +String ResourceFormatSaverTextInstance::_write_resource(const RES& res) { - f->store_string(rtoss(ptr[i].r)+", "+rtoss(ptr[i].g)+", "+rtoss(ptr[i].b)+", "+rtoss(ptr[i].a) ); + if (external_resources.has(res)) { - } - f->store_string(" )"); + return "ExtResource( "+itos(external_resources[res]+1)+" )"; + } else { - } break; - default: {} + if (internal_resources.has(res)) { + return "SubResource( "+itos(internal_resources[res])+" )"; + } else if (res->get_path().length() && res->get_path().find("::")==-1) { + //external resource + String path=relative_paths?local_path.path_to_file(res->get_path()):res->get_path(); + return "Resource( \""+path+"\" )"; + } else { + ERR_EXPLAIN("Resource was not pre cached for the resource section, bug?"); + ERR_FAIL_V("null"); + //internal resource + } } - if (r_ok) - *r_ok=true; - + return "null"; } - void ResourceFormatSaverTextInstance::_find_resources(const Variant& p_variant,bool p_main) { @@ -1584,11 +1195,18 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re } + Vector<RES> sorted_er; + sorted_er.resize(external_resources.size()); + for(Map<RES,int>::Element *E=external_resources.front();E;E=E->next()) { - String p = E->key()->get_path(); + sorted_er[E->get()]=E->key(); + } + + for(int i=0;i<sorted_er.size();i++) { + String p = sorted_er[i]->get_path(); - f->store_string("[ext_resource path=\""+p+"\" type=\""+E->key()->get_save_type()+"\" id="+itos(E->get()+1)+"]\n"); //bundled + f->store_string("[ext_resource path=\""+p+"\" type=\""+sorted_er[i]->get_save_type()+"\" id="+itos(i+1)+"]\n"); //bundled } if (external_resources.size()) @@ -1667,8 +1285,9 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re if (PE->get().type==Variant::OBJECT && value.is_zero()) continue; - write_property(name,value); - f->store_string("\n"); + String vars; + VariantWriter::write_to_string(value,vars,_write_resources,this); + f->store_string(name+" = "+vars+"\n"); } @@ -1719,17 +1338,22 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re f->store_string(header); if (instance.is_valid()) { + + String vars; f->store_string(" instance="); - write_property("",instance); + VariantWriter::write_to_string(instance,vars,_write_resources,this); + f->store_string(vars); + } f->store_line("]\n"); for(int j=0;j<state->get_node_property_count(i);j++) { - write_property(state->get_node_property_name(i,j),state->get_node_property_value(i,j)); - f->store_line(String()); + String vars; + VariantWriter::write_to_string(state->get_node_property_value(i,j),vars,_write_resources,this); + f->store_string(String(state->get_node_property_name(i,j))+" = "+vars+"\n"); } if (state->get_node_property_count(i)) { @@ -1754,8 +1378,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re Array binds=state->get_connection_binds(i); f->store_string(connstr); if (binds.size()) { - f->store_string(" binds="); - write_property("",binds); + String vars; + VariantWriter::write_to_string(binds,vars,_write_resources,this); + f->store_string(" binds= "+vars); + } f->store_line("]\n"); diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h index 4f18af2b62..0e844c9165 100644 --- a/scene/resources/scene_format_text.h +++ b/scene/resources/scene_format_text.h @@ -60,7 +60,6 @@ class ResourceInteractiveLoaderText : public ResourceInteractiveLoader { friend class ResourceFormatLoaderText; List<RES> resource_cache; - Error parse_property(Variant& r_v, String &r_name); Error error; RES resource; @@ -117,7 +116,10 @@ class ResourceFormatSaverTextInstance { Map<RES,int> internal_resources; void _find_resources(const Variant& p_variant,bool p_main=false); - void write_property(const String& p_name,const Variant& p_property,bool *r_ok=NULL); + + static String _write_resources(void *ud,const RES& p_resource); + String _write_resource(const RES& res); + public: diff --git a/scene/resources/scene_preloader.cpp b/scene/resources/scene_preloader.cpp index 09001c1a94..c031f3c721 100644 --- a/scene/resources/scene_preloader.cpp +++ b/scene/resources/scene_preloader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/scene_preloader.h b/scene/resources/scene_preloader.h index d60d08afd4..2317c9e0bd 100644 --- a/scene/resources/scene_preloader.h +++ b/scene/resources/scene_preloader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 88f7adcd9b..b8b14fd6fc 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/segment_shape_2d.h b/scene/resources/segment_shape_2d.h index 37c68b6c92..6f7b2f2d38 100644 --- a/scene/resources/segment_shape_2d.h +++ b/scene/resources/segment_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index f0a2721016..ee9f23dd2a 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shader.h b/scene/resources/shader.h index 61a369c408..6ee8d4e793 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index f8a14e58a0..eabc84c41e 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -179,25 +179,25 @@ void ShaderGraph::_bind_methods() { ObjectTypeDB::bind_method(_MD("default_get_value","shader_type","id","param_id"), &ShaderGraph::default_get_value); ObjectTypeDB::bind_method(_MD("scalar_const_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_const_node_set_value); - ObjectTypeDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_set_value); + ObjectTypeDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_get_value); ObjectTypeDB::bind_method(_MD("vec_const_node_set_value","shader_type","id","value"),&ShaderGraph::vec_const_node_set_value); - ObjectTypeDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_set_value); + ObjectTypeDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_get_value); ObjectTypeDB::bind_method(_MD("rgb_const_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_const_node_set_value); - ObjectTypeDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_set_value); + ObjectTypeDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_get_value); ObjectTypeDB::bind_method(_MD("xform_const_node_set_value","shader_type","id","value"),&ShaderGraph::xform_const_node_set_value); - ObjectTypeDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_set_value); + ObjectTypeDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value); // void get_node_list(ShaderType p_which,List<int> *p_node_list) const; ObjectTypeDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size); - ObjectTypeDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_set_filter_size); + ObjectTypeDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size); ObjectTypeDB::bind_method(_MD("texture_node_set_filter_strength","shader_type","id","filter_strength"),&ShaderGraph::texture_node_set_filter_strength); - ObjectTypeDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_set_filter_strength); + ObjectTypeDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_get_filter_strength); ObjectTypeDB::bind_method(_MD("scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::scalar_op_node_set_op); ObjectTypeDB::bind_method(_MD("scalar_op_node_get_op","shader_type","id"),&ShaderGraph::scalar_op_node_get_op); @@ -1533,7 +1533,7 @@ const ShaderGraph::NodeSlotInfo ShaderGraph::node_slot_info[]= { {NODE_CURVE_MAP,{SLOT_TYPE_SCALAR,SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // vec3 interpolation (with optional curve) {NODE_SCALAR_INPUT,{SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // scalar uniform (assignable in material) {NODE_VEC_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // vec3 uniform (assignable in material) - {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // color uniform (assignable in material) + {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // color uniform (assignable in material) {NODE_XFORM_INPUT,{SLOT_MAX},{SLOT_TYPE_XFORM,SLOT_MAX}}, // mat4 uniform (assignable in material) {NODE_TEXTURE_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // texture input (assignable in material) {NODE_CUBEMAP_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // cubemap input (assignable in material) @@ -2576,8 +2576,9 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str String name = p_node->param1; Color dv= p_node->param2; - code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.g)+","+rtos(dv.a)+");\n"; + code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.b)+","+rtos(dv.a)+");\n"; code += OUTNAME(p_node->id,0)+"="+name+".rgb;\n"; + code += OUTNAME(p_node->id,1)+"="+name+".a;\n"; }break; case NODE_XFORM_INPUT: { diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index f867ae0388..1e6fc3507c 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape.cpp b/scene/resources/shape.cpp index 143ef82d51..a71e414f61 100644 --- a/scene/resources/shape.cpp +++ b/scene/resources/shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape.h b/scene/resources/shape.h index 1992ce51c3..bfd423a300 100644 --- a/scene/resources/shape.h +++ b/scene/resources/shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 56fd8e212e..6a9773bf14 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_2d.h b/scene/resources/shape_2d.h index 1737301d9d..4059af62c6 100644 --- a/scene/resources/shape_2d.h +++ b/scene/resources/shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index 97e9985754..4133d2218f 100644 --- a/scene/resources/shape_line_2d.cpp +++ b/scene/resources/shape_line_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/shape_line_2d.h b/scene/resources/shape_line_2d.h index f32ad7fb7c..f6f75e7a95 100644 --- a/scene/resources/shape_line_2d.h +++ b/scene/resources/shape_line_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/space_2d.cpp b/scene/resources/space_2d.cpp index 6dbf7c4a73..d328ee3de4 100644 --- a/scene/resources/space_2d.cpp +++ b/scene/resources/space_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/space_2d.h b/scene/resources/space_2d.h index eb3e13ee62..270f8de3ea 100644 --- a/scene/resources/space_2d.h +++ b/scene/resources/space_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index a7e28eb727..4764937371 100644 --- a/scene/resources/sphere_shape.cpp +++ b/scene/resources/sphere_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/sphere_shape.h b/scene/resources/sphere_shape.h index 2543d94439..50682f38bb 100644 --- a/scene/resources/sphere_shape.h +++ b/scene/resources/sphere_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 527fae5946..71a775ee24 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -83,7 +83,7 @@ void StyleBox::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_center_size"),&StyleBox::get_center_size); ObjectTypeDB::bind_method(_MD("get_offset"),&StyleBox::get_offset); - ObjectTypeDB::bind_method(_MD("draw"),&StyleBox::draw); + ObjectTypeDB::bind_method(_MD("draw","canvas_item","rect"),&StyleBox::draw); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/left", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_LEFT ); ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/right", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_RIGHT ); @@ -182,10 +182,10 @@ void StyleBoxTexture::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_texture:Texture"),&StyleBoxTexture::get_texture); ObjectTypeDB::bind_method(_MD("set_margin_size","margin","size"),&StyleBoxTexture::set_margin_size); - ObjectTypeDB::bind_method(_MD("get_margin_size"),&StyleBoxTexture::get_margin_size); + ObjectTypeDB::bind_method(_MD("get_margin_size","margin"),&StyleBoxTexture::get_margin_size); ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxTexture::set_expand_margin_size); - ObjectTypeDB::bind_method(_MD("get_expand_margin_size"),&StyleBoxTexture::get_expand_margin_size); + ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxTexture::get_expand_margin_size); ObjectTypeDB::bind_method(_MD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center); ObjectTypeDB::bind_method(_MD("get_draw_center"),&StyleBoxTexture::get_draw_center); @@ -392,7 +392,7 @@ void StyleBoxImageMask::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_expand","expand"),&StyleBoxImageMask::set_expand); ObjectTypeDB::bind_method(_MD("get_expand"),&StyleBoxImageMask::get_expand); ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxImageMask::set_expand_margin_size); - ObjectTypeDB::bind_method(_MD("get_expand_margin_size"),&StyleBoxImageMask::get_expand_margin_size); + ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxImageMask::get_expand_margin_size); ADD_PROPERTY( PropertyInfo(Variant::IMAGE, "image"), _SCS("set_image"), _SCS("get_image")); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "expand"), _SCS("set_expand"), _SCS("get_expand")); diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index 337bb54026..d0466ed5f1 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 418df97f51..bf5070fd7d 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h index ed91b4df61..1d329f23c0 100644 --- a/scene/resources/surface_tool.h +++ b/scene/resources/surface_tool.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 5df3d64d1a..28754480f1 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -70,9 +70,9 @@ void Texture::_bind_methods() { ObjectTypeDB::bind_method(_MD("has_alpha"),&Texture::has_alpha); ObjectTypeDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags); ObjectTypeDB::bind_method(_MD("get_flags"),&Texture::get_flags); - ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","modulate"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","modulate","transpose"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate","transpose"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ObjectTypeDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate","transpose"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); BIND_CONSTANT( FLAG_MIPMAPS ); BIND_CONSTANT( FLAG_REPEAT ); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 3be13bf815..2627b9480a 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 651e234b49..e2413f7d84 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -552,36 +552,36 @@ void Theme::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_icon:Texture","name","type"),&Theme::get_icon); ObjectTypeDB::bind_method(_MD("has_icon","name","type"),&Theme::has_icon); ObjectTypeDB::bind_method(_MD("clear_icon","name","type"),&Theme::clear_icon); - ObjectTypeDB::bind_method(_MD("get_icon_list"),&Theme::_get_icon_list); + ObjectTypeDB::bind_method(_MD("get_icon_list","type"),&Theme::_get_icon_list); ObjectTypeDB::bind_method(_MD("set_stylebox","name","type","texture:StyleBox"),&Theme::set_stylebox); ObjectTypeDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Theme::get_stylebox); ObjectTypeDB::bind_method(_MD("has_stylebox","name","type"),&Theme::has_stylebox); ObjectTypeDB::bind_method(_MD("clear_stylebox","name","type"),&Theme::clear_stylebox); - ObjectTypeDB::bind_method(_MD("get_stylebox_list"),&Theme::_get_stylebox_list); + ObjectTypeDB::bind_method(_MD("get_stylebox_list","type"),&Theme::_get_stylebox_list); ObjectTypeDB::bind_method(_MD("set_font","name","type","font:Font"),&Theme::set_font); ObjectTypeDB::bind_method(_MD("get_font:Font","name","type"),&Theme::get_font); ObjectTypeDB::bind_method(_MD("has_font","name","type"),&Theme::has_font); ObjectTypeDB::bind_method(_MD("clear_font","name","type"),&Theme::clear_font); - ObjectTypeDB::bind_method(_MD("get_font_list"),&Theme::_get_font_list); + ObjectTypeDB::bind_method(_MD("get_font_list","type"),&Theme::_get_font_list); ObjectTypeDB::bind_method(_MD("set_color","name","type","color"),&Theme::set_color); ObjectTypeDB::bind_method(_MD("get_color","name","type"),&Theme::get_color); ObjectTypeDB::bind_method(_MD("has_color","name","type"),&Theme::has_color); ObjectTypeDB::bind_method(_MD("clear_color","name","type"),&Theme::clear_color); - ObjectTypeDB::bind_method(_MD("get_color_list"),&Theme::_get_color_list); + ObjectTypeDB::bind_method(_MD("get_color_list","type"),&Theme::_get_color_list); ObjectTypeDB::bind_method(_MD("set_constant","name","type","constant"),&Theme::set_constant); ObjectTypeDB::bind_method(_MD("get_constant","name","type"),&Theme::get_constant); ObjectTypeDB::bind_method(_MD("has_constant","name","type"),&Theme::has_constant); ObjectTypeDB::bind_method(_MD("clear_constant","name","type"),&Theme::clear_constant); - ObjectTypeDB::bind_method(_MD("get_constant_list"),&Theme::_get_constant_list); + ObjectTypeDB::bind_method(_MD("get_constant_list","type"),&Theme::_get_constant_list); ObjectTypeDB::bind_method(_MD("set_default_font","font"),&Theme::set_default_theme_font); ObjectTypeDB::bind_method(_MD("get_default_font"),&Theme::get_default_theme_font); - ObjectTypeDB::bind_method(_MD("get_type_list"),&Theme::_get_type_list); + ObjectTypeDB::bind_method(_MD("get_type_list","type"),&Theme::_get_type_list); ObjectTypeDB::bind_method("copy_default_theme",&Theme::copy_default_theme); diff --git a/scene/resources/theme.h b/scene/resources/theme.h index cfa0762595..f0747fb3c4 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 28e179b34c..6f71287750 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 96048bf06b..fb0e832c1e 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp index c957fd4c67..8e16f2e024 100644 --- a/scene/resources/video_stream.cpp +++ b/scene/resources/video_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index a23ef0c64f..b05a7cf773 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/volume.cpp b/scene/resources/volume.cpp index a668a39c4f..8eb96cb4ad 100644 --- a/scene/resources/volume.cpp +++ b/scene/resources/volume.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/volume.h b/scene/resources/volume.h index f929792b74..be3cbddbbd 100644 --- a/scene/resources/volume.h +++ b/scene/resources/volume.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index fb3469102c..0a88abf252 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world.h b/scene/resources/world.h index 165122124d..5a74f27235 100644 --- a/scene/resources/world.h +++ b/scene/resources/world.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 3b1f1d2346..8cacc0fce7 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h index a3a79dee09..a939d935c4 100644 --- a/scene/resources/world_2d.h +++ b/scene/resources/world_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index 9509878dc9..57bde00de4 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 48f17ed38b..b2c0e9abf0 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ |