feat(model): add CM2Model::FreeExternalResources

This commit is contained in:
fallenoak committed 2026-01-03 20:35:42 -06:00
1 parent 6db4041b8d
commit e37f768a8d
2 files changed
+22 -2

No files matched your search

+21 -2
View File
@@ -95,8 +95,7 @@ CM2Model::~CM2Model() {
this->DetachFromScene();
if (this->m_shared) {
// TODO
this->FreeExternalResources();
this->FreeInternalResources();
this->m_shared->Release();
@@ -1023,6 +1022,26 @@ void CM2Model::FindKey(M2ModelBoneSeq* sequence, const M2TrackBase& track, uint3
}
}
void CM2Model::FreeExternalResources() {
if (!this->m_loaded) {
return;
}
// TODO
if (this->m_textures) {
for (int32_t i = 0; i < this->m_shared->m_data->textures.Count(); i++) {
auto texture = this->m_textures[i];
if (texture) {
HandleClose(texture);
}
}
}
// TODO
}
void CM2Model::FreeInternalResources() {
if (!this->m_internalResources) {
return;
+1
View File
@@ -165,6 +165,7 @@ class CM2Model {
void DetachFromParent();
void DetachFromScene();
void FindKey(M2ModelBoneSeq* sequence, const M2TrackBase& track, uint32_t& currentKey, uint32_t& nextKey, float& ratio);
void FreeExternalResources();
void FreeInternalResources();
C44Matrix GetAttachmentWorldTransform(uint32_t id);
CAaBox& GetBoundingBox(CAaBox& bounds);