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>
This commit is contained in:
1 parent
8c31c98a81
commit
837aa06518
63 files changed
+10557
-12054
No files matched your search
@@ -46,396 +46,6 @@ AnimationState::AnimationState(void *owner, AnimationState *other)
|
||||
return;
|
||||
}
|
||||
|
||||
// 004087a0
|
||||
AnimationState::~AnimationState()
|
||||
{
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
|
||||
puStack_c = &LAB_00af0b40;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
if (this->_layerFrames != (void *)0x0) {
|
||||
local_8 = 0;
|
||||
tracked_alloc(1,this->_layerFrames,0);
|
||||
this->_layerFrames = (void *)0x0;
|
||||
}
|
||||
if (this->_nullLayerFrames != (void *)0x0) {
|
||||
local_8 = 1;
|
||||
tracked_alloc(1,this->_nullLayerFrames,0);
|
||||
this->_nullLayerFrames = (void *)0x0;
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408830
|
||||
void AnimationState::SetAnimationData(void *animData)
|
||||
{
|
||||
void *pvVar1;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
int64_t allocBytes;
|
||||
|
||||
puStack_c = &LAB_00af0b60;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
this->_animData = animData;
|
||||
if (this->_layerFrames != (void *)0x0) {
|
||||
local_8 = 0;
|
||||
tracked_alloc(1,this->_layerFrames,0);
|
||||
this->_layerFrames = (void *)0x0;
|
||||
}
|
||||
if (this->_nullLayerFrames != (void *)0x0) {
|
||||
local_8 = 1;
|
||||
tracked_alloc(1,this->_nullLayerFrames,0);
|
||||
this->_nullLayerFrames = (void *)0x0;
|
||||
}
|
||||
local_8 = 0xffffffff;
|
||||
pvVar1 = this->_animData;
|
||||
if (pvVar1 != (void *)0x0) {
|
||||
if (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x1c)) != 0) {
|
||||
allocBytes = (uint64_t)*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x1c)) * 4;
|
||||
pvVar1 = tracked_alloc(0,(void *)0x0,
|
||||
(uint64_t)
|
||||
(-GHIDRA_UINT((GHIDRA_INT(((uint64_t)allocBytes >> 0x20)) != 0)) | GHIDRA_UINT(allocBytes))
|
||||
);
|
||||
this->_layerFrames = pvVar1;
|
||||
memset(pvVar1,0xff,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_animData) + 0x1c)) << 2);
|
||||
pvVar1 = this->_animData;
|
||||
if (pvVar1 == (void *)0x0) goto LAB_00408935;
|
||||
}
|
||||
if (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x24)) != 0) {
|
||||
allocBytes = (uint64_t)*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x24)) * 4;
|
||||
pvVar1 = tracked_alloc(0,(void *)0x0,
|
||||
(uint64_t)
|
||||
(-GHIDRA_UINT((GHIDRA_INT(((uint64_t)allocBytes >> 0x20)) != 0)) | GHIDRA_UINT(allocBytes))
|
||||
);
|
||||
this->_nullLayerFrames = pvVar1;
|
||||
memset(pvVar1,0xff,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_animData) + 0x24)) << 2);
|
||||
}
|
||||
}
|
||||
LAB_00408935:
|
||||
this->_animFrame = (float)&DAT_bf800000;
|
||||
this->_isPlaying = 0;
|
||||
this->_currentlyTriggeredEvents = 0;
|
||||
this->_previouslyTriggeredEvents = 0;
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408970
|
||||
void AnimationState::ChangeAnimationKeepFrame(void *animData)
|
||||
{
|
||||
uint64_t qVar1;
|
||||
void *newNullLayerCount;
|
||||
void *pvVar2;
|
||||
uint32_t uVar3;
|
||||
uint64_t *allocatedBytes;
|
||||
uint32_t newLayerCount;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
void *newAnimData;
|
||||
void *temp_5f5450bd6d;
|
||||
|
||||
newAnimData = animData;
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00af0b80;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
newNullLayerCount = this->_animData;
|
||||
if (newNullLayerCount == (void *)0x0) {
|
||||
uVar3 = 0;
|
||||
}
|
||||
else {
|
||||
uVar3 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newNullLayerCount) + 0x1c));
|
||||
}
|
||||
if (animData == (void *)0x0) {
|
||||
newLayerCount = 0;
|
||||
}
|
||||
else {
|
||||
newLayerCount = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(animData) + 0x1c));
|
||||
}
|
||||
if (newNullLayerCount == (void *)0x0) {
|
||||
animData = (void *)0x0;
|
||||
}
|
||||
else {
|
||||
animData = *(void **)(GHIDRA_CAST<char *>(newNullLayerCount) + 0x24);
|
||||
}
|
||||
if (newAnimData == (void *)0x0) {
|
||||
newNullLayerCount = (void *)0x0;
|
||||
}
|
||||
else {
|
||||
newNullLayerCount = *(void **)(GHIDRA_CAST<char *>(newAnimData) + 0x24);
|
||||
}
|
||||
if (uVar3 != newLayerCount) {
|
||||
if (GHIDRA_INT(newLayerCount) < 1) {
|
||||
if (this->_layerFrames != (void *)0x0) {
|
||||
local_8 = 0;
|
||||
tracked_alloc(1,this->_layerFrames,0);
|
||||
local_8 = 0xffffffff;
|
||||
this->_layerFrames = (void *)0x0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pvVar2 = tracked_alloc(0,(void *)0x0,
|
||||
(uint64_t)
|
||||
(-GHIDRA_UINT((GHIDRA_INT(((uint64_t)newLayerCount * 4 >> 0x20)) != 0)) |
|
||||
GHIDRA_UINT(((uint64_t)newLayerCount * 4))));
|
||||
memset(pvVar2,0xff,newLayerCount * 4);
|
||||
if (0 < GHIDRA_INT(uVar3)) {
|
||||
memcpy(pvVar2,this->_layerFrames,uVar3 << 2);
|
||||
}
|
||||
temp_5f5450bd6d = this->_layerFrames;
|
||||
if (temp_5f5450bd6d != (void *)0x0) {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
uVar3 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(temp_5f5450bd6d) + -4));
|
||||
qVar1 = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar3;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar3));
|
||||
free((void *)(GHIDRA_INT(temp_5f5450bd6d) + -4));
|
||||
local_8 = 0xffffffff;
|
||||
}
|
||||
this->_layerFrames = pvVar2;
|
||||
}
|
||||
}
|
||||
if (animData != newNullLayerCount) {
|
||||
if (GHIDRA_INT(newNullLayerCount) < 1) {
|
||||
if (this->_nullLayerFrames != (void *)0x0) {
|
||||
local_8 = 2;
|
||||
tracked_alloc(1,this->_nullLayerFrames,0);
|
||||
this->_nullLayerFrames = (void *)0x0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pvVar2 = tracked_alloc(0,(void *)0x0,
|
||||
(uint64_t)
|
||||
(-GHIDRA_UINT((GHIDRA_INT((ZEXT48(newNullLayerCount) * 4 >> 0x20)) != 0)) |
|
||||
GHIDRA_UINT((ZEXT48(newNullLayerCount) * 4))));
|
||||
memset(pvVar2,0xff,GHIDRA_INT(newNullLayerCount) * 4);
|
||||
if (0 < GHIDRA_INT(animData)) {
|
||||
memcpy(pvVar2,this->_nullLayerFrames,GHIDRA_INT(animData) << 2);
|
||||
}
|
||||
newNullLayerCount = this->_nullLayerFrames;
|
||||
if (newNullLayerCount != (void *)0x0) {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
uVar3 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newNullLayerCount) + -4));
|
||||
qVar1 = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar3;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar3));
|
||||
free((void *)(GHIDRA_INT(newNullLayerCount) + -4));
|
||||
this->_nullLayerFrames = (void *)0x0;
|
||||
}
|
||||
this->_layerFrames = pvVar2;
|
||||
}
|
||||
}
|
||||
this->_animData = newAnimData;
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408b90
|
||||
void AnimationState::AdvanceLayerPosition(int layerId, float targetFrame)
|
||||
{
|
||||
int frameIdx;
|
||||
void *animData;
|
||||
int frameOffset;
|
||||
int layerData;
|
||||
void *layerFrames;
|
||||
|
||||
animData = this->_animData;
|
||||
if (((animData == (void *)0x0) || (layerId < 0)) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x1c)) <= layerId)) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
||||
animData = this->_animData;
|
||||
}
|
||||
layerFrames = this->_layerFrames;
|
||||
frameIdx = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(layerFrames) + layerId * 4));
|
||||
layerData = layerId * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18));
|
||||
if (-1 < frameIdx) {
|
||||
frameOffset = frameIdx * 0x6c;
|
||||
do {
|
||||
frameIdx = frameIdx + 1;
|
||||
if (*GHIDRA_CAST<int *>((layerData + 8)) <= frameIdx) {
|
||||
return;
|
||||
}
|
||||
if (targetFrame < (float)*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((layerData + 4)) + 0x68 + frameOffset))) {
|
||||
return;
|
||||
}
|
||||
frameOffset = frameOffset + 0x6c;
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(layerFrames) + layerId * 4)) = frameIdx;
|
||||
} while (-1 < frameIdx);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408c10
|
||||
void AnimationState::AdvanceNullLayerPosition(int nullLayerID, float targetFrame)
|
||||
{
|
||||
int keyframe;
|
||||
void *animData;
|
||||
int keyframeOffset;
|
||||
int nullLayerAnim;
|
||||
void *nullLayerFrames;
|
||||
|
||||
animData = this->_animData;
|
||||
if (((animData == (void *)0x0) || (nullLayerID < 0)) ||
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x24)) <= nullLayerID)) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
||||
animData = this->_animData;
|
||||
}
|
||||
nullLayerFrames = this->_nullLayerFrames;
|
||||
keyframe = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nullLayerFrames) + nullLayerID * 4));
|
||||
nullLayerAnim = nullLayerID * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x20));
|
||||
if (-1 < keyframe) {
|
||||
keyframeOffset = keyframe * 0x54;
|
||||
do {
|
||||
keyframe = keyframe + 1;
|
||||
if (*GHIDRA_CAST<int *>((nullLayerAnim + 0xc)) <= keyframe) {
|
||||
return;
|
||||
}
|
||||
if (targetFrame < (float)*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((nullLayerAnim + 8)) + 0x50 + keyframeOffset))) {
|
||||
return;
|
||||
}
|
||||
keyframeOffset = keyframeOffset + 0x54;
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(nullLayerFrames) + nullLayerID * 4)) = keyframe;
|
||||
} while (-1 < keyframe);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408c90
|
||||
void AnimationState::FireTriggersAtCurrentFrame()
|
||||
{
|
||||
uint32_t eventIdx;
|
||||
void *animData;
|
||||
|
||||
animData = this->_animData;
|
||||
if (animData == (void *)0x0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("AnimationData is NULL\n"));
|
||||
animData = this->_animData;
|
||||
}
|
||||
eventIdx = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x2c)) != 0) {
|
||||
do {
|
||||
if ((float)*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x28)) + 4 + eventIdx * 8)) == this->_animFrame) {
|
||||
this->_currentlyTriggeredEvents =
|
||||
this->_currentlyTriggeredEvents |
|
||||
1 << (*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x28)) + eventIdx * 8)) & 0x1f);
|
||||
this->_previouslyTriggeredEvents =
|
||||
this->_previouslyTriggeredEvents |
|
||||
1 << (*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x28)) + eventIdx * 8)) & 0x1f);
|
||||
}
|
||||
eventIdx = eventIdx + 1;
|
||||
} while (eventIdx < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(animData) + 0x2c)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408d00
|
||||
void AnimationState::AdvancePosition(int targetFrame)
|
||||
{
|
||||
void *animData;
|
||||
uint32_t layer;
|
||||
float targetFrameFloat;
|
||||
float currentFrame;
|
||||
double dVar1;
|
||||
|
||||
currentFrame = this->_animFrame;
|
||||
dVar1 = floor((double)currentFrame);
|
||||
if (targetFrame < GHIDRA_INT(dVar1)) {
|
||||
KAGE_LogMessage(0x10,(uint8_t *)
|
||||
"Animation::AdvancePosition cannot go backward (new: %d, cur: %d)\n");
|
||||
currentFrame = this->_animFrame;
|
||||
}
|
||||
targetFrameFloat = (float)targetFrame;
|
||||
this->_currentlyTriggeredEvents = 0;
|
||||
if (currentFrame < targetFrameFloat) {
|
||||
do {
|
||||
dVar1 = floor((double)this->_animFrame);
|
||||
this->_animFrame = (float)dVar1 + 1.0;
|
||||
FireTriggersAtCurrentFrame(this);
|
||||
} while (this->_animFrame <= targetFrameFloat && targetFrameFloat != this->_animFrame);
|
||||
}
|
||||
animData = this->_animData;
|
||||
layer = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x1c)) != 0) {
|
||||
do {
|
||||
AdvanceLayerPosition(this,layer,targetFrameFloat);
|
||||
animData = this->_animData;
|
||||
layer = layer + 1;
|
||||
} while (layer < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(animData) + 0x1c)));
|
||||
}
|
||||
layer = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x24)) != 0) {
|
||||
do {
|
||||
AdvanceNullLayerPosition(this,layer,targetFrameFloat);
|
||||
layer = layer + 1;
|
||||
} while (layer < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_animData) + 0x24)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408e00
|
||||
void AnimationState::SetFrameFloat(float frame)
|
||||
{
|
||||
void *animData;
|
||||
uint32_t layer;
|
||||
long double lastFrame;
|
||||
float clampedFrame;
|
||||
|
||||
lastFrame = (long double)nextafterf((float)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_animData) + 0x30)),0);
|
||||
clampedFrame = (float)lastFrame;
|
||||
if (frame <= (float)lastFrame) {
|
||||
clampedFrame = frame;
|
||||
}
|
||||
this->_currentlyTriggeredEvents = 0;
|
||||
this->_animFrame = clampedFrame;
|
||||
FireTriggersAtCurrentFrame(this);
|
||||
animData = this->_animData;
|
||||
layer = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x1c)) != 0) {
|
||||
do {
|
||||
if (((animData == (void *)0x0) || (GHIDRA_INT(layer) < 0)) ||
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x1c)) <= GHIDRA_INT(layer))) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_layerFrames) + layer * 4)) = 0;
|
||||
AdvanceLayerPosition(this,layer,frame);
|
||||
animData = this->_animData;
|
||||
layer = layer + 1;
|
||||
} while (layer < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(animData) + 0x1c)));
|
||||
}
|
||||
layer = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x24)) != 0) {
|
||||
do {
|
||||
if (((animData == (void *)0x0) || (GHIDRA_INT(layer) < 0)) ||
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x24)) <= GHIDRA_INT(layer))) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_nullLayerFrames) + layer * 4)) = 0;
|
||||
AdvanceNullLayerPosition(this,layer,frame);
|
||||
animData = this->_animData;
|
||||
layer = layer + 1;
|
||||
} while (layer < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(animData) + 0x24)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00408ef0
|
||||
void AnimationState::SetLayerFrame(int layerID, int frame)
|
||||
{
|
||||
@@ -488,94 +98,6 @@ void AnimationState::SetNullLayerFrame(int nullLayerId, int frame)
|
||||
return;
|
||||
}
|
||||
|
||||
// 00409030
|
||||
void AnimationState::Update()
|
||||
{
|
||||
int targetFrame;
|
||||
float nextFrame;
|
||||
double dVar1;
|
||||
void *animData;
|
||||
float currentFrame;
|
||||
|
||||
animData = this->_animData;
|
||||
if ((animData != (void *)0x0) && (this->_isPlaying != 0)) {
|
||||
currentFrame = this->_animFrame;
|
||||
nextFrame = currentFrame + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(this->_animation) + 0x104));
|
||||
dVar1 = floor((double)nextFrame);
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x30)) <= GHIDRA_INT(dVar1)) {
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(animData) + 0x34)) != '\0') {
|
||||
Rewind(this);
|
||||
return;
|
||||
}
|
||||
targetFrame = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x30)) + -1;
|
||||
dVar1 = floor((double)currentFrame);
|
||||
if (GHIDRA_INT(dVar1) <= targetFrame) {
|
||||
AdvancePosition(this,targetFrame);
|
||||
}
|
||||
this->_isPlaying = 0;
|
||||
return;
|
||||
}
|
||||
AdvancePosition(this,GHIDRA_INT(dVar1));
|
||||
this->_animFrame = nextFrame;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 0040a1b0
|
||||
void AnimationState::Rewind()
|
||||
{
|
||||
void *animData;
|
||||
uint32_t layerIdx;
|
||||
|
||||
this->_animFrame = 0.0;
|
||||
this->_currentlyTriggeredEvents = 0;
|
||||
this->_previouslyTriggeredEvents = 0;
|
||||
FireTriggersAtCurrentFrame();
|
||||
animData = this->_animData;
|
||||
layerIdx = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x1c)) != 0) {
|
||||
do {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_layerFrames) + layerIdx * 4)) = 0;
|
||||
layerIdx = layerIdx + 1;
|
||||
animData = this->_animData;
|
||||
} while (layerIdx < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(animData) + 0x1c)));
|
||||
}
|
||||
layerIdx = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x24)) != 0) {
|
||||
do {
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_nullLayerFrames) + layerIdx * 4)) = 0;
|
||||
layerIdx = layerIdx + 1;
|
||||
} while (layerIdx < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this->_animData) + 0x24)));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 0040a220
|
||||
void * AnimationState::GetLayerFrame(int layerId)
|
||||
{
|
||||
int iVar1;
|
||||
void *animData;
|
||||
int frameIndex;
|
||||
|
||||
if (this->_animData == (void *)0x0) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("AnimationData is NULL\n"));
|
||||
}
|
||||
if ((layerId < 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_animation) + 0x80)) <= layerId)) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n"));
|
||||
}
|
||||
animData = this->_animData;
|
||||
if ((((animData == (void *)0x0) || (layerId < 0)) ||
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_animation) + 0x80)) < layerId)) ||
|
||||
(((iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + layerId * 4 + 0x38)), iVar1 < 0 ||
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x1c)) <= iVar1)) ||
|
||||
((frameIndex = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this->_layerFrames) + iVar1 * 4)), frameIndex < 0 ||
|
||||
(iVar1 = iVar1 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18)), *GHIDRA_CAST<int *>((iVar1 + 8)) <= frameIndex))))
|
||||
)) {
|
||||
return (void *)0x0;
|
||||
}
|
||||
return (void *)(frameIndex * 0x6c + *GHIDRA_CAST<int *>((iVar1 + 4)));
|
||||
}
|
||||
|
||||
// 0040ac70
|
||||
void * AnimationState::GetNullFrameById(int nullLayerId)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user