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>
75 lines
2.3 KiB
C++
75 lines
2.3 KiB
C++
#include "classes.h"
|
|
|
|
// 00960750
|
|
CutsceneEntry * CutsceneEntry::Constructor()
|
|
{
|
|
*this = (CutsceneEntry)0x0;
|
|
this[1] = (CutsceneEntry)0x0;
|
|
this[5] = (CutsceneEntry)0x0;
|
|
this[6] = (CutsceneEntry)0xf;
|
|
this[7] = (CutsceneEntry)0x0;
|
|
this[8] = (CutsceneEntry)0x0;
|
|
this[9] = (CutsceneEntry)0x0;
|
|
*GHIDRA_CAST<undefined2 *>((this + 10)) = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((this + 0xb)))))->KColor::SetFromARGB(0xff000000);
|
|
this[0x10] = (CutsceneEntry)0xffffffff;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x12])) + 0x1))) = 0;
|
|
return this;
|
|
}
|
|
|
|
// 009607b0
|
|
void CutsceneEntry::Destructor()
|
|
{
|
|
CutsceneEntry elementsBegin;
|
|
CutsceneEntry ptr;
|
|
uint uVar1;
|
|
undefined4 *element;
|
|
|
|
uVar1 = 0;
|
|
elementsBegin = this[7];
|
|
if (GHIDRA_INT(this[8]) - GHIDRA_INT(elementsBegin) >> 2 != 0) {
|
|
do {
|
|
element = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(elementsBegin) + uVar1 * 4));
|
|
if (element != GHIDRA_CAST<undefined4 *>(0x0)) {
|
|
(**(code **)*element)(1);
|
|
}
|
|
uVar1 = uVar1 + 1;
|
|
elementsBegin = this[7];
|
|
} while (uVar1 < GHIDRA_UINT((GHIDRA_INT(this[8]) - GHIDRA_INT(elementsBegin) >> 2)));
|
|
}
|
|
if (elementsBegin != (CutsceneEntry)0x0) {
|
|
uVar1 = GHIDRA_INT(this[9]) - GHIDRA_INT(elementsBegin) & 0xfffffffc;
|
|
ptr = elementsBegin;
|
|
if (0xfff < uVar1) {
|
|
ptr = *GHIDRA_CAST<CutsceneEntry *>((GHIDRA_CAST<char *>(elementsBegin) + -4));
|
|
uVar1 = uVar1 + 0x23;
|
|
if (0x1f < (GHIDRA_INT(elementsBegin) - GHIDRA_INT(ptr)) - 4U) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete((void *)ptr,uVar1);
|
|
this[7] = (CutsceneEntry)0x0;
|
|
this[8] = (CutsceneEntry)0x0;
|
|
this[9] = (CutsceneEntry)0x0;
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 1)))))->std::string::_Tidy_deallocate();
|
|
return;
|
|
}
|
|
|
|
// 00960840
|
|
void CutsceneEntry::Unload()
|
|
{
|
|
uint layerIndex;
|
|
|
|
layerIndex = 0;
|
|
this[0x10] = (CutsceneEntry)0xffffffff;
|
|
if (GHIDRA_INT(this[8]) - GHIDRA_INT(this[7]) >> 2 != 0) {
|
|
do {
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_INT(this[7]) + layerIndex * 4)) + 8))();
|
|
layerIndex = layerIndex + 1;
|
|
} while (layerIndex < GHIDRA_UINT((GHIDRA_INT(this[8]) - GHIDRA_INT(this[7]) >> 2)));
|
|
}
|
|
return;
|
|
}
|