diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index 26c5f55786..8a307f69df 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -261,7 +261,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32 renderer->addCommand(&_afterDrawStencilCmd); int i = 0; - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 60798852f5..9eaf5ee5f1 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -1053,7 +1053,7 @@ void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags) void Label::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { - if (! _visible || _originalUTF8String.empty() || !isVisibleByVisitingCamera()) + if (! _visible || _originalUTF8String.empty() || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 413ecd58e0..fb42ac4ea2 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -1225,7 +1225,7 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl return flags; } -bool Node::isVisibleByVisitingCamera() const +bool Node::isVisitableByVisitingCamera() const { auto camera = Camera::getVisitingCamera(); bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true; @@ -1249,7 +1249,7 @@ void Node::visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t paren director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); int i = 0; diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 91851c9b7a..729544681d 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1522,7 +1522,7 @@ protected: bool doEnumerateRecursive(const Node* node, const std::string &name, std::function callback) const; //check whether this camera mask is visible by the current visiting camera - bool isVisibleByVisitingCamera() const; + bool isVisitableByVisitingCamera() const; #if CC_USE_PHYSICS void updatePhysicsBodyTransform(Scene* layer); diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index fa4ad6d2d7..a2e5c263c2 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -126,7 +126,7 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p } int i = 0; - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index ac5873b686..b717205f82 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -130,7 +130,7 @@ void ParticleBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, u // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/2d/CCProtectedNode.cpp b/cocos/2d/CCProtectedNode.cpp index 485b7dd34a..4eae3d0b5a 100644 --- a/cocos/2d/CCProtectedNode.cpp +++ b/cocos/2d/CCProtectedNode.cpp @@ -318,7 +318,7 @@ void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint3 // // draw self // - if (isVisibleByVisitingCamera()) + if (isVisitableByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index f53dc17da2..f21a7c6458 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -393,7 +393,7 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3 { // override visit. // Don't call visit on its children - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 1e1516a76b..a2e48bddca 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -147,7 +147,7 @@ void SpriteBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uin // The alternative is to have a void Sprite#visit, but // although this is less maintainable, is faster // - if (! _visible || !isVisibleByVisitingCamera()) + if (! _visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index 0af7683eb1..c9081721ea 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -467,7 +467,7 @@ void Armature::onExit() void Armature::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index b287c1acfc..eb0ba5cf70 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -108,7 +108,7 @@ void BatchNode::removeChild(Node* child, bool cleanup) void BatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { // quick return if not visible. children won't be drawn. - if (!_visible || !isVisibleByVisitingCamera()) + if (!_visible || !isVisitableByVisitingCamera()) { return; } diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 8bd8fc7cb4..c3f79d13b2 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -774,7 +774,7 @@ y+=ytranslate; \ // // draw self // - if (isVisibleByVisitingCamera()) + if (isVisitableByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index af346cf01a..6c2862b3f0 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -581,7 +581,7 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); this->beforeDraw(); - bool visibleByCamera = isVisibleByVisitingCamera(); + bool visibleByCamera = isVisitableByVisitingCamera(); if (!_children.empty()) {