MCPcopy Create free account
hub / github.com/carbonengine/trinity / GatherSpritesHelper

Method GatherSpritesHelper

trinity/Sprite2d/Tr2Sprite2dContainer.cpp:292–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void Tr2Sprite2dContainer::GatherSpritesHelper( Tr2Sprite2dScene* renderer )
293{
294 if( m_absoluteCoordinates )
295 {
296 renderer->PushTransformAbsolute();
297 }
298
299 renderer->PushTranslation( m_translation );
300 renderer->PushDepthRange( m_depthMin, m_depthMax );
301 float oldOpacity = renderer->GetAccumulatedAlpha();
302 renderer->SetAccumulatedAlpha( m_opacity * oldOpacity );
303
304 if( m_clip )
305 {
306 renderer->PushClipRectangle( 0.0f, 0.0f, m_displayWidth, m_displayHeight );
307 }
308
309 for( ITr2SpriteObjectVector::reverse_iterator it = m_background.rbegin(); it != m_background.rend(); ++it )
310 {
311 ( *it )->GatherSprites( renderer );
312 }
313 for( ITr2SpriteObjectVector::reverse_iterator it = m_children.rbegin(); it != m_children.rend(); ++it )
314 {
315 ( *it )->GatherSprites( renderer );
316 }
317
318 if( m_clip )
319 {
320 renderer->PopClipRectangle();
321 }
322
323 renderer->SetAccumulatedAlpha( oldOpacity );
324 renderer->PopDepthRange();
325 renderer->PopTranslation();
326
327 if( m_absoluteCoordinates )
328 {
329 renderer->PopTransformAbsolute();
330 }
331}

Callers

nothing calls this directly

Calls 11

PushTransformAbsoluteMethod · 0.80
PushTranslationMethod · 0.80
PushDepthRangeMethod · 0.80
GetAccumulatedAlphaMethod · 0.80
SetAccumulatedAlphaMethod · 0.80
PushClipRectangleMethod · 0.80
PopClipRectangleMethod · 0.80
PopDepthRangeMethod · 0.80
PopTranslationMethod · 0.80
PopTransformAbsoluteMethod · 0.80
GatherSpritesMethod · 0.45

Tested by

no test coverage detected