1. fixes failed to build linux.

This commit is contained in:
zhangcheng 2013-09-18 11:51:14 +08:00
parent 529d43544f
commit 820b8630dc
4 changed files with 29 additions and 29 deletions

View File

@ -84,7 +84,7 @@ ActionObject* ActionManagerEx::getActionByName(const char* jsonName,const char*
} }
for (unsigned int i=0; i<actionList->count(); i++) for (unsigned int i=0; i<actionList->count(); i++)
{ {
ActionObject* action = dynamic_cast<ActionObject*>(actionList->objectAtIndex(i)); ActionObject* action = dynamic_cast<ActionObject*>(actionList->getObjectAtIndex(i));
if (strcmp(actionName, action->getName()) == 0) if (strcmp(actionName, action->getName()) == 0)
{ {
return action; return action;

View File

@ -87,8 +87,8 @@ void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root)
float positionY = DICTOOL->getFloatValue_json(actionFrameDic, "positiony"); float positionY = DICTOOL->getFloatValue_json(actionFrameDic, "positiony");
ActionMoveFrame* actionFrame = new ActionMoveFrame(); ActionMoveFrame* actionFrame = new ActionMoveFrame();
actionFrame->setFrameIndex(frameInex); actionFrame->setFrameIndex(frameInex);
actionFrame->setPosition(CCPointMake(positionX, positionY)); actionFrame->setPosition(Point(positionX, positionY));
Array* cActionArray = (Array*)_frameArray->objectAtIndex((int)kKeyframeMove); Array* cActionArray = (Array*)_frameArray->getObjectAtIndex((int)kKeyframeMove);
cActionArray->addObject(actionFrame); cActionArray->addObject(actionFrame);
} }
@ -101,7 +101,7 @@ void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root)
actionFrame->setFrameIndex(frameInex); actionFrame->setFrameIndex(frameInex);
actionFrame->setScaleX(scaleX); actionFrame->setScaleX(scaleX);
actionFrame->setScaleY(scaleY); actionFrame->setScaleY(scaleY);
Array* cActionArray = (Array*)_frameArray->objectAtIndex((int)kKeyframeScale); Array* cActionArray = (Array*)_frameArray->getObjectAtIndex((int)kKeyframeScale);
cActionArray->addObject(actionFrame); cActionArray->addObject(actionFrame);
} }
@ -112,7 +112,7 @@ void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root)
ActionRotationFrame* actionFrame = new ActionRotationFrame(); ActionRotationFrame* actionFrame = new ActionRotationFrame();
actionFrame->setFrameIndex(frameInex); actionFrame->setFrameIndex(frameInex);
actionFrame->setRotation(rotation); actionFrame->setRotation(rotation);
Array* cActionArray = (Array*)_frameArray->objectAtIndex((int)kKeyframeRotate); Array* cActionArray = (Array*)_frameArray->getObjectAtIndex((int)kKeyframeRotate);
cActionArray->addObject(actionFrame); cActionArray->addObject(actionFrame);
} }
@ -123,7 +123,7 @@ void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root)
ActionFadeFrame* actionFrame = new ActionFadeFrame(); ActionFadeFrame* actionFrame = new ActionFadeFrame();
actionFrame->setFrameIndex(frameInex); actionFrame->setFrameIndex(frameInex);
actionFrame->setOpacity(opacity); actionFrame->setOpacity(opacity);
Array* cActionArray = (Array*)_frameArray->objectAtIndex((int)kKeyframeFade); Array* cActionArray = (Array*)_frameArray->getObjectAtIndex((int)kKeyframeFade);
cActionArray->addObject(actionFrame); cActionArray->addObject(actionFrame);
} }
@ -135,8 +135,8 @@ void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root)
int colorB = DICTOOL->getIntValue_json(actionFrameDic, "colorb"); int colorB = DICTOOL->getIntValue_json(actionFrameDic, "colorb");
ActionTintFrame* actionFrame = new ActionTintFrame(); ActionTintFrame* actionFrame = new ActionTintFrame();
actionFrame->setFrameIndex(frameInex); actionFrame->setFrameIndex(frameInex);
actionFrame->setColor(ccc3(colorR,colorG,colorB)); actionFrame->setColor(Color3B(colorR,colorG,colorB));
Array* cActionArray = (Array*)_frameArray->objectAtIndex((int)kKeyframeTint); Array* cActionArray = (Array*)_frameArray->getObjectAtIndex((int)kKeyframeTint);
cActionArray->addObject(actionFrame); cActionArray->addObject(actionFrame);
} }
@ -150,7 +150,7 @@ void ActionNode::initActionNodeFromRoot(Object* root)
Node* rootNode = dynamic_cast<Node*>(root); Node* rootNode = dynamic_cast<Node*>(root);
if (rootNode != NULL) if (rootNode != NULL)
{ {
CCLog("Need a definition of <initActionNodeFromRoot> for gameObject"); log("Need a definition of <initActionNodeFromRoot> for gameObject");
} }
else else
{ {
@ -222,7 +222,7 @@ void ActionNode::insertFrame(int index, ActionFrame* frame)
return; return;
} }
int frameType = frame->getFrameType(); int frameType = frame->getFrameType();
Array* cArray = (Array*)_frameArray->objectAtIndex(frameType); Array* cArray = (Array*)_frameArray->getObjectAtIndex(frameType);
if (cArray == NULL) if (cArray == NULL)
{ {
return; return;
@ -237,7 +237,7 @@ void ActionNode::addFrame(ActionFrame* frame)
return; return;
} }
int frameType = frame->getFrameType(); int frameType = frame->getFrameType();
Array* cArray = (Array*)_frameArray->objectAtIndex(frameType); Array* cArray = (Array*)_frameArray->getObjectAtIndex(frameType);
if (cArray == NULL) if (cArray == NULL)
{ {
return; return;
@ -252,7 +252,7 @@ void ActionNode::deleteFrame(ActionFrame* frame)
return; return;
} }
int frameType = frame->getFrameType(); int frameType = frame->getFrameType();
Array* cArray = (Array*)_frameArray->objectAtIndex(frameType); Array* cArray = (Array*)_frameArray->getObjectAtIndex(frameType);
if (cArray == NULL) if (cArray == NULL)
{ {
return; return;
@ -277,7 +277,7 @@ Spawn * ActionNode::refreshActionProperty()
Array* cSpawnArray = Array::create(); Array* cSpawnArray = Array::create();
for (int n = 0; n < _frameArrayNum; n++) for (int n = 0; n < _frameArrayNum; n++)
{ {
Array* cArray = (Array*)(_frameArray->objectAtIndex(n)); Array* cArray = (Array*)(_frameArray->getObjectAtIndex(n));
if (cArray == NULL || cArray->count() <= 0) if (cArray == NULL || cArray->count() <= 0)
{ {
continue; continue;
@ -287,13 +287,13 @@ Spawn * ActionNode::refreshActionProperty()
int frameCount = cArray->count(); int frameCount = cArray->count();
for (int i = 0; i < frameCount; i++) for (int i = 0; i < frameCount; i++)
{ {
ActionFrame* frame = (ActionFrame*)(cArray->objectAtIndex(i)); ActionFrame* frame = (ActionFrame*)(cArray->getObjectAtIndex(i));
if (i == 0) if (i == 0)
{ {
} }
else else
{ {
ActionFrame* srcFrame = (ActionFrame*)(cArray->objectAtIndex(i-1)); ActionFrame* srcFrame = (ActionFrame*)(cArray->getObjectAtIndex(i-1));
float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex()) * getUnitTime(); float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex()) * getUnitTime();
Action* cAction = frame->getAction(duration); Action* cAction = frame->getAction(duration);
cSequenceArray->addObject(cAction); cSequenceArray->addObject(cAction);
@ -333,7 +333,7 @@ void ActionNode::playAction(bool bloop)
} }
else else
{ {
_action = Sequence::create(_actionSpawn); _action = Sequence::create(_actionSpawn, NULL);
} }
_action->retain(); _action->retain();
@ -364,13 +364,13 @@ int ActionNode::getFirstFrameIndex()
int frameindex = 99999; int frameindex = 99999;
for (int n = 0; n < _frameArrayNum; n++) for (int n = 0; n < _frameArrayNum; n++)
{ {
Array* cArray = (Array*)(_frameArray->objectAtIndex(n)); Array* cArray = (Array*)(_frameArray->getObjectAtIndex(n));
if (cArray == NULL || cArray->count() <= 0) if (cArray == NULL || cArray->count() <= 0)
{ {
continue; continue;
} }
ActionFrame* frame = (ActionFrame*)(cArray->objectAtIndex(0)); ActionFrame* frame = (ActionFrame*)(cArray->getObjectAtIndex(0));
int iFrameIndex = frame->getFrameIndex(); int iFrameIndex = frame->getFrameIndex();
if (frameindex > iFrameIndex) if (frameindex > iFrameIndex)
@ -387,13 +387,13 @@ int ActionNode::getLastFrameIndex()
int frameindex = -1; int frameindex = -1;
for (int n = 0; n < _frameArrayNum; n++) for (int n = 0; n < _frameArrayNum; n++)
{ {
Array* cArray = (Array*)(_frameArray->objectAtIndex(n)); Array* cArray = (Array*)(_frameArray->getObjectAtIndex(n));
if (cArray == NULL || cArray->count() <= 0) if (cArray == NULL || cArray->count() <= 0)
{ {
continue; continue;
} }
int lastInex = cArray->count() - 1; int lastInex = cArray->count() - 1;
ActionFrame* frame = (ActionFrame*)(cArray->objectAtIndex(lastInex)); ActionFrame* frame = (ActionFrame*)(cArray->getObjectAtIndex(lastInex));
int iFrameIndex = frame->getFrameIndex(); int iFrameIndex = frame->getFrameIndex();
if (frameindex < iFrameIndex) if (frameindex < iFrameIndex)
@ -413,7 +413,7 @@ bool ActionNode::updateActionToTimeLine(float fTime)
for (int n = 0; n < _frameArrayNum; n++) for (int n = 0; n < _frameArrayNum; n++)
{ {
Array* cArray = (Array*)(_frameArray->objectAtIndex(n)); Array* cArray = (Array*)(_frameArray->getObjectAtIndex(n));
if (cArray == NULL) if (cArray == NULL)
{ {
continue; continue;
@ -421,7 +421,7 @@ bool ActionNode::updateActionToTimeLine(float fTime)
int frameCount = cArray->count(); int frameCount = cArray->count();
for (int i = 0; i < frameCount; i++) for (int i = 0; i < frameCount; i++)
{ {
ActionFrame* frame = (ActionFrame*)(cArray->objectAtIndex(i)); ActionFrame* frame = (ActionFrame*)(cArray->getObjectAtIndex(i));
if (frame->getFrameIndex()*getUnitTime() == fTime) if (frame->getFrameIndex()*getUnitTime() == fTime)
{ {
@ -438,7 +438,7 @@ bool ActionNode::updateActionToTimeLine(float fTime)
} }
else else
{ {
srcFrame = (ActionFrame*)(cArray->objectAtIndex(i-1)); srcFrame = (ActionFrame*)(cArray->getObjectAtIndex(i-1));
float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex())*getUnitTime(); float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex())*getUnitTime();
float delaytime = fTime - srcFrame->getFrameIndex()*getUnitTime(); float delaytime = fTime - srcFrame->getFrameIndex()*getUnitTime();
this->easingToFrame(duration,1.0f,srcFrame); this->easingToFrame(duration,1.0f,srcFrame);

View File

@ -23,7 +23,7 @@
****************************************************************************/ ****************************************************************************/
#include "CCActionObject.h" #include "CCActionObject.h"
#include "../Json//DictionaryHelper.h" #include "../Json/DictionaryHelper.h"
NS_CC_EXT_BEGIN NS_CC_EXT_BEGIN
@ -70,7 +70,7 @@ void ActionObject::setUnitTime(float fTime)
int nodeNum = _actionNodeList->count(); int nodeNum = _actionNodeList->count();
for ( int i = 0; i < nodeNum; i++ ) for ( int i = 0; i < nodeNum; i++ )
{ {
ActionNode* actionNode = (ActionNode*)_actionNodeList->objectAtIndex(i); ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i);
actionNode->setUnitTime(_fUnitTime); actionNode->setUnitTime(_fUnitTime);
} }
} }
@ -134,7 +134,7 @@ void ActionObject::play()
int frameNum = _actionNodeList->count(); int frameNum = _actionNodeList->count();
for ( int i = 0; i < frameNum; i++ ) for ( int i = 0; i < frameNum; i++ )
{ {
ActionNode* actionNode = (ActionNode*)_actionNodeList->objectAtIndex(i); ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i);
actionNode->playAction( getLoop()); actionNode->playAction( getLoop());
} }
} }
@ -150,7 +150,7 @@ void ActionObject::stop()
for ( int i = 0; i < frameNum; i++ ) for ( int i = 0; i < frameNum; i++ )
{ {
ActionNode* actionNode = (ActionNode*)_actionNodeList->objectAtIndex(i); ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i);
actionNode->stopAction(); actionNode->stopAction();
} }
@ -165,7 +165,7 @@ void ActionObject::updateToFrameByTime(float fTime)
for ( int i = 0; i < nodeNum; i++ ) for ( int i = 0; i < nodeNum; i++ )
{ {
ActionNode* actionNode = (ActionNode*)_actionNodeList->objectAtIndex(i); ActionNode* actionNode = (ActionNode*)_actionNodeList->getObjectAtIndex(i);
actionNode->updateActionToTimeLine(fTime); actionNode->updateActionToTimeLine(fTime);
} }

View File

@ -8,7 +8,7 @@ using namespace cocos2d::extension;
SceneEditorTestLayer::~SceneEditorTestLayer() SceneEditorTestLayer::~SceneEditorTestLayer()
{ {
armature::ArmatureDataManager::purge(); armature::ArmatureDataManager::getInstance()->purge();
SceneReader::getInstance()->purgeSceneReader(); SceneReader::getInstance()->purgeSceneReader();
cocos2d::extension::ActionManagerEx::shareManager()->purgeActionManager(); cocos2d::extension::ActionManagerEx::shareManager()->purgeActionManager();
cocos2d::extension::UIHelper::instance()->purgeUIHelper(); cocos2d::extension::UIHelper::instance()->purgeUIHelper();