mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Fixed loading textures from cached pieces.
This commit is contained in:
parent
a9971b0b1a
commit
5e3ca0e781
2 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue