mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12748 from fusijie/refineSetTexture
refine setTexture.
This commit is contained in:
commit
cab670f0ff
|
@ -343,7 +343,7 @@ void Sprite::setTexture(const std::string &filename)
|
|||
void Sprite::setTexture(Texture2D *texture)
|
||||
{
|
||||
// If batchnode, then texture id should be the same
|
||||
CCASSERT(! _batchNode || texture->getName() == _batchNode->getTexture()->getName(), "CCSprite: Batched sprites should use the same texture as the batchnode");
|
||||
CCASSERT(! _batchNode || (texture && texture->getName() == _batchNode->getTexture()->getName()), "CCSprite: Batched sprites should use the same texture as the batchnode");
|
||||
// accept texture==nil as argument
|
||||
CCASSERT( !texture || dynamic_cast<Texture2D*>(texture), "setTexture expects a Texture2D. Invalid argument");
|
||||
|
||||
|
|
Loading…
Reference in New Issue