Files
isaac-port/generated-src/grid_entity_tnt.cpp
T
shweetandClaude Opus 5.5 9d4d4f5c64 Build 29: zero-length placeholder structs, generated-src with standard types
--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:41:34 -05:00

177 lines
6.8 KiB
C++

#include "classes.h"
// 0071ee90
void GridEntity_TNT::BeginBatches()
{
uint8_t bVar1;
EntityConfig_Entity *entity;
uint8_t *currentAnimChar;
char *ptr;
uint8_t *idleAnimChar;
uint32_t uVar2;
EntityConfig *entityConfig;
bool isLess;
uint8_t lowerBoundResult [8];
void *lowerBoundNode;
GridEntity_TNT *self;
uint32_t entityKey;
std_string anm2Path;
uint32_t local_14;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
uint8_t *animData;
local_8 = 0xffffffff;
puStack_c = &LAB_00af32ed;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT(&(&anm2Path)[1]._size);
ExceptionList = &local_10;
if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_game->_room) + this->_gridIndex * 4 + 0x76c)) = 1000;
}
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
self = this;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x16;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/grid/grid_tnt.anm2",0x17);
local_8 = 0;
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&anm2Path,1);
local_8 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar2 = anm2Path._capacity + 1;
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar2) {
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar2 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar2);
}
anm2Path._size = 0;
entityConfig = &g_manager->_entityConfig;
anm2Path._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) & 0xffffff00;
entityKey = 0x3e801b00;
_Find_lower_bound<>(lowerBoundResult,&entityKey);
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(lowerBoundNode) + 0xd)) == '\0') &&
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(lowerBoundNode) + 0x10)) < 0x3e801b01)) &&
(lowerBoundNode != (entityConfig->_entities)._head)) {
entity = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(lowerBoundNode) + 0x18));
}
else {
entity = (GHIDRA_CAST<EntityConfig *>((entityConfig)))->EntityConfig::GetEntity(1000,0,0);
}
if (entity != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
(GHIDRA_CAST<EntityConfig *>((entityConfig)))->EntityConfig::PreloadResources(entity);
}
animData = (this->_sprite)._animState._animData;
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
currentAnimChar = animData;
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
currentAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
}
idleAnimChar = s_Idle;
do {
bVar1 = *currentAnimChar;
isLess = bVar1 < *idleAnimChar;
if (bVar1 != *idleAnimChar) {
LAB_0071f028:
uVar2 = -GHIDRA_UINT(isLess) | 1;
goto LAB_0071f02d;
}
if (bVar1 == 0) break;
bVar1 = currentAnimChar[1];
isLess = bVar1 < idleAnimChar[1];
if (bVar1 != idleAnimChar[1]) goto LAB_0071f028;
currentAnimChar = currentAnimChar + 2;
idleAnimChar = idleAnimChar + 2;
} while (bVar1 != 0);
uVar2 = 0;
LAB_0071f02d:
if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
goto LAB_0071f059;
}
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
(this->_sprite)._animState._isPlaying = 1;
}
LAB_0071f059:
self->_frameCnt = GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0xc)))) < 4)) * 4 + -1;
ExceptionList = local_10;
return;
}
// 0071f090
void GridEntity_TNT::Update()
{
uint8_t isBlownPlaying;
int collisionClass;
uint32_t seed;
Vector *gridPos;
uint32_t extraout_ECX;
Vector posBuf;
collisionClass = 2;
if (3 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))))) {
collisionClass = 0;
}
this->_collisionClass = collisionClass;
switch(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc))))) {
case 0:
case 1:
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(s_Idle,0);
return;
case 2:
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("IdleMedium"),0);
return;
case 3:
goto LAB_0071f222;
case 4:
isBlownPlaying = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST<uint8_t *>("Blown"));
if (isBlownPlaying == 0) {
this->_frameCnt = this->_frameCnt + -1;
if (this->_frameCnt < 1) {
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("Blown"),0);
if (this->_frameCnt != 0) {
return;
}
seed = Random();
gridPos = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&posBuf);
(GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(1000,1,gridPos,&g_vectorZero,GHIDRA_CAST<Entity *>(0x0),0,seed,0);
gridPos = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&posBuf);
(GHIDRA_CAST<Game *>((g_game)))->Game::spawn_bomb_crater(gridPos,GHIDRA_CAST<Entity *>(0x0),1.0);
gridPos = (GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&posBuf);
(GHIDRA_CAST<Game *>((g_game)))->Game::BombDamage(gridPos,100.0,75.0,0,GHIDRA_CAST<Entity *>(0x0),g_tearFlagsNone,0x1004,0);
(GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&posBuf);
spawn_rock_particles();
(GHIDRA_CAST<GridEntity *>((GHIDRA_CAST<GridEntity *>(this))))->GridEntity::Position(&posBuf);
FUN_0071f4b0(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))),extraout_ECX);
if (GHIDRA_UINT(this->_gridIndex) < 0x1c0) {
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(g_game->_room) + this->_gridIndex * 4 + 0x76c)) = 900;
return;
}
return;
}
}
else if (this->_frameCnt < 1) {
return;
}
LAB_0071f222:
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Play(GHIDRA_CAST<uint8_t *>("ReadyToExplode"),0);
return;
default:
return;
}
}