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

Method Execute

trinity/RenderJob/TriStepRenderTexture.cpp:52–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52TriStepResult 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}

Callers

nothing calls this directly

Calls 4

CalcSubTextureWindowMethod · 0.80
GetTextureMethod · 0.45
GetWidthMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected