Files
wowdecomp/Engine/Source/Model2/M2Cache.h
T
SatyandClaude Opus 5.5 2203210f2b Model2: port the Model2 TUs
M2Model.cpp, M2Shared.cpp, M2Scene.cpp, CM2SceneRender.cpp, M2Light.cpp,
M2Cache.cpp and the new M2Data.cpp/.h (0x81C000-0x834900). Only the
std::sort internals for CModelBatch stay unported.

AnimationData lookups in ResolveSequenceFallback/SequenceFallbackById use
g_animationDataDB directly: 12340 inlines its record loads into M2Model.cpp.

Shared additions: CParticleEmitter2 vtable order and the plane/sphere/spline
emitters, CRibbonMat, Services/Camera.h, Base/SIMD, Base/ObjectAlloc.h (the
engine-side ObjectAlloc interface), CFacet, CAaRect, CiRange, the C44Matrix
16-float constructor and CMath fequal/fnotequal/FloatToInt64.

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

66 lines
1.8 KiB
C++

#ifndef ENGINE_SOURCE_MODEL2_M2CACHE_H
#define ENGINE_SOURCE_MODEL2_M2CACHE_H
#include <cstddef>
#include <cstdint>
#include "Engine/Source/Base/Prop.h"
#include "Engine/Source/Model2/M2Shared.h"
#include "Engine/Source/Storm/H/stpl.h"
#include "Engine/Source/Storm/Source/SLock.h"
#include "Engine/Source/Storm/Source/SThread.h"
class CM2Scene;
class CM2ModelHeap {
public:
/* 0000 */ uint32_t m_heapId;
void Delete(CM2Model* model);
CM2Model* New();
};
class CM2Cache {
public:
static uint32_t s_processorFeatures;
static uint32_t STORMAPI ThreadProc(void* param);
/* 0000 */ int32_t m_initialized;
/* 0004 */ uint32_t m_flags;
/* 0008 */ CM2Shared* m_freeList;
/* 000C */ CM2Shared** m_freeListTail;
/* 0010 */ CM2Shared* m_shared [1021];
/* 1004 */ SThread m_thread;
/* 1008 */ SEvent m_threadStart;
/* 100C */ SEvent m_threadDone;
/* 1010 */ HPROPCONTEXT m_propContext;
/* 1014 */ void (*m_threadFunc)(void*);
/* 1018 */ void* m_threadParam;
/* 101C */ char unk_101C [64];
/* 105C */ char unk_105C [64];
/* 109C */ uint32_t m_updateTime;
/* 10A0 */ TSExplicitList<CM2Shared, offsetof(CM2Shared, m_updateLink)> m_sharedUpdateList;
CM2Cache();
void BeginThread(void (*func)(void*), void* param);
void ClearSharedHash();
CM2Shared* CreateShared(const char* name, uint32_t flags);
void Destroy();
void GarbageCollect(int32_t force);
int32_t Initialize(uint32_t flags);
void LinkToSharedUpdateList(CM2Shared* shared);
void UpdateShared();
void WaitThread();
};
extern CM2ModelHeap* g_modelPool;
CM2Scene* M2CreateScene();
void M2Destroy();
uint32_t M2GetCacheFlags();
void M2Initialize(uint32_t flags, uint32_t modelCount);
void M2SetCacheFlags(uint32_t flags);
void M2SetGlobalOptFlags(uint32_t flags);
#endif