From 9b7b9a4b1e71982c28be87b6d5cb8b946bac5471 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sun, 12 Oct 2025 11:09:55 -0500 Subject: [PATCH] feat(model): add CM2Model::AddRef --- src/model/CM2Model.cpp | 8 ++++++-- src/model/CM2Model.hpp | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/model/CM2Model.cpp b/src/model/CM2Model.cpp index 50d80aa..df5ef9d 100644 --- a/src/model/CM2Model.cpp +++ b/src/model/CM2Model.cpp @@ -76,6 +76,10 @@ uint16_t CM2Model::Sub8260C0(M2Data* data, uint32_t sequenceId, int32_t a3) { return -1; } +void CM2Model::AddRef() { + this->m_refCount++; +} + void CM2Model::Animate() { // TODO } @@ -754,7 +758,7 @@ int32_t CM2Model::Initialize(CM2Scene* scene, CM2Shared* shared, CM2Model* a4, u this->m_shared->AddRef(); if (a4) { - a4->m_refCount++; + a4->AddRef(); } this->m_flags = flags; @@ -1103,7 +1107,7 @@ void CM2Model::ProcessCallbacksRecursive() { return; } - this->m_refCount++; + this->AddRef(); if (this->ProcessCallbacks()) { // TODO process attachments diff --git a/src/model/CM2Model.hpp b/src/model/CM2Model.hpp index 7f6f05d..1829702 100644 --- a/src/model/CM2Model.hpp +++ b/src/model/CM2Model.hpp @@ -135,6 +135,7 @@ class CM2Model { , m_flag200000(0) , m_flag400000(0) {}; + void AddRef(); void Animate(); void AnimateCamerasST(); void AnimateMT(const C44Matrix* view, const C3Vector& a3, const C3Vector& a4, float a5, float a6);