The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69 lines
1.3 KiB
C++
69 lines
1.3 KiB
C++
#include "classes.h"
|
|
|
|
// 0040c3a0
|
|
undefined4 EntityPtr::Ref()
|
|
{
|
|
undefined4 *in_ECX;
|
|
|
|
return *in_ECX;
|
|
}
|
|
|
|
// 004cf1d0
|
|
void EntityPtr::Set(Entity *entity)
|
|
{
|
|
Entity *newEntity;
|
|
|
|
newEntity = entity;
|
|
if (*this != (EntityPtr)entity) {
|
|
if (*this != (EntityPtr)0x0) {
|
|
entity = GHIDRA_CAST<Entity *>(this);
|
|
std::multiset<unsigned_int>::erase(&entity);
|
|
}
|
|
*this = (EntityPtr)newEntity;
|
|
if (newEntity != GHIDRA_CAST<Entity *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(this);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 006b5b50
|
|
void EntityPtr::SetReference(EntityPtr *ptr, Entity *entity)
|
|
{
|
|
EntityPtr *local_8;
|
|
|
|
local_8 = ptr;
|
|
if (*ptr != (EntityPtr)0x0) {
|
|
std::multiset<unsigned_int>::erase(&local_8);
|
|
}
|
|
*ptr = (EntityPtr)entity;
|
|
if (entity != GHIDRA_CAST<Entity *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(ptr);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00872050
|
|
void EntityPtr::SetReference(Entity *entity)
|
|
{
|
|
EntityPtr *selfKey;
|
|
|
|
if (*this != (EntityPtr)0x0) {
|
|
selfKey = this;
|
|
std::multiset<unsigned_int>::erase(&selfKey);
|
|
}
|
|
*this = (EntityPtr)entity;
|
|
if (entity != GHIDRA_CAST<Entity *>(0x0)) {
|
|
std::multiset<unsigned_int>::insert(this);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00a0fe80
|
|
EntityPtr * EntityPtr::clear()
|
|
{
|
|
this[1] = (EntityPtr)0x0;
|
|
*this = (EntityPtr)0x0;
|
|
return this;
|
|
}
|