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:
1 parent
d6e1ca7c6c
commit
780767f5e1
161 files changed
+8646
-21919
No files matched your search
@@ -97,7 +97,7 @@ void Entity_Projectile::Init(int type, int variant, int subType, uint32_t initSe
|
||||
(GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(this))))->Entity::Init(type,variant,subType,initSeed);
|
||||
this->_entityGridCollisionClass = 4;
|
||||
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->_height = -23.0;
|
||||
uVar1 = Random();
|
||||
@@ -125,7 +125,7 @@ void Entity_Projectile::Init(int type, int variant, int subType, uint32_t initSe
|
||||
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x470)))) = 0;
|
||||
uVar1 = g_graphicsManager_flags;
|
||||
if (iVar2 == 2) {
|
||||
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
||||
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x0));
|
||||
iVar2 = 1;
|
||||
if ((uVar1 & 4) == 0) {
|
||||
iVar2 = 6;
|
||||
@@ -136,7 +136,7 @@ void Entity_Projectile::Init(int type, int variant, int subType, uint32_t initSe
|
||||
layer->_blendMode[3] = 1;
|
||||
layer->_blendMode[4] = 1;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x10) {
|
||||
layer = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST<uint8_t *>(0x0));
|
||||
layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST<uint8_t *>(0x0));
|
||||
(layer->_pos).x = 0.0;
|
||||
(layer->_pos).y = 8.0;
|
||||
}
|
||||
@@ -425,7 +425,7 @@ void Entity_Projectile::Update()
|
||||
else {
|
||||
sprintf_s(subtypeHigh,0x20,GHIDRA_CAST<uint8_t *>("RegularTear%d"));
|
||||
}
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(subtypeHigh,0);
|
||||
ANM2::Play(&this->_sprite,subtypeHigh,0);
|
||||
this->_animKey = sizeIndex;
|
||||
}
|
||||
}
|
||||
@@ -437,9 +437,9 @@ void Entity_Projectile::Update()
|
||||
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST<std_string *>(auStack_3c));
|
||||
uStack_14 = -1;
|
||||
(GHIDRA_CAST<msvc::string *>((auStack_3c)))->msvc::string::_Tidy_deallocate();
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::LoadGraphics(0);
|
||||
ANM2::LoadGraphics(&this->_sprite,0);
|
||||
}
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(&DAT_00b1d6fc,0);
|
||||
ANM2::Play(&this->_sprite,&DAT_00b1d6fc,0);
|
||||
pvVar21 = (this->_sprite)._animState._animData;
|
||||
if (pvVar21 != (void *)0x0) {
|
||||
AnimationState::SetFrameFloat
|
||||
@@ -451,9 +451,9 @@ void Entity_Projectile::Update()
|
||||
}
|
||||
else if (sizeIndex == 2) {
|
||||
if (this->_animKey != 200) {
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Flickering"),0);
|
||||
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("Flickering"),0);
|
||||
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
||||
uVar5 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
|
||||
uVar5 = AnimationState::GetAnimationLength(animState);
|
||||
uVar9 = EntityPtr::Ref();
|
||||
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(uVar9 % uVar5);
|
||||
(GHIDRA_CAST<BlendMode *>((auStack_cc + 0x2c)))->BlendMode::SetMode(2,0);
|
||||
@@ -479,16 +479,16 @@ LAB_0065334c:
|
||||
}
|
||||
Isaac::Random(4);
|
||||
sprintf_s(auStack_8c + 8,0x20,GHIDRA_CAST<uint8_t *>(animFormat));
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(auStack_8c + 8,0);
|
||||
ANM2::Play(&this->_sprite,auStack_8c + 8,0);
|
||||
this->_animKey = 300;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (sizeIndex == 7) {
|
||||
if (this->_animKey != 400) {
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("MoveHori"),0);
|
||||
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>("MoveHori"),0);
|
||||
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
||||
uVar5 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
|
||||
uVar5 = AnimationState::GetAnimationLength(animState);
|
||||
uVar9 = EntityPtr::Ref();
|
||||
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(uVar9 % uVar5);
|
||||
this->_animKey = 400;
|
||||
@@ -506,7 +506,7 @@ LAB_0065334c:
|
||||
if (this->_scale <= 1.5 && this->_scale != 1.5) {
|
||||
animFormat = "Small";
|
||||
}
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>(animFormat),0);
|
||||
ANM2::Play(&this->_sprite,GHIDRA_CAST<uint8_t *>(animFormat),0);
|
||||
this->_animKey = 700;
|
||||
}
|
||||
}
|
||||
@@ -520,15 +520,15 @@ LAB_0065334c:
|
||||
else if (sizeIndex == 9) {
|
||||
if (this->_animKey != 500) {
|
||||
sprintf_s(animName,0x20,GHIDRA_CAST<uint8_t *>("Rotate%d"));
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(animName,0);
|
||||
ANM2::Play(&this->_sprite,animName,0);
|
||||
this->_animKey = 500;
|
||||
}
|
||||
}
|
||||
else if (sizeIndex == 0xb) {
|
||||
if (this->_animKey != 600) {
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(&DAT_00b1d6fc,0);
|
||||
ANM2::Play(&this->_sprite,&DAT_00b1d6fc,0);
|
||||
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
||||
uVar5 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
|
||||
uVar5 = AnimationState::GetAnimationLength(animState);
|
||||
uVar9 = EntityPtr::Ref();
|
||||
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite::SetFrame_1(uVar9 % uVar5);
|
||||
projectile->_animKey = 600;
|
||||
@@ -540,11 +540,11 @@ LAB_0065334c:
|
||||
player = GHIDRA_CAST<Entity_Player *>(&this->_sprite);
|
||||
pEStack_35c = player;
|
||||
if (this->_animKey != 800) {
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(player))))->ANM2::Play(&DAT_00b1d6fc,0);
|
||||
ANM2::Play(GHIDRA_CAST<ANM2 *>(player),&DAT_00b1d6fc,0);
|
||||
bVar3 = EntityPtr::Ref();
|
||||
set_byte_0x101(player,bVar3 & 1);
|
||||
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
||||
uVar5 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
|
||||
uVar5 = AnimationState::GetAnimationLength(animState);
|
||||
uVar9 = EntityPtr::Ref();
|
||||
player = pEStack_35c;
|
||||
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pEStack_35c))))->Sprite::SetFrame_1(uVar9 % uVar5);
|
||||
@@ -561,7 +561,7 @@ LAB_00653797:
|
||||
if (sizeIndex == 0xf) {
|
||||
if (this->_animKey != 1000) {
|
||||
anm2 = &this->_sprite;
|
||||
(GHIDRA_CAST<ANM2 *>((anm2)))->ANM2::Play(s_Idle,0);
|
||||
ANM2::Play(anm2,s_Idle,0);
|
||||
this = projectile;
|
||||
bVar3 = EntityPtr::Ref();
|
||||
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(anm2))))->Sprite::set_flip_x(bVar3 & 1);
|
||||
@@ -585,7 +585,7 @@ LAB_00653797:
|
||||
pEStack_35c = GHIDRA_CAST<Entity_Player *>((*piVar13 + 0x44c));
|
||||
if (GHIDRA_CAST<Entity_Player *>(this->_animKey) != pEStack_35c) {
|
||||
sprintf_s(animName,0x20,GHIDRA_CAST<uint8_t *>("RegularTear%d"));
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(animName,0);
|
||||
ANM2::Play(&this->_sprite,animName,0);
|
||||
this->_animKey = GHIDRA_INT(pEStack_35c);
|
||||
}
|
||||
pEStack_35c = GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Vector *>((&this->_velocity)))->Vector)::GetAngleDegrees();
|
||||
@@ -625,7 +625,7 @@ LAB_00653797:
|
||||
if (this->_visible == 0) {
|
||||
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>(()))->Entity)::GetSprite();
|
||||
spriteColor = GHIDRA_CAST<Font *>((GHIDRA_CAST<Sprite *>((sprite)))->Sprite)::Color();
|
||||
(GHIDRA_CAST<Font *>((spriteColor)))->Font::SetLineHeightModifier(0.0);
|
||||
Font::SetLineHeightModifier(spriteColor,0.0);
|
||||
}
|
||||
else {
|
||||
sprite = GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Entity *>(()))->Entity)::GetSprite();
|
||||
@@ -633,7 +633,7 @@ LAB_00653797:
|
||||
pCVar14 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
|
||||
fVar19 = (GHIDRA_CAST<Color *>((pCVar14)))->Color::A();
|
||||
pEStack_35c = GHIDRA_CAST<Entity_Player *>((fVar19 * 0.5));
|
||||
(GHIDRA_CAST<Font *>((spriteColor)))->Font::SetLineHeightModifier((float)pEStack_35c);
|
||||
Font::SetLineHeightModifier(spriteColor,(float)pEStack_35c);
|
||||
tmpEntity = GHIDRA_CAST<Entity *>(this->_child);
|
||||
vecResult = (GHIDRA_CAST<Vector *>((&this->_pos)))->Vector::__add(&tmpVecC,&this->_posOffset);
|
||||
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetPosition(vecResult);
|
||||
@@ -645,11 +645,11 @@ LAB_00653797:
|
||||
player = GHIDRA_CAST<Entity_Player *>(&this->_sprite);
|
||||
pEStack_35c = player;
|
||||
if (this->_animKey != 900) {
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(player))))->ANM2::Play(&DAT_00b1d6fc,0);
|
||||
ANM2::Play(GHIDRA_CAST<ANM2 *>(player),&DAT_00b1d6fc,0);
|
||||
bVar3 = EntityPtr::Ref();
|
||||
set_byte_0x101(player,bVar3 & 1);
|
||||
animState = GHIDRA_CAST<AnimationState *>(Config)::GetPillEffects();
|
||||
uVar5 = (GHIDRA_CAST<AnimationState *>((animState)))->AnimationState::GetAnimationLength();
|
||||
uVar5 = AnimationState::GetAnimationLength(animState);
|
||||
uVar9 = EntityPtr::Ref();
|
||||
player = pEStack_35c;
|
||||
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(pEStack_35c))))->Sprite::SetFrame_1(uVar9 % uVar5);
|
||||
@@ -786,7 +786,7 @@ LAB_00653d5c:
|
||||
pEStack_374 = GHIDRA_CAST<Entity_Player *>(0x0);
|
||||
}
|
||||
spriteColor = GHIDRA_CAST<Font *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->_sprite))))->Sprite)::Color();
|
||||
(GHIDRA_CAST<Font *>((spriteColor)))->Font::SetLineHeightModifier(0.0);
|
||||
Font::SetLineHeightModifier(spriteColor,0.0);
|
||||
this->_subtype = 1000;
|
||||
}
|
||||
}
|
||||
@@ -1298,7 +1298,7 @@ LAB_006555d5:
|
||||
tmpColor = GHIDRA_CAST<ColorMod *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&projectile->_sprite))))->Sprite)::Color();
|
||||
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(auStack_cc))))->Color::operator_assign(tmpColor);
|
||||
fVar19 = (GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(auStack_cc))))->Color::A();
|
||||
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>(auStack_cc))))->Font::SetLineHeightModifier(fVar19 * 0.3);
|
||||
Font::SetLineHeightModifier(GHIDRA_CAST<Font *>(auStack_cc),fVar19 * 0.3);
|
||||
tmpEntity->SetColor();
|
||||
}
|
||||
else if (sizeIndex == 7) {
|
||||
@@ -1418,7 +1418,7 @@ LAB_00655e83:
|
||||
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::ClearEntityFlags(4);
|
||||
(GHIDRA_CAST<Entity *>((tmpEntity)))->Entity::SetField380(24.0);
|
||||
anm2 = GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<Entity *>((tmpEntity)))->Entity)::GetSprite();
|
||||
(GHIDRA_CAST<ANM2 *>((anm2)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("ReGenProjectile"),0);
|
||||
ANM2::Play(anm2,GHIDRA_CAST<uint8_t *>("ReGenProjectile"),0);
|
||||
FUN_00440ed0();
|
||||
this = projectile;
|
||||
bVar3 = (GHIDRA_CAST<Entity *>((GHIDRA_CAST<Entity *>(projectile))))->Entity::HasEntityFlags(0x1000000);
|
||||
@@ -3077,7 +3077,7 @@ LAB_0065a73e:
|
||||
pCVar14 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(anm2))))->Sprite)::Color();
|
||||
fVar19 = (GHIDRA_CAST<Color *>((pCVar14)))->Color::A();
|
||||
VStack_3cc.y = fVar19 - *GHIDRA_CAST<float *>(VStack_3cc.y) * 0.1;
|
||||
(GHIDRA_CAST<Font *>((spriteColor)))->Font::SetLineHeightModifier(VStack_3cc.y);
|
||||
Font::SetLineHeightModifier(spriteColor,VStack_3cc.y);
|
||||
pCVar14 = GHIDRA_CAST<Color *>((GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(anm2))))->Sprite)::Color();
|
||||
VStack_3cc.y = (GHIDRA_CAST<Color *>((pCVar14)))->Color::A();
|
||||
this = projectile;
|
||||
@@ -3376,7 +3376,7 @@ void Entity_Projectile::Render(Vector *offset)
|
||||
uVar2 = uVar2 >> (rngShift & 0x1f) ^ uVar2;
|
||||
local_20.x = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) *
|
||||
2.3283062e-10 * 16.0;
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Render(&this->_renderPosition,&local_18,&local_20);
|
||||
ANM2::Render(&this->_sprite,&this->_renderPosition,&local_18,&local_20);
|
||||
}
|
||||
if (this->_isRenderedAtGround != 0) {
|
||||
(this->_posOffset).y = this->_height + (this->_posOffset).y;
|
||||
|
||||
Reference in new issue
Block a user