From 4629d257e17458905325a15eaaa374fb5f113342 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Thu, 14 Aug 2014 09:58:11 +0800 Subject: [PATCH] rename checkCameraMask to isVisibleByVisitingCamera --- cocos/2d/CCClippingNode.cpp | 2 +- cocos/2d/CCLabel.cpp | 2 +- cocos/2d/CCNode.cpp | 4 ++-- cocos/2d/CCNode.h | 2 +- cocos/2d/CCNodeGrid.cpp | 2 +- cocos/2d/CCParticleBatchNode.cpp | 2 +- cocos/2d/CCProtectedNode.cpp | 2 +- cocos/2d/CCRenderTexture.cpp | 2 +- cocos/2d/CCSpriteBatchNode.cpp | 2 +- cocos/editor-support/cocostudio/CCArmature.cpp | 2 +- cocos/editor-support/cocostudio/CCBatchNode.cpp | 2 +- cocos/ui/UIScale9Sprite.cpp | 2 +- extensions/GUI/CCScrollView/CCScrollView.cpp | 2 +- tools/cocos2d-console | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index 53ed6797bb..26c5f55786 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 = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index d0242c1fc2..60798852f5 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() || !checkCameraMask()) + if (! _visible || _originalUTF8String.empty() || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 81290f2327..413ecd58e0 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::checkCameraMask() const +bool Node::isVisibleByVisitingCamera() 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 = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); int i = 0; diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 6d0f788104..91851c9b7a 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 checkCameraMask() const; + bool isVisibleByVisitingCamera() const; #if CC_USE_PHYSICS void updatePhysicsBodyTransform(Scene* layer); diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index ee86daa2e4..fa4ad6d2d7 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 = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); if(!_children.empty()) { diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index eb24526f82..ac5873b686 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 || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/2d/CCProtectedNode.cpp b/cocos/2d/CCProtectedNode.cpp index 5cf53729e6..485b7dd34a 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 (checkCameraMask()) + if (isVisibleByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 7cb4cf9e12..f53dc17da2 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 || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index df68d82b26..1e1516a76b 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 || !checkCameraMask()) + if (! _visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index ed11c16734..0af7683eb1 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 || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index ab64329483..b287c1acfc 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 || !checkCameraMask()) + if (!_visible || !isVisibleByVisitingCamera()) { return; } diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 3d31885daa..8bd8fc7cb4 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -774,7 +774,7 @@ y+=ytranslate; \ // // draw self // - if (checkCameraMask()) + if (isVisibleByVisitingCamera()) this->draw(renderer, _modelViewTransform, flags); // diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index f864ba1a79..af346cf01a 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 = checkCameraMask(); + bool visibleByCamera = isVisibleByVisitingCamera(); if (!_children.empty()) { diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 5db5a4283a..4b020e4900 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 5db5a4283aa22e362901e2924146ad66c2e1484f +Subproject commit 4b020e4900e601a2d5845095f2e6970c13c59613