migrate particleBatchNode to director matrix stack

This commit is contained in:
Huabing.Xu 2014-04-02 22:52:41 +08:00
parent c593938ed2
commit dd4d45ea90
1 changed files with 6 additions and 4 deletions

View File

@ -140,14 +140,16 @@ void ParticleBatchNode::visit(Renderer *renderer, const kmMat4 &parentTransform,
_transformUpdated = false; _transformUpdated = false;
// IMPORTANT: // IMPORTANT:
// To ease the migration to v3.0, we still support the kmGL stack, // To ease the migration to v3.0, we still support the kmMat4 stack,
// but it is deprecated and your code should not rely on it // but it is deprecated and your code should not rely on it
kmGLPushMatrix(); Director* director = Director::getInstance();
kmGLLoadMatrix(&_modelViewTransform); CCASSERT(nullptr != director, "Director is null when seting matrix stack");
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
draw(renderer, _modelViewTransform, dirty); draw(renderer, _modelViewTransform, dirty);
kmGLPopMatrix(); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
} }
// override addChild: // override addChild: