standardize code

This commit is contained in:
2youyou2 2013-09-16 12:02:57 +08:00
parent c767ff355c
commit b7b079c1c6
8 changed files with 20 additions and 20 deletions

View File

@ -142,13 +142,13 @@ bool Armature::init(const char *name)
_name = name; _name = name;
AnimationData *animationData = armatureDataManager->getAnimationData(name); AnimationData *animationData = armatureDataManager->getAnimationData(name);
CCAssert(animationData, "AnimationData not exist! "); CCASSERT(animationData, "AnimationData not exist! ");
_animation->setAnimationData(animationData); _animation->setAnimationData(animationData);
ArmatureData *armatureData = armatureDataManager->getArmatureData(name); ArmatureData *armatureData = armatureDataManager->getArmatureData(name);
CCAssert(armatureData, ""); CCASSERT(armatureData, "");
_armatureData = armatureData; _armatureData = armatureData;
@ -197,7 +197,7 @@ bool Armature::init(const char *name)
} }
setShaderProgram(CCShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
unscheduleUpdate(); unscheduleUpdate();
scheduleUpdate(); scheduleUpdate();
@ -251,8 +251,8 @@ Bone *Armature::createBone(const char *boneName)
void Armature::addBone(Bone *bone, const char *parentName) void Armature::addBone(Bone *bone, const char *parentName)
{ {
CCAssert( bone != NULL, "Argument must be non-nil"); CCASSERT( bone != NULL, "Argument must be non-nil");
CCAssert(_boneDic->objectForKey(bone->getName()) == NULL, "bone already added. It can't be added again"); CCASSERT(_boneDic->objectForKey(bone->getName()) == NULL, "bone already added. It can't be added again");
if (NULL != parentName) if (NULL != parentName)
{ {
@ -286,7 +286,7 @@ void Armature::addBone(Bone *bone, const char *parentName)
void Armature::removeBone(Bone *bone, bool recursion) void Armature::removeBone(Bone *bone, bool recursion)
{ {
CCAssert(bone != NULL, "bone must be added to the bone dictionary!"); CCASSERT(bone != NULL, "bone must be added to the bone dictionary!");
bone->setArmature(NULL); bone->setArmature(NULL);
bone->removeFromParent(recursion); bone->removeFromParent(recursion);
@ -308,7 +308,7 @@ Bone *Armature::getBone(const char *name) const
void Armature::changeBoneParent(Bone *bone, const char *parentName) void Armature::changeBoneParent(Bone *bone, const char *parentName)
{ {
CCAssert(bone != NULL, "bone must be added to the bone dictionary!"); CCASSERT(bone != NULL, "bone must be added to the bone dictionary!");
if(bone->getParentBone()) if(bone->getParentBone())
{ {
@ -423,7 +423,7 @@ const AffineTransform& Armature::getNodeToParentTransform() const
void Armature::updateOffsetPoint() void Armature::updateOffsetPoint()
{ {
// Set contentsize and Calculate anchor point. // Set contentsize and Calculate anchor point.
Rect rect = boundingBox(); Rect rect = getBoundingBox();
setContentSize(rect.size); setContentSize(rect.size);
_offsetPoint = Point(-rect.origin.x, -rect.origin.y); _offsetPoint = Point(-rect.origin.x, -rect.origin.y);
if (rect.size.width != 0 && rect.size.height != 0) if (rect.size.width != 0 && rect.size.height != 0)

View File

@ -129,7 +129,7 @@ bool Bone::init(const char *name)
void Bone::setBoneData(BoneData *boneData) void Bone::setBoneData(BoneData *boneData)
{ {
CCAssert(NULL != boneData, "_boneData must not be NULL"); CCASSERT(NULL != boneData, "_boneData must not be NULL");
m_pBoneData = boneData; m_pBoneData = boneData;
m_pBoneData->retain(); m_pBoneData->retain();
@ -237,8 +237,8 @@ void Bone::updateZOrder()
void Bone::addChildBone(Bone *child) void Bone::addChildBone(Bone *child)
{ {
CCAssert( NULL != child, "Argument must be non-nil"); CCASSERT( NULL != child, "Argument must be non-nil");
CCAssert( NULL == child->_parentBone, "child already added. It can't be added again"); CCASSERT( NULL == child->_parentBone, "child already added. It can't be added again");
if(!_children) if(!_children)
{ {

View File

@ -185,10 +185,10 @@ void ArmatureAnimation::setAnimationInternal(float animationInternal)
void ArmatureAnimation::play(const char *animationName, int durationTo, int durationTween, int loop, int tweenEasing) void ArmatureAnimation::play(const char *animationName, int durationTo, int durationTween, int loop, int tweenEasing)
{ {
CCAssert(_animationData, "_animationData can not be null"); CCASSERT(_animationData, "_animationData can not be null");
_movementData = _animationData->getMovement(animationName); _movementData = _animationData->getMovement(animationName);
CCAssert(_movementData, "_movementData can not be null"); CCASSERT(_movementData, "_movementData can not be null");
//! Get key frame count //! Get key frame count
_rawDuration = _movementData->duration; _rawDuration = _movementData->duration;

View File

@ -48,7 +48,7 @@ BatchNode::BatchNode()
bool BatchNode::init() bool BatchNode::init()
{ {
bool ret = Node::init(); bool ret = Node::init();
setShaderProgram(CCShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
return ret; return ret;
} }

View File

@ -184,7 +184,7 @@ Array *DisplayManager::getDecorativeDisplayList()
void DisplayManager::changeDisplayByIndex(int index, bool force) void DisplayManager::changeDisplayByIndex(int index, bool force)
{ {
CCAssert( (_decoDisplayList ? index < (int)_decoDisplayList->count() : true), "the _index value is out of range"); CCASSERT( (_decoDisplayList ? index < (int)_decoDisplayList->count() : true), "the _index value is out of range");
_forceChangeDisplay = force; _forceChangeDisplay = force;

View File

@ -109,7 +109,7 @@ ColliderDetector::~ColliderDetector()
bool ColliderDetector::init() bool ColliderDetector::init()
{ {
_colliderBodyList = Array::create(); _colliderBodyList = Array::create();
CCAssert(_colliderBodyList, "create _colliderBodyList failed!"); CCASSERT(_colliderBodyList, "create _colliderBodyList failed!");
_colliderBodyList->retain(); _colliderBodyList->retain();
return true; return true;

View File

@ -78,15 +78,15 @@ bool ArmatureDataManager::init()
do do
{ {
_armarureDatas = Dictionary::create(); _armarureDatas = Dictionary::create();
CCAssert(_armarureDatas, "create ArmatureDataManager::_armarureDatas fail!"); CCASSERT(_armarureDatas, "create ArmatureDataManager::_armarureDatas fail!");
_armarureDatas->retain(); _armarureDatas->retain();
_animationDatas = Dictionary::create(); _animationDatas = Dictionary::create();
CCAssert(_animationDatas, "create ArmatureDataManager::_animationDatas fail!"); CCASSERT(_animationDatas, "create ArmatureDataManager::_animationDatas fail!");
_animationDatas->retain(); _animationDatas->retain();
_textureDatas = Dictionary::create(); _textureDatas = Dictionary::create();
CCAssert(_textureDatas, "create ArmatureDataManager::_textureDatas fail!"); CCASSERT(_textureDatas, "create ArmatureDataManager::_textureDatas fail!");
_textureDatas->retain(); _textureDatas->retain();
bRet = true; bRet = true;

View File

@ -467,7 +467,7 @@ void DataReaderHelper::addDataFromCache(const char *pFileContent, DataInfo *data
document.Parse(pFileContent); document.Parse(pFileContent);
tinyxml2::XMLElement *root = document.RootElement(); tinyxml2::XMLElement *root = document.RootElement();
CCAssert(root, "XML error or XML is empty."); CCASSERT(root, "XML error or XML is empty.");
root->QueryFloatAttribute(VERSION, &s_FlashToolVersion); root->QueryFloatAttribute(VERSION, &s_FlashToolVersion);