| 384 | } |
| 385 | |
| 386 | void Tr2Sprite2dScene::PushTranslation( const Vector2& t ) |
| 387 | { |
| 388 | //CCP_STATS_ZONE( __FUNCTION__ ); |
| 389 | |
| 390 | TransformStackEntry entry; |
| 391 | entry.isTranslationOnlySet = true; |
| 392 | |
| 393 | if( m_transformStack->empty() ) |
| 394 | { |
| 395 | entry.translation = t; |
| 396 | entry.isTranslationOnly = true; |
| 397 | } |
| 398 | else |
| 399 | { |
| 400 | const TransformStackEntry& top = m_transformStack->back(); |
| 401 | if( top.isTranslationOnly ) |
| 402 | { |
| 403 | entry.translation = t + top.translation; |
| 404 | entry.isTranslationOnly = true; |
| 405 | } |
| 406 | else |
| 407 | { |
| 408 | const Matrix& parent = m_transformStack->back().transform; |
| 409 | |
| 410 | Matrix transform = TranslationMatrix( t.x, t.y, 0.0f ); |
| 411 | entry.transform = transform * parent; |
| 412 | |
| 413 | entry.isTranslationOnly = false; |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | m_transformStack->push_back( entry ); |
| 418 | } |
| 419 | |
| 420 | void Tr2Sprite2dScene::PopTranslation() |
| 421 | { |
no test coverage detected