mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(model): implement more of CM2Model dtor
This commit is contained in:
parent
e055543167
commit
e85cdd4896
@ -86,21 +86,22 @@ CM2Model::~CM2Model() {
|
|||||||
|
|
||||||
// Unlink from lists
|
// Unlink from lists
|
||||||
|
|
||||||
if (this->m_animatePrev) {
|
this->UnlinkFromCallbackList();
|
||||||
*this->m_animatePrev = this->m_animateNext;
|
this->UnlinkFromAnimateList();
|
||||||
}
|
this->UnlinkFromDrawList();
|
||||||
if (this->m_animateNext) {
|
|
||||||
this->m_animateNext->m_animatePrev = this->m_animatePrev;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->m_drawPrev) {
|
|
||||||
*this->m_drawPrev = this->m_drawNext;
|
|
||||||
}
|
|
||||||
if (this->m_drawNext) {
|
|
||||||
this->m_drawNext->m_drawPrev = this->m_drawPrev;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
this->DetachFromScene();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
this->UnlinkFromAttachList();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
this->m_attachParent = nullptr;
|
||||||
|
this->m_currentLighting = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CM2Model::AddRef() {
|
void CM2Model::AddRef() {
|
||||||
@ -812,7 +813,22 @@ void CM2Model::DetachFromParent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CM2Model::DetachFromScene() {
|
void CM2Model::DetachFromScene() {
|
||||||
|
// Unlink from scene list
|
||||||
|
|
||||||
|
if (this->m_scenePrev) {
|
||||||
|
*this->m_scenePrev = this->m_sceneNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_sceneNext) {
|
||||||
|
this->m_sceneNext->m_scenePrev = this->m_scenePrev;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->m_scenePrev = nullptr;
|
||||||
|
this->m_sceneNext = nullptr;
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
this->m_scene = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CM2Model::FindKey(M2ModelBoneSeq* sequence, const M2TrackBase& track, uint32_t& currentKey, uint32_t& nextKey, float& ratio) {
|
void CM2Model::FindKey(M2ModelBoneSeq* sequence, const M2TrackBase& track, uint32_t& currentKey, uint32_t& nextKey, float& ratio) {
|
||||||
@ -1914,6 +1930,26 @@ void CM2Model::Sub826E60(uint32_t* a2, uint32_t* a3) {
|
|||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CM2Model::UnlinkFromAnimateList() {
|
||||||
|
if (this->m_animatePrev) {
|
||||||
|
*this->m_animatePrev = this->m_animateNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_animateNext) {
|
||||||
|
this->m_animateNext->m_animatePrev = this->m_animatePrev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CM2Model::UnlinkFromAttachList() {
|
||||||
|
if (this->m_attachPrev) {
|
||||||
|
*this->m_attachPrev = this->m_attachNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_attachNext) {
|
||||||
|
this->m_attachNext->m_attachPrev = this->m_attachPrev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CM2Model::UnlinkFromCallbackList() {
|
void CM2Model::UnlinkFromCallbackList() {
|
||||||
if (this->m_callbackPrev) {
|
if (this->m_callbackPrev) {
|
||||||
*this->m_callbackPrev = this->m_callbackNext;
|
*this->m_callbackPrev = this->m_callbackNext;
|
||||||
@ -1929,6 +1965,16 @@ void CM2Model::UnlinkFromCallbackList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CM2Model::UnlinkFromDrawList() {
|
||||||
|
if (this->m_drawPrev) {
|
||||||
|
*this->m_drawPrev = this->m_drawNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_drawNext) {
|
||||||
|
this->m_drawNext->m_drawPrev = this->m_drawPrev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CM2Model::UnoptimizeVisibleGeometry() {
|
void CM2Model::UnoptimizeVisibleGeometry() {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|||||||
@ -189,7 +189,10 @@ class CM2Model {
|
|||||||
void Sub826350(M2SequenceFallback& fallback, uint32_t sequenceId);
|
void Sub826350(M2SequenceFallback& fallback, uint32_t sequenceId);
|
||||||
int32_t Sub8269C0(uint32_t boneId, uint16_t boneIndex);
|
int32_t Sub8269C0(uint32_t boneId, uint16_t boneIndex);
|
||||||
void Sub826E60(uint32_t* a2, uint32_t* a3);
|
void Sub826E60(uint32_t* a2, uint32_t* a3);
|
||||||
|
void UnlinkFromAnimateList();
|
||||||
|
void UnlinkFromAttachList();
|
||||||
void UnlinkFromCallbackList();
|
void UnlinkFromCallbackList();
|
||||||
|
void UnlinkFromDrawList();
|
||||||
void UnoptimizeVisibleGeometry();
|
void UnoptimizeVisibleGeometry();
|
||||||
void UnsetBoneSequence(uint32_t boneId, int32_t a3, int32_t a4);
|
void UnsetBoneSequence(uint32_t boneId, int32_t a3, int32_t a4);
|
||||||
void UpdateLoaded();
|
void UpdateLoaded();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user