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>
2476 lines
124 KiB
C++
2476 lines
124 KiB
C++
#include "classes.h"
|
|
|
|
// 0091fe80
|
|
int NightmareScene::load_nightmares_xml(byte *path)
|
|
{
|
|
qword qVar1;
|
|
uint uVar2;
|
|
int *file;
|
|
int fileSize;
|
|
byte *xmlText;
|
|
void *node;
|
|
void *attribute;
|
|
byte *pbVar3;
|
|
byte ****ppppbVar4;
|
|
LayerState *layer;
|
|
undefined4 uVar5;
|
|
undefined4 extraout_EAX;
|
|
undefined4 extraout_EAX_00;
|
|
byte *pbVar6;
|
|
std_string *psVar7;
|
|
byte *pbVar8;
|
|
undefined4 extraout_ECX;
|
|
undefined4 extraout_ECX_00;
|
|
undefined4 extraout_ECX_01;
|
|
undefined4 extraout_ECX_02;
|
|
undefined4 extraout_ECX_03;
|
|
uint size;
|
|
qword *allocatedBytes;
|
|
bool isLess;
|
|
byte bVar9;
|
|
undefined1 xmlDoc [48];
|
|
undefined1 xmlPool [65564];
|
|
byte *progressAnm2Path;
|
|
char acStack_80 [4];
|
|
char acStack_7c [4];
|
|
char acStack_78 [4];
|
|
undefined8 local_74;
|
|
byte *joinedPath;
|
|
char acStack_68 [4];
|
|
char acStack_64 [4];
|
|
char acStack_60 [4];
|
|
uint joinedPathSize;
|
|
uint joinedPathCapacity;
|
|
byte *backgroundAnm2Path;
|
|
char acStack_50 [4];
|
|
char acStack_4c [4];
|
|
char acStack_48 [4];
|
|
uint backgroundAnm2PathSize;
|
|
uint backgroundAnm2PathCapacity;
|
|
byte ****root [4];
|
|
uint rootSize;
|
|
uint rootCapacity;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
byte ***local_14;
|
|
undefined4 *nightmareAttr;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((root + 0xe));
|
|
local_14 = GHIDRA_CAST<byte ***>(0xffffffff);
|
|
puStack_18 = &LAB_00b0a680;
|
|
local_1c = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((root + 0xb));
|
|
ExceptionList = &local_1c;
|
|
local_24 = uVar2;
|
|
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(path,GHIDRA_CAST<int *>(0x0));
|
|
if (file == GHIDRA_CAST<int *>(0x0)) {
|
|
fileSize = 0;
|
|
}
|
|
else {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x0))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4))) = 0xf;
|
|
progressAnm2Path = GHIDRA_CAST<byte *>(0x0);
|
|
backgroundAnm2PathCapacity = 0xf;
|
|
backgroundAnm2PathSize = 0;
|
|
backgroundAnm2Path = GHIDRA_CAST<byte *>(0x0);
|
|
local_14 = GHIDRA_CAST<byte ***>(0x1);
|
|
fileSize = (**(code **)(*file + 4))(uVar2);
|
|
xmlText = operator_new_tracked(fileSize + 1);
|
|
(**(code **)(*file + 0x14))(xmlText,1,fileSize);
|
|
xmlText[fileSize] = 0;
|
|
(**(code **)*file)(1);
|
|
FUN_00413b90();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
uVar2 = 0x91ffb1;
|
|
pbVar3 = xmlText;
|
|
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDoc)))->rapidxml::xml_document::parse(xmlText);
|
|
bVar9 = (byte)pbVar3;
|
|
node = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<byte *>("nightmares"),uVar2,bVar9);
|
|
attribute = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_attribute(&DAT_00b66f40,uVar2,bVar9);
|
|
rootSize = 0;
|
|
rootCapacity = 0xf;
|
|
root[0] = GHIDRA_CAST<byte ****>(0x0);
|
|
pbVar3 = &g_xmlNullStr;
|
|
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(attribute) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(attribute) + 4));
|
|
}
|
|
pbVar8 = pbVar3 + 1;
|
|
pbVar6 = pbVar3;
|
|
do {
|
|
bVar9 = *pbVar6;
|
|
pbVar6 = pbVar6 + 1;
|
|
} while (bVar9 != 0);
|
|
uVar2 = GHIDRA_INT(pbVar6) - GHIDRA_INT(pbVar8);
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(root))))->std::string::assign(pbVar3,uVar2);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
attribute = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_attribute(GHIDRA_CAST<byte *>("progressAnm2"),GHIDRA_UINT(pbVar3),(byte)uVar2);
|
|
pbVar3 = &g_xmlNullStr;
|
|
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(attribute) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(attribute) + 4));
|
|
}
|
|
pbVar6 = pbVar3;
|
|
do {
|
|
bVar9 = *pbVar6;
|
|
pbVar6 = pbVar6 + 1;
|
|
} while (bVar9 != 0);
|
|
psVar7 = GHIDRA_CAST<std_string *>((pbVar6 + -GHIDRA_INT((pbVar3 + 1))));
|
|
if (GHIDRA_CAST<std_string *>((0x7fffffff - rootSize)) < psVar7) {
|
|
LAB_00920436:
|
|
/* WARNING: Subroutine does not return */
|
|
std::string::_Xlen();
|
|
}
|
|
ppppbVar4 = GHIDRA_CAST<byte ****>(root);
|
|
if (0xf < rootCapacity) {
|
|
ppppbVar4 = root[0];
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&joinedPath))))->std::string::concat(GHIDRA_INT(pbVar8),psVar7,GHIDRA_CAST<byte *>(ppppbVar4),rootSize,pbVar3,
|
|
GHIDRA_UINT(psVar7));
|
|
bVar9 = (byte)psVar7;
|
|
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4)))) {
|
|
uVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4))) + 1;
|
|
pbVar3 = progressAnm2Path;
|
|
if (0xfff < uVar2) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((progressAnm2Path + -4));
|
|
uVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4))) + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < progressAnm2Path + (-4 - GHIDRA_INT(pbVar3))) goto LAB_0092030e;
|
|
}
|
|
operator_delete(pbVar3,uVar2);
|
|
bVar9 = (byte)uVar2;
|
|
}
|
|
progressAnm2Path = joinedPath;
|
|
acStack_80[0] = acStack_68[0];
|
|
acStack_80[1] = acStack_68[1];
|
|
acStack_80[2] = acStack_68[2];
|
|
acStack_80[3] = acStack_68[3];
|
|
acStack_7c[0] = acStack_64[0];
|
|
acStack_7c[1] = acStack_64[1];
|
|
acStack_7c[2] = acStack_64[2];
|
|
acStack_7c[3] = acStack_64[3];
|
|
acStack_78[0] = acStack_60[0];
|
|
acStack_78[1] = acStack_60[1];
|
|
acStack_78[2] = acStack_60[2];
|
|
acStack_78[3] = acStack_60[3];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4))) = joinedPathCapacity;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x0))) = joinedPathSize;
|
|
attribute = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_attribute(GHIDRA_CAST<byte *>("backgroundAnm2"),GHIDRA_UINT(pbVar3),bVar9);
|
|
if (attribute == (void *)0x0) {
|
|
pbVar3 = GHIDRA_CAST<byte *>("nightmare_bg.anm2");
|
|
}
|
|
else {
|
|
pbVar3 = &g_xmlNullStr;
|
|
if (*GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(attribute) + 4)) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(attribute) + 4));
|
|
}
|
|
}
|
|
pbVar6 = pbVar3;
|
|
do {
|
|
bVar9 = *pbVar6;
|
|
pbVar6 = pbVar6 + 1;
|
|
} while (bVar9 != 0);
|
|
psVar7 = GHIDRA_CAST<std_string *>((pbVar6 + -GHIDRA_INT((pbVar3 + 1))));
|
|
if (GHIDRA_CAST<std_string *>((0x7fffffff - rootSize)) < psVar7) goto LAB_00920436;
|
|
ppppbVar4 = GHIDRA_CAST<byte ****>(root);
|
|
if (0xf < rootCapacity) {
|
|
ppppbVar4 = root[0];
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&joinedPath))))->std::string::concat(GHIDRA_INT(pbVar8),psVar7,GHIDRA_CAST<byte *>(ppppbVar4),rootSize,pbVar3,
|
|
GHIDRA_UINT(psVar7));
|
|
bVar9 = (byte)psVar7;
|
|
if (0xf < backgroundAnm2PathCapacity) {
|
|
uVar2 = backgroundAnm2PathCapacity + 1;
|
|
pbVar3 = backgroundAnm2Path;
|
|
if (0xfff < uVar2) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((backgroundAnm2Path + -4));
|
|
uVar2 = backgroundAnm2PathCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < backgroundAnm2Path + (-4 - GHIDRA_INT(pbVar3))) goto LAB_0092030e;
|
|
}
|
|
operator_delete(pbVar3,uVar2);
|
|
bVar9 = (byte)uVar2;
|
|
}
|
|
backgroundAnm2Path = joinedPath;
|
|
acStack_50[0] = acStack_68[0];
|
|
acStack_50[1] = acStack_68[1];
|
|
acStack_50[2] = acStack_68[2];
|
|
acStack_50[3] = acStack_68[3];
|
|
acStack_4c[0] = acStack_64[0];
|
|
acStack_4c[1] = acStack_64[1];
|
|
acStack_4c[2] = acStack_64[2];
|
|
acStack_4c[3] = acStack_64[3];
|
|
acStack_48[0] = acStack_60[0];
|
|
acStack_48[1] = acStack_60[1];
|
|
acStack_48[2] = acStack_60[2];
|
|
acStack_48[3] = acStack_60[3];
|
|
backgroundAnm2PathSize = joinedPathSize;
|
|
backgroundAnm2PathCapacity = joinedPathCapacity;
|
|
for (node = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<byte *>("nightmare"),GHIDRA_INT(pbVar3),bVar9);
|
|
node != (void *)0x0; node = *(void **)(GHIDRA_CAST<char *>(node) + 0x2c)) {
|
|
for (nightmareAttr = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(node) + 0x20)); nightmareAttr != GHIDRA_CAST<undefined4 *>(0x0);
|
|
nightmareAttr = GHIDRA_CAST<undefined4 *>(nightmareAttr[6])) {
|
|
pbVar3 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(*nightmareAttr) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar3 = GHIDRA_CAST<byte *>(*nightmareAttr);
|
|
}
|
|
pbVar8 = &DAT_00b1bff4;
|
|
do {
|
|
bVar9 = *pbVar3;
|
|
isLess = bVar9 < *pbVar8;
|
|
if (bVar9 != *pbVar8) {
|
|
LAB_009201e1:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009201e6;
|
|
}
|
|
if (bVar9 == 0) break;
|
|
bVar9 = pbVar3[1];
|
|
isLess = bVar9 < pbVar8[1];
|
|
if (bVar9 != pbVar8[1]) goto LAB_009201e1;
|
|
pbVar3 = pbVar3 + 2;
|
|
pbVar8 = pbVar8 + 2;
|
|
} while (bVar9 != 0);
|
|
uVar2 = 0;
|
|
LAB_009201e6:
|
|
if (uVar2 == 0) {
|
|
pbVar3 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<byte *>(nightmareAttr[1]) != GHIDRA_CAST<byte *>(0x0)) {
|
|
pbVar3 = GHIDRA_CAST<byte *>(nightmareAttr[1]);
|
|
}
|
|
pbVar8 = pbVar3;
|
|
do {
|
|
bVar9 = *pbVar8;
|
|
pbVar8 = pbVar8 + 1;
|
|
} while (bVar9 != 0);
|
|
psVar7 = GHIDRA_CAST<std_string *>((pbVar8 + -GHIDRA_INT((pbVar3 + 1))));
|
|
if (GHIDRA_CAST<std_string *>((0x7fffffff - rootSize)) < psVar7) goto LAB_00920436;
|
|
ppppbVar4 = GHIDRA_CAST<byte ****>(root);
|
|
if (0xf < rootCapacity) {
|
|
ppppbVar4 = root[0];
|
|
}
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&joinedPath))))->std::string::concat(GHIDRA_INT((pbVar3 + 1)),psVar7,GHIDRA_CAST<byte *>(ppppbVar4),
|
|
rootSize,pbVar3,GHIDRA_UINT(psVar7));
|
|
pbVar3 = joinedPath;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
|
|
psVar7 = *GHIDRA_CAST<std_string **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xc))));
|
|
if (psVar7 == *GHIDRA_CAST<std_string **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x10))))) {
|
|
vector_string_emplace_reallocate_move(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x8))),psVar7,GHIDRA_CAST<std_string *>(&joinedPath))
|
|
;
|
|
uVar2 = joinedPathCapacity;
|
|
}
|
|
else {
|
|
joinedPath = GHIDRA_CAST<byte *>((GHIDRA_UINT(joinedPath) & 0xffffff00));
|
|
*GHIDRA_CAST<byte **>(psVar7->_buf) = pbVar3;
|
|
*(char (*) [4])(psVar7->_buf + 4) = acStack_68;
|
|
*(char (*) [4])(psVar7->_buf + 8) = acStack_64;
|
|
*(char (*) [4])(psVar7->_buf + 0xc) = acStack_60;
|
|
psVar7->_size = joinedPathSize;
|
|
psVar7->_capacity = joinedPathCapacity;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xc)))) + 0x18;
|
|
uVar2 = 0xf;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
if (0xf < uVar2) {
|
|
size = uVar2 + 1;
|
|
pbVar3 = joinedPath;
|
|
if (0xfff < size) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((joinedPath + -4));
|
|
size = uVar2 + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < joinedPath + (-4 - GHIDRA_INT(pbVar3))) goto LAB_0092030e;
|
|
}
|
|
operator_delete(pbVar3,size);
|
|
}
|
|
}
|
|
if (nightmareAttr[4] == 0) break;
|
|
}
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
if (0xf < rootCapacity) {
|
|
uVar2 = rootCapacity + 1;
|
|
ppppbVar4 = root[0];
|
|
if (0xfff < uVar2) {
|
|
ppppbVar4 = GHIDRA_CAST<byte ****>(root[0][-1]);
|
|
uVar2 = rootCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(root[0]) + (-4 - GHIDRA_INT(ppppbVar4))))) {
|
|
LAB_0092030e:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ppppbVar4,uVar2);
|
|
}
|
|
local_14 = GHIDRA_CAST<byte ***>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),5));
|
|
(GHIDRA_CAST<xml_memory_pool *>((xmlPool)))->xml_memory_pool::clear();
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
uVar5 = extraout_ECX;
|
|
if (xmlText != GHIDRA_CAST<byte *>(0x0)) {
|
|
uVar2 = *GHIDRA_CAST<uint *>((xmlText + -4));
|
|
qVar1 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar2;
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar2));
|
|
free(xmlText + -4);
|
|
uVar5 = extraout_ECX_00;
|
|
}
|
|
local_14 = GHIDRA_CAST<byte ***>(CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1));
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) == '\0') {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::Load(GHIDRA_CAST<std_string *>(&progressAnm2Path),1);
|
|
uVar5 = extraout_ECX_01;
|
|
}
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x129))) == '\0') &&
|
|
((GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))))))->ANM2::Load(GHIDRA_CAST<std_string *>(&backgroundAnm2Path),1),
|
|
uVar5 = extraout_ECX_02, 7 < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xa0)))))) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))))))->ANM2::GetLayer(&DAT_00000007);
|
|
layer->_bitflags = layer->_bitflags | 0x60;
|
|
uVar5 = extraout_ECX_03;
|
|
}
|
|
uVar5 = FUN_00920440(uVar5);
|
|
if (0xf < backgroundAnm2PathCapacity) {
|
|
uVar2 = backgroundAnm2PathCapacity + 1;
|
|
pbVar3 = backgroundAnm2Path;
|
|
if (0xfff < uVar2) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((backgroundAnm2Path + -4));
|
|
uVar2 = backgroundAnm2PathCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < backgroundAnm2Path + (-4 - GHIDRA_INT(pbVar3))) goto LAB_0092041f;
|
|
}
|
|
operator_delete(pbVar3,uVar2);
|
|
uVar5 = extraout_EAX;
|
|
}
|
|
backgroundAnm2PathSize = 0;
|
|
backgroundAnm2PathCapacity = 0xf;
|
|
backgroundAnm2Path = GHIDRA_CAST<byte *>((GHIDRA_UINT(backgroundAnm2Path) & 0xffffff00));
|
|
if (0xf < (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4)))) {
|
|
uVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4))) + 1;
|
|
pbVar3 = progressAnm2Path;
|
|
if (0xfff < uVar2) {
|
|
pbVar3 = *GHIDRA_CAST<byte **>((progressAnm2Path + -4));
|
|
uVar2 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_74)) + 0x4))) + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < progressAnm2Path + (-4 - GHIDRA_INT(pbVar3))) {
|
|
LAB_0092041f:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pbVar3,uVar2);
|
|
uVar5 = extraout_EAX_00;
|
|
}
|
|
fileSize = CONCAT31((int3)(GHIDRA_UINT(uVar5) >> 8),1);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return fileSize;
|
|
}
|
|
|
|
// 00920510
|
|
void NightmareScene::Update()
|
|
{
|
|
undefined1 *puVar1;
|
|
byte isConfirmTriggered;
|
|
byte isSkipPressed;
|
|
Entity_Player *dreamCatcherOwner;
|
|
uint uVar3;
|
|
char *anim;
|
|
byte *queuedAnim;
|
|
LayerState *layer;
|
|
int framesLeft;
|
|
int currentFrame;
|
|
byte extraout_CL;
|
|
byte extraout_CL_00;
|
|
bool isSceneFinished;
|
|
float fadeProgress;
|
|
bool isSkipPressed;
|
|
|
|
if (*GHIDRA_CAST<int *>(this) == 0) {
|
|
return;
|
|
}
|
|
dreamCatcherOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x236,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if (((dreamCatcherOwner == GHIDRA_CAST<Entity_Player *>(0x0)) ||
|
|
(((isSkipPressed = extraout_CL, 0 < g_game->_stage && (g_game->_stage < 7)) &&
|
|
(isSkipPressed = 0, (g_game->_gameStateFlags & 0x1000000000000) != 0)))) &&
|
|
(isConfirmTriggered = input_is_action_triggered(g_manager,0xe,-1,GHIDRA_CAST<Entity *>(0x0),0),
|
|
isSkipPressed = extraout_CL_00, isConfirmTriggered != 0)) {
|
|
isSkipPressed = true;
|
|
}
|
|
else {
|
|
isSkipPressed = false;
|
|
}
|
|
uVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID(isSkipPressed);
|
|
if ((uVar3 == 0x1a) &&
|
|
(isSkipPressed = input_is_action_triggered(g_manager,0xe,-1,GHIDRA_CAST<Entity *>(0x0),0), isSkipPressed != 0)) {
|
|
isSkipPressed = true;
|
|
}
|
|
uVar3 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if ((uVar3 & 1) == 0) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x129))) != '\0') {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x50)))))))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x70)))))))->AnimationState::Update();
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x239))) != '\0') {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x160)))))))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x180)))))))->AnimationState::Update();
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x54)))) == 0) || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x64))) == '\0')) {
|
|
anim = "Dogma";
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x244))) == '\0') {
|
|
anim = &DAT_00b1b410;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))))))->ANM2::Play(GHIDRA_CAST<byte *>(anim),0);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x23d))) != '\0') {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x164)))))))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x184)))))))->AnimationState::Update();
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4)))) == *GHIDRA_CAST<int *>((this + 1)) * 2) &&
|
|
(isSkipPressed = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Scene"),1), isSkipPressed != 0)) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x164)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x178))) = 1;
|
|
}
|
|
if (((((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x118))) != '\0') && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x12c)))) != 0)) &&
|
|
(GHIDRA_UINT((*GHIDRA_CAST<int *>((this + 1)) * 2)) < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4)))))) &&
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x168)))) == 0 || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x178))) == '\0')))) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x188)))) == 0) {
|
|
LAB_00920712:
|
|
queuedAnim = *GHIDRA_CAST<byte **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x120)))) +
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x124)))) - 1U & *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128)))))
|
|
* 4));
|
|
if (0xf < *GHIDRA_CAST<uint *>((queuedAnim + 0x14))) {
|
|
queuedAnim = *GHIDRA_CAST<byte **>(queuedAnim);
|
|
}
|
|
isSkipPressed = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134)))))))->ANM2::SetOverlayAnimation(queuedAnim,1);
|
|
if (isSkipPressed != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x184)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x198))) = 1;
|
|
}
|
|
if (9 < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1b4))))) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134)))))))->ANM2::GetLayer(&DAT_00000009);
|
|
layer->_bitflags = layer->_bitflags | 0x60;
|
|
}
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x198))) == '\0') {
|
|
std::string::_Tidy_deallocate
|
|
(*GHIDRA_CAST<char **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x120)))) +
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x124)))) - 1U & *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128))))) *
|
|
4)));
|
|
puVar1 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x12c)));
|
|
*GHIDRA_CAST<int *>(puVar1) = *GHIDRA_CAST<int *>(puVar1) + -1;
|
|
if (*GHIDRA_CAST<int *>(puVar1) != 0) {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128)))) + 1;
|
|
goto LAB_00920712;
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128)))) = 0;
|
|
}
|
|
}
|
|
if ((((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x244))) != '\0') && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x168)))) != 0)) &&
|
|
(isSkipPressed = AnimationState::IsEventTriggered
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x164)))),GHIDRA_CAST<byte *>("Interrupt")), isSkipPressed != 0))
|
|
{
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134)))))))->ANM2::Reset();
|
|
TextureCache::Purge();
|
|
*GHIDRA_CAST<undefined4 *>(this) = 0;
|
|
return;
|
|
}
|
|
}
|
|
uVar3 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
if (uVar3 < 0x1e) {
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x35c)))) = 1.0 - ((float)(uVar3 >> 1) + 0.0) / 15.0;
|
|
}
|
|
else if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x23d))) == '\0') {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x35c)))) = 0;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x118))) == '\0') {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x168)))) == 0) {
|
|
framesLeft = 0;
|
|
}
|
|
else {
|
|
framesLeft = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x168)))) + 0x30));
|
|
}
|
|
currentFrame = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134)))))))->ANM2::GetFrame();
|
|
framesLeft = framesLeft - currentFrame;
|
|
}
|
|
else {
|
|
if ((1 < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x12c))))) || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x198))) == '\0')) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x35c)))) = 0;
|
|
goto LAB_009208b9;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x188)))) == 0) {
|
|
uVar3 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
framesLeft = 1;
|
|
}
|
|
else {
|
|
uVar3 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
framesLeft = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x188)))) + 0x30)) -
|
|
GHIDRA_INT(*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x194)))));
|
|
}
|
|
}
|
|
fadeProgress = (float)framesLeft / 15.0;
|
|
if (fadeProgress <= 0.0) {
|
|
fadeProgress = 0.0;
|
|
}
|
|
if (1.0 <= fadeProgress) {
|
|
fadeProgress = 1.0;
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x35c)))) = 1.0 - fadeProgress;
|
|
}
|
|
}
|
|
LAB_009208b9:
|
|
if (*GHIDRA_CAST<int *>((this + 1)) * 2 + 2U < uVar3) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x118))) == '\0') {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x168)))) != 0) {
|
|
isSceneFinished = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x178))) == '\0';
|
|
goto LAB_009208ec;
|
|
}
|
|
}
|
|
else {
|
|
isSceneFinished = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x12c)))) == 0;
|
|
LAB_009208ec:
|
|
if (!isSceneFinished) goto LAB_009208ee;
|
|
}
|
|
}
|
|
else {
|
|
LAB_009208ee:
|
|
if (!isSkipPressed) goto LAB_00920918;
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))))))->ANM2::Reset();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134)))))))->ANM2::Reset();
|
|
TextureCache::Purge();
|
|
uVar3 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4))));
|
|
*GHIDRA_CAST<undefined4 *>(this) = 0;
|
|
LAB_00920918:
|
|
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4)))) = uVar3 + 1;
|
|
return;
|
|
}
|
|
|
|
// 00920940
|
|
void NightmareScene::Render()
|
|
{
|
|
float fVar1;
|
|
undefined4 uVar2;
|
|
undefined4 uVar3;
|
|
undefined4 uVar4;
|
|
byte bVar5;
|
|
LayerState *layer;
|
|
int iVar6;
|
|
float *nullFrame;
|
|
int iVar7;
|
|
ChallengeParam *challengeParams;
|
|
float fVar8;
|
|
byte *pbVar9;
|
|
uint uVar10;
|
|
Game *connectorIndex;
|
|
byte *animNameChar;
|
|
void *pvVar11;
|
|
undefined4 *shaderTop;
|
|
char *animName;
|
|
AnimationState *renderState;
|
|
int unused;
|
|
int animData;
|
|
bool isLess;
|
|
float fVar12;
|
|
ANM2 *animation;
|
|
undefined1 fadeQuad [44];
|
|
float local_d4;
|
|
float local_c0;
|
|
float local_ac;
|
|
float local_98;
|
|
undefined1 *stageBarSprite;
|
|
Vector local_88;
|
|
float lastSlot;
|
|
float local_7c;
|
|
uint local_78;
|
|
float local_74;
|
|
float local_70;
|
|
float iconCount;
|
|
char isGreedMode;
|
|
Game *local_64;
|
|
void *local_60;
|
|
int *local_5c;
|
|
float local_58;
|
|
Vector iconPos;
|
|
int stageIcons [5];
|
|
undefined4 local_38;
|
|
undefined4 local_34;
|
|
undefined4 local_30;
|
|
undefined4 local_2c;
|
|
KColor local_28;
|
|
uint stackCookie;
|
|
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT((stageIcons + 0xf));
|
|
if ((g_game->_difficulty == 2) || (isGreedMode = '\0', g_game->_difficulty == 3)) {
|
|
isGreedMode = '\x01';
|
|
}
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
if (*GHIDRA_CAST<int *>(this) == 0) {
|
|
return;
|
|
}
|
|
local_74 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x54))));
|
|
if ((local_74 != 0.0) && (local_78 = 0, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_74) + 0x1c)) != 0)) {
|
|
local_58 = 0.0;
|
|
do {
|
|
pbVar9 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(local_58) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_74) + 0x18))));
|
|
local_60 = (GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x50)))))))->AnimationState::GetLayerFrame(GHIDRA_INT(pbVar9));
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))))))->ANM2::GetLayer(pbVar9);
|
|
if (((layer->_visible != 0) && (local_60 != (void *)0x0)) &&
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_60) + 0x2c)) != '\0')) {
|
|
local_64 = GHIDRA_CAST<Game *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_74) + 0x18)) + GHIDRA_INT(local_58)));
|
|
if ((((GHIDRA_INT(pbVar9) < 0) || (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x50)))) + 0x80)) <= GHIDRA_INT(pbVar9))) &&
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n")), GHIDRA_INT(pbVar9) < 0)) ||
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x50)))) + 0x80)) <= GHIDRA_INT(pbVar9))) {
|
|
iVar6 = 0;
|
|
}
|
|
else {
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x58)))) +
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x54)))) + 0x38 + GHIDRA_INT(pbVar9) * 4)) * 4));
|
|
}
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>(local_64),&g_vectorZero,iVar6,&g_vectorZero,&g_vectorZero,
|
|
GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))));
|
|
pvVar11 = local_60;
|
|
if (((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x239))) != '\0') && ((pbVar9 == GHIDRA_CAST<byte *>(0x2) || (pbVar9 == &DAT_00000006))))
|
|
{
|
|
local_5c = GHIDRA_CAST<int *>((-*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + 0x24)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + 0x1c))));
|
|
local_70 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + 0x5c));
|
|
local_64 = GHIDRA_CAST<Game *>((local_70 * 0.017453292));
|
|
local_60 = (void *)(-*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + 0x20)) * *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + 0x18)));
|
|
local_7c = cos((float)local_64);
|
|
fVar12 = sin((float)local_64);
|
|
if (GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1d8)))) == GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pvVar11) + 0x30))) {
|
|
fVar8 = local_70;
|
|
}
|
|
else {
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x34));
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x38));
|
|
uVar4 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x3c));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1d8)))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x30));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1dc)))) = uVar2;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1e0)))) = uVar3;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1e4)))) = uVar4;
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x44));
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x48));
|
|
uVar4 = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x4c));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1e8)))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x40));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1ec)))) = uVar2;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1f0)))) = uVar3;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1f4)))) = uVar4;
|
|
*GHIDRA_CAST<undefined8 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1f8)))) = *GHIDRA_CAST<undefined8 *>((GHIDRA_CAST<char *>(pvVar11) + 0x50));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x200)))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x58));
|
|
fVar8 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar11) + 0x5c));
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1d4)))) = fVar8;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1cc)))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x18));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1d0)))) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar11) + 0x1c));
|
|
fVar8 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xb8))));
|
|
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar11) + 0x14));
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1c4)))) =
|
|
((float)local_60 * local_7c - (float)local_5c * fVar12) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xb4))))
|
|
+ *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar11) + 0x10));
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1c8)))) =
|
|
(float)local_5c * local_7c + (float)local_60 * fVar12 + fVar8 + fVar1;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x239))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1a0))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x160)))),&g_vectorZero,&g_vectorZero,
|
|
&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x180))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x180)))),&g_vectorZero,&g_vectorZero,
|
|
&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x160))));
|
|
}
|
|
AnimationState::Render(renderState,&g_vectorZero,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
}
|
|
local_78 = local_78 + 1;
|
|
local_58 = (float)(GHIDRA_INT(local_58) + 0x10);
|
|
} while (local_78 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_74) + 0x1c)));
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x118))) == '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x23d))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1a4))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x164)))),&g_vectorZero,&g_vectorZero,&g_vectorZero);
|
|
goto LAB_00921007;
|
|
}
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x184)))),&g_vectorZero,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x164))));
|
|
goto LAB_0092100d;
|
|
}
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x164)))),&g_vectorZero,&g_vectorZero,&g_vectorZero);
|
|
if ((((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x10d))) != '\0') && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x12c)))) != 0)) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x188)))) != 0)) {
|
|
local_58 = 5.60519e-45;
|
|
local_64 = *GHIDRA_CAST<Game **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x120)))) +
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x124)))) - 1U & *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128))))) * 4));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x98)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1c8))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x9c)))) = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x1cc))));
|
|
local_5c = &DAT_00c5d254;
|
|
do {
|
|
nullFrame = AnimationState::GetNullFrame
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x184)))),GHIDRA_CAST<byte *>(local_5c[-1]));
|
|
if (((nullFrame != GHIDRA_CAST<float *>(0x0)) && (*GHIDRA_CAST<char *>((nullFrame + 3)) != '\0')) &&
|
|
(iVar6 = local_64->_roomMap[local_5c[3] + -0x5eb1], iVar6 != 0)) {
|
|
pbVar9 = GHIDRA_CAST<byte *>(*local_5c);
|
|
if (pbVar9 == &DAT_00000006) {
|
|
uVar10 = *GHIDRA_CAST<uint *>((iVar6 + 4));
|
|
if (GHIDRA_INT(uVar10) < 0x2dd) {
|
|
local_60 = (void *)(uVar10 - 1);
|
|
goto LAB_00920dfe;
|
|
}
|
|
local_28._unk = 7;
|
|
if (((byte)g_graphicsManager_flags & 4) == 0) {
|
|
local_28._green = 8.40779e-45;
|
|
}
|
|
else {
|
|
local_28._green = 1.4013e-45;
|
|
}
|
|
local_28._red = 0.0;
|
|
local_28._blue = 9.80909e-45;
|
|
local_28._alpha = 1.4013e-45;
|
|
iconPos.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x98)))) + *nullFrame;
|
|
iconPos.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x9c)))) + nullFrame[1];
|
|
ModManager::RenderCustomCollectionItem
|
|
(&g_manager->_modManager,uVar10,&iconPos,GHIDRA_CAST<Vector *>((nullFrame + 4)),
|
|
GHIDRA_CAST<ColorMod *>((nullFrame + 6)),&local_28);
|
|
}
|
|
else if (((pbVar9 == GHIDRA_CAST<byte *>(0x3)) &&
|
|
(local_60 = *(void **)(iVar6 + 0x160), local_60 != (void *)0x0)) &&
|
|
(*GHIDRA_CAST<char *>((iVar6 + 0x164)) != '\0')) {
|
|
local_88.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x98)))) + *nullFrame;
|
|
local_88.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x9c)))) + nullFrame[1];
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_60) + 0xef9)) != '\0') {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_60) + 0xdf0)))))->ANM2::SetFrame(GHIDRA_CAST<std_string *>((GHIDRA_INT(local_60) + 0xe08)),
|
|
*GHIDRA_CAST<int *>((iVar6 + 100)));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((GHIDRA_INT(local_60) + 0xdf0)))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>((nullFrame + 6)));
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + 0xe8c)) = nullFrame[4];
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_60) + 0xe90)) = nullFrame[5];
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_60) + 0xdf0)))))->ANM2::Render(&local_88,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
else {
|
|
local_60 = *(void **)(iVar6 + 100);
|
|
LAB_00920dfe:
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))))))->ANM2::GetLayer(pbVar9);
|
|
fVar12 = (float)local_5c[2];
|
|
fVar8 = nullFrame[1];
|
|
(layer->_pos).x = (float)local_5c[1] + *nullFrame;
|
|
(layer->_pos).y = fVar12 + fVar8;
|
|
layer->_rotation = nullFrame[0x11];
|
|
(layer->_size).x = nullFrame[4];
|
|
(layer->_size).y = nullFrame[5];
|
|
if (&layer->_color != GHIDRA_CAST<ColorMod *>((nullFrame + 6))) {
|
|
fVar12 = nullFrame[7];
|
|
fVar8 = nullFrame[8];
|
|
fVar1 = nullFrame[9];
|
|
(layer->_color)._tint[0] = nullFrame[6];
|
|
(layer->_color)._tint[1] = fVar12;
|
|
(layer->_color)._tint[2] = fVar8;
|
|
(layer->_color)._tint[3] = fVar1;
|
|
fVar12 = nullFrame[0xb];
|
|
fVar8 = nullFrame[0xc];
|
|
fVar1 = nullFrame[0xd];
|
|
(layer->_color)._colorize[0] = nullFrame[10];
|
|
(layer->_color)._colorize[1] = fVar12;
|
|
(layer->_color)._colorize[2] = fVar8;
|
|
(layer->_color)._colorize[3] = fVar1;
|
|
fVar12 = nullFrame[0xf];
|
|
(layer->_color)._offset[0] = nullFrame[0xe];
|
|
(layer->_color)._offset[1] = fVar12;
|
|
(layer->_color)._offset[2] = nullFrame[0x10];
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))))))->ANM2::SetLayerFrame(*local_5c,GHIDRA_INT(local_60));
|
|
iVar6 = *local_5c;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x10d))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x74))) == '\0') {
|
|
animData = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x38))));
|
|
if ((((animData != 0) && (-1 < iVar6)) &&
|
|
(iVar6 < (*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x34)))))->_layerCount)) &&
|
|
(iVar7 = *GHIDRA_CAST<int *>((animData + 0x38 + iVar6 * 4)), -1 < iVar7)) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar7 * 0x10 + *GHIDRA_CAST<int *>((animData + 0x18)))),
|
|
&g_vectorZero,*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x3c)))) + iVar7 * 4)),
|
|
&g_vectorZero,&g_vectorZero,*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x34)))));
|
|
}
|
|
animData = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x58))));
|
|
if (((animData != 0) && (-1 < iVar6)) &&
|
|
((animation = *GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x54)))), iVar6 < animation->_layerCount &&
|
|
(iVar6 = *GHIDRA_CAST<int *>((animData + 0x38 + iVar6 * 4)), -1 < iVar6)))) {
|
|
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x5c))));
|
|
goto LAB_00920f90;
|
|
}
|
|
}
|
|
else {
|
|
animData = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x58))));
|
|
if (((animData != 0) && (-1 < iVar6)) &&
|
|
((iVar6 < (*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x54)))))->_layerCount &&
|
|
(iVar7 = *GHIDRA_CAST<int *>((animData + 0x38 + iVar6 * 4)), -1 < iVar7)))) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar7 * 0x10 + *GHIDRA_CAST<int *>((animData + 0x18)))),
|
|
&g_vectorZero,*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x5c)))) + iVar7 * 4)),
|
|
&g_vectorZero,&g_vectorZero,*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x54)))));
|
|
}
|
|
animData = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x38))));
|
|
if ((((animData != 0) && (-1 < iVar6)) &&
|
|
(animation = *GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x34)))), iVar6 < animation->_layerCount)) &&
|
|
(iVar6 = *GHIDRA_CAST<int *>((animData + 0x38 + iVar6 * 4)), -1 < iVar6)) {
|
|
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x3c))));
|
|
LAB_00920f90:
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((iVar6 * 0x10 + *GHIDRA_CAST<int *>((animData + 0x18)))),
|
|
&g_vectorZero,*GHIDRA_CAST<int *>((iVar7 + iVar6 * 4)),&g_vectorZero,&g_vectorZero,
|
|
animation);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_5c = local_5c + 5;
|
|
local_58 = (float)(GHIDRA_INT(local_58) + -1);
|
|
} while (local_58 != 0.0);
|
|
local_58 = 0.0;
|
|
}
|
|
LAB_00921007:
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x184))));
|
|
LAB_0092100d:
|
|
AnimationState::Render(renderState,&g_vectorZero,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x244))) != '\0') goto LAB_00921b36;
|
|
local_88.y = (float)((*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4)))) >> 1) - 0x1e);
|
|
if ((g_game->_stageType == 4) || (g_game->_stageType == 5)) {
|
|
fVar12 = (float)(g_game->_stage + 1);
|
|
}
|
|
else {
|
|
fVar12 = (float)g_game->_stage;
|
|
}
|
|
local_58 = 8.40779e-45;
|
|
local_70 = fVar12;
|
|
if (isGreedMode == '\0') {
|
|
if (((g_manager->_persistentGameData)._achievements[4] != 0) ||
|
|
((((g_manager->_state == 2 &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))) ||
|
|
(7 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x364)))))) ||
|
|
((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x364)))) == 6 && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x368))) == '\0')))))) {
|
|
local_58 = 1.12104e-44;
|
|
}
|
|
challengeParams = (GHIDRA_CAST<Game *>((g_game)))->Game::GetChallengeParams();
|
|
if (challengeParams->_isPathTypeSet != 0) {
|
|
if (challengeParams->_endStage == 6) {
|
|
local_58 = 8.40779e-45;
|
|
}
|
|
else if (7 < challengeParams->_endStage) {
|
|
local_58 = 1.12104e-44;
|
|
}
|
|
}
|
|
if (fVar12 != 1.26117e-44) goto LAB_00921072;
|
|
local_58 = fVar12;
|
|
LAB_0092110a:
|
|
local_5c = GHIDRA_CAST<int *>(fVar12);
|
|
if (GHIDRA_INT(fVar12) < GHIDRA_INT(local_58)) {
|
|
local_5c = GHIDRA_CAST<int *>(local_58);
|
|
}
|
|
lastSlot = -NAN;
|
|
iconCount = 0.0;
|
|
local_7c = -NAN;
|
|
local_74 = -NAN;
|
|
local_78 = 0;
|
|
fVar12 = lastSlot;
|
|
if (-1 < GHIDRA_INT(local_5c)) goto LAB_00921130;
|
|
}
|
|
else {
|
|
local_58 = 9.80909e-45;
|
|
LAB_00921072:
|
|
if (fVar12 != 1.82169e-44) goto LAB_0092110a;
|
|
local_58 = 0.0;
|
|
local_70 = 0.0;
|
|
local_5c = GHIDRA_CAST<int *>(0x0);
|
|
LAB_00921130:
|
|
local_64 = g_game;
|
|
fVar8 = 0.0;
|
|
lastSlot = -NAN;
|
|
iconCount = 0.0;
|
|
local_7c = -NAN;
|
|
local_74 = -NAN;
|
|
local_78 = 0;
|
|
do {
|
|
if (fVar8 == 0.0) {
|
|
if (local_70 == 0.0) {
|
|
iVar6 = this->_stageBarIcons[0xd];
|
|
goto LAB_0092117e;
|
|
}
|
|
}
|
|
else if ((fVar8 != 1.26117e-44) || (this->_stageBarIcons[9] != 0x11)) {
|
|
iVar6 = this->_stageBarIcons[GHIDRA_INT(fVar8)];
|
|
LAB_0092117e:
|
|
stageIcons[GHIDRA_INT(iconCount)] = iVar6;
|
|
if ((fVar8 == local_58) && (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x364)))) != local_58)) {
|
|
local_7c = iconCount;
|
|
}
|
|
if ((GHIDRA_CAST<int *>(fVar8) == local_5c) && (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x364)))) != lastSlot)) {
|
|
lastSlot = iconCount;
|
|
}
|
|
if (fVar8 == local_70) {
|
|
local_74 = iconCount;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x368))) == '\0') {
|
|
if ((g_game->_challenge == 0x1f) || (local_78 = 1, local_70 == 0.0)) {
|
|
local_78 = 0xffffffff;
|
|
}
|
|
}
|
|
else {
|
|
local_78 = 0;
|
|
}
|
|
}
|
|
iconCount = (float)(GHIDRA_INT(iconCount) + 1);
|
|
}
|
|
fVar8 = (float)(GHIDRA_INT(fVar8) + 1);
|
|
fVar12 = lastSlot;
|
|
} while (GHIDRA_INT(fVar8) <= GHIDRA_INT(local_5c));
|
|
}
|
|
for (; (fVar8 = iconCount, -1 < GHIDRA_INT(fVar12) && (stageIcons[GHIDRA_INT(fVar12)] == 0x11));
|
|
fVar12 = (float)(GHIDRA_INT(fVar12) + -1)) {
|
|
stageIcons[GHIDRA_INT(fVar12)] = -1;
|
|
}
|
|
stageBarSprite = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)));
|
|
pbVar9 = *GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c))));
|
|
local_5c = GHIDRA_CAST<int *>(((g_screenWidth * 0.5 - (float)(GHIDRA_INT(iconCount) * 0x1b + -4) * 0.5) + 11.5));
|
|
local_58 = (float)local_5c + 13.5;
|
|
if (pbVar9 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_009212c6:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Connector"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) = 1;
|
|
fVar8 = iconCount;
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar9 + 0x14))) {
|
|
pbVar9 = *GHIDRA_CAST<byte **>(pbVar9);
|
|
}
|
|
animName = "Connector";
|
|
do {
|
|
bVar5 = *pbVar9;
|
|
isLess = bVar5 < (byte)*animName;
|
|
if (bVar5 != *animName) {
|
|
LAB_009212a0:
|
|
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009212a5;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar9[1];
|
|
isLess = bVar5 < (byte)animName[1];
|
|
if (bVar5 != animName[1]) goto LAB_009212a0;
|
|
pbVar9 = pbVar9 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar5 != 0);
|
|
uVar10 = 0;
|
|
LAB_009212a5:
|
|
if ((uVar10 != 0) ||
|
|
((*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c)))) + 0x34)) != '\0' && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) == '\0'))))
|
|
goto LAB_009212c6;
|
|
}
|
|
local_60 = (void *)(GHIDRA_INT(fVar8) + -1);
|
|
connectorIndex = GHIDRA_CAST<Game *>(0x0);
|
|
fVar12 = local_58;
|
|
if (0 < GHIDRA_INT(local_60)) {
|
|
do {
|
|
local_64 = GHIDRA_CAST<Game *>((GHIDRA_INT(&connectorIndex->_stage) + 1));
|
|
iconPos.y = 24.0;
|
|
iconPos.x = (float)GHIDRA_INT(connectorIndex) * 27.0 + fVar12;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2b8))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278))));
|
|
}
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
fVar12 = local_58;
|
|
}
|
|
local_60 = (void *)(GHIDRA_INT(local_60) + -1);
|
|
connectorIndex = local_64;
|
|
} while (local_60 != (void *)0x0);
|
|
}
|
|
pbVar9 = *GHIDRA_CAST<byte **>((stageBarSprite + 0x34));
|
|
if (pbVar9 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_009213f6:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Levels"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) = 1;
|
|
fVar8 = iconCount;
|
|
}
|
|
}
|
|
else {
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar9 + 0x14))) {
|
|
pbVar9 = *GHIDRA_CAST<byte **>(pbVar9);
|
|
}
|
|
animName = "Levels";
|
|
do {
|
|
bVar5 = *pbVar9;
|
|
isLess = bVar5 < (byte)*animName;
|
|
if (bVar5 != *animName) {
|
|
LAB_009213d0:
|
|
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009213d5;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = pbVar9[1];
|
|
isLess = bVar5 < (byte)animName[1];
|
|
if (bVar5 != animName[1]) goto LAB_009213d0;
|
|
pbVar9 = pbVar9 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar5 != 0);
|
|
uVar10 = 0;
|
|
LAB_009213d5:
|
|
if ((uVar10 != 0) ||
|
|
((*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c)))) + 0x34)) != '\0' && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) == '\0'))))
|
|
goto LAB_009213f6;
|
|
}
|
|
local_58 = 0.0;
|
|
if (0 < GHIDRA_INT(fVar8)) {
|
|
do {
|
|
if (-1 < stageIcons[GHIDRA_INT(local_58)]) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c)))) != 0) {
|
|
AnimationState::SetFrameFloat
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))),(float)stageIcons[GHIDRA_INT(local_58)]);
|
|
}
|
|
iconPos.y = 24.0;
|
|
iconPos.x = (float)GHIDRA_INT(local_58) * 27.0 + (float)local_5c;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2b8))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278))));
|
|
}
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
local_58 = (float)(GHIDRA_INT(local_58) + 1);
|
|
} while (GHIDRA_INT(local_58) < GHIDRA_INT(fVar8));
|
|
}
|
|
pbVar9 = *GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c))));
|
|
if (pbVar9 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_00921544:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("ClearFloor"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameChar = pbVar9;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar9 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<byte **>(pbVar9);
|
|
}
|
|
animName = "ClearFloor";
|
|
do {
|
|
bVar5 = *animNameChar;
|
|
isLess = bVar5 < (byte)*animName;
|
|
if (bVar5 != *animName) {
|
|
LAB_00921520:
|
|
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00921525;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameChar[1];
|
|
isLess = bVar5 < (byte)animName[1];
|
|
if (bVar5 != animName[1]) goto LAB_00921520;
|
|
animNameChar = animNameChar + 2;
|
|
animName = animName + 2;
|
|
} while (bVar5 != 0);
|
|
uVar10 = 0;
|
|
LAB_00921525:
|
|
if ((uVar10 != 0) || ((pbVar9[0x34] != 0 && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) == '\0')))) goto LAB_00921544;
|
|
}
|
|
fVar8 = 0.0;
|
|
fVar12 = iconCount;
|
|
if (0 < GHIDRA_INT(iconCount)) {
|
|
do {
|
|
if ((-1 < stageIcons[GHIDRA_INT(fVar8)]) && (fVar8 != local_74)) {
|
|
iconPos.y = 24.0;
|
|
iconPos.x = (float)GHIDRA_INT(fVar8) * 27.0 + (float)local_5c;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2b8))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278))));
|
|
}
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
fVar12 = iconCount;
|
|
}
|
|
}
|
|
fVar8 = (float)(GHIDRA_INT(fVar8) + 1);
|
|
} while (GHIDRA_INT(fVar8) < GHIDRA_INT(fVar12));
|
|
}
|
|
pbVar9 = *GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c))));
|
|
if (pbVar9 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_0092166b:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("NotClearFloor"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameChar = pbVar9;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar9 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<byte **>(pbVar9);
|
|
}
|
|
animName = "NotClearFloor";
|
|
do {
|
|
bVar5 = *animNameChar;
|
|
isLess = bVar5 < (byte)*animName;
|
|
if (bVar5 != *animName) {
|
|
LAB_00921647:
|
|
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0092164c;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameChar[1];
|
|
isLess = bVar5 < (byte)animName[1];
|
|
if (bVar5 != animName[1]) goto LAB_00921647;
|
|
animNameChar = animNameChar + 2;
|
|
animName = animName + 2;
|
|
} while (bVar5 != 0);
|
|
uVar10 = 0;
|
|
LAB_0092164c:
|
|
if ((uVar10 != 0) || ((pbVar9[0x34] != 0 && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) == '\0')))) goto LAB_0092166b;
|
|
}
|
|
fVar12 = iconCount;
|
|
local_60 = (void *)0x0;
|
|
if (0 < GHIDRA_INT(iconCount)) {
|
|
do {
|
|
if (stageIcons[GHIDRA_INT(local_60)] < 0) {
|
|
iconPos.y = 24.0;
|
|
iconPos.x = (float)GHIDRA_INT(local_60) * 27.0 + (float)local_5c;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2b8))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278))));
|
|
}
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
local_60 = (void *)(GHIDRA_INT(local_60) + 1);
|
|
} while (GHIDRA_INT(local_60) < GHIDRA_INT(fVar12));
|
|
}
|
|
if ((-1 < GHIDRA_INT(local_7c)) && (GHIDRA_INT(lastSlot) <= GHIDRA_INT(local_7c))) {
|
|
if ((g_game->_difficulty == 2) || (g_game->_difficulty == 3)) {
|
|
pbVar9 = *GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c))));
|
|
if (pbVar9 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_00921834:
|
|
animName = "GreedIndicator";
|
|
goto LAB_0092183b;
|
|
}
|
|
animNameChar = pbVar9;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar9 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<byte **>(pbVar9);
|
|
}
|
|
animName = "GreedIndicator";
|
|
do {
|
|
bVar5 = *animNameChar;
|
|
isLess = bVar5 < (byte)*animName;
|
|
if (bVar5 != *animName) {
|
|
LAB_00921810:
|
|
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00921815;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameChar[1];
|
|
isLess = bVar5 < (byte)animName[1];
|
|
if (bVar5 != animName[1]) goto LAB_00921810;
|
|
animNameChar = animNameChar + 2;
|
|
animName = animName + 2;
|
|
} while (bVar5 != 0);
|
|
uVar10 = 0;
|
|
LAB_00921815:
|
|
if ((uVar10 != 0) || ((pbVar9[0x34] != 0 && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) == '\0')))) goto LAB_00921834;
|
|
}
|
|
else {
|
|
pbVar9 = *GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c))));
|
|
if (pbVar9 != GHIDRA_CAST<byte *>(0x0)) {
|
|
animNameChar = pbVar9;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar9 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<byte **>(pbVar9);
|
|
}
|
|
animName = "BossIndicator";
|
|
do {
|
|
bVar5 = *animNameChar;
|
|
isLess = bVar5 < (byte)*animName;
|
|
if (bVar5 != *animName) {
|
|
LAB_00921797:
|
|
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0092179c;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameChar[1];
|
|
isLess = bVar5 < (byte)animName[1];
|
|
if (bVar5 != animName[1]) goto LAB_00921797;
|
|
animNameChar = animNameChar + 2;
|
|
animName = animName + 2;
|
|
} while (bVar5 != 0);
|
|
uVar10 = 0;
|
|
LAB_0092179c:
|
|
if (uVar10 == 0) {
|
|
if ((pbVar9[0x34] == 0) || ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) != '\0')) goto LAB_00921852;
|
|
animName = "BossIndicator";
|
|
goto LAB_0092183b;
|
|
}
|
|
}
|
|
animName = "BossIndicator";
|
|
LAB_0092183b:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(animName),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) = 1;
|
|
}
|
|
}
|
|
LAB_00921852:
|
|
iconPos.y = 24.0;
|
|
iconPos.x = (float)GHIDRA_INT(local_7c) * 27.0 + (float)local_5c;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2b8))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278))));
|
|
}
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
if ((((g_game->_difficulty != 2) && (g_game->_difficulty != 3)) && (g_game->_challenge != 0x1f))
|
|
&& (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x364)))) < 6)) {
|
|
if ((g_game->_timeCounter <= g_game->_bossRushParTime) && (local_70 != 0.0)) {
|
|
pbVar9 = *GHIDRA_CAST<byte **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c))));
|
|
local_64 = GHIDRA_CAST<Game *>(((float)g_game->_timeCounter / (float)g_game->_bossRushParTime));
|
|
if (pbVar9 == GHIDRA_CAST<byte *>(0x0)) {
|
|
LAB_00921997:
|
|
bVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Clock"),1);
|
|
if (bVar5 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameChar = pbVar9;
|
|
if (0xf < *GHIDRA_CAST<uint *>((pbVar9 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<byte **>(pbVar9);
|
|
}
|
|
animName = "Clock";
|
|
do {
|
|
bVar5 = *animNameChar;
|
|
isLess = bVar5 < (byte)*animName;
|
|
if (bVar5 != *animName) {
|
|
LAB_00921973:
|
|
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00921978;
|
|
}
|
|
if (bVar5 == 0) break;
|
|
bVar5 = animNameChar[1];
|
|
isLess = bVar5 < (byte)animName[1];
|
|
if (bVar5 != animName[1]) goto LAB_00921973;
|
|
animNameChar = animNameChar + 2;
|
|
animName = animName + 2;
|
|
} while (bVar5 != 0);
|
|
uVar10 = 0;
|
|
LAB_00921978:
|
|
if ((uVar10 != 0) || ((pbVar9[0x34] != 0 && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28c))) == '\0'))))
|
|
goto LAB_00921997;
|
|
}
|
|
iconPos.y = 24.0;
|
|
iconPos.x = (float)local_64 * 135.0 + (float)local_5c;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2b8))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278))));
|
|
}
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
}
|
|
if (-2 < GHIDRA_INT(local_74)) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("IsaacIndicator"),1);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278))));
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c)))) != 0) {
|
|
AnimationState::SetFrameFloat
|
|
(renderState,
|
|
(float)GHIDRA_INT(((*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x4)))) >> 1) %
|
|
*GHIDRA_CAST<uint *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x27c)))) + 0x30)))));
|
|
}
|
|
fVar12 = 5.60519e-44;
|
|
if (GHIDRA_INT(local_88.y) < 0x28) {
|
|
fVar12 = local_88.y;
|
|
}
|
|
iconPos.y = 24.0;
|
|
fVar8 = 1.4013e-44;
|
|
if (10 < GHIDRA_INT(fVar12)) {
|
|
fVar8 = fVar12;
|
|
}
|
|
iconPos.x = ((float)GHIDRA_INT(local_74) * 27.0 + (float)local_5c) -
|
|
(1.0 - (float)(GHIDRA_INT(fVar8) + -10) / 30.0) * (float)GHIDRA_INT(local_78) * 27.0;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x351))) != '\0') {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2b8))) == '\0') {
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
renderState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))),&iconPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
AnimationState::Render(renderState,&iconPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
LAB_00921b36:
|
|
fVar12 = 0.0;
|
|
if (0.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x35c))))) {
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
if (((byte)g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
local_28._alpha = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x35c))));
|
|
local_28._unk = 0;
|
|
local_28._red = 0.0;
|
|
local_28._green = 0.0;
|
|
local_28._blue = 0.0;
|
|
render_quad_set_uniform_color(fadeQuad,0.0,0.0,g_screenWidth,g_screenHeight,&local_28);
|
|
if ((local_d4 + local_c0 + local_ac + local_98) * 0.25 != fVar12) {
|
|
shader_push(GHIDRA_CAST<byte *>("KAGE_ColorShader"));
|
|
local_28._red = 0.0;
|
|
local_38 = 0;
|
|
local_2c = 0;
|
|
local_34 = 0;
|
|
local_28._blue = 1.0;
|
|
local_30 = 0x3f800000;
|
|
local_28._alpha = 1.0;
|
|
local_28._green = 1.0;
|
|
local_28._unk = local_28._unk & 0xffffff00;
|
|
pvVar11 = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(pvVar11,&local_38,fadeQuad,1,unused);
|
|
if (g_shaderStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Shader stack empty\n"));
|
|
}
|
|
uVar10 = g_shaderStackSize;
|
|
shaderTop = GHIDRA_CAST<undefined4 *>(FUN_00684fc0());
|
|
g_shaderStackSize = uVar10 - 1;
|
|
g_currentShader = (void *)*shaderTop;
|
|
if (g_shaderStackSize == 0) {
|
|
DAT_00c379d8 = 0;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00921ce0
|
|
void NightmareScene::Show(byte unk)
|
|
{
|
|
undefined4 uVar1;
|
|
undefined4 uVar2;
|
|
undefined4 uVar3;
|
|
undefined4 uVar4;
|
|
void **ppvVar5;
|
|
EntityConfig_Entity *pEVar6;
|
|
char cVar7;
|
|
byte bVar8;
|
|
int iVar9;
|
|
std_string *stringData;
|
|
int *piVar10;
|
|
Entity_Player *collectibleOwner;
|
|
RoomConfig_Room *randomRoom;
|
|
short *spawn;
|
|
undefined8 *pickedEntry;
|
|
uint uVar11;
|
|
ItemConfig_Item *collectibleConfig;
|
|
EntityConfig_Entity *pEVar12;
|
|
NetplayManager peerIt;
|
|
uint *puVar13;
|
|
byte *anim;
|
|
LayerState *layer;
|
|
byte extraout_CL;
|
|
byte extraout_CL_00;
|
|
byte unk_00;
|
|
int iVar14;
|
|
char *****pppppcVar15;
|
|
undefined1 *puVar16;
|
|
uint uVar17;
|
|
Game *game;
|
|
uint newCapacity;
|
|
PlayerManager *playerManager;
|
|
void *pvVar18;
|
|
float halfHeight;
|
|
char *pcVar19;
|
|
ColorMod diaryColor;
|
|
undefined1 seedEffectFind [8];
|
|
void *seedNode;
|
|
uint bossEntrySeed;
|
|
undefined8 uStack_2f8;
|
|
undefined4 uStack_2f0;
|
|
uint local_2ec;
|
|
undefined8 uStack_2e8;
|
|
undefined4 uStack_2e0;
|
|
undefined8 bossRngShifts;
|
|
undefined4 local_2d0;
|
|
undefined8 treasureRngShifts;
|
|
undefined4 local_2c0;
|
|
undefined8 local_2b8;
|
|
undefined4 local_2b0;
|
|
uint treasureEntrySeed;
|
|
undefined8 uStack_2a8;
|
|
void *pvStack_2a0;
|
|
undefined4 seedEffect;
|
|
uint collectibleSeed;
|
|
undefined8 uStack_294;
|
|
undefined4 uStack_28c;
|
|
int *local_288;
|
|
undefined4 uStack_284;
|
|
undefined4 uStack_280;
|
|
undefined4 uStack_27c;
|
|
undefined4 local_278;
|
|
void **local_274;
|
|
void *local_270;
|
|
RoomDescriptor *local_26c;
|
|
int local_268;
|
|
uint local_264;
|
|
void *local_260;
|
|
RoomConfig_Room *local_25c;
|
|
void **local_258;
|
|
EntityConfig_Entity *local_254;
|
|
NightmareScene *sceneRef;
|
|
EntityConfig_Entity *local_24c;
|
|
char *****local_248;
|
|
undefined8 bossEntry;
|
|
undefined4 bossEntryExtra;
|
|
ANM2 gfuelAnm2;
|
|
char doubleTroubleItem [24];
|
|
EntityConfig_Entity *firstBoss;
|
|
EntityConfig_Entity *secondBoss;
|
|
char bossItem [24];
|
|
EntityConfig_Entity *bossConfig;
|
|
undefined4 local_e4;
|
|
std_string *gfuelPath [4];
|
|
uint gfuelPathSize;
|
|
uint gfuelPathCapacity;
|
|
void *bossLabel [4];
|
|
undefined4 bossLabelSize;
|
|
uint bossLabelCapacity;
|
|
undefined8 treasureEntry;
|
|
undefined4 treasureEntryExtra;
|
|
std_string sceneAnm2Path;
|
|
std_string local_8c;
|
|
char *gfuelPrefix;
|
|
int gfuelPrefixSize;
|
|
uint gfuelPrefixCapacity;
|
|
std_string deathScreenPath;
|
|
char *****treasureLabel [4];
|
|
undefined4 treasureLabelSize;
|
|
uint treasureLabelCapacity;
|
|
uint treasureItems [3];
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
uint local_14;
|
|
int currentStage;
|
|
code *debugBreak;
|
|
bool isDoubleTrouble;
|
|
Manager *manager;
|
|
RoomConfig_Room *roomData;
|
|
NightmareScene *scene;
|
|
|
|
game = g_game;
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((treasureItems + 10));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0a72a;
|
|
local_1c = ExceptionList;
|
|
treasureItems[2] = __security_cookie ^ GHIDRA_UINT((treasureItems + 7));
|
|
ExceptionList = &local_1c;
|
|
piVar10 = (g_game->_playerManager)._playerList._begin;
|
|
sceneRef = this;
|
|
puVar13 = treasureItems + 10;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT(piVar10) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
piVar10 = (game->_playerManager)._playerList._begin;
|
|
puVar13 = GHIDRA_CAST<uint *>(puStack_20);
|
|
}
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>(puVar13);
|
|
local_270 = (void *)*piVar10;
|
|
(GHIDRA_CAST<std::string *>((sceneAnm2Path._buf)))->std::string::string((void *)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x8)))) +
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x14)))) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x360)))) * 4)) *
|
|
0x18));
|
|
game = g_game;
|
|
local_14 = 0;
|
|
seedEffect = 0x4f;
|
|
std::set<int>::find_node(seedEffectFind,&seedEffect);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(seedNode) + 0xd)) != '\0') || (0x4f < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(seedNode) + 0x10)))) {
|
|
seedNode = (game->_seedEffects)._seedEffects;
|
|
}
|
|
if (seedNode != (game->_seedEffects)._seedEffects) {
|
|
stringData = &sceneAnm2Path;
|
|
if (0xf < sceneAnm2Path._capacity) {
|
|
stringData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(sceneAnm2Path._buf))) + 0x0)));
|
|
}
|
|
iVar9 = strncmp(stringData->_buf,"gfx/ui/stage/nightmare",0x16);
|
|
if (iVar9 == 0) {
|
|
stringData = &sceneAnm2Path;
|
|
if (0xf < sceneAnm2Path._capacity) {
|
|
stringData = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(sceneAnm2Path._buf))) + 0x0)));
|
|
}
|
|
gfuelPrefixCapacity = 0xf;
|
|
gfuelPrefix = GHIDRA_CAST<char *>(0x0);
|
|
gfuelPrefixSize = iVar9;
|
|
gfuelPrefix = std::_Allocate(0x30);
|
|
gfuelPrefixSize = 0x23;
|
|
gfuelPrefixCapacity = 0x2f;
|
|
builtin_strncpy(gfuelPrefix,"gfx/promo/gfuel/ui/stage/nightmareg",0x24);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
FUN_0060c790(GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&stringData->_capacity) + 2)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
if (0xf < gfuelPrefixCapacity) {
|
|
uVar17 = gfuelPrefixCapacity + 1;
|
|
pcVar19 = gfuelPrefix;
|
|
if (0xfff < uVar17) {
|
|
pcVar19 = *GHIDRA_CAST<char **>((gfuelPrefix + -4));
|
|
uVar17 = gfuelPrefixCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < gfuelPrefix + (-4 - GHIDRA_INT(pcVar19))) {
|
|
LAB_00921eab:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar19,uVar17);
|
|
}
|
|
gfuelPrefixSize = 0;
|
|
gfuelPrefixCapacity = 0xf;
|
|
gfuelPrefix = GHIDRA_CAST<char *>((GHIDRA_UINT(gfuelPrefix) & 0xffffff00));
|
|
(GHIDRA_CAST<ANM2 *>((&gfuelAnm2)))->ANM2::constructor();
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
|
|
(GHIDRA_CAST<ANM2 *>((&gfuelAnm2)))->ANM2::Load(GHIDRA_CAST<std_string *>(gfuelPath),1);
|
|
if (gfuelAnm2._loaded != 0) {
|
|
stringData = GHIDRA_CAST<std_string *>(gfuelPath);
|
|
if (0xf < gfuelPathCapacity) {
|
|
stringData = gfuelPath[0];
|
|
}
|
|
(GHIDRA_CAST<std::string *>((sceneAnm2Path._buf)))->std::string::assign(GHIDRA_CAST<byte *>(stringData),gfuelPathSize);
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
(GHIDRA_CAST<ANM2 *>((&gfuelAnm2)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&gfuelAnm2._overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&gfuelAnm2._animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((gfuelAnm2._animDefaultName._buf)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&gfuelAnm2))))->std::string::_Tidy_deallocate();
|
|
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
if (0xf < gfuelPathCapacity) {
|
|
uVar17 = gfuelPathCapacity + 1;
|
|
stringData = gfuelPath[0];
|
|
if (0xfff < uVar17) {
|
|
stringData = GHIDRA_CAST<std_string *>(gfuelPath[0][-1]._capacity);
|
|
uVar17 = gfuelPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>((GHIDRA_INT(gfuelPath[0]) + (-4 - GHIDRA_INT(stringData))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(stringData,uVar17);
|
|
}
|
|
gfuelPathSize = 0;
|
|
gfuelPathCapacity = 0xf;
|
|
gfuelPath[0] = GHIDRA_CAST<std_string *>((GHIDRA_UINT(gfuelPath[0]) & 0xffffff00));
|
|
}
|
|
}
|
|
*GHIDRA_CAST<undefined4 *>((this + 1)) = 0x28;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x118))) = 0;
|
|
local_288 = GHIDRA_CAST<int *>(0x0);
|
|
uStack_284 = 0;
|
|
uStack_280 = 0;
|
|
uStack_27c = 0;
|
|
local_278 = 0;
|
|
piVar10 = operator_new(8);
|
|
scene = sceneRef;
|
|
piVar10[1] = 0;
|
|
*piVar10 = GHIDRA_INT(&local_288);
|
|
puVar16 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x11c)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
local_288 = piVar10;
|
|
if (GHIDRA_CAST<int **>(puVar16) != &local_288) {
|
|
local_288 = *GHIDRA_CAST<int **>(puVar16);
|
|
*GHIDRA_CAST<int **>(puVar16) = piVar10;
|
|
if (piVar10 != GHIDRA_CAST<int *>(0x0)) {
|
|
*piVar10 = GHIDRA_INT(puVar16);
|
|
}
|
|
if (local_288 != GHIDRA_CAST<int *>(0x0)) {
|
|
*local_288 = GHIDRA_INT(&local_288);
|
|
}
|
|
uVar1 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x120))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x120)))) = uStack_284;
|
|
uVar2 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x124))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x124)))) = uStack_280;
|
|
uVar3 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x128)))) = uStack_27c;
|
|
uVar4 = *GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x12c))));
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x12c)))) = local_278;
|
|
uStack_284 = uVar1;
|
|
uStack_280 = uVar2;
|
|
uStack_27c = uVar3;
|
|
local_278 = uVar4;
|
|
}
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sceneRef[1])) + 0x244))) == '\0') {
|
|
collectibleOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&g_game->_playerManager,0x236,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
|
|
if ((collectibleOwner != GHIDRA_CAST<Entity_Player *>(0x0)) && (g_game->_stage != 0xd)) {
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x10d))) == '\0') {
|
|
deathScreenPath._size = 0;
|
|
deathScreenPath._capacity = 0xf;
|
|
deathScreenPath._buf[0] = '\0';
|
|
deathScreenPath._buf[1] = '\0';
|
|
deathScreenPath._buf[2] = '\0';
|
|
deathScreenPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) = std::_Allocate(0x20);
|
|
deathScreenPath._size = 0x18;
|
|
deathScreenPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(deathScreenPath._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x4)))))))->ANM2::Load(&deathScreenPath,1);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
if (0xf < deathScreenPath._capacity) {
|
|
uVar17 = deathScreenPath._capacity + 1;
|
|
pcVar19 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(deathScreenPath._buf))) + 0x0)));
|
|
if (0xfff < uVar17) {
|
|
pcVar19 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) + -4));
|
|
uVar17 = deathScreenPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar19))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar19,uVar17);
|
|
}
|
|
deathScreenPath._size = 0;
|
|
deathScreenPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) & 0xffffff00;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x4)))))))->ANM2::Play(GHIDRA_CAST<byte *>("Diary"),0);
|
|
diaryColor._offset[0] = -0.1283;
|
|
diaryColor._colorize[0] = 0.0;
|
|
diaryColor._colorize[1] = 0.0;
|
|
diaryColor._colorize[2] = 0.0;
|
|
diaryColor._colorize[3] = 0.0;
|
|
diaryColor._offset[1] = -0.126;
|
|
diaryColor._tint[0] = 1.1616;
|
|
diaryColor._tint[1] = 1.3218;
|
|
diaryColor._tint[2] = 1.5972;
|
|
diaryColor._tint[3] = 1.0;
|
|
diaryColor._offset[2] = -0.1642;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x4)))))))->Sprite::SetColor(&diaryColor);
|
|
}
|
|
game = g_game;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x118))) = 1;
|
|
*GHIDRA_CAST<undefined4 *>((scene + 1)) = 10;
|
|
local_26c = game->_roomList;
|
|
local_274 = (void **)0x0;
|
|
if (0 < game->_nbRooms) {
|
|
local_258 = &game->_roomList[0].Data;
|
|
LAB_00922220:
|
|
ppvVar5 = local_258;
|
|
if (local_258[-1] != (void *)0x0) goto LAB_009228d6;
|
|
roomData = *local_258;
|
|
local_25c = roomData;
|
|
if (((roomData == GHIDRA_CAST<RoomConfig_Room *>(0x0)) || (roomData->Type != 4)) ||
|
|
(local_258[0x29] != (void *)0xffffffff)) goto LAB_009228d6;
|
|
collectibleOwner =
|
|
PlayerManager::FirstCollectibleOwner
|
|
(&game->_playerManager,0x19e,GHIDRA_CAST<RNG **>(&game->_playerManager),1);
|
|
if (collectibleOwner != GHIDRA_CAST<Entity_Player *>(0x0)) {
|
|
uVar17 = GHIDRA_UINT(ppvVar5[0x13]);
|
|
local_2b8 = 0x500000001;
|
|
local_254 = GHIDRA_CAST<EntityConfig_Entity *>(0x10);
|
|
local_2b0 = 0x10;
|
|
if (uVar17 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
debugBreak = (code *)swi(3);
|
|
(*debugBreak)();
|
|
return;
|
|
}
|
|
uVar17 = uVar17 >> 1 ^ uVar17;
|
|
uVar17 = uVar17 << 5 ^ uVar17;
|
|
iVar14 = 0;
|
|
local_254 = GHIDRA_CAST<EntityConfig_Entity *>((uVar17 >> 0x10 ^ uVar17));
|
|
iVar9 = g_game->_stageType;
|
|
if ((iVar9 == 4) || (iVar9 == 5)) {
|
|
currentStage = g_game->_stage;
|
|
if ((currentStage == 1) || (currentStage == 2)) {
|
|
iVar14 = (iVar9 != 4) + 0x1b;
|
|
}
|
|
else if ((currentStage == 3) || (currentStage == 4)) {
|
|
iVar14 = (iVar9 != 4) + 0x1d;
|
|
}
|
|
else if ((currentStage == 5) || (currentStage == 6)) {
|
|
iVar14 = (iVar9 != 4) + 0x1f;
|
|
}
|
|
}
|
|
if (roomData->Subtype == 0) {
|
|
uVar17 = 1;
|
|
}
|
|
else {
|
|
if (roomData->Subtype != 2) goto LAB_00922378;
|
|
uVar17 = 3;
|
|
}
|
|
randomRoom = RoomConfig::GetRandomRoom
|
|
(&g_game->_roomConfig,GHIDRA_UINT(local_254),0,iVar14,4,roomData->Shape,0,
|
|
-1,1,10,GHIDRA_CAST<uint *>(&roomData->Doors),uVar17,-1);
|
|
local_25c = roomData;
|
|
if (randomRoom != GHIDRA_CAST<RoomConfig_Room *>(0x0)) {
|
|
local_25c = randomRoom;
|
|
}
|
|
}
|
|
LAB_00922378:
|
|
iVar9 = 0;
|
|
treasureLabelSize = 0;
|
|
treasureLabelCapacity = 0xf;
|
|
treasureLabel[0] = GHIDRA_CAST<char *****>(0x0);
|
|
treasureItems[0] = 0;
|
|
treasureItems[1] = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
|
|
local_264 = GHIDRA_UINT(local_258[0x13]);
|
|
local_254 = GHIDRA_CAST<EntityConfig_Entity *>(&DAT_00000007);
|
|
local_2c0 = 7;
|
|
treasureRngShifts = 0x700000002;
|
|
local_260 = (void *)0x0;
|
|
if (local_25c->SpawnCount == 0) {
|
|
LAB_00922789:
|
|
uVar17 = treasureLabelCapacity;
|
|
if (0x7fffffff - (treasureLabelCapacity >> 1) < treasureLabelCapacity) {
|
|
newCapacity = 0x7fffffff;
|
|
}
|
|
else {
|
|
uVar11 = treasureLabelCapacity + (treasureLabelCapacity >> 1);
|
|
newCapacity = 0x1f;
|
|
if (0x1f < uVar11) {
|
|
newCapacity = uVar11;
|
|
}
|
|
}
|
|
local_248 = std::_Allocate(newCapacity + 1);
|
|
treasureLabelSize = 0x10;
|
|
*local_248 = GHIDRA_CAST<char ****>(0x61657254);
|
|
local_248[1] = GHIDRA_CAST<char ****>(0x65727573);
|
|
local_248[2] = GHIDRA_CAST<char ****>(0x6d6f6f52);
|
|
local_248[3] = GHIDRA_CAST<char ****>(0x706f6f50);
|
|
*GHIDRA_CAST<char *>((local_248 + 4)) = '\0';
|
|
treasureLabelCapacity = newCapacity;
|
|
if (0xf < uVar17) {
|
|
uVar11 = uVar17 + 1;
|
|
pppppcVar15 = treasureLabel[0];
|
|
if (0xfff < uVar11) {
|
|
pppppcVar15 = GHIDRA_CAST<char *****>(treasureLabel[0][-1]);
|
|
uVar11 = uVar17 + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(treasureLabel[0]) + (-4 - GHIDRA_INT(pppppcVar15)))))
|
|
goto LAB_00921eab;
|
|
}
|
|
LAB_009227fa:
|
|
operator_delete(pppppcVar15,uVar11);
|
|
}
|
|
LAB_00922809:
|
|
treasureLabel[0] = local_248;
|
|
}
|
|
else {
|
|
local_24c = GHIDRA_CAST<EntityConfig_Entity *>(0x0);
|
|
do {
|
|
if (1 < iVar9) break;
|
|
if (local_264 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
debugBreak = (code *)swi(3);
|
|
(*debugBreak)();
|
|
return;
|
|
}
|
|
local_264 = local_264 >> ((byte)treasureRngShifts & 0x1f) ^ local_264;
|
|
local_264 = local_264 << ((byte)((ulonglong)treasureRngShifts >> 0x20) & 0x1f) ^
|
|
local_264;
|
|
uVar17 = local_264 >> ((byte)local_254 & 0x1f) ^ local_264;
|
|
spawn = GHIDRA_CAST<short *>((GHIDRA_INT(local_25c->Spawns) + GHIDRA_INT(local_24c)));
|
|
local_248 = GHIDRA_CAST<char *****>((*spawn + 1 + (spawn[1] + 1) * GHIDRA_UINT(local_25c->Width)));
|
|
local_264 = uVar17;
|
|
if ((char)spawn[4] != '\0') {
|
|
pickedEntry = (GHIDRA_CAST<Spawn *>((spawn)))->Spawn::PickEntry((float)((double)GHIDRA_INT(uVar17) +
|
|
__uint_to_double_fixup
|
|
[-(GHIDRA_INT(uVar17) >> 0x1f)]) * 2.3283062e-10)
|
|
;
|
|
treasureEntry = *pickedEntry;
|
|
treasureEntryExtra = *GHIDRA_CAST<undefined4 *>((pickedEntry + 1));
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::TransformEntry(&treasureEntry,GHIDRA_UINT(local_248),uVar17);
|
|
uStack_294 = 0x900000005;
|
|
local_248 = GHIDRA_CAST<char *****>(&DAT_00000007);
|
|
if (uVar17 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
debugBreak = (code *)swi(3);
|
|
(*debugBreak)();
|
|
return;
|
|
}
|
|
uVar17 = uVar17 >> 5 ^ uVar17;
|
|
uStack_2a8 = 0x900000005;
|
|
uVar17 = uVar17 << 9 ^ uVar17;
|
|
treasureEntrySeed = uVar17 >> 7 ^ uVar17;
|
|
pvStack_2a0 = (void *)0x7;
|
|
uStack_294 = 0x900000005;
|
|
uStack_28c = 7;
|
|
collectibleSeed = treasureEntrySeed;
|
|
if ((GHIDRA_INT(treasureEntry) == 5) && ((*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(treasureEntry)) + 0x4))) == 100)) {
|
|
uVar11 = (*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(treasureEntry))) + 0x6)));
|
|
if (uVar11 == 0) {
|
|
if (uVar17 >> 7 == uVar17) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
debugBreak = (code *)swi(3);
|
|
(*debugBreak)();
|
|
return;
|
|
}
|
|
collectibleSeed = treasureEntrySeed >> 5 ^ treasureEntrySeed;
|
|
collectibleSeed = collectibleSeed << 9 ^ collectibleSeed;
|
|
collectibleSeed = collectibleSeed >> 7 ^ collectibleSeed;
|
|
uVar11 = ItemPool::GetSeededCollectible
|
|
(collectibleSeed,1,GHIDRA_CAST<RoomDescriptor *>((local_258 + -4)));
|
|
}
|
|
collectibleConfig = (GHIDRA_CAST<ItemConfig *>((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(uVar11);
|
|
treasureItems[iVar9] = GHIDRA_UINT(collectibleConfig);
|
|
iVar9 = iVar9 + 1;
|
|
}
|
|
}
|
|
local_24c = GHIDRA_CAST<EntityConfig_Entity *>(((local_24c->name)._buf + 4));
|
|
local_260 = (void *)(GHIDRA_INT(local_260) + 1);
|
|
} while (local_260 < (void *)GHIDRA_UINT((ushort)local_25c->SpawnCount));
|
|
uVar17 = treasureLabelCapacity;
|
|
pppppcVar15 = treasureLabel[0];
|
|
if (iVar9 == 0) {
|
|
if (0xf < treasureLabelCapacity) {
|
|
treasureLabelSize = 0x10;
|
|
memmove(treasureLabel[0],"TreasureRoomPoop",0x10);
|
|
*GHIDRA_CAST<char *>((pppppcVar15 + 4)) = '\0';
|
|
goto LAB_0092280c;
|
|
}
|
|
goto LAB_00922789;
|
|
}
|
|
if (iVar9 == 1) {
|
|
if (0xb < treasureLabelCapacity) {
|
|
treasureLabelSize = 0xc;
|
|
pppppcVar15 = GHIDRA_CAST<char *****>(treasureLabel);
|
|
if (0xf < treasureLabelCapacity) {
|
|
pppppcVar15 = treasureLabel[0];
|
|
}
|
|
memmove(pppppcVar15,"TreasureRoom",0xc);
|
|
*GHIDRA_CAST<char *>((pppppcVar15 + 3)) = '\0';
|
|
goto LAB_0092280c;
|
|
}
|
|
if (0x7fffffff - (treasureLabelCapacity >> 1) < treasureLabelCapacity) {
|
|
newCapacity = 0x7fffffff;
|
|
}
|
|
else {
|
|
uVar11 = treasureLabelCapacity + (treasureLabelCapacity >> 1);
|
|
newCapacity = 0xf;
|
|
if (0xf < uVar11) {
|
|
newCapacity = uVar11;
|
|
}
|
|
}
|
|
local_248 = std::_Allocate(newCapacity + 1);
|
|
treasureLabelSize = 0xc;
|
|
local_248[0] = GHIDRA_CAST<char ****>(0x61657254);
|
|
local_248[1] = GHIDRA_CAST<char ****>(0x65727573);
|
|
local_248[2] = GHIDRA_CAST<char ****>(0x6d6f6f52);
|
|
*GHIDRA_CAST<char *>((local_248 + 3)) = '\0';
|
|
LAB_009226d0:
|
|
treasureLabelCapacity = newCapacity;
|
|
if (uVar17 < 0x10) goto LAB_00922809;
|
|
uVar11 = uVar17 + 1;
|
|
pppppcVar15 = treasureLabel[0];
|
|
if (uVar11 < 0x1000) goto LAB_009227fa;
|
|
pppppcVar15 = GHIDRA_CAST<char *****>(treasureLabel[0][-1]);
|
|
uVar11 = uVar17 + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(treasureLabel[0]) + (-4 - GHIDRA_INT(pppppcVar15)))))
|
|
goto LAB_00921eab;
|
|
goto LAB_009227fa;
|
|
}
|
|
if (treasureLabelCapacity < 0x12) {
|
|
if (0x7fffffff - (treasureLabelCapacity >> 1) < treasureLabelCapacity) {
|
|
newCapacity = 0x7fffffff;
|
|
}
|
|
else {
|
|
uVar11 = treasureLabelCapacity + (treasureLabelCapacity >> 1);
|
|
newCapacity = 0x1f;
|
|
if (0x1f < uVar11) {
|
|
newCapacity = uVar11;
|
|
}
|
|
}
|
|
local_248 = std::_Allocate(newCapacity + 1);
|
|
treasureLabelSize = 0x12;
|
|
*local_248 = GHIDRA_CAST<char ****>(0x61657254);
|
|
local_248[1] = GHIDRA_CAST<char ****>(0x65727573);
|
|
local_248[2] = GHIDRA_CAST<char ****>(0x6d6f6f52);
|
|
local_248[3] = GHIDRA_CAST<char ****>(0x62756f44);
|
|
*GHIDRA_CAST<undefined2 *>((local_248 + 4)) = 0x656c;
|
|
*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_248) + 0x12)) = '\0';
|
|
goto LAB_009226d0;
|
|
}
|
|
treasureLabelSize = 0x12;
|
|
pppppcVar15 = GHIDRA_CAST<char *****>(treasureLabel);
|
|
if (0xf < treasureLabelCapacity) {
|
|
pppppcVar15 = treasureLabel[0];
|
|
}
|
|
memmove(pppppcVar15,"TreasureRoomDouble",0x12);
|
|
*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pppppcVar15) + 0x12)) = '\0';
|
|
}
|
|
LAB_0092280c:
|
|
scene = sceneRef;
|
|
iVar9 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sceneRef[1])) + 0x12c))));
|
|
uVar17 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sceneRef[1])) + 0x124))));
|
|
if (uVar17 <= iVar9 + 1U) {
|
|
std::deque<32byte>::_Growmap(iVar9);
|
|
uVar17 = *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x124))));
|
|
iVar9 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x12c))));
|
|
}
|
|
uVar11 = uVar17 - 1 & *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x128))));
|
|
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x128)))) = uVar11;
|
|
uVar17 = uVar17 - 1 & uVar11 + iVar9;
|
|
iVar9 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x120))));
|
|
if (*GHIDRA_CAST<int *>((iVar9 + uVar17 * 4)) == 0) {
|
|
pvVar18 = operator_new(0x20);
|
|
*(void **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x120)))) + uVar17 * 4) = pvVar18;
|
|
iVar9 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x120))));
|
|
}
|
|
pcVar19 = *GHIDRA_CAST<char **>((iVar9 + uVar17 * 4));
|
|
(GHIDRA_CAST<std::string *>((pcVar19)))->std::string::string(treasureLabel);
|
|
*GHIDRA_CAST<uint *>((pcVar19 + 0x18)) = treasureItems[0];
|
|
*GHIDRA_CAST<uint *>((pcVar19 + 0x1c)) = treasureItems[1];
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x12c)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x12c)))) + 1;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
if (0xf < treasureLabelCapacity) {
|
|
uVar17 = treasureLabelCapacity + 1;
|
|
pppppcVar15 = treasureLabel[0];
|
|
if (0xfff < uVar17) {
|
|
pppppcVar15 = GHIDRA_CAST<char *****>(treasureLabel[0][-1]);
|
|
uVar17 = treasureLabelCapacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>((GHIDRA_INT(treasureLabel[0]) + (-4 - GHIDRA_INT(pppppcVar15)))))
|
|
goto LAB_00921eab;
|
|
}
|
|
operator_delete(pppppcVar15,uVar17);
|
|
}
|
|
treasureLabelSize = 0;
|
|
treasureLabelCapacity = 0xf;
|
|
treasureLabel[0] = GHIDRA_CAST<char *****>((GHIDRA_UINT(treasureLabel[0]) & 0xffffff00));
|
|
game = g_game;
|
|
LAB_009228d6:
|
|
local_274 = (void **)(GHIDRA_INT(local_274) + 1);
|
|
local_258 = local_258 + 0x2e;
|
|
if (game->_nbRooms <= GHIDRA_INT(local_274)) goto LAB_009228fb;
|
|
goto LAB_00922220;
|
|
}
|
|
LAB_009228fb:
|
|
local_260 = (void *)0x0;
|
|
if (0 < game->_nbRooms) {
|
|
local_25c = GHIDRA_CAST<RoomConfig_Room *>(&local_26c->Group);
|
|
do {
|
|
if (local_25c[-2].Subtype == 0) {
|
|
iVar9 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_25c[-2])) + 0x14))));
|
|
if ((((iVar9 != 0) && (*GHIDRA_CAST<int *>((iVar9 + 8)) == 5)) && (local_25c->StageId == -1)) &&
|
|
(((game->_difficulty != 2 && (game->_difficulty != 3)) ||
|
|
(game->_lastBossRoomListIdx == local_25c[-2].Variant)))) {
|
|
uVar17 = local_25c[-1].Mode;
|
|
local_26c = GHIDRA_CAST<RoomDescriptor *>(&DAT_00000007);
|
|
local_2d0 = 7;
|
|
iVar9 = *GHIDRA_CAST<ushort *>((iVar9 + 0x44)) - 1;
|
|
bossRngShifts = 0x700000002;
|
|
local_258 = (void **)0x0;
|
|
local_274 = (void **)0x0;
|
|
local_24c = GHIDRA_CAST<EntityConfig_Entity *>(0x0);
|
|
local_254 = GHIDRA_CAST<EntityConfig_Entity *>(0x0);
|
|
if (iVar9 < 0) {
|
|
LAB_00922baf:
|
|
manager = g_manager;
|
|
if (((game->_gameStateFlags & 0x800000000000) == 0) || (game->_stage != 6))
|
|
goto LAB_00922c20;
|
|
local_268 = 0x2d00000;
|
|
_Find_lower_bound<>(&uStack_2a8,&local_268);
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvStack_2a0) + 0xd)) != '\0') ||
|
|
(0x2d00000 < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(pvStack_2a0) + 0x10)))) goto LAB_00922c20;
|
|
pEVar12 = local_24c;
|
|
if (((pvStack_2a0 != (manager->_entityConfig)._entities._head) &&
|
|
(GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(pvStack_2a0) + 0x18)) != GHIDRA_CAST<EntityConfig_Entity *>(0x0))
|
|
) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvStack_2a0) + 0x48)) != 0)) {
|
|
pEVar12 = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(pvStack_2a0) + 0x18));
|
|
}
|
|
}
|
|
else {
|
|
local_264 = iVar9 * 0x10;
|
|
do {
|
|
if (uVar17 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
debugBreak = (code *)swi(3);
|
|
(*debugBreak)();
|
|
return;
|
|
}
|
|
uVar17 = uVar17 >> ((byte)bossRngShifts & 0x1f) ^ uVar17;
|
|
uVar17 = uVar17 << ((byte)((ulonglong)bossRngShifts >> 0x20) & 0x1f) ^ uVar17;
|
|
uVar17 = uVar17 >> ((byte)local_26c & 0x1f) ^ uVar17;
|
|
spawn = GHIDRA_CAST<short *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_25c[-2])) + 0x14)))) + 0x40)) + local_264));
|
|
local_248 = (char *****)
|
|
(*spawn + 1 +
|
|
(spawn[1] + 1) *
|
|
GHIDRA_UINT(*GHIDRA_CAST<byte *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_25c[-2])) + 0x14)))) + 0x46))));
|
|
if ((char)spawn[4] != '\0') {
|
|
pickedEntry = (GHIDRA_CAST<Spawn *>((spawn)))->Spawn::PickEntry((float)((double)GHIDRA_INT(uVar17) +
|
|
__uint_to_double_fixup
|
|
[-(GHIDRA_INT(uVar17) >> 0x1f)]) *
|
|
2.3283062e-10);
|
|
bossEntry = *pickedEntry;
|
|
bossEntryExtra = *GHIDRA_CAST<undefined4 *>((pickedEntry + 1));
|
|
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::TransformEntry(&bossEntry,GHIDRA_UINT(local_248),uVar17);
|
|
uStack_2f8 = 0x900000005;
|
|
local_248 = GHIDRA_CAST<char *****>(&DAT_00000007);
|
|
if (uVar17 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("RNG Seed is zero!\n"));
|
|
debugBreak = (code *)swi(3);
|
|
(*debugBreak)();
|
|
return;
|
|
}
|
|
bossEntrySeed = uVar17 >> 5 ^ uVar17;
|
|
uStack_2e8 = 0x900000005;
|
|
bossEntrySeed = bossEntrySeed << 9 ^ bossEntrySeed;
|
|
bossEntrySeed = bossEntrySeed >> 7 ^ bossEntrySeed;
|
|
uStack_2e0 = 7;
|
|
uStack_2f8 = 0x900000005;
|
|
uStack_2f0 = 7;
|
|
local_2ec = bossEntrySeed;
|
|
pEVar12 = EntityConfig::GetEntity
|
|
(&g_manager->_entityConfig,GHIDRA_INT(bossEntry),
|
|
(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(bossEntry))) + 0x4))),(*GHIDRA_CAST<undefined2 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(bossEntry))) + 0x6))));
|
|
if (pEVar12 != GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
|
|
ppvVar5 = (void **)pEVar12->bossID;
|
|
if (ppvVar5 != (void **)0x0) {
|
|
if (local_258 == (void **)0x0) {
|
|
local_258 = ppvVar5;
|
|
local_24c = pEVar12;
|
|
}
|
|
else if (ppvVar5 != local_258) {
|
|
local_274 = ppvVar5;
|
|
local_254 = pEVar12;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
local_264 = local_264 - 0x10;
|
|
iVar9 = iVar9 + -1;
|
|
} while (-1 < iVar9);
|
|
if (local_258 == (void **)0x0) {
|
|
game = g_game;
|
|
goto LAB_00922baf;
|
|
}
|
|
LAB_00922c20:
|
|
pEVar12 = local_24c;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_25c[-2])) + 0x14)))) + 8)) == 5) &&
|
|
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_25c[-2])) + 0x14)))) + 0xc)) - 0xe74U < 0x96)) {
|
|
isDoubleTrouble = true;
|
|
}
|
|
else {
|
|
isDoubleTrouble = false;
|
|
}
|
|
if (isDoubleTrouble) {
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_8c._buf)) + 0x0))) = std::_Allocate(0x20);
|
|
local_8c._size = 0x11;
|
|
local_8c._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_8c._buf))) + 0x0))),"BossDoubleTrouble",0x12);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
|
|
(GHIDRA_CAST<std::string *>((doubleTroubleItem)))->std::string::string(&local_8c);
|
|
secondBoss = pEVar12;
|
|
if (local_274 != (void **)0x0) {
|
|
secondBoss = local_254;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 10;
|
|
firstBoss = pEVar12;
|
|
std::deque<32byte>::push_back(doubleTroubleItem);
|
|
(GHIDRA_CAST<std::string *>((doubleTroubleItem)))->std::string::_Tidy_deallocate();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
if (0xf < local_8c._capacity) {
|
|
uVar17 = local_8c._capacity + 1;
|
|
pcVar19 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_8c._buf))) + 0x0)));
|
|
if (0xfff < uVar17) {
|
|
pcVar19 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_8c._buf)) + 0x0))) + -4));
|
|
uVar17 = local_8c._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_8c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar19)))))
|
|
goto LAB_00921eab;
|
|
}
|
|
operator_delete(pcVar19,uVar17);
|
|
}
|
|
local_8c._size = 0;
|
|
local_8c._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_8c._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_8c._buf)) + 0x0))) & 0xffffff00;
|
|
}
|
|
else {
|
|
bossLabelSize = 0;
|
|
bossLabelCapacity = 0xf;
|
|
bossLabel[0] = (void *)0x0;
|
|
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(bossLabel))))->std::string::assign(&DAT_00b6c734,4);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
|
|
(GHIDRA_CAST<std::string *>((bossItem)))->std::string::string(bossLabel);
|
|
local_e4 = 0;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
|
|
bossConfig = pEVar12;
|
|
std::deque<32byte>::push_back(bossItem);
|
|
(GHIDRA_CAST<std::string *>((bossItem)))->std::string::_Tidy_deallocate();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
|
if (0xf < bossLabelCapacity) {
|
|
uVar17 = bossLabelCapacity + 1;
|
|
pvVar18 = bossLabel[0];
|
|
if (0xfff < uVar17) {
|
|
pvVar18 = *(void **)(GHIDRA_INT(bossLabel[0]) + -4);
|
|
uVar17 = bossLabelCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(bossLabel[0]) + (-4 - GHIDRA_INT(pvVar18))))) goto LAB_00921eab;
|
|
}
|
|
operator_delete(pvVar18,uVar17);
|
|
}
|
|
bossLabelSize = 0;
|
|
bossLabelCapacity = 0xf;
|
|
bossLabel[0] = (void *)(GHIDRA_UINT(bossLabel[0]) & 0xffffff00);
|
|
}
|
|
game = g_game;
|
|
}
|
|
}
|
|
local_260 = (void *)(GHIDRA_INT(local_260) + 1);
|
|
local_25c = local_25c + 2;
|
|
} while (GHIDRA_INT(local_260) < game->_nbRooms);
|
|
}
|
|
uVar17 = 0x1e;
|
|
pcVar19 = "gfx/ui/stage/nightmare_dc.anm2";
|
|
goto LAB_00922e39;
|
|
}
|
|
}
|
|
else {
|
|
uVar17 = 0x21;
|
|
pcVar19 = "gfx/ui/stage/nightmare_dogma.anm2";
|
|
LAB_00922e39:
|
|
(GHIDRA_CAST<std::string *>((sceneAnm2Path._buf)))->std::string::assign(GHIDRA_CAST<byte *>(pcVar19),uVar17);
|
|
}
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
playerManager = &g_game->_playerManager;
|
|
local_254 = GHIDRA_CAST<EntityConfig_Entity *>(0x0);
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >>
|
|
2 != 0) {
|
|
do {
|
|
pEVar12 = local_254;
|
|
pvVar18 = (playerManager->_playerList)._end;
|
|
piVar10 = (playerManager->_playerList)._begin;
|
|
if (GHIDRA_INT(pvVar18) - GHIDRA_INT(piVar10) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar18 = (playerManager->_playerList)._end;
|
|
piVar10 = (playerManager->_playerList)._begin;
|
|
}
|
|
pEVar6 = local_254;
|
|
if (pEVar12 < GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(pvVar18) - GHIDRA_INT(piVar10) >> 2))) {
|
|
piVar10 = piVar10 + GHIDRA_INT(pEVar12);
|
|
}
|
|
local_260 = (void *)*piVar10;
|
|
peerIt = g_manager->_netplayManager;
|
|
if (peerIt == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
|
LAB_00922f0e:
|
|
local_270 = local_260;
|
|
break;
|
|
}
|
|
puVar16 = GHIDRA_CAST<undefined1 *>(0x0);
|
|
local_26c = GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(*GHIDRA_CAST<NetplayManager *>((g_manager + 1))) - GHIDRA_INT(peerIt) >> 2));
|
|
if (local_26c == GHIDRA_CAST<RoomDescriptor *>(0x0)) goto LAB_00922f0e;
|
|
while (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peerIt) + 0xc)) != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_260) + 0x1618))) {
|
|
puVar16 = puVar16 + 1;
|
|
peerIt = (NetplayManager)(GHIDRA_INT(peerIt) + 4);
|
|
if (local_26c <= puVar16) goto LAB_00922f0e;
|
|
}
|
|
cVar7 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(peerIt) + 0x370)) + 0x14))();
|
|
if (cVar7 != '\0') goto LAB_00922f0e;
|
|
local_254 = GHIDRA_CAST<EntityConfig_Entity *>((GHIDRA_INT(&pEVar6->id) + 1));
|
|
playerManager = &g_game->_playerManager;
|
|
} while (local_254 <
|
|
(EntityConfig_Entity *)
|
|
(GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2));
|
|
}
|
|
iVar9 = FUN_0090b070();
|
|
uVar17 = g_manager[1]._state - 5;
|
|
uVar17 = -GHIDRA_UINT((uVar17 != 0)) & uVar17;
|
|
while( true ) {
|
|
if (*GHIDRA_CAST<int *>((iVar9 + 0x3a4)) == 0) {
|
|
uVar11 = g_manager[1]._state;
|
|
}
|
|
else {
|
|
local_268 = *GHIDRA_CAST<int *>((iVar9 + 0x3a0));
|
|
puVar13 = GHIDRA_CAST<uint *>(FUN_009012b0());
|
|
uVar11 = *puVar13;
|
|
}
|
|
if (uVar11 < uVar17) break;
|
|
NetInputDevice::broadcast_frame_input(uVar17);
|
|
uVar17 = uVar17 + 1;
|
|
}
|
|
}
|
|
scene = sceneRef;
|
|
iVar9 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_270) + 0x13c0));
|
|
local_268 = iVar9;
|
|
if ((iVar9 < 0) ||
|
|
((GHIDRA_INT((g_manager->_entityConfig)._players._end) -
|
|
GHIDRA_INT((g_manager->_entityConfig)._players._begin)) / 0x148 <= iVar9)) {
|
|
pvVar18 = (void *)0x0;
|
|
}
|
|
else {
|
|
pvVar18 = (void *)(iVar9 * 0x148 + GHIDRA_INT((g_manager->_entityConfig)._players._begin));
|
|
local_270 = pvVar18;
|
|
if (pvVar18 != (void *)0x0) {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x20)))),2,GHIDRA_CAST<std_string *>((GHIDRA_INT(pvVar18) + 0x4c)));
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x20)))))))->Sprite::ReplaceSpritesheet(6,GHIDRA_CAST<std_string *>((GHIDRA_INT(pvVar18) + 0x4c)))
|
|
;
|
|
pvVar18 = local_270;
|
|
iVar9 = local_268;
|
|
goto LAB_00923057;
|
|
}
|
|
}
|
|
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] could not load player config for type %d.\n"));
|
|
LAB_00923057:
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sceneRef[1])) + 0x130)))))))->ANM2::Reset();
|
|
scene = sceneRef;
|
|
bVar8 = extraout_CL;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar18) + 0x8c)) != 0) {
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sceneRef[1])) + 0x130)))))))->ANM2::Load(GHIDRA_CAST<std_string *>((GHIDRA_INT(pvVar18) + 0x7c)),1);
|
|
anim = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x148)));
|
|
if (0xf < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x15c))))) {
|
|
anim = *GHIDRA_CAST<byte **>(anim);
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(scene[1])) + 0x130)))))))->ANM2::Play(anim,0);
|
|
bVar8 = extraout_CL_00;
|
|
}
|
|
game = g_game;
|
|
uVar17 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID(bVar8);
|
|
(GHIDRA_CAST<std::string *>((local_8c._buf)))->std::string::string(game->_ventricleRazorPortals + uVar17 * 0xc4 + 0x5cc);
|
|
scene = sceneRef;
|
|
puVar16 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x20)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xd;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(puVar16))))->Sprite::ReplaceSpritesheet(3,&local_8c);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),6);
|
|
(GHIDRA_CAST<std::string *>((local_8c._buf)))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar16))))->ANM2::LoadGraphics(unk_00);
|
|
bVar8 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar16))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Intro"),1);
|
|
if (bVar8 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x50)))))))->AnimationState::Rewind();
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x64))) = 1;
|
|
}
|
|
scene = sceneRef;
|
|
puVar16 = &(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x134)));
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar16))))->ANM2::Reset();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar16))))->ANM2::Load(&sceneAnm2Path,1);
|
|
bVar8 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(puVar16))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Scene"),1);
|
|
if (((bVar8 != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x168)))) != 0)) &&
|
|
((GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x164)))))))->AnimationState::SetFrameFloat(0.0),
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x168)))) != 0)) {
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x178))) = 0;
|
|
}
|
|
scene = sceneRef;
|
|
if (((((iVar9 == 4) || (iVar9 == 0x10)) ||
|
|
((iVar9 == 0x11 || ((iVar9 == 0xe || (iVar9 == 0x19)))))) || (iVar9 == 0x23)) ||
|
|
(iVar9 == 0x21)) {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x20)))))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x2));
|
|
layer->_visible = 0;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x20)))))))->ANM2::GetLayer(&DAT_00000006);
|
|
layer->_visible = 1;
|
|
}
|
|
else {
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x20)))))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x2));
|
|
layer->_visible = 1;
|
|
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x20)))))))->ANM2::GetLayer(&DAT_00000006);
|
|
layer->_visible = 0;
|
|
}
|
|
scene = sceneRef;
|
|
*GHIDRA_CAST<undefined4 *>(sceneRef) = 1;
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x4)))) = 0;
|
|
halfHeight = g_screenHeight * 0.5;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0xb4)))) = g_screenWidth * 0.5;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0xb8)))) = halfHeight;
|
|
halfHeight = g_screenHeight * 0.5;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x1c8)))) = g_screenWidth * 0.5;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x1cc)))) = halfHeight;
|
|
game = g_game;
|
|
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x360)))) =
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x360)))) + 1U) %
|
|
GHIDRA_UINT(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0xc)))) - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x8))))) / 0x18));
|
|
iVar9 = game->_stage;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x364)))) = iVar9 + -1;
|
|
iVar14 = game->_stageType;
|
|
if ((iVar14 == 4) || (iVar14 == 5)) {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x364)))) = iVar9;
|
|
}
|
|
manager = g_manager;
|
|
cVar7 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(sceneRef[1])) + 0x244)));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((sceneRef)) + 0x368))) = unk;
|
|
iVar9 = 0x60;
|
|
if (cVar7 != '\0') {
|
|
iVar9 = 0x41;
|
|
}
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&manager->_musicManager))))->Music::Play(iVar9,(manager->_optionsConfig)._musicVolume);
|
|
if (g_game->_stage == 0xc) {
|
|
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((scene)) + 0x364)))) = 9;
|
|
}
|
|
std::deque<32byte>::_Tidy();
|
|
(GHIDRA_CAST<std::string *>((sceneAnm2Path._buf)))->std::string::_Tidy_deallocate();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00923320
|
|
void NightmareScene::record_stage(int stage, int stageType)
|
|
{
|
|
undefined1 isHomeNight;
|
|
int iconBase;
|
|
Game *game;
|
|
|
|
game = g_game;
|
|
iconBase = 0x11;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x244))) = 0;
|
|
if ((game->_difficulty == 2) || (game->_difficulty == 3)) {
|
|
if ((stageType != 4) && (stageType != 5)) {
|
|
if (stage < 5) {
|
|
iconBase = (stage + -1) * 3 + stageType;
|
|
}
|
|
else if (stage == 5) {
|
|
iconBase = stageType + 0xd;
|
|
}
|
|
else if (stage == 6) {
|
|
iconBase = stageType + 0x10;
|
|
}
|
|
else {
|
|
if (stage == 7) {
|
|
iconBase = 0x10;
|
|
}
|
|
iconBase = iconBase + stageType;
|
|
}
|
|
goto LAB_0092342f;
|
|
}
|
|
iconBase = stage * 2 + 0xd + stageType;
|
|
}
|
|
else {
|
|
if (stage == 0xd) {
|
|
isHomeNight = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x244)));
|
|
if (stageType == 1) {
|
|
isHomeNight = 1;
|
|
}
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x244))) = isHomeNight;
|
|
this->_stageBarIcons[0xd] = 0x1b;
|
|
return;
|
|
}
|
|
if ((stageType != 4) && (stageType != 5)) {
|
|
if (stage < 10) {
|
|
iconBase = ((stage + -1) / 2) * 3 + stageType;
|
|
}
|
|
else if (stage == 10) {
|
|
iconBase = stageType + 0xd;
|
|
}
|
|
else if (stage == 0xb) {
|
|
iconBase = stageType + 0xf;
|
|
}
|
|
else {
|
|
if (stage == 0xc) {
|
|
iconBase = 0x12;
|
|
}
|
|
iconBase = iconBase + stageType;
|
|
}
|
|
goto LAB_0092342f;
|
|
}
|
|
iconBase = stageType + 0xf + ((stage + -1) / 2) * 2;
|
|
}
|
|
stage = stage + 1;
|
|
LAB_0092342f:
|
|
this->_stageBarIcons[stage] = iconBase;
|
|
if (stage == 0xc) {
|
|
this->_stageBarIcons[10] = this->_stageBarIcons[0xc];
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00950f10
|
|
NightmareScene::~NightmareScene()
|
|
{
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
|
|
puStack_c = &LAB_00b0bd60;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x130)))))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x180)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x160)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x148))))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x130))))))->std::string::_Tidy_deallocate();
|
|
std::deque<32byte>::_Tidy();
|
|
local_8 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x54)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x34)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1c))))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4))))))->std::string::_Tidy_deallocate();
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248)))))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x298)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x278)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x260))))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x248))))))->std::string::_Tidy_deallocate();
|
|
local_8 = 3;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134)))))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x184)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x164)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x14c))))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x134))))))->std::string::_Tidy_deallocate();
|
|
local_8 = 4;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))))))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x70)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x50)))))))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x38))))))->std::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<std::string *>((&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20))))))->std::string::_Tidy_deallocate();
|
|
FID_conflict__Tidy(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x14))));
|
|
std::vector<std::string>::_Tidy();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|