Curation round 2, wave A: anm2 (Anm2Ed JSON), text, config as idiomatic classes; SDL3 platform opens a window

- 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>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-19 23:04:54 -05:00
1 parent d6e1ca7c6c
commit 780767f5e1
161 files changed
+8646 -21919

No files matched your search

+15 -15
View File
@@ -31,7 +31,7 @@ void GenericPrompt::Initialize(uint8_t SmallPrompt)
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/Prompt_YesNo.anm2",0x19);
local_14 = 1;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&anm2Path,1);
ANM2::Load(&this->_sprite,&anm2Path,1);
if (anm2Path._capacity < 0x10) goto LAB_00837a6d;
size = anm2Path._capacity + 1;
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
@@ -57,7 +57,7 @@ void GenericPrompt::Initialize(uint8_t SmallPrompt)
smallAnm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(smallAnm2Path._buf))) + 0x0))),"gfx/ui/Prompt_YesNo_Small.anm2",0x1f);
local_14 = 0;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&smallAnm2Path,1);
ANM2::Load(&this->_sprite,&smallAnm2Path,1);
if (smallAnm2Path._capacity < 0x10) goto LAB_00837a6d;
size = smallAnm2Path._capacity + 1;
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(smallAnm2Path._buf))) + 0x0)));
@@ -97,8 +97,8 @@ void GenericPrompt::Update(uint8_t processInput)
handle_input(this);
}
if ((this->_sprite)._loaded != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Update();
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::Update();
AnimationState::Update(&(this->_sprite)._animState);
AnimationState::Update(&(this->_sprite)._overlayAnimState);
}
animData = (this->_sprite)._animState._animData;
if ((animData != GHIDRA_CAST<uint8_t *>(0x0)) && ((this->_sprite)._animState._isPlaying == 0)) {
@@ -148,8 +148,8 @@ LAB_00837b60:
compareResult = 0;
LAB_00837b65:
if (((compareResult != 0) || (animData[0x34] != 0)) &&
(bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1), bVar1 != 0)) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
(bVar1 = ANM2::SetAnimation(&this->_sprite,s_Idle,1), bVar1 != 0)) {
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
}
@@ -168,7 +168,7 @@ LAB_00837b65:
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
}
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((this->_sprite)._animState._layerFrames) + layerId * 4)) = 0;
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::AdvanceLayerPosition(layerId,(float)selectedOption);
AnimationState::AdvanceLayerPosition(&(this->_sprite)._animState,layerId,(float)selectedOption);
}
return;
}
@@ -237,7 +237,7 @@ void GenericPrompt::Render()
AnimationState::Render(secondAnimState,&screenCenter,&g_vectorZero,&g_vectorZero);
}
if ((this->_sprite)._animState._animData != (void *)0x0) {
textTopFrame = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::GetNullFrame(GHIDRA_CAST<uint8_t *>("TextTop"));
textTopFrame = AnimationState::GetNullFrame(&(this->_sprite)._animState,GHIDRA_CAST<uint8_t *>("TextTop"));
if (textTopFrame != GHIDRA_CAST<float *>(0x0)) {
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xff362f2d);
titleFont = local_18;
@@ -264,7 +264,7 @@ void GenericPrompt::Render()
fVar2 = textTopFrame[5];
fVar4 = textTopFrame[4];
fVar3 = g_screenHeight * 0.5 + fVar3;
iVar1 = (GHIDRA_CAST<Font *>((titleFont)))->Font::get_string_width_utf16(GHIDRA_CAST<short *>(*lineText),-1);
iVar1 = Font::get_string_width_utf16(titleFont,GHIDRA_CAST<short *>(*lineText),-1);
Font::draw_string_wide
(titleFont,GHIDRA_CAST<short *>(*lineText),
(g_screenWidth * fVar5 + fVar6) -
@@ -297,14 +297,14 @@ void GenericPrompt::Render()
fVar2 = textTopFrame[4];
lineY = g_screenHeight * 0.5 + fVar3;
local_28 = GHIDRA_CAST<GenericPrompt *>(fVar2);
bodyLineWidth = (GHIDRA_CAST<Font *>((bodyFont)))->Font::get_string_width_utf16(GHIDRA_CAST<short *>(*lineText),-1);
bodyLineWidth = Font::get_string_width_utf16(bodyFont,GHIDRA_CAST<short *>(*lineText),-1);
bodyLineX = (g_screenWidth * fVar4 + fVar6) -
(float)((double)bodyLineWidth +
__uint_to_double_fixup[-(bodyLineWidth >> 0x1f)]) * fVar4 *
textTopFrame[4];
layoutScale.x = fVar2;
layoutScale.y = textScaleY;
glyphRun = (GHIDRA_CAST<Font *>((bodyFont)))->Font::layout_glyphs(glyphRunBuf,GHIDRA_CAST<uint8_t *>(*lineText),&fontSettings,
glyphRun = Font::layout_glyphs(bodyFont,glyphRunBuf,GHIDRA_CAST<uint8_t *>(*lineText),&fontSettings,
&layoutScale);
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
color._green = textColor._green;
@@ -433,9 +433,9 @@ LAB_00838147:
if ((cmpResult == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
goto LAB_00838173;
}
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Appear"),1);
bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("Appear"),1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
LAB_00838173:
@@ -486,9 +486,9 @@ LAB_008381d5:
}
}
}
bVar1 = (GHIDRA_CAST<ANM2 *>((anm2)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Dissappear"),1);
bVar1 = ANM2::SetAnimation(anm2,GHIDRA_CAST<uint8_t *>("Dissappear"),1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&anm2->_animState)))->AnimationState::Rewind();
AnimationState::Rewind(&anm2->_animState);
(anm2->_animState)._isPlaying = 1;
}
return;