mirror of https://github.com/axmolengine/axmol.git
standardize code
This commit is contained in:
parent
c767ff355c
commit
b7b079c1c6
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue