Files
isaac-port/generated-src/room_transition.cpp
T
shweetandClaude Opus 5.5 3ce74c6e2d Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
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>
2026-11-19 21:10:23 -05:00

2354 lines
112 KiB
C++

#include "classes.h"
// 0082ebd0
RoomTransition::~RoomTransition()
{
char cVar1;
undefined4 extraout_ECX;
RoomTransition *local_14;
void *local_10;
undefined1 *puStack_c;
undefined4 local_8;
EntityPtr *refSlot;
local_8 = 0xffffffff;
puStack_c = &LAB_00b01fe0;
local_10 = ExceptionList;
ExceptionList = &local_10;
local_14 = this;
KAGE::SmartPointer<RenderTargetBase>::reset(this);
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
refSlot = &this->_minecart;
if (*refSlot != (EntityPtr)0x0) {
local_14 = GHIDRA_CAST<RoomTransition *>(refSlot);
std::multiset<unsigned_int>::erase(&local_14);
*refSlot = (EntityPtr)0x0;
}
std::map<RoomTransitionSprite>::_Erase_tree
(&this->_sprites,*GHIDRA_CAST<undefined4 *>((GHIDRA_INT((this->_sprites)._head) + 4)));
operator_delete((this->_sprites)._head,0x128);
local_8 = 1;
(GHIDRA_CAST<ANM2 *>((&this->_versusScreenSprite)))->ANM2::Reset();
(GHIDRA_CAST<AnimationState *>((&(this->_versusScreenSprite)._overlayAnimState)))->AnimationState::~AnimationState();
(GHIDRA_CAST<AnimationState *>((&(this->_versusScreenSprite)._animState)))->AnimationState::~AnimationState();
(GHIDRA_CAST<std::string *>(((this->_versusScreenSprite)._animDefaultName._buf)))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(&this->_versusScreenSprite))))->std::string::_Tidy_deallocate();
local_8 = 2;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x34)))) != GHIDRA_CAST<int *>(0x0)) {
cVar1 = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x34)))) + 0xc))();
if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x30))));
}
}
local_8 = 3;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2c)))) != GHIDRA_CAST<int *>(0x0)) {
cVar1 = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x2c)))) + 0xc))();
if ((cVar1 != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28))));
}
}
ExceptionList = local_10;
return;
}
// 0082f1c0
void RoomTransition::StartBossIntro(uint bossID1, uint bossID2)
{
byte bVar1;
char cVar2;
uint uVar3;
std_string *psVar4;
LayerState *layer;
int iVar5;
EntityPtr coopPlayer;
uint uVar6;
uint *puVar7;
int *piVar8;
undefined4 *texture;
RoomDescriptor *roomDesc;
byte extraout_CL;
byte extraout_CL_00;
undefined1 *texture;
void *pvVar10;
Game *pGVar11;
uint *strEnd;
char *nameEnd;
byte *pbVar12;
float extraout_ECX;
float extraout_ECX_00;
float fVar13;
Game *extraout_EDX;
Game *pGVar14;
Sprite *stageType;
byte *pbVar15;
void **ppvVar16;
Sprite *versusSprite;
Game *pGVar17;
undefined4 uVar18;
undefined4 uVar19;
char *pcVar20;
undefined4 uVar21;
Game *local_7c;
char isAnm2LoadNeeded;
int *portraitTexture;
std_string *local_70;
EntityPtr local_6c;
uint cleanupFlags;
Sprite *local_64;
byte local_5d;
std_string anm2Path;
std_string tmpString;
byte local_2c;
byte pixelGreen;
byte pixelBlue;
Game *local_28;
uint local_24;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
ANM2 *versusAnm2;
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&tmpString) + 0x40));
local_14 = 0xffffffff;
puStack_18 = &LAB_00b02107;
local_1c = ExceptionList;
uVar3 = __security_cookie ^ GHIDRA_UINT((GHIDRA_INT(&tmpString) + 0x34U));
ExceptionList = &local_1c;
local_6c = (EntityPtr)0x0;
cleanupFlags = 0;
this->_bossIntroBossId = bossID1;
local_7c = GHIDRA_CAST<Game *>(this);
local_24 = uVar3;
texture = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&tmpString) + 0x40));
if (*GHIDRA_CAST<int *>(this) != 0) {
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&g_manager->_musicManager))))->Music::Play(0x51,(g_manager->_optionsConfig)._musicVolume);
texture = puStack_20;
}
puStack_20 = texture;
FUN_007ea5d0(uVar3);
(g_game->_hud)._isVisible = 0;
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
anm2Path._size = 0x1d;
anm2Path._capacity = GHIDRA_UINT(&DAT_0000001f);
*GHIDRA_CAST<undefined4 *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0))))->_buf) = 0x2f786667;
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0))))->_buf) + 4)) = 0x622f6975;
builtin_strncpy(GHIDRA_CAST<char *>((GHIDRA_INT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0))))->_buf) + 8)),"oss/",4);
builtin_strncpy(GHIDRA_CAST<char *>((GHIDRA_INT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0))))->_buf) + 0xc)),"vers",4);
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0))))->_size = 0x63737375;
((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0))))->_capacity = 0x6e656572;
builtin_strncpy((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + 0x18)))->_buf,".anm2",6);
local_14 = 0;
local_5d = 0;
if (bossID1 == 99) {
local_70 = GHIDRA_CAST<std_string *>(0x1f);
local_6c = (EntityPtr)&DAT_0000002f;
local_70 = std::_Allocate(0x30);
anm2Path._size = 0x23;
anm2Path._capacity = GHIDRA_UINT(local_6c);
*GHIDRA_CAST<undefined4 *>(local_70->_buf) = 0x2f786667;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_70->_buf) + 4)) = 0x622f6975;
builtin_strncpy(GHIDRA_CAST<char *>((GHIDRA_INT(local_70->_buf) + 8)),"oss/",4);
builtin_strncpy(GHIDRA_CAST<char *>((GHIDRA_INT(local_70->_buf) + 0xc)),"vers",4);
local_70->_size = 0x63737375;
local_70->_capacity = 0x6e656572;
builtin_strncpy(local_70[1]._buf,"_dogma.anm2",0xc);
operator_delete((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)anm2Path._buf)) + 0x0))),0x20);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = local_70;
local_5d = 1;
}
else if (bossID1 == 0x58) {
local_70 = GHIDRA_CAST<std_string *>(0x1f);
local_6c = (EntityPtr)&DAT_0000002f;
local_70 = std::_Allocate(0x30);
anm2Path._capacity = GHIDRA_UINT(local_6c);
anm2Path._size = 0x24;
*GHIDRA_CAST<undefined4 *>(local_70->_buf) = 0x2f786667;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_70->_buf) + 4)) = 0x622f6975;
builtin_strncpy(GHIDRA_CAST<char *>((GHIDRA_INT(local_70->_buf) + 8)),"oss/",4);
builtin_strncpy(GHIDRA_CAST<char *>((GHIDRA_INT(local_70->_buf) + 0xc)),"vers",4);
local_70->_size = 0x63737375;
local_70->_capacity = 0x6e656572;
builtin_strncpy(local_70[1]._buf,"_mother.anm2",0xd);
operator_delete((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((void *)anm2Path._buf)) + 0x0))),0x20);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = local_70;
}
if ((this->_versusScreenSprite)._loaded == 0) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
LAB_0082f4e7:
isAnm2LoadNeeded = '\x01';
}
else {
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::string(&this->_versusScreenSprite);
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
cleanupFlags = 9;
psVar4 = &anm2Path;
if (GHIDRA_CAST<Game *>(&DAT_0000000f) < anm2Path._capacity) {
psVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0)));
}
pbVar12 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar12 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
bVar1 = str_eq(pbVar12,tmpString._size,GHIDRA_CAST<byte *>(psVar4),anm2Path._size);
if (bVar1 == 0) goto LAB_0082f4e7;
isAnm2LoadNeeded = '\0';
}
if (((cleanupFlags & 1) != 0) &&
(cleanupFlags = cleanupFlags & 0xfffffffe, &DAT_0000000f < tmpString._capacity)) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar12 = pbVar15;
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar12 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(pbVar15) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < pbVar15 + (-4 - GHIDRA_INT(pbVar12))) goto LAB_00830911;
}
operator_delete(pbVar12,GHIDRA_UINT(texture));
}
local_64 = GHIDRA_CAST<Sprite *>(&this->_versusScreenSprite);
if (isAnm2LoadNeeded != '\0') {
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_64))))->ANM2::Load(&anm2Path,1);
}
if (bossID1 == 99) {
local_64 = GHIDRA_CAST<Sprite *>(&this->_versusScreenSprite);
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_64))))->ANM2::GetLayer(&DAT_0000000b);
layer->_bitflags = layer->_bitflags | 0x60;
}
layer = (GHIDRA_CAST<ANM2 *>((&this->_versusScreenSprite)))->ANM2::GetLayer(&DAT_0000000b);
layer->_blendMode[0] = 0;
layer->_blendMode[1] = 4;
layer->_blendMode[2] = 7;
layer->_blendMode[3] = 4;
layer->_blendMode[4] = 7;
pvVar10 = (this->_sprites)._head;
std::map<RoomTransitionSprite>::_Erase_tree(&this->_sprites,*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(pvVar10) + 4)));
pGVar17 = g_game;
*(void **)(GHIDRA_CAST<char *>(pvVar10) + 4) = pvVar10;
*(void **)pvVar10 = pvVar10;
*(void **)(GHIDRA_CAST<char *>(pvVar10) + 8) = pvVar10;
(this->_sprites)._size = 0;
local_6c = (EntityPtr)(pGVar17->_playerManager)._roomTransitionPlayer;
if (local_6c == (EntityPtr)0x0) {
local_6c = (EntityPtr)(GHIDRA_CAST<Game *>((pGVar17)))->Game::GetPlayer(0);
}
versusSprite = local_64;
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_6c) + 0x13c0));
if (iVar5 < 0) {
LAB_0082f7d9:
KAGE_LogMessage(1,GHIDRA_CAST<byte *>("[warn] could not load player config for type %d.\n"));
versusSprite = local_64;
pGVar17 = local_7c;
}
else {
local_70 = (g_manager->_entityConfig)._players._begin;
if ((GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(local_70)) / 0x148 <= iVar5)
goto LAB_0082f7d9;
psVar4 = GHIDRA_CAST<std_string *>((GHIDRA_INT(local_70) + iVar5 * 0x148));
local_70 = psVar4;
if (psVar4 == GHIDRA_CAST<std_string *>(0x0)) goto LAB_0082f7d9;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(local_64))))->ANM2::GetLayer(&DAT_00000005);
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0xc));
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_0000000f);
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x12));
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x15));
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x10));
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_00000013);
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x16));
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_00000011);
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_00000014);
layer->_visible = 0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_00000017);
pGVar17 = local_7c;
layer->_visible = 0;
FUN_00831780(psVar4,5,0xc,3);
(GHIDRA_CAST<Sprite *>((versusSprite)))->Sprite::ReplaceSpritesheet(6,GHIDRA_CAST<std_string *>((local_70[2]._buf + 4)));
local_7c = GHIDRA_CAST<Game *>(&g_game->_playerManager);
local_64 = GHIDRA_CAST<Sprite *>(0x1);
iVar5 = (GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<PlayerManager *>(local_7c))))->PlayerManager::count_main_players();
if (iVar5 != 0) {
uVar3 = 0;
do {
coopPlayer = (EntityPtr)(GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<PlayerManager *>(local_7c))))->PlayerManager::get_main_player(uVar3);
if (((coopPlayer != (EntityPtr)0x0) && (coopPlayer != local_6c)) &&
(coopPlayer != *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_6c) + 0x1e68)))) {
local_70 = *GHIDRA_CAST<std_string **>((GHIDRA_CAST<char *>(coopPlayer) + 0x13c0));
if ((GHIDRA_INT(local_70) < 0) ||
((GHIDRA_INT((g_manager->_entityConfig)._players._end) -
GHIDRA_INT((g_manager->_entityConfig)._players._begin)) / 0x148 <= GHIDRA_INT(local_70))) {
pvVar10 = (void *)0x0;
}
else {
pvVar10 = (void *)(GHIDRA_INT(local_70) * 0x148 +
GHIDRA_INT((g_manager->_entityConfig)._players._begin));
}
if (local_64 == GHIDRA_CAST<Sprite *>(0x1)) {
uVar21 = 0xf;
uVar19 = 0x15;
uVar18 = 0x12;
LAB_0082f7ac:
FUN_00831780(pvVar10,uVar18,uVar19,uVar21);
}
else {
if (local_64 == GHIDRA_CAST<Sprite *>(0x2)) {
uVar21 = 0x10;
uVar19 = 0x16;
uVar18 = 0x13;
goto LAB_0082f7ac;
}
if (local_64 == GHIDRA_CAST<Sprite *>(0x3)) {
uVar21 = 0x11;
uVar19 = 0x17;
uVar18 = 0x14;
goto LAB_0082f7ac;
}
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Ran out of slots for players"));
}
local_64 = GHIDRA_CAST<Sprite *>(((local_64->_filename)._buf + 1));
}
uVar3 = uVar3 + 1;
local_7c = GHIDRA_CAST<Game *>(&g_game->_playerManager);
uVar6 = (GHIDRA_CAST<PlayerManager *>((GHIDRA_CAST<PlayerManager *>(local_7c))))->PlayerManager::count_main_players();
} while (uVar3 < uVar6);
versusSprite = GHIDRA_CAST<Sprite *>((pGVar17->_roomList[0]._doors + 2));
}
}
local_7c = GHIDRA_CAST<Game *>(g_game->_stage);
local_28 = local_7c;
local_70 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level)::GetRoomStageType(g_game->_currentRoomIdx);
local_6c = (EntityPtr)g_game;
local_64 = GHIDRA_CAST<Sprite *>(local_70);
if (g_game->_currentRoomIdx == -0x11) {
Level::boss_count_adjust(GHIDRA_CAST<int *>(&local_7c),GHIDRA_CAST<int *>(&local_70));
local_64 = GHIDRA_CAST<Sprite *>(local_70);
pGVar11 = local_7c;
pGVar14 = extraout_EDX;
}
else {
pGVar11 = local_28;
pGVar14 = g_game;
}
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar14->_room) + 8)) == 5) &&
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar14->_room) + 4)) + 0x10)) + 0x10)) == 0x5a)) {
pGVar11 = GHIDRA_CAST<Game *>(0x8);
stageType = GHIDRA_CAST<Sprite *>(GHIDRA_CAST<std_string *>(0x0));
}
else {
stageType = local_64;
}
local_70 = &local_64->_filename;
local_7c = GHIDRA_CAST<Game *>(RoomConfig)::GetStageID(GHIDRA_UINT(pGVar11),GHIDRA_UINT(stageType),-1);
local_28 = GHIDRA_CAST<Game *>(g_manager);
if ((GHIDRA_INT(bossID1) < 0) ||
((GHIDRA_INT((g_manager->_entityConfig)._bosses._end) - GHIDRA_INT((g_manager->_entityConfig)._bosses._begin)
) / 100 <= GHIDRA_INT(bossID1))) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("BossID out of bounds\n"));
local_6c = (EntityPtr)g_game;
}
local_64 = (Sprite *)
(bossID1 * 100 + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28->_glowingHourglassStates[0]._gameState)) + 0x3ca0)))))
;
uVar3 = 0xffffffff;
if (local_6c != (EntityPtr)0x0) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_6c) + 0x26584)) == 0x2c) {
uVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(local_6c))))->Level::GetRoomStageType(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_6c) + 0x18304)));
uVar3 = *GHIDRA_CAST<int *>(local_6c);
}
else {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_6c) + 0x1830c)) == 2) {
uVar3 = 0x23;
goto LAB_0082f917;
}
uVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_6c) + 4));
uVar3 = *GHIDRA_CAST<int *>(local_6c);
}
uVar3 = RoomConfig::GetStageID(uVar3,uVar6,-1);
}
LAB_0082f917:
puVar7 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x58));
if (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c))) {
do {
if (*puVar7 == uVar3) {
puVar7 = puVar7 + 1;
goto LAB_0082f933;
}
puVar7 = puVar7 + 7;
} while (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c)));
}
puVar7 = GHIDRA_CAST<uint *>((GHIDRA_INT(local_64) + 0x34));
LAB_0082f933:
if (0xf < puVar7[5]) {
puVar7 = GHIDRA_CAST<uint *>(*puVar7);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((GHIDRA_INT(puVar7) + 1));
strEnd = puVar7;
do {
uVar3 = *strEnd;
strEnd = GHIDRA_CAST<uint *>((GHIDRA_INT(strEnd) + 1));
} while ((char)uVar3 != '\0');
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>(puVar7),GHIDRA_INT(strEnd) - GHIDRA_INT(local_28));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
if (4 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa4))))) {
local_28 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
piVar8 = &local_28->_roomList[3].GreedSubType;
if (0xf < GHIDRA_UINT(local_28->_roomList[3].AwardSeed)) {
piVar8 = GHIDRA_CAST<int *>(local_28->_roomList[3].GreedSubType);
}
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
bVar1 = str_eq(pbVar15,tmpString._size,GHIDRA_CAST<byte *>(piVar8),local_28->_roomList[3].SpawnSeed);
if (bVar1 == 0) {
piVar8 = &local_28->_roomList[3].GreedSubType;
pGVar11 = local_28;
if (GHIDRA_CAST<std_string *>(piVar8) != &tmpString) {
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(piVar8))))->std::string::assign(pbVar15,tmpString._size);
pGVar11 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
}
*GHIDRA_CAST<undefined1 *>(&pGVar11->_roomList[3].SavedEntities._begin) = 0;
}
}
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
uVar3 = 0xffffffff;
local_28 = g_game;
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
if (g_game->_challenge == 0x2c) {
uVar6 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomStageType(g_game->_currentRoomIdx);
uVar3 = local_28->_stage;
}
else {
if (g_game->_currentDimensionIdx == 2) {
uVar3 = 0x23;
goto LAB_0082fa81;
}
uVar6 = g_game->_stageType;
uVar3 = g_game->_stage;
}
uVar3 = RoomConfig::GetStageID(uVar3,uVar6,-1);
}
LAB_0082fa81:
puVar7 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x58));
if (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c))) {
do {
if (*puVar7 == uVar3) {
puVar7 = puVar7 + 1;
goto LAB_0082faa3;
}
puVar7 = puVar7 + 7;
} while (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c)));
}
puVar7 = GHIDRA_CAST<uint *>((GHIDRA_INT(local_64) + 0x34));
LAB_0082faa3:
if (0xf < puVar7[5]) {
puVar7 = GHIDRA_CAST<uint *>(*puVar7);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((GHIDRA_INT(puVar7) + 1));
strEnd = puVar7;
do {
uVar3 = *strEnd;
strEnd = GHIDRA_CAST<uint *>((GHIDRA_INT(strEnd) + 1));
} while ((char)uVar3 != '\0');
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>(puVar7),GHIDRA_INT(strEnd) - GHIDRA_INT(local_28));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (0xd < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa4))))) {
local_28 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
piVar8 = local_28->_roomList[0xb]._doors + 4;
if (0xf < GHIDRA_UINT(local_28->_roomList[0xb].VisitedCount)) {
piVar8 = GHIDRA_CAST<int *>(local_28->_roomList[0xb]._doors[4]);
}
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
bVar1 = str_eq(pbVar15,tmpString._size,GHIDRA_CAST<byte *>(piVar8),local_28->_roomList[0xb].DisplayFlags);
if (bVar1 == 0) {
piVar8 = local_28->_roomList[0xb]._doors + 4;
pGVar11 = local_28;
if (GHIDRA_CAST<std_string *>(piVar8) != &tmpString) {
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(piVar8))))->std::string::assign(pbVar15,tmpString._size);
pGVar11 = versusSprite->_layerState;
}
*GHIDRA_CAST<undefined1 *>(&pGVar11->_roomList[0xb].PitsCount) = 0;
}
}
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
if (bossID2 == 0) {
uVar3 = 0xffffffff;
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
uVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID((byte)g_game);
}
puVar7 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x58));
if (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c))) {
do {
if (*puVar7 == uVar3) {
puVar7 = puVar7 + 1;
goto LAB_0082fdd5;
}
puVar7 = puVar7 + 7;
} while (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c)));
}
puVar7 = GHIDRA_CAST<uint *>((GHIDRA_INT(local_64) + 0x34));
LAB_0082fdd5:
if (0xf < puVar7[5]) {
puVar7 = GHIDRA_CAST<uint *>(*puVar7);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((GHIDRA_INT(puVar7) + 1));
strEnd = puVar7;
do {
uVar3 = *strEnd;
strEnd = GHIDRA_CAST<uint *>((GHIDRA_INT(strEnd) + 1));
} while ((char)uVar3 != '\0');
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>(puVar7),GHIDRA_INT(strEnd) - GHIDRA_INT(local_28));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
if (9 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa4))))) {
local_28 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
ppvVar16 = &local_28->_roomList[7].SavedEffects._end;
if (0xf < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28->_roomList[7])) + 0xa0))))) {
ppvVar16 = local_28->_roomList[7].SavedEffects._end;
}
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
bVar1 = str_eq(pbVar15,tmpString._size,GHIDRA_CAST<byte *>(ppvVar16),
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28->_roomList[7])) + 0x9c)))));
if (bVar1 == 0) {
ppvVar16 = &local_28->_roomList[7].SavedEffects._end;
pGVar11 = local_28;
if (GHIDRA_CAST<std_string *>(ppvVar16) != &tmpString) {
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(ppvVar16))))->std::string::assign(pbVar15,tmpString._size);
pGVar11 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
}
*GHIDRA_CAST<undefined1 *>(&pGVar11->_roomList[7].Group) = 0;
}
}
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
uVar3 = 0xffffffff;
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
uVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID((byte)g_game);
}
puVar7 = *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x58));
if (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c))) {
do {
if (*puVar7 == uVar3) {
puVar7 = puVar7 + 1;
goto LAB_0082ff03;
}
puVar7 = puVar7 + 7;
} while (puVar7 != *GHIDRA_CAST<uint **>((GHIDRA_CAST<char *>(local_64) + 0x5c)));
}
puVar7 = GHIDRA_CAST<uint *>((GHIDRA_INT(local_64) + 0x34));
LAB_0082ff03:
if (0xf < puVar7[5]) {
puVar7 = GHIDRA_CAST<uint *>(*puVar7);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((GHIDRA_INT(puVar7) + 1));
strEnd = puVar7;
do {
uVar3 = *strEnd;
strEnd = GHIDRA_CAST<uint *>((GHIDRA_INT(strEnd) + 1));
} while ((char)uVar3 != '\0');
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>(puVar7),GHIDRA_INT(strEnd) - GHIDRA_INT(local_28));
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),6);
}
else {
local_28 = GHIDRA_CAST<Game *>(g_manager);
if ((GHIDRA_INT(bossID2) < 0) ||
((GHIDRA_INT((g_manager->_entityConfig)._bosses._end) -
GHIDRA_INT((g_manager->_entityConfig)._bosses._begin)) / 100 <= GHIDRA_INT(bossID2))) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("BossID out of bounds\n"));
}
uVar3 = 0xffffffff;
local_70 = (std_string *)
(bossID2 * 100 +
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28->_glowingHourglassStates[0]._gameState)) + 0x3ca0)))));
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
uVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID((byte)g_game);
}
puVar7 = GHIDRA_CAST<uint *>(local_70[3]._size);
if (puVar7 != GHIDRA_CAST<uint *>(local_70[3]._capacity)) {
do {
if (*puVar7 == uVar3) {
pcVar20 = GHIDRA_CAST<char *>((puVar7 + 1));
goto LAB_0082fc23;
}
puVar7 = puVar7 + 7;
} while (puVar7 != GHIDRA_CAST<uint *>(local_70[3]._capacity));
}
pcVar20 = local_70[2]._buf + 4;
LAB_0082fc23:
if (0xf < *GHIDRA_CAST<uint *>((pcVar20 + 0x14))) {
pcVar20 = *GHIDRA_CAST<char **>(pcVar20);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((pcVar20 + 1));
nameEnd = pcVar20;
do {
cVar2 = *nameEnd;
nameEnd = nameEnd + 1;
} while (cVar2 != '\0');
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>(pcVar20),GHIDRA_INT(nameEnd) - GHIDRA_INT(local_28));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
if (9 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa4))))) {
local_28 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
ppvVar16 = &local_28->_roomList[7].SavedEffects._end;
if (0xf < *GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28->_roomList[7])) + 0xa0))))) {
ppvVar16 = local_28->_roomList[7].SavedEffects._end;
}
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
bVar1 = str_eq(pbVar15,tmpString._size,GHIDRA_CAST<byte *>(ppvVar16),
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_28->_roomList[7])) + 0x9c)))));
if (bVar1 == 0) {
ppvVar16 = &local_28->_roomList[7].SavedEffects._end;
pGVar11 = local_28;
if (GHIDRA_CAST<std_string *>(ppvVar16) != &tmpString) {
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(ppvVar16))))->std::string::assign(pbVar15,tmpString._size);
pGVar11 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
}
*GHIDRA_CAST<undefined1 *>(&pGVar11->_roomList[7].Group) = 0;
}
}
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
uVar3 = 0xffffffff;
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
uVar3 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetStageID((byte)g_game);
}
puVar7 = GHIDRA_CAST<uint *>(local_70[3]._size);
if (puVar7 != GHIDRA_CAST<uint *>(local_70[3]._capacity)) {
do {
if (*puVar7 == uVar3) {
pcVar20 = GHIDRA_CAST<char *>((puVar7 + 1));
goto LAB_0082fd47;
}
puVar7 = puVar7 + 7;
} while (puVar7 != GHIDRA_CAST<uint *>(local_70[3]._capacity));
}
pcVar20 = local_70[2]._buf + 4;
LAB_0082fd47:
if (0xf < *GHIDRA_CAST<uint *>((pcVar20 + 0x14))) {
pcVar20 = *GHIDRA_CAST<char **>(pcVar20);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((pcVar20 + 1));
nameEnd = pcVar20;
do {
cVar2 = *nameEnd;
nameEnd = nameEnd + 1;
} while (cVar2 != '\0');
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>(pcVar20),GHIDRA_INT(nameEnd) - GHIDRA_INT(local_28));
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
}
if (0xe < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa4))))) {
local_28 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
ppvVar16 = &local_28->_roomList[0xc].OverrideData;
if (0xf < GHIDRA_UINT(local_28->_roomList[0xc]._doors[3])) {
ppvVar16 = local_28->_roomList[0xc].OverrideData;
}
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
bVar1 = str_eq(pbVar15,tmpString._size,GHIDRA_CAST<byte *>(ppvVar16),local_28->_roomList[0xc]._doors[2]);
if (bVar1 == 0) {
ppvVar16 = &local_28->_roomList[0xc].OverrideData;
pGVar11 = local_28;
if (GHIDRA_CAST<std_string *>(ppvVar16) != &tmpString) {
pbVar15 = GHIDRA_CAST<byte *>(&tmpString);
if (&DAT_0000000f < tmpString._capacity) {
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
}
(GHIDRA_CAST<std::string *>((GHIDRA_CAST<char *>(ppvVar16))))->std::string::assign(pbVar15,tmpString._size);
pGVar11 = *GHIDRA_CAST<Game **>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(pGVar17->_roomList[0])) + 0xa0))));
}
*GHIDRA_CAST<undefined1 *>(&pGVar11->_roomList[0xc].DisplayFlags) = 0;
}
}
local_14 = local_14 & 0xffffff00;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
if (bossID1 == 0x28) {
local_70 = GHIDRA_CAST<std_string *>(&(g_game->_seedEffects)._seedEffects);
local_28 = GHIDRA_CAST<Game *>(&DAT_0000004f);
std::set<int>::find_node(GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&tmpString) + 0xc)),&local_28);
if ((*GHIDRA_CAST<char *>((tmpString._capacity + 0xd)) != '\0') ||
(0x4f < *GHIDRA_CAST<int *>((tmpString._capacity + 0x10)))) {
tmpString._capacity = *GHIDRA_CAST<uint *>(local_70->_buf);
}
if (GHIDRA_CAST<undefined1 *>(tmpString._capacity) != *GHIDRA_CAST<undefined1 **>(local_70->_buf)) {
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>("gfx/promo/gfuel/ui/boss/g fuel bluebaby portrait.png"),0x34);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
(GHIDRA_CAST<Sprite *>((versusSprite)))->Sprite::ReplaceSpritesheet(4,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15)))))
goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>("gfx/promo/gfuel/ui/boss/g fuel bluebaby portrait.png"),0x34);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
(GHIDRA_CAST<Sprite *>((versusSprite)))->Sprite::ReplaceSpritesheet(0xd,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15)))))
goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
}
}
pbVar15 = GHIDRA_CAST<byte *>((GHIDRA_INT(local_64) + 0x1c));
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_64) + 0x30))) {
pbVar15 = *GHIDRA_CAST<byte **>(pbVar15);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((pbVar15 + 1));
pbVar12 = pbVar15;
do {
bVar1 = *pbVar12;
pbVar12 = pbVar12 + 1;
} while (bVar1 != 0);
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(pbVar15,GHIDRA_INT(pbVar12) - GHIDRA_INT(local_28));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
(GHIDRA_CAST<Sprite *>((versusSprite)))->Sprite::ReplaceSpritesheet(7,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
}
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_00000004);
(layer->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x4c));
(layer->_pos).y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x50));
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_0000000d);
(layer->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x4c));
(layer->_pos).y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x50));
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_00000009);
(layer->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x4c));
(layer->_pos).y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x50));
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_0000000e);
(layer->_pos).x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x4c));
fVar13 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_64) + 0x50));
(layer->_pos).y = fVar13;
if (local_5d == 0) {
iVar5 = GHIDRA_INT(local_7c) * 0xc4;
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::string(g_game->_ventricleRazorPortals + iVar5 + 0x5b4);
cleanupFlags = cleanupFlags | 0x10;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 10;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((pGVar17->_roomList[0]._doors + 2)))))->Sprite::ReplaceSpritesheet(3,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::string(g_game->_ventricleRazorPortals + iVar5 + 0x5b4);
cleanupFlags = cleanupFlags | 0x20;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((pGVar17->_roomList[0]._doors + 2)))))->Sprite::ReplaceSpritesheet(0xf,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::string(g_game->_ventricleRazorPortals + iVar5 + 0x5b4);
cleanupFlags = cleanupFlags | 0x40;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((pGVar17->_roomList[0]._doors + 2)))))->Sprite::ReplaceSpritesheet(0x10,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::string(g_game->_ventricleRazorPortals + iVar5 + 0x5b4);
cleanupFlags = cleanupFlags | 0x80;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xd;
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>((pGVar17->_roomList[0]._doors + 2)))))->Sprite::ReplaceSpritesheet(0x11,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::_Tidy_deallocate();
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::string(g_game->_ventricleRazorPortals + iVar5 + 0x5cc);
cleanupFlags = cleanupFlags | 0x100;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xe;
versusSprite = GHIDRA_CAST<Sprite *>((pGVar17->_roomList[0]._doors + 2));
(GHIDRA_CAST<Sprite *>((versusSprite)))->Sprite::ReplaceSpritesheet(2,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::_Tidy_deallocate();
local_5d = bossID1 != 0x37;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x2));
layer->_visible = local_5d;
fVar13 = extraout_ECX;
}
if (bossID1 == 0x58) {
pbVar15 = GHIDRA_CAST<byte *>(FUN_0069d250(fVar13));
if (0xf < *GHIDRA_CAST<uint *>((pbVar15 + 0x14))) {
pbVar15 = *GHIDRA_CAST<byte **>(pbVar15);
}
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
local_28 = GHIDRA_CAST<Game *>((pbVar15 + 1));
pbVar12 = pbVar15;
do {
bVar1 = *pbVar12;
pbVar12 = pbVar12 + 1;
} while (bVar1 != 0);
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(pbVar15,GHIDRA_INT(pbVar12) - GHIDRA_INT(local_28));
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xf;
(GHIDRA_CAST<Sprite *>((versusSprite)))->Sprite::ReplaceSpritesheet(0x18,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
fVar13 = extraout_ECX_00;
if (tmpString._capacity < GHIDRA_CAST<undefined1 *>(0x10)) goto LAB_0083066a;
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::LoadGraphics((byte)texture);
LAB_0083041c:
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x2));
piVar8 = (GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(&portraitTexture);
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x10);
local_6c = (EntityPtr)(cleanupFlags | 2);
cleanupFlags = GHIDRA_UINT(local_6c);
if (*piVar8 == 0) {
LAB_0083047c:
local_5d = 0;
}
else {
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x2));
texture = (GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(&local_2c);
local_14 = 0x11;
local_6c = (EntityPtr)(cleanupFlags | 4);
cleanupFlags = GHIDRA_UINT(local_6c);
cVar2 = (*(code *)**GHIDRA_CAST<undefined4 **>(*texture))();
local_5d = 1;
if (cVar2 == '\0') goto LAB_0083047c;
}
if ((cleanupFlags & 4) != 0) {
local_6c = (EntityPtr)(cleanupFlags & 0xfffffffb);
local_14 = 0x12;
cleanupFlags = GHIDRA_UINT(local_6c);
if (((local_28 != GHIDRA_CAST<Game *>(0x0)) &&
(cVar2 = (**(code **)(GHIDRA_CAST<char *>(local_28->_stage) + 0xc))(), cVar2 != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&local_2c);
}
}
local_14 = 0;
if ((cleanupFlags & 2) != 0) {
local_14 = 0x13;
if (((local_70 != GHIDRA_CAST<std_string *>(0x0)) &&
(cVar2 = (**(code **)(GHIDRA_INT(*(void **))local_70->_buf + 0xc))(), cVar2 != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&portraitTexture);
}
local_14 = local_14 & 0xffffff00;
}
versusAnm2 = GHIDRA_CAST<ANM2 *>((pGVar17->_roomList[0]._doors + 2));
if (local_5d == 0) {
layer = (GHIDRA_CAST<ANM2 *>((versusAnm2)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
(layer->_color)._tint[0] = 0.0;
(layer->_color)._tint[1] = 0.0;
(layer->_color)._tint[2] = 0.0;
(layer->_color)._tint[3] = 1.0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_0000000d);
(layer->_color)._tint[0] = 1.0;
(layer->_color)._tint[1] = 0.5568628;
(layer->_color)._tint[2] = 0.4666667;
(layer->_color)._tint[3] = 1.0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_0000000e);
(layer->_color)._tint[0] = 1.0;
(layer->_color)._tint[1] = 0.5568628;
(layer->_color)._tint[2] = 0.4666667;
(layer->_color)._tint[3] = 1.0;
}
else {
layer = (GHIDRA_CAST<ANM2 *>((versusAnm2)))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x2));
(GHIDRA_CAST<LayerState *>((layer)))->LayerState::GetTexture(&portraitTexture);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x14;
(**(code **)(*portraitTexture + 0x30))(0,0,2,1,&local_2c);
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
(layer->_color)._tint[3] = 1.0;
(layer->_color)._tint[0] = (float)local_2c * 0.003921569;
(layer->_color)._tint[1] = (float)pixelGreen * 0.003921569;
(layer->_color)._tint[2] = (float)pixelBlue * 0.003921569;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(&DAT_0000000d);
(layer->_color)._tint[3] = 1.0;
(layer->_color)._tint[0] = (float)((GHIDRA_UINT(local_28) & 0xff) * 2) * 0.003921569;
(layer->_color)._tint[1] = (float)((GHIDRA_UINT(local_28) >> 8 & 0xff) * 2) * 0.003921569;
(layer->_color)._tint[2] = (float)((GHIDRA_UINT(local_28) >> 0x10 & 0xff) * 2) * 0.003921569;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(&DAT_0000000e);
(layer->_color)._tint[0] = (float)((GHIDRA_UINT(local_28) & 0xff) * 2) * 0.003921569;
(layer->_color)._tint[1] = (float)((GHIDRA_UINT(local_28) >> 8 & 0xff) * 2) * 0.003921569;
(layer->_color)._tint[2] = (float)((GHIDRA_UINT(local_28) >> 0x10 & 0xff) * 2) * 0.003921569;
(layer->_color)._tint[3] = 1.0;
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x15;
if (((local_70 != GHIDRA_CAST<std_string *>(0x0)) &&
(cVar2 = (**(code **)(GHIDRA_INT(*(void **))local_70->_buf + 0xc))(), cVar2 != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&portraitTexture);
}
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
versusSprite = GHIDRA_CAST<Sprite *>((pGVar17->_roomList[0]._doors + 2));
}
if (bossID1 == 0x37) {
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
(layer->_color)._tint[0] = 0.0;
(layer->_color)._tint[1] = 0.0;
(layer->_color)._tint[2] = 0.0;
goto LAB_0083077d;
}
}
else {
LAB_0083066a:
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::LoadGraphics(SUB41(fVar13,0));
if (bossID1 != 99) goto LAB_0083041c;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>(0x0));
(layer->_color)._tint[0] = 1.0;
(layer->_color)._tint[1] = 1.0;
(layer->_color)._tint[2] = 1.0;
(layer->_color)._tint[3] = 1.0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_0000000d);
(layer->_color)._tint[0] = 1.0;
(layer->_color)._tint[1] = 1.0;
(layer->_color)._tint[2] = 1.0;
(layer->_color)._tint[3] = 1.0;
layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::GetLayer(&DAT_0000000e);
(layer->_color)._tint[0] = 1.0;
(layer->_color)._tint[1] = 1.0;
(layer->_color)._tint[2] = 1.0;
LAB_0083077d:
(layer->_color)._tint[3] = 1.0;
}
roomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(pGVar17->_roomList[0].GridIndex,-1);
local_28 = GHIDRA_CAST<Game *>(&roomDesc->Data);
pvVar10 = *(void **)local_28;
if (pvVar10 == (void *)0x0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("Room Data is NULL in RoomTransition::change_room.\n"));
pvVar10 = (void *)local_28->_stage;
}
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + 8)) == 5) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + 0xc)) - 0xe74U < 0x96)) {
tmpString._size = 0;
tmpString._capacity = GHIDRA_UINT(&DAT_0000000f);
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = GHIDRA_CAST<byte *>(0x0);
(GHIDRA_CAST<std::string *>((tmpString._buf)))->std::string::assign(GHIDRA_CAST<byte *>("gfx/ui/boss/doubletrouble.png"),0x1d);
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x16;
(GHIDRA_CAST<Sprite *>((versusSprite)))->Sprite::ReplaceSpritesheet(10,&tmpString);
local_14 = (*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
bVar1 = extraout_CL;
if (&DAT_0000000f < tmpString._capacity) {
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 1));
pbVar15 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<byte *>(tmpString._buf))) + 0x0)));
if (GHIDRA_CAST<undefined1 *>(0xfff) < texture) {
pbVar15 = *GHIDRA_CAST<byte **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xfffffffc));
texture = GHIDRA_CAST<undefined1 *>((tmpString._capacity + 0x24));
if (GHIDRA_CAST<byte *>(0x1f) < GHIDRA_CAST<byte *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911;
}
operator_delete(pbVar15,GHIDRA_UINT(texture));
bVar1 = extraout_CL_00;
}
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::LoadGraphics(bVar1);
if ((g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) ||
(uVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::count_main_players(), uVar3 < 2)) {
pcVar20 = "DoubleTrouble";
goto LAB_008308ce;
}
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::Play(GHIDRA_CAST<byte *>("DoubleTroubleCoop"),1);
}
else if ((g_manager->_netplayManager == *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) ||
(uVar3 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::count_main_players(), uVar3 < 2)) {
pcVar20 = "Scene";
LAB_008308ce:
bVar1 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>(pcVar20),1);
if (bVar1 != 0) {
(GHIDRA_CAST<AnimationState *>((&versusSprite->_animState)))->AnimationState::Rewind();
(versusSprite->_animState)._isPlaying = 1;
}
}
else {
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(versusSprite))))->ANM2::Play(GHIDRA_CAST<byte *>("SceneCoop"),1);
}
pGVar17->_stage = 2;
if (GHIDRA_CAST<Game *>(&DAT_0000000f) < anm2Path._capacity) {
ppvVar16 = (void **)(GHIDRA_INT(GHIDRA_CAST<int *>(anm2Path._capacity)) + 1);
psVar4 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(anm2Path._buf))) + 0x0)));
if ((void **)0xfff < ppvVar16) {
psVar4 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -0x18)))->_capacity);
ppvVar16 = &(GHIDRA_CAST<RoomDescriptor *>((anm2Path._capacity + 0x14)))->Data;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar4))))) {
LAB_00830911:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(psVar4,GHIDRA_UINT(ppvVar16));
}
ExceptionList = local_1c;
return;
}
// 00830950
void RoomTransition::ChangeRoom()
{
qword qVar1;
byte isAnimSet;
RoomDescriptor *currentRoomDesc;
uint uVar2;
int iVar3;
float *pfVar4;
uint randomValue;
undefined4 *puVar5;
void *pvVar6;
int iVar7;
float fVar8;
qword *allocCounter;
Game *game;
PlayerManager *playerManager;
float *playerIt;
float player;
Entity_Player *pEVar9;
int *piVar10;
EntityList_EL familiars;
undefined8 local_5c;
float local_54;
Vector local_50;
Vector local_48;
ANM2 *local_40;
float local_3c;
RoomDescriptor *local_38;
RoomTransition *transition;
Entity_Player *local_30;
int *local_2c;
float local_28;
float local_24;
undefined1 *puStack_20;
void *local_1c;
undefined1 *puStack_18;
undefined4 local_14;
ANM2 *playerSprite;
Room *room;
int roomWidth;
GridEntity *teleporter;
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
local_14 = 0xffffffff;
puStack_18 = &LAB_00b02130;
local_1c = ExceptionList;
ExceptionList = &local_1c;
local_24 = g_vectorZero.x;
local_3c = (float)g_game->_currentRoomIdx;
local_28 = g_vectorZero.y;
transition = this;
currentRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(GHIDRA_INT(local_3c),g_game->_currentDimensionIdx);
local_38 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,this->_targetDimension);
if (((this->_targetRoomIdx < 0) || (GHIDRA_INT(local_3c) < 0)) ||
(currentRoomDesc->Dimension != local_38->Dimension)) {
switch(this->_direction) {
case 0:
local_24 = -(float)*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_38->Data) + 0x46)) * 26.0;
break;
case 1:
local_28 = -(float)*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(local_38->Data) + 0x47)) * 26.0;
break;
case 2:
local_24 = (float)*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(currentRoomDesc->Data) + 0x46)) * 26.0;
break;
case 3:
local_28 = (float)*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(currentRoomDesc->Data) + 0x47)) * 26.0;
}
}
else {
local_3c = (float)(currentRoomDesc->GridIndex % 0xd);
local_24 = (float)((local_38->GridIndex % 0xd - GHIDRA_INT(local_3c)) * 0xd) * 26.0;
local_28 = (float)((local_38->GridIndex / 0xd - currentRoomDesc->GridIndex / 0xd) * 7) * 26.0;
this = transition;
}
if (((g_game->_currentDimensionIdx == 1) &&
((g_game->_stageType == 4 || (g_game->_stageType == 5)))) &&
((g_game->_stage == 2 ||
((g_game->_stage == 1 && (uVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetCurses(), (uVar2 & 2) != 0)))))) {
local_24 = local_24 * -1.0;
}
game = g_game;
local_2c = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(g_game->_room) + 0x1204));
local_30 = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(g_game->_room) + 0x1208));
if ((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) &&
(piVar10 = (g_game->_playerManager)._playerList._begin,
piVar10 != (g_game->_playerManager)._playerList._end)) {
do {
iVar7 = *piVar10;
piVar10 = piVar10 + 1;
*GHIDRA_CAST<undefined1 *>((iVar7 + 0x410)) = 1;
} while (piVar10 != (game->_playerManager)._playerList._end);
}
if (this->_animation == 0xc) {
Game::rewind((game->_playerManager)._roomTransitionPlayer);
}
else {
if (this->_direction == -1) {
game->_leaveDoor = -1;
}
(GHIDRA_CAST<Game *>((game)))->Game::ChangeRoom(this->_targetRoomIdx,this->_targetDimension);
}
game = g_game;
piVar10 = (g_game->_playerManager)._playerList._begin;
if (piVar10 != (g_game->_playerManager)._playerList._end) {
do {
iVar7 = *piVar10;
piVar10 = piVar10 + 1;
*GHIDRA_CAST<undefined1 *>((iVar7 + 0x410)) = 0;
} while (piVar10 != (game->_playerManager)._playerList._end);
}
local_38 = *GHIDRA_CAST<RoomDescriptor **>((GHIDRA_CAST<char *>(game->_room) + 0x1204));
local_3c = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(game->_room) + 0x1208));
if (this->_animation != 0) goto switchD_00830c6b_default;
if ((game->_currentDimensionIdx == 1) && ((game->_stageType == 4 || (game->_stageType == 5)))) {
if (game->_stage != 2) {
if (game->_stage == 1) {
uVar2 = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(game))))->Level::GetCurses();
game = g_game;
if ((uVar2 & 2) != 0) goto LAB_00830c5f;
}
goto LAB_00830cb4;
}
LAB_00830c5f:
switch(this->_direction) {
case 0:
(this->_slideOffset).x = (((float)local_2c - (float)local_38) - g_screenWidth) - local_24;
break;
case 1:
goto switchD_00830c6b_caseD_1;
case 2:
(this->_slideOffset).x = (((float)local_38 - (float)local_2c) - g_screenWidth) + local_24;
break;
case 3:
goto switchD_00830c6b_caseD_3;
}
}
else {
LAB_00830cb4:
switch(this->_direction) {
case 0:
(this->_slideOffset).x = (((float)local_38 - (float)local_2c) - g_screenWidth) - local_24;
break;
case 1:
switchD_00830c6b_caseD_1:
(this->_slideOffset).y = ((local_3c - (float)local_30) - g_screenHeight) - local_28;
break;
case 2:
(this->_slideOffset).x = (((float)local_2c - (float)local_38) - g_screenWidth) + local_24;
break;
case 3:
switchD_00830c6b_caseD_3:
(this->_slideOffset).y = (((float)local_30 - local_3c) - g_screenHeight) + local_28;
}
}
switchD_00830c6b_default:
local_30 = (game->_playerManager)._roomTransitionPlayer;
if (local_30 == GHIDRA_CAST<Entity_Player *>(0x0)) {
local_30 = (GHIDRA_CAST<Game *>((game)))->Game::GetPlayer(0);
game = g_game;
}
room = game->_room;
local_38 = GHIDRA_CAST<RoomDescriptor *>(room->_bossId);
local_3c = (float)room->_secondBossID;
if (local_38 == GHIDRA_CAST<RoomDescriptor *>(0x0)) {
LAB_00830d9d:
piVar10 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(room->_descriptor) + 0x10));
if ((((*piVar10 == 0x23) && (piVar10[2] == 1)) && (piVar10[3] == 1000)) &&
((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(room->_descriptor) + 0x44)) & 1) == 0)) {
StartBossIntro(this,99,0);
goto LAB_00830dda;
}
if (*GHIDRA_CAST<int *>(&game->_deathmatchManager) < 2) {
(GHIDRA_CAST<Room *>((room)))->Room::PlayMusic();
goto LAB_00830dda;
}
}
else {
iVar3 = room->_aliveBossCount + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((room)) + 0x12cc))));
iVar7 = 0;
if (0 < iVar3) {
iVar7 = iVar3;
}
if (iVar7 < 1) goto LAB_00830d9d;
StartBossIntro(this,GHIDRA_UINT(local_38),GHIDRA_UINT(local_3c));
LAB_00830dda:
game = g_game;
}
iVar7 = this->_animation;
if (((iVar7 == 3) || (iVar7 == 0xc)) || (iVar7 == 0xd)) {
LAB_00830e96:
if (iVar7 != 0xb) {
if (iVar7 == 0x11) {
puVar5 = (game->_playerManager)._playerList._begin;
if (puVar5 != (game->_playerManager)._playerList._end) {
do {
pEVar9 = GHIDRA_CAST<Entity_Player *>(*puVar5);
if ((pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
((game->_playerManager)._roomTransitionPlayer == pEVar9)) {
Entity_Player::Teleport(pEVar9,&pEVar9->_forgottenBodyPos,0,0);
game = g_game;
}
puVar5 = puVar5 + 1;
} while (puVar5 != (game->_playerManager)._playerList._end);
}
}
else if (iVar7 == 0x14) {
if (game->_currentDimensionIdx == 2) {
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
if ((iVar7 < 0xb) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0x10)) < 5)) {
iVar3 = -1;
}
else {
iVar3 = iVar7 * 4 + 10;
}
fVar8 = 0.0;
playerIt = (g_game->_playerManager)._playerList._begin;
pEVar9 = GHIDRA_CAST<Entity_Player *>(((float)(iVar3 % iVar7) * 40.0 + 40.0));
piVar10 = GHIDRA_CAST<int *>(((float)(iVar3 / iVar7) * 40.0 + 120.0));
game = g_game;
local_30 = pEVar9;
local_2c = piVar10;
if (playerIt != (g_game->_playerManager)._playerList._end) {
do {
local_50.y = *playerIt;
if (GHIDRA_CAST<Entity_Player *>(local_50.y) != GHIDRA_CAST<Entity_Player *>(0x0)) {
local_48.y = (float)(GHIDRA_INT(fVar8) + 1);
if (fVar8 != 0.0) {
uVar2 = Random();
fVar8 = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]
) * 2.3283064e-10 * 3.14;
fVar8 = fVar8 + fVar8;
local_5c = CONCAT44(fVar8,(undefined4)local_5c);
local_54 = sin(fVar8);
fVar8 = cos((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_5c)) + 0x4))));
pEVar9 = GHIDRA_CAST<Entity_Player *>((fVar8 * 10.0 + (float)local_30));
piVar10 = GHIDRA_CAST<int *>((local_54 * 10.0 + (float)local_2c));
}
fVar8 = local_50.y;
(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_50.y) + 0x33c)))->x = (float)pEVar9;
(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_50.y) + 0x33c)))->y = (float)piVar10;
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(local_50.y))))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<byte *>("Appear"));
if (((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar8) + 0x48)))->_animState)._animData != (void *)0x0) {
(GHIDRA_CAST<AnimationState *>((&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar8) + 0x48)))->_animState)))->AnimationState::SetFrameFloat(2.0);
}
*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(fVar8) + 0x410)) = 0;
fVar8 = local_48.y;
game = g_game;
piVar10 = local_2c;
pEVar9 = local_30;
}
playerIt = playerIt + 1;
} while (playerIt != (game->_playerManager)._playerList._end);
}
EntityList::QuerySublist
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),&familiars,3,0xee,-1,0,0);
fVar8 = 0.0;
if ((float)familiars._size != 0.0) {
do {
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(familiars._data) + GHIDRA_INT(fVar8) * 4));
fVar8 = (float)(GHIDRA_INT(fVar8) + 1);
*GHIDRA_CAST<Entity_Player **>((iVar7 + 0x33c)) = local_30;
*GHIDRA_CAST<int **>((iVar7 + 0x340)) = local_2c;
} while (GHIDRA_UINT(fVar8) < GHIDRA_UINT(familiars._size));
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (familiars._data != (void *)0x0) {
uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(familiars._data) + -4));
qVar1 = *allocCounter;
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar2));
free((void *)(GHIDRA_INT(familiars._data) + -4));
}
LAB_00831623:
local_14 = 0xffffffff;
}
}
else {
puVar5 = (game->_playerManager)._playerList._begin;
if (puVar5 != (game->_playerManager)._playerList._end) {
do {
pEVar9 = GHIDRA_CAST<Entity_Player *>(*puVar5);
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
(GHIDRA_CAST<Entity_Player *>((pEVar9)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<byte *>("Appear"));
if ((pEVar9->_sprite)._animState._animData != (void *)0x0) {
(GHIDRA_CAST<AnimationState *>((&(pEVar9->_sprite)._animState)))->AnimationState::SetFrameFloat(2.0);
}
game = g_game;
pEVar9->_isControlsEnabled = 0;
}
puVar5 = puVar5 + 1;
} while (puVar5 != (game->_playerManager)._playerList._end);
}
}
}
else if ((iVar7 == 3) && (0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))))) {
pvVar6 = game->_room;
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 8)) == 0x19) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 8)) == 0x1a)) {
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x20)))) + -1;
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0x10)) * *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar6) + 0xc));
uVar2 = 0;
if (0 < iVar3) {
puVar5 = GHIDRA_CAST<undefined4 *>((GHIDRA_INT(pvVar6) + 0x24));
LAB_00831497:
if ((((0x1bf < uVar2) ||
(teleporter = GHIDRA_CAST<GridEntity *>(*puVar5), teleporter == GHIDRA_CAST<GridEntity *>(0x0))) ||
((teleporter->_desc)._type != 0x17)) ||
((-1 < iVar7 && ((teleporter->_desc)._variant != iVar7)))) goto LAB_008314b3;
(GHIDRA_CAST<GridEntity *>((teleporter)))->GridEntity::Position(&local_50);
Entity_Player::Teleport(local_30,&local_50,0,0);
if ((teleporter->_desc)._state == 0) {
(teleporter->_desc)._state = 1;
}
uVar2 = 0;
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
do {
pEVar9 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(uVar2);
if (pEVar9 != local_30) {
randomValue = Random();
fVar8 = (float)((double)GHIDRA_INT(randomValue) +
__uint_to_double_fixup[-(GHIDRA_INT(randomValue) >> 0x1f)]) *
2.3283064e-10 * 3.14;
fVar8 = fVar8 + fVar8;
local_5c = CONCAT44(fVar8,(undefined4)local_5c);
local_54 = sin(fVar8);
fVar8 = cos((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_5c)) + 0x4))));
local_48.x = fVar8 * 10.0 + local_50.x;
local_48.y = local_54 * 10.0 + local_50.y;
Entity_Player::Teleport(pEVar9,&local_48,0,0);
}
uVar2 = uVar2 + 1;
} while (uVar2 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2)));
}
EntityList::QuerySublist
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,0xee,-1,0,0);
fVar8 = 0.0;
if ((float)familiars._size != 0.0) {
do {
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(familiars._data) + GHIDRA_INT(fVar8) * 4));
fVar8 = (float)(GHIDRA_INT(fVar8) + 1);
*GHIDRA_CAST<float *>((iVar7 + 0x33c)) = local_50.x;
*GHIDRA_CAST<float *>((iVar7 + 0x340)) = local_50.y;
} while (GHIDRA_UINT(fVar8) < GHIDRA_UINT(familiars._size));
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) != '\0') goto LAB_0083162a;
local_14 = 2;
tracked_alloc(1,familiars._data,0);
goto LAB_00831623;
}
}
}
goto LAB_0083162a;
}
}
else if (iVar7 != 0xb) {
playerManager = &game->_playerManager;
uVar2 = 0;
if (GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2
== 0) {
this = transition;
}
else {
do {
pvVar6 = (playerManager->_playerList)._end;
if (GHIDRA_INT(pvVar6) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
pvVar6 = (playerManager->_playerList)._end;
game = g_game;
}
piVar10 = (playerManager->_playerList)._begin;
if (uVar2 < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(piVar10) >> 2))) {
piVar10 = piVar10 + uVar2;
}
iVar7 = *piVar10;
if ((*GHIDRA_CAST<int *>((iVar7 + 0x2c)) == 0) && ((*GHIDRA_CAST<uint *>((iVar7 + 0x16c)) & 0x2000000) == 0)) {
*GHIDRA_CAST<undefined1 *>((iVar7 + 0x171)) = 1;
}
playerManager = &game->_playerManager;
uVar2 = uVar2 + 1;
} while (uVar2 < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) -
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
iVar7 = transition->_animation;
this = transition;
}
goto LAB_00830e96;
}
local_28 = 2.3283064e-10;
local_24 = 3.14;
local_38 = GHIDRA_CAST<RoomDescriptor *>(0x18378);
local_5c = CONCAT44(free_exref,(undefined4)local_5c);
local_50.y = 2.0;
do {
local_2c = GHIDRA_CAST<int *>((GHIDRA_INT(game->_roomList[0]._doors) + (GHIDRA_INT(local_38) - 0x30U)));
if (*local_2c == game->_currentRoomIdx) {
playerIt = (game->_playerManager)._playerList._begin;
fVar8 = 0.0;
if (playerIt != (game->_playerManager)._playerList._end) {
do {
player = *playerIt;
local_48.y = player;
if (player != 0.0) {
local_54 = (float)(GHIDRA_INT(fVar8) + 1);
iVar7 = local_2c[1];
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
if (fVar8 == 0.0) {
fVar8 = (float)(iVar7 % iVar3) * 40.0 + 40.0;
pEVar9 = GHIDRA_CAST<Entity_Player *>(((float)(iVar7 / iVar3) * 40.0 + 120.0));
}
else {
local_40 = GHIDRA_CAST<ANM2 *>(((float)(iVar7 % iVar3) * 40.0 + 40.0));
local_30 = GHIDRA_CAST<Entity_Player *>(((float)(iVar7 / iVar3) * 40.0 + 120.0));
uVar2 = Random();
local_3c = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)])
* local_28 * local_24;
local_3c = local_3c + local_3c;
fVar8 = sin(local_3c);
local_30 = GHIDRA_CAST<Entity_Player *>(((float)local_30 + fVar8));
fVar8 = cos(local_3c);
fVar8 = fVar8 + (float)local_40;
pEVar9 = local_30;
}
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x33c)) = fVar8;
*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(player) + 0x340)) = pEVar9;
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(player) + 0x139a)) = 0;
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(player) + 0x41c)))))->ANM2::Reset();
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(player) + 0x14c)) = 0x3f800000;
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(player) + 0x98)))))->AnimationState::SetAnimationData((void *)0x0);
local_40 = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(player) + 0x48));
isAnimSet = (GHIDRA_CAST<ANM2 *>((local_40)))->ANM2::SetAnimation(s_Jump,1);
playerSprite = local_40;
if (isAnimSet != 0) {
(GHIDRA_CAST<AnimationState *>((&local_40->_animState)))->AnimationState::Rewind();
(playerSprite->_animState)._isPlaying = 1;
player = local_48.y;
}
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(player) + 0x1398)) = 1;
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(player) + 0x139a)) = 0;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x7c)) != 0) {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(player) + 0x78)))))->AnimationState::SetFrameFloat(local_50.y);
}
game = g_game;
pfVar4 = &local_48.y;
if (0x22 < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(player) + 0x13bc))) {
pfVar4 = GHIDRA_CAST<float *>((GHIDRA_INT(player) + 0x13bc));
}
local_48.y = 4.90454e-44;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(player) + 0x13bc)) = *pfVar4;
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(player) + 0x410)) = 0;
fVar8 = local_54;
}
playerIt = playerIt + 1;
} while (playerIt != (game->_playerManager)._playerList._end);
}
EntityList::QuerySublist(GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)),&familiars,3,0xee,-1,0,0);
game = g_game;
local_3c = 0.0;
if ((float)familiars._size != 0.0) {
do {
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(familiars._data) + GHIDRA_INT(local_3c) * 4));
iVar3 = local_2c[1];
roomWidth = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(game->_room) + 0xc));
local_3c = (float)(GHIDRA_INT(local_3c) + 1);
*GHIDRA_CAST<float *>((iVar7 + 0x33c)) = (float)(iVar3 % roomWidth) * 40.0 + 40.0;
*GHIDRA_CAST<float *>((iVar7 + 0x340)) = (float)(iVar3 / roomWidth) * 40.0 + 120.0;
} while (GHIDRA_UINT(local_3c) < GHIDRA_UINT(familiars._size));
}
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
if (g_mainHeap == (void *)0x0) {
allocCounter = &g_allocatedBytesNoHeap;
}
else {
allocCounter = GHIDRA_CAST<qword *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
if (familiars._data != (void *)0x0) {
uVar2 = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(familiars._data) + -4));
qVar1 = *allocCounter;
*GHIDRA_CAST<uint *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar2;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar2));
(*(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_5c)) + 0x4))))(GHIDRA_CAST<uint *>((GHIDRA_INT(familiars._data) + -4)));
}
local_14 = 0xffffffff;
}
game = g_game;
}
local_38 = GHIDRA_CAST<RoomDescriptor *>((GHIDRA_INT(local_38) + 0xc));
} while (GHIDRA_INT(local_38) < 0x18390);
LAB_0083162a:
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::render_lighting();
local_5c = 0;
std::vector::resize(&local_5c);
puVar5 = std::deque::back();
if (GHIDRA_CAST<byte *>((puVar5 + 1)) != GHIDRA_CAST<byte *>(0x0)) {
*GHIDRA_CAST<byte *>((puVar5 + 1)) = (byte)(g_graphicsManager_flags >> 5) & 1;
}
*puVar5 = g_graphicsManager_renderTarget;
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(*(void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((transition)) + 0x30))),1);
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
g_graphicsManager_blendMode[1] = 1;
g_graphicsManager_blendMode[0] = 0;
if ((g_graphicsManager_flags & 4) == 0) {
g_graphicsManager_blendMode[1] = 6;
}
g_graphicsManager_blendMode[2] = 7;
g_graphicsManager_blendMode[3] = 1;
g_graphicsManager_blendMode[4] = 7;
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::Render();
_glfw_context_reset(1);
if (g_renderTargetStackSize == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("PopRenderTarget: stack is empty!\n"));
}
puVar5 = std::deque::back();
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget((void *)*puVar5,*GHIDRA_CAST<byte *>((puVar5 + 1)));
g_renderTargetStackSize = g_renderTargetStackSize - 1;
if (g_renderTargetStackSize == 0) {
DAT_00c7978c = 0;
}
ExceptionList = local_1c;
return;
LAB_008314b3:
uVar2 = uVar2 + 1;
puVar5 = puVar5 + 1;
if (iVar3 <= GHIDRA_INT(uVar2)) goto LAB_0083162a;
goto LAB_00831497;
}
// 008318a0
void RoomTransition::Update()
{
float fVar1;
float fVar2;
char cVar3;
byte bVar4;
std_string *psVar5;
Vector *tmpVec;
undefined4 uVar6;
int *parentNode;
undefined4 *puVar8;
Entity_Player *pEVar9;
int iVar10;
uint uVar11;
EntityPtr EVar12;
int iVar13;
int *piVar14;
uint uVar15;
float randomScale;
double dVar16;
Entity_Player *idlePlayer;
Vector local_68;
std_string *local_60;
byte local_59;
Vector local_58;
Entity_Player *local_50;
EntityPtr local_4c;
char local_45;
std_string animName;
EntityPtr animSuffix [4];
int animSuffixSize;
uint animSuffixCapacity;
uint local_14;
void *local_10;
undefined1 *puStack_c;
EntityPtr local_8;
void *animData;
Game *game;
Manager *manager;
EntityPtr minecart;
int *parentNode;
manager = g_manager;
local_8 = (EntityPtr)0xffffffff;
puStack_c = &LAB_00b02165;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT((animSuffix + 10));
ExceptionList = &local_10;
local_50 = GHIDRA_CAST<Entity_Player *>(0x0);
local_4c = (EntityPtr)0x0;
pEVar9 = (g_game->_playerManager)._roomTransitionPlayer;
EVar12 = this->_minecart;
if (((EVar12 != (EntityPtr)0x0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x28)) == 0x3c5)) &&
(local_4c = (EntityPtr)0x0, *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(EVar12) + 0x2c)) == 10)) {
local_4c = EVar12;
}
local_58.y = (float)pEVar9;
switch(*GHIDRA_CAST<undefined4 *>(this)) {
case 1:
local_45 = '\x01';
idlePlayer = GHIDRA_CAST<Entity_Player *>(0x0);
local_50 = GHIDRA_CAST<Entity_Player *>(0x0);
local_60 = GHIDRA_CAST<std_string *>(0x3e8);
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)))))->EntityList::Update(1);
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::update_ambient_sounds();
iVar13 = this->_animation;
if (iVar13 == 0x13) {
uVar15 = 0;
uVar11 = 0x724;
do {
uVar15 = uVar15 + 1;
if ((uVar15 < 9) && (parentNode = *GHIDRA_CAST<int **>((uVar11 + GHIDRA_INT(g_game->_room))), parentNode != GHIDRA_CAST<int *>(0x0)))
{
(**(code **)(*parentNode + 8))();
}
uVar11 = uVar11 + 4;
} while (uVar11 < 0x744);
iVar13 = this->_animation;
}
puVar8 = (g_game->_playerManager)._playerList._begin;
if (puVar8 != (g_game->_playerManager)._playerList._end) {
do {
pEVar9 = GHIDRA_CAST<Entity_Player *>(*puVar8);
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
if (pEVar9->_dead == 0) {
if (((pEVar9->_isPlayingExtraAnimation == 0) && (pEVar9->_isPlayingItemAnimation == 0))
|| ((animData = (pEVar9->_sprite)._animState._animData, animData != (void *)0x0 &&
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(animData) + 0x34)) != '\0')))) {
if ((idlePlayer == GHIDRA_CAST<Entity_Player *>(0x0)) && (pEVar9->_visible != 0)) {
idlePlayer = pEVar9;
}
if (this->_animation == 0x13) {
pEVar9->Update();
}
}
else {
if (this->_animation == 0) {
pEVar9->_isPlayingExtraAnimation = 0;
pEVar9->_isPlayingItemAnimation = 0;
}
pEVar9->Update();
if ((pEVar9->_itemState != 0) && (pEVar9->_itemState != 0x25c)) {
(GHIDRA_CAST<Entity_Player *>((pEVar9)))->Entity_Player::ResetItemState();
}
iVar13 = this->_animation;
if (iVar13 == 0) {
pEVar9->_isPlayingExtraAnimation = 0;
pEVar9->_isPlayingItemAnimation = 0;
iVar13 = this->_animation;
}
if ((((iVar13 == 0x13) && (local_4c != (EntityPtr)0x0)) &&
((pEVar9->_sprite)._animState._animData != (void *)0x0)) &&
(bVar4 = AnimationState::IsEventTriggered
(&(pEVar9->_sprite)._animState,&DAT_00b1d534), bVar4 != 0)) {
(GHIDRA_CAST<Entity_Player *>((pEVar9)))->Entity_Player::AttachMinecart(GHIDRA_CAST<Entity_NPC *>(local_4c));
pEVar9->_visible = 0;
}
if (((pEVar9->_isPlayingExtraAnimation == 0) && (pEVar9->_isPlayingItemAnimation == 0)
) || (pEVar9->_pitfallState == 4)) {
pEVar9->_visible = 0;
}
else {
if ((pEVar9->_sprite)._animState._animData == (void *)0x0) {
psVar5 = GHIDRA_CAST<std_string *>(0xffffffff);
}
else {
fVar1 = (pEVar9->_sprite)._animState._animFrame;
local_68.y = fVar1;
dVar16 = floor((double)fVar1);
local_68.y = (float)dVar16;
psVar5 = GHIDRA_CAST<std_string *>(GHIDRA_INT(dVar16));
}
local_45 = '\0';
if (GHIDRA_INT(local_60) <= GHIDRA_INT(psVar5)) {
psVar5 = local_60;
pEVar9 = local_50;
}
local_50 = pEVar9;
local_60 = psVar5;
}
}
}
else {
pEVar9->Update();
}
}
puVar8 = puVar8 + 1;
} while (puVar8 != (g_game->_playerManager)._playerList._end);
iVar13 = this->_animation;
}
pEVar9 = local_50;
if ((((iVar13 == 0xb) || (iVar13 == 0x10)) || (iVar13 == 0x13)) &&
(((local_50 != GHIDRA_CAST<Entity_Player *>(0x0) && (idlePlayer != GHIDRA_CAST<Entity_Player *>(0x0))) &&
(5 < GHIDRA_INT(local_60))))) {
psVar5 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>(&(local_50->_sprite)._animState))))->ANM2::GetAnimation(&animName);
local_8 = (EntityPtr)0x0;
if (0xf < psVar5->_capacity) {
psVar5 = *GHIDRA_CAST<std_string **>(psVar5->_buf);
}
(GHIDRA_CAST<Entity_Player *>((idlePlayer)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<byte *>(psVar5));
local_8 = (EntityPtr)0xffffffff;
if (0xf < animName._capacity) {
uVar11 = animName._capacity + 1;
psVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
if (0xfff < uVar11) {
psVar5 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) + -0x18)))->_capacity);
uVar11 = animName._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar5))))) {
LAB_00831b99:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(psVar5,uVar11);
}
fVar1 = (pEVar9->_moveToTarget).y;
(idlePlayer->_moveToTarget).x = (pEVar9->_moveToTarget).x;
(idlePlayer->_moveToTarget).y = fVar1;
iVar13 = this->_animation;
animName._size = 0;
animName._capacity = 0xf;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) & 0xffffff00;
if ((iVar13 == 0x13) && (local_4c != (EntityPtr)0x0)) {
tmpVec = MusicManager::RandomVector(&local_68);
uVar11 = Random();
randomScale = (float)((double)GHIDRA_INT(uVar11) + __uint_to_double_fixup[-(GHIDRA_INT(uVar11) >> 0x1f)])
* 2.3283064e-10;
fVar1 = tmpVec->x;
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_4c) + 0x334));
(idlePlayer->_moveToTarget).y =
randomScale * tmpVec->y * 8.0 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_4c) + 0x338));
(idlePlayer->_moveToTarget).x = randomScale * fVar1 * 8.0 + fVar2;
iVar13 = this->_animation;
}
LAB_00831c6a:
if (iVar13 != 0x15) break;
}
else if (local_45 == '\0') goto LAB_00831c6a;
EVar12 = local_4c;
game = g_game;
if (iVar13 == 0x13) {
minecart = this->_minecart;
if (((minecart == (EntityPtr)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(minecart) + 0x28)) != 0x3c5)) ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(minecart) + 0x2c)) != 10)) goto LAB_00831dc6;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_4c) + 0xb64)) != 4) {
iVar13 = 1;
*GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_4c) + 0x16c)) = *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(local_4c) + 0x16c)) | 0x1000;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_4c) + 0x168)) = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_4c) + 0x168));
(GHIDRA_CAST<Room *>((game->_room)))->Room::GetGridIndex(GHIDRA_CAST<Vector *>((GHIDRA_INT(local_4c) + 0x334)));
uVar6 = FUN_004ce0f0();
switch(uVar6) {
case 7:
iVar13 = 2;
break;
case 8:
iVar13 = 0;
break;
case 9:
iVar13 = 3;
}
tmpVec = Isaac::GetAxisAlignedUnitVectorFromDir(&local_58,iVar13);
fVar1 = tmpVec->y;
fVar2 = tmpVec->x;
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(EVar12) + 0xb64)) = 4;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x364)) = fVar1 * 0.1;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x360)) = fVar2 * 0.1;
fVar1 = g_vectorZero.y;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x334)) = g_vectorZero.x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(EVar12) + 0x338)) = fVar1;
}
}
else if (((iVar13 == 0xb) || (iVar13 == 0x10)) &&
(this->_targetRoomIdx == g_game->_currentRoomIdx)) {
parentNode = (g_game->_playerManager)._playerList._begin;
if (parentNode != (g_game->_playerManager)._playerList._end) {
do {
iVar13 = *parentNode;
if (iVar13 != 0) {
*GHIDRA_CAST<undefined1 *>((iVar13 + 0x171)) = 0;
*GHIDRA_CAST<undefined1 *>((iVar13 + 0x410)) = 1;
}
parentNode = parentNode + 1;
} while (parentNode != (game->_playerManager)._playerList._end);
}
LAB_00831db4:
this->_frame = 0;
*GHIDRA_CAST<undefined4 *>(this) = 0;
}
else {
LAB_00831dc6:
this->_frame = 0;
game = g_game;
if ((((this->_direction != -1) || (iVar13 == 3)) ||
(((iVar13 == 0xc || ((iVar13 == 0xd || (iVar13 == 0xb)))) || (iVar13 == 0x10)))) &&
(puVar8 = (g_game->_playerManager)._playerList._begin,
puVar8 != (g_game->_playerManager)._playerList._end)) {
do {
pEVar9 = GHIDRA_CAST<Entity_Player *>(*puVar8);
if ((pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) &&
((((this->_animation != 0 && (this->_animation != 2)) || (this->_direction == -1)) ||
(pEVar9 == GHIDRA_CAST<Entity_Player *>(local_58.y))))) {
pEVar9->_visible = 0;
}
puVar8 = puVar8 + 1;
} while (puVar8 != (game->_playerManager)._playerList._end);
}
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::render_lighting();
local_68.x = 0.0;
local_68.y = 0.0;
std::vector::resize(&local_68);
puVar8 = std::deque::back();
if (GHIDRA_CAST<byte *>((puVar8 + 1)) != GHIDRA_CAST<byte *>(0x0)) {
*GHIDRA_CAST<byte *>((puVar8 + 1)) = (byte)(g_graphicsManager_flags >> 5) & 1;
}
*puVar8 = g_graphicsManager_renderTarget;
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(*(void **)&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x28))),1);
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
g_graphicsManager_blendMode[1] = 1;
g_graphicsManager_blendMode[0] = 0;
if ((g_graphicsManager_flags & 4) == 0) {
g_graphicsManager_blendMode[1] = 6;
}
g_graphicsManager_blendMode[2] = 7;
g_graphicsManager_blendMode[3] = 1;
g_graphicsManager_blendMode[4] = 7;
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::Render();
_glfw_context_reset();
if (g_renderTargetStackSize == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("PopRenderTarget: stack is empty!\n"));
}
puVar8 = std::deque::back();
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget((void *)*puVar8,*GHIDRA_CAST<byte *>((puVar8 + 1)));
g_renderTargetStackSize = g_renderTargetStackSize - 1;
if (g_renderTargetStackSize == 0) {
DAT_00c7978c = 0;
}
iVar13 = this->_animation;
if ((((iVar13 == 1) || (iVar13 == 2)) ||
((this->_direction == -1 || ((iVar13 == 0xb || (iVar13 == 0xf)))))) ||
((iVar13 == 0x10 ||
((((iVar13 == 0x11 || (iVar13 == 0x14)) || (iVar13 == 0x12)) ||
((iVar13 == 0x13 || (iVar13 == 0x15)))))))) {
*GHIDRA_CAST<undefined4 *>(this) = 2;
if ((iVar13 == 0xf) || (iVar13 == 0x15)) {
ChangeRoom(this);
}
}
else {
*GHIDRA_CAST<undefined4 *>(this) = 3;
ChangeRoom(this);
}
}
break;
case 2:
if (this->_bossIntroBossId == 0) {
iVar13 = this->_frame;
if (iVar13 < this->_duration) goto LAB_008320bd;
this->_frame = 0;
*GHIDRA_CAST<undefined4 *>(this) = 3;
ChangeRoom(this);
}
else {
(GHIDRA_CAST<ANM2 *>((&this->_versusScreenSprite)))->ANM2::Update();
parentNode = (this->_sprites)._head;
piVar14 = GHIDRA_CAST<int *>(*parentNode);
if (piVar14 != parentNode) {
do {
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar14) + 0x11d)) != '\0') {
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((piVar14 + 0x11)))))->AnimationState::Update();
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((piVar14 + 0x19)))))->AnimationState::Update();
}
parentNode = GHIDRA_CAST<int *>(piVar14[2]);
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(parentNode) + 0xd)) == '\0') {
cVar3 = *GHIDRA_CAST<char *>((*parentNode + 0xd));
piVar14 = parentNode;
parentNode = GHIDRA_CAST<int *>(*parentNode);
while (cVar3 == '\0') {
cVar3 = *GHIDRA_CAST<char *>((*parentNode + 0xd));
piVar14 = parentNode;
parentNode = GHIDRA_CAST<int *>(*parentNode);
}
}
else {
cVar3 = *GHIDRA_CAST<char *>((piVar14[1] + 0xd));
parentNode = GHIDRA_CAST<int *>(piVar14[1]);
parentNode = piVar14;
while ((piVar14 = parentNode, cVar3 == '\0' && (parentNode == GHIDRA_CAST<int *>(piVar14[2])))) {
cVar3 = *GHIDRA_CAST<char *>((piVar14[1] + 0xd));
parentNode = GHIDRA_CAST<int *>(piVar14[1]);
parentNode = piVar14;
}
}
} while (piVar14 != (this->_sprites)._head);
}
if (((this->_versusScreenSprite)._animState._animData == (void *)0x0) ||
((this->_versusScreenSprite)._animState._isPlaying == 0)) {
(GHIDRA_CAST<Room *>((g_game->_room)))->Room::PlayMusic();
game = g_game;
(g_game->_hud)._isVisible = 1;
this->_frame = this->_duration;
*GHIDRA_CAST<undefined4 *>(this) = 3;
parentNode = (game->_playerManager)._playerList._begin;
if (parentNode != (game->_playerManager)._playerList._end) {
do {
iVar13 = *parentNode;
if (iVar13 != 0) {
iVar10 = 10;
if (10 < *GHIDRA_CAST<int *>((iVar13 + 0x418))) {
iVar10 = *GHIDRA_CAST<int *>((iVar13 + 0x418));
}
*GHIDRA_CAST<int *>((iVar13 + 0x418)) = iVar10;
}
parentNode = parentNode + 1;
} while (parentNode != (game->_playerManager)._playerList._end);
}
}
}
break;
case 3:
iVar13 = this->_frame;
if (iVar13 < this->_duration) {
LAB_008320bd:
this->_frame = iVar13 + 1;
}
else {
FUN_00421260(local_14);
this->_frame = 0;
cVar3 = FUN_0082eb90();
manager = g_manager;
if (cVar3 == '\0') {
iVar13 = this->_animation;
if (iVar13 == 5) {
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::AnimateCollectible
(pEVar9,0xa1,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
}
LAB_008321d0:
*GHIDRA_CAST<undefined4 *>(this) = 4;
break;
}
if (iVar13 == 6) {
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::AnimateCollectible
(pEVar9,0x51,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
*GHIDRA_CAST<undefined4 *>(this) = 4;
break;
}
goto LAB_008321d0;
}
if (iVar13 == 7) {
local_58.y = 1.4013e-45;
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_58.y));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_58.y),1.0,2,0,1.0,0.0);
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::AnimateCollectible
(pEVar9,0xb,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
*GHIDRA_CAST<undefined4 *>(this) = 4;
break;
}
goto LAB_008321d0;
}
if (iVar13 == 8) {
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::AnimateCollectible
(pEVar9,0xd4,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
*GHIDRA_CAST<undefined4 *>(this) = 4;
break;
}
goto LAB_008321d0;
}
if (iVar13 == 9) {
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::AnimateCollectible
(pEVar9,0x137,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
*GHIDRA_CAST<undefined4 *>(this) = 4;
break;
}
goto LAB_008321d0;
}
if (iVar13 == 10) {
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::AnimateCollectible
(pEVar9,0x14c,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
*GHIDRA_CAST<undefined4 *>(this) = 4;
break;
}
goto LAB_008321d0;
}
if (iVar13 == 0xe) {
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
Entity_Player::AnimateTrinket
(pEVar9,0x17,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"));
*GHIDRA_CAST<undefined4 *>(this) = 4;
break;
}
goto LAB_008321d0;
}
if (((iVar13 == 1) || (iVar13 == 2)) || (iVar13 == 0x12)) goto LAB_008321d0;
if (((iVar13 != 0xb) && (iVar13 != 0x10)) && ((iVar13 != 0x11 && (iVar13 != 0x13)))) {
if (iVar13 == 0x14) goto LAB_008321d0;
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)))))->EntityList::Update(1);
parentNode = (g_game->_playerManager)._playerList._begin;
if (parentNode == (g_game->_playerManager)._playerList._end) goto LAB_00831db4;
do {
piVar14 = GHIDRA_CAST<int *>(*parentNode);
if (piVar14 != GHIDRA_CAST<int *>(0x0)) {
if (*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2) {
*GHIDRA_CAST<undefined1 *>((piVar14 + 0x104)) = 1;
}
(**(code **)(*piVar14 + 0xc))();
}
parentNode = parentNode + 1;
} while (parentNode != (g_game->_playerManager)._playerList._end);
this->_frame = 0;
*GHIDRA_CAST<undefined4 *>(this) = 0;
break;
}
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)))))->EntityList::Update(1);
parentNode = (g_game->_playerManager)._playerList._begin;
if (parentNode != (g_game->_playerManager)._playerList._end) {
do {
piVar14 = GHIDRA_CAST<int *>(*parentNode);
if (piVar14 != GHIDRA_CAST<int *>(0x0)) {
(**(code **)(*piVar14 + 0xc))();
*GHIDRA_CAST<undefined1 *>((piVar14 + 0x104)) = 1;
}
parentNode = parentNode + 1;
} while (parentNode != (g_game->_playerManager)._playerList._end);
this->_frame = 0;
*GHIDRA_CAST<undefined4 *>(this) = 0;
break;
}
goto LAB_00831db4;
}
puVar8 = (g_game->_playerManager)._playerList._begin;
if (puVar8 != (g_game->_playerManager)._playerList._end) {
do {
pEVar9 = GHIDRA_CAST<Entity_Player *>(*puVar8);
if (pEVar9 != GHIDRA_CAST<Entity_Player *>(0x0)) {
if (this->_animation == 3) {
(GHIDRA_CAST<Entity_Player *>((pEVar9)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST<byte *>("TeleportDown"));
}
if ((pEVar9->_flags & 0x200000000000000) == 0) {
pEVar9->_visible = 1;
}
}
puVar8 = puVar8 + 1;
} while (puVar8 != (g_game->_playerManager)._playerList._end);
}
if (this->_animation == 0xc) {
if (GHIDRA_CAST<Entity_Player *>(local_58.y) == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_008321d0;
Entity_Player::AnimateCollectible
(GHIDRA_CAST<Entity_Player *>(local_58.y),0x1a6,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"))
;
*GHIDRA_CAST<undefined4 *>(this) = 4;
}
else {
if ((this->_animation != 0xd) || (GHIDRA_CAST<Entity_Player *>(local_58.y) == GHIDRA_CAST<Entity_Player *>(0x0)))
goto LAB_008321d0;
Entity_Player::AnimateCollectible
(GHIDRA_CAST<Entity_Player *>(local_58.y),0x1b5,GHIDRA_CAST<byte *>("Pickup"),GHIDRA_CAST<byte *>("PlayerPickupSparkle"))
;
*GHIDRA_CAST<undefined4 *>(this) = 4;
}
}
break;
case 4:
if ((this->_animation == 3) && (this->_frame == 8)) {
local_58.y = 2.99878e-43;
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_58.y));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_58.y),1.0,2,0,1.0,0.0);
}
game = g_game;
this->_frame = this->_frame + 1;
local_58.y = (float)CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_58.y)) + 0x1))),1);
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(game->_room) + 0x1218)))))->EntityList::Update(1);
parentNode = (g_game->_playerManager)._playerList._begin;
if (parentNode != (g_game->_playerManager)._playerList._end) {
pEVar9 = GHIDRA_CAST<Entity_Player *>(local_58.y);
do {
piVar14 = GHIDRA_CAST<int *>(*parentNode);
local_59 = (byte)pEVar9;
if ((piVar14 != GHIDRA_CAST<int *>(0x0)) &&
(((char)piVar14[0x4e6] != '\0' || (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar14) + 0x139a)) != '\0')))) {
if (piVar14[0x1f] == 0) {
cVar3 = '\0';
}
else {
cVar3 = *GHIDRA_CAST<char *>((piVar14[0x1f] + 0x34));
}
if (cVar3 == '\0') {
(**(code **)(*piVar14 + 0xc))();
if ((void *)piVar14[0x1f] == (void *)0x0) {
animName._capacity = 0xf;
animName._size = 0;
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(animName._buf)) + 0x0))) = GHIDRA_CAST<std_string *>(0x0);
}
else {
(GHIDRA_CAST<std::string *>((animName._buf)))->std::string::string((void *)piVar14[0x1f]);
}
local_8 = (EntityPtr)0x1;
local_50 = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_50) | 0x20));
local_60 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
if ((((char)piVar14[0x4e6] == '\0') && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar14) + 0x139a)) == '\0')) ||
(animName._size < 5)) {
local_4c = animSuffix[0];
uVar11 = animSuffixCapacity;
LAB_00832568:
local_45 = '\0';
}
else {
fVar1 = (float)(animName._size - 5);
animSuffix[0] = (EntityPtr)0x0;
local_68.y = fVar1;
animSuffixCapacity = 0xf;
if (animName._size < GHIDRA_UINT(fVar1)) {
/* WARNING: Subroutine does not return */
FUN_00499950();
}
pEVar9 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
if (GHIDRA_CAST<Entity_Player *>((animName._size - GHIDRA_INT(fVar1))) != GHIDRA_CAST<Entity_Player *>(0xffffffff)) {
pEVar9 = GHIDRA_CAST<Entity_Player *>((animName._size - GHIDRA_INT(fVar1)));
}
psVar5 = &animName;
if (0xf < animName._capacity) {
psVar5 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(animName._buf))) + 0x0)));
}
local_68.y = (float)(psVar5->_buf + GHIDRA_INT(fVar1));
local_58.y = (float)pEVar9;
if (GHIDRA_CAST<Entity_Player *>(&DAT_0000000f) < pEVar9) {
if (GHIDRA_CAST<Entity_Player *>(0x7fffffff) < pEVar9) {
/* WARNING: Subroutine does not return */
std::string::_Xlen();
}
uVar11 = GHIDRA_UINT(pEVar9) | 0xf;
if (uVar11 < 0x80000000) {
if (uVar11 < 0x16) {
uVar11 = 0x16;
}
}
else {
uVar11 = 0x7fffffff;
}
local_4c = (EntityPtr)std::_Allocate(uVar11 + 1);
animSuffixSize = GHIDRA_INT(local_58.y);
animSuffixCapacity = uVar11;
memcpy((void *)local_4c,(void *)local_68.y,(size_t)local_58.y);
animSuffix[0] = local_4c;
*(undefined1 *)
(GHIDRA_INT((&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(local_58.y) + 0x48)))->_filename + -3)) + GHIDRA_INT(local_4c)) = 0;
pEVar9 = GHIDRA_CAST<Entity_Player *>(local_58.y);
}
else {
animSuffixSize = GHIDRA_INT(pEVar9);
memmove(animSuffix,psVar5->_buf + GHIDRA_INT(fVar1),(size_t)pEVar9);
(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(animSuffix[-0x12])) + 0x0))))[GHIDRA_INT((pEVar9->_sprite)._filename._buf)] = 0;
pEVar9 = GHIDRA_CAST<Entity_Player *>(animSuffixSize);
uVar11 = animSuffixCapacity;
}
local_50 = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_50) | 0x41));
EVar12 = (EntityPtr)animSuffix;
if (0xf < uVar11) {
EVar12 = animSuffix[0];
}
local_4c = animSuffix[0];
bVar4 = str_eq(GHIDRA_CAST<byte *>(EVar12),GHIDRA_UINT(pEVar9),GHIDRA_CAST<byte *>("Death"),5);
if (bVar4 != 0) goto LAB_00832568;
local_45 = '\x01';
}
if (((GHIDRA_UINT(local_50) & 1) != 0) &&
(local_50 = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(local_50) & 0xfffffffe)), 0xf < uVar11)) {
uVar15 = uVar11 + 1;
EVar12 = local_4c;
if (0xfff < uVar15) {
EVar12 = *GHIDRA_CAST<EntityPtr *>((GHIDRA_CAST<char *>(local_4c) + -4));
uVar15 = uVar11 + 0x24;
if (0x1f < (GHIDRA_INT(local_4c) - GHIDRA_INT(EVar12)) - 4U) goto LAB_00831b99;
}
operator_delete((void *)EVar12,uVar15);
}
local_8 = (EntityPtr)0xffffffff;
local_58.y = (float)GHIDRA_CAST<Entity_Player *>(0x0);
if (local_45 == '\0') {
local_58.y = (float)GHIDRA_UINT(local_59);
}
pEVar9 = GHIDRA_CAST<Entity_Player *>(local_58.y);
if (0xf < animName._capacity) {
uVar11 = animName._capacity + 1;
psVar5 = local_60;
if (0xfff < uVar11) {
psVar5 = GHIDRA_CAST<std_string *>(local_60[-1]._capacity);
uVar11 = animName._capacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(local_60) + (-4 - GHIDRA_INT(psVar5))))) goto LAB_00831b99;
}
operator_delete(psVar5,uVar11);
pEVar9 = GHIDRA_CAST<Entity_Player *>(local_58.y);
}
}
}
parentNode = parentNode + 1;
} while (parentNode != (g_game->_playerManager)._playerList._end);
if ((char)pEVar9 == '\0') break;
}
game = g_game;
*GHIDRA_CAST<undefined4 *>(this) = 0;
this->_frame = 0;
parentNode = (game->_playerManager)._playerList._begin;
if (parentNode != (game->_playerManager)._playerList._end) {
do {
iVar13 = *parentNode;
if ((iVar13 != 0) &&
(*GHIDRA_CAST<undefined1 *>((iVar13 + 0x410)) = 1, (*GHIDRA_CAST<uint *>((iVar13 + 0x16c)) & 0x2000000) == 0)) {
*GHIDRA_CAST<undefined1 *>((iVar13 + 0x171)) = 1;
}
parentNode = parentNode + 1;
} while (parentNode != (game->_playerManager)._playerList._end);
}
break;
default:
goto switchD_0083190e_default;
}
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = (float)this->_frame / (float)this->_duration;
game = g_game;
if ((*GHIDRA_CAST<int *>(this) == 2) || (*GHIDRA_CAST<int *>(this) == 3)) {
(g_game->_hud)._hudRefreshType = 2;
(game->_hud)._hudRefreshCountdown = 2;
}
switchD_0083190e_default:
ExceptionList = local_10;
return;
}
// 008327e0
float RoomTransition::get_hud_alpha()
{
int iVar1;
int animation;
iVar1 = *GHIDRA_CAST<int *>(this);
if (((iVar1 == 2) || (iVar1 == 3)) &&
((((animation = this->_animation, animation == 1 ||
((((animation == 2 || (this->_direction == -1)) || (animation == 0xb)) ||
((animation == 0x10 || (animation == 0x11)))))) || (animation == 0x12)) ||
((animation == 0x14 || (animation == 0x13)))))) {
if (iVar1 == 2) {
return 1.0 - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xc))));
}
if (iVar1 == 3) {
return *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0xc))));
}
}
return 1.0;
}