diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 9e2f1970af..39ef02f014 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -880,7 +880,7 @@ void Label::drawShadowWithoutBlur() void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { // Don't do calculate the culling if the transform was not updated - _insideBounds = (flags & PARENT_DIRTY_MASK) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; + _insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if(_insideBounds) { _customCommand.init(_globalZOrder); @@ -1066,7 +1066,7 @@ void Label::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t pare uint32_t flags = processParentFlags(parentTransform, parentFlags); - if (_shadowEnabled && _shadowBlurRadius <= 0 && (_shadowDirty || (flags & PARENT_DIRTY_MASK))) + if (_shadowEnabled && _shadowBlurRadius <= 0 && (_shadowDirty || (flags & FLAGS_DIRTY_MASK))) { _position.x += _shadowOffset.width; _position.y += _shadowOffset.height; diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 8209d9d609..108db36ced 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -976,10 +976,10 @@ void Node::visit() uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFlags) { uint32_t flags = parentFlags; - flags |= (_transformUpdated ? PARENT_TRANSFORM_DIRTY : 0); - flags |= (_contentSizeDirty ? PARENT_CONTENT_SIZE_DIRTY : 0); + flags |= (_transformUpdated ? FLAGS_TRANSFORM_DIRTY : 0); + flags |= (_contentSizeDirty ? FLAGS_CONTENT_SIZE_DIRTY : 0); - if(_usingNormalizedPosition && (flags & PARENT_CONTENT_SIZE_DIRTY)) { + if(_usingNormalizedPosition && (flags & FLAGS_CONTENT_SIZE_DIRTY)) { CCASSERT(_parent, "setNormalizedPosition() doesn't work with orphan nodes"); auto s = _parent->getContentSize(); _position.x = _normalizedPosition.x * s.width; @@ -987,7 +987,7 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl _transformUpdated = _transformDirty = _inverseDirty = true; } - if(flags & PARENT_DIRTY_MASK) + if(flags & FLAGS_DIRTY_MASK) _modelViewTransform = this->transform(parentTransform); _transformUpdated = false; diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index cfd5eee512..84d0973693 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -108,10 +108,10 @@ public: static const int INVALID_TAG = -1; enum { - PARENT_TRANSFORM_DIRTY = (1 << 0), - PARENT_CONTENT_SIZE_DIRTY = (1 << 1), + FLAGS_TRANSFORM_DIRTY = (1 << 0), + FLAGS_CONTENT_SIZE_DIRTY = (1 << 1), - PARENT_DIRTY_MASK = (PARENT_TRANSFORM_DIRTY | PARENT_CONTENT_SIZE_DIRTY), + FLAGS_DIRTY_MASK = (FLAGS_TRANSFORM_DIRTY | FLAGS_CONTENT_SIZE_DIRTY), }; /// @{ /// @name Constructor, Destructor and Initializers diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index 6749df3905..b2ed64a5c7 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -94,7 +94,7 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p renderer->addCommand(&_groupCommand); renderer->pushGroup(_groupCommand.getRenderQueueID()); - bool dirty = (parentFlags & PARENT_TRANSFORM_DIRTY) || _transformUpdated; + bool dirty = (parentFlags & FLAGS_TRANSFORM_DIRTY) || _transformUpdated; if(dirty) _modelViewTransform = this->transform(parentTransform); _transformUpdated = false; diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 97b239b514..cc04c47c47 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -588,7 +588,7 @@ void Sprite::updateTransform(void) void Sprite::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { // Don't do calculate the culling if the transform was not updated - _insideBounds = (flags & PARENT_DIRTY_MASK) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; + _insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if(_insideBounds) { diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 9500ad3cea..fce1d22fac 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -151,7 +151,7 @@ public: void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override { // Don't do calculate the culling if the transform was not updated - _insideBounds = (flags & PARENT_DIRTY_MASK) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; + _insideBounds = (flags & FLAGS_TRANSFORM_DIRTY) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if(_insideBounds) {