rename checkCameraMask to isVisibleByVisitingCamera

This commit is contained in:
yangxiao 2014-08-14 09:58:11 +08:00
parent 76329f9e53
commit 4629d257e1
14 changed files with 15 additions and 15 deletions

View File

@ -261,7 +261,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32
renderer->addCommand(&_afterDrawStencilCmd); renderer->addCommand(&_afterDrawStencilCmd);
int i = 0; int i = 0;
bool visibleByCamera = checkCameraMask(); bool visibleByCamera = isVisibleByVisitingCamera();
if(!_children.empty()) if(!_children.empty())
{ {

View File

@ -1053,7 +1053,7 @@ void Label::drawTextSprite(Renderer *renderer, uint32_t parentFlags)
void Label::visit(Renderer *renderer, const Mat4 &parentTransform, 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; return;
} }

View File

@ -1225,7 +1225,7 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl
return flags; return flags;
} }
bool Node::checkCameraMask() const bool Node::isVisibleByVisitingCamera() const
{ {
auto camera = Camera::getVisitingCamera(); auto camera = Camera::getVisitingCamera();
bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true; 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->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
bool visibleByCamera = checkCameraMask(); bool visibleByCamera = isVisibleByVisitingCamera();
int i = 0; int i = 0;

View File

@ -1522,7 +1522,7 @@ protected:
bool doEnumerateRecursive(const Node* node, const std::string &name, std::function<bool (Node *)> callback) const; bool doEnumerateRecursive(const Node* node, const std::string &name, std::function<bool (Node *)> callback) const;
//check whether this camera mask is visible by the current visiting camera //check whether this camera mask is visible by the current visiting camera
bool checkCameraMask() const; bool isVisibleByVisitingCamera() const;
#if CC_USE_PHYSICS #if CC_USE_PHYSICS
void updatePhysicsBodyTransform(Scene* layer); void updatePhysicsBodyTransform(Scene* layer);

View File

@ -126,7 +126,7 @@ void NodeGrid::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t p
} }
int i = 0; int i = 0;
bool visibleByCamera = checkCameraMask(); bool visibleByCamera = isVisibleByVisitingCamera();
if(!_children.empty()) if(!_children.empty())
{ {

View File

@ -130,7 +130,7 @@ void ParticleBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, u
// The alternative is to have a void Sprite#visit, but // The alternative is to have a void Sprite#visit, but
// although this is less maintainable, is faster // although this is less maintainable, is faster
// //
if (!_visible || !checkCameraMask()) if (!_visible || !isVisibleByVisitingCamera())
{ {
return; return;
} }

View File

@ -318,7 +318,7 @@ void ProtectedNode::visit(Renderer* renderer, const Mat4 &parentTransform, uint3
// //
// draw self // draw self
// //
if (checkCameraMask()) if (isVisibleByVisitingCamera())
this->draw(renderer, _modelViewTransform, flags); this->draw(renderer, _modelViewTransform, flags);
// //

View File

@ -393,7 +393,7 @@ void RenderTexture::visit(Renderer *renderer, const Mat4 &parentTransform, uint3
{ {
// override visit. // override visit.
// Don't call visit on its children // Don't call visit on its children
if (!_visible || !checkCameraMask()) if (!_visible || !isVisibleByVisitingCamera())
{ {
return; return;
} }

View File

@ -147,7 +147,7 @@ void SpriteBatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uin
// The alternative is to have a void Sprite#visit, but // The alternative is to have a void Sprite#visit, but
// although this is less maintainable, is faster // although this is less maintainable, is faster
// //
if (! _visible || !checkCameraMask()) if (! _visible || !isVisibleByVisitingCamera())
{ {
return; return;
} }

View File

@ -467,7 +467,7 @@ void Armature::onExit()
void Armature::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) void Armature::visit(cocos2d::Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{ {
// quick return if not visible. children won't be drawn. // quick return if not visible. children won't be drawn.
if (!_visible || !checkCameraMask()) if (!_visible || !isVisibleByVisitingCamera())
{ {
return; return;
} }

View File

@ -108,7 +108,7 @@ void BatchNode::removeChild(Node* child, bool cleanup)
void BatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) void BatchNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{ {
// quick return if not visible. children won't be drawn. // quick return if not visible. children won't be drawn.
if (!_visible || !checkCameraMask()) if (!_visible || !isVisibleByVisitingCamera())
{ {
return; return;
} }

View File

@ -774,7 +774,7 @@ y+=ytranslate; \
// //
// draw self // draw self
// //
if (checkCameraMask()) if (isVisibleByVisitingCamera())
this->draw(renderer, _modelViewTransform, flags); this->draw(renderer, _modelViewTransform, flags);
// //

View File

@ -581,7 +581,7 @@ void ScrollView::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
this->beforeDraw(); this->beforeDraw();
bool visibleByCamera = checkCameraMask(); bool visibleByCamera = isVisibleByVisitingCamera();
if (!_children.empty()) if (!_children.empty())
{ {

@ -1 +1 @@
Subproject commit 5db5a4283aa22e362901e2924146ad66c2e1484f Subproject commit 4b020e4900e601a2d5845095f2e6970c13c59613