issue #3162: delete duplicate functions.

This commit is contained in:
boyu0 2013-12-11 16:12:14 +08:00
parent 463ae20ce6
commit 7cbce905bf
8 changed files with 3 additions and 92 deletions

View File

@ -576,18 +576,6 @@ void LayerColor::draw()
CC_INCREMENT_GL_DRAWS(1);
}
void LayerColor::setColor(const Color3B &color)
{
Layer::setColor(color);
updateColor();
}
void LayerColor::setOpacity(GLubyte opacity)
{
Layer::setOpacity(opacity);
updateColor();
}
//
// LayerGradient
//

View File

@ -261,8 +261,6 @@ public:
// Overrides
//
virtual void draw() override;
virtual void setColor(const Color3B &color) override;
virtual void setOpacity(GLubyte opacity) override;
virtual void setContentSize(const Size & var) override;
/** BlendFunction. Conforms to BlendProtocol protocol */
/**
@ -286,7 +284,7 @@ protected:
bool initWithColor(const Color4B& color, GLfloat width, GLfloat height);
bool initWithColor(const Color4B& color);
virtual void updateColor();
virtual void updateColor() override;
BlendFunc _blendFunc;
Vertex2F _squareVertices[4];

View File

@ -148,28 +148,6 @@ void ProgressTimer::setReverseProgress(bool reverse)
}
}
void ProgressTimer::setColor(const Color3B& color)
{
_sprite->setColor(color);
updateColor();
}
const Color3B& ProgressTimer::getColor() const
{
return _sprite->getColor();
}
void ProgressTimer::setOpacity(GLubyte opacity)
{
_sprite->setOpacity(opacity);
updateColor();
}
GLubyte ProgressTimer::getOpacity() const
{
return _sprite->getOpacity();
}
// Interval
///

View File

@ -111,10 +111,6 @@ public:
// Overrides
virtual void draw(void) override;
void setAnchorPoint(const Point& anchorPoint) override;
virtual void setColor(const Color3B& color) override;
virtual const Color3B& getColor() const override;
virtual GLubyte getOpacity() const override;
virtual void setOpacity(GLubyte opacity) override;
protected:
/**
@ -135,7 +131,7 @@ protected:
void updateProgress(void);
void updateBar(void);
void updateRadial(void);
void updateColor(void);
virtual void updateColor(void) override;
Point boundaryTexCoord(char index);
Type _type;

View File

@ -982,20 +982,6 @@ void Sprite::updateColor(void)
// do nothing
}
void Sprite::setOpacity(GLubyte opacity)
{
Node::setOpacity(opacity);
updateColor();
}
void Sprite::setColor(const Color3B& color3)
{
Node::setColor(color3);
updateColor();
}
void Sprite::setOpacityModifyRGB(bool modify)
{
if (_opacityModifyRGB != modify)
@ -1010,20 +996,6 @@ bool Sprite::isOpacityModifyRGB(void) const
return _opacityModifyRGB;
}
void Sprite::updateDisplayedColor(const Color3B& parentColor)
{
Node::updateDisplayedColor(parentColor);
updateColor();
}
void Sprite::updateDisplayedOpacity(GLubyte opacity)
{
Node::updateDisplayedOpacity(opacity);
updateColor();
}
// Frames
void Sprite::setSpriteFrame(const std::string &spriteFrameName)

View File

@ -421,12 +421,8 @@ public:
virtual void ignoreAnchorPointForPosition(bool value) override;
virtual void setVisible(bool bVisible) override;
virtual void draw(void) override;
virtual void setColor(const Color3B& color3) override;
virtual void updateDisplayedColor(const Color3B& parentColor) override;
virtual void setOpacity(GLubyte opacity) override;
virtual void setOpacityModifyRGB(bool modify) override;
virtual bool isOpacityModifyRGB(void) const override;
virtual void updateDisplayedOpacity(GLubyte parentOpacity) override;
/// @}
protected:

View File

@ -252,26 +252,12 @@ void Bone::updateDisplayedColor(const Color3B &parentColor)
{
_realColor = Color3B(255, 255, 255);
Node::updateDisplayedColor(parentColor);
updateColor();
}
void Bone::updateDisplayedOpacity(GLubyte parentOpacity)
{
_realOpacity = 255;
Node::updateDisplayedOpacity(parentOpacity);
updateColor();
}
void Bone::setColor(const Color3B& color)
{
Node::setColor(color);
updateColor();
}
void Bone::setOpacity(GLubyte opacity)
{
Node::setOpacity(opacity);
updateColor();
}
void Bone::updateColor()

View File

@ -133,11 +133,8 @@ public:
void updateDisplayedColor(const cocos2d::Color3B &parentColor) override;
void updateDisplayedOpacity(GLubyte parentOpacity) override;
virtual void setColor(const cocos2d::Color3B& color) override;
virtual void setOpacity(GLubyte opacity) override;
//! Update color to render display
void updateColor();
virtual void updateColor() override;
//! Update zorder
void updateZOrder();