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,193 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 004252f0
|
||||
void CompletionWidget::Render(Vector *pos, Vector *scale)
|
||||
{
|
||||
AnimationState *animState;
|
||||
|
||||
this[0x28] = (CompletionWidget)scale->x;
|
||||
this[0x29] = (CompletionWidget)scale->y;
|
||||
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x43])) + 0x1))) != '\0') {
|
||||
animState = GHIDRA_CAST<AnimationState *>((this + 0x15));
|
||||
if (*GHIDRA_CAST<char *>((this + 0x1d)) == '\0') {
|
||||
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0xd)),pos,&g_vectorZero,&g_vectorZero);
|
||||
}
|
||||
else {
|
||||
AnimationState::Render(animState,pos,&g_vectorZero,&g_vectorZero);
|
||||
animState = GHIDRA_CAST<AnimationState *>((this + 0xd));
|
||||
}
|
||||
AnimationState::Render(animState,pos,&g_vectorZero,&g_vectorZero);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 008ca2c0
|
||||
void CompletionWidget::Load()
|
||||
{
|
||||
byte bVar1;
|
||||
CompletionWidget currentName;
|
||||
byte *idleName;
|
||||
char *pcVar2;
|
||||
uint uVar3;
|
||||
CompletionWidget *characterAnimData;
|
||||
bool isLess;
|
||||
int characterIndex;
|
||||
std_string menuPath;
|
||||
std_string characterPath;
|
||||
uint local_24;
|
||||
undefined1 *puStack_20;
|
||||
void *local_1c;
|
||||
undefined1 *puStack_18;
|
||||
undefined4 local_14;
|
||||
CompletionWidget animData;
|
||||
|
||||
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
||||
local_14 = 0xffffffff;
|
||||
puStack_18 = &LAB_00af1f85;
|
||||
local_1c = ExceptionList;
|
||||
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
||||
ExceptionList = &local_1c;
|
||||
*GHIDRA_CAST<undefined1 *>(this) = 0;
|
||||
menuPath._size = 0;
|
||||
menuPath._capacity = 0xf;
|
||||
menuPath._buf[0] = '\0';
|
||||
menuPath._buf[1] = '\0';
|
||||
menuPath._buf[2] = '\0';
|
||||
menuPath._buf[3] = '\0';
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(menuPath._buf)) + 0x0))) = std::_Allocate(0x20);
|
||||
menuPath._size = 0x15;
|
||||
menuPath._capacity = 0x1f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuPath._buf))) + 0x0))),"gfx/ui/DeedsMenu.anm2",0x16);
|
||||
local_14 = 0;
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 1)))))->ANM2::Load(&menuPath,1);
|
||||
local_14 = 0xffffffff;
|
||||
if (0xf < menuPath._capacity) {
|
||||
uVar3 = menuPath._capacity + 1;
|
||||
pcVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuPath._buf))) + 0x0)));
|
||||
if (0xfff < uVar3) {
|
||||
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(menuPath._buf)) + 0x0))) + -4));
|
||||
uVar3 = menuPath._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(menuPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
|
||||
LAB_008ca399:
|
||||
local_14 = 0xffffffff;
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pcVar2,uVar3);
|
||||
}
|
||||
animData = this[0xe];
|
||||
if (animData != (CompletionWidget)0x0) {
|
||||
currentName = animData;
|
||||
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
|
||||
currentName = *GHIDRA_CAST<CompletionWidget *>(animData);
|
||||
}
|
||||
idleName = s_Idle;
|
||||
do {
|
||||
bVar1 = *GHIDRA_CAST<byte *>(currentName);
|
||||
isLess = bVar1 < *idleName;
|
||||
if (bVar1 != *idleName) {
|
||||
LAB_008ca3e0:
|
||||
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_008ca3e5;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(currentName) + 1));
|
||||
isLess = bVar1 < idleName[1];
|
||||
if (bVar1 != idleName[1]) goto LAB_008ca3e0;
|
||||
currentName = (CompletionWidget)(GHIDRA_INT(currentName) + 2);
|
||||
idleName = idleName + 2;
|
||||
} while (bVar1 != 0);
|
||||
uVar3 = 0;
|
||||
LAB_008ca3e5:
|
||||
if ((uVar3 == 0) && ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) == 0 || (*GHIDRA_CAST<char *>((this + 0x12)) != '\0')))
|
||||
) goto LAB_008ca419;
|
||||
}
|
||||
bVar1 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 1)))))->ANM2::SetAnimation(s_Idle,1);
|
||||
if (bVar1 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0xd)))))->AnimationState::Rewind();
|
||||
*GHIDRA_CAST<undefined1 *>((this + 0x12)) = 1;
|
||||
}
|
||||
LAB_008ca419:
|
||||
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x43])) + 0x1))) != '\0') {
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0xd)))))->AnimationState::Update();
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x15)))))->AnimationState::Update();
|
||||
}
|
||||
characterIndex = 0;
|
||||
characterAnimData = this + 0x53;
|
||||
do {
|
||||
characterPath._size = 0;
|
||||
characterPath._capacity = 0xf;
|
||||
characterPath._buf[0] = '\0';
|
||||
characterPath._buf[1] = '\0';
|
||||
characterPath._buf[2] = '\0';
|
||||
characterPath._buf[3] = '\0';
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) = std::_Allocate(0x20);
|
||||
characterPath._size = 0x15;
|
||||
characterPath._capacity = 0x1f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(characterPath._buf))) + 0x0))),"gfx/ui/DeedsMenu.anm2",0x16);
|
||||
local_14 = 1;
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((characterAnimData + -0xd)))))->ANM2::Load(&characterPath,1);
|
||||
local_14 = 0xffffffff;
|
||||
if (0xf < characterPath._capacity) {
|
||||
uVar3 = characterPath._capacity + 1;
|
||||
pcVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(characterPath._buf))) + 0x0)));
|
||||
if (0xfff < uVar3) {
|
||||
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) + -4));
|
||||
uVar3 = characterPath._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2)))))
|
||||
goto LAB_008ca399;
|
||||
}
|
||||
operator_delete(pcVar2,uVar3);
|
||||
}
|
||||
animData = *characterAnimData;
|
||||
characterPath._size = 0;
|
||||
characterPath._capacity = 0xf;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) & 0xffffff00;
|
||||
if (animData == (CompletionWidget)0x0) {
|
||||
LAB_008ca543:
|
||||
bVar1 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((characterAnimData + -0xd)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("PlayerCharacter"),1);
|
||||
if (bVar1 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((characterAnimData + -1)))))->AnimationState::Rewind();
|
||||
*GHIDRA_CAST<undefined1 *>((characterAnimData + 4)) = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
currentName = animData;
|
||||
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
|
||||
currentName = *GHIDRA_CAST<CompletionWidget *>(animData);
|
||||
}
|
||||
pcVar2 = "PlayerCharacter";
|
||||
do {
|
||||
bVar1 = *GHIDRA_CAST<byte *>(currentName);
|
||||
isLess = bVar1 < (byte)*pcVar2;
|
||||
if (bVar1 != *pcVar2) {
|
||||
LAB_008ca530:
|
||||
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_008ca535;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(currentName) + 1));
|
||||
isLess = bVar1 < (byte)pcVar2[1];
|
||||
if (bVar1 != pcVar2[1]) goto LAB_008ca530;
|
||||
currentName = (CompletionWidget)(GHIDRA_INT(currentName) + 2);
|
||||
pcVar2 = pcVar2 + 2;
|
||||
} while (bVar1 != 0);
|
||||
uVar3 = 0;
|
||||
LAB_008ca535:
|
||||
if ((uVar3 != 0) ||
|
||||
((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) != 0 && (*GHIDRA_CAST<char *>((characterAnimData + 4)) == '\0'))))
|
||||
goto LAB_008ca543;
|
||||
}
|
||||
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(characterAnimData[0x35])) + 0x1))) != '\0') {
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((characterAnimData + -1)))))->AnimationState::Update();
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((characterAnimData + 7)))))->AnimationState::Update();
|
||||
}
|
||||
characterAnimData = characterAnimData + 0x45;
|
||||
characterIndex = characterIndex + 1;
|
||||
if (3 < characterIndex) {
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
} while( true );
|
||||
}
|
||||
Reference in new issue
Block a user