MCPcopy Create free account
hub / github.com/axmolengine/axmol / visit

Method visit

core/2d/SpriteBatchNode.cpp:172–209  ·  view source on GitHub ↗

override visit don't call visit on it's children

Source from the content-addressed store, hash-verified

170// override visit
171// don't call visit on it's children
172void SpriteBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t parentFlags)
173{
174 AX_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit");
175
176 // CAREFUL:
177 // This visit is almost identical to CocosNode#visit
178 // with the exception that it doesn't call visit on it's children
179 //
180 // The alternative is to have a void Sprite#visit, but
181 // although this is less maintainable, is faster
182 //
183 if (!_visible)
184 {
185 return;
186 }
187
188 sortAllChildren();
189
190 uint32_t flags = processParentFlags(parentTransform, parentFlags);
191
192 if (isVisitableByVisitingCamera())
193 {
194 // IMPORTANT:
195 // To ease the migration to v3.0, we still support the Mat4 stack,
196 // but it is deprecated and your code should not rely on it
197 _director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
198 _director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
199
200 draw(renderer, _modelViewTransform, flags);
201
202 _director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
203 // FIX ME: Why need to set _orderOfArrival to 0??
204 // Please refer to https://github.com/cocos2d/cocos2d-x/pull/6920
205 // setOrderOfArrival(0);
206
207 AX_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit");
208 }
209}
210
211void SpriteBatchNode::addChild(Node* child, int zOrder, int tag)
212{

Callers

nothing calls this directly

Calls 4

drawFunction · 0.85
pushMatrixMethod · 0.80
loadMatrixMethod · 0.80
popMatrixMethod · 0.80

Tested by

no test coverage detected