diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index 252f1e1454..2dd6fb05bf 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -140,14 +140,16 @@ void ParticleBatchNode::visit(Renderer *renderer, const kmMat4 &parentTransform, _transformUpdated = false; // 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 - kmGLPushMatrix(); - kmGLLoadMatrix(&_modelViewTransform); + Director* director = Director::getInstance(); + 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); - kmGLPopMatrix(); + director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } // override addChild: