Files
isaac-port/generated-src/layer_state.cpp
T
shweetandClaude Opus 5.5 837aa06518 Curation round 1: 66 boot-path functions rewritten in src/; the game links into a Linux executable
Six agents took over ANM2/AnimationState/LayerState, ItemConfig, EntityConfig, StringTable/Font/FormattedText/RichText,
OptionsConfig/ChallengeParams and ModManager/ModEntry functions (FormattedText::parse checked against a transliteration
of its assembly on 200,000 random inputs). 174 field rows and 32 names from the round are merged into db/.
source_tree.py: a struct or class src/*.h defines is no longer emitted in classes.h (class takeover) and gets no stubs;
data labels get stub definitions. build/isaac links (64-bit ELF) and stops at the first function not reconstructed:
IsaacMain. Boot path 64/615 functions curated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:13:25 -05:00

88 lines
2.8 KiB
C++

#include "classes.h"
// 00407a60
LayerState::~LayerState()
{
char isLastRef;
int in_ECX;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
puStack_c = &LAB_00af09f0;
local_10 = ExceptionList;
ExceptionList = &local_10;
local_8 = 0;
if (*GHIDRA_CAST<int **>((in_ECX + 0x9c)) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>((in_ECX + 0x9c)) + 0xc))
(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(in_ECX + 0x98);
}
}
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((in_ECX + 8)))))->msvc::string::_Tidy_deallocate();
ExceptionList = local_10;
return;
}
// 00408590
void * LayerState::GetTexture(void *outTexture)
{
int iVar1;
int iVar2;
int *texture;
texture = GHIDRA_CAST<int *>(this->_spriteSheet);
if (texture != GHIDRA_CAST<int *>(0x0)) {
iVar1 = this->_minFilterMode;
if (((texture[0xc] != iVar1) || (texture[0xd] != this->_magFilterMode)) &&
((iVar2 = this->_magFilterMode, iVar1 != texture[0xc] || (iVar2 != texture[0xd])))) {
(**(code **)(*texture + 0x44))(iVar1,iVar2);
texture[0xc] = iVar1;
texture[0xd] = iVar2;
texture = GHIDRA_CAST<int *>(this->_spriteSheet);
}
iVar1 = this->_wrapSMode;
if (((texture[0xe] != iVar1) || (texture[0xf] != this->_wrapTMode)) &&
((iVar2 = this->_wrapTMode, iVar1 != texture[0xe] || (iVar2 != texture[0xf])))) {
(**(code **)(*texture + 0x48))(iVar1,iVar2);
texture[0xe] = iVar1;
texture[0xf] = iVar2;
}
}
(GHIDRA_CAST<KAGE::SmartPointer *>((outTexture)))->KAGE::SmartPointer::operator_assign(&this->_spriteSheet);
return outTexture;
}
// 00408640
void LayerState::SetTexture(void *texture, void *textureRefCount)
{
char isLastRef;
uint32_t uVar1;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
puStack_c = &LAB_00af0b1d;
local_10 = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
local_8 = 0;
if (texture != (void *)0x0) {
this->_minFilterMode = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(texture) + 0x30));
this->_magFilterMode = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(texture) + 0x34));
this->_wrapSMode = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(texture) + 0x38));
this->_wrapTMode = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(texture) + 0x3c));
}
(GHIDRA_CAST<KAGE::SmartPointer *>((&this->_spriteSheet)))->KAGE::SmartPointer::operator_assign(&texture);
local_8 = 1;
if (textureRefCount != (void *)0x0) {
isLastRef = (**(code **)(*GHIDRA_CAST<int *>(textureRefCount) + 0xc))(uVar1);
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&texture);
}
}
ExceptionList = local_10;
return;
}