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

Method ReleaseResources

trinity/Tr2AtlasTexture.cpp:159–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void 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
185BlueAsyncRes::LoadingResult Tr2AtlasTexture::DoLoad()
186{

Callers

nothing calls this directly

Calls 4

Tr2TextureALClass · 0.70
GetTextureMethod · 0.45
IsValidMethod · 0.45
GetMemoryClassMethod · 0.45

Tested by

no test coverage detected