2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 11:07:44 +00:00

CToken usage fixes in CWorldTransManager; better model instances

This commit is contained in:
Jack Andersen
2016-09-02 11:39:46 -10:00
parent f4ea728a61
commit 0d08d4a40e
5 changed files with 36 additions and 37 deletions

View File

@@ -254,16 +254,18 @@ bool CBooModel::TryLockTextures() const
allLoad = false;
}
if (allLoad)
const_cast<CBooModel*>(this)->BuildGfxToken();
const_cast<CBooModel*>(this)->x40_24_texturesLoaded = allLoad;
}
if (!m_gfxToken && x40_24_texturesLoaded)
const_cast<CBooModel*>(this)->BuildGfxToken();
return x40_24_texturesLoaded;
}
void CBooModel::UnlockTextures() const
{
const_cast<boo::GraphicsDataToken&>(m_gfxToken).doDestroy();
for (TCachedToken<CTexture>& tex : const_cast<std::vector<TCachedToken<CTexture>>&>(x1c_textures))
tex.Unlock();
const_cast<CBooModel*>(this)->x40_24_texturesLoaded = false;