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]>
29 lines
716 B
C++
29 lines
716 B
C++
#include <cstdint>
|
|
#include "Engine/Source/Base/SIMD.h"
|
|
#include "Engine/Source/Storm/H/storm.h"
|
|
|
|
// VERIFY: aaf6c69b auto
|
|
// OFFSET: 0x0083DE50
|
|
void* SIMD::AllocA16(uint32_t size, const char* fileName, int32_t lineNumber) {
|
|
uint8_t* ptr = static_cast<uint8_t*>(SMemAlloc(size + 16, fileName, lineNumber, 0));
|
|
|
|
if (!ptr) {
|
|
return nullptr;
|
|
}
|
|
|
|
uint8_t pad = static_cast<uint8_t>(16 - (reinterpret_cast<uintptr_t>(ptr) & 0xF));
|
|
ptr += pad;
|
|
ptr[-1] = pad;
|
|
|
|
return ptr;
|
|
}
|
|
|
|
// VERIFY: 9b3a75f2 manual
|
|
// OFFSET: 0x0083DE90
|
|
void SIMD::FreeA16(void* ptr) {
|
|
if (ptr) {
|
|
uint8_t* base = static_cast<uint8_t*>(ptr) - static_cast<uint8_t*>(ptr)[-1];
|
|
delete[] base;
|
|
}
|
|
}
|