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

Method RemoveFromAtlas

trinity/Tr2TextureAtlas.cpp:194–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void Tr2TextureAtlas::RemoveFromAtlas( Tr2AtlasTexture* tex )
195{
196 m_texturesInAtlas.erase( tex );
197 m_texturesOutsideAtlas.erase( tex );
198
199 Tr2TextureAtlasArea* area = tex->m_atlasArea;
200 if( area )
201 {
202 m_freeTexels += ( area->rect.bottom - area->rect.top ) * ( area->rect.right - area->rect.left );
203 tex->m_atlasArea = NULL;
204
205 area->type = Tr2TextureAtlasArea::FREE;
206 FreeArea( area );
207
208 PaintEmptyArea( area );
209
210 if( m_optimizeOnRemoval )
211 {
212 PullInOutsiders();
213 }
214 else
215 {
216 UpdateFreeMaxima();
217 }
218 }
219}
220
221//Consolidates free areas, attempting to improve the 'squareness' of the free regions of the atlas
222//to improve further usage.

Callers 2

OnShutdownMethod · 0.80
DoPrepareMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected