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>
198 lines
6.2 KiB
C++
198 lines
6.2 KiB
C++
#include "classes.h"
|
|
|
|
// 009c25e0
|
|
MessagePopup::MessagePopup(void *font, void *callback, void *userData, Vector *position)
|
|
{
|
|
float posY;
|
|
|
|
*GHIDRA_CAST<undefined1 *>(this) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 8)) = 0x41c80000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0xc)) = 0x41700000;
|
|
*(void **)(GHIDRA_CAST<char *>(this) + 4) = font;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x10)) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x14)) = 2;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x18)) = 3;
|
|
posY = position->y;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x1c)) = position->x;
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this) + 0x20)) = posY;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x28)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x24)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x2c)) = 0x3f000000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x30)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x34)) = 1;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x38)) = 0x3f800000;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x3c)) = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((GHIDRA_INT(this) + 0x40)))))->KColor::SetFromARGB(0xffffffff);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x54)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x58)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x5c)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x60)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 100)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x68)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x6c)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x70)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x74)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x78)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x7c)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x80)) = 0;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x84)) = 0xffffffff;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(this) + 0x88)) = 0xffffffff;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((GHIDRA_INT(this) + 0x8c)))))->KColor::SetFromARGB(0xffd3d3d3);
|
|
*GHIDRA_CAST<byte *>(this) = *GHIDRA_CAST<byte *>(this) | 7;
|
|
*(void **)(GHIDRA_CAST<char *>(this) + 0x7c) = callback;
|
|
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(this) + 0xa0)) = 1;
|
|
*(void **)(GHIDRA_CAST<char *>(this) + 0x80) = userData;
|
|
return;
|
|
}
|
|
|
|
// 009c3b70
|
|
void MessagePopup::add_blank_footer(byte *headerText, byte *messageText, void *popup)
|
|
{
|
|
undefined4 popupLine;
|
|
byte *pbStack_34;
|
|
undefined4 local_30;
|
|
undefined4 local_2c;
|
|
undefined4 local_28;
|
|
undefined4 uStack_24;
|
|
undefined4 uStack_20;
|
|
undefined4 uStack_1c;
|
|
undefined4 local_18;
|
|
float local_14;
|
|
float local_10;
|
|
undefined4 local_c;
|
|
|
|
local_28 = 0x3e5cdcdd;
|
|
uStack_24 = 0x3e2cacad;
|
|
uStack_20 = 0x3e34b4b5;
|
|
uStack_1c = 0x3f800000;
|
|
local_14 = g_vectorZero.x;
|
|
popupLine = 0;
|
|
local_30 = 0xffffffff;
|
|
local_2c = 0xffffffff;
|
|
local_18 = 0;
|
|
local_10 = g_vectorZero.y;
|
|
local_c = 1;
|
|
pbStack_34 = headerText;
|
|
std::vector<48byte>::push_back(&popupLine);
|
|
popupLine = 0;
|
|
local_30 = 0xffffffff;
|
|
local_2c = 0xffffffff;
|
|
local_28 = 0x3e5cdcdd;
|
|
uStack_24 = 0x3e2cacad;
|
|
uStack_20 = 0x3e34b4b5;
|
|
uStack_1c = 0x3f800000;
|
|
local_18 = 0;
|
|
local_14 = 0.0;
|
|
local_10 = 20.0;
|
|
local_c = 1;
|
|
pbStack_34 = messageText;
|
|
std::vector<48byte>::push_back(&popupLine);
|
|
return;
|
|
}
|
|
|
|
// 009c3c30
|
|
void MessagePopup::add_ok_button(byte *text, void *popupDesc)
|
|
{
|
|
undefined4 entry;
|
|
byte *entryText;
|
|
undefined4 local_30;
|
|
undefined4 local_2c;
|
|
undefined4 entryColor;
|
|
undefined4 uStack_24;
|
|
undefined4 uStack_20;
|
|
undefined4 uStack_1c;
|
|
undefined4 local_18;
|
|
float entryOffsetX;
|
|
float entryOffsetY;
|
|
undefined4 local_c;
|
|
|
|
entryColor = 0x3e5cdcdd;
|
|
uStack_24 = 0x3e2cacad;
|
|
uStack_20 = 0x3e34b4b5;
|
|
uStack_1c = 0x3f800000;
|
|
entryOffsetX = g_vectorZero.x;
|
|
entry = 0;
|
|
local_30 = 0xffffffff;
|
|
local_2c = 0xffffffff;
|
|
local_18 = 0;
|
|
entryOffsetY = g_vectorZero.y;
|
|
local_c = 1;
|
|
entryText = text;
|
|
std::vector<48byte>::push_back(&entry);
|
|
entry = 0;
|
|
entryText = GHIDRA_CAST<byte *>(0xb7ed98);
|
|
local_30 = 0;
|
|
local_2c = 0xffffffff;
|
|
entryColor = 0x3e5cdcdd;
|
|
uStack_24 = 0x3e2cacad;
|
|
uStack_20 = 0x3e34b4b5;
|
|
uStack_1c = 0x3f800000;
|
|
local_18 = 0;
|
|
entryOffsetX = 0.0;
|
|
entryOffsetY = 35.0;
|
|
local_c = 1;
|
|
std::vector<48byte>::push_back(&entry);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(popupDesc) + 0x84)) = 0;
|
|
return;
|
|
}
|
|
|
|
// 009c3d10
|
|
void MessagePopup::add_yes_no_buttons(byte *message, void *popup)
|
|
{
|
|
undefined4 entry;
|
|
byte *entryText;
|
|
undefined4 entryId;
|
|
undefined4 local_2c;
|
|
undefined4 entryColor;
|
|
undefined4 uStack_24;
|
|
undefined4 uStack_20;
|
|
undefined4 uStack_1c;
|
|
undefined4 local_18;
|
|
float entryOffsetX;
|
|
float entryOffsetY;
|
|
undefined4 local_c;
|
|
|
|
entryColor = 0x3e5cdcdd;
|
|
uStack_24 = 0x3e2cacad;
|
|
uStack_20 = 0x3e34b4b5;
|
|
uStack_1c = 0x3f800000;
|
|
entryOffsetX = g_vectorZero.x;
|
|
entry = 0;
|
|
entryId = 0xffffffff;
|
|
local_2c = 0xffffffff;
|
|
local_18 = 0;
|
|
entryOffsetY = g_vectorZero.y;
|
|
local_c = 1;
|
|
entryText = message;
|
|
std::vector<48byte>::push_back(&entry);
|
|
entry = 0;
|
|
entryText = GHIDRA_CAST<byte *>(0xb7edac);
|
|
entryId = 1;
|
|
local_2c = 0xffffffff;
|
|
entryColor = 0x3e5cdcdd;
|
|
uStack_24 = 0x3e2cacad;
|
|
uStack_20 = 0x3e34b4b5;
|
|
uStack_1c = 0x3f800000;
|
|
local_18 = 0;
|
|
entryOffsetX = 0.0;
|
|
entryOffsetY = 35.0;
|
|
local_c = 1;
|
|
std::vector<48byte>::push_back(&entry);
|
|
entryColor = 0x3e5cdcdd;
|
|
uStack_24 = 0x3e2cacad;
|
|
uStack_20 = 0x3e34b4b5;
|
|
uStack_1c = 0x3f800000;
|
|
entry = 0;
|
|
entryOffsetX = g_vectorZero.x;
|
|
entryText = GHIDRA_CAST<byte *>(0xb7edc0);
|
|
entryId = 2;
|
|
local_2c = 0xffffffff;
|
|
local_18 = 0;
|
|
entryOffsetY = g_vectorZero.y;
|
|
local_c = 1;
|
|
std::vector<48byte>::push_back(&entry);
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(popup) + 0x84)) = 2;
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(popup) + 0x88)) = 1;
|
|
return;
|
|
}
|