From b7b079c1c61a4fcf4b25a52bce080199009b6e3e Mon Sep 17 00:00:00 2001 From: 2youyou2 <501251991@qq.com> Date: Mon, 16 Sep 2013 12:02:57 +0800 Subject: [PATCH] standardize code --- extensions/CocoStudio/Armature/CCArmature.cpp | 16 ++++++++-------- extensions/CocoStudio/Armature/CCBone.cpp | 6 +++--- .../Armature/animation/CCArmatureAnimation.cpp | 4 ++-- .../CocoStudio/Armature/display/CCBatchNode.cpp | 2 +- .../Armature/display/CCDisplayManager.cpp | 2 +- .../Armature/physics/CCColliderDetector.cpp | 2 +- .../Armature/utils/CCArmatureDataManager.cpp | 6 +++--- .../Armature/utils/CCDataReaderHelper.cpp | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/extensions/CocoStudio/Armature/CCArmature.cpp b/extensions/CocoStudio/Armature/CCArmature.cpp index 6bcfcf0f5c..f42630464f 100644 --- a/extensions/CocoStudio/Armature/CCArmature.cpp +++ b/extensions/CocoStudio/Armature/CCArmature.cpp @@ -142,13 +142,13 @@ bool Armature::init(const char *name) _name = name; AnimationData *animationData = armatureDataManager->getAnimationData(name); - CCAssert(animationData, "AnimationData not exist! "); + CCASSERT(animationData, "AnimationData not exist! "); _animation->setAnimationData(animationData); ArmatureData *armatureData = armatureDataManager->getArmatureData(name); - CCAssert(armatureData, ""); + CCASSERT(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(); scheduleUpdate(); @@ -251,8 +251,8 @@ Bone *Armature::createBone(const char *boneName) void Armature::addBone(Bone *bone, const char *parentName) { - CCAssert( bone != NULL, "Argument must be non-nil"); - CCAssert(_boneDic->objectForKey(bone->getName()) == NULL, "bone already added. It can't be added again"); + CCASSERT( bone != NULL, "Argument must be non-nil"); + CCASSERT(_boneDic->objectForKey(bone->getName()) == NULL, "bone already added. It can't be added again"); if (NULL != parentName) { @@ -286,7 +286,7 @@ void Armature::addBone(Bone *bone, const char *parentName) 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->removeFromParent(recursion); @@ -308,7 +308,7 @@ Bone *Armature::getBone(const char *name) const 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()) { @@ -423,7 +423,7 @@ const AffineTransform& Armature::getNodeToParentTransform() const void Armature::updateOffsetPoint() { // Set contentsize and Calculate anchor point. - Rect rect = boundingBox(); + Rect rect = getBoundingBox(); setContentSize(rect.size); _offsetPoint = Point(-rect.origin.x, -rect.origin.y); if (rect.size.width != 0 && rect.size.height != 0) diff --git a/extensions/CocoStudio/Armature/CCBone.cpp b/extensions/CocoStudio/Armature/CCBone.cpp index d15c7d8e6a..22efd6e3d8 100644 --- a/extensions/CocoStudio/Armature/CCBone.cpp +++ b/extensions/CocoStudio/Armature/CCBone.cpp @@ -129,7 +129,7 @@ bool Bone::init(const char *name) 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->retain(); @@ -237,8 +237,8 @@ void Bone::updateZOrder() void Bone::addChildBone(Bone *child) { - CCAssert( NULL != child, "Argument must be non-nil"); - CCAssert( NULL == child->_parentBone, "child already added. It can't be added again"); + CCASSERT( NULL != child, "Argument must be non-nil"); + CCASSERT( NULL == child->_parentBone, "child already added. It can't be added again"); if(!_children) { diff --git a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp index 96543635a6..82ffd42501 100644 --- a/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp +++ b/extensions/CocoStudio/Armature/animation/CCArmatureAnimation.cpp @@ -185,10 +185,10 @@ void ArmatureAnimation::setAnimationInternal(float animationInternal) 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); - CCAssert(_movementData, "_movementData can not be null"); + CCASSERT(_movementData, "_movementData can not be null"); //! Get key frame count _rawDuration = _movementData->duration; diff --git a/extensions/CocoStudio/Armature/display/CCBatchNode.cpp b/extensions/CocoStudio/Armature/display/CCBatchNode.cpp index c52823e407..299d38a842 100644 --- a/extensions/CocoStudio/Armature/display/CCBatchNode.cpp +++ b/extensions/CocoStudio/Armature/display/CCBatchNode.cpp @@ -48,7 +48,7 @@ BatchNode::BatchNode() bool BatchNode::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; } diff --git a/extensions/CocoStudio/Armature/display/CCDisplayManager.cpp b/extensions/CocoStudio/Armature/display/CCDisplayManager.cpp index 8b3bd2b837..01103f392d 100644 --- a/extensions/CocoStudio/Armature/display/CCDisplayManager.cpp +++ b/extensions/CocoStudio/Armature/display/CCDisplayManager.cpp @@ -184,7 +184,7 @@ Array *DisplayManager::getDecorativeDisplayList() 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; diff --git a/extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp b/extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp index cabdffc318..941b7d59c5 100644 --- a/extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp +++ b/extensions/CocoStudio/Armature/physics/CCColliderDetector.cpp @@ -109,7 +109,7 @@ ColliderDetector::~ColliderDetector() bool ColliderDetector::init() { _colliderBodyList = Array::create(); - CCAssert(_colliderBodyList, "create _colliderBodyList failed!"); + CCASSERT(_colliderBodyList, "create _colliderBodyList failed!"); _colliderBodyList->retain(); return true; diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp index acded20944..4bdd9ca9e6 100644 --- a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp +++ b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp @@ -78,15 +78,15 @@ bool ArmatureDataManager::init() do { _armarureDatas = Dictionary::create(); - CCAssert(_armarureDatas, "create ArmatureDataManager::_armarureDatas fail!"); + CCASSERT(_armarureDatas, "create ArmatureDataManager::_armarureDatas fail!"); _armarureDatas->retain(); _animationDatas = Dictionary::create(); - CCAssert(_animationDatas, "create ArmatureDataManager::_animationDatas fail!"); + CCASSERT(_animationDatas, "create ArmatureDataManager::_animationDatas fail!"); _animationDatas->retain(); _textureDatas = Dictionary::create(); - CCAssert(_textureDatas, "create ArmatureDataManager::_textureDatas fail!"); + CCASSERT(_textureDatas, "create ArmatureDataManager::_textureDatas fail!"); _textureDatas->retain(); bRet = true; diff --git a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp index 89ae47ad8e..7bc1c7f55f 100644 --- a/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp +++ b/extensions/CocoStudio/Armature/utils/CCDataReaderHelper.cpp @@ -467,7 +467,7 @@ void DataReaderHelper::addDataFromCache(const char *pFileContent, DataInfo *data document.Parse(pFileContent); 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);