| 498 | } |
| 499 | |
| 500 | void 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 | |
| 530 | void Tr2Sprite2dScene::PopTransform() |
| 531 | { |
no test coverage detected