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

Method PushTransform

trinity/Sprite2d/Tr2Sprite2dScene.cpp:500–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498}
499
500void Tr2Sprite2dScene::PushTransform( const Matrix& m )
501{
502 //CCP_STATS_ZONE( __FUNCTION__ );
503
504 TransformStackEntry entry;
505 entry.isTranslationOnly = false;
506 entry.isTranslationOnlySet = false;
507
508 if( m_transformStack->empty() )
509 {
510 entry.transform = m;
511 }
512 else
513 {
514 const TransformStackEntry& top = m_transformStack->back();
515 if( top.isTranslationOnly )
516 {
517 Matrix parent = TranslationMatrix( top.translation.x, top.translation.y, 0.0f );
518 entry.transform = m * parent;
519 }
520 else
521 {
522 const Matrix& parent = m_transformStack->back().transform;
523 entry.transform = m * parent;
524 }
525 }
526
527 m_transformStack->push_back( entry );
528}
529
530void Tr2Sprite2dScene::PopTransform()
531{

Callers 2

GatherSpritesMethod · 0.80
PickPointMethod · 0.80

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected