- 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>
194 lines
7.9 KiB
C++
194 lines
7.9 KiB
C++
#include "classes.h"
|
|
|
|
// 004252f0
|
|
void CompletionWidget::Render(Vector *pos, Vector *scale)
|
|
{
|
|
AnimationState *animState;
|
|
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x35])) + 0x1)))) = scale->x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x36])) + 0x2)))) = scale->y;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x59])) + 0x2))) != '\0') {
|
|
animState = GHIDRA_CAST<AnimationState *>((this + 0x1c));
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x26])) + 0x2))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1)))),pos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
else {
|
|
AnimationState::Render(animState,pos,&g_vectorZero,&g_vectorZero);
|
|
animState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1))));
|
|
}
|
|
AnimationState::Render(animState,pos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 008ca2c0
|
|
void CompletionWidget::Load()
|
|
{
|
|
uint8_t bVar1;
|
|
uint8_t *currentName;
|
|
uint8_t *idleName;
|
|
char *pcVar2;
|
|
uint32_t uVar3;
|
|
uint32_t *characterAnimData;
|
|
bool isLess;
|
|
int characterIndex;
|
|
std_string menuPath;
|
|
std_string characterPath;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint8_t *animData;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((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<uint8_t *>(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<uint32_t *>((GHIDRA_CAST<char *>(&(menuPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
menuPath._size = 0x15;
|
|
menuPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuPath._buf))) + 0x0))),"gfx/ui/DeedsMenu.anm2",0x16);
|
|
local_14 = 0;
|
|
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))),&menuPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < menuPath._capacity) {
|
|
uVar3 = menuPath._capacity + 1;
|
|
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuPath._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(menuPath._buf)) + 0x0))) + -4));
|
|
uVar3 = menuPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((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 = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x12])) + 0x2))));
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
currentName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
currentName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
idleName = s_Idle;
|
|
do {
|
|
bVar1 = *currentName;
|
|
isLess = bVar1 < *idleName;
|
|
if (bVar1 != *idleName) {
|
|
LAB_008ca3e0:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_008ca3e5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentName[1];
|
|
isLess = bVar1 < idleName[1];
|
|
if (bVar1 != idleName[1]) goto LAB_008ca3e0;
|
|
currentName = currentName + 2;
|
|
idleName = idleName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_008ca3e5:
|
|
if ((uVar3 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST<char *>((this + 0x18)) != '\0'))))
|
|
goto LAB_008ca419;
|
|
}
|
|
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1)))),s_Idle,1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1)))));
|
|
*GHIDRA_CAST<uint8_t *>((this + 0x18)) = 1;
|
|
}
|
|
LAB_008ca419:
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x59])) + 0x2))) != '\0') {
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x11])) + 0x1)))));
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>((this + 0x1c)));
|
|
}
|
|
characterIndex = 0;
|
|
characterAnimData = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[0x6e])) + 0x2))));
|
|
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<uint32_t *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
characterPath._size = 0x15;
|
|
characterPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(characterPath._buf))) + 0x0))),"gfx/ui/DeedsMenu.anm2",0x16);
|
|
local_14 = 1;
|
|
ANM2::Load(GHIDRA_CAST<ANM2 *>((characterAnimData + -0xd)),&characterPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < characterPath._capacity) {
|
|
uVar3 = characterPath._capacity + 1;
|
|
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(characterPath._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) + -4));
|
|
uVar3 = characterPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2)))))
|
|
goto LAB_008ca399;
|
|
}
|
|
operator_delete(pcVar2,uVar3);
|
|
}
|
|
animData = GHIDRA_CAST<uint8_t *>(*characterAnimData);
|
|
characterPath._size = 0;
|
|
characterPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(characterPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_008ca543:
|
|
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>((characterAnimData + -0xd)),GHIDRA_CAST<uint8_t *>("PlayerCharacter"),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((characterAnimData + -1)));
|
|
*GHIDRA_CAST<uint8_t *>((characterAnimData + 4)) = 1;
|
|
}
|
|
}
|
|
else {
|
|
currentName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
currentName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
pcVar2 = "PlayerCharacter";
|
|
do {
|
|
bVar1 = *currentName;
|
|
isLess = bVar1 < (uint8_t)*pcVar2;
|
|
if (bVar1 != *pcVar2) {
|
|
LAB_008ca530:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_008ca535;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentName[1];
|
|
isLess = bVar1 < (uint8_t)pcVar2[1];
|
|
if (bVar1 != pcVar2[1]) goto LAB_008ca530;
|
|
currentName = currentName + 2;
|
|
pcVar2 = pcVar2 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_008ca535:
|
|
if ((uVar3 != 0) || ((animData[0x34] != 0 && (*GHIDRA_CAST<char *>((characterAnimData + 4)) == '\0'))))
|
|
goto LAB_008ca543;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(characterAnimData) + 0xd5)) != '\0') {
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>((characterAnimData + -1)));
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>((characterAnimData + 7)));
|
|
}
|
|
characterAnimData = characterAnimData + 0x45;
|
|
characterIndex = characterIndex + 1;
|
|
if (3 < characterIndex) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|