Cocos2d-x中常用宏的作用

1.

CC_SYNTHESIZE(int, nTest, Test);

 相当于:

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

 2.

CC_SAFE_DELETE(p);//安全删除

 相当于:

do { if(p) { delete (p); (p) = 0; } } while(0)

 

posted @ 2013-11-11 14:33  快乐在编  阅读(192)  评论(0编辑  收藏  举报