remove unneeded function, and make protocol an abstract class

This commit is contained in:
minggo 2011-12-28 14:46:49 +08:00
parent 2438dba1a8
commit 37915cfed6
9 changed files with 20 additions and 20 deletions

View File

@ -88,8 +88,6 @@ public:
virtual void draw();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
// CC Texture protocol
/** returns the used texture*/

View File

@ -180,8 +180,7 @@ namespace cocos2d{
virtual const char* getString(void);
virtual void setCString(const char *label);
virtual void setAnchorPoint(const CCPoint& var);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual CCLabelProtocol* convertToLabelProtocol() { return (CCLabelProtocol*)this; }
#if CC_LABELBMFONT_DEBUG_DRAW
virtual void draw();
#endif // CC_LABELBMFONT_DEBUG_DRAW

View File

@ -182,7 +182,8 @@ public:
/** BlendFunction. Conforms to CCBlendProtocol protocol */
CC_PROPERTY(ccBlendFunc, m_tBlendFunc, BlendFunc)
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
LAYER_NODE_FUNC(CCLayerColor);
protected:

View File

@ -118,7 +118,8 @@ namespace cocos2d{
*/
virtual void onExit();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
protected:
CCMenuItem* itemForTouch(CCTouch * touch);

View File

@ -124,7 +124,8 @@ namespace cocos2d{
virtual void setColor(const ccColor3B& color);
virtual const ccColor3B& getColor();
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
protected:
ccColor3B m_tColorBackup;
float m_fOriginalScale;
@ -236,7 +237,8 @@ namespace cocos2d{
virtual void unselected();
virtual void setIsEnabled(bool bEnabled);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
};
/** @brief CCMenuItemImage accepts images as items.
@ -308,7 +310,8 @@ namespace cocos2d{
virtual void unselected();
virtual void setIsEnabled(bool var);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol*)this; }
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool getIsOpacityModifyRGB(void) { return false;}
};
}

View File

@ -52,8 +52,8 @@ public:
CCObject(void);
virtual ~CCObject(void);
virtual void release(void);
virtual void retain(void);
void release(void);
void retain(void);
CCObject* autorelease(void);
CCObject* copy(void);
bool isSingleRefrence(void);

View File

@ -63,12 +63,12 @@ public:
Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO
@since v0.8
*/
virtual void setIsOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual void setIsOpacityModifyRGB(bool bValue) = 0;
/** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);
@since v0.8
*/
virtual bool getIsOpacityModifyRGB(void) { return false;}
virtual bool getIsOpacityModifyRGB(void) = 0;
};
/**
@ -101,7 +101,7 @@ public:
virtual CCTexture2D* getTexture(void) = 0;
// sets a new texture. it will be retained
virtual void setTexture(CCTexture2D *texture) {CC_UNUSED_PARAM(texture);}
virtual void setTexture(CCTexture2D *texture) = 0;
};
//! @brief Common interface for Labels

View File

@ -246,8 +246,6 @@ public:
virtual void setIsOpacityModifyRGB(bool bValue);
virtual bool getIsOpacityModifyRGB(void);
virtual CCRGBAProtocol* convertToRGBAProtocol() { return (CCRGBAProtocol *)this; }
// CCTextureProtocol
virtual void setTexture(CCTexture2D *texture);
virtual CCTexture2D* getTexture(void);

View File

@ -82,13 +82,13 @@ public: virtual const varType& get##funName(void);
*/
#define CC_PROPERTY(varType, varName, funName)\
protected: varType varName;\
public: virtual varType get##funName(void);\
public: virtual void set##funName(varType var);
public: varType get##funName(void);\
public: void set##funName(varType var);
#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: virtual const varType& get##funName(void);\
public: virtual void set##funName(const varType& var);
public: const varType& get##funName(void);\
public: void set##funName(const varType& var);
/** CC_SYNTHESIZE_READONLY is used to declare a protected variable.
We can use getter to read the variable.