mirror of https://github.com/axmolengine/axmol.git
issue #2378: Reverting CCPlatformMacros.h
This commit is contained in:
parent
4110b95e96
commit
a6b880a124
|
@ -109,92 +109,92 @@ It's new in cocos2d-x since v0.99.5
|
|||
#define USING_NS_CC
|
||||
#endif
|
||||
|
||||
///** CC_PROPERTY_READONLY is used to declare a protected variable.
|
||||
// We can use getter to read the variable.
|
||||
// @param varType : the type of variable.
|
||||
// @param varName : variable name.
|
||||
// @param funName : "get + funName" is the name of the getter.
|
||||
// @warning : The getter is a public virtual function, you should rewrite it first.
|
||||
// The variables and methods declared after CC_PROPERTY_READONLY are all public.
|
||||
// If you need protected or private, please declare.
|
||||
// */
|
||||
//#define CC_PROPERTY_READONLY(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual varType get##funName(void) const;
|
||||
//
|
||||
//#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual const varType& get##funName(void) const;
|
||||
//
|
||||
///** CC_PROPERTY is used to declare a protected variable.
|
||||
// We can use getter to read the variable, and use the setter to change the variable.
|
||||
// @param varType : the type of variable.
|
||||
// @param varName : variable name.
|
||||
// @param funName : "get + funName" is the name of the getter.
|
||||
// "set + funName" is the name of the setter.
|
||||
// @warning : The getter and setter are public virtual functions, you should rewrite them first.
|
||||
// The variables and methods declared after CC_PROPERTY are all public.
|
||||
// If you need protected or private, please declare.
|
||||
// */
|
||||
//#define CC_PROPERTY(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual varType get##funName(void);\
|
||||
//public: virtual void set##funName(varType var);
|
||||
//
|
||||
//#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual const varType& get##funName(void) const;\
|
||||
//public: virtual void set##funName(const varType& var);
|
||||
//
|
||||
///** CC_SYNTHESIZE_READONLY is used to declare a protected variable.
|
||||
// We can use getter to read the variable.
|
||||
// @param varType : the type of variable.
|
||||
// @param varName : variable name.
|
||||
// @param funName : "get + funName" is the name of the getter.
|
||||
// @warning : The getter is a public inline function.
|
||||
// The variables and methods declared after CC_SYNTHESIZE_READONLY are all public.
|
||||
// If you need protected or private, please declare.
|
||||
// */
|
||||
//#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual varType get##funName(void) const { return varName; }
|
||||
//
|
||||
//#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual const varType& get##funName(void) const { return varName; }
|
||||
//
|
||||
///** CC_SYNTHESIZE is used to declare a protected variable.
|
||||
// We can use getter to read the variable, and use the setter to change the variable.
|
||||
// @param varType : the type of variable.
|
||||
// @param varName : variable name.
|
||||
// @param funName : "get + funName" is the name of the getter.
|
||||
// "set + funName" is the name of the setter.
|
||||
// @warning : The getter and setter are public inline functions.
|
||||
// The variables and methods declared after CC_SYNTHESIZE are all public.
|
||||
// If you need protected or private, please declare.
|
||||
// */
|
||||
//#define CC_SYNTHESIZE(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual varType get##funName(void) const { return varName; }\
|
||||
//public: virtual void set##funName(varType var){ varName = var; }
|
||||
//
|
||||
//#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\
|
||||
//protected: varType varName;\
|
||||
//public: virtual const varType& get##funName(void) const { return varName; }\
|
||||
//public: virtual void set##funName(const varType& var){ varName = var; }
|
||||
//
|
||||
//#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \
|
||||
//private: varType varName; \
|
||||
//public: virtual varType get##funName(void) const { return varName; } \
|
||||
//public: virtual void set##funName(varType var) \
|
||||
//{ \
|
||||
// if (varName != var) \
|
||||
// { \
|
||||
// CC_SAFE_RETAIN(var); \
|
||||
// CC_SAFE_RELEASE(varName); \
|
||||
// varName = var; \
|
||||
// } \
|
||||
//}
|
||||
/** CC_PROPERTY_READONLY is used to declare a protected variable.
|
||||
We can use getter to read the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
@warning : The getter is a public virtual function, you should rewrite it first.
|
||||
The variables and methods declared after CC_PROPERTY_READONLY are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_PROPERTY_READONLY(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual varType get##funName(void) const;
|
||||
|
||||
#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual const varType& get##funName(void) const;
|
||||
|
||||
/** CC_PROPERTY is used to declare a protected variable.
|
||||
We can use getter to read the variable, and use the setter to change the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
"set + funName" is the name of the setter.
|
||||
@warning : The getter and setter are public virtual functions, you should rewrite them first.
|
||||
The variables and methods declared after CC_PROPERTY are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_PROPERTY(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual varType get##funName(void);\
|
||||
public: virtual void set##funName(varType var);
|
||||
|
||||
#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual const varType& get##funName(void) const;\
|
||||
public: virtual void set##funName(const varType& var);
|
||||
|
||||
/** CC_SYNTHESIZE_READONLY is used to declare a protected variable.
|
||||
We can use getter to read the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
@warning : The getter is a public inline function.
|
||||
The variables and methods declared after CC_SYNTHESIZE_READONLY are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual varType get##funName(void) const { return varName; }
|
||||
|
||||
#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual const varType& get##funName(void) const { return varName; }
|
||||
|
||||
/** CC_SYNTHESIZE is used to declare a protected variable.
|
||||
We can use getter to read the variable, and use the setter to change the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
"set + funName" is the name of the setter.
|
||||
@warning : The getter and setter are public inline functions.
|
||||
The variables and methods declared after CC_SYNTHESIZE are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_SYNTHESIZE(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual varType get##funName(void) const { return varName; }\
|
||||
public: virtual void set##funName(varType var){ varName = var; }
|
||||
|
||||
#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual const varType& get##funName(void) const { return varName; }\
|
||||
public: virtual void set##funName(const varType& var){ varName = var; }
|
||||
|
||||
#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \
|
||||
private: varType varName; \
|
||||
public: virtual varType get##funName(void) const { return varName; } \
|
||||
public: virtual void set##funName(varType var) \
|
||||
{ \
|
||||
if (varName != var) \
|
||||
{ \
|
||||
CC_SAFE_RETAIN(var); \
|
||||
CC_SAFE_RELEASE(varName); \
|
||||
varName = var; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CC_SAFE_DELETE(p) do { if(p) { delete (p); (p) = 0; } } while(0)
|
||||
#define CC_SAFE_DELETE_ARRAY(p) do { if(p) { delete[] (p); (p) = 0; } } while(0)
|
||||
|
|
Loading…
Reference in New Issue