Revert "fix issue that render texture will have wrong effect if using with global z order (#18629)" (#18777)

This reverts commit 38864456bf.
This commit is contained in:
leda 2018-04-19 09:37:05 +08:00 committed by minggo
parent bed8c0ac77
commit fbad734633
2 changed files with 2 additions and 11 deletions

View File

@ -796,12 +796,6 @@ void RenderTexture::draw(Renderer *renderer, const Mat4 &transform, uint32_t fla
}
}
void RenderTexture::setGlobalZOrder(float globalZOrder)
{
Node::setGlobalZOrder(globalZOrder);
_sprite->setGlobalZOrder(globalZOrder);
}
void RenderTexture::begin()
{
Director* director = Director::getInstance();
@ -836,8 +830,7 @@ void RenderTexture::begin()
renderer->addCommand(&_groupCommand);
renderer->pushGroup(_groupCommand.getRenderQueueID());
// Begine command should be the first command of the command group.
_beginCommand.init(INT_MIN);
_beginCommand.init(_globalZOrder);
_beginCommand.func = CC_CALLBACK_0(RenderTexture::onBegin, this);
Director::getInstance()->getRenderer()->addCommand(&_beginCommand);
@ -845,8 +838,7 @@ void RenderTexture::begin()
void RenderTexture::end()
{
// End command should be the last command of the command group.
_endCommand.init(INT_MAX);
_endCommand.init(_globalZOrder);
_endCommand.func = CC_CALLBACK_0(RenderTexture::onEnd, this);
Director* director = Director::getInstance();

View File

@ -265,7 +265,6 @@ public:
// Overrides
virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
virtual void setGlobalZOrder(float globalZOrder) override;
/** Flag: Use stack matrix computed from scene hierarchy or generate new modelView and projection matrix.
*