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

+41 -41
View File
@@ -117,7 +117,7 @@ void Entity_Bomb::Init(int type, int variant, int subType, uint32_t initSeed)
this->_radiusMultiplier = 1.0;
this->_stickyTarget = 0;
if (this->_config != (void *)0x0) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),1);
ANM2::Load(&this->_sprite,GHIDRA_CAST<std_string *>((GHIDRA_INT(this->_config) + 0x74)),1);
}
(this->_hitList)._end = (this->_hitList)._begin;
variantLocal = this->_variant;
@@ -156,9 +156,9 @@ LAB_006a2265:
else if (((variantLocal == 4) || (variantLocal == 3)) ||
((variantLocal == 8 || ((variantLocal == 0x11 || (variantLocal == 0x12)))))) {
if (this->_subtype == 1) {
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("BombReturn"),1);
bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("BombReturn"),1);
if (bVar2 != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::GetFloorColorAt(&floorColor,&this->_pos,this->_size);
@@ -172,7 +172,7 @@ LAB_006a2265:
floorTint._tint[2] = floorColor._blue * 2.0;
if ((this->_sprite)._layerCount != 0) {
do {
pLVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(layerIndex);
pLVar4 = ANM2::GetLayer(&this->_sprite,layerIndex);
if (pLVar4->_layerData == (void *)0x0) {
layerName._buf[0] = '\0';
layerName._buf[1] = '\0';
@@ -227,9 +227,9 @@ LAB_006a2265:
else {
pbVar5 = GHIDRA_CAST<uint8_t *>("Pulse");
}
bVar2 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(pbVar5,1);
bVar2 = ANM2::SetAnimation(&this->_sprite,pbVar5,1);
if (bVar2 != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
LAB_006a2468:
@@ -390,14 +390,14 @@ void Entity_Bomb::Update()
}
fVar9 = -3.0;
if ((this->_flags & 0x20) != 0) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>(s_Idle),0);
ANM2::SetFrame(&this->_sprite,GHIDRA_CAST<std_string *>(s_Idle),0);
if (this->_hasCostumes != 0) {
costumeLoaded = &this->_bombCostumesSprites[0]._loaded;
local_84 = &DAT_00000005;
do {
if (*costumeLoaded != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xd9)))))->AnimationState::Update();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xb9)))))->AnimationState::Update();
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xd9)));
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xb9)));
}
costumeLoaded = costumeLoaded + 0x114;
local_84 = local_84 + -1;
@@ -514,28 +514,28 @@ LAB_006a2829:
goto LAB_006a2a0d;
}
(this->_sprite)._rotation = 0.0;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
ANM2::Play(&this->_sprite,s_Idle,0);
this->_rocketSpeed = 0.0;
}
else {
LAB_006a2a0d:
if (((this->_sprite)._animState._animData != (void *)0x0) &&
((this->_sprite)._animState._isPlaying != 0)) {
bVar4 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsLoopingAnimation();
bVar4 = AnimationState::IsLoopingAnimation(&(this->_sprite)._animState);
stickyTarget = extraout_EDX;
if (bVar4 == 0) goto LAB_006a2a4a;
}
if ((stickyTarget != 2) && (this->_pitfallState == 0)) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Pulse"),0);
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("Pulse"),0);
}
}
LAB_006a2a4a:
bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST<uint8_t *>("Pulse"));
bVar4 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST<uint8_t *>("Pulse"));
if ((bVar4 != 0) && (bVar4 = IsRocket(this), bVar4 == 0)) {
if ((this->_isFetus == 0) &&
(((this->_spawnerType == 1 && (pEVar8 != GHIDRA_CAST<Entity_Player *>(0x0))) &&
(bVar4 = (GHIDRA_CAST<Entity_Player *>((pEVar8)))->Entity_Player::HasCollectible(0x89,0), bVar4 != 0)))) {
stickyTarget = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetFrame();
stickyTarget = ANM2::GetFrame(&this->_sprite);
if (0xe < stickyTarget) {
stickyTarget = 0;
goto LAB_006a2afe;
@@ -543,12 +543,12 @@ LAB_006a2a4a:
}
else {
local_80 = GHIDRA_CAST<Entity_Player *>(0x0);
stickyTarget = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::GetAnimationLength();
stickyTarget = AnimationState::GetAnimationLength(&(this->_sprite)._animState);
stickyTarget = (stickyTarget - *extraout_EDX_00) + -1;
if (stickyTarget < 0) {
stickyTarget = stickyTarget + (stickyTarget / 0xf) * -0xf + 0xf;
}
iVar7 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetFrame();
iVar7 = ANM2::GetFrame(&this->_sprite);
if (stickyTarget != iVar7) {
LAB_006a2afe:
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(stickyTarget);
@@ -1252,7 +1252,7 @@ LAB_006a4412:
}
this->_dead = 1;
if (this->_pitfallState == 0) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Explode"),0);
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("Explode"),0);
}
if (this->_isFetus == 0) {
pBVar5 = BitSet128::operator_and(&local_110,&this->_tearFlags,&g_tearFlagSticky);
@@ -1416,13 +1416,13 @@ LAB_006a4412:
this->_dead = 0;
uVar6 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::RandomInt(0x1e);
this->_explosionCountdown1 = uVar6 + 0x3c;
bVar4 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>("Appear"),1);
bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST<uint8_t *>("Appear"),1);
if (bVar4 != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
AnimationState::Rewind(&(this->_sprite)._animState);
(this->_sprite)._animState._isPlaying = 1;
}
if ((this->_sprite)._animState._animData != (void *)0x0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(8.0);
AnimationState::SetFrameFloat(&(this->_sprite)._animState,8.0);
}
uVar6 = (GHIDRA_CAST<RNG *>((&this->_dropRNG)))->RNG::Next();
tmpVecPtr = RandomVector(&local_e0,uVar6);
@@ -1549,7 +1549,7 @@ LAB_006a4412:
this->_friction = this->_friction * 0.8;
}
if ((this->_sprite)._animState._animData != (void *)0x0) {
bVar4 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b670d0);
bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b670d0);
manager = g_manager;
if (bVar4 != 0) {
local_80 = GHIDRA_CAST<Entity_Player *>(0xab);
@@ -1581,7 +1581,7 @@ LAB_006a4412:
this->_collisionCooldown = 4;
}
if (((this->_sprite)._animState._animData != (void *)0x0) &&
(bVar4 = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST<uint8_t *>("DropSound")),
(bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST<uint8_t *>("DropSound")),
bVar4 != 0)) {
if (this->_variant == 0x11) {
(GHIDRA_CAST<SoundEffects *>((&g_manager->_sfxManager)))->SoundEffects::Play(0x28,1.0,4,0,0.8,0.0);
@@ -1610,8 +1610,8 @@ LAB_006a4412:
local_80 = GHIDRA_CAST<Entity_Player *>(&DAT_00000005);
do {
if (*costumeLoaded != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xd9)))))->AnimationState::Update();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xb9)))))->AnimationState::Update();
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xd9)));
AnimationState::Update(GHIDRA_CAST<AnimationState *>((costumeLoaded + -0xb9)));
}
costumeLoaded = costumeLoaded + 0x114;
local_80 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_80[-1])) + 0x2eff))));
@@ -1723,7 +1723,7 @@ void Entity_Bomb::Render(Vector *offset)
position->x = (float)dVar7 / fVar6 + offset->x;
(this->_renderPosition).y = (float)dVar8 / fVar6 + fVar1;
if (this->_hasCostumes != 0) {
layerFrame = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0);
layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0);
fVar1 = (this->_sprite)._scale.x;
fVar3 = (*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(layerFrame) + 0x10)) + (this->_sprite)._offset.x) * fVar1;
fVar6 = (this->_sprite)._scale.y;
@@ -1809,7 +1809,7 @@ void Entity_Bomb::Render(Vector *offset)
FUN_00862060(this,offset);
return;
}
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero);
ANM2::Render(&this->_sprite,position,&g_vectorZero,&g_vectorZero);
FUN_00862060(this,offset);
}
return;
@@ -1916,7 +1916,7 @@ void Entity_Bomb::update_sparks()
bomb = this;
do {
if (costumeSprite->_loaded != 0) {
(GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::Reset();
ANM2::Reset(costumeSprite);
}
manager = g_manager;
costumeSprite = costumeSprite + 1;
@@ -2329,13 +2329,13 @@ LAB_006a794a:
}
}
if (spritePathSize != 0) {
(GHIDRA_CAST<ANM2 *>((local_1c4)))->ANM2::Load(GHIDRA_CAST<std_string *>(&spritePath),0);
ANM2::Load(local_1c4,GHIDRA_CAST<std_string *>(&spritePath),0);
pEVar9 = bomb;
layerIdx = GHIDRA_CAST<uint8_t *>(0x0);
bVar3 = extraout_CL;
if ((bomb->_sprite)._layerCount != 0) {
do {
layer = (GHIDRA_CAST<ANM2 *>((&pEVar9->_sprite)))->ANM2::GetLayer(layerIdx);
layer = ANM2::GetLayer(&pEVar9->_sprite,layerIdx);
if (layer->_layerData == (void *)0x0) {
tmpString._size = 0;
tmpString._capacity = 0xf;
@@ -2365,8 +2365,8 @@ LAB_006a794a:
bVar3 = extraout_CL_00;
} while (layerIdx < GHIDRA_CAST<uint8_t *>((pEVar9->_sprite)._layerCount));
}
(GHIDRA_CAST<ANM2 *>((local_1c4)))->ANM2::LoadGraphics(bVar3);
layer = (GHIDRA_CAST<ANM2 *>((local_1c4)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>("sparks"));
ANM2::LoadGraphics(local_1c4,bVar3);
layer = ANM2::GetLayer(local_1c4,GHIDRA_CAST<uint8_t *>("sparks"));
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
layer->_bitflags = layer->_bitflags | 1;
}
@@ -2377,14 +2377,14 @@ LAB_006a794a:
psVar8 = local_1bc;
costumeSprite = costumeIter;
if (local_1bc->_size != 0) {
(GHIDRA_CAST<ANM2 *>((costumeIter)))->ANM2::Load(local_1bc,0);
ANM2::Load(costumeIter,local_1bc,0);
layerIdx = GHIDRA_CAST<uint8_t *>(0x0);
pEVar9 = bomb;
pEVar11 = extraout_ECX;
if (bomb->_bombCostumesSprites[0]._layerCount != 0) {
do {
local_1cc = GHIDRA_CAST<Sprite *>(pEVar9->_bombCostumesSprites);
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_1cc))))->ANM2::GetLayer(layerIdx);
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(local_1cc),layerIdx);
if (layer->_layerData == (void *)0x0) {
tmpString._size = 0;
tmpString._capacity = 0xf;
@@ -2417,14 +2417,14 @@ LAB_006a794a:
psVar8 = local_1bc;
}
costumeSprite = costumeIter;
(GHIDRA_CAST<ANM2 *>((costumeIter)))->ANM2::LoadGraphics((uint8_t)pEVar11);
ANM2::LoadGraphics(costumeIter,(uint8_t)pEVar11);
psVar10 = &costumeSprite->_animDefaultName;
if (0xf < (costumeSprite->_animDefaultName)._capacity) {
psVar10 = *GHIDRA_CAST<std_string **>(psVar10->_buf);
}
bVar3 = (GHIDRA_CAST<ANM2 *>((costumeSprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(psVar10),1);
bVar3 = ANM2::SetAnimation(costumeSprite,GHIDRA_CAST<uint8_t *>(psVar10),1);
if (bVar3 != 0) {
(GHIDRA_CAST<AnimationState *>((&costumeSprite->_animState)))->AnimationState::Rewind();
AnimationState::Rewind(&costumeSprite->_animState);
(costumeSprite->_animState)._isPlaying = 1;
}
bomb->_hasCostumes = 1;
@@ -2440,9 +2440,9 @@ LAB_006a794a:
if (0xf < savedAnimNameCapacity) {
ppppppbVar6 = savedAnimName[0];
}
bVar3 = (GHIDRA_CAST<ANM2 *>((&bomb->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(ppppppbVar6),1);
bVar3 = ANM2::SetAnimation(&bomb->_sprite,GHIDRA_CAST<uint8_t *>(ppppppbVar6),1);
if (((bVar3 != 0) && ((pEVar9->_sprite)._animState._animData != (void *)0x0)) &&
((GHIDRA_CAST<AnimationState *>((&(pEVar9->_sprite)._animState)))->AnimationState::SetFrameFloat(local_1c0),
(AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,local_1c0),
(pEVar9->_sprite)._animState._animData != (void *)0x0)) {
(pEVar9->_sprite)._animState._isPlaying = 0;
}
@@ -2452,13 +2452,13 @@ LAB_006a794a:
if (0xf < savedAnimNameCapacity) {
ppppppbVar6 = savedAnimName[0];
}
bVar3 = (GHIDRA_CAST<ANM2 *>((&bomb->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<uint8_t *>(ppppppbVar6),1);
bVar3 = ANM2::SetAnimation(&bomb->_sprite,GHIDRA_CAST<uint8_t *>(ppppppbVar6),1);
if (bVar3 != 0) {
(GHIDRA_CAST<AnimationState *>((&(pEVar9->_sprite)._animState)))->AnimationState::Rewind();
AnimationState::Rewind(&(pEVar9->_sprite)._animState);
(pEVar9->_sprite)._animState._isPlaying = 1;
}
if ((pEVar9->_sprite)._animState._animData != (void *)0x0) {
(GHIDRA_CAST<AnimationState *>((&(pEVar9->_sprite)._animState)))->AnimationState::SetFrameFloat(local_1c0);
AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,local_1c0);
}
}
}