mirror of https://github.com/axmolengine/axmol.git
Fixing couple of bugs in reader that was checked into different branch
This commit is contained in:
parent
aa022b532d
commit
80a268baf6
|
@ -575,14 +575,15 @@ CCObject* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* cha
|
|||
|
||||
CCArray* keyVal = (CCArray *)keyframe->getValue();
|
||||
std::string selectorName = ((CCString *)keyVal->objectAtIndex(0))->getCString();
|
||||
int selectorTarget = atoi(((CCString *)keyVal->objectAtIndex(0))->getCString());
|
||||
int selectorTarget = atoi(((CCString *)keyVal->objectAtIndex(1))->getCString());
|
||||
|
||||
if(jsControlled) {
|
||||
|
||||
stringstream ss;//create a stringstream
|
||||
ss << selectorTarget;//add number to the stream
|
||||
std::string callbackName = ss.str() + ":" + selectorName;
|
||||
CCCallFuncN *callback = (CCCallFuncN*)mKeyframeCallFuncs->objectForKey(callbackName.c_str());
|
||||
CCCallFunc *callback = (CCCallFunc*)mKeyframeCallFuncs->objectForKey(callbackName.c_str());
|
||||
callback->retain();
|
||||
|
||||
if(callback != NULL) {
|
||||
actions->addObject(callback);
|
||||
|
@ -822,7 +823,7 @@ void CCBAnimationManager::setAnimationCompletedCallback(CCObject *target, SEL_Ca
|
|||
mAnimationCompleteCallbackFunc = callbackFunc;
|
||||
}
|
||||
|
||||
void CCBAnimationManager::setCallFunc(CCCallFuncN* callFunc, const std::string &callbackNamed) {
|
||||
void CCBAnimationManager::setCallFunc(CCCallFunc* callFunc, const std::string &callbackNamed) {
|
||||
mKeyframeCallFuncs->setObject((CCObject*)callFunc, callbackNamed);
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
|
||||
void debug();
|
||||
|
||||
void setCallFunc(CCCallFuncN *callFunc, const std::string &callbackNamed);
|
||||
void setCallFunc(CCCallFunc *callFunc, const std::string &callbackNamed);
|
||||
|
||||
CCObject* actionForCallbackChannel(CCBSequenceProperty* channel);
|
||||
CCObject* actionForSoundChannel(CCBSequenceProperty* channel);
|
||||
|
|
|
@ -885,9 +885,7 @@ bool CCBReader::readSoundKeyframesForSeq(CCBSequence* seq) {
|
|||
float pitch = readFloat();
|
||||
float pan = readFloat();
|
||||
float gain = readFloat();
|
||||
|
||||
int callbackType = readInt(false);
|
||||
|
||||
|
||||
CCArray* value = CCArray::create();
|
||||
|
||||
value->addObject(CCString::create(soundFile));
|
||||
|
@ -911,7 +909,7 @@ bool CCBReader::readSoundKeyframesForSeq(CCBSequence* seq) {
|
|||
channel->getKeyframes()->addObject(keyframe);
|
||||
}
|
||||
|
||||
seq->setCallbackChannel(channel);
|
||||
seq->setSoundChannel(channel);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue