Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
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>
This commit is contained in:
1 parent
2ff2d5d87f
commit
3ce74c6e2d
331 files changed
+485
-7835
No files matched your search
@@ -0,0 +1,123 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 005cd690
|
||||
void TearParams::constructor()
|
||||
{
|
||||
this->_tearVariant = 0;
|
||||
this->_bombVariant = 0;
|
||||
(this->_tearColor)._tint[0] = 1.0;
|
||||
(this->_tearColor)._tint[1] = 1.0;
|
||||
(this->_tearColor)._tint[2] = 1.0;
|
||||
(this->_tearColor)._tint[3] = 1.0;
|
||||
(this->_tearColor)._colorize[0] = 0.0;
|
||||
(this->_tearColor)._colorize[1] = 0.0;
|
||||
(this->_tearColor)._colorize[2] = 0.0;
|
||||
(this->_tearColor)._colorize[3] = 0.0;
|
||||
(this->_tearColor)._offset[0] = 0.0;
|
||||
(this->_tearColor)._offset[1] = 0.0;
|
||||
(this->_tearColor)._offset[2] = 0.0;
|
||||
*GHIDRA_CAST<undefined4 *>(&(this->_flags)._l) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_flags)._l) + 4)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>(&(this->_flags)._h) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_flags)._h) + 4)) = 0;
|
||||
this->_tearDamage = 3.5;
|
||||
this->_tearScale = 1.0;
|
||||
this->_tearHeight = -23.75;
|
||||
this[1]._tearVariant = 0x3f800000;
|
||||
this[1]._bombVariant = 0x3fd9999a;
|
||||
this[1]._tearColor._tint[0] = 1.0;
|
||||
this[1]._tearColor._tint[1] = 0.0;
|
||||
return;
|
||||
}
|
||||
|
||||
// 006075a0
|
||||
TearParams * TearParams::operator_(TearParams *other)
|
||||
{
|
||||
float fVar1;
|
||||
float fVar2;
|
||||
float fVar3;
|
||||
undefined4 uVar4;
|
||||
undefined4 uVar5;
|
||||
qword qVar6;
|
||||
|
||||
this->_tearVariant = other->_tearVariant;
|
||||
this->_bombVariant = other->_bombVariant;
|
||||
if (&this->_tearColor != &other->_tearColor) {
|
||||
fVar1 = (other->_tearColor)._tint[1];
|
||||
fVar2 = (other->_tearColor)._tint[2];
|
||||
fVar3 = (other->_tearColor)._tint[3];
|
||||
(this->_tearColor)._tint[0] = (other->_tearColor)._tint[0];
|
||||
(this->_tearColor)._tint[1] = fVar1;
|
||||
(this->_tearColor)._tint[2] = fVar2;
|
||||
(this->_tearColor)._tint[3] = fVar3;
|
||||
fVar1 = (other->_tearColor)._colorize[1];
|
||||
fVar2 = (other->_tearColor)._colorize[2];
|
||||
fVar3 = (other->_tearColor)._colorize[3];
|
||||
(this->_tearColor)._colorize[0] = (other->_tearColor)._colorize[0];
|
||||
(this->_tearColor)._colorize[1] = fVar1;
|
||||
(this->_tearColor)._colorize[2] = fVar2;
|
||||
(this->_tearColor)._colorize[3] = fVar3;
|
||||
*GHIDRA_CAST<undefined8 *>((this->_tearColor)._offset) = *GHIDRA_CAST<undefined8 *>((other->_tearColor)._offset);
|
||||
(this->_tearColor)._offset[2] = (other->_tearColor)._offset[2];
|
||||
}
|
||||
uVar4 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(other->_flags)._l) + 4));
|
||||
qVar6 = (other->_flags)._h;
|
||||
uVar5 = *GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(other->_flags)._h) + 4));
|
||||
*GHIDRA_CAST<int *>(&(this->_flags)._l) = GHIDRA_INT((other->_flags)._l);
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_flags)._l) + 4)) = uVar4;
|
||||
*GHIDRA_CAST<int *>(&(this->_flags)._h) = GHIDRA_INT(qVar6);
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_flags)._h) + 4)) = uVar5;
|
||||
this->_tearDamage = other->_tearDamage;
|
||||
this->_tearScale = other->_tearScale;
|
||||
this->_tearHeight = other->_tearHeight;
|
||||
this[1]._tearVariant = other[1]._tearVariant;
|
||||
this[1]._bombVariant = other[1]._bombVariant;
|
||||
this[1]._tearColor._tint[0] = other[1]._tearColor._tint[0];
|
||||
this[1]._tearColor._tint[1] = other[1]._tearColor._tint[1];
|
||||
return this;
|
||||
}
|
||||
|
||||
// 0065b490
|
||||
void TearParams::copy(void *other)
|
||||
{
|
||||
float fVar1;
|
||||
float fVar2;
|
||||
float fVar3;
|
||||
undefined4 uVar4;
|
||||
undefined4 uVar5;
|
||||
undefined4 uVar6;
|
||||
|
||||
this->_tearVariant = *GHIDRA_CAST<int *>(other);
|
||||
this->_bombVariant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 4));
|
||||
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0xc));
|
||||
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x10));
|
||||
fVar3 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x14));
|
||||
(this->_tearColor)._tint[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 8));
|
||||
(this->_tearColor)._tint[1] = fVar1;
|
||||
(this->_tearColor)._tint[2] = fVar2;
|
||||
(this->_tearColor)._tint[3] = fVar3;
|
||||
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x1c));
|
||||
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x20));
|
||||
fVar3 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x24));
|
||||
(this->_tearColor)._colorize[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x18));
|
||||
(this->_tearColor)._colorize[1] = fVar1;
|
||||
(this->_tearColor)._colorize[2] = fVar2;
|
||||
(this->_tearColor)._colorize[3] = fVar3;
|
||||
*GHIDRA_CAST<undefined8 *>((this->_tearColor)._offset) = *GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(other) + 0x28));
|
||||
(this->_tearColor)._offset[2] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x30));
|
||||
uVar4 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(other) + 0x3c));
|
||||
uVar5 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(other) + 0x40));
|
||||
uVar6 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(other) + 0x44));
|
||||
*GHIDRA_CAST<undefined4 *>(&(this->_flags)._l) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(other) + 0x38));
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_flags)._l) + 4)) = uVar4;
|
||||
*GHIDRA_CAST<undefined4 *>(&(this->_flags)._h) = uVar5;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(&(this->_flags)._h) + 4)) = uVar6;
|
||||
this->_tearDamage = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x48));
|
||||
this->_tearScale = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x4c));
|
||||
this->_tearHeight = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x50));
|
||||
this[1]._tearVariant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 0x54));
|
||||
this[1]._bombVariant = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(other) + 0x58));
|
||||
this[1]._tearColor._tint[0] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x5c));
|
||||
this[1]._tearColor._tint[1] = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(other) + 0x60));
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user