- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired. - font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact against its assembly. - options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include Save's exact bytes. - platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first built-in shader (FUN_00a13fa0). - source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every address in a (a, b, c to d) list on a comment counts as taken over. - log.h: reconstruction_missing() for a taken-over class's methods that are not written yet. 206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager still use the old APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
536 lines
21 KiB
C++
536 lines
21 KiB
C++
#include "classes.h"
|
|
|
|
// 008ce080
|
|
void Menu_CustomChallenge::Update()
|
|
{
|
|
Seeds unk;
|
|
KColor fadeColor;
|
|
std_string seed;
|
|
Manager *pMVar1;
|
|
char isActionTriggered;
|
|
uint32_t selectedIndex;
|
|
Seeds *menuSeeds;
|
|
Manager *this_00;
|
|
uint32_t uVar2;
|
|
Seeds aSStackY_2f08 [128];
|
|
uint8_t in_stack_ffffff54 [48];
|
|
uint32_t in_stack_ffffff84;
|
|
uint32_t in_stack_ffffff88;
|
|
uint32_t in_stack_ffffff8c;
|
|
uint32_t in_stack_ffffff90;
|
|
uint32_t in_stack_ffffff94;
|
|
uint32_t uVar3;
|
|
uint32_t in_stack_ffffff98;
|
|
uint32_t uVar4;
|
|
uint32_t in_stack_ffffff9c;
|
|
int iVar5;
|
|
uint32_t in_stack_ffffffa0;
|
|
uint32_t in_stack_ffffffa4;
|
|
uint32_t in_stack_ffffffa8;
|
|
void *in_stack_ffffffac;
|
|
uint32_t in_stack_ffffffb0;
|
|
int difficulty;
|
|
char acStack_4a [2];
|
|
uint32_t local_34 [2];
|
|
void *seedText [4];
|
|
uint32_t local_1c;
|
|
uint32_t local_18;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *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<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5d])) + 0x2))) != '\0')) {
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))));
|
|
in_stack_ffffffb0 = 0x8ce0d5;
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>((this + 0x20)));
|
|
}
|
|
menuManager = g_menuManager;
|
|
manager = g_manager;
|
|
if (g_menuManager->_fadeOutActive == 0) {
|
|
local_34[1] = 0xe;
|
|
iVar5 = 0x8ce203;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
pMVar1 = g_manager;
|
|
if (isActionTriggered == '\0') {
|
|
local_34[1] = 0x16;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered == '\0') {
|
|
local_34[1] = 0x17;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
manager = g_manager;
|
|
if (isActionTriggered == '\0') {
|
|
local_34[1] = 0xf;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered != '\0') {
|
|
FUN_0098aec0();
|
|
}
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))));
|
|
if (((iVar5 == 0) || ((0x31 < iVar5 && (iVar5 % 10 == 0)))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>(this), *GHIDRA_CAST<int *>(this) = iVar5 + 1,
|
|
(GHIDRA_INT((manager->_challengeParams)._end) - GHIDRA_INT((manager->_challengeParams)._begin)) /
|
|
0xa4 <= iVar5 + 1)) {
|
|
*GHIDRA_CAST<uint32_t *>(this) = 0x2e;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1))));
|
|
if (((iVar5 == 0) || ((0x31 < iVar5 && (iVar5 % 10 == 0)))) &&
|
|
(iVar5 = *GHIDRA_CAST<int *>(this), *GHIDRA_CAST<int *>(this) = iVar5 + -1, iVar5 + -1 < 0x2e)) {
|
|
*GHIDRA_CAST<int *>(this) = (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[0] = 0xbb;
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(local_34));
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar1->_sfxManager)))->SoundEffects::Play(local_34[0],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 = iVar5;
|
|
MenuManager::start_game(fadeColor);
|
|
}
|
|
local_34[1] = 0x17;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if ((isActionTriggered == '\0') &&
|
|
(isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(), isActionTriggered == '\0')
|
|
) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))) + 1;
|
|
}
|
|
else if (1.0 <= g_menuManager->_fadeOutProgress) {
|
|
challengeParams = (g_manager->_challengeParams)._begin;
|
|
local_34[0] = *GHIDRA_CAST<uint32_t *>(this);
|
|
uVar2 = (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[0] != 0)) & local_34[0];
|
|
if (uVar2 <= selectedIndex) {
|
|
selectedIndex = uVar2;
|
|
}
|
|
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(challengeParams) + selectedIndex * 0xa4 + 0x44));
|
|
local_8 = (void *)0x0;
|
|
uVar3 = 0x8ce16d;
|
|
(GHIDRA_CAST<msvc::string *>((acStack_4a + -0x1a)))->msvc::string::string(seedText);
|
|
uVar4 = 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) {
|
|
uVar2 = local_18 + 1;
|
|
in_stack_ffffffac = seedText[0];
|
|
if (0xfff < uVar2) {
|
|
in_stack_ffffffac = *(void **)(GHIDRA_INT(seedText[0]) + -4);
|
|
uVar2 = 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,uVar2);
|
|
}
|
|
menuSeeds = &g_menuManager->_seedsObject;
|
|
*GHIDRA_CAST<uint8_t *>(menuSeeds) = 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;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(unk)) + 0x0))) = in_stack_ffffff54;
|
|
unk._stageSeeds[7] = in_stack_ffffff88;
|
|
unk._stageSeeds[8] = in_stack_ffffff8c;
|
|
unk._stageSeeds[9] = in_stack_ffffff90;
|
|
unk._stageSeeds[10] = uVar3;
|
|
unk._stageSeeds[0xb] = uVar4;
|
|
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(iVar5,local_34[0],unk,difficulty);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 008ce430
|
|
void Menu_CustomChallenge::Render()
|
|
{
|
|
code *pcVar1;
|
|
KColor color;
|
|
Manager *pMVar2;
|
|
uint8_t bVar3;
|
|
uint8_t *curAnimChar;
|
|
uint32_t uVar4;
|
|
void *glyphs;
|
|
uint8_t *wantAnimChar;
|
|
char *wantAnimStr;
|
|
AnimationState *secondAnimState;
|
|
int iVar5;
|
|
int iVar6;
|
|
int selectedRow;
|
|
bool isLess;
|
|
float fVar7;
|
|
uint8_t glyphQuads [20];
|
|
uint64_t rngShifts;
|
|
uint32_t measureParams;
|
|
uint32_t local_ac;
|
|
uint32_t local_a8;
|
|
uint32_t local_a4;
|
|
uint32_t local_a0;
|
|
uint32_t local_9c;
|
|
uint32_t 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;
|
|
uint8_t textBuf [64];
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint8_t *animData;
|
|
MenuManager *menuManager;
|
|
uint8_t *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<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1)));
|
|
animData = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2))));
|
|
menuPos.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[2])) + 0x2)))) + 200.0;
|
|
menuPos.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>((this + 4)) + 0.0;
|
|
menuY = menuPos.y;
|
|
menuX = menuPos.x;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_008ce4e8:
|
|
bVar3 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(sprite),&DAT_00b6767c,1);
|
|
if (bVar3 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))));
|
|
*GHIDRA_CAST<uint8_t *>((this + 0x1c)) = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
wantAnimChar = &DAT_00b6767c;
|
|
do {
|
|
bVar3 = *curAnimChar;
|
|
isLess = bVar3 < *wantAnimChar;
|
|
if (bVar3 != *wantAnimChar) {
|
|
LAB_008ce4d5:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_008ce4da;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = curAnimChar[1];
|
|
isLess = bVar3 < wantAnimChar[1];
|
|
if (bVar3 != wantAnimChar[1]) goto LAB_008ce4d5;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantAnimChar = wantAnimChar + 2;
|
|
} while (bVar3 != 0);
|
|
uVar4 = 0;
|
|
LAB_008ce4da:
|
|
if ((uVar4 != 0) || ((animData[0x34] != 0 && (*GHIDRA_CAST<char *>((this + 0x1c)) == '\0'))))
|
|
goto LAB_008ce4e8;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5d])) + 0x2))) != '\0') {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x2a])) + 0x2))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))),&menuPos,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x20)),&menuPos,&g_vectorZero,&g_vectorZero);
|
|
menuY = menuPos.y;
|
|
menuX = menuPos.x;
|
|
}
|
|
else {
|
|
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x20)),&menuPos,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))),&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<uint8_t *>("RNG Seed is zero!\n"));
|
|
pcVar1 = (code *)swi(3);
|
|
(*pcVar1)();
|
|
return;
|
|
}
|
|
uVar4 = GHIDRA_UINT(fVar7) >> ((uint8_t)rngShifts & 0x1f) ^ GHIDRA_UINT(fVar7);
|
|
uVar4 = uVar4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar4;
|
|
local_74.y = (float)(uVar4 >> (SUB41(local_78,0) & 0x1f) ^ uVar4);
|
|
sprintf_s(textBuf,0x40,GHIDRA_CAST<uint8_t *>("Piece%d"));
|
|
animData = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2))));
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_008ce698:
|
|
bVar3 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(sprite),textBuf,1);
|
|
if (bVar3 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))));
|
|
*GHIDRA_CAST<uint8_t *>((this + 0x1c)) = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
wantAnimChar = textBuf;
|
|
do {
|
|
bVar3 = *curAnimChar;
|
|
isLess = bVar3 < *wantAnimChar;
|
|
if (bVar3 != *wantAnimChar) {
|
|
LAB_008ce685:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_008ce68a;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = curAnimChar[1];
|
|
isLess = bVar3 < wantAnimChar[1];
|
|
if (bVar3 != wantAnimChar[1]) goto LAB_008ce685;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantAnimChar = wantAnimChar + 2;
|
|
} while (bVar3 != 0);
|
|
uVar4 = 0;
|
|
LAB_008ce68a:
|
|
if ((uVar4 != 0) || ((animData[0x34] != 0 && (*GHIDRA_CAST<char *>((this + 0x1c)) == '\0'))))
|
|
goto LAB_008ce698;
|
|
}
|
|
row = row + 1;
|
|
piecePos.x = menuX + 0.0;
|
|
piecePos.y = (float)row * 32.0 + menuY;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5d])) + 0x2))) != '\0') {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x2a])) + 0x2))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))),&piecePos,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x20));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((this + 0x20)),&piecePos,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1))));
|
|
}
|
|
AnimationState::Render(secondAnimState,&piecePos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
fVar7 = local_74.y;
|
|
} while (row < local_64);
|
|
}
|
|
animData = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2))));
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
wantAnimStr = "Bottom";
|
|
do {
|
|
bVar3 = *curAnimChar;
|
|
isLess = bVar3 < (uint8_t)*wantAnimStr;
|
|
if (bVar3 != *wantAnimStr) {
|
|
LAB_008ce780:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_008ce785;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = curAnimChar[1];
|
|
isLess = bVar3 < (uint8_t)wantAnimStr[1];
|
|
if (bVar3 != wantAnimStr[1]) goto LAB_008ce780;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantAnimStr = wantAnimStr + 2;
|
|
} while (bVar3 != 0);
|
|
uVar4 = 0;
|
|
LAB_008ce785:
|
|
if ((uVar4 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST<char *>((this + 0x1c)) != '\0'))))
|
|
goto LAB_008ce7b1;
|
|
}
|
|
bVar3 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(sprite),GHIDRA_CAST<uint8_t *>("Bottom"),1);
|
|
if (bVar3 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))));
|
|
*GHIDRA_CAST<uint8_t *>((this + 0x1c)) = 1;
|
|
}
|
|
LAB_008ce7b1:
|
|
local_74.x = menuX + 0.0;
|
|
local_74.y = (float)local_64 * 32.0 + menuY;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5d])) + 0x2))) != '\0') {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x2a])) + 0x2))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))),&local_74,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x20));
|
|
}
|
|
else {
|
|
AnimationState::Render(GHIDRA_CAST<AnimationState *>((this + 0x20)),&local_74,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1))));
|
|
}
|
|
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<uint8_t *>("%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<uint8_t *>((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);
|
|
msvc::vector<12byte>::clear();
|
|
msvc::vector<12byte>::_Tidy();
|
|
local_8 = 0xffffffff;
|
|
if (*GHIDRA_CAST<int *>(this) == row + 0x2d) {
|
|
animData = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x16])) + 0x2))));
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_008cea15:
|
|
bVar3 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[5])) + 0x1)))),GHIDRA_CAST<uint8_t *>("Cursor"),1);
|
|
if (bVar3 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))));
|
|
*GHIDRA_CAST<uint8_t *>((this + 0x1c)) = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
wantAnimStr = "Cursor";
|
|
do {
|
|
bVar3 = *curAnimChar;
|
|
isLess = bVar3 < (uint8_t)*wantAnimStr;
|
|
if (bVar3 != *wantAnimStr) {
|
|
LAB_008cea02:
|
|
uVar4 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_008cea07;
|
|
}
|
|
if (bVar3 == 0) break;
|
|
bVar3 = curAnimChar[1];
|
|
isLess = bVar3 < (uint8_t)wantAnimStr[1];
|
|
if (bVar3 != wantAnimStr[1]) goto LAB_008cea02;
|
|
curAnimChar = curAnimChar + 2;
|
|
wantAnimStr = wantAnimStr + 2;
|
|
} while (bVar3 != 0);
|
|
uVar4 = 0;
|
|
LAB_008cea07:
|
|
if ((uVar4 != 0) || ((animData[0x34] != 0 && (*GHIDRA_CAST<char *>((this + 0x1c)) == '\0'))))
|
|
goto LAB_008cea15;
|
|
}
|
|
cursorPos.x = menuX - 93.0;
|
|
cursorPos.y = ((float)row * 25.0 - 16.0) + menuY;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x5d])) + 0x2))) != '\0') {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x2a])) + 0x2))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1)))),&cursorPos,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x20));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((this + 0x20)),&cursorPos,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x15])) + 0x1))));
|
|
}
|
|
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_CAST<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_CAST<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;
|
|
}
|