Files
wowdecomp/Engine/Source/Base/Handle.cpp
T
SatyandClaude Opus 5.5 cb9f7f4ac7 Base/Event: cover HandleCompare and the remaining destructors
HandleCompare (0x47BF20): the ICF-folded 4-byte handle difference that the
M2 scene sorts, CSimpleTexture and CDetailDoodadInst call. ~TRefCnt now
names its scalar deleting destructor (0x480E40), ~CDataRecycler adds
0x95CE00, and TSHashObject gets its destructor (0x47C560, the HASHKEY_STR
instance). Event is 88/88, Base 122/123 (the s_callbackRegAllocator atexit
thunk stays compiler-generated).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-27 01:13:36 +02:00

67 lines
1.3 KiB
C++

#include <cstdint>
#include "Engine/Source/Base/Handle.h"
#include "Engine/Source/Storm/H/storm.h"
// INLINED
CHandleObject::CHandleObject() {
this->m_refcount = 0;
}
// INLINED
CHandleObject::~CHandleObject() {
}
// INLINED
const char* CHandleObject::GetObjectName() {
return nullptr;
}
// VERIFY: baa00fb6 auto
// OFFSET: 0x0047BF20
int32_t HandleCompare(HOBJECT a, HOBJECT b) {
return static_cast<int32_t>(a - b);
}
// VERIFY: 436d38d9 manual
// OFFSET: 0x0047BF30
void HandleClose(HOBJECT handle) {
CHandleObject* object = HandleDereference(handle);
if (object->m_refcount-- == 1) {
delete object;
}
}
// VERIFY: 96ec39c1 auto
// OFFSET: 0x0047BF50
HOBJECT HandleCreate(CHandleObject* ptr, const char* handleName) {
if (!ptr) {
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
return nullptr;
}
ptr->m_refcount++;
return reinterpret_cast<HOBJECT>(ptr);
}
// INLINED
CHandleObject* HandleDereference(HOBJECT handle) {
return reinterpret_cast<CHandleObject*>(handle);
}
// VERIFY: 1d1aba75 manual
// OFFSET: 0x0047BF70
HOBJECT HandleDuplicate(HOBJECT handle) {
if (handle) {
HandleDereference(handle)->m_refcount++;
}
return handle;
}
void HandleDestroy() {
}
void HandleInitialize() {
}