Files
isaac-port/generated-src/menu_custom_challenge.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

551 lines
22 KiB
C++

#include "classes.h"
// 008ce080
void Menu_CustomChallenge::Update()
{
Menu_CustomChallenge MVar1;
Seeds unk;
KColor fadeColor;
std_string seed;
Manager *pMVar2;
char isActionTriggered;
uint selectedIndex;
Seeds *menuSeeds;
Manager *this_00;
uint uVar3;
Seeds aSStackY_2f08 [128];
undefined1 in_stack_ffffff54 [48];
undefined4 in_stack_ffffff84;
undefined4 in_stack_ffffff88;
undefined4 in_stack_ffffff8c;
undefined4 in_stack_ffffff90;
undefined4 in_stack_ffffff94;
undefined4 uVar4;
undefined4 in_stack_ffffff98;
undefined4 uVar5;
undefined4 in_stack_ffffff9c;
int iVar6;
undefined4 in_stack_ffffffa0;
undefined4 in_stack_ffffffa4;
undefined4 in_stack_ffffffa8;
void *in_stack_ffffffac;
uint in_stack_ffffffb0;
int difficulty;
char acStack_4a [2];
Menu_CustomChallenge local_34;
undefined4 actionId;
void *seedText [4];
undefined4 local_1c;
uint local_18;
uint local_14;
void *local_10;
undefined1 *puStack_c;
void *local_8;
void *challengeParams;
Manager *manager;
MenuManager *menuManager;
local_8 = (void *)0xffffffff;
puStack_c = &LAB_00af32ed;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT((seedText + 10));
ExceptionList = &local_10;
if (((g_manager->_framecount & 1) == 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x46])) + 0x1))) != '\0')) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x10)))))->AnimationState::Update();
in_stack_ffffffb0 = 0x8ce0d5;
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x18)))))->AnimationState::Update();
}
menuManager = g_menuManager;
manager = g_manager;
if (g_menuManager->_fadeOutActive == 0) {
actionId = 0xe;
iVar6 = 0x8ce203;
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
pMVar2 = g_manager;
if (isActionTriggered == '\0') {
actionId = 0x16;
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
if (isActionTriggered == '\0') {
actionId = 0x17;
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
manager = g_manager;
if (isActionTriggered == '\0') {
actionId = 0xf;
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
if (isActionTriggered != '\0') {
FUN_0098aec0();
}
}
else {
MVar1 = this[1];
if (((MVar1 == (Menu_CustomChallenge)0x0) ||
((0x31 < GHIDRA_INT(MVar1) && (GHIDRA_INT(MVar1) % 10 == 0)))) &&
(MVar1 = *this, *this = (Menu_CustomChallenge)(GHIDRA_INT(MVar1) + 1),
(GHIDRA_INT((manager->_challengeParams)._end) - GHIDRA_INT((manager->_challengeParams)._begin)) /
0xa4 <= GHIDRA_INT(MVar1) + 1)) {
*this = (Menu_CustomChallenge)0x2e;
}
}
}
else {
MVar1 = this[1];
if (((MVar1 == (Menu_CustomChallenge)0x0) || ((0x31 < GHIDRA_INT(MVar1) && (GHIDRA_INT(MVar1) % 10 == 0)))
) && (MVar1 = *this, *this = (Menu_CustomChallenge)(GHIDRA_INT(MVar1) + -1),
GHIDRA_INT(MVar1) + -1 < 0x2e)) {
*this = (Menu_CustomChallenge)
((GHIDRA_INT((g_manager->_challengeParams)._end) -
GHIDRA_INT((g_manager->_challengeParams)._begin)) / 0xa4 + -1);
}
}
}
else if ((GHIDRA_INT((manager->_challengeParams)._end) - GHIDRA_INT((manager->_challengeParams)._begin)) /
0xa4 == 0x2e) {
local_34 = (Menu_CustomChallenge)0xbb;
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_34));
(GHIDRA_CAST<SoundEffects *>((&pMVar2->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_34),1.0,2,0,1.0,0.0);
}
else {
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((acStack_4a + -0x2a)))))->KColor::SetFromARGB(0xff000000);
fadeColor._green = (float)in_stack_ffffff90;
fadeColor._red = (float)in_stack_ffffff8c;
fadeColor._blue = (float)in_stack_ffffff94;
fadeColor._alpha = (float)in_stack_ffffff98;
fadeColor._unk = iVar6;
MenuManager::start_game(fadeColor);
}
actionId = 0x17;
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
if ((isActionTriggered == '\0') &&
(isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(), isActionTriggered == '\0')
) {
this[1] = (Menu_CustomChallenge)0x0;
ExceptionList = local_10;
return;
}
this[1] = (Menu_CustomChallenge)(GHIDRA_INT(this[1]) + 1);
}
else if (1.0 <= g_menuManager->_fadeOutProgress) {
challengeParams = (g_manager->_challengeParams)._begin;
local_34 = *this;
uVar3 = (GHIDRA_INT((g_manager->_challengeParams)._end) - GHIDRA_INT(challengeParams)) / 0xa4 - 1;
local_18 = 0xf;
local_1c = 0;
seedText[0] = (void *)0x0;
selectedIndex = -GHIDRA_UINT((local_34 != (Menu_CustomChallenge)0x0)) & GHIDRA_UINT(local_34);
if (uVar3 <= selectedIndex) {
selectedIndex = uVar3;
}
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(challengeParams) + selectedIndex * 0xa4 + 0x44));
local_8 = (void *)0x0;
uVar4 = 0x8ce16d;
(GHIDRA_CAST<std::string *>((acStack_4a + -0x1a)))->std::string::string(seedText);
uVar5 = 0x8ce178;
seed._buf[4] = (char)in_stack_ffffffa0;
seed._buf[5] = (char)(GHIDRA_UINT(in_stack_ffffffa0) >> 8);
seed._buf[6] = (char)(GHIDRA_UINT(in_stack_ffffffa0) >> 0x10);
seed._buf[7] = (char)(GHIDRA_UINT(in_stack_ffffffa0) >> 0x18);
seed._buf[0] = (char)in_stack_ffffff9c;
seed._buf[1] = (char)(GHIDRA_UINT(in_stack_ffffff9c) >> 8);
seed._buf[2] = (char)(GHIDRA_UINT(in_stack_ffffff9c) >> 0x10);
seed._buf[3] = (char)(GHIDRA_UINT(in_stack_ffffff9c) >> 0x18);
seed._buf[8] = (char)in_stack_ffffffa4;
seed._buf[9] = (char)(GHIDRA_UINT(in_stack_ffffffa4) >> 8);
seed._buf[10] = (char)(GHIDRA_UINT(in_stack_ffffffa4) >> 0x10);
seed._buf[0xb] = (char)(GHIDRA_UINT(in_stack_ffffffa4) >> 0x18);
seed._buf[0xc] = (char)in_stack_ffffffa8;
seed._buf[0xd] = (char)(GHIDRA_UINT(in_stack_ffffffa8) >> 8);
seed._buf[0xe] = (char)(GHIDRA_UINT(in_stack_ffffffa8) >> 0x10);
seed._buf[0xf] = (char)(GHIDRA_UINT(in_stack_ffffffa8) >> 0x18);
seed._size = GHIDRA_UINT(in_stack_ffffffac);
seed._capacity = in_stack_ffffffb0;
(GHIDRA_CAST<Seeds *>((&menuManager->_seedsObject)))->Seeds::SetStartSeed(seed);
local_8 = (void *)0xffffffff;
if (0xf < local_18) {
uVar3 = local_18 + 1;
in_stack_ffffffac = seedText[0];
if (0xfff < uVar3) {
in_stack_ffffffac = *(void **)(GHIDRA_INT(seedText[0]) + -4);
uVar3 = local_18 + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(seedText[0]) + (-4 - GHIDRA_INT(in_stack_ffffffac))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
in_stack_ffffffa8 = 0x8ce1b2;
operator_delete(in_stack_ffffffac,uVar3);
}
menuSeeds = &g_menuManager->_seedsObject;
menuSeeds->_isCustomRun = 1;
difficulty = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(challengeParams) + selectedIndex * 0xa4 + 0x70));
(GHIDRA_CAST<Seeds *>((aSStackY_2f08 + 0x81)))->Seeds::construct_from_copy(menuSeeds);
unk._stageSeeds[6] = in_stack_ffffff84;
unk._isCustomRun = in_stack_ffffff54[0];
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(unk)) + 0x1))) = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x1)));
unk._gameStartSeed = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x4)));
unk._rng._seed = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x8)));
unk._rng._shift1 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0xc)));
unk._rng._shift2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x10)));
unk._rng._shift3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x14)));
unk._stageSeeds[0] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x18)));
unk._stageSeeds[1] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x1c)));
unk._stageSeeds[2] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x20)));
unk._stageSeeds[3] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x24)));
unk._stageSeeds[4] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x28)));
unk._stageSeeds[5] = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(in_stack_ffffff54)) + 0x2c)));
unk._stageSeeds[7] = in_stack_ffffff88;
unk._stageSeeds[8] = in_stack_ffffff8c;
unk._stageSeeds[9] = in_stack_ffffff90;
unk._stageSeeds[10] = uVar4;
unk._stageSeeds[0xb] = uVar5;
unk._stageSeeds[0xc] = in_stack_ffffff9c;
unk._stageSeeds[0xd] = in_stack_ffffffa0;
unk._playerInitSeed = in_stack_ffffffa4;
unk._seedEffects = (void *)in_stack_ffffffa8;
unk._seedEffectsCount = GHIDRA_INT(in_stack_ffffffac);
(GHIDRA_CAST<Manager *>((this_00)))->Manager::StartNewGame(iVar6,GHIDRA_INT(local_34),unk,difficulty);
}
ExceptionList = local_10;
return;
}
// 008ce430
void Menu_CustomChallenge::Render()
{
code *pcVar1;
KColor color;
Manager *pMVar2;
byte bVar3;
Menu_CustomChallenge curAnimChar;
uint uVar4;
void *glyphs;
byte *wantAnimChar;
char *wantAnimStr;
AnimationState *secondAnimState;
int iVar5;
int iVar6;
int selectedRow;
bool isLess;
float fVar7;
undefined1 glyphQuads [20];
undefined8 rngShifts;
undefined4 measureParams;
undefined4 local_ac;
undefined4 local_a8;
undefined4 local_a4;
undefined4 local_a0;
undefined4 local_9c;
undefined4 local_98;
Vector textScale;
Vector cursorPos;
Vector piecePos;
Manager *manager;
float local_78;
Vector local_74;
Vector menuPos;
int local_64;
float menuY;
float menuX;
int row;
byte textBuf [64];
uint local_14;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
Menu_CustomChallenge animData;
MenuManager *menuManager;
ANM2 *sprite;
local_8 = 0xffffffff;
puStack_c = &LAB_00b05b1b;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT((textBuf + 0x50));
ExceptionList = &local_10;
sprite = GHIDRA_CAST<ANM2 *>((this + 4));
animData = this[0x11];
menuPos.x = (g_menuManager->_ViewPosition).x + (float)this[2] + 200.0;
menuPos.y = (g_menuManager->_ViewPosition).y + (float)this[3] + 0.0;
menuY = menuPos.y;
menuX = menuPos.x;
if (animData == (Menu_CustomChallenge)0x0) {
LAB_008ce4e8:
bVar3 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetAnimation(&DAT_00b6767c,1);
if (bVar3 != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x10)))))->AnimationState::Rewind();
*GHIDRA_CAST<undefined1 *>((this + 0x15)) = 1;
}
}
else {
curAnimChar = animData;
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
curAnimChar = *GHIDRA_CAST<Menu_CustomChallenge *>(animData);
}
wantAnimChar = &DAT_00b6767c;
do {
bVar3 = *GHIDRA_CAST<byte *>(curAnimChar);
isLess = bVar3 < *wantAnimChar;
if (bVar3 != *wantAnimChar) {
LAB_008ce4d5:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008ce4da;
}
if (bVar3 == 0) break;
bVar3 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(curAnimChar) + 1));
isLess = bVar3 < wantAnimChar[1];
if (bVar3 != wantAnimChar[1]) goto LAB_008ce4d5;
curAnimChar = (Menu_CustomChallenge)(GHIDRA_INT(curAnimChar) + 2);
wantAnimChar = wantAnimChar + 2;
} while (bVar3 != 0);
uVar4 = 0;
LAB_008ce4da:
if ((uVar4 != 0) || ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) != 0 && (*GHIDRA_CAST<char *>((this + 0x15)) == '\0')))
) goto LAB_008ce4e8;
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x46])) + 0x1))) != '\0') {
if (*GHIDRA_CAST<char *>((this + 0x20)) == '\0') {
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x10)),&menuPos,&g_vectorZero,&g_vectorZero);
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x18)),&menuPos,&g_vectorZero,&g_vectorZero);
menuY = menuPos.y;
menuX = menuPos.x;
}
else {
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x18)),&menuPos,&g_vectorZero,&g_vectorZero);
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x10)),&menuPos,&g_vectorZero,&g_vectorZero);
menuY = menuPos.y;
menuX = menuPos.x;
}
}
local_78 = 9.80909e-45;
manager = g_manager;
rngShifts = 0x900000005;
row = 0;
local_64 = (GHIDRA_UINT((((GHIDRA_INT((g_manager->_challengeParams)._end) -
GHIDRA_INT((g_manager->_challengeParams)._begin)) / 0xa4 + -0x2e) * 0x19)) >> 5) + 1;
fVar7 = 1.7299e-41;
if (local_64 != 0) {
do {
if (fVar7 == 0.0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
pcVar1 = (code *)swi(3);
(*pcVar1)();
return;
}
uVar4 = GHIDRA_UINT(fVar7) >> ((byte)rngShifts & 0x1f) ^ GHIDRA_UINT(fVar7);
uVar4 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4;
local_74.y = (float)(uVar4 >> (SUB41(local_78,0) & 0x1f) ^ uVar4);
sprintf_s(textBuf,0x40,GHIDRA_CAST<byte *>("Piece%d"));
animData = this[0x11];
if (animData == (Menu_CustomChallenge)0x0) {
LAB_008ce698:
bVar3 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetAnimation(textBuf,1);
if (bVar3 != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x10)))))->AnimationState::Rewind();
*GHIDRA_CAST<undefined1 *>((this + 0x15)) = 1;
}
}
else {
curAnimChar = animData;
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
curAnimChar = *GHIDRA_CAST<Menu_CustomChallenge *>(animData);
}
wantAnimChar = textBuf;
do {
bVar3 = *GHIDRA_CAST<byte *>(curAnimChar);
isLess = bVar3 < *wantAnimChar;
if (bVar3 != *wantAnimChar) {
LAB_008ce685:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008ce68a;
}
if (bVar3 == 0) break;
bVar3 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(curAnimChar) + 1));
isLess = bVar3 < wantAnimChar[1];
if (bVar3 != wantAnimChar[1]) goto LAB_008ce685;
curAnimChar = (Menu_CustomChallenge)(GHIDRA_INT(curAnimChar) + 2);
wantAnimChar = wantAnimChar + 2;
} while (bVar3 != 0);
uVar4 = 0;
LAB_008ce68a:
if ((uVar4 != 0) ||
((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) != 0 && (*GHIDRA_CAST<char *>((this + 0x15)) == '\0'))))
goto LAB_008ce698;
}
row = row + 1;
piecePos.x = menuX + 0.0;
piecePos.y = (float)row * 32.0 + menuY;
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x46])) + 0x1))) != '\0') {
if (*GHIDRA_CAST<char *>((this + 0x20)) == '\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((this + 0x10)),&piecePos,&g_vectorZero,&g_vectorZero);
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x18));
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((this + 0x18)),&piecePos,&g_vectorZero,&g_vectorZero);
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x10));
}
AnimationState::Render(secondAnimState,&piecePos,&g_vectorZero,&g_vectorZero);
}
fVar7 = local_74.y;
} while (row < local_64);
}
animData = this[0x11];
if (animData != (Menu_CustomChallenge)0x0) {
curAnimChar = animData;
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
curAnimChar = *GHIDRA_CAST<Menu_CustomChallenge *>(animData);
}
wantAnimStr = "Bottom";
do {
bVar3 = *GHIDRA_CAST<byte *>(curAnimChar);
isLess = bVar3 < (byte)*wantAnimStr;
if (bVar3 != *wantAnimStr) {
LAB_008ce780:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008ce785;
}
if (bVar3 == 0) break;
bVar3 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(curAnimChar) + 1));
isLess = bVar3 < (byte)wantAnimStr[1];
if (bVar3 != wantAnimStr[1]) goto LAB_008ce780;
curAnimChar = (Menu_CustomChallenge)(GHIDRA_INT(curAnimChar) + 2);
wantAnimStr = wantAnimStr + 2;
} while (bVar3 != 0);
uVar4 = 0;
LAB_008ce785:
if ((uVar4 == 0) && ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) == 0 || (*GHIDRA_CAST<char *>((this + 0x15)) != '\0')))
) goto LAB_008ce7b1;
}
bVar3 = (GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Bottom"),1);
if (bVar3 != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x10)))))->AnimationState::Rewind();
*GHIDRA_CAST<undefined1 *>((this + 0x15)) = 1;
}
LAB_008ce7b1:
local_74.x = menuX + 0.0;
local_74.y = (float)local_64 * 32.0 + menuY;
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x46])) + 0x1))) != '\0') {
if (*GHIDRA_CAST<char *>((this + 0x20)) == '\0') {
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x10)),&local_74,&g_vectorZero,&g_vectorZero);
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x18));
}
else {
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x18)),&local_74,&g_vectorZero,&g_vectorZero);
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x10));
}
AnimationState::Render(secondAnimState,&local_74,&g_vectorZero,&g_vectorZero);
}
if (0x2e < GHIDRA_UINT(((GHIDRA_INT((manager->_challengeParams)._end) - GHIDRA_INT((manager->_challengeParams)._begin)
) / 0xa4))) {
textScale.x = 0.8;
local_78 = menuX - 90.0;
textScale.y = 1.0;
local_64 = 0x1d78;
row = 1;
do {
sprintf_s(textBuf,0x40,GHIDRA_CAST<byte *>("%d.%s"));
pMVar2 = g_manager;
measureParams = 0;
local_ac = 0xffff;
local_a8 = 0;
local_a4 = 0x3f800000;
local_a0 = 0xffffffff;
local_9c = 0;
local_98 = 0;
local_8 = 0;
local_74.y = (float)(row + -1) * 25.0 + menuY;
glyphs = Font::measure_string
(&g_manager->_font2_TeamMeatEx12,glyphQuads,textBuf,&measureParams,
&textScale);
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
color._alpha = 1.0;
color._red = 0.0;
color._green = 0.0;
color._blue = 0.0;
color._unk = 0;
Font::render_glyph_quads
(&pMVar2->_font2_TeamMeatEx12,glyphs,local_78,local_74.y,0.8,1.0,color,
&measureParams);
std::vector<12byte>::clear();
std::vector<12byte>::_Tidy();
local_8 = 0xffffffff;
if (*this == (Menu_CustomChallenge)(row + 0x2d)) {
animData = this[0x11];
if (animData == (Menu_CustomChallenge)0x0) {
LAB_008cea15:
bVar3 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 4)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Cursor"),1);
if (bVar3 != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x10)))))->AnimationState::Rewind();
*GHIDRA_CAST<undefined1 *>((this + 0x15)) = 1;
}
}
else {
curAnimChar = animData;
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
curAnimChar = *GHIDRA_CAST<Menu_CustomChallenge *>(animData);
}
wantAnimStr = "Cursor";
do {
bVar3 = *GHIDRA_CAST<byte *>(curAnimChar);
isLess = bVar3 < (byte)*wantAnimStr;
if (bVar3 != *wantAnimStr) {
LAB_008cea02:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008cea07;
}
if (bVar3 == 0) break;
bVar3 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(curAnimChar) + 1));
isLess = bVar3 < (byte)wantAnimStr[1];
if (bVar3 != wantAnimStr[1]) goto LAB_008cea02;
curAnimChar = (Menu_CustomChallenge)(GHIDRA_INT(curAnimChar) + 2);
wantAnimStr = wantAnimStr + 2;
} while (bVar3 != 0);
uVar4 = 0;
LAB_008cea07:
if ((uVar4 != 0) ||
((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) != 0 && (*GHIDRA_CAST<char *>((this + 0x15)) == '\0'))))
goto LAB_008cea15;
}
cursorPos.x = menuX - 93.0;
cursorPos.y = ((float)row * 25.0 - 16.0) + menuY;
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x46])) + 0x1))) != '\0') {
if (*GHIDRA_CAST<char *>((this + 0x20)) == '\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((this + 0x10)),&cursorPos,&g_vectorZero,&g_vectorZero);
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x18));
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((this + 0x18)),&cursorPos,&g_vectorZero,&g_vectorZero);
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x10));
}
AnimationState::Render(secondAnimState,&cursorPos,&g_vectorZero,&g_vectorZero);
}
}
local_64 = local_64 + 0xa4;
uVar4 = row + 0x2e;
row = row + 1;
} while (uVar4 < GHIDRA_UINT(((GHIDRA_INT((manager->_challengeParams)._end) -
GHIDRA_INT((manager->_challengeParams)._begin)) / 0xa4)));
}
menuManager = g_menuManager;
selectedRow = GHIDRA_INT(*this) + -0x2e;
fVar7 = -216.0;
iVar6 = GHIDRA_INT((g_manager->_challengeParams)._end) - GHIDRA_INT((g_manager->_challengeParams)._begin);
iVar5 = iVar6 >> 0x1f;
iVar6 = iVar6 / 0xa4 + iVar5;
iVar5 = -iVar5;
if (4 < selectedRow) {
if (selectedRow < iVar6 + -0x31 + iVar5) {
iVar5 = GHIDRA_INT(*this) + -0x32;
}
else {
iVar5 = iVar6 + -0x35 + iVar5;
}
fVar7 = -216.0 - (float)(iVar5 * 0x19);
}
g_menuManager->_viewPositionSet[0xf].y = fVar7;
menuManager->_state = 1;
ExceptionList = local_10;
return;
}