123456789101112131415 | Cells[col]= (Card*)TableauPiles[whichColumnForCC]->lastObject(); Card* t2=Cells[col]; Cells[col]->setPosition(m_pCurNode->getChildByTag(10006+col)->getPosition()); m_pCurNode->reorderChild(Cells[col],++zIndexForAll); Cells[col]->setPosition(m_pCurNode->getChildByTag(10006+col)->getPosition()); m_pCurNode->reorderChild(Cells[col],++zIndexForAll); //从原来位置清除扑克,但是并没有释放内存;否则,存在野指针!!!// TableauPiles[whichColumnForCC]->removeLastObject( false ); //9-11 |
1234567891011121314151617181920212223 | Card* tmpCard = TableauPiles[whichColumnForCC].back(); Card* card_2015 = new Card(); card_2015->setCurrentSuit(tmpCard->getCurrentSuit()); card_2015->setNumber(tmpCard->getNumber()); card_2015->loadTexture(tmpCard->getCurrentSuit()); card_2015->setPosition(m_pCurNode->getChildByTag(10006 + col)->getPosition()); Cells[col] = card_2015; Card* t2=Cells[col]; m_pCurNode->reorderChild(t2, ++zIndexForAll); //从原来位置清除扑克 //TableauPiles[whichColumnForCC]->removeLastObject(false);//modified on 9-11 TableauPiles[whichColumnForCC].popBack(); |
新闻热点
疑难解答