mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(model): implement CM2Shared::Release
This commit is contained in:
parent
b370d86f7d
commit
12a7752a57
@ -53,7 +53,9 @@ void CM2Shared::SkinProfileLoadedCallback(void* arg) {
|
||||
}
|
||||
|
||||
void CM2Shared::AddRef() {
|
||||
// TODO
|
||||
// TODO free list management etc
|
||||
|
||||
this->m_refCount++;
|
||||
}
|
||||
|
||||
int32_t CM2Shared::CallbackWhenLoaded(CM2Model* model) {
|
||||
@ -595,8 +597,20 @@ int32_t CM2Shared::LoadSkinProfile(uint32_t profile) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CM2Shared::Release() {
|
||||
// TODO
|
||||
uint32_t CM2Shared::Release() {
|
||||
STORM_ASSERT(this->m_refCount > 0);
|
||||
|
||||
this->m_refCount--;
|
||||
|
||||
if (this->m_refCount > 0) {
|
||||
return this->m_refCount;
|
||||
}
|
||||
|
||||
// TODO free list management etc
|
||||
|
||||
delete this;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t CM2Shared::SetIndices() {
|
||||
|
||||
@ -26,6 +26,7 @@ class CM2Shared {
|
||||
static void SkinProfileLoadedCallback(void* param);
|
||||
|
||||
// Member variables
|
||||
uint32_t m_refCount = 1;
|
||||
CM2Cache* m_cache;
|
||||
uint32_t m_m2DataLoaded : 1;
|
||||
uint32_t m_skinProfileLoaded : 1;
|
||||
@ -73,7 +74,7 @@ class CM2Shared {
|
||||
int32_t InitializeSkinProfile();
|
||||
int32_t Load(SFile* file, int32_t a3, CAaBox* a4);
|
||||
int32_t LoadSkinProfile(uint32_t profile);
|
||||
void Release();
|
||||
uint32_t Release();
|
||||
int32_t SetIndices();
|
||||
int32_t SetVertices(uint32_t a2);
|
||||
void SubstituteSimpleShaders();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user