From c79be979d47daae613d1b1bbc732a30a74f56543 Mon Sep 17 00:00:00 2001
From: Juan Linietsky <reduzio@gmail.com>
Date: Sun, 7 Dec 2014 02:04:20 -0300
Subject: Batch of Bugfixes -=-=-=-=-=-=-=-=-

-Fixed Export UV XForm (should work now). #923
-Fixed enforcement of limits in property editor. #919
-Fixed long-standing bug of export editings in script inheritance. #914, #859, #756
-Fixed horrible error reporting in shader language. #912
-Added kinematic collision with plane (please test well). #911
-Fixed double animation track insert when using 2D rigs. #904
-VKey updates offset parameter in sprite edition. #901
-Do not allow anymore a script to preload itself. (does not fix #899, but narrows it down)
-Avoid connection editor from overriding selected text. #897
-Fixed timer autostart. #876
-Fixed collision layers in 3D physics. #872
-Improved operators in shader #857
-Fixed ambient lighting bug #834
-Avoid editor from processing gamepad input #813
-Added not keyword #752

Please test!
---
 scene/2d/animated_sprite.cpp |  7 +++++--
 scene/2d/area_2d.cpp         | 15 +++++++++++++++
 scene/2d/area_2d.h           |  1 +
 scene/2d/polygon_2d.cpp      |  1 +
 scene/2d/sprite.cpp          |  6 ++++++
 5 files changed, 28 insertions(+), 2 deletions(-)

(limited to 'scene/2d')

diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index 316dffb3f9..2fcfc18429 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -27,7 +27,7 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /*************************************************************************/
 #include "animated_sprite.h"
-
+#include "scene/scene_string_names.h"
 void AnimatedSprite::edit_set_pivot(const Point2& p_pivot) {
 
 	set_offset(p_pivot);
@@ -207,7 +207,7 @@ void AnimatedSprite::set_frame(int p_frame) {
 	frame=p_frame;
 	update();
 	_change_notify("frame");
-
+	emit_signal(SceneStringNames::get_singleton()->frame_changed);
 
 }
 int AnimatedSprite::get_frame() const {
@@ -233,6 +233,7 @@ void AnimatedSprite::set_offset(const Point2& p_offset) {
 	offset=p_offset;
 	update();
 	item_rect_changed();
+	_change_notify("offset");
 }
 Point2 AnimatedSprite::get_offset() const {
 
@@ -325,6 +326,8 @@ void AnimatedSprite::_bind_methods() {
 
 	ObjectTypeDB::bind_method(_MD("_res_changed"),&AnimatedSprite::_res_changed);
 
+	ADD_SIGNAL(MethodInfo("frame_changed"));
+
 	ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "frames",PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), _SCS("set_sprite_frames"),_SCS("get_sprite_frames"));
 	ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame"), _SCS("set_frame"),_SCS("get_frame"));
 	ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered"));
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index 3114106235..68dcfcb875 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -142,6 +142,8 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
 
 	ERR_FAIL_COND(!body_in && !E);
 
+	locked=true;
+
 	if (body_in) {
 		if (!E) {
 
@@ -197,11 +199,18 @@ void Area2D::_body_inout(int p_status,const RID& p_body, int p_instance, int p_b
 
 	}
 
+	locked=false;
+
+
 }
 
 
 void Area2D::_clear_monitoring() {
 
+	if (locked) {
+		ERR_EXPLAIN("This function can't be used during the in/out signal.");
+	}
+	ERR_FAIL_COND(locked);
 
 	Map<ObjectID,BodyState> bmcopy = body_map;
 	body_map.clear();
@@ -243,6 +252,11 @@ 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;
 
@@ -336,6 +350,7 @@ Area2D::Area2D() : CollisionObject2D(Physics2DServer::get_singleton()->area_crea
 	set_gravity_vector(Vector2(0,1));
 	gravity_is_point=false;
 	density=0.1;
+	locked=true;
 	priority=0;
 	monitoring=false;
 	set_enable_monitoring(true);
diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h
index c6210e7c9a..2044cc7db0 100644
--- a/scene/2d/area_2d.h
+++ b/scene/2d/area_2d.h
@@ -52,6 +52,7 @@ private:
 	real_t density;
 	int priority;
 	bool monitoring;
+	bool locked;
 
 	void _body_inout(int p_status,const RID& p_body, int p_instance, int p_body_shape,int p_area_shape);
 
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index 2b4be734af..217a98aaea 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -359,5 +359,6 @@ Polygon2D::Polygon2D() {
 	tex_rot=0;
 	tex_tile=true;
 	tex_scale=Vector2(1,1);
+	color=Color(1,1,1);
 	rect_cache_dirty=true;
 }
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index 9f789a7a1f..82f5a6972a 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -34,6 +34,7 @@
 void Sprite::edit_set_pivot(const Point2& p_pivot) {
 
 	set_offset(p_pivot);
+
 }
 
 Point2 Sprite::edit_get_pivot() const {
@@ -136,6 +137,7 @@ void Sprite::set_offset(const Point2& p_offset) {
 	offset=p_offset;
 	update();
 	item_rect_changed();
+	_change_notify("offset");
 }
 Point2 Sprite::get_offset() const {
 
@@ -199,6 +201,8 @@ void Sprite::set_frame(int p_frame) {
 		item_rect_changed();
 
 	frame=p_frame;
+
+	emit_signal(SceneStringNames::get_singleton()->frame_changed);
 }
 
 int Sprite::get_frame() const {
@@ -307,6 +311,8 @@ void Sprite::_bind_methods() {
 	ObjectTypeDB::bind_method(_MD("set_modulate","modulate"),&Sprite::set_modulate);
 	ObjectTypeDB::bind_method(_MD("get_modulate"),&Sprite::get_modulate);
 
+	ADD_SIGNAL(MethodInfo("frame_changed"));
+
 	ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_texture"),_SCS("get_texture"));
 	ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered"));
 	ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset"));
-- 
cgit v1.2.3


From efb257c675a028de666b4bfcbac47b16770e10e7 Mon Sep 17 00:00:00 2001
From: Juan Linietsky <reduzio@gmail.com>
Date: Sun, 7 Dec 2014 02:31:43 -0300
Subject: missing fix in file

---
 scene/2d/area_2d.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'scene/2d')

diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index 68dcfcb875..ca2a42026d 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -350,7 +350,7 @@ Area2D::Area2D() : CollisionObject2D(Physics2DServer::get_singleton()->area_crea
 	set_gravity_vector(Vector2(0,1));
 	gravity_is_point=false;
 	density=0.1;
-	locked=true;
+	locked=false;
 	priority=0;
 	monitoring=false;
 	set_enable_monitoring(true);
-- 
cgit v1.2.3