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

Method GatherSprites

trinity/Sprite2d/Tr2Sprite2dArc.cpp:49–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void Tr2Sprite2dArc::GatherSprites( Tr2Sprite2dScene* renderer )
50{
51 CCP_STATS_ZONE( __FUNCTION__ );
52
53 if( !m_display || ( m_spriteEffect == TR2_SFX_NONE ) || ( m_radius == 0.0f ) || ( m_startAngle >= m_endAngle ) )
54 {
55 if( m_renderVertices )
56 {
57 ClearVertices();
58 }
59 return;
60 }
61
62 if( m_isDirty )
63 {
64 ClearVertices();
65
66 if( m_spriteEffect >= TR2_SFX_ONE_TEXTURE )
67 {
68 if( m_texturePrimary )
69 {
70 if( !m_texturePrimary->IsGood() )
71 {
72 // Don't draw if we're still loading (or failed)
73 return;
74 }
75 m_texturePrimary->Apply( renderer, 0 );
76 }
77 else
78 {
79 // Don't draw if no texture set
80 return;
81 }
82
83 if( m_spriteEffect >= TR2_SFX_TWO_TEXTURES )
84 {
85 if( m_textureSecondary )
86 {
87 if( !m_textureSecondary->IsGood() )
88 {
89 // Don't draw if we're still loading (or failed)
90 return;
91 }
92 m_textureSecondary->Apply( renderer, 1 );
93 }
94 else
95 {
96 // Don't draw if no texture set
97 return;
98 }
99 }
100 }
101
102 // Anti-aliased lines are rendered with a quad that is larger. This is then
103 // compensated for in the pixel shader, using the extra pixels to fill in
104 // alpha values to do the anti-aliasing
105
106 bool isAA = m_spriteEffect == TR2_SFX_FILL_AA;

Callers

nothing calls this directly

Calls 7

SetSpriteEffectMethod · 0.80
SetTileModeMethod · 0.80
PrepareTriangleVertsMethod · 0.80
RenderTriangleVertsMethod · 0.80
sizeMethod · 0.80
IsGoodMethod · 0.45
ApplyMethod · 0.45

Tested by

no test coverage detected