| 192 | } |
| 193 | |
| 194 | void 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. |
no outgoing calls
no test coverage detected