| 157 | } |
| 158 | |
| 159 | void Tr2AtlasTexture::ReleaseResources( TriStorage s ) |
| 160 | { |
| 161 | Tr2TextureAL* texture = nullptr; |
| 162 | if( m_textureAtlas && m_atlasArea ) |
| 163 | { |
| 164 | texture = m_textureAtlas->GetTexture(); |
| 165 | } |
| 166 | else if( m_texture.IsValid() ) |
| 167 | { |
| 168 | texture = &m_texture; |
| 169 | } |
| 170 | |
| 171 | if( texture && texture->GetMemoryClass() & s ) |
| 172 | { |
| 173 | // When managed memory is freed, both standalone textures and the |
| 174 | // ones resident in an atlas are purged. |
| 175 | CancelPendingLoad(); |
| 176 | |
| 177 | m_texture = Tr2TextureAL(); |
| 178 | CCP_DELETE m_atlasArea; |
| 179 | m_atlasArea = NULL; |
| 180 | |
| 181 | SetPrepared( false ); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | BlueAsyncRes::LoadingResult Tr2AtlasTexture::DoLoad() |
| 186 | { |
nothing calls this directly
no test coverage detected