| 354 | } |
| 355 | |
| 356 | void TriTextureRes::ReleaseResources( TriStorage s ) |
| 357 | { |
| 358 | if( m_ownTexture.IsValid() && ( m_ownTexture.GetMemoryClass() & s ) != 0 ) |
| 359 | { |
| 360 | if( m_lodEnabled ) |
| 361 | { |
| 362 | Tr2TextureLodManager::Instance().GpuTextureDestroyed( m_ownTexture.GetDesc() ); |
| 363 | } |
| 364 | m_ownTexture = Tr2TextureAL(); |
| 365 | } |
| 366 | |
| 367 | if( !m_texture ) |
| 368 | { |
| 369 | return; |
| 370 | } |
| 371 | |
| 372 | if( ( s & TRISTORAGE_MANAGEDMEMORY ) || ( ( s & TRISTORAGE_VIDEOMEMORY ) && m_texture->GetMemoryClass() == AL_MEMORY_VIDEO ) ) |
| 373 | { |
| 374 | CCP_STATS_ADD( textureResBytes, -(int)m_memoryUse ); |
| 375 | m_memoryUse = 0; |
| 376 | m_originalMemoryUse = 0; |
| 377 | |
| 378 | CancelPendingLoad(); |
| 379 | CleanupAsyncSave( false ); |
| 380 | |
| 381 | m_ownTexture = Tr2TextureAL(); |
| 382 | m_texture = nullptr; |
| 383 | if( m_wrappedRenderTarget ) |
| 384 | { |
| 385 | m_wrappedRenderTarget->OnTextureChange().UnregisterListener( this ); |
| 386 | } |
| 387 | m_wrappedRenderTarget = nullptr; |
| 388 | SetPrepared( false ); |
| 389 | SetGood( false ); |
| 390 | m_onTextureChange(); |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | Tr2TextureAL* TriTextureRes::GetTexture() |
| 395 | { |
nothing calls this directly
no test coverage detected