MCPcopy Create free account
hub / github.com/axmolengine/axmol / removeUnusedTextures

Method removeUnusedTextures

core/renderer/TextureCache.cpp:661–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661void TextureCache::removeUnusedTextures()
662{
663 for (auto it = _textures.cbegin(); it != _textures.cend(); /* nothing */)
664 {
665 Texture2D* tex = it->second;
666 if (tex->getReferenceCount() == 1)
667 {
668 AXLOGD("TextureCache: removing unused texture: {}", it->first);
669
670 tex->release();
671 it = _textures.erase(it);
672 }
673 else
674 {
675 ++it;
676 }
677 }
678}
679
680void TextureCache::removeTexture(Texture2D* texture)
681{

Callers 9

purgeCachedDataMethod · 0.80
TestCaseMethod · 0.80
addNewMeshWithCoordsMethod · 0.80
~TextureDemoMethod · 0.80
~TextureGlClampMethod · 0.80
~TextureGlRepeatMethod · 0.80
updateImageMethod · 0.80
~RenderTextureSaveMethod · 0.80
~BaseClippingNodeTestMethod · 0.80

Calls 5

cbeginMethod · 0.45
cendMethod · 0.45
getReferenceCountMethod · 0.45
releaseMethod · 0.45
eraseMethod · 0.45

Tested by 8

TestCaseMethod · 0.64
addNewMeshWithCoordsMethod · 0.64
~TextureDemoMethod · 0.64
~TextureGlClampMethod · 0.64
~TextureGlRepeatMethod · 0.64
updateImageMethod · 0.64
~RenderTextureSaveMethod · 0.64
~BaseClippingNodeTestMethod · 0.64