Cocos2d-x中经常使用宏的做用

1.安全

CC_SYNTHESIZE(int, nTest, Test);

 至关于:blog

protected: int nTest; 
public: virtual nTest getTest(void) const { return nTest; } 
public: virtual void setTest(int var){ nTest = var; } 

 2.get

CC_SAFE_DELETE(p);//安全删除

 至关于:class

do { if(p) { delete (p); (p) = 0; } } while(0)
相关文章
相关标签/搜索