Files
isaac-port/generated-src/generic_popup.cpp
T
shweetandClaude Opus 5.5 3ce74c6e2d 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>
2026-11-19 21:10:23 -05:00

141 lines
4.8 KiB
C++

#include "classes.h"
// 008372e0
void GenericPopup::Render()
{
byte bVar1;
GenericPopup animName;
int textWidth;
AnimationState *frontAnimState;
byte *idleName;
int line;
GenericPopup *lineText;
bool bVar2;
float y;
float alignFactor;
undefined4 drawSettings;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
Font *font;
float lineOffsetY;
Vector local_1c;
uint local_14;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00b0245d;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
if ((this[0xd] != (GenericPopup)0x0) && (*GHIDRA_CAST<char *>((this + 0x11)) != '\0')) {
font = &g_manager->_font2_TeamMeatEx12;
local_1c.x = (g_screenWidth - 480.0) * 0.5;
local_1c.y = (g_screenHeight - 270.0) * 0.5;
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x42])) + 0x1))) != '\0') {
if (*GHIDRA_CAST<char *>((this + 0x1c)) == '\0') {
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0xc)),&local_1c,&g_vectorZero,&g_vectorZero)
;
frontAnimState = GHIDRA_CAST<AnimationState *>((this + 0x14));
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((this + 0x14)),&local_1c,&g_vectorZero,&g_vectorZero);
frontAnimState = GHIDRA_CAST<AnimationState *>((this + 0xc));
}
AnimationState::Render(frontAnimState,&local_1c,&g_vectorZero,&g_vectorZero);
}
animName = this[0xd];
if ((animName != (GenericPopup)0x0) && (*GHIDRA_CAST<char *>((this + 0x11)) != '\0')) {
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animName) + 0x14))) {
animName = *GHIDRA_CAST<GenericPopup *>(animName);
}
idleName = s_Idle;
do {
bVar1 = *GHIDRA_CAST<byte *>(animName);
bVar2 = bVar1 < *idleName;
if (bVar1 != *idleName) {
LAB_00837400:
local_1c.x = (float)(-GHIDRA_UINT(bVar2) | 1);
goto LAB_00837405;
}
if (bVar1 == 0) break;
bVar1 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animName) + 1));
bVar2 = bVar1 < idleName[1];
if (bVar1 != idleName[1]) goto LAB_00837400;
animName = (GenericPopup)(GHIDRA_INT(animName) + 2);
idleName = idleName + 2;
} while (bVar1 != 0);
local_1c.x = 0.0;
LAB_00837405:
if (local_1c.x == 0.0) {
lineOffsetY = -32.0;
lineText = this + 0x4a;
line = 0;
local_1c.y = 18.0;
do {
alignFactor = 0.5;
if (*lineText != (GenericPopup)0x0) {
drawSettings = 0;
local_3c = 0xffff;
local_38 = 0;
local_34 = 0x3f800000;
local_30 = 0xffffffff;
local_2c = 0;
local_28 = 0;
local_8 = 0;
y = g_screenHeight * 0.5 + (&lineOffsetY)[line];
textWidth = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_utf16(GHIDRA_CAST<short *>(*lineText),-1);
Font::draw_string_wide_unscaled
(font,GHIDRA_CAST<short *>(*lineText),
g_screenWidth * alignFactor -
(float)((double)textWidth + __uint_to_double_fixup[-(textWidth >> 0x1f)]) *
alignFactor,y,GHIDRA_CAST<KColor *>((this + 0x45)),&drawSettings);
}
line = line + 1;
lineText = lineText + 1;
} while (line < 3);
}
}
}
ExceptionList = local_10;
return;
}
// 009c6130
void GenericPopup::destructor()
{
char isLastRef;
uint uVar1;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
puStack_c = &LAB_00af0b40;
local_10 = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
this[0x53] = (GenericPopup)KAGE::Network::Multiplayer::ConstLobby::vftable;
local_8 = 0;
if (this[0x55] != (GenericPopup)0x0) {
isLastRef = (**(code **)(*GHIDRA_CAST<int *>(this[0x55]) + 0xc))(uVar1);
if ((isLastRef != '\0') && (g_lobbyReleaseFn != (void *)0x0)) {
(*g_lobbyReleaseFn)(this + 0x54);
}
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 0x4d)))))->std::string::_Tidy_deallocate();
local_8 = 1;
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(this))))->ANM2::Reset();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x14)))))->AnimationState::~AnimationState();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0xc)))))->AnimationState::~AnimationState();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>((this + 6)))))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(this))))->std::string::_Tidy_deallocate();
ExceptionList = local_10;
return;
}