diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-08 12:31:14 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-08 12:31:14 -0300 |
commit | 8ecc34bfaeb6b444333c0aa2412e412f6423915d (patch) | |
tree | 052418f9cc28956565f9df6796f65551d04b9b20 /scene/2d | |
parent | d9ca9d778db3e49e2f3376881b4ca11eb6d6d172 (diff) |
removed unnecesary modulate funtions, which were superseded by self_modulate
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/animated_sprite.cpp | 19 | ||||
-rw-r--r-- | scene/2d/animated_sprite.h | 1 | ||||
-rw-r--r-- | scene/2d/sprite.cpp | 19 | ||||
-rw-r--r-- | scene/2d/sprite.h | 4 |
4 files changed, 3 insertions, 40 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index bde3f50754..f9f6525686 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -428,7 +428,7 @@ void AnimatedSprite::_notification(int p_what) { dst_rect.size.y=-dst_rect.size.y; //texture->draw_rect(ci,dst_rect,false,modulate); - texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size()),modulate); + texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size())); // VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); } break; @@ -544,17 +544,6 @@ bool AnimatedSprite::is_flipped_v() const { } -void AnimatedSprite::set_modulate(const Color& p_color) { - - modulate=p_color; - update(); -} - -Color AnimatedSprite::get_modulate() const{ - - return modulate; -} - Rect2 AnimatedSprite::get_item_rect() const { @@ -692,9 +681,6 @@ void AnimatedSprite::_bind_methods() { ClassDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite::set_frame); ClassDB::bind_method(_MD("get_frame"),&AnimatedSprite::get_frame); - ClassDB::bind_method(_MD("set_modulate","modulate"),&AnimatedSprite::set_modulate); - ClassDB::bind_method(_MD("get_modulate"),&AnimatedSprite::get_modulate); - ClassDB::bind_method(_MD("_res_changed"),&AnimatedSprite::_res_changed); @@ -709,7 +695,7 @@ void AnimatedSprite::_bind_methods() { ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset")); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_h"), _SCS("set_flip_h"),_SCS("is_flipped_h")); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_v"), _SCS("set_flip_v"),_SCS("is_flipped_v")); - ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate")); + } @@ -722,7 +708,6 @@ AnimatedSprite::AnimatedSprite() { frame=0; playing=false; animation="default"; - modulate=Color(1,1,1,1); timeout=0; diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index f546de038b..fbeea7f69b 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -124,7 +124,6 @@ class AnimatedSprite : public Node2D { bool hflip; bool vflip; - Color modulate; void _res_changed(); diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 480991c71d..8bad8fcb38 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -97,7 +97,7 @@ void Sprite::_notification(int p_what) { if (vflip) dst_rect.size.y=-dst_rect.size.y; - texture->draw_rect_region(ci,dst_rect,src_rect,modulate); + texture->draw_rect_region(ci,dst_rect,src_rect); } break; } @@ -249,16 +249,6 @@ int Sprite::get_hframes() const { return hframes; } -void Sprite::set_modulate(const Color& p_color) { - - modulate=p_color; - update(); -} - -Color Sprite::get_modulate() const{ - - return modulate; -} Rect2 Sprite::get_item_rect() const { @@ -332,9 +322,6 @@ void Sprite::_bind_methods() { ClassDB::bind_method(_MD("set_hframes","hframes"),&Sprite::set_hframes); ClassDB::bind_method(_MD("get_hframes"),&Sprite::get_hframes); - ClassDB::bind_method(_MD("set_modulate","modulate"),&Sprite::set_modulate); - ClassDB::bind_method(_MD("get_modulate"),&Sprite::get_modulate); - ADD_SIGNAL(MethodInfo("frame_changed")); ADD_SIGNAL(MethodInfo("texture_changed")); @@ -346,7 +333,6 @@ void Sprite::_bind_methods() { ADD_PROPERTYNO( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_vframes"),_SCS("get_vframes")); ADD_PROPERTYNO( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_hframes"),_SCS("get_hframes")); ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); - ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate")); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "region"), _SCS("set_region"),_SCS("is_region")); ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); @@ -364,9 +350,6 @@ Sprite::Sprite() { vframes=1; hframes=1; - modulate=Color(1,1,1,1); - - } diff --git a/scene/2d/sprite.h b/scene/2d/sprite.h index 687d054297..05c0bd9eec 100644 --- a/scene/2d/sprite.h +++ b/scene/2d/sprite.h @@ -52,7 +52,6 @@ class Sprite : public Node2D { int vframes; int hframes; - Color modulate; protected: @@ -99,9 +98,6 @@ public: void set_hframes(int p_amount); int get_hframes() const; - void set_modulate(const Color& p_color); - Color get_modulate() const; - virtual Rect2 get_item_rect() const; Sprite(); |