Restore translation-unit ownership and publish verified source corrections
Owner-authorized source migration: 31 helper-only translation units were merged into their callers or existing inline headers; both build manifests updated. Includes the preserved source payload, Lua configuration matching wowdecomp, and exact malloca expansion without diagnostic pragmas. 449 native units compiled locally and 449 staged units compiled by the pinned server toolchain. No previously byte-matched function regressed. Compiler mapping diagnostics remain recorded as needs_cleanup, not accepted or peer-confirmed. Existing independent review records are preserved. README.md is intentionally unchanged.
This commit is contained in:
parent
3c939f1cdd
commit
e168b4e4a6
326 changed files with 9538 additions and 3481 deletions
|
|
@ -2,13 +2,18 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
// OFFSET: 0x005B9E50
|
||||
// FUNCTION: fn_03440
|
||||
// INLINED
|
||||
inline NRecycleObject::NRecycleObject(std::string poolName) : m_poolName(std::move(poolName)) {
|
||||
}
|
||||
|
||||
// INLINED
|
||||
inline NRecycleObject::~NRecycleObject() = default;
|
||||
|
||||
// INLINED
|
||||
NAsyncWork::NAsyncWork(std::string poolName) : NRecycleObject(std::move(poolName)), m_group(0), m_key(0) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x005BA4F0
|
||||
// FUNCTION: fn_03443
|
||||
// INLINED
|
||||
NAsyncWork::~NAsyncWork() = default;
|
||||
|
||||
// OFFSET: 0x005BAEE0
|
||||
|
|
@ -38,9 +43,8 @@ NAsyncWorkPtr::NAsyncWorkPtr(NRecycleObjectPoolMgr* manager, std::string poolNam
|
|||
}
|
||||
|
||||
// OFFSET: 0x00731B50
|
||||
// FUNCTION: fn_07561
|
||||
// OFFSET: 0x00731BD0
|
||||
// FUNCTION: fn_07562
|
||||
// FUNCTION: fn_07561
|
||||
NAsyncWorkPtr::~NAsyncWorkPtr() {
|
||||
if (this->m_work) {
|
||||
this->m_manager->Release(this->m_work->PoolName(), this->m_work);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public:
|
|||
virtual bool Execute();
|
||||
virtual void Complete();
|
||||
|
||||
// INLINED
|
||||
std::pair<std::uint32_t, std::uint32_t> GroupKey() const {
|
||||
return {m_group, m_key};
|
||||
}
|
||||
|
|
@ -26,6 +27,7 @@ public:
|
|||
NAsyncWorkPtr(NRecycleObjectPoolMgr* manager, std::string poolName);
|
||||
virtual ~NAsyncWorkPtr();
|
||||
|
||||
// INLINED
|
||||
NAsyncWork* Get() const {
|
||||
return this->m_work;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,8 @@ NAsyncWorkMgr::NAsyncWorkMgr(std::uint32_t workers) : m_enabled(false), m_worker
|
|||
}
|
||||
|
||||
// OFFSET: 0x00731530
|
||||
// FUNCTION: fn_07549
|
||||
// OFFSET: 0x007315F0
|
||||
// FUNCTION: fn_07550
|
||||
// FUNCTION: fn_07549
|
||||
NAsyncWorkMgr::~NAsyncWorkMgr() {
|
||||
for (auto worker = this->m_workers.begin(); worker != this->m_workers.end(); ++worker) {
|
||||
(*worker)->Stop();
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ NAsyncWorkRequestQueue::NAsyncWorkRequestQueue() : m_waiting(0), m_semaphore(nul
|
|||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00732140
|
||||
// FUNCTION: fn_07567
|
||||
// INLINED
|
||||
NAsyncWorkRequestQueue::~NAsyncWorkRequestQueue() {
|
||||
if (this->m_semaphore) {
|
||||
CloseHandle(this->m_semaphore);
|
||||
|
|
@ -91,8 +90,7 @@ NAsyncWorkResponseQueue::NAsyncWorkResponseQueue() : m_enabled(false) {
|
|||
this->m_enabled = true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x007326C0
|
||||
// FUNCTION: fn_07573
|
||||
// INLINED
|
||||
NAsyncWorkResponseQueue::~NAsyncWorkResponseQueue() {
|
||||
DeleteCriticalSection(&this->m_criticalSection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,8 @@ NAsyncWorkThread::NAsyncWorkThread(NAsyncWorkRequestQueue* requests, NAsyncWorkR
|
|||
}
|
||||
|
||||
// OFFSET: 0x00732A80
|
||||
// FUNCTION: fn_07577
|
||||
// OFFSET: 0x00732B40
|
||||
// FUNCTION: fn_07581
|
||||
// FUNCTION: fn_07577
|
||||
NAsyncWorkThread::~NAsyncWorkThread() {
|
||||
g_messageMgr->Unregister(this->m_objectId, static_cast<NInter*>(this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,18 +8,15 @@
|
|||
NMessageMgr* g_messageMgr;
|
||||
|
||||
// OFFSET: 0x00732BF0
|
||||
// FUNCTION: fn_07582
|
||||
NInter::~NInter() = default;
|
||||
|
||||
// OFFSET: 0x007359A0
|
||||
// FUNCTION: fn_07610
|
||||
// INLINED
|
||||
NMessageMgr::NMessageMgr() : m_enabled(false) {
|
||||
InitializeCriticalSection(&this->m_criticalSection);
|
||||
this->m_enabled = true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00735920
|
||||
// FUNCTION: fn_07609
|
||||
// INLINED
|
||||
NMessageMgr::~NMessageMgr() {
|
||||
DeleteCriticalSection(&this->m_criticalSection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "Utility/Threading/NSyncObject.h"
|
||||
|
||||
// OFFSET: 0x00736340
|
||||
// FUNCTION: fn_07619
|
||||
NMessageQueue::NMessageQueue() : m_semaphore(nullptr), m_enabled(false) {
|
||||
InitializeCriticalSection(&this->m_criticalSection);
|
||||
|
||||
|
|
@ -12,9 +13,8 @@ NMessageQueue::NMessageQueue() : m_semaphore(nullptr), m_enabled(false) {
|
|||
}
|
||||
|
||||
// OFFSET: 0x00736460
|
||||
// FUNCTION: fn_07620
|
||||
// OFFSET: 0x007364F0
|
||||
// FUNCTION: fn_07621
|
||||
// FUNCTION: fn_07620
|
||||
NMessageQueue::~NMessageQueue() {
|
||||
if (this->m_semaphore) {
|
||||
CloseHandle(this->m_semaphore);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ NObject::NObject() : m_objectId(++s_nextObjectId) {
|
|||
}
|
||||
|
||||
// OFFSET: 0x007369D0
|
||||
// FUNCTION: fn_07629
|
||||
// OFFSET: 0x007369E0
|
||||
// FUNCTION: fn_07630
|
||||
// FUNCTION: fn_07629
|
||||
NObject::~NObject() = default;
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
#include "Utility/Async/NRecycleObject.h"
|
||||
|
||||
// OFFSET: 0x005B9E50
|
||||
// FUNCTION: fn_03440
|
||||
NRecycleObject::NRecycleObject(std::string poolName) : m_poolName(std::move(poolName)) {
|
||||
}
|
||||
|
||||
// OFFSET: 0x005BA560
|
||||
// FUNCTION: fn_03444
|
||||
NRecycleObject::~NRecycleObject() = default;
|
||||
|
||||
// OFFSET: 0x005782C0
|
||||
// FUNCTION: fn_02551
|
||||
NRecycleObjectPoolInter::~NRecycleObjectPoolInter() = default;
|
||||
|
|
@ -35,6 +35,9 @@ public:
|
|||
virtual ~NRecycleObjectPoolInter();
|
||||
};
|
||||
|
||||
// OFFSET: 0x005782C0
|
||||
inline NRecycleObjectPoolInter::~NRecycleObjectPoolInter() = default;
|
||||
|
||||
template <class T> class NRecycleObjectPool : public NRecycleObjectPoolInter {
|
||||
public:
|
||||
// OFFSET: 0x00575AC0
|
||||
|
|
@ -44,8 +47,7 @@ public:
|
|||
this->m_enabled = true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x005775F0
|
||||
// FUNCTION: fn_02536
|
||||
// INLINED
|
||||
~NRecycleObjectPool() override {
|
||||
for (T* object : this->m_objects) {
|
||||
delete object;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "Utility/Async/NRecycleObjectPoolMgr.h"
|
||||
|
||||
// OFFSET: 0x00736A10
|
||||
// FUNCTION: fn_07631
|
||||
// INLINED
|
||||
std::size_t NRecycleObjectPoolMgr::NameHash::operator()(const std::string& name) const {
|
||||
std::uint32_t hash = 2166136261;
|
||||
|
||||
|
|
@ -26,11 +25,12 @@ NRecycleObjectPoolMgr::NRecycleObjectPoolMgr() : m_enabled(false) {
|
|||
}
|
||||
|
||||
// OFFSET: 0x00736DE0
|
||||
// FUNCTION: fn_07635
|
||||
// OFFSET: 0x00736E50
|
||||
// FUNCTION: fn_07635
|
||||
NRecycleObjectPoolMgr::~NRecycleObjectPoolMgr() = default;
|
||||
|
||||
// OFFSET: 0x00736EE0
|
||||
// FUNCTION: fn_07637
|
||||
NRecycleObject* NRecycleObjectPoolMgr::Acquire(std::string poolName) {
|
||||
auto pool = this->m_pools.find(poolName);
|
||||
if (pool == this->m_pools.end()) {
|
||||
|
|
@ -41,6 +41,7 @@ NRecycleObject* NRecycleObjectPoolMgr::Acquire(std::string poolName) {
|
|||
}
|
||||
|
||||
// OFFSET: 0x00736F60
|
||||
// FUNCTION: fn_07638
|
||||
void NRecycleObjectPoolMgr::Release(std::string poolName, NRecycleObject* object) {
|
||||
auto pool = this->m_pools.find(poolName);
|
||||
if (pool != this->m_pools.end()) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
namespace {
|
||||
// OFFSET: 0x00AFA440
|
||||
// FUNCTION: fn_18290
|
||||
|
||||
int Scan(const char* text, std::size_t bytes, const char* format, ...) {
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <cmath>
|
||||
|
||||
namespace {
|
||||
// INLINED
|
||||
float Length(float squared) {
|
||||
return std::sqrt(squared);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@
|
|||
#include <bit>
|
||||
#include <cstring>
|
||||
|
||||
namespace {
|
||||
// STATIC: 0x01312438
|
||||
// GLOBAL: gl_21913
|
||||
constexpr float identity[12] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0};
|
||||
// STATIC: 0x01312438
|
||||
// GLOBAL: gl_21913
|
||||
const float g_identityMatrix[12] = {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0};
|
||||
|
||||
namespace {
|
||||
// INLINED
|
||||
void Rotate(float* values, const float* rotation) {
|
||||
for (unsigned row = 0; row < 4; ++row) {
|
||||
const float x = values[row * 3];
|
||||
|
|
@ -24,8 +25,9 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
// INLINED
|
||||
void AffineMatrix::Identity() {
|
||||
std::memcpy(this->values, identity, sizeof(identity));
|
||||
std::memcpy(this->values, g_identityMatrix, sizeof(g_identityMatrix));
|
||||
}
|
||||
|
||||
// OFFSET: 0x00555360
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef RAGNAROK_SOURCE_UTILITY_MATH_AFFINEMATRIX_H
|
||||
#define RAGNAROK_SOURCE_UTILITY_MATH_AFFINEMATRIX_H
|
||||
|
||||
extern const float g_identityMatrix[12];
|
||||
|
||||
float ClientSin(float radians);
|
||||
float ClientCos(float radians);
|
||||
float ClientRadians(int degrees);
|
||||
|
|
|
|||
|
|
@ -3,18 +3,17 @@
|
|||
#include <bit>
|
||||
#include <cmath>
|
||||
|
||||
// INLINED
|
||||
float ClientSin(float radians) {
|
||||
return std::sin(radians);
|
||||
}
|
||||
|
||||
// INLINED
|
||||
float ClientCos(float radians) {
|
||||
return std::cos(radians);
|
||||
}
|
||||
|
||||
namespace {
|
||||
// OFFSET: 0x00554280
|
||||
// FUNCTION: fn_02021
|
||||
|
||||
struct AngleTables {
|
||||
float radians[361];
|
||||
float negativeRadians[361];
|
||||
|
|
@ -23,6 +22,7 @@ namespace {
|
|||
float cosine[361];
|
||||
float negativeCosine[361];
|
||||
|
||||
// INLINED
|
||||
AngleTables() {
|
||||
for (int index = 0; index <= 360; ++index) {
|
||||
const float angle = (static_cast<float>(index) / 180.0f) * 3.141592f;
|
||||
|
|
@ -38,6 +38,7 @@ namespace {
|
|||
|
||||
const AngleTables tables;
|
||||
|
||||
// INLINED
|
||||
int Wrapped(int degrees) {
|
||||
return degrees > 360 || degrees < -360 ? degrees % 360 : degrees;
|
||||
}
|
||||
|
|
|
|||
13
Source/Utility/StackAlloc.h
Normal file
13
Source/Utility/StackAlloc.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef RAGNAROK_SOURCE_UTILITY_STACKALLOC_H
|
||||
#define RAGNAROK_SOURCE_UTILITY_STACKALLOC_H
|
||||
|
||||
#include <malloc.h>
|
||||
|
||||
#define STACK_ALLOC(size) \
|
||||
(_MallocaComputeSize(size) != 0 \
|
||||
? (((_MallocaComputeSize(size) <= _ALLOCA_S_THRESHOLD) \
|
||||
? _MarkAllocaS(_alloca(_MallocaComputeSize(size)), _ALLOCA_S_STACK_MARKER) \
|
||||
: _MarkAllocaS(malloc(_MallocaComputeSize(size)), _ALLOCA_S_HEAP_MARKER))) \
|
||||
: NULL)
|
||||
|
||||
#endif
|
||||
|
|
@ -26,10 +26,12 @@ int StringFormat(char* buffer, std::size_t sizeInBytes, std::size_t count, const
|
|||
namespace {
|
||||
class ThreadSafeBuffer {
|
||||
public:
|
||||
// FUNCTION: fn_07592
|
||||
ThreadSafeBuffer() {
|
||||
InitializeCriticalSection(&this->m_criticalSection);
|
||||
}
|
||||
|
||||
// INLINED
|
||||
virtual ~ThreadSafeBuffer() {
|
||||
DeleteCriticalSection(&this->m_criticalSection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#include "Utility/Threading/CSyncObject.h"
|
||||
|
||||
CSyncObject::CSyncObject(CRITICAL_SECTION* criticalSection) : m_criticalSection(criticalSection) {
|
||||
EnterCriticalSection(this->m_criticalSection);
|
||||
}
|
||||
|
||||
// OFFSET: 0x00AEE560
|
||||
// FUNCTION: fn_18172
|
||||
CSyncObject::~CSyncObject() {
|
||||
LeaveCriticalSection(this->m_criticalSection);
|
||||
}
|
||||
|
|
@ -12,6 +12,16 @@ private:
|
|||
CRITICAL_SECTION* m_criticalSection;
|
||||
};
|
||||
|
||||
// INLINED
|
||||
inline CSyncObject::CSyncObject(CRITICAL_SECTION* criticalSection) : m_criticalSection(criticalSection) {
|
||||
EnterCriticalSection(this->m_criticalSection);
|
||||
}
|
||||
|
||||
// INLINED
|
||||
inline CSyncObject::~CSyncObject() {
|
||||
LeaveCriticalSection(this->m_criticalSection);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(CSyncObject) == 8);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@ NSyncObject::NSyncObject(CRITICAL_SECTION* criticalSection) : m_criticalSection(
|
|||
}
|
||||
|
||||
// OFFSET: 0x00737150
|
||||
// FUNCTION: fn_07641
|
||||
// OFFSET: 0x007371A0
|
||||
// FUNCTION: fn_07642
|
||||
// FUNCTION: fn_07641
|
||||
NSyncObject::~NSyncObject() {
|
||||
LeaveCriticalSection(this->m_criticalSection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
namespace {
|
||||
// OFFSET: 0x00737510
|
||||
|
||||
// FUNCTION: fn_07647
|
||||
void SetDebuggerThreadName(unsigned id, const char* name) {
|
||||
ULONG_PTR arguments[4] = {0x1000, reinterpret_cast<ULONG_PTR>(name), id, 0};
|
||||
__try {
|
||||
|
|
@ -21,14 +21,14 @@ NThread::NThread(std::string name) : m_threadId(0), unknown_0008(true), m_state(
|
|||
}
|
||||
|
||||
// OFFSET: 0x00737290
|
||||
// FUNCTION: fn_07644
|
||||
// OFFSET: 0x00737350
|
||||
// FUNCTION: fn_07645
|
||||
// FUNCTION: fn_07644
|
||||
NThread::~NThread() {
|
||||
this->Stop();
|
||||
}
|
||||
|
||||
// OFFSET: 0x007375C0
|
||||
// FUNCTION: fn_07648
|
||||
unsigned __stdcall NThread::Entry(void* parameter) {
|
||||
NThread* thread = static_cast<NThread*>(parameter);
|
||||
unsigned result = thread->Run();
|
||||
|
|
@ -37,7 +37,7 @@ unsigned __stdcall NThread::Entry(void* parameter) {
|
|||
return result;
|
||||
}
|
||||
|
||||
// ORIGINAL_SITE: 0x00737420 in fn_07585 (fragment)
|
||||
// INLINED
|
||||
bool NThread::Start() {
|
||||
if (this->m_handle || this->m_state) {
|
||||
return false;
|
||||
|
|
@ -55,7 +55,7 @@ bool NThread::Start() {
|
|||
return true;
|
||||
}
|
||||
|
||||
// ORIGINAL_SITE: 0x00737480 in fn_07586 (fragment)
|
||||
// INLINED
|
||||
void NThread::Stop() {
|
||||
switch (this->m_state) {
|
||||
case 2:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue