summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prop_renames.txt16
-rw-r--r--scene/2d/animated_sprite.cpp19
-rw-r--r--scene/2d/animated_sprite.h1
-rw-r--r--scene/2d/sprite.cpp19
-rw-r--r--scene/2d/sprite.h4
-rw-r--r--scene/gui/patch_9_frame.cpp17
-rw-r--r--scene/gui/patch_9_frame.h4
-rw-r--r--scene/gui/texture_frame.cpp25
-rw-r--r--scene/gui/texture_frame.h3
9 files changed, 26 insertions, 82 deletions
diff --git a/prop_renames.txt b/prop_renames.txt
index 8ab54f7221..9821a32b68 100644
--- a/prop_renames.txt
+++ b/prop_renames.txt
@@ -497,6 +497,22 @@ expand_margin/right = expand_margin_right
modulate/color = modulate_color
+[AnimatedSprite]
+
+modulate = self_modulate
+
+[Sprite]
+
+modulate = self_modulate
+
+[Patch9Frame]
+
+modulate = self_modulate
+
+[TextureFrame]
+
+modulate = self_modulate
+
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();
diff --git a/scene/gui/patch_9_frame.cpp b/scene/gui/patch_9_frame.cpp
index 06d58c49e1..5bcc6eb3e9 100644
--- a/scene/gui/patch_9_frame.cpp
+++ b/scene/gui/patch_9_frame.cpp
@@ -39,7 +39,7 @@ void Patch9Frame::_notification(int p_what) {
Size2 s=get_size();
RID ci = get_canvas_item();
- VS::get_singleton()->canvas_item_add_nine_patch(ci,Rect2(Point2(),s),region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),VS::NINE_PATCH_STRETCH,VS::NINE_PATCH_STRETCH,draw_center,modulate);
+ VS::get_singleton()->canvas_item_add_nine_patch(ci,Rect2(Point2(),s),region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),VS::NINE_PATCH_STRETCH,VS::NINE_PATCH_STRETCH,draw_center);
// draw_texture_rect(texture,Rect2(Point2(),s),false,modulate);
/*
@@ -70,8 +70,6 @@ void Patch9Frame::_bind_methods() {
ClassDB::bind_method(_MD("set_texture","texture"), & Patch9Frame::set_texture );
ClassDB::bind_method(_MD("get_texture"), & Patch9Frame::get_texture );
- ClassDB::bind_method(_MD("set_modulate","modulate"), & Patch9Frame::set_modulate );
- ClassDB::bind_method(_MD("get_modulate"), & Patch9Frame::get_modulate );
ClassDB::bind_method(_MD("set_patch_margin","margin","value"), & Patch9Frame::set_patch_margin );
ClassDB::bind_method(_MD("get_patch_margin","margin"), & Patch9Frame::get_patch_margin );
ClassDB::bind_method(_MD("set_region_rect","rect"),&Patch9Frame::set_region_rect);
@@ -82,7 +80,6 @@ void Patch9Frame::_bind_methods() {
ADD_SIGNAL(MethodInfo("texture_changed"));
ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") );
- ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate") );
ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "draw_center"), _SCS("set_draw_center"),_SCS("get_draw_center") );
ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect"));
@@ -112,16 +109,6 @@ Ref<Texture> Patch9Frame::get_texture() const {
return texture;
}
-void Patch9Frame::set_modulate(const Color& p_tex) {
-
- modulate=p_tex;
- update();
-}
-
-Color Patch9Frame::get_modulate() const{
-
- return modulate;
-}
void Patch9Frame::set_patch_margin(Margin p_margin,int p_size) {
@@ -186,7 +173,7 @@ Patch9Frame::Patch9Frame() {
margin[MARGIN_RIGHT]=0;
margin[MARGIN_BOTTOM]=0;
margin[MARGIN_TOP]=0;
- modulate=Color(1,1,1,1);
+
set_ignore_mouse(true);
draw_center=true;
}
diff --git a/scene/gui/patch_9_frame.h b/scene/gui/patch_9_frame.h
index f9de022078..afbeca5ae8 100644
--- a/scene/gui/patch_9_frame.h
+++ b/scene/gui/patch_9_frame.h
@@ -40,7 +40,6 @@ class Patch9Frame : public Control {
bool draw_center;
int margin[4];
Rect2 region_rect;
- Color modulate;
Ref<Texture> texture;
protected:
@@ -53,9 +52,6 @@ public:
void set_texture(const Ref<Texture>& p_tex);
Ref<Texture> get_texture() const;
- void set_modulate(const Color& p_tex);
- Color get_modulate() const;
-
void set_patch_margin(Margin p_margin,int p_size);
int get_patch_margin(Margin p_margin) const;
diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_frame.cpp
index 9c2113233c..b0940df1f6 100644
--- a/scene/gui/texture_frame.cpp
+++ b/scene/gui/texture_frame.cpp
@@ -40,22 +40,22 @@ void TextureFrame::_notification(int p_what) {
switch(stretch_mode) {
case STRETCH_SCALE_ON_EXPAND: {
Size2 s=expand?get_size():texture->get_size();
- draw_texture_rect(texture,Rect2(Point2(),s),false,modulate);
+ draw_texture_rect(texture,Rect2(Point2(),s),false);
} break;
case STRETCH_SCALE: {
- draw_texture_rect(texture,Rect2(Point2(),get_size()),false,modulate);
+ draw_texture_rect(texture,Rect2(Point2(),get_size()),false);
} break;
case STRETCH_TILE: {
- draw_texture_rect(texture,Rect2(Point2(),get_size()),true,modulate);
+ draw_texture_rect(texture,Rect2(Point2(),get_size()),true);
} break;
case STRETCH_KEEP: {
- draw_texture_rect(texture,Rect2(Point2(),texture->get_size()),false,modulate);
+ draw_texture_rect(texture,Rect2(Point2(),texture->get_size()),false);
} break;
case STRETCH_KEEP_CENTERED: {
Vector2 ofs = (get_size() - texture->get_size())/2;
- draw_texture_rect(texture,Rect2(ofs,texture->get_size()),false,modulate);
+ draw_texture_rect(texture,Rect2(ofs,texture->get_size()),false);
} break;
case STRETCH_KEEP_ASPECT_CENTERED:
case STRETCH_KEEP_ASPECT: {
@@ -97,15 +97,12 @@ void TextureFrame::_bind_methods() {
ClassDB::bind_method(_MD("set_texture","texture"), & TextureFrame::set_texture );
ClassDB::bind_method(_MD("get_texture"), & TextureFrame::get_texture );
- ClassDB::bind_method(_MD("set_modulate","modulate"), & TextureFrame::set_modulate );
- ClassDB::bind_method(_MD("get_modulate"), & TextureFrame::get_modulate );
ClassDB::bind_method(_MD("set_expand","enable"), & TextureFrame::set_expand );
ClassDB::bind_method(_MD("has_expand"), & TextureFrame::has_expand );
ClassDB::bind_method(_MD("set_stretch_mode","stretch_mode"), & TextureFrame::set_stretch_mode );
ClassDB::bind_method(_MD("get_stretch_mode"), & TextureFrame::get_stretch_mode );
ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") );
- ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate") );
ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") );
ADD_PROPERTYNO( PropertyInfo( Variant::INT, "stretch_mode",PROPERTY_HINT_ENUM,"Scale On Expand (Compat),Scale,Tile,Keep,Keep Centered,Keep Aspect,Keep Aspect Centered"), _SCS("set_stretch_mode"),_SCS("get_stretch_mode") );
@@ -134,17 +131,6 @@ Ref<Texture> TextureFrame::get_texture() const {
return texture;
}
-void TextureFrame::set_modulate(const Color& p_tex) {
-
- modulate=p_tex;
- update();
-}
-
-Color TextureFrame::get_modulate() const{
-
- return modulate;
-}
-
void TextureFrame::set_expand(bool p_expand) {
@@ -172,7 +158,6 @@ TextureFrame::TextureFrame() {
expand=false;
- modulate=Color(1,1,1,1);
set_ignore_mouse(true);
stretch_mode=STRETCH_SCALE_ON_EXPAND;
}
diff --git a/scene/gui/texture_frame.h b/scene/gui/texture_frame.h
index 47a653a117..c311748708 100644
--- a/scene/gui/texture_frame.h
+++ b/scene/gui/texture_frame.h
@@ -49,7 +49,6 @@ public:
};
private:
bool expand;
- Color modulate;
Ref<Texture> texture;
StretchMode stretch_mode;
protected:
@@ -63,8 +62,6 @@ public:
void set_texture(const Ref<Texture>& p_tex);
Ref<Texture> get_texture() const;
- void set_modulate(const Color& p_tex);
- Color get_modulate() const;
void set_expand(bool p_expand);
bool has_expand() const;