mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Extract SSkinTextures::Unload
function
This commit is contained in:
parent
fbc4181809
commit
e350ceeb16
|
@ -310,26 +310,10 @@ void CSkins::OnInit()
|
|||
|
||||
void CSkins::Refresh(TSkinLoadedCBFunc &&SkinLoadedFunc)
|
||||
{
|
||||
for(const auto &SkinIt : m_Skins)
|
||||
for(const auto &[_, pSkin] : m_Skins)
|
||||
{
|
||||
const auto &pSkin = SkinIt.second;
|
||||
Graphics()->UnloadTexture(&pSkin->m_OriginalSkin.m_Body);
|
||||
Graphics()->UnloadTexture(&pSkin->m_OriginalSkin.m_BodyOutline);
|
||||
Graphics()->UnloadTexture(&pSkin->m_OriginalSkin.m_Feet);
|
||||
Graphics()->UnloadTexture(&pSkin->m_OriginalSkin.m_FeetOutline);
|
||||
Graphics()->UnloadTexture(&pSkin->m_OriginalSkin.m_Hands);
|
||||
Graphics()->UnloadTexture(&pSkin->m_OriginalSkin.m_HandsOutline);
|
||||
for(auto &Eye : pSkin->m_OriginalSkin.m_aEyes)
|
||||
Graphics()->UnloadTexture(&Eye);
|
||||
|
||||
Graphics()->UnloadTexture(&pSkin->m_ColorableSkin.m_Body);
|
||||
Graphics()->UnloadTexture(&pSkin->m_ColorableSkin.m_BodyOutline);
|
||||
Graphics()->UnloadTexture(&pSkin->m_ColorableSkin.m_Feet);
|
||||
Graphics()->UnloadTexture(&pSkin->m_ColorableSkin.m_FeetOutline);
|
||||
Graphics()->UnloadTexture(&pSkin->m_ColorableSkin.m_Hands);
|
||||
Graphics()->UnloadTexture(&pSkin->m_ColorableSkin.m_HandsOutline);
|
||||
for(auto &Eye : pSkin->m_ColorableSkin.m_aEyes)
|
||||
Graphics()->UnloadTexture(&Eye);
|
||||
pSkin->m_OriginalSkin.Unload(Graphics());
|
||||
pSkin->m_ColorableSkin.Unload(Graphics());
|
||||
}
|
||||
|
||||
m_Skins.clear();
|
||||
|
|
|
@ -37,6 +37,18 @@ public:
|
|||
for(auto &Eye : m_aEyes)
|
||||
Eye = IGraphics::CTextureHandle();
|
||||
}
|
||||
|
||||
void Unload(IGraphics *pGraphics)
|
||||
{
|
||||
pGraphics->UnloadTexture(&m_Body);
|
||||
pGraphics->UnloadTexture(&m_BodyOutline);
|
||||
pGraphics->UnloadTexture(&m_Feet);
|
||||
pGraphics->UnloadTexture(&m_FeetOutline);
|
||||
pGraphics->UnloadTexture(&m_Hands);
|
||||
pGraphics->UnloadTexture(&m_HandsOutline);
|
||||
for(auto &Eye : m_aEyes)
|
||||
pGraphics->UnloadTexture(&Eye);
|
||||
}
|
||||
};
|
||||
|
||||
SSkinTextures m_OriginalSkin;
|
||||
|
|
Loading…
Reference in a new issue