| 1260 | } |
| 1261 | |
| 1262 | bool Tr2TextureAtlas::EjectTexture( Tr2AtlasTexture* tex ) |
| 1263 | { |
| 1264 | CCP_ASSERT( tex ); |
| 1265 | |
| 1266 | if( !tex->m_textureAtlas || !tex->m_atlasArea ) |
| 1267 | { |
| 1268 | return false; |
| 1269 | } |
| 1270 | |
| 1271 | if( EjectTextureHelper( tex ) ) |
| 1272 | { |
| 1273 | for( auto i = m_texturesInAtlas.begin(); i != m_texturesInAtlas.end(); ++i ) |
| 1274 | { |
| 1275 | Tr2AtlasTexture* t = *i; |
| 1276 | if( t == tex ) |
| 1277 | { |
| 1278 | m_texturesInAtlas.erase( i ); |
| 1279 | return true; |
| 1280 | } |
| 1281 | } |
| 1282 | } |
| 1283 | |
| 1284 | return false; |
| 1285 | } |
| 1286 | |
| 1287 | bool Tr2TextureAtlas::EjectTextureHelper( Tr2AtlasTexture* tex ) |
| 1288 | { |
no test coverage detected