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)