Fixing couple of bugs in reader that was checked into different branch

This commit is contained in:
Rohan Kuruvilla 2013-03-18 23:15:36 -07:00
parent aa022b532d
commit 80a268baf6
3 changed files with 7 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -886,8 +886,6 @@ bool CCBReader::readSoundKeyframesForSeq(CCBSequence* seq) {
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;
}