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)
相關文章
相關標籤/搜索