Model2: header-inline copies emitted in WoW and ~CM2Cache

CM2Model::SetWorldTransform(C44Matrix) 0x4D8630, GetBoundingBox 0x4F5E20,
GetBoundingSphere 0x4F5E80, GetAnimatedWorldTransform 0x6F1D20,
CM2Lighting::Reset 0x4E2730, CM2Lighting(const CAaSphere&) 0x790440 and
CM2Cache::~CM2Cache (0x81C870, reached through the atexit thunk 0x9DD200;
needs its IDB function defined). Removes a stray VERIFY stamp inside
CM2Lighting().

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Saty
2026-09-27 03:04:04 +02:00
co-authored by Claude Opus 5.5
parent 03de438346
commit 13054ed277
5 changed files with 91 additions and 2 deletions
+7
View File
@@ -423,6 +423,13 @@ void CM2Cache::LinkToSharedUpdateList(CM2Shared* shared) {
this->m_sharedUpdateList.LinkToTail(shared);
}
// OFFSET: 0x0081C870
CM2Cache::~CM2Cache() {
if (this->m_initialized) {
DebugLog("Model2: M2Destroy never called\n");
}
}
// VERIFY: 902f5653 manual
// OFFSET: 0x0081C900
CM2Cache::CM2Cache() : m_threadStart(0, 0), m_threadDone(0, 0) {
+1
View File
@@ -42,6 +42,7 @@ class CM2Cache {
/* 10A0 */ TSExplicitList<CM2Shared, offsetof(CM2Shared, m_updateLink)> m_sharedUpdateList;
CM2Cache();
~CM2Cache();
void BeginThread(void (*func)(void*), void* param);
void ClearSharedHash();
CM2Shared* CreateShared(const char* name, uint32_t flags);
+2
View File
@@ -65,6 +65,8 @@ class CM2Lighting {
/* 00C4 */ C4Plane m_liquidPlane;
CM2Lighting();
CM2Lighting(const CAaSphere& sphere);
void Reset();
void AddAmbient(const C3Vector& color);
void AddDiffuse(const C3Vector& color, const C3Vector& dir);
void AddLight(CM2Light* light);
+77 -2
View File
@@ -458,7 +458,7 @@ void CM2Model::ComputeLoadProgress(int64_t& loaded, int64_t& total) {
}
}
// VERIFY: 7cdb0522 manual
// VERIFY: 4f897dd8 manual
// OFFSET: 0x008248C0
CM2Lighting::CM2Lighting() {
this->m_sphere4.c.x = 0.0f;
@@ -474,7 +474,6 @@ CM2Lighting::CM2Lighting() {
this->m_sunDiffuse = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunSpecular = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunDir = C3Vector(0.0f, 0.0f, 0.0f);
// VERIFY: 5e9baa29 auto
this->m_fogColor = C3Vector(0.0f, 0.0f, 0.0f);
this->m_liquidPlane.n.x = 0.0f;
this->m_liquidPlane.n.y = 0.0f;
@@ -7784,3 +7783,79 @@ int32_t CM2Model::Initialize(CM2Scene* scene, CM2Shared* shared, CM2Model* sourc
return this->m_shared->CallbackWhenLoaded(this);
}
// VERIFY: 767a1eb1 auto
// OFFSET: 0x004D8630
void CM2Model::SetWorldTransform(const C44Matrix& matrix) {
this->m_fFlags |= 0x8000;
this->m_worldTransform = matrix;
}
// VERIFY: 3fa6010f auto
// OFFSET: 0x004E2730
void CM2Lighting::Reset() {
this->m_sunAmbient = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunDiffuse = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunSpecular = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunDir = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector18 = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector24 = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector30 = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector3C = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector48 = C3Vector(0.0f, 0.0f, 0.0f);
}
// VERIFY: 56d2a807 auto
// OFFSET: 0x004F5E20
CAaBox CM2Model::GetBoundingBox() {
if (!(this->m_shared->m_flags & 1)) {
this->WaitForLoad(nullptr);
}
return this->m_shared->m_data->m_bounds.m_extent;
}
// VERIFY: d8b44604 manual
// OFFSET: 0x004F5E80
CAaSphere CM2Model::GetBoundingSphere() {
if (!(this->m_shared->m_flags & 1)) {
this->WaitForLoad(nullptr);
}
const M2Bounds& bounds = this->m_shared->m_data->m_bounds;
CAaSphere sphere = { C3Vector((bounds.m_extent.b.x + bounds.m_extent.t.x) * 0.5f, (bounds.m_extent.b.y + bounds.m_extent.t.y) * 0.5f, (bounds.m_extent.b.z + bounds.m_extent.t.z) * 0.5f), bounds.m_radius };
return sphere;
}
// VERIFY: f3350a9a auto
// OFFSET: 0x006F1D20
C44Matrix CM2Model::GetAnimatedWorldTransform() {
this->Animate();
return this->m_matrixF4 * this->m_scene->m_viewInv;
}
// VERIFY: bf5b6c6a manual
// OFFSET: 0x00790440
CM2Lighting::CM2Lighting(const CAaSphere& sphere) {
this->m_sphere4.c.x = 0.0f;
this->m_sphere4.r = 0.0f;
this->m_sphere4.c.y = 0.0f;
this->m_sphere4.c.z = 0.0f;
this->m_vector18 = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector24 = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector30 = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector3C = C3Vector(0.0f, 0.0f, 0.0f);
this->m_vector48 = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunAmbient = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunDiffuse = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunSpecular = C3Vector(0.0f, 0.0f, 0.0f);
this->m_sunDir = C3Vector(0.0f, 0.0f, 0.0f);
this->m_fogColor = C3Vector(0.0f, 0.0f, 0.0f);
this->m_liquidPlane.n.x = 0.0f;
this->m_liquidPlane.n.y = 0.0f;
this->m_liquidPlane.n.z = 1.0f;
this->m_liquidPlane.d = 0.0f;
this->Initialize(nullptr, sphere);
}
+4
View File
@@ -269,6 +269,9 @@ class CM2Model {
uint32_t GetBoneSequenceId(uint32_t boneId);
int32_t GetBoneSequenceInfo(uint32_t boneId, M2BoneSequenceInfo& info);
float GetBoneSequenceSpeed(uint32_t boneId);
CAaBox GetBoundingBox();
CAaSphere GetBoundingSphere();
C44Matrix GetAnimatedWorldTransform();
CAaBox GetCurrentBoundingBox();
CAaBox GetMaxBoundingBoxPlusAttachments();
CAaSphere GetMaxBoundingSpherePlusAttachments();
@@ -339,6 +342,7 @@ class CM2Model {
void SetLoadedCallback(void (*callback)(CM2Model*, void*), void* arg);
void SetRibbonsEnabled(uint32_t enabled);
void SetSequenceCallback(void* callback, uint64_t param);
void SetWorldTransform(const C44Matrix& matrix);
void SetWorldTransform(const C3Vector& position, float rotation, float scale);
void SetWorldTransform(const C3Vector& position, float rotation, float scale, const C3Vector& up, uint32_t flags);
void UpdateLoaded();