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

Method UnlockBuffer

trinity/Tr2AtlasTexture.cpp:392–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392void Tr2AtlasTexture::UnlockBuffer()
393{
394 if( !m_isLocked )
395 {
396 CCP_LOGWARN( "Tr2AtlasTexture::UnlockBuffer failed - texture is not locked" );
397 return;
398 }
399
400 USE_MAIN_THREAD_RENDER_CONTEXT();
401
402 Tr2TextureAL* texture = nullptr;
403 if( m_textureAtlas && m_atlasArea )
404 {
405 texture = m_textureAtlas->GetTexture();
406 }
407 else if( m_texture.IsValid() )
408 {
409 texture = &m_texture;
410 }
411
412 if( !texture )
413 {
414 return;
415 }
416
417 texture->UnmapForWriting( renderContext );
418
419 m_isLocked = false;
420 SetGood( true );
421
422 NotifyListenersOfChange();
423}
424
425bool Tr2AtlasTexture::IsMemoryUsageKnown()
426{

Callers 4

DrawToAtlasTextureMethod · 0.80
OnPrepareResourcesMethod · 0.80
FlashDefaultTextureMethod · 0.80

Calls 3

GetTextureMethod · 0.45
IsValidMethod · 0.45
UnmapForWritingMethod · 0.45

Tested by

no test coverage detected