Fixed loading textures from cached pieces.

This commit is contained in:
Leonardo Zide 2021-06-27 12:42:53 -07:00
parent a9971b0b1a
commit 5e3ca0e781
2 changed files with 2 additions and 1 deletions

View file

@ -424,6 +424,7 @@ bool lcMesh::FileLoad(lcMemFile& File)
FileName[Length] = 0; FileName[Length] = 0;
Section.Texture = lcGetPiecesLibrary()->FindTexture(FileName, nullptr, false); Section.Texture = lcGetPiecesLibrary()->FindTexture(FileName, nullptr, false);
Section.Texture->AddRef();
} }
else else
Section.Texture = nullptr; Section.Texture = nullptr;

View file

@ -168,7 +168,7 @@ void PieceInfo::ReleaseMesh()
lcMeshSection& Section = mMesh->mLods[LodIdx].Sections[SectionIdx]; lcMeshSection& Section = mMesh->mLods[LodIdx].Sections[SectionIdx];
if (Section.Texture) if (Section.Texture)
lcGetPiecesLibrary()->ReleaseTexture(Section.Texture); Section.Texture->Release();
} }
} }