2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:47:42 +00:00

Proper handling for persistently resident resources

This commit is contained in:
Jack Andersen
2019-03-09 23:37:36 -10:00
parent 2f963b9ce3
commit 52b36795ac
18 changed files with 69 additions and 17 deletions

View File

@@ -1188,15 +1188,7 @@ void CModel::Draw(const CModelFlags& flags) const {
bool CModel::IsLoaded(int shaderIdx) const {
const_cast<CBooModel&>(*x28_modelInst).VerifyCurrentShader(shaderIdx);
std::vector<TCachedToken<CTexture>>& texs = x28_modelInst->x1c_textures;
bool loaded = true;
for (TCachedToken<CTexture>& tex : texs) {
if (!tex.IsLoaded()) {
loaded = false;
break;
}
}
return loaded;
return const_cast<CBooModel&>(*x28_modelInst).TryLockTextures();
}
size_t CModel::GetPoolVertexOffset(size_t idx) const { return m_hmdlMeta.vertStride * idx; }