Files
isaac-port/generated-src/sprite.cpp
T
shweetandClaude Opus 5.5 69a354f843 Curation round 8: the first room plays: Isaac walks and shoots tears
Eight agents took over Room::Init's pieces, RailManager, Room::Render/render_lighting/Update, the GridEntity hierarchy
(walls, doors, rocks, pits, poop ...), Game::Update and interpolate_update, the run's save, update_ingame_input,
Game::Spawn with the entity factory and grid collision, the player's movement and tears through Weapon/Weapon_Tears,
PlayerManager's positions, the camera focus, MinimapConfig, PlayerHUD, mod shader rendering, Entity_Tear and
Entity_Effect. Integration wrote Level::get_secret_exit_kind, shared the secret-exit enum (four copies merged) and
fixed the generator's vtable-stub check (word boundary and namespace, not a substring).
Under gdb a run reaches the first room: doors, HUD with hearts and minimap, WASD movement with acceleration, arrow-key
tears that fly and splash. Floor and walls (Backdrop::RenderFloor/RenderWalls) and room transitions are next.
The official build/isaac reaches the start room and stops at Entity_NPC::Redirect. 2770 functions taken over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 06:43:01 -05:00

269 lines
5.5 KiB
C++

#include "classes.h"
// 004073d0
void Sprite::SetColor(ColorMod *color)
{
float fVar1;
float fVar2;
float fVar3;
if (&this->_color != color) {
fVar1 = color->_tint[1];
fVar2 = color->_tint[2];
fVar3 = color->_tint[3];
(this->_color)._tint[0] = color->_tint[0];
(this->_color)._tint[1] = fVar1;
(this->_color)._tint[2] = fVar2;
(this->_color)._tint[3] = fVar3;
fVar1 = color->_colorize[1];
fVar2 = color->_colorize[2];
fVar3 = color->_colorize[3];
(this->_color)._colorize[0] = color->_colorize[0];
(this->_color)._colorize[1] = fVar1;
(this->_color)._colorize[2] = fVar2;
(this->_color)._colorize[3] = fVar3;
*GHIDRA_CAST<uint64_t *>((this->_color)._offset) = *GHIDRA_CAST<uint64_t *>(color->_offset);
(this->_color)._offset[2] = color->_offset[2];
}
return;
}
// 00407420
uint8_t Sprite::FlipX()
{
return this->_flipX;
}
// 00407430
uint8_t Sprite::FlipY()
{
return this->_flipY;
}
// 0040a360
void Sprite::Play(std_string *animName, uint8_t isForce)
{
if (0xf < animName->_capacity) {
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
}
ANM2::Play(GHIDRA_CAST<ANM2 *>(this),GHIDRA_CAST<uint8_t *>(animName),isForce);
return;
}
// 0040a4b0
void Sprite::IsPlaying(uint8_t *param_1)
{
ANM2 *in_ECX;
if (0xf < *GHIDRA_CAST<uint32_t *>((param_1 + 0x14))) {
param_1 = *GHIDRA_CAST<uint8_t **>(param_1);
}
ANM2::IsPlaying(in_ECX,param_1);
return;
}
// 0040a530
uint8_t Sprite::IsFinished(std_string *animName)
{
uint8_t bVar1;
if (0xf < animName->_capacity) {
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
}
bVar1 = ANM2::IsFinishedImpl(GHIDRA_CAST<ANM2 *>(this),GHIDRA_CAST<uint8_t *>(animName));
return bVar1;
}
// 0040a5b0
uint8_t Sprite::SetAnimation(std_string *name, uint8_t isReset)
{
uint8_t bVar1;
if (0xf < name->_capacity) {
name = *GHIDRA_CAST<std_string **>(name->_buf);
}
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(this),GHIDRA_CAST<uint8_t *>(name),isReset);
return bVar1;
}
// 0040a720
void Sprite::SetFrame_1(int frame)
{
if ((this->_animState)._animData != (void *)0x0) {
AnimationState::SetFrameFloat(&this->_animState,(float)frame);
}
return;
}
// 0040a920
void Sprite::PlayOverlay(uint8_t *param_1, uint8_t param_2)
{
ANM2 *in_ECX;
if (0xf < *GHIDRA_CAST<uint32_t *>((param_1 + 0x14))) {
param_1 = *GHIDRA_CAST<uint8_t **>(param_1);
}
ANM2::PlayOverlay(in_ECX,param_1,param_2);
return;
}
// 0040a9d0
void Sprite::IsOverlayPlaying()
{
FUN_0040a9f0();
return;
}
// 0040aa50
void Sprite::IsOverlayFinished()
{
FUN_0040aa70();
return;
}
// 0040aad0
uint8_t Sprite::SetOverlayAnimation(std_string *animName, uint8_t isReset)
{
uint8_t bVar1;
if (0xf < animName->_capacity) {
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
}
bVar1 = ANM2::SetOverlayAnimation(GHIDRA_CAST<ANM2 *>(this),GHIDRA_CAST<uint8_t *>(animName),isReset);
return bVar1;
}
// 0040abb0
void Sprite::SetOverlayFrame(std_string *animName, int frame)
{
uint8_t isAnimationSet;
if (0xf < animName->_capacity) {
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
}
isAnimationSet = ANM2::SetOverlayAnimation(GHIDRA_CAST<ANM2 *>(this),GHIDRA_CAST<uint8_t *>(animName),1);
if ((isAnimationSet != 0) && ((this->_overlayAnimState)._animData != (void *)0x0)) {
AnimationState::SetFrameFloat(&this->_overlayAnimState,(float)frame);
}
return;
}
// 0040b000
uint8_t Sprite::IsEventTriggered(void *eventName)
{
uint8_t isTriggered;
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(eventName) + 0x14))) {
eventName = *(void **)eventName;
}
if ((this->_animState)._animData == (void *)0x0) {
return 0;
}
isTriggered = AnimationState::IsEventTriggered(&this->_animState,eventName);
return isTriggered;
}
// 0040b060
uint8_t Sprite::WasEventTriggered(std_string *eventName)
{
uint8_t local_AL_32;
if (0xf < eventName->_capacity) {
eventName = *GHIDRA_CAST<std_string **>(eventName->_buf);
}
if ((this->_animState)._animData == (void *)0x0) {
return 0;
}
local_AL_32 = AnimationState::WasEventTriggered(&this->_animState,GHIDRA_CAST<uint8_t *>(eventName));
return local_AL_32;
}
// 0040b200
LayerState * Sprite::GetLayer(uint8_t *layerName)
{
LayerState *layer;
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(this),layerName);
return layer;
}
// 0040bff0
void Sprite::LoadGraphics()
{
ANM2::LoadGraphics(GHIDRA_CAST<ANM2 *>(this),(uint8_t)this);
return;
}
// 00417200
Vector * Sprite::Scale()
{
return &this->_scale;
}
// 00417210
long double Sprite::Rotation()
{
return (long double)this->_rotation;
}
// 00420160
uint8_t Sprite::IsLoaded()
{
return this->_loaded;
}
// 00420170
void Sprite::SetScale(Vector *scale)
{
(this->_scale).x = scale->x;
(this->_scale).y = scale->y;
return;
}
// 004312e0
std_string * Sprite::GetFilename(std_string *outName)
{
(GHIDRA_CAST<msvc::string *>((outName->_buf)))->msvc::string::string(this);
return outName;
}
// 00431300
void Sprite::SetOverlayRenderPriority(uint8_t param_2)
{
this->_overlayRenderFirst = param_2;
return;
}
// 0043ee80
void Sprite::SetRotation(float rotation)
{
this->_rotation = rotation;
return;
}
// 00440e40
int Sprite::GetLayerCount()
{
return this->_layerCount;
}
// 00456340
void Sprite::set_offset(Vector *offset)
{
(this->_offset).x = offset->x;
(this->_offset).y = offset->y;
return;
}
// 00456360
long double Sprite::PlaybackSpeed()
{
return (long double)this->_playbackSpeed;
}
// 0049cb40
Vector * Sprite::Offset()
{
return &this->_offset;
}