fix merge issue

This commit is contained in:
andyque 2015-03-25 22:16:41 +08:00
parent f32b59d565
commit 86c3e60254
1 changed files with 24 additions and 1 deletions

View File

@ -50,7 +50,7 @@ namespace ui {
* Then you could call any methods of Sprite class with the return pointers. * Then you could call any methods of Sprite class with the return pointers.
* *
*/ */
class CC_GUI_DLL Scale9Sprite : public Node class CC_GUI_DLL Scale9Sprite : public Node , public cocos2d::BlendProtocol
{ {
public: public:
/** /**
@ -365,6 +365,25 @@ namespace ui {
* @return True if initializes success, false otherwise. * @return True if initializes success, false otherwise.
*/ */
CC_DEPRECATED(v3) virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets); CC_DEPRECATED(v3) virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets);
/**
* Sets the source blending function.
*
* @param blendFunc A structure with source and destination factor to specify pixel arithmetic,
* e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.
* @js NA
* @lua NA
*/
virtual void setBlendFunc(const BlendFunc &blendFunc) override;
/**
* Returns the blending function that is currently being used.
*
* @return A BlendFunc structure with source and destination factor which specified pixel arithmetic.
* @js NA
* @lua NA
*/
virtual const BlendFunc &getBlendFunc() const override;
/** /**
* Creates and returns a new sprite object with the specified cap insets. * Creates and returns a new sprite object with the specified cap insets.
@ -645,12 +664,15 @@ namespace ui {
virtual float getScaleY() const override; virtual float getScaleY() const override;
virtual float getScale() const override; virtual float getScale() const override;
using Node::getScaleZ; using Node::getScaleZ;
virtual void setCameraMask(unsigned short mask, bool applyChildren = true) override;
protected: protected:
void updateCapInset(); void updateCapInset();
void updatePositions(); void updatePositions();
void createSlicedSprites(); void createSlicedSprites();
void cleanupSlicedSprites(); void cleanupSlicedSprites();
void adjustScale9ImagePosition(); void adjustScale9ImagePosition();
void applyBlendFunc();
void updateBlendFunc(Texture2D *texture);
/** /**
* Sorts the children array once before drawing, instead of every time when a child is added or reordered. * Sorts the children array once before drawing, instead of every time when a child is added or reordered.
* This approach can improves the performance massively. * This approach can improves the performance massively.
@ -676,6 +698,7 @@ namespace ui {
Sprite* _bottomRightSprite; Sprite* _bottomRightSprite;
bool _scale9Enabled; bool _scale9Enabled;
BlendFunc _blendFunc;
Size _topLeftSize; Size _topLeftSize;
Size _centerSize; Size _centerSize;