Hi.
I accidentally found this bug while I was working with my code. First, I initialize a CCRect and pass it into a constructor like this.
CCRect rect= CCRectMake(0,0,512,512);
AnimationList* animList = new AnimationList(“grossini.png”, rect);
However, at this point, the CCRect passed into the constructor just got its values (x and height) swapped, resulting in an error.
AnimationList::AnimationList(char* spriteSheetPath,
CCRect defaultSpriteLocationOnSpriteSheet)
{
*spriteSheet = CCSpriteBatchNode::create;
*sprite = CCSprite::createWithTexture(_spriteSheet->getTexture(),
defaultSpriteLocationOnSpriteSheet);
}
I then passed by reference, and the problem was solved. Could anyone help check on this problem? Thanks