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

Method GatherSprites

trinity/Sprite2d/Tr2Sprite2dContainer.cpp:108–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void Tr2Sprite2dContainer::GatherSprites( Tr2Sprite2dScene* renderer )
109{
110 if( !m_display || ( m_children.empty() && m_background.empty() ) )
111 {
112 return;
113 }
114
115 if( m_displayWidth <= 0.0f || m_displayHeight <= 0.0f )
116 {
117 return;
118 }
119
120 if( m_cacheContentsHint )
121 {
122 if( m_isDirty )
123 {
124 m_cleanFrameCount = 0;
125 if( m_dirtyFrameCount > 10 )
126 {
127 m_cacheContents = false;
128 if( m_cachedDisplayList )
129 {
130 CCP_DELETE m_cachedDisplayList;
131 m_cachedDisplayList = nullptr;
132 }
133 }
134 else
135 {
136 m_dirtyFrameCount++;
137 }
138 }
139 else
140 {
141 m_dirtyFrameCount = 0;
142 if( m_cleanFrameCount > 3 )
143 {
144 m_cacheContents = true;
145 }
146 else
147 {
148 m_cleanFrameCount++;
149 }
150 }
151 }
152 else
153 {
154 m_dirtyFrameCount = 0;
155 m_cleanFrameCount = 0;
156 m_cacheContents = false;
157 if( m_cachedDisplayList )
158 {
159 CCP_DELETE m_cachedDisplayList;
160 m_cachedDisplayList = nullptr;
161 }
162 }
163
164 if( m_cacheContents && !renderer->IsCapturing() )
165 {

Callers 1

GatherSpritesHelperMethod · 0.45

Calls 5

emptyMethod · 0.80
StartCaptureMethod · 0.80
EndCaptureMethod · 0.80
ReplayCaptureMethod · 0.80
IsCapturingMethod · 0.45

Tested by

no test coverage detected