mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(model): add CM2Model::FreeExternalResources
This commit is contained in:
parent
6db4041b8d
commit
e37f768a8d
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user