The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1943 lines
89 KiB
C++
1943 lines
89 KiB
C++
#include "classes.h"
|
|
|
|
// 008c6240
|
|
void Menu_Bestiary::load_graphics()
|
|
{
|
|
byte bVar1;
|
|
Menu_Bestiary MVar2;
|
|
byte *pbVar3;
|
|
char *pcVar4;
|
|
uint uVar5;
|
|
bool bVar6;
|
|
std_string menuAnmPath;
|
|
std_string deathScreenAnmPath;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
Menu_Bestiary animData;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af1f85;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
menuAnmPath._size = 0;
|
|
menuAnmPath._capacity = 0xf;
|
|
menuAnmPath._buf[0] = '\0';
|
|
menuAnmPath._buf[1] = '\0';
|
|
menuAnmPath._buf[2] = '\0';
|
|
menuAnmPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(menuAnmPath._buf)) + 0x0))) = std::_Allocate(0x30);
|
|
menuAnmPath._size = 0x22;
|
|
menuAnmPath._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuAnmPath._buf))) + 0x0))),"gfx/ui/main menu/BestiaryMenu.anm2",0x23);
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 2)))))->ANM2::Load(&menuAnmPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < menuAnmPath._capacity) {
|
|
uVar5 = menuAnmPath._capacity + 1;
|
|
pcVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuAnmPath._buf))) + 0x0)));
|
|
if (0xfff < uVar5) {
|
|
pcVar4 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(menuAnmPath._buf)) + 0x0))) + -4));
|
|
uVar5 = menuAnmPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(menuAnmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar4,uVar5);
|
|
}
|
|
animData = this[0xf];
|
|
if (animData != (Menu_Bestiary)0x0) {
|
|
MVar2 = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
|
|
MVar2 = *GHIDRA_CAST<Menu_Bestiary *>(animData);
|
|
}
|
|
pbVar3 = s_Idle;
|
|
do {
|
|
bVar1 = *GHIDRA_CAST<byte *>(MVar2);
|
|
bVar6 = bVar1 < *pbVar3;
|
|
if (bVar1 != *pbVar3) {
|
|
LAB_008c6365:
|
|
uVar5 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_008c636a;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(MVar2) + 1));
|
|
bVar6 = bVar1 < pbVar3[1];
|
|
if (bVar1 != pbVar3[1]) goto LAB_008c6365;
|
|
MVar2 = (Menu_Bestiary)(GHIDRA_INT(MVar2) + 2);
|
|
pbVar3 = pbVar3 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar5 = 0;
|
|
LAB_008c636a:
|
|
if ((uVar5 == 0) && ((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) == 0 || (*GHIDRA_CAST<char *>((this + 0x13)) != '\0')))
|
|
) goto LAB_008c6396;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 2)))))->ANM2::SetAnimation(s_Idle,1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0xe)))))->AnimationState::Rewind();
|
|
*GHIDRA_CAST<undefined1 *>((this + 0x13)) = 1;
|
|
}
|
|
LAB_008c6396:
|
|
deathScreenAnmPath._size = 0;
|
|
deathScreenAnmPath._capacity = 0xf;
|
|
deathScreenAnmPath._buf[0] = '\0';
|
|
deathScreenAnmPath._buf[1] = '\0';
|
|
deathScreenAnmPath._buf[2] = '\0';
|
|
deathScreenAnmPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenAnmPath._buf)) + 0x0))) = std::_Allocate(0x20);
|
|
deathScreenAnmPath._size = 0x18;
|
|
deathScreenAnmPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(deathScreenAnmPath._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19);
|
|
local_14 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x47)))))->ANM2::Load(&deathScreenAnmPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < deathScreenAnmPath._capacity) {
|
|
uVar5 = deathScreenAnmPath._capacity + 1;
|
|
pcVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(deathScreenAnmPath._buf))) + 0x0)));
|
|
if (0xfff < uVar5) {
|
|
pcVar4 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenAnmPath._buf)) + 0x0))) + -4));
|
|
uVar5 = deathScreenAnmPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenAnmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar4))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar4,uVar5);
|
|
}
|
|
animData = this[0x54];
|
|
deathScreenAnmPath._size = 0;
|
|
deathScreenAnmPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenAnmPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenAnmPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (animData != (Menu_Bestiary)0x0) {
|
|
MVar2 = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
|
|
MVar2 = *GHIDRA_CAST<Menu_Bestiary *>(animData);
|
|
}
|
|
pcVar4 = "Diary";
|
|
do {
|
|
bVar1 = *GHIDRA_CAST<byte *>(MVar2);
|
|
bVar6 = bVar1 < (byte)*pcVar4;
|
|
if (bVar1 != *pcVar4) {
|
|
LAB_008c6487:
|
|
uVar5 = -GHIDRA_UINT(bVar6) | 1;
|
|
goto LAB_008c648c;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(MVar2) + 1));
|
|
bVar6 = bVar1 < (byte)pcVar4[1];
|
|
if (bVar1 != pcVar4[1]) goto LAB_008c6487;
|
|
MVar2 = (Menu_Bestiary)(GHIDRA_INT(MVar2) + 2);
|
|
pcVar4 = pcVar4 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar5 = 0;
|
|
LAB_008c648c:
|
|
if (uVar5 == 0) {
|
|
if (*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) == 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<char *>((this + 0x58)) != '\0') {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x47)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Diary"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x53)))))->AnimationState::Rewind();
|
|
*GHIDRA_CAST<undefined1 *>((this + 0x58)) = 1;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 008c64e0
|
|
void Menu_Bestiary::Update()
|
|
{
|
|
Menu_Bestiary MVar1;
|
|
Menu_Bestiary MVar2;
|
|
byte isAnimSet;
|
|
std_string *anim;
|
|
LayerState *arrowLayer;
|
|
void *ptr;
|
|
uint uVar3;
|
|
Menu_Bestiary MVar4;
|
|
void *currentAnim [5];
|
|
uint local_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
void *local_8;
|
|
|
|
local_8 = (void *)0xffffffff;
|
|
puStack_c = &LAB_00aff10d;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((currentAnim + 10));
|
|
ExceptionList = &local_10;
|
|
MVar1 = this[0xd2];
|
|
MVar2 = this[0xd1];
|
|
update_cursor(this);
|
|
if ((g_manager->_framecount & 1) == 0) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x44])) + 0x1))) != '\0') {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0xe)))))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x16)))))->AnimationState::Update();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0xce])) + 0x1))) != '\0') {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x98)))))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0xa0)))))->AnimationState::Update();
|
|
}
|
|
if ((this[0x99] == (Menu_Bestiary)0x0) || (*GHIDRA_CAST<char *>((this + 0x9d)) == '\0')) {
|
|
anim = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x98)))))->ANM2::GetAnimation(GHIDRA_CAST<std_string *>(currentAnim));
|
|
local_8 = (void *)0x0;
|
|
if (0xf < anim->_capacity) {
|
|
anim = *GHIDRA_CAST<std_string **>(anim->_buf);
|
|
}
|
|
isAnimSet = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x8c)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(anim),1);
|
|
if (isAnimSet != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x98)))))->AnimationState::Rewind();
|
|
*GHIDRA_CAST<undefined1 *>((this + 0x9d)) = 1;
|
|
}
|
|
local_8 = (void *)0xffffffff;
|
|
if (0xf < local_18) {
|
|
uVar3 = local_18 + 1;
|
|
ptr = currentAnim[0];
|
|
if (0xfff < uVar3) {
|
|
ptr = *(void **)(GHIDRA_INT(currentAnim[0]) + -4);
|
|
uVar3 = local_18 + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(currentAnim[0]) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar3);
|
|
}
|
|
}
|
|
}
|
|
MVar4 = this[0xd1];
|
|
if ((MVar2 != MVar4) || (MVar1 != this[0xd2])) {
|
|
LoadPreview(this);
|
|
MVar4 = this[0xd1];
|
|
}
|
|
MVar1 = this[0xd3];
|
|
uVar3 = (GHIDRA_INT(this[0xd8]) - GHIDRA_INT(this[0xd7]) >> 2) - 1;
|
|
arrowLayer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 2)))))->ANM2::GetLayer(&DAT_00000007);
|
|
arrowLayer->_visible = 0 < GHIDRA_INT(MVar4);
|
|
MVar2 = this[0xd1];
|
|
arrowLayer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 2)))))->ANM2::GetLayer(&DAT_00000008);
|
|
arrowLayer->_visible = GHIDRA_INT(MVar2) < GHIDRA_INT((GHIDRA_INT(MVar1) + 1 + ((-GHIDRA_UINT((uVar3 != 0)) & uVar3) >> 2)));
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 008c66a0
|
|
void Menu_Bestiary::Render()
|
|
{
|
|
Menu_Bestiary *frontAnimState = this;
|
|
Vector pos;
|
|
Vector pos_00;
|
|
Vector pos_01;
|
|
Vector pos_02;
|
|
KColor color;
|
|
KColor color_00;
|
|
Vector scale;
|
|
uint uVar1;
|
|
EntityConfig_Entity *bestiaryConfig;
|
|
int iVar2;
|
|
uint uVar3;
|
|
Vector *layerPos;
|
|
byte *pbVar4;
|
|
void *pvVar5;
|
|
AnimationState *frontAnimState;
|
|
void *encounterNode;
|
|
AnimationLayer *layer;
|
|
ANM2 *sprite;
|
|
Font *pFVar6;
|
|
Menu_Bestiary MVar7;
|
|
float fVar8;
|
|
float cellOffsetY;
|
|
float fVar9;
|
|
Menu_Bestiary MVar10;
|
|
float fVar11;
|
|
float fVar12;
|
|
Menu_Bestiary MVar13;
|
|
ColorMod whiteColor;
|
|
Menu_Bestiary gridCellColor;
|
|
undefined4 uStack_218;
|
|
undefined4 uStack_214;
|
|
Menu_Bestiary MStack_210;
|
|
undefined4 local_1fc;
|
|
undefined4 uStack_1f8;
|
|
undefined4 local_1f4;
|
|
Menu_Bestiary pageCellColor;
|
|
undefined4 uStack_1ec;
|
|
undefined4 uStack_1e8;
|
|
Menu_Bestiary MStack_1e4;
|
|
undefined4 local_1d0;
|
|
undefined4 uStack_1cc;
|
|
undefined4 local_1c8;
|
|
KColor local_1c4;
|
|
undefined1 local_1b0 [8];
|
|
void *local_1a8;
|
|
PersistentGameData *local_1a0;
|
|
Vector local_19c;
|
|
Font *local_194;
|
|
Vector renderPos;
|
|
FontSettings fontSettings;
|
|
undefined4 local_184;
|
|
undefined4 local_180;
|
|
undefined4 local_17c;
|
|
undefined4 local_178;
|
|
undefined4 local_174;
|
|
undefined4 local_170;
|
|
Menu_Bestiary local_16c;
|
|
PersistentGameData *local_168;
|
|
uint *local_164;
|
|
Menu_Bestiary local_160;
|
|
Vector local_15c;
|
|
std_map *local_154;
|
|
PersistentGameData *local_150;
|
|
EntityConfig *local_14c;
|
|
float local_148;
|
|
float local_144;
|
|
std_string local_140;
|
|
byte textBuffer [260];
|
|
uint stackCookie;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
|
|
puStack_20 = textBuffer + 0x124;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0577e;
|
|
local_1c = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((textBuffer + 0x118));
|
|
ExceptionList = &local_1c;
|
|
local_19c.x = (g_menuManager->_ViewPosition).x + (float)*frontAnimState;
|
|
local_19c.y = (g_menuManager->_ViewPosition).y + (float)frontAnimState[1];
|
|
pbVar4 = textBuffer + 0x124;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(frontAnimState[0x44])) + 0x1))) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((frontAnimState + 0x1e)) == '\0') {
|
|
AnimationState::Render(GHIDRA_CAST<AnimationState *>((frontAnimState + 0xe)),&local_19c,&g_vectorZero,&g_vectorZero);
|
|
frontAnimState = GHIDRA_CAST<AnimationState *>((frontAnimState + 0x16));
|
|
}
|
|
else {
|
|
puStack_20 = textBuffer + 0x124;
|
|
AnimationState::Render(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x16)),&local_19c,&g_vectorZero,&g_vectorZero)
|
|
;
|
|
frontAnimState = GHIDRA_CAST<AnimationState *>((frontAnimState + 0xe));
|
|
}
|
|
AnimationState::Render(frontAnimState,&local_19c,&g_vectorZero,&g_vectorZero);
|
|
pbVar4 = puStack_20;
|
|
}
|
|
puStack_20 = pbVar4;
|
|
fVar9 = 0.0;
|
|
local_14c = &g_manager->_entityConfig;
|
|
MVar7 = frontAnimState[0xd1];
|
|
MVar13 = (Menu_Bestiary)0x3f800000;
|
|
MVar10 = (Menu_Bestiary)0x3f000000;
|
|
fVar11 = (g_menuManager->_ViewPosition).x + (float)*frontAnimState;
|
|
fVar12 = (g_menuManager->_ViewPosition).y + (float)frontAnimState[1];
|
|
if (GHIDRA_INT(frontAnimState[0xd3]) < GHIDRA_INT(MVar7)) {
|
|
fVar11 = fVar11 + 60.0;
|
|
fVar12 = fVar12 + 142.0;
|
|
local_168 = GHIDRA_CAST<PersistentGameData *>(((GHIDRA_INT(MVar7) - GHIDRA_INT(frontAnimState[0xd3])) * 4));
|
|
local_16c = (Menu_Bestiary)(GHIDRA_INT(local_168) - 4);
|
|
local_148 = fVar12;
|
|
local_144 = fVar11;
|
|
if (GHIDRA_INT(local_16c) < GHIDRA_INT(local_168)) {
|
|
fVar8 = 80.0;
|
|
local_160 = (Menu_Bestiary)0x0;
|
|
do {
|
|
if (GHIDRA_INT(frontAnimState[0xd8]) - GHIDRA_INT(frontAnimState[0xd7]) >> 2 <= GHIDRA_INT(local_16c)) break;
|
|
local_154 = GHIDRA_CAST<std_map *>((GHIDRA_INT(frontAnimState[0xd7]) + GHIDRA_INT(local_16c) * 4));
|
|
_Find_lower_bound<>(local_1b0,local_154);
|
|
pvVar5 = local_1a8;
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_1a8) + 0xd)) == '\0') &&
|
|
(*(void **)(GHIDRA_CAST<char *>(local_1a8) + 0x10) <= local_154->_head)) &&
|
|
(local_1a8 != (local_14c->_entities)._head)) {
|
|
uVar1 = GHIDRA_UINT(local_16c) & 0x80000001;
|
|
if (GHIDRA_INT(uVar1) < 0) {
|
|
uVar1 = (uVar1 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
pFVar6 = GHIDRA_CAST<Font *>(((float)GHIDRA_INT(uVar1) * fVar8));
|
|
uVar1 = GHIDRA_UINT(local_16c) & 0x80000003;
|
|
if (GHIDRA_INT(uVar1) < 0) {
|
|
uVar1 = (uVar1 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
local_1a0 = &g_manager->_persistentGameData;
|
|
local_150 = GHIDRA_CAST<PersistentGameData *>((GHIDRA_INT(local_1a8) + 0x18));
|
|
cellOffsetY = (float)(GHIDRA_INT(uVar1) / 2) * fVar8;
|
|
local_194 = pFVar6;
|
|
local_154 = GHIDRA_CAST<std_map *>(cellOffsetY);
|
|
bestiaryConfig =
|
|
EntityConfig::GetBestiaryConfig
|
|
(&g_manager->_entityConfig,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1a8) + 0x18)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_1a8) + 0x1c)));
|
|
if ((bestiaryConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) || (bestiaryConfig->bestiary == 0)) {
|
|
iVar2 = 0;
|
|
}
|
|
else {
|
|
iVar2 = FUN_0092b1e0((bestiaryConfig->id << 0xc | bestiaryConfig->variant) << 8);
|
|
}
|
|
if (frontAnimState[0xd2] == local_160) {
|
|
MVar10 = MVar13;
|
|
}
|
|
pageCellColor = (Menu_Bestiary)0x3f800000;
|
|
uStack_1ec = 0x3f800000;
|
|
uStack_1e8 = 0x3f800000;
|
|
local_1d0 = 0;
|
|
uStack_1cc = 0;
|
|
local_1c8 = 0;
|
|
if (frontAnimState + 0x71 != &pageCellColor) {
|
|
frontAnimState[0x75] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x76] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x77] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x78] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x71] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x72] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x73] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x74] = MVar10;
|
|
*GHIDRA_CAST<undefined8 *>((frontAnimState + 0x79)) = 0;
|
|
frontAnimState[0x7b] = (Menu_Bestiary)0x0;
|
|
pFVar6 = local_194;
|
|
}
|
|
MStack_1e4 = MVar10;
|
|
if (iVar2 < 1) {
|
|
if (frontAnimState[0x54] != (Menu_Bestiary)0x0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 6) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n"));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 6) goto LAB_008c6d94;
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
local_150 = *GHIDRA_CAST<PersistentGameData **>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (((MVar7 == (Menu_Bestiary)0x0) || (GHIDRA_INT(local_150) < 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x1c)) <= GHIDRA_INT(local_150))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(frontAnimState[0x55]) + GHIDRA_INT(local_150) * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x53)),GHIDRA_INT(local_150),152.0);
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
}
|
|
LAB_008c6d94:
|
|
local_15c.x = fVar11 + (float)local_194 + fVar9;
|
|
local_15c.y = fVar12 + (float)local_154 + fVar9;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(frontAnimState[0x89])) + 0x1))) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((frontAnimState + 99)) == '\0') {
|
|
MVar7 = frontAnimState[0x54];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&local_15c,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x55]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x53]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x5b], 5 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
MVar7 = frontAnimState[0x5d];
|
|
goto LAB_008c6eff;
|
|
}
|
|
}
|
|
else {
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5b]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&local_15c,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5d]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x5b]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x53], 5 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
MVar7 = frontAnimState[0x55];
|
|
LAB_008c6eff:
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + iVar2 * 4));
|
|
layerPos = &local_15c;
|
|
LAB_008c6f13:
|
|
AnimationLayer::RenderFrame
|
|
(layer,layerPos,iVar2,&g_vectorZero,&g_vectorZero,GHIDRA_CAST<ANM2 *>(MVar10));
|
|
goto LAB_008c6f19;
|
|
}
|
|
}
|
|
}
|
|
LAB_008c6f2c:
|
|
MVar13 = (Menu_Bestiary)0x3f800000;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x178)) == 0) || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar5) + 0x17c)) == '\0')) {
|
|
local_1a0 = *GHIDRA_CAST<PersistentGameData **>((GHIDRA_CAST<char *>(pvVar5) + 0x7c));
|
|
if (frontAnimState[0x54] != (Menu_Bestiary)0x0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 4) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n"));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 4) goto LAB_008c6b3e;
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
local_150 = *GHIDRA_CAST<PersistentGameData **>((GHIDRA_CAST<char *>(MVar7) + 0x44));
|
|
if (((MVar7 == (Menu_Bestiary)0x0) || (GHIDRA_INT(local_150) < 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x1c)) <= GHIDRA_INT(local_150))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(frontAnimState[0x55]) + GHIDRA_INT(local_150) * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x53)),GHIDRA_INT(local_150),(float)GHIDRA_INT(local_1a0));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
}
|
|
LAB_008c6b3e:
|
|
local_19c.x = fVar11 + (float)local_194 + fVar9;
|
|
local_19c.y = fVar12 + (float)local_154 + fVar9;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(frontAnimState[0x89])) + 0x1))) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((frontAnimState + 99)) == '\0') {
|
|
MVar7 = frontAnimState[0x54];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (3 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x44));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&local_19c,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x55]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x53]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x5b], 3 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x44)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5d]) + iVar2 * 4));
|
|
layerPos = &local_19c;
|
|
goto LAB_008c6f13;
|
|
}
|
|
}
|
|
else {
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (3 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5b]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x44));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&local_19c,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5d]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x5b]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x53], 3 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x44)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x55]) + iVar2 * 4));
|
|
layerPos = &local_19c;
|
|
goto LAB_008c6f13;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_008c6f2c;
|
|
}
|
|
renderPos.x = fVar11 + (float)pFVar6 + fVar9 + 21.0;
|
|
renderPos.y = (fVar12 + cellOffsetY + fVar9) - 30.0;
|
|
if (((local_150 != GHIDRA_CAST<PersistentGameData *>(0x0)) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((local_150->_achievements + 0x128)), iVar2 != 0)) &&
|
|
(sprite = GHIDRA_CAST<ANM2 *>((iVar2 + 0xdf0)), *GHIDRA_CAST<char *>((iVar2 + 0xef9)) != '\0')) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>((iVar2 + 0xe08)),
|
|
*GHIDRA_CAST<int *>((local_150->_achievements + 0x2c)));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(sprite))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>((frontAnimState + 0x71)));
|
|
*GHIDRA_CAST<float *>((iVar2 + 0xe8c)) = g_vectorOne.x;
|
|
*GHIDRA_CAST<float *>((iVar2 + 0xe90)) = g_vectorOne.y;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero);
|
|
LAB_008c6f19:
|
|
fVar9 = 0.0;
|
|
fVar11 = local_144;
|
|
fVar12 = local_148;
|
|
goto LAB_008c6f2c;
|
|
}
|
|
}
|
|
MVar10 = (Menu_Bestiary)0x3f000000;
|
|
fVar8 = 80.0;
|
|
}
|
|
local_160 = (Menu_Bestiary)(GHIDRA_INT(local_160) + 1);
|
|
local_16c = (Menu_Bestiary)(GHIDRA_INT(local_16c) + 1);
|
|
} while (GHIDRA_INT(local_16c) < GHIDRA_INT(local_168));
|
|
}
|
|
}
|
|
else {
|
|
fVar11 = fVar11 + 42.0;
|
|
fVar12 = fVar12 + 120.0;
|
|
local_168 = GHIDRA_CAST<PersistentGameData *>((GHIDRA_INT(MVar7) * 0x10));
|
|
local_15c.y = (float)(GHIDRA_INT(local_168) + 0x10);
|
|
local_148 = fVar11;
|
|
local_144 = fVar12;
|
|
if (GHIDRA_INT(local_168) < GHIDRA_INT(local_15c.y)) {
|
|
fVar8 = 40.0;
|
|
local_16c = (Menu_Bestiary)0x0;
|
|
do {
|
|
if (GHIDRA_INT(frontAnimState[0xd5]) - GHIDRA_INT(frontAnimState[0xd4]) >> 2 <= GHIDRA_INT(local_168)) break;
|
|
local_150 = GHIDRA_CAST<PersistentGameData *>((GHIDRA_INT(frontAnimState[0xd4]) + GHIDRA_INT(local_168) * 4));
|
|
_Find_lower_bound<>(GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&local_140) + 0xc)),local_150);
|
|
uVar1 = local_140._capacity;
|
|
if (((*GHIDRA_CAST<char *>((local_140._capacity + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint *>((local_140._capacity + 0x10)) <= *GHIDRA_CAST<uint *>(local_150))) &&
|
|
((void *)local_140._capacity != (local_14c->_entities)._head)) {
|
|
uVar3 = GHIDRA_UINT(local_168) & 0x80000003;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
uVar3 = (uVar3 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
MVar7 = (Menu_Bestiary)((float)GHIDRA_INT(uVar3) * fVar8);
|
|
uVar3 = GHIDRA_UINT(local_168) & 0x8000000f;
|
|
if (GHIDRA_INT(uVar3) < 0) {
|
|
uVar3 = (uVar3 - 1 | 0xfffffff0) + 1;
|
|
}
|
|
local_164 = GHIDRA_CAST<uint *>((local_140._capacity + 0x18));
|
|
local_1a0 = (PersistentGameData *)
|
|
((*GHIDRA_CAST<int *>((local_140._capacity + 0x18)) << 0xc |
|
|
*GHIDRA_CAST<uint *>((local_140._capacity + 0x1c))) << 8);
|
|
local_154 = &(g_manager->_persistentGameData)._bestiaryEncounters;
|
|
fVar8 = (float)(GHIDRA_INT((uVar3 + (GHIDRA_INT(uVar3) >> 0x1f & 3U))) >> 2) * fVar8;
|
|
local_194 = GHIDRA_CAST<Font *>(fVar8);
|
|
local_160 = MVar7;
|
|
local_150 = local_1a0;
|
|
std::set<int>::find_node(&local_1c4._blue,&local_150);
|
|
if ((*GHIDRA_CAST<char *>((local_1c4._unk + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((local_1c4._unk + 0x10)) <= GHIDRA_INT(local_1a0))) {
|
|
pvVar5 = (void *)local_1c4._unk;
|
|
}
|
|
else {
|
|
pvVar5 = local_154->_head;
|
|
}
|
|
if (pvVar5 == local_154->_head) {
|
|
iVar2 = 0;
|
|
}
|
|
else {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x14));
|
|
}
|
|
if (frontAnimState[0xd2] == local_16c) {
|
|
MVar10 = MVar13;
|
|
}
|
|
gridCellColor = (Menu_Bestiary)0x3f800000;
|
|
uStack_218 = 0x3f800000;
|
|
uStack_214 = 0x3f800000;
|
|
local_1fc = 0;
|
|
uStack_1f8 = 0;
|
|
local_1f4 = 0;
|
|
if (frontAnimState + 0x71 != &gridCellColor) {
|
|
frontAnimState[0x75] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x76] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x77] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x78] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x71] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x72] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x73] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x74] = MVar10;
|
|
*GHIDRA_CAST<undefined8 *>((frontAnimState + 0x79)) = 0;
|
|
frontAnimState[0x7b] = (Menu_Bestiary)0x0;
|
|
MVar7 = local_160;
|
|
}
|
|
MStack_210 = MVar10;
|
|
if (iVar2 < 1) {
|
|
if (frontAnimState[0x54] != (Menu_Bestiary)0x0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 6) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n"));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 6) goto LAB_008c7578;
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
local_164 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (((MVar7 == (Menu_Bestiary)0x0) || (GHIDRA_INT(local_164) < 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x1c)) <= GHIDRA_INT(local_164))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(frontAnimState[0x55]) + GHIDRA_INT(local_164) * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x53)),GHIDRA_INT(local_164),152.0);
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
}
|
|
LAB_008c7578:
|
|
renderPos.x = (float)local_160 + fVar11 + fVar9;
|
|
renderPos.y = (float)local_194 + fVar12 + fVar9;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(frontAnimState[0x89])) + 0x1))) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((frontAnimState + 99)) == '\0') {
|
|
MVar7 = frontAnimState[0x54];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&renderPos,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x55]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x53]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x5b], 5 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
MVar7 = frontAnimState[0x5d];
|
|
goto LAB_008c76e5;
|
|
}
|
|
}
|
|
else {
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5b]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&renderPos,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5d]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x5b]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x53], 5 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
MVar7 = frontAnimState[0x55];
|
|
LAB_008c76e5:
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + iVar2 * 4));
|
|
layerPos = &renderPos;
|
|
LAB_008c76f9:
|
|
AnimationLayer::RenderFrame
|
|
(layer,layerPos,iVar2,&g_vectorZero,&g_vectorZero,GHIDRA_CAST<ANM2 *>(MVar10));
|
|
goto LAB_008c76ff;
|
|
}
|
|
}
|
|
}
|
|
LAB_008c7712:
|
|
MVar13 = (Menu_Bestiary)0x3f800000;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((uVar1 + 0x178)) == 0) || (*GHIDRA_CAST<char *>((uVar1 + 0x17c)) == '\0')) {
|
|
local_150 = *GHIDRA_CAST<PersistentGameData **>((uVar1 + 0x7c));
|
|
if (frontAnimState[0x54] != (Menu_Bestiary)0x0) {
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 6) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n"));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) < 6) goto LAB_008c7320;
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
local_164 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (((MVar7 == (Menu_Bestiary)0x0) || (GHIDRA_INT(local_164) < 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x1c)) <= GHIDRA_INT(local_164))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(frontAnimState[0x55]) + GHIDRA_INT(local_164) * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x53)),GHIDRA_INT(local_164),(float)GHIDRA_INT(local_150));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
}
|
|
LAB_008c7320:
|
|
local_19c.x = (float)local_160 + fVar11 + fVar9;
|
|
local_19c.y = (float)local_194 + fVar12 + fVar9;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(frontAnimState[0x89])) + 0x1))) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((frontAnimState + 99)) == '\0') {
|
|
MVar7 = frontAnimState[0x54];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&local_19c,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x55]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x53]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x5b], 5 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5d]) + iVar2 * 4));
|
|
layerPos = &local_19c;
|
|
goto LAB_008c76f9;
|
|
}
|
|
}
|
|
else {
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (MVar7 != (Menu_Bestiary)0x0) {
|
|
if (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5b]) + 0x80))) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if (-1 < iVar2) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),
|
|
&local_19c,*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5d]) + iVar2 * 4)),&g_vectorZero,
|
|
&g_vectorZero,GHIDRA_CAST<ANM2 *>(frontAnimState[0x5b]));
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
}
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) &&
|
|
(MVar10 = frontAnimState[0x53], 5 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x55]) + iVar2 * 4));
|
|
layerPos = &local_19c;
|
|
goto LAB_008c76f9;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_008c7712;
|
|
}
|
|
local_1a8 = (void *)((fVar8 + fVar12 + fVar9) - 30.0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1b0)) + 0x4))) = (float)MVar7 + fVar11 + fVar9 + 21.0;
|
|
if (((local_164 != GHIDRA_CAST<uint *>(0x0)) && (uVar1 = local_164[0x58], uVar1 != 0)) &&
|
|
(sprite = GHIDRA_CAST<ANM2 *>((uVar1 + 0xdf0)), *GHIDRA_CAST<char *>((uVar1 + 0xef9)) != '\0')) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>((uVar1 + 0xe08)),local_164[0x19]);
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(sprite))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>((frontAnimState + 0x71)));
|
|
*GHIDRA_CAST<float *>((uVar1 + 0xe8c)) = g_vectorOne.x;
|
|
*GHIDRA_CAST<float *>((uVar1 + 0xe90)) = g_vectorOne.y;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Render(GHIDRA_CAST<Vector *>((local_1b0 + 4)),&g_vectorZero,&g_vectorZero);
|
|
LAB_008c76ff:
|
|
fVar9 = 0.0;
|
|
fVar11 = local_148;
|
|
fVar12 = local_144;
|
|
goto LAB_008c7712;
|
|
}
|
|
}
|
|
MVar10 = (Menu_Bestiary)0x3f000000;
|
|
fVar8 = 40.0;
|
|
}
|
|
local_16c = (Menu_Bestiary)(GHIDRA_INT(local_16c) + 1);
|
|
local_168 = GHIDRA_CAST<PersistentGameData *>((GHIDRA_INT(local_168) + 1));
|
|
} while (GHIDRA_INT(local_168) < GHIDRA_INT(local_15c.y));
|
|
}
|
|
}
|
|
MVar7 = frontAnimState[0xd1];
|
|
if (GHIDRA_INT(frontAnimState[0xd3]) < GHIDRA_INT(MVar7)) {
|
|
if (frontAnimState[0xd7] != frontAnimState[0xd8]) {
|
|
local_15c.y = (float)(GHIDRA_INT(frontAnimState[0xd7]) +
|
|
(GHIDRA_INT(frontAnimState[0xd2]) + (GHIDRA_INT(MVar7) - GHIDRA_INT(frontAnimState[0xd3])) * 4 + -4) * 4);
|
|
goto LAB_008c7794;
|
|
}
|
|
LAB_008c77ce:
|
|
pvVar5 = (local_14c->_entities)._head;
|
|
}
|
|
else {
|
|
if (frontAnimState[0xd4] == frontAnimState[0xd5]) goto LAB_008c77ce;
|
|
local_15c.y = (float)(GHIDRA_INT(frontAnimState[0xd4]) + (GHIDRA_INT(MVar7) * 0x10 + GHIDRA_INT(frontAnimState[0xd2])) * 4);
|
|
LAB_008c7794:
|
|
_Find_lower_bound<>(&local_1c4._blue,local_15c.y);
|
|
if ((*GHIDRA_CAST<char *>((local_1c4._unk + 0xd)) != '\0') ||
|
|
(*GHIDRA_CAST<uint *>(local_15c.y) < *GHIDRA_CAST<uint *>((local_1c4._unk + 0x10)))) goto LAB_008c77ce;
|
|
pvVar5 = (void *)local_1c4._unk;
|
|
}
|
|
if (pvVar5 == (local_14c->_entities)._head) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
local_194 = &g_manager->_font2_TeamMeatEx12;
|
|
local_168 = &g_manager->_persistentGameData;
|
|
local_1a0 = GHIDRA_CAST<PersistentGameData *>(&g_manager->_entityConfig);
|
|
local_150 = *GHIDRA_CAST<PersistentGameData **>((GHIDRA_CAST<char *>(pvVar5) + 0x18));
|
|
fVar11 = ((g_menuManager->_ViewPosition).x + (float)*frontAnimState) - fVar9;
|
|
fVar9 = ((g_menuManager->_ViewPosition).y + (float)frontAnimState[1]) - fVar9;
|
|
local_14c = GHIDRA_CAST<EntityConfig *>(fVar9);
|
|
local_144 = fVar11;
|
|
bestiaryConfig =
|
|
EntityConfig::GetBestiaryConfig
|
|
(GHIDRA_CAST<EntityConfig *>(local_1a0),GHIDRA_INT(local_150),*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x1c)));
|
|
if ((bestiaryConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) || (bestiaryConfig->bestiary == 0)) {
|
|
LAB_008c78c8:
|
|
local_148 = 0.0;
|
|
}
|
|
else {
|
|
local_164 = GHIDRA_CAST<uint *>(((bestiaryConfig->id << 0xc | bestiaryConfig->variant) << 8));
|
|
local_154 = &local_168->_bestiaryEncounters;
|
|
local_15c.y = (float)local_164;
|
|
std::set<int>::find_node(&local_1c4._blue,&local_15c.y);
|
|
if ((*GHIDRA_CAST<char *>((local_1c4._unk + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<int *>((local_1c4._unk + 0x10)) <= GHIDRA_INT(local_164))) {
|
|
encounterNode = (void *)local_1c4._unk;
|
|
}
|
|
else {
|
|
encounterNode = local_154->_head;
|
|
}
|
|
if (encounterNode == local_154->_head) goto LAB_008c78c8;
|
|
local_148 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(encounterNode) + 0x14));
|
|
}
|
|
local_19c.y = (float)PersistentGameData::GetBestiaryDeathCount
|
|
(local_168,GHIDRA_INT(local_150),*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x1c)));
|
|
local_150 = *GHIDRA_CAST<PersistentGameData **>((GHIDRA_CAST<char *>(pvVar5) + 0x18));
|
|
bestiaryConfig =
|
|
EntityConfig::GetBestiaryConfig
|
|
(GHIDRA_CAST<EntityConfig *>(local_1a0),GHIDRA_INT(local_150),*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x1c)));
|
|
if ((bestiaryConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) || (bestiaryConfig->bestiary == 0)) {
|
|
LAB_008c7985:
|
|
local_160 = (Menu_Bestiary)0x0;
|
|
}
|
|
else {
|
|
local_164 = GHIDRA_CAST<uint *>(((bestiaryConfig->id << 0xc | bestiaryConfig->variant) << 8));
|
|
local_154 = GHIDRA_CAST<std_map *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_168)) + 0xf74))));
|
|
local_15c.y = (float)local_164;
|
|
std::set<int>::find_node(&local_1c4._blue,&local_15c.y);
|
|
if ((*GHIDRA_CAST<char *>((local_1c4._unk + 0xd)) != '\0') ||
|
|
(GHIDRA_INT(local_164) < *GHIDRA_CAST<int *>((local_1c4._unk + 0x10)))) {
|
|
local_1c4._unk = GHIDRA_INT(local_154->_head);
|
|
}
|
|
if ((void *)local_1c4._unk == local_154->_head) goto LAB_008c7985;
|
|
local_160 = *GHIDRA_CAST<Menu_Bestiary *>((local_1c4._unk + 0x14));
|
|
}
|
|
local_164 = GHIDRA_CAST<uint *>(PersistentGameData)::GetBestiaryKillCount
|
|
(local_168,GHIDRA_INT(local_150),*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x1c)));
|
|
local_15c.y = (float)(frontAnimState + 0x71);
|
|
whiteColor._offset[0] = 0.0;
|
|
whiteColor._offset[1] = 0.0;
|
|
whiteColor._offset[2] = 0.0;
|
|
if (GHIDRA_CAST<ColorMod *>(local_15c.y) != &whiteColor) {
|
|
*GHIDRA_CAST<undefined8 *>((frontAnimState + 0x79)) = 0;
|
|
(GHIDRA_CAST<ColorMod *>(local_15c.y))->_tint[0] = 1.0;
|
|
frontAnimState[0x72] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x73] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x74] = (Menu_Bestiary)0x3f800000;
|
|
frontAnimState[0x7b] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x75] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x76] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x77] = (Menu_Bestiary)0x0;
|
|
frontAnimState[0x78] = (Menu_Bestiary)0x0;
|
|
fVar11 = local_144;
|
|
}
|
|
if (local_148 != 0.0) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(frontAnimState[0xce])) + 0x1))) == '\0') {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x178)) == 0) || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar5) + 0x17c)) == '\0')) {
|
|
local_16c = (Menu_Bestiary)(frontAnimState + 0x47);
|
|
local_154 = *GHIDRA_CAST<std_map **>((GHIDRA_CAST<char *>(pvVar5) + 0x7c));
|
|
if (GHIDRA_INT(frontAnimState[0xd3]) < GHIDRA_INT(frontAnimState[0xd1])) {
|
|
if ((frontAnimState[0x54] != (Menu_Bestiary)0x0) &&
|
|
((3 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n")),
|
|
3 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)))))) {
|
|
MVar7 = frontAnimState[0x54];
|
|
local_15c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(MVar7) + 0x44));
|
|
if ((MVar7 == (Menu_Bestiary)0x0) ||
|
|
((GHIDRA_INT(local_15c.y) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x1c)) <= GHIDRA_INT(local_15c.y))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(frontAnimState[0x55]) + GHIDRA_INT(local_15c.y) * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x53)),GHIDRA_INT(local_15c.y),(float)GHIDRA_INT(local_154));
|
|
}
|
|
iVar2 = 3;
|
|
}
|
|
else {
|
|
if ((frontAnimState[0x54] != (Menu_Bestiary)0x0) &&
|
|
((5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n")),
|
|
5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)))))) {
|
|
MVar7 = frontAnimState[0x54];
|
|
local_15c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if ((MVar7 == (Menu_Bestiary)0x0) ||
|
|
((GHIDRA_INT(local_15c.y) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x1c)) <= GHIDRA_INT(local_15c.y))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(frontAnimState[0x55]) + GHIDRA_INT(local_15c.y) * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x53)),GHIDRA_INT(local_15c.y),(float)GHIDRA_INT(local_154));
|
|
}
|
|
iVar2 = 5;
|
|
}
|
|
local_1a8 = (void *)((float)local_14c + 120.0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1b0)) + 0x4))) = local_144 + 340.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(local_16c))))->Sprite::RenderLayer(iVar2,GHIDRA_CAST<Vector *>((local_1b0 + 4)),&g_vectorZero,
|
|
&g_vectorZero);
|
|
}
|
|
else {
|
|
local_1a8 = (void *)(fVar9 + 150.0);
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1b0)) + 0x4))) = fVar11 + 319.0;
|
|
if (((pvVar5 != (void *)0xffffffe8) && (iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x178)), iVar2 != 0))
|
|
&& (sprite = GHIDRA_CAST<ANM2 *>((iVar2 + 0xdf0)), *GHIDRA_CAST<char *>((iVar2 + 0xef9)) != '\0')) {
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::SetFrame(GHIDRA_CAST<std_string *>((iVar2 + 0xe08)),*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar5) + 0x7c)));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(sprite))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_15c.y));
|
|
*GHIDRA_CAST<float *>((iVar2 + 0xe8c)) = g_vectorOne.x;
|
|
*GHIDRA_CAST<float *>((iVar2 + 0xe90)) = g_vectorOne.y;
|
|
(GHIDRA_CAST<ANM2 *>((sprite)))->ANM2::Render(GHIDRA_CAST<Vector *>((local_1b0 + 4)),&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
renderPos.x = fVar11 + 360.0 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x104));
|
|
renderPos.y = fVar9 + 150.0 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x108));
|
|
if (*GHIDRA_CAST<char *>((frontAnimState + 0xa8)) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x98)),&renderPos,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0xa0)),&renderPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0xa0)),&renderPos,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((frontAnimState + 0x98)),&renderPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(pvVar5) + 0x18)))))->EntityConfig_Entity::GetName(&local_140,0x14);
|
|
pFVar6 = local_194;
|
|
local_14 = 1;
|
|
pbVar4 = GHIDRA_CAST<byte *>(&local_140);
|
|
if ((void *)0xf < local_140._capacity) {
|
|
pbVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(local_140._buf))) + 0x0)));
|
|
}
|
|
uVar1 = (GHIDRA_CAST<Font *>((local_194)))->Font::get_string_width_n(pbVar4,-1);
|
|
fontSettings = (FontSettings)0x1;
|
|
local_184 = 0xffff;
|
|
local_180 = 0;
|
|
local_17c = 0x3f800000;
|
|
local_178 = 0xffffffff;
|
|
local_174 = 0;
|
|
local_170 = 0;
|
|
if (uVar1 < 0xc9) {
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),3);
|
|
pbVar4 = GHIDRA_CAST<byte *>(&local_140);
|
|
if ((void *)0xf < local_140._capacity) {
|
|
pbVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(local_140._buf))) + 0x0)));
|
|
}
|
|
local_1c4._red = 0.2;
|
|
local_1c4._green = 0.2;
|
|
local_1c4._blue = 0.2;
|
|
local_1c4._alpha = 1.0;
|
|
local_144 = local_144 + 360.0;
|
|
local_1c4._unk = 0;
|
|
(GHIDRA_CAST<Font *>((pFVar6)))->Font::DrawString(pbVar4,&local_1c4,&fontSettings,local_144,(float)local_14c + 160.0);
|
|
}
|
|
else {
|
|
fVar11 = 200.0 / (float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
|
|
local_1c4._red = 0.2;
|
|
local_1c4._green = 0.2;
|
|
local_1c4._blue = 0.2;
|
|
local_1c4._alpha = 1.0;
|
|
pbVar4 = GHIDRA_CAST<byte *>(&local_140);
|
|
if ((void *)0xf < local_140._capacity) {
|
|
pbVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(local_140._buf))) + 0x0)));
|
|
}
|
|
local_1c4._unk = 0;
|
|
local_144 = local_144 + 360.0;
|
|
pos.y = (float)local_14c + 160.0 +
|
|
((float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]) / 200.0 -
|
|
1.0) * (float)(ushort)pFVar6->_base;
|
|
pos.x = local_144;
|
|
scale.y = fVar11;
|
|
scale.x = fVar11;
|
|
(GHIDRA_CAST<Font *>((pFVar6)))->Font::DrawString(pbVar4,pos,scale,&local_1c4,&fontSettings);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
local_1b0 = (undefined1 [8])(double)*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x68));
|
|
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>("#BESTIARY_HP"));
|
|
sprintf_s(textBuffer,0x100,GHIDRA_CAST<byte *>("%s: %.f"));
|
|
fontSettings = (FontSettings)0x1;
|
|
local_184 = 0xffff;
|
|
local_180 = 0;
|
|
local_17c = 0x3f800000;
|
|
local_178 = 0xffffffff;
|
|
local_174 = 0;
|
|
local_170 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
|
|
local_15c.y = (float)local_14c + 180.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1b0)) + 0x4))) = 0x3f000000;
|
|
local_1a8 = (void *)0x3f000000;
|
|
pvVar5 = Font::measure_string
|
|
(pFVar6,&local_1c4._green,textBuffer,&fontSettings,GHIDRA_CAST<Vector *>((local_1b0 + 4)))
|
|
;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
color._blue = 0.2;
|
|
color._red = 0.2;
|
|
color._green = 0.2;
|
|
color._alpha = 1.0;
|
|
color._unk = 0;
|
|
Font::render_glyph_quads(pFVar6,pvVar5,local_144,local_15c.y,0.5,0.5,color,&fontSettings);
|
|
std::vector<12byte>::clear();
|
|
std::vector<12byte>::_Tidy();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>("#BESTIARY_HITS"));
|
|
sprintf_s(textBuffer,0x100,GHIDRA_CAST<byte *>("%s: %d"));
|
|
fontSettings = (FontSettings)0x1;
|
|
local_184 = 0xffff;
|
|
local_180 = 0;
|
|
local_17c = 0x3f800000;
|
|
local_178 = 0xffffffff;
|
|
local_174 = 0;
|
|
local_170 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
local_15c.y = (float)local_14c + 190.0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_1b0)) + 0x4))) = 0x3f000000;
|
|
local_1a8 = (void *)0x3f000000;
|
|
pvVar5 = Font::measure_string
|
|
(pFVar6,&local_1c4._green,textBuffer,&fontSettings,GHIDRA_CAST<Vector *>((local_1b0 + 4)))
|
|
;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
color_00._blue = 0.2;
|
|
color_00._red = 0.2;
|
|
color_00._green = 0.2;
|
|
color_00._alpha = 1.0;
|
|
color_00._unk = 0;
|
|
Font::render_glyph_quads(pFVar6,pvVar5,local_144,local_15c.y,0.5,0.5,color_00,&fontSettings);
|
|
std::vector<12byte>::clear();
|
|
std::vector<12byte>::_Tidy();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>("#BESTIARY_DEATHS"));
|
|
sprintf_s(textBuffer,0x100,GHIDRA_CAST<byte *>("%s: %d"));
|
|
fontSettings = (FontSettings)0x1;
|
|
local_184 = 0xffff;
|
|
local_180 = 0;
|
|
local_17c = 0x3f800000;
|
|
local_178 = 0xffffffff;
|
|
local_174 = 0;
|
|
local_170 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
|
|
local_1c4._red = 0.2;
|
|
local_1c4._green = 0.2;
|
|
local_1c4._blue = 0.2;
|
|
local_1c4._alpha = 1.0;
|
|
local_1c4._unk = 0;
|
|
pos_00.y = (float)local_14c + 200.0;
|
|
pos_00.x = local_144;
|
|
(GHIDRA_CAST<Font *>((pFVar6)))->Font::DrawString(textBuffer,pos_00,(Vector)0x3f0000003f000000,&local_1c4,&fontSettings);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>("#BESTIARY_KILLS"));
|
|
sprintf_s(textBuffer,0x100,GHIDRA_CAST<byte *>("%s: %d"));
|
|
fontSettings = (FontSettings)0x1;
|
|
local_184 = 0xffff;
|
|
local_180 = 0;
|
|
local_17c = 0x3f800000;
|
|
local_178 = 0xffffffff;
|
|
local_174 = 0;
|
|
local_170 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
|
|
local_1c4._red = 0.2;
|
|
local_1c4._green = 0.2;
|
|
local_1c4._blue = 0.2;
|
|
local_1c4._alpha = 1.0;
|
|
local_1c4._unk = 0;
|
|
pos_01.y = (float)local_14c + 210.0;
|
|
pos_01.x = local_144;
|
|
(GHIDRA_CAST<Font *>((pFVar6)))->Font::DrawString(textBuffer,pos_01,(Vector)0x3f0000003f000000,&local_1c4,&fontSettings);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>("#BESTIARY_ENCOUNTERS"));
|
|
sprintf_s(textBuffer,0x100,GHIDRA_CAST<byte *>("%s: %d"));
|
|
fontSettings = (FontSettings)0x1;
|
|
local_184 = 0xffff;
|
|
local_180 = 0;
|
|
local_17c = 0x3f800000;
|
|
local_178 = 0xffffffff;
|
|
local_174 = 0;
|
|
local_170 = 0;
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),10);
|
|
local_1c4._unk = 0;
|
|
local_1c4._red = 0.2;
|
|
local_1c4._green = 0.2;
|
|
local_1c4._blue = 0.2;
|
|
local_1c4._alpha = 1.0;
|
|
pos_02.y = (float)local_14c + 220.0;
|
|
pos_02.x = local_144;
|
|
(GHIDRA_CAST<Font *>((pFVar6)))->Font::DrawString(textBuffer,pos_02,(Vector)0x3f0000003f000000,&local_1c4,&fontSettings);
|
|
(GHIDRA_CAST<std::string *>((local_140._buf)))->std::string::_Tidy_deallocate();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if ((frontAnimState[0x54] != (Menu_Bestiary)0x0) &&
|
|
((5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n")), 5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80))
|
|
)))) {
|
|
MVar7 = frontAnimState[0x54];
|
|
local_15c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(MVar7) + 0x4c));
|
|
if ((MVar7 == (Menu_Bestiary)0x0) ||
|
|
((GHIDRA_INT(local_15c.y) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x1c)) <= GHIDRA_INT(local_15c.y))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(frontAnimState[0x55]) + GHIDRA_INT(local_15c.y) * 4)) = 0;
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((frontAnimState + 0x53)))))->AnimationState::AdvanceLayerPosition(GHIDRA_INT(local_15c.y),152.0);
|
|
}
|
|
renderPos.y = (float)local_14c + 120.0;
|
|
renderPos.x = local_144 + 340.0;
|
|
local_14c = GHIDRA_CAST<EntityConfig *>(renderPos.y);
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(frontAnimState[0x89])) + 0x1))) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((frontAnimState + 99)) == '\0') {
|
|
MVar7 = frontAnimState[0x54];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) && (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x53]) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),&renderPos,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x55]) + iVar2 * 4)),&g_vectorZero,&g_vectorZero,
|
|
GHIDRA_CAST<ANM2 *>(frontAnimState[0x53]));
|
|
}
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (((MVar7 == (Menu_Bestiary)0x0) || (MVar10 = frontAnimState[0x5b], *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)) < 6))
|
|
|| (iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), iVar2 < 0)) goto LAB_008c7c0b;
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
MVar7 = frontAnimState[0x5d];
|
|
}
|
|
else {
|
|
MVar7 = frontAnimState[0x5c];
|
|
if (((MVar7 != (Menu_Bestiary)0x0) && (5 < *GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5b]) + 0x80)))) &&
|
|
(iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), -1 < iVar2)) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18)))),&renderPos,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(frontAnimState[0x5d]) + iVar2 * 4)),&g_vectorZero,&g_vectorZero,
|
|
GHIDRA_CAST<ANM2 *>(frontAnimState[0x5b]));
|
|
}
|
|
MVar7 = frontAnimState[0x54];
|
|
if (((MVar7 == (Menu_Bestiary)0x0) || (MVar10 = frontAnimState[0x53], *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar10) + 0x80)) < 6))
|
|
|| (iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x4c)), iVar2 < 0)) goto LAB_008c7c0b;
|
|
layer = GHIDRA_CAST<AnimationLayer *>((iVar2 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + 0x18))));
|
|
MVar7 = frontAnimState[0x55];
|
|
}
|
|
AnimationLayer::RenderFrame
|
|
(layer,&renderPos,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(MVar7) + iVar2 * 4)),&g_vectorZero,&g_vectorZero,
|
|
GHIDRA_CAST<ANM2 *>(MVar10));
|
|
}
|
|
LAB_008c7c0b:
|
|
fontSettings = (FontSettings)0x1;
|
|
local_184 = 0xffff;
|
|
local_180 = 0;
|
|
local_17c = 0x3f800000;
|
|
local_178 = 0xffffffff;
|
|
local_174 = 0;
|
|
local_170 = 0;
|
|
local_14 = 0;
|
|
local_1c4._unk = 0;
|
|
local_1c4._red = 0.2;
|
|
local_1c4._green = 0.2;
|
|
local_1c4._blue = 0.2;
|
|
local_1c4._alpha = 1.0;
|
|
pbVar4 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<byte *>("#BESTIARY_UNKNOWN"));
|
|
(GHIDRA_CAST<Font *>((local_194)))->Font::DrawString(pbVar4,&local_1c4,&fontSettings,local_144 + 360.0,(float)local_14c);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 008c87b0
|
|
void Menu_Bestiary::update_cursor()
|
|
{
|
|
char isActionActive;
|
|
uint uVar1;
|
|
int iVar2;
|
|
Menu_Bestiary newPage;
|
|
Menu_Bestiary *heldFrames;
|
|
Menu_Bestiary *local_24;
|
|
undefined4 local_20;
|
|
Menu_Bestiary local_1c;
|
|
Menu_Bestiary lastPage;
|
|
uint repeatDelay;
|
|
Menu_Bestiary maxCursorIdx;
|
|
int columns;
|
|
char local_8 [4];
|
|
Menu_Bestiary cursorIdx;
|
|
|
|
cursorIdx = this[0xd3];
|
|
iVar2 = GHIDRA_INT(this[0xd8]) - GHIDRA_INT(this[0xd7]) >> 2;
|
|
uVar1 = iVar2 - 1;
|
|
lastPage = (Menu_Bestiary)(GHIDRA_INT(cursorIdx) + 1 + ((-GHIDRA_UINT((uVar1 != 0)) & uVar1) >> 2));
|
|
local_1c = (Menu_Bestiary)((GHIDRA_INT(this[0xd5]) - GHIDRA_INT(this[0xd4]) >> 2) - 1U & 0x8000000f);
|
|
if (GHIDRA_INT(local_1c) < 0) {
|
|
local_1c = (Menu_Bestiary)((GHIDRA_INT(local_1c) - 1U | 0xfffffff0) + 1);
|
|
}
|
|
newPage = this[0xd1];
|
|
repeatDelay = 0xf;
|
|
if (GHIDRA_INT(cursorIdx) < GHIDRA_INT(newPage)) {
|
|
columns = 2;
|
|
if (newPage == lastPage) {
|
|
maxCursorIdx = (Menu_Bestiary)(iVar2 - 1U & 0x80000003);
|
|
if (GHIDRA_INT(maxCursorIdx) < 0) {
|
|
maxCursorIdx = (Menu_Bestiary)((GHIDRA_INT(maxCursorIdx) - 1U | 0xfffffffc) + 1);
|
|
}
|
|
}
|
|
else {
|
|
maxCursorIdx = (Menu_Bestiary)0x3;
|
|
}
|
|
}
|
|
else {
|
|
columns = 4;
|
|
maxCursorIdx = (Menu_Bestiary)0xf;
|
|
if (newPage == cursorIdx) {
|
|
maxCursorIdx = local_1c;
|
|
}
|
|
}
|
|
heldFrames = this + 0xda;
|
|
local_8[0] = '\x14';
|
|
local_8[1] = '\0';
|
|
local_8[2] = '\0';
|
|
local_8[3] = '\0';
|
|
local_24 = this;
|
|
isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0);
|
|
if (isActionActive == '\0') {
|
|
*heldFrames = (Menu_Bestiary)0x0;
|
|
}
|
|
else {
|
|
*heldFrames = (Menu_Bestiary)(GHIDRA_INT(*heldFrames) + 1);
|
|
}
|
|
local_8[0] = '\x16';
|
|
local_8[1] = '\0';
|
|
local_8[2] = '\0';
|
|
local_8[3] = '\0';
|
|
isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0);
|
|
if (isActionActive == '\0') {
|
|
this[0xdb] = (Menu_Bestiary)0x0;
|
|
}
|
|
else {
|
|
this[0xdb] = (Menu_Bestiary)(GHIDRA_INT(this[0xdb]) + 1);
|
|
}
|
|
local_8[0] = '\x15';
|
|
local_8[1] = '\0';
|
|
local_8[2] = '\0';
|
|
local_8[3] = '\0';
|
|
isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0);
|
|
if (isActionActive == '\0') {
|
|
this[0xdc] = (Menu_Bestiary)0x0;
|
|
}
|
|
else {
|
|
this[0xdc] = (Menu_Bestiary)(GHIDRA_INT(this[0xdc]) + 1);
|
|
}
|
|
local_8[0] = '\x17';
|
|
local_8[1] = '\0';
|
|
local_8[2] = '\0';
|
|
local_8[3] = '\0';
|
|
isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_8,0,0);
|
|
if (isActionActive == '\0') {
|
|
this[0xdd] = (Menu_Bestiary)0x0;
|
|
cursorIdx = (Menu_Bestiary)0x0;
|
|
}
|
|
else {
|
|
this[0xdd] = (Menu_Bestiary)(GHIDRA_INT(this[0xdd]) + 1);
|
|
cursorIdx = this[0xdd];
|
|
}
|
|
if (*heldFrames == (Menu_Bestiary)0x0) {
|
|
if (this[0xdc] != (Menu_Bestiary)0x0) {
|
|
this[0xdd] = (Menu_Bestiary)0x0;
|
|
*heldFrames = (Menu_Bestiary)0x0;
|
|
goto LAB_008c89a7;
|
|
}
|
|
if (this[0xdb] == (Menu_Bestiary)0x0) {
|
|
if (cursorIdx != (Menu_Bestiary)0x0) {
|
|
*heldFrames = (Menu_Bestiary)0x0;
|
|
goto LAB_008c899d;
|
|
}
|
|
}
|
|
else {
|
|
this[0xdd] = (Menu_Bestiary)0x0;
|
|
this[0xdc] = (Menu_Bestiary)0x0;
|
|
*heldFrames = (Menu_Bestiary)0x0;
|
|
}
|
|
}
|
|
else {
|
|
this[0xdd] = (Menu_Bestiary)0x0;
|
|
LAB_008c899d:
|
|
this[0xdc] = (Menu_Bestiary)0x0;
|
|
LAB_008c89a7:
|
|
this[0xdb] = (Menu_Bestiary)0x0;
|
|
}
|
|
iVar2 = 0;
|
|
local_8[0] = '\0';
|
|
local_8[1] = '\0';
|
|
local_8[2] = '\0';
|
|
local_8[3] = '\0';
|
|
do {
|
|
cursorIdx = *heldFrames;
|
|
if ((((cursorIdx != (Menu_Bestiary)0x0) && (GHIDRA_UINT(cursorIdx) % repeatDelay == 0)) ||
|
|
((0x3c < GHIDRA_UINT(cursorIdx) && (GHIDRA_UINT(cursorIdx) % 10 == 0)))) ||
|
|
((0xb4 < GHIDRA_UINT(cursorIdx) && (GHIDRA_UINT(cursorIdx) % 5 == 0)))) {
|
|
local_8[iVar2] = '\x01';
|
|
}
|
|
iVar2 = iVar2 + 1;
|
|
heldFrames = heldFrames + 1;
|
|
} while (iVar2 < 4);
|
|
local_20 = 0x14;
|
|
isActionActive = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_20,0,0)
|
|
;
|
|
heldFrames = local_24;
|
|
if ((isActionActive == '\0') && (local_8[0] == '\0')) {
|
|
local_24 = GHIDRA_CAST<Menu_Bestiary *>(0x15);
|
|
isActionActive =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0);
|
|
if ((isActionActive != '\0') || (local_8[2] != '\0')) {
|
|
newPage = heldFrames[0xd2];
|
|
cursorIdx = (Menu_Bestiary)(GHIDRA_INT(newPage) + 1);
|
|
heldFrames[0xd2] = cursorIdx;
|
|
if ((GHIDRA_INT(cursorIdx) <= GHIDRA_INT(maxCursorIdx)) && (GHIDRA_INT(cursorIdx) % columns != 0)) {
|
|
return;
|
|
}
|
|
if (GHIDRA_INT(lastPage) <= GHIDRA_INT(heldFrames[0xd1])) {
|
|
heldFrames[0xd2] = newPage;
|
|
return;
|
|
}
|
|
cursorIdx = (Menu_Bestiary)(GHIDRA_INT(cursorIdx) - columns);
|
|
newPage = (Menu_Bestiary)(GHIDRA_INT(heldFrames[0xd1]) + 1);
|
|
heldFrames[0xd1] = newPage;
|
|
heldFrames[0xd2] = cursorIdx;
|
|
if (newPage == (Menu_Bestiary)(GHIDRA_INT(heldFrames[0xd3]) + 1)) {
|
|
LAB_008c8be2:
|
|
heldFrames[0xd2] = (Menu_Bestiary)0x0;
|
|
return;
|
|
}
|
|
if (newPage == lastPage) {
|
|
uVar1 = GHIDRA_INT(heldFrames[0xd8]) - GHIDRA_INT(heldFrames[0xd7]) >> 2 & 0x80000003;
|
|
if (GHIDRA_INT(uVar1) < 0) {
|
|
uVar1 = (uVar1 - 1 | 0xfffffffc) + 1;
|
|
}
|
|
if (GHIDRA_INT(uVar1) <= GHIDRA_INT(cursorIdx)) goto LAB_008c8be2;
|
|
}
|
|
if (newPage != heldFrames[0xd3]) {
|
|
return;
|
|
}
|
|
if (GHIDRA_INT(local_1c) < GHIDRA_INT(cursorIdx)) {
|
|
cursorIdx = local_1c;
|
|
}
|
|
heldFrames[0xd2] = cursorIdx;
|
|
return;
|
|
}
|
|
local_24 = GHIDRA_CAST<Menu_Bestiary *>(0x16);
|
|
isActionActive =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0);
|
|
if ((isActionActive == '\0') && (local_8[1] == '\0')) {
|
|
local_24 = GHIDRA_CAST<Menu_Bestiary *>(0x17);
|
|
isActionActive =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0);
|
|
if ((isActionActive == '\0') && (local_8[3] == '\0')) {
|
|
local_24 = GHIDRA_CAST<Menu_Bestiary *>(0xf);
|
|
isActionActive =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_24,0,0);
|
|
if (isActionActive == '\0') {
|
|
return;
|
|
}
|
|
FUN_0098aec0();
|
|
return;
|
|
}
|
|
cursorIdx = heldFrames[0xd2];
|
|
if (columns + -1 <= GHIDRA_INT(cursorIdx) / columns) {
|
|
return;
|
|
}
|
|
heldFrames[0xd2] = (Menu_Bestiary)(GHIDRA_INT(cursorIdx) + columns);
|
|
if (GHIDRA_INT(maxCursorIdx) < GHIDRA_INT(cursorIdx) + columns) {
|
|
heldFrames[0xd2] = cursorIdx;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (GHIDRA_INT(heldFrames[0xd2]) / columns < 1) {
|
|
return;
|
|
}
|
|
newPage = (Menu_Bestiary)(GHIDRA_INT(heldFrames[0xd2]) - columns);
|
|
}
|
|
else {
|
|
newPage = local_24[0xd2];
|
|
cursorIdx = (Menu_Bestiary)(GHIDRA_INT(newPage) + -1);
|
|
local_24[0xd2] = cursorIdx;
|
|
if ((-1 < GHIDRA_INT(cursorIdx)) && (GHIDRA_INT(cursorIdx) % columns != columns + -1)) {
|
|
return;
|
|
}
|
|
if (0 < GHIDRA_INT(local_24[0xd1])) {
|
|
newPage = (Menu_Bestiary)(GHIDRA_INT(local_24[0xd1]) + -1);
|
|
local_24[0xd1] = newPage;
|
|
local_24[0xd2] = (Menu_Bestiary)(GHIDRA_INT(cursorIdx) + columns);
|
|
if (newPage == local_24[0xd3]) {
|
|
local_24[0xd2] = local_1c;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
heldFrames[0xd2] = newPage;
|
|
return;
|
|
}
|
|
|
|
// 008c8c70
|
|
void Menu_Bestiary::LoadPreview()
|
|
{
|
|
byte bVar1;
|
|
int iVar2;
|
|
LayerState *pLVar3;
|
|
byte *pbVar4;
|
|
void *ptr;
|
|
byte *pbVar5;
|
|
std_string *psVar6;
|
|
LayerState *pLVar7;
|
|
uint uVar8;
|
|
char *pcVar9;
|
|
void *entityEntry;
|
|
EntityConfig *entityConfig;
|
|
Menu_Bestiary MVar10;
|
|
ANM2 *pAVar11;
|
|
ANM2 *pAVar12;
|
|
bool bVar13;
|
|
undefined4 local_bc [8];
|
|
undefined4 local_9c;
|
|
undefined4 uStack_98;
|
|
undefined4 local_94;
|
|
LayerState *local_90;
|
|
std_string *local_8c;
|
|
Menu_Bestiary *menu;
|
|
Menu_Bestiary layerIdx;
|
|
Menu_Bestiary local_80;
|
|
char isBrightLayer;
|
|
LayerState *local_78;
|
|
LayerState *cleanupFlags;
|
|
ANM2 *previewSprite;
|
|
void *resolvedPath [5];
|
|
uint resolvedPathCapacity;
|
|
std_string layerString;
|
|
std_string local_3c;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
void *local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((resolvedPath + 0x1a));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
|
|
puStack_18 = &LAB_00b057ee;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((resolvedPath + 0x17));
|
|
ExceptionList = &local_1c;
|
|
cleanupFlags = GHIDRA_CAST<LayerState *>(0x0);
|
|
local_90 = GHIDRA_CAST<LayerState *>(0x0);
|
|
previewSprite = GHIDRA_CAST<ANM2 *>((this + 0x8c));
|
|
menu = this;
|
|
(GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::Reset();
|
|
entityConfig = &g_manager->_entityConfig;
|
|
MVar10 = this[0xd1];
|
|
if (GHIDRA_INT(this[0xd3]) < GHIDRA_INT(MVar10)) {
|
|
if (this[0xd7] != this[0xd8]) {
|
|
local_80 = (Menu_Bestiary)
|
|
(GHIDRA_INT(this[0xd7]) + (GHIDRA_INT(this[0xd2]) + (GHIDRA_INT(MVar10) - GHIDRA_INT(this[0xd3])) * 4 + -4) * 4
|
|
);
|
|
goto LAB_008c8d25;
|
|
}
|
|
LAB_008c8d47:
|
|
entityEntry = (entityConfig->_entities)._head;
|
|
}
|
|
else {
|
|
if (this[0xd4] == this[0xd5]) goto LAB_008c8d47;
|
|
local_80 = (Menu_Bestiary)(GHIDRA_INT(this[0xd4]) + (GHIDRA_INT(MVar10) * 0x10 + GHIDRA_INT(this[0xd2])) * 4);
|
|
LAB_008c8d25:
|
|
_Find_lower_bound<>(local_3c._buf + 0xc,local_80);
|
|
if ((*GHIDRA_CAST<char *>((local_3c._capacity + 0xd)) != '\0') ||
|
|
(entityEntry = (void *)local_3c._capacity,
|
|
*GHIDRA_CAST<uint *>(local_80) < *GHIDRA_CAST<uint *>((local_3c._capacity + 0x10)))) goto LAB_008c8d47;
|
|
}
|
|
if (entityEntry == (entityConfig->_entities)._head) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x138)) == 0) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
iVar2 = 0x110;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x120)) == 0) {
|
|
iVar2 = 0x8c;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::Load(GHIDRA_CAST<std_string *>((iVar2 + GHIDRA_INT(entityEntry))),0);
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x168)) != 0) &&
|
|
(MVar10 = (Menu_Bestiary)0x0, menu[0xac] != (Menu_Bestiary)0x0)) {
|
|
do {
|
|
pLVar3 = (GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(MVar10));
|
|
local_3c._capacity = 0xf;
|
|
local_3c._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = GHIDRA_CAST<LayerState *>(0x0);
|
|
local_14 = (void *)0x0;
|
|
cleanupFlags = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) | 4));
|
|
if (pLVar3->_layerData == (void *)0x0) {
|
|
layerString._capacity = 0xf;
|
|
layerString._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(layerString._buf)) + 0x0))) = GHIDRA_CAST<std_string *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((layerString._buf)))->std::string::string((void *)(GHIDRA_INT(pLVar3->_layerData) + 0x20));
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
anm2_resolve_spritesheet_path
|
|
(GHIDRA_CAST<std_string *>(resolvedPath),&layerString,GHIDRA_CAST<std_string *>((GHIDRA_INT(entityEntry) + 0x158)),
|
|
&local_3c,GHIDRA_CAST<byte *>(0x0));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
if (0xf < layerString._capacity) {
|
|
uVar8 = layerString._capacity + 1;
|
|
psVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(layerString._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
psVar6 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(layerString._buf)) + 0x0))) + -0x18)))->_capacity);
|
|
uVar8 = layerString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(layerString._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar6)))))
|
|
goto LAB_008c9312;
|
|
}
|
|
operator_delete(psVar6,uVar8);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
|
|
if ((void *)0xf < local_3c._capacity) {
|
|
uVar8 = local_3c._capacity + 1;
|
|
pLVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<LayerState *>(local_3c._buf))) + 0x0)));
|
|
if (0xfff < uVar8) {
|
|
pLVar3 = GHIDRA_CAST<LayerState *>((GHIDRA_CAST<LayerState *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -0x9c)))->_spriteSheet);
|
|
uVar8 = local_3c._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pLVar3))))) goto LAB_008c9312;
|
|
}
|
|
operator_delete(pLVar3,uVar8);
|
|
}
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(previewSprite))))->Sprite::ReplaceSpritesheet(GHIDRA_INT(MVar10),GHIDRA_CAST<std_string *>(resolvedPath));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
|
|
if (0xf < resolvedPathCapacity) {
|
|
uVar8 = resolvedPathCapacity + 1;
|
|
ptr = resolvedPath[0];
|
|
if (0xfff < uVar8) {
|
|
ptr = *(void **)(GHIDRA_INT(resolvedPath[0]) + -4);
|
|
uVar8 = resolvedPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(resolvedPath[0]) + (-4 - GHIDRA_INT(ptr))))) goto LAB_008c9312;
|
|
}
|
|
operator_delete(ptr,uVar8);
|
|
}
|
|
MVar10 = (Menu_Bestiary)(GHIDRA_INT(MVar10) + 1);
|
|
} while (GHIDRA_UINT(MVar10) < GHIDRA_UINT(menu[0xac]));
|
|
}
|
|
if ((((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x18)) == 0x110) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x18)) == 0x10f)
|
|
) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x1c)) == 1)) &&
|
|
(layerIdx = (Menu_Bestiary)0x0, menu[0xac] != (Menu_Bestiary)0x0)) {
|
|
do {
|
|
pLVar3 = (GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(layerIdx));
|
|
cleanupFlags = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) | 8));
|
|
if (pLVar3->_layerData == (void *)0x0) {
|
|
local_3c._capacity = 0xf;
|
|
local_3c._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = GHIDRA_CAST<LayerState *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((local_3c._buf)))->std::string::string((void *)(GHIDRA_INT(pLVar3->_layerData) + 0x20));
|
|
}
|
|
local_14 = (void *)0x5;
|
|
local_90 = GHIDRA_CAST<LayerState *>(&local_3c);
|
|
if ((void *)0xf < local_3c._capacity) {
|
|
local_90 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<LayerState *>(local_3c._buf))) + 0x0)));
|
|
}
|
|
local_78 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<LayerState *>(local_3c._buf))) + 0x0)));
|
|
if (4 < local_3c._size) {
|
|
local_8c = GHIDRA_CAST<std_string *>(((local_90->_spriteSheetPath)._buf + (local_3c._size - 0xc)));
|
|
for (pbVar4 = memchr(local_90,0x41,GHIDRA_INT(local_8c) - GHIDRA_INT(local_90)); pbVar4 != GHIDRA_CAST<byte *>(0x0);
|
|
pbVar4 = memchr(pbVar4 + 1,0x41,GHIDRA_INT(local_8c) - GHIDRA_INT((pbVar4 + 1)))) {
|
|
local_80 = (Menu_Bestiary)0x1;
|
|
pcVar9 = "Angel";
|
|
pbVar5 = pbVar4;
|
|
if (*GHIDRA_CAST<int *>(pbVar4) == 0x65676e41) {
|
|
pbVar5 = pbVar4 + 4;
|
|
local_80 = (Menu_Bestiary)0xfffffffd;
|
|
pcVar9 = "l";
|
|
}
|
|
bVar13 = *pbVar5 < (byte)*pcVar9;
|
|
if ((*pbVar5 == *pcVar9) &&
|
|
((local_80 == (Menu_Bestiary)0xfffffffd ||
|
|
(((bVar13 = pbVar5[1] < (byte)pcVar9[1], pbVar5[1] == pcVar9[1] &&
|
|
(bVar13 = pbVar5[2] < (byte)pcVar9[2], pbVar5[2] == pcVar9[2])) &&
|
|
(bVar13 = pbVar5[3] < (byte)pcVar9[3], pbVar5[3] == pcVar9[3])))))) {
|
|
uVar8 = 0;
|
|
}
|
|
else {
|
|
uVar8 = -GHIDRA_UINT(bVar13) | 1;
|
|
}
|
|
if (uVar8 == 0) {
|
|
if (GHIDRA_INT(pbVar4) - GHIDRA_INT(local_90) != -1) {
|
|
uVar8 = local_3c._size - 4;
|
|
if (local_3c._size < uVar8) {
|
|
(GHIDRA_CAST<std::string *>((local_3c._buf)))->std::string::append_n(uVar8 - local_3c._size,0);
|
|
}
|
|
else {
|
|
pLVar3 = GHIDRA_CAST<LayerState *>(&local_3c);
|
|
if ((void *)0xf < local_3c._capacity) {
|
|
pLVar3 = local_78;
|
|
}
|
|
iVar2 = local_3c._size - 0xc;
|
|
local_3c._size = uVar8;
|
|
(pLVar3->_spriteSheetPath)._buf[iVar2] = '\0';
|
|
}
|
|
(GHIDRA_CAST<std::string *>((local_3c._buf)))->std::string::append(GHIDRA_CAST<byte *>("Black.png"),9);
|
|
MVar10 = layerIdx;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(previewSprite))))->Sprite::ReplaceSpritesheet(GHIDRA_INT(layerIdx),&local_3c);
|
|
pLVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<LayerState *>(local_3c._buf))) + 0x0)));
|
|
goto LAB_008c9015;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
pLVar3 = local_78;
|
|
MVar10 = layerIdx;
|
|
LAB_008c9015:
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
|
|
if ((void *)0xf < local_3c._capacity) {
|
|
uVar8 = local_3c._capacity + 1;
|
|
pLVar7 = pLVar3;
|
|
if (0xfff < uVar8) {
|
|
pLVar7 = GHIDRA_CAST<LayerState *>(pLVar3[-1]._spriteSheet);
|
|
uVar8 = local_3c._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pLVar3) + (-4 - GHIDRA_INT(pLVar7))))) goto LAB_008c9312;
|
|
}
|
|
operator_delete(pLVar7,uVar8);
|
|
}
|
|
layerIdx = (Menu_Bestiary)(GHIDRA_INT(MVar10) + 1);
|
|
} while (GHIDRA_UINT(layerIdx) < GHIDRA_UINT(menu[0xac]));
|
|
}
|
|
local_80 = (Menu_Bestiary)0x0;
|
|
if (menu[0xac] != (Menu_Bestiary)0x0) {
|
|
do {
|
|
pLVar3 = (GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(local_80));
|
|
cleanupFlags = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) | 0x10));
|
|
local_78 = pLVar3;
|
|
if (pLVar3->_layerData == (void *)0x0) {
|
|
layerString._capacity = 0xf;
|
|
layerString._size = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(layerString._buf)) + 0x0))) = GHIDRA_CAST<std_string *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((layerString._buf)))->std::string::string((void *)(GHIDRA_INT(pLVar3->_layerData) + 8));
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0;
|
|
local_90 = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) | 1));
|
|
psVar6 = &layerString;
|
|
if (0xf < layerString._capacity) {
|
|
psVar6 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(layerString._buf))) + 0x0)));
|
|
}
|
|
local_8c = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(layerString._buf))) + 0x0)));
|
|
cleanupFlags = local_90;
|
|
bVar1 = str_eq(GHIDRA_CAST<byte *>(psVar6),layerString._size,&DAT_00b64428,4);
|
|
if (bVar1 == 0) {
|
|
cleanupFlags = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) | 0x20));
|
|
if (pLVar3->_layerData == (void *)0x0) {
|
|
local_3c._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = GHIDRA_CAST<LayerState *>(0x0);
|
|
local_3c._size = 0;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<std::string *>((local_3c._buf)))->std::string::string((void *)(GHIDRA_INT(pLVar3->_layerData) + 8));
|
|
}
|
|
pLVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<LayerState *>(local_3c._buf))) + 0x0)));
|
|
cleanupFlags = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) | 2));
|
|
pLVar7 = GHIDRA_CAST<LayerState *>(&local_3c);
|
|
if ((void *)0xf < local_3c._capacity) {
|
|
pLVar7 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<LayerState *>(local_3c._buf))) + 0x0)));
|
|
}
|
|
bVar1 = str_eq(GHIDRA_CAST<byte *>(pLVar7),local_3c._size,&DAT_00b1d57c,4);
|
|
if (bVar1 != 0) goto LAB_008c91ab;
|
|
isBrightLayer = '\0';
|
|
}
|
|
else {
|
|
pLVar3 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<LayerState *>(local_3c._buf))) + 0x0)));
|
|
LAB_008c91ab:
|
|
isBrightLayer = '\x01';
|
|
}
|
|
if (((GHIDRA_UINT(cleanupFlags) & 2) != 0) &&
|
|
(cleanupFlags = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) & 0xfffffffd)),
|
|
(void *)0xf < local_3c._capacity)) {
|
|
uVar8 = local_3c._capacity + 1;
|
|
pLVar7 = pLVar3;
|
|
if (0xfff < uVar8) {
|
|
pLVar7 = GHIDRA_CAST<LayerState *>(pLVar3[-1]._spriteSheet);
|
|
uVar8 = local_3c._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(pLVar3) + (-4 - GHIDRA_INT(pLVar7))))) {
|
|
LAB_008c9312:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pLVar7,uVar8);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xff;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))) = 0xffffff;
|
|
if (((GHIDRA_UINT(cleanupFlags) & 1) != 0) &&
|
|
(cleanupFlags = GHIDRA_CAST<LayerState *>((GHIDRA_UINT(cleanupFlags) & 0xfffffffe)),
|
|
0xf < layerString._capacity)) {
|
|
uVar8 = layerString._capacity + 1;
|
|
psVar6 = local_8c;
|
|
if (0xfff < uVar8) {
|
|
psVar6 = GHIDRA_CAST<std_string *>(local_8c[-1]._capacity);
|
|
uVar8 = layerString._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(local_8c) + (-4 - GHIDRA_INT(psVar6))))) goto LAB_008c9312;
|
|
}
|
|
operator_delete(psVar6,uVar8);
|
|
}
|
|
if (isBrightLayer != '\0') {
|
|
local_9c = 0;
|
|
uStack_98 = 0;
|
|
local_94 = 0;
|
|
if (&local_78->_color != GHIDRA_CAST<ColorMod *>(local_bc)) {
|
|
(local_78->_color)._colorize[0] = 0.0;
|
|
(local_78->_color)._colorize[1] = 0.0;
|
|
(local_78->_color)._colorize[2] = 0.0;
|
|
(local_78->_color)._colorize[3] = 0.0;
|
|
(local_78->_color)._offset[0] = 0.0;
|
|
(local_78->_color)._offset[1] = 0.0;
|
|
(local_78->_color)._tint[0] = 1.8203125;
|
|
(local_78->_color)._tint[1] = 1.703125;
|
|
(local_78->_color)._tint[2] = 1.7421875;
|
|
(local_78->_color)._tint[3] = 1.0;
|
|
(local_78->_color)._offset[2] = 0.0;
|
|
}
|
|
}
|
|
local_80 = (Menu_Bestiary)(GHIDRA_INT(local_80) + 1);
|
|
} while (GHIDRA_UINT(local_80) < GHIDRA_UINT(menu[0xac]));
|
|
}
|
|
pAVar12 = previewSprite;
|
|
MVar10 = (Menu_Bestiary)0x60;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x18)) != 0x3b6) {
|
|
MVar10 = (Menu_Bestiary)0x0;
|
|
}
|
|
menu[0xd0] = MVar10;
|
|
(GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::LoadGraphics((byte)menu);
|
|
pAVar11 = previewSprite;
|
|
local_78 = GHIDRA_CAST<LayerState *>((GHIDRA_INT(entityEntry) + 0x128));
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(entityEntry) + 0x13c))) {
|
|
local_78 = *GHIDRA_CAST<LayerState **>(local_78);
|
|
}
|
|
pbVar4 = (pAVar12->_animState)._animData;
|
|
if (pbVar4 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_008c9339:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(local_78),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&pAVar11->_animState)))->AnimationState::Rewind();
|
|
(pAVar11->_animState)._isPlaying = 1;
|
|
pAVar11 = previewSprite;
|
|
}
|
|
}
|
|
else {
|
|
pbVar5 = pbVar4;
|
|
pLVar3 = local_78;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar4 + 0x14))) {
|
|
pbVar5 = *GHIDRA_CAST<byte **>(pbVar4);
|
|
}
|
|
do {
|
|
bVar1 = *pbVar5;
|
|
bVar13 = bVar1 < *GHIDRA_CAST<byte *>(pLVar3);
|
|
if (bVar1 != *GHIDRA_CAST<byte *>(pLVar3)) {
|
|
LAB_008c9318:
|
|
uVar8 = -GHIDRA_UINT(bVar13) | 1;
|
|
goto LAB_008c931d;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar5[1];
|
|
bVar13 = bVar1 < *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pLVar3) + 1));
|
|
if (bVar1 != *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pLVar3) + 1))) goto LAB_008c9318;
|
|
pbVar5 = pbVar5 + 2;
|
|
pLVar3 = GHIDRA_CAST<LayerState *>((GHIDRA_INT(pLVar3) + 2));
|
|
} while (bVar1 != 0);
|
|
uVar8 = 0;
|
|
LAB_008c931d:
|
|
if ((uVar8 != 0) || ((pbVar4[0x34] != 0 && ((previewSprite->_animState)._isPlaying == 0))))
|
|
goto LAB_008c9339;
|
|
}
|
|
pAVar12 = previewSprite;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(entityEntry) + 0x150)) != 0) {
|
|
local_78 = GHIDRA_CAST<LayerState *>((GHIDRA_INT(entityEntry) + 0x140));
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(entityEntry) + 0x154))) {
|
|
local_78 = *GHIDRA_CAST<LayerState **>(local_78);
|
|
}
|
|
pbVar4 = (pAVar11->_overlayAnimState)._animData;
|
|
if (pbVar4 != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar5 = pbVar4;
|
|
pLVar3 = local_78;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar4 + 0x14))) {
|
|
pbVar5 = *GHIDRA_CAST<byte **>(pbVar4);
|
|
}
|
|
do {
|
|
bVar1 = *pbVar5;
|
|
bVar13 = bVar1 < *GHIDRA_CAST<byte *>(pLVar3);
|
|
if (bVar1 != *GHIDRA_CAST<byte *>(pLVar3)) {
|
|
LAB_008c93b0:
|
|
uVar8 = -GHIDRA_UINT(bVar13) | 1;
|
|
goto LAB_008c93b5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar5[1];
|
|
bVar13 = bVar1 < *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pLVar3) + 1));
|
|
if (bVar1 != *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pLVar3) + 1))) goto LAB_008c93b0;
|
|
pbVar5 = pbVar5 + 2;
|
|
pLVar3 = GHIDRA_CAST<LayerState *>((GHIDRA_INT(pLVar3) + 2));
|
|
} while (bVar1 != 0);
|
|
uVar8 = 0;
|
|
LAB_008c93b5:
|
|
if ((uVar8 == 0) &&
|
|
((pbVar4[0x34] == 0 || ((previewSprite->_overlayAnimState)._isPlaying != 0))))
|
|
goto LAB_008c93f3;
|
|
}
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((previewSprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST<byte *>(local_78),1);
|
|
pAVar11 = previewSprite;
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((&previewSprite->_overlayAnimState)))->AnimationState::Rewind();
|
|
(pAVar11->_overlayAnimState)._isPlaying = 1;
|
|
pAVar12 = pAVar11;
|
|
}
|
|
}
|
|
LAB_008c93f3:
|
|
MVar10 = (Menu_Bestiary)(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(entityEntry) + 0x10c)) * g_vectorOne.y);
|
|
menu[0xb3] = (Menu_Bestiary)(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(entityEntry) + 0x10c)) * g_vectorOne.x);
|
|
menu[0xb4] = MVar10;
|
|
pLVar3 = (GHIDRA_CAST<ANM2 *>((pAVar12)))->ANM2::GetLayer(GHIDRA_CAST<byte *>("shadow"));
|
|
if (pLVar3 != GHIDRA_CAST<LayerState *>(0x0)) {
|
|
pLVar3->_visible = 0;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|