| 50 | } |
| 51 | |
| 52 | TriStepResult TriStepRenderTexture::Execute( Be::Time realTime, Be::Time simTime, Tr2RenderContext& renderContext ) |
| 53 | { |
| 54 | if( m_texture && m_texture->GetTexture() ) |
| 55 | { |
| 56 | return ClearIfFail( Tr2Renderer::DrawTexture( renderContext, *m_texture->GetTexture(), m_tlTexCoord, m_brTexCoord ), renderContext ); |
| 57 | } |
| 58 | |
| 59 | if( m_atlasTexture && m_atlasTexture->GetTexture() ) |
| 60 | { |
| 61 | float rectX = m_tlTexCoord.x * m_atlasTexture->GetWidth(); |
| 62 | float rectY = m_tlTexCoord.y * m_atlasTexture->GetHeight(); |
| 63 | float rectWidth = ( m_brTexCoord.x - m_tlTexCoord.x ) * m_atlasTexture->GetWidth(); |
| 64 | float rectHeight = ( m_brTexCoord.y - m_tlTexCoord.y ) * m_atlasTexture->GetHeight(); |
| 65 | |
| 66 | Vector4 tw; |
| 67 | m_atlasTexture->CalcSubTextureWindow( tw, rectX, rectY, rectWidth, rectHeight ); |
| 68 | |
| 69 | return ClearIfFail( Tr2Renderer::DrawTexture( renderContext, *m_texture->GetTexture(), Vector2( tw.x, tw.y ), Vector2( tw.x + tw.z, tw.y + tw.w ) ), renderContext ); |
| 70 | } |
| 71 | |
| 72 | return RS_OK; |
| 73 | } |
nothing calls this directly
no test coverage detected