|
cocos2d-x
2.1.1
|
Macros | |
| #define | CREATE_FUNC(__TYPE__) |
| define some platform specific macros | |
| #define | NODE_FUNC(__TYPE__) |
| define a node function for a specific type, such as CCLayer class type to add node(), such as CCLayer | |
| #define | CC_ENABLE_CACHE_TEXTURE_DATA 0 |
| Enable it if you want to cache the texture data. | |
| #define | CC_REBIND_INDICES_BUFFER 0 |
| #define | NS_CC_BEGIN |
| #define | NS_CC_END |
| #define | USING_NS_CC |
| #define | CC_PROPERTY_READONLY(varType, varName, funName) |
| CC_PROPERTY_READONLY is used to declare a protected variable. | |
| #define | CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName) |
| #define | CC_PROPERTY(varType, varName, funName) |
| CC_PROPERTY is used to declare a protected variable. | |
| #define | CC_PROPERTY_PASS_BY_REF(varType, varName, funName) |
| #define | CC_SYNTHESIZE_READONLY(varType, varName, funName) |
| CC_SYNTHESIZE_READONLY is used to declare a protected variable. | |
| #define | CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName) |
| #define | CC_SYNTHESIZE(varType, varName, funName) |
| CC_SYNTHESIZE is used to declare a protected variable. | |
| #define | CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName) |
| #define | CC_SYNTHESIZE_RETAIN(varType, varName, funName) |
| #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) |
| #define | CC_SAFE_FREE(p) do { if(p) { free(p); (p) = 0; } } while(0) |
| #define | CC_SAFE_RELEASE(p) do { if(p) { (p)->release(); } } while(0) |
| #define | CC_SAFE_RELEASE_NULL(p) do { if(p) { (p)->release(); (p) = 0; } } while(0) |
| #define | CC_SAFE_RETAIN(p) do { if(p) { (p)->retain(); } } while(0) |
| #define | CC_BREAK_IF(cond) if(cond) break |
| #define | __CCLOGWITHFUNCTION(s,...) CCLog("%s : %s",__FUNCTION__, CCString::createWithFormat(s, ##__VA_ARGS__)->getCString()) |
| #define | CCLOG(...) do {} while (0) |
| #define | CCLOGINFO(...) do {} while (0) |
| #define | CCLOGERROR(...) do {} while (0) |
| #define | CCLOGWARN(...) do {} while (0) |
| #define | LUALOG(...) |
| #define | CC_DEPRECATED_ATTRIBUTE |
Macro Definition Documentation
| #define __CCLOGWITHFUNCTION | ( | s, | |
| ... | |||
| ) | CCLog("%s : %s",__FUNCTION__, CCString::createWithFormat(s, ##__VA_ARGS__)->getCString()) |
| #define CC_BREAK_IF | ( | cond | ) | if(cond) break |
| #define CC_DEPRECATED_ATTRIBUTE |
| #define CC_ENABLE_CACHE_TEXTURE_DATA 0 |
Enable it if you want to cache the texture data.
Basically,it's only enabled in android
It's new in cocos2d-x since v0.99.5
| #define CC_PROPERTY | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
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.
- Parameters
-
varType : the type of variable. varName : variable name. 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_PASS_BY_REF | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
| #define CC_PROPERTY_READONLY | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
CC_PROPERTY_READONLY is used to declare a protected variable.
We can use getter to read the variable.
- Parameters
-
varType : the type of variable. varName : variable name. 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_PASS_BY_REF | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
| #define CC_REBIND_INDICES_BUFFER 0 |
| #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) |
| #define CC_SAFE_FREE | ( | p | ) | do { if(p) { free(p); (p) = 0; } } while(0) |
| #define CC_SAFE_RELEASE | ( | p | ) | do { if(p) { (p)->release(); } } while(0) |
| #define CC_SAFE_RELEASE_NULL | ( | p | ) | do { if(p) { (p)->release(); (p) = 0; } } while(0) |
| #define CC_SAFE_RETAIN | ( | p | ) | do { if(p) { (p)->retain(); } } while(0) |
| #define CC_SYNTHESIZE | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
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.
- Parameters
-
varType : the type of variable. varName : variable name. 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_PASS_BY_REF | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
| #define CC_SYNTHESIZE_READONLY | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
CC_SYNTHESIZE_READONLY is used to declare a protected variable.
We can use getter to read the variable.
- Parameters
-
varType : the type of variable. varName : variable name. 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_PASS_BY_REF | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
| #define CC_SYNTHESIZE_RETAIN | ( | varType, | |
| varName, | |||
| funName | |||
| ) |
| #define CCLOG | ( | ... | ) | do {} while (0) |
| #define CCLOGERROR | ( | ... | ) | do {} while (0) |
| #define CCLOGINFO | ( | ... | ) | do {} while (0) |
| #define CCLOGWARN | ( | ... | ) | do {} while (0) |
| #define CREATE_FUNC | ( | __TYPE__ | ) |
define some platform specific macros
define a create function for a specific type, such as CCLayer class type to add create(), such as CCLayer
| #define LUALOG | ( | ... | ) |
| #define NODE_FUNC | ( | __TYPE__ | ) |
define a node function for a specific type, such as CCLayer class type to add node(), such as CCLayer
- Deprecated:
- : This interface will be deprecated sooner or later.
| #define NS_CC_BEGIN |
| #define NS_CC_END |
| #define USING_NS_CC |

