Files
isaac-port/generated-src/pause_screen.cpp
T
shweetandClaude Opus 5.5 28e2e48842 Curation round 2, wave B: ItemConfig, EntityConfig, mods, Manager and the KAGE platform on SDL3; boots to LuaEngine::Init
- item_config, entity_config and mod_manager take over their families as idiomatic classes (std containers,
  unique_ptr, bitset tear flags). Every big loader reads the imported JSON: entities2.xml gives 1349 entities.
- manager.h/.cpp take over Manager (g_manager) and IsaacStartup. Members are the curated subsystems by value.
- kage_graphics, kage_input and kage_sound take over KAGE's graphics (shaders, render targets, batches, PNG through
  stb_image), input (SDL3 keyboard, mouse, gamepads) and sound (SDL3 audio, wav and stb_vorbis ogg, pitch and volume).
- source_tree.py: classes inside a namespace block in src/ headers count as taken over, and a still-generated class's
  vtable slot keeps its stub unless src/ defines that exact method.
build/isaac opens the window, sets up GL 4.6, framebuffers and PulseAudio, logs the version, and stops at
LuaEngine::Init. 522 functions taken over, boot path 156/615.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:03:39 -05:00

3847 lines
170 KiB
C++

#include "classes.h"
// 008d0fd0
void PauseScreen::load_drop_player_menu()
{
uint8_t bVar1;
uint8_t *curAnimChar;
int in_ECX;
char *pcVar2;
uint32_t uVar3;
bool isLess;
std_string menuAnmPath;
std_string counterAnmPath;
uint32_t securityCookie;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
uint8_t *animData;
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
local_14 = 0xffffffff;
puStack_18 = &LAB_00af1f85;
local_1c = ExceptionList;
securityCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
ExceptionList = &local_1c;
menuAnmPath._size = 0;
menuAnmPath._capacity = 0xf;
menuAnmPath._buf[0] = '\0';
menuAnmPath._buf[1] = '\0';
menuAnmPath._buf[2] = '\0';
menuAnmPath._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(menuAnmPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
menuAnmPath._size = 0x1b;
menuAnmPath._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuAnmPath._buf))) + 0x0))),"gfx/ui/Menu_DropPlayer.anm2",0x1c);
local_14 = 0;
ANM2::Load(GHIDRA_CAST<ANM2 *>((in_ECX + 4)),&menuAnmPath,1);
local_14 = 0xffffffff;
if (0xf < menuAnmPath._capacity) {
uVar3 = menuAnmPath._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(menuAnmPath._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(menuAnmPath._buf)) + 0x0))) + -4));
uVar3 = menuAnmPath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(menuAnmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
animData = *GHIDRA_CAST<uint8_t **>((in_ECX + 0x38));
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
LAB_008d1114:
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>((in_ECX + 4)),GHIDRA_CAST<uint8_t *>("Background"),1);
if (bVar1 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((in_ECX + 0x34)));
*GHIDRA_CAST<uint8_t *>((in_ECX + 0x48)) = 1;
}
}
else {
curAnimChar = animData;
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
}
pcVar2 = "Background";
do {
bVar1 = *curAnimChar;
isLess = bVar1 < (uint8_t)*pcVar2;
if (bVar1 != *pcVar2) {
LAB_008d1101:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008d1106;
}
if (bVar1 == 0) break;
bVar1 = curAnimChar[1];
isLess = bVar1 < (uint8_t)pcVar2[1];
if (bVar1 != pcVar2[1]) goto LAB_008d1101;
curAnimChar = curAnimChar + 2;
pcVar2 = pcVar2 + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_008d1106:
if ((uVar3 != 0) || ((animData[0x34] != 0 && (*GHIDRA_CAST<char *>((in_ECX + 0x48)) == '\0'))))
goto LAB_008d1114;
}
counterAnmPath._size = 0;
counterAnmPath._capacity = 0xf;
counterAnmPath._buf[0] = '\0';
counterAnmPath._buf[1] = '\0';
counterAnmPath._buf[2] = '\0';
counterAnmPath._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(counterAnmPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
counterAnmPath._size = 0x1e;
counterAnmPath._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(counterAnmPath._buf))) + 0x0))),"gfx/ui/DropPlayer_Counter.anm2",0x1f);
local_14 = 1;
ANM2::Load(GHIDRA_CAST<ANM2 *>((in_ECX + 0x118)),&counterAnmPath,1);
local_14 = 0xffffffff;
if (0xf < counterAnmPath._capacity) {
uVar3 = counterAnmPath._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(counterAnmPath._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(counterAnmPath._buf)) + 0x0))) + -4));
uVar3 = counterAnmPath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(counterAnmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
animData = *GHIDRA_CAST<uint8_t **>((in_ECX + 0x14c));
counterAnmPath._size = 0;
counterAnmPath._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(counterAnmPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(counterAnmPath._buf)) + 0x0))) & 0xffffff00;
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
curAnimChar = animData;
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
curAnimChar = *GHIDRA_CAST<uint8_t **>(animData);
}
pcVar2 = "UpperSelector";
do {
bVar1 = *curAnimChar;
isLess = bVar1 < (uint8_t)*pcVar2;
if (bVar1 != *pcVar2) {
LAB_008d1238:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008d123d;
}
if (bVar1 == 0) break;
bVar1 = curAnimChar[1];
isLess = bVar1 < (uint8_t)pcVar2[1];
if (bVar1 != pcVar2[1]) goto LAB_008d1238;
curAnimChar = curAnimChar + 2;
pcVar2 = pcVar2 + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_008d123d:
if ((uVar3 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST<char *>((in_ECX + 0x15c)) != '\0'))))
goto LAB_008d1269;
}
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>((in_ECX + 0x118)),GHIDRA_CAST<uint8_t *>("UpperSelector"),1);
if (bVar1 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((in_ECX + 0x148)));
*GHIDRA_CAST<uint8_t *>((in_ECX + 0x15c)) = 1;
}
LAB_008d1269:
*GHIDRA_CAST<uint32_t *>((in_ECX + 0x1b4)) = *GHIDRA_CAST<uint32_t *>((in_ECX + 0x238));
*GHIDRA_CAST<uint32_t *>((in_ECX + 0x1b8)) = *GHIDRA_CAST<uint32_t *>((in_ECX + 0x238));
ExceptionList = local_1c;
return;
}
// 008d12b0
void PauseScreen::update_player_info_page()
{
char isActionTriggered;
uint8_t bVar1;
int memberCount;
int controllerIndex;
Entity_Player *player;
uint8_t *currentAnimChar;
uint32_t uVar2;
uint8_t *newAnimChar;
bool isLess;
uint32_t actionMenuRight;
uint32_t actionMenuLeft;
uint32_t actionMenuDown;
uint32_t actionMenuUp;
uint8_t *local_8;
uint8_t *currentAnim;
Manager *manager;
int optionCount;
if ((g_game->_hud)._isVisible == 0) {
return;
}
build_player_user_list(this);
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10d))) != '\0') {
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x34)))));
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54)))));
}
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x221))) != '\0') {
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x148)))));
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x168)))));
}
memberCount = online_lobby_get_member_count();
optionCount = memberCount + -1;
if (optionCount <= this->_state) {
this->_state = memberCount + -2;
}
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((g_game->_pauseScreen)._playerIdx);
controllerIndex = player->_controllerIndex;
}
else {
controllerIndex = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
}
else {
controllerIndex = g_menuControllerIndex;
}
local_8 = GHIDRA_CAST<uint8_t *>(0xf);
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,&local_8,0,0);
if ((isActionTriggered == '\0') && (0 < optionCount)) {
local_8 = GHIDRA_CAST<uint8_t *>(0xe);
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,&local_8,0,0);
if (isActionTriggered == '\0') {
if (optionCount < 2) goto LAB_008d1434;
local_8 = GHIDRA_CAST<uint8_t *>(this->_state);
actionMenuUp = 0x16;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))
(controllerIndex,FUN_00a209e0,&actionMenuUp,0,0);
if (isActionTriggered == '\0') {
actionMenuDown = 0x17;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))
(controllerIndex,FUN_00a209e0,&actionMenuDown,0,0);
if (isActionTriggered != '\0') goto LAB_008d154d;
actionMenuLeft = 0x14;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))
(controllerIndex,FUN_00a209e0,&actionMenuLeft,0,0);
if (isActionTriggered != '\0') {
this->_state = this->_state + -1;
if (-1 < this->_state) goto LAB_008d156b;
uVar2 = memberCount - 2;
goto LAB_008d1569;
}
actionMenuRight = 0x15;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))
(controllerIndex,FUN_00a209e0,&actionMenuRight,0,0);
if (isActionTriggered != '\0') {
this->_state = (this->_state + 1) % optionCount;
}
}
else {
LAB_008d154d:
if (optionCount == 2) {
uVar2 = GHIDRA_UINT((this->_state == 0));
}
else {
uVar2 = 2;
if (0 < this->_state) {
uVar2 = 0;
}
}
LAB_008d1569:
this->_state = uVar2;
}
LAB_008d156b:
manager = g_manager;
if (GHIDRA_CAST<uint8_t *>(this->_state) != local_8) {
local_8 = GHIDRA_CAST<uint8_t *>(0x11a);
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_8),1.0,2,0,1.0,0.0);
}
goto LAB_008d1434;
}
FUN_00909c40(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x22c)))) + this->_state * 8)),
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x22c)))) + 4 + this->_state * 8)));
manager = g_manager;
local_8 = GHIDRA_CAST<uint8_t *>(0x25);
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_8),1.0,2,0,1.0,0.0);
}
(GHIDRA_CAST<PopupWindow *>((&g_game->_pauseScreen)))->PopupWindow::hide();
LAB_008d1434:
local_8 = GHIDRA_CAST<uint8_t *>(0xb75850);
currentAnim = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14c))));
if (this->_state != 0) {
local_8 = GHIDRA_CAST<uint8_t *>(0xb75860);
}
if (currentAnim != GHIDRA_CAST<uint8_t *>(0x0)) {
currentAnimChar = currentAnim;
newAnimChar = local_8;
if (0xf < *GHIDRA_CAST<uint32_t *>((currentAnim + 0x14))) {
currentAnimChar = *GHIDRA_CAST<uint8_t **>(currentAnim);
}
do {
bVar1 = *currentAnimChar;
isLess = bVar1 < *newAnimChar;
if (bVar1 != *newAnimChar) {
LAB_008d15bc:
uVar2 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008d15c1;
}
if (bVar1 == 0) break;
bVar1 = currentAnimChar[1];
isLess = bVar1 < newAnimChar[1];
if (bVar1 != newAnimChar[1]) goto LAB_008d15bc;
currentAnimChar = currentAnimChar + 2;
newAnimChar = newAnimChar + 2;
} while (bVar1 != 0);
uVar2 = 0;
LAB_008d15c1:
if (uVar2 == 0) {
if (currentAnim[0x34] == 0) {
return;
}
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x15c))) != '\0') {
return;
}
}
}
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x118)))),local_8,1);
if (bVar1 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x148)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x15c))) = 1;
}
return;
}
// 008d19a0
void PauseScreen::build_player_user_list()
{
PauseScreen *playerManager = this;
char cVar1;
uint8_t isAlreadyListed;
uint32_t uVar2;
int iVar3;
int *deviceIter;
int extraout_EAX;
uint32_t uVar4;
uint8_t *extraout_EAX_00;
uint32_t uVar5;
uint32_t uVar6;
int iVar7;
uint32_t playerIndex;
PlayerManager *playerManager;
uint32_t deviceCount;
uint8_t *userIds;
int local_3c;
int *lobbyRefCount;
uint32_t memberUserIdLow;
uint32_t memberUserIdHigh;
uint64_t userId;
uint64_t local_24;
PauseScreen *pauseScreen;
uint8_t **memberProfile;
uint8_t *local_14;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
Manager *manager;
void *playerListEnd;
uint32_t *userIdsEnd;
local_8 = 0xffffffff;
puStack_c = &LAB_00b05c7d;
local_10 = ExceptionList;
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
userIds = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((playerManager)) + 0x22c)));
playerManager = &g_game->_playerManager;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((playerManager)) + 0x230)))) = *GHIDRA_CAST<uint32_t *>(userIds);
playerIndex = 0;
pauseScreen = playerManager;
local_14 = userIds;
iVar3 = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::count_main_players();
if (iVar3 != 0) {
do {
playerListEnd = (playerManager->_playerList)._end;
deviceIter = (playerManager->_playerList)._begin;
if (GHIDRA_INT(playerListEnd) - GHIDRA_INT(deviceIter) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
playerListEnd = (playerManager->_playerList)._end;
deviceIter = (playerManager->_playerList)._begin;
}
if (playerIndex < GHIDRA_UINT((GHIDRA_INT(playerListEnd) - GHIDRA_INT(deviceIter) >> 2))) {
deviceIter = deviceIter + playerIndex;
}
uVar5 = 0;
iVar3 = *GHIDRA_CAST<int *>((*deviceIter + 0x1618));
deviceIter = GHIDRA_CAST<int *>(g_manager->_netplayManager);
deviceCount = *GHIDRA_CAST<int *>((g_manager + 1)) - GHIDRA_INT(deviceIter) >> 2;
if (deviceCount != 0) {
do {
iVar7 = *deviceIter;
if (*GHIDRA_CAST<int *>((iVar7 + 0xc)) == iVar3) goto LAB_008d1a7d;
uVar5 = uVar5 + 1;
deviceIter = deviceIter + 1;
} while (uVar5 < deviceCount);
}
KAGE_LogMessage(8,(uint8_t *)
"[Frame: %d] NetManager::GetDeviceById() failed to find device with ID %d \n"
);
iVar7 = 0;
LAB_008d1a7d:
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((iVar7 + 0x370)) + 0x14))(uVar2);
if (cVar1 == '\0') {
iVar3 = FUN_0090b010(iVar3);
userIds = local_14;
iVar3 = *GHIDRA_CAST<int *>((iVar3 + 0x374));
if (iVar3 == 0) {
local_24 = 0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) = 0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x0))) = GHIDRA_CAST<uint8_t **>(0x0);
uVar4 = GHIDRA_CAST<uint8_t **>(local_24);
uVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4)));
}
else {
uVar4 = *GHIDRA_CAST<uint32_t *>((iVar3 + 8));
uVar6 = *GHIDRA_CAST<uint32_t *>((iVar3 + 0xc));
}
userId = CONCAT44(uVar6,uVar4);
userIdsEnd = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pauseScreen)) + 0x230))));
if (userIdsEnd == *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pauseScreen)) + 0x234))))) {
msvc::vector<8byte>::_Emplace_reallocate(userIdsEnd,&userId);
}
else {
*userIdsEnd = uVar4;
userIdsEnd[1] = uVar6;
*GHIDRA_CAST<int *>((local_14 + 4)) = *GHIDRA_CAST<int *>((local_14 + 4)) + 8;
}
}
else {
userIds = local_14;
}
playerIndex = playerIndex + 1;
playerManager = &g_game->_playerManager;
uVar5 = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::count_main_players();
} while (playerIndex < uVar5);
}
local_3c = 0;
lobbyRefCount = GHIDRA_CAST<int *>(0x0);
local_8 = 0;
(GHIDRA_CAST<msvc::shared_ptr *>((&local_3c)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
uVar2 = 0;
do {
while( true ) {
manager = g_manager;
if ((local_3c == 0) ||
(GHIDRA_UINT((*GHIDRA_CAST<int *>((local_3c + 0x14)) - *GHIDRA_CAST<int *>((local_3c + 0x10)) >> 3)) <= uVar2)) {
local_8 = 5;
if ((lobbyRefCount != GHIDRA_CAST<int *>(0x0)) &&
((cVar1 = (**(code **)(*lobbyRefCount + 0xc))(), cVar1 != '\0' &&
(g_lobbyReleaseFn != (void *)0x0)))) {
(*g_lobbyReleaseFn)(&local_3c);
}
ExceptionList = local_10;
return;
}
local_24 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))),KAGE::System::UserProfileBase::vftable);
(GHIDRA_CAST<UserProfile *>(((void *)(*GHIDRA_CAST<int *>((local_3c + 0x10)) + uVar2 * 8))))->UserProfile::find_or_create();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x0))) = KAGE::System::UserProfile::vftable;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) = extraout_EAX;
if (((extraout_EAX != 0) &&
(*GHIDRA_CAST<int *>((extraout_EAX + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX + 0xc)) != 0)) &&
(*GHIDRA_CAST<int *>((extraout_EAX + 0x14)) == 0)) {
(GHIDRA_CAST<KAGE::System::UserProfile *>((&local_24)))->KAGE::System::UserProfile::load_steam_avatar();
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
if ((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) == 0) {
userId = 0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) = 0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x0))) = 0;
uVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4)));
uVar6 = (uint32_t)userId;
}
else {
uVar4 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) + 0xc));
uVar6 = *GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))) + 8));
}
isAlreadyListed =
NetplayManager::is_user_in_player_list
(GHIDRA_CAST<NetplayManager *>(&manager->_netplayManager),CONCAT44(uVar4,uVar6));
local_24 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_24)) + 0x4))),KAGE::System::UserProfileBase::vftable);
if (isAlreadyListed == 0) break;
LAB_008d1ccc:
uVar2 = uVar2 + 1;
}
if (local_3c == 0) {
memberProfile = KAGE::System::UserProfile::vftable;
local_14 = GHIDRA_CAST<uint8_t *>(0x0);
}
else {
if (GHIDRA_UINT((*GHIDRA_CAST<int *>((local_3c + 0x14)) - *GHIDRA_CAST<int *>((local_3c + 0x10)) >> 3)) <= uVar2) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Invalid lobby user index"));
}
memberProfile = KAGE::System::UserProfileBase::vftable;
(GHIDRA_CAST<UserProfile *>(((void *)(*GHIDRA_CAST<int *>((local_3c + 0x10)) + uVar2 * 8))))->UserProfile::find_or_create();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
memberProfile = KAGE::System::UserProfile::vftable;
local_14 = extraout_EAX_00;
if (((extraout_EAX_00 != GHIDRA_CAST<uint8_t *>(0x0)) &&
(*GHIDRA_CAST<int *>((extraout_EAX_00 + 8)) != 0 || *GHIDRA_CAST<int *>((extraout_EAX_00 + 0xc)) != 0)) &&
(*GHIDRA_CAST<int *>((extraout_EAX_00 + 0x14)) == 0)) {
(GHIDRA_CAST<KAGE::System::UserProfile *>((&memberProfile)))->KAGE::System::UserProfile::load_steam_avatar();
}
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
if (local_14 == GHIDRA_CAST<uint8_t *>(0x0)) {
userId = 0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4))) = 0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x0))) = 0;
memberUserIdLow = (uint32_t)userId;
memberUserIdHigh = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(userId)) + 0x4)));
}
else {
memberUserIdLow = *GHIDRA_CAST<uint32_t *>((local_14 + 8));
memberUserIdHigh = *GHIDRA_CAST<uint32_t *>((local_14 + 0xc));
}
userIdsEnd = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pauseScreen)) + 0x230))));
if (userIdsEnd == *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pauseScreen)) + 0x234))))) {
msvc::vector<8byte>::_Emplace_reallocate(userIdsEnd,&memberUserIdLow);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
memberProfile = KAGE::System::UserProfileBase::vftable;
goto LAB_008d1ccc;
}
*userIdsEnd = memberUserIdLow;
userIdsEnd[1] = memberUserIdHigh;
*GHIDRA_CAST<int *>((userIds + 4)) = *GHIDRA_CAST<int *>((userIds + 4)) + 8;
uVar2 = uVar2 + 1;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
memberProfile = KAGE::System::UserProfileBase::vftable;
} while( true );
}
// 008d3360
void PauseScreen::update_items_menu()
{
char isActionTriggered;
int iVar1;
int scrollDeviceId;
uint32_t uVar2;
uint32_t nextTab;
Entity_Player *player;
uint32_t descriptionLineCount;
LayerState *arrowLayer;
uint32_t in_stack_ffffff88;
uint32_t buttonAction [2];
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
iVar1 = -1;
}
else {
iVar1 = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
scrollDeviceId = -1;
}
else {
scrollDeviceId = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
buttonAction[0] = 0x14;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollDeviceId,FUN_00a20940,buttonAction,0,0);
if (isActionTriggered == '\0') {
buttonAction[0] = 0x15;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollDeviceId,FUN_00a20940,buttonAction,0,0);
if (isActionTriggered != '\0') goto LAB_008d3410;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x648)))) = 0;
}
else {
LAB_008d3410:
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x648)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x648)))) + 1;
}
buttonAction[0] = 0x16;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollDeviceId,FUN_00a20940,buttonAction,0,0);
if (isActionTriggered == '\0') {
buttonAction[0] = 0x17;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollDeviceId,FUN_00a20940,buttonAction,0,0);
if (isActionTriggered != '\0') goto LAB_008d3472;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x64c)))) = 0;
}
else {
LAB_008d3472:
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x64c)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x64c)))) + 1;
}
buttonAction[0] = 0xf;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar1,FUN_00a20940,buttonAction,0,0);
if (isActionTriggered == '\0') {
update_items_menu_selection(this);
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18)))) & 0xfffffffcU) != 0) &&
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18)))) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) * 4)) != 0)) {
buttonAction[0] = 0x1c;
isActionTriggered =
(**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar1,FUN_00a209e0,buttonAction,0,0);
if (isActionTriggered != '\0') {
uVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) + 1U & 0x80000003;
if (GHIDRA_INT(uVar2) < 0) {
uVar2 = (uVar2 - 1 | 0xfffffffc) + 1;
}
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = uVar2;
if ((uVar2 == 1) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x38)))) == 0)) {
uVar2 = 2;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = 2;
}
if (uVar2 == 2) {
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c)))) != 0) goto LAB_008d354d;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = 3;
}
else if (uVar2 != 3) goto LAB_008d354d;
nextTab = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))));
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x60)))) == 0) {
nextTab = 0;
}
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = nextTab;
}
LAB_008d354d:
update_items_page();
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x38)))) == 0) {
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("DescriptionArrowUp"));
arrowLayer->_visible = 0;
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("DescriptionArrowDown"));
arrowLayer->_visible = 0;
update_trinket_display(this);
update_pocket_item_display(this);
return;
}
FUN_008d47c0(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x38)))),&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44))),&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x48))),in_stack_ffffff88,
0x42c80000,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) == 1);
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((g_game->_pauseScreen)._playerIdx);
descriptionLineCount =
InfoDisplayEntry::count_lines(player,*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x38)))) + 4)));
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44))));
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("DescriptionArrowUp"));
arrowLayer->_visible = 0 < iVar1;
uVar2 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x48))));
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("DescriptionArrowDown"));
arrowLayer->_visible = uVar2 < descriptionLineCount;
update_trinket_display(this);
update_pocket_item_display(this);
return;
}
}
FUN_008d3250();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10))) = 0;
return;
}
// 008d3640
void PauseScreen::render_items_page()
{
Vector pos;
Vector scale;
float *backButtonNull;
Entity_Player *player;
int in_ECX;
int layerId;
AnimationState *secondAnim;
float glyphY;
float glyphX;
Vector pagePos;
int layerFrame;
int layerId;
if (*GHIDRA_CAST<int *>((in_ECX + 0x338)) == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("AnimationData is NULL\n"));
}
if (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x334)) + 0x80)) < 1) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n"));
}
layerId = *GHIDRA_CAST<int *>((in_ECX + 0x338));
if (((((layerId == 0) || (*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x334)) + 0x80)) < 0)) ||
(layerId = *GHIDRA_CAST<int *>((layerId + 0x38)), layerId < 0)) ||
((*GHIDRA_CAST<int *>((layerId + 0x1c)) <= layerId ||
(layerFrame = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x33c)) + layerId * 4)), layerFrame < 0)))) ||
(layerId = layerId * 0x10 + *GHIDRA_CAST<int *>((layerId + 0x18)), *GHIDRA_CAST<int *>((layerId + 8)) <= layerFrame)) {
layerId = 0;
}
else {
layerId = layerFrame * 0x6c + *GHIDRA_CAST<int *>((layerId + 4));
}
pagePos.x = g_screenWidth * 0.5 - *GHIDRA_CAST<float *>((layerId + 8)) * 0.5;
pagePos.y = g_screenHeight * 0.5 - *GHIDRA_CAST<float *>((layerId + 0xc)) * 0.5;
if (*GHIDRA_CAST<char *>((in_ECX + 0x40d)) != '\0') {
if (*GHIDRA_CAST<char *>((in_ECX + 0x374)) == '\0') {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x334)),&pagePos,&g_vectorZero,&g_vectorZero);
secondAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x354));
}
else {
AnimationState::Render
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x354)),&pagePos,&g_vectorZero,&g_vectorZero);
secondAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x334));
}
AnimationState::Render(secondAnim,&pagePos,&g_vectorZero,&g_vectorZero);
}
if (*GHIDRA_CAST<int *>((in_ECX + 0x338)) != 0) {
backButtonNull =
AnimationState::GetNullFrame(GHIDRA_CAST<AnimationState *>((in_ECX + 0x334)),GHIDRA_CAST<uint8_t *>("BackButton"));
if (backButtonNull != GHIDRA_CAST<float *>(0x0)) {
glyphX = pagePos.x + *backButtonNull;
glyphY = pagePos.y + backButtonNull[1];
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((g_game->_pauseScreen)._playerIdx);
layerId = player->_controllerIndex;
}
else {
layerId = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
pos.y = glyphY;
pos.x = glyphX;
scale.y = g_vectorOne.y;
scale.x = g_vectorOne.x;
Manager::render_controller_action_glyph
(g_manager,layerId,0xf,0,1,
(ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),
pos,scale);
}
}
if (((*GHIDRA_CAST<int *>((in_ECX + 0x1c)) - *GHIDRA_CAST<int *>((in_ECX + 0x18)) & 0xfffffffcU) != 0) &&
(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((in_ECX + 0x18)) + *GHIDRA_CAST<int *>((in_ECX + 0x24)) * 4)) != 0)) {
OnlinePlayerInfo::render_items(&pagePos);
FUN_008d5440(&pagePos);
FUN_008d5640(&pagePos);
FUN_008d57f0(&pagePos);
}
return;
}
// 008d3890
void PauseScreen::update_items_page()
{
int *piVar1;
uint32_t uVar2;
uint32_t uVar3;
uint32_t uVar4;
Entity_Player *pEVar5;
uint8_t isOwned;
char cVar6;
uint32_t uVar7;
uint32_t *historyEntry;
LayerState *arrowLayer;
int *piVar8;
int iVar9;
uint8_t *path;
void *pvVar10;
int *in_ECX;
int iVar11;
uint32_t *puVar12;
uint8_t local_74 [8];
void *local_6c;
void *shownItemsVecBegin;
uint32_t *shownItemsVecEnd;
uint32_t *shownItemsVecCapacity;
uint8_t local_5c [4];
uint8_t loadedImage [4];
int *local_54;
uint32_t actionMenuDown;
uint32_t actionMenuUp;
int *local_48;
InfoDisplay *local_44;
int *local_40;
void *local_3c;
uint32_t *shownItemsCapacity;
uint32_t local_34;
void *shownItems;
Entity_Player *ownerPlayer;
int local_28;
uint8_t isArrowVisible;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
InfoDisplay *deviceId;
Manager *manager;
puStack_20 = loadedImage + 0x54;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b05d65;
local_1c = ExceptionList;
uVar7 = __security_cookie ^ GHIDRA_UINT((loadedImage + 0x48));
ExceptionList = &local_1c;
local_48 = in_ECX;
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
local_44 = GHIDRA_CAST<InfoDisplay *>(0xffffffff);
puStack_20 = loadedImage + 0x54;
}
else {
local_44 = GHIDRA_CAST<InfoDisplay *>((GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager)::FirstLocalDeviceID();
}
if (GHIDRA_UINT((in_ECX[7] - in_ECX[6])) < 4) {
ownerPlayer = GHIDRA_CAST<Entity_Player *>(0x0);
}
else {
ownerPlayer = *GHIDRA_CAST<Entity_Player **>((in_ECX[6] + in_ECX[9] * 4));
}
puVar12 = GHIDRA_CAST<uint32_t *>(0x0);
shownItems = (void *)0x0;
shownItemsVecBegin = (void *)0x0;
shownItemsVecEnd = GHIDRA_CAST<uint32_t *>(0x0);
shownItemsCapacity = GHIDRA_CAST<uint32_t *>(0x0);
shownItemsVecCapacity = GHIDRA_CAST<uint32_t *>(0x0);
local_14 = 0;
local_34 = 0;
local_3c = (ownerPlayer->_history)._historyItems._end;
pvVar10 = (ownerPlayer->_history)._historyItems._begin;
iVar9 = GHIDRA_INT(local_3c) - GHIDRA_INT(pvVar10) >> 0x1f;
local_40 = pvVar10;
if ((GHIDRA_INT(local_3c) - GHIDRA_INT(pvVar10)) / 0x1c + iVar9 != iVar9) {
local_28 = 0;
do {
pEVar5 = ownerPlayer;
if (*GHIDRA_CAST<char *>((local_28 + 4 + GHIDRA_INT(pvVar10))) == '\0') {
isOwned = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasCollectible(*GHIDRA_CAST<int *>((local_28 + 8 + GHIDRA_INT(pvVar10))),0)
;
if (isOwned != 0) {
historyEntry = GHIDRA_CAST<uint32_t *>((GHIDRA_INT((pEVar5->_history)._historyItems._begin) + local_28));
if (puVar12 == shownItemsCapacity) {
msvc::vector<28byte>::_Emplace_reallocate(puVar12,historyEntry);
shownItemsCapacity = shownItemsVecCapacity;
puVar12 = shownItemsVecEnd;
}
else {
uVar2 = historyEntry[1];
uVar3 = historyEntry[2];
uVar4 = historyEntry[3];
*puVar12 = *historyEntry;
puVar12[1] = uVar2;
puVar12[2] = uVar3;
puVar12[3] = uVar4;
uVar2 = historyEntry[5];
puVar12[4] = historyEntry[4];
puVar12[5] = uVar2;
puVar12[6] = historyEntry[6];
shownItemsVecEnd = puVar12 + 7;
puVar12 = shownItemsVecEnd;
}
}
}
local_28 = local_28 + 0x1c;
local_34 = local_34 + 1;
local_3c = (pEVar5->_history)._historyItems._end;
pvVar10 = (pEVar5->_history)._historyItems._begin;
} while (local_34 < GHIDRA_UINT(((GHIDRA_INT(local_3c) - GHIDRA_INT(pvVar10)) / 0x1c)));
shownItems = shownItemsVecBegin;
in_ECX = local_48;
local_40 = pvVar10;
}
local_3c = (void *)(GHIDRA_INT(local_3c) - GHIDRA_INT(local_40));
local_34 = 0;
if (GHIDRA_INT(local_3c) / 0x1c + (GHIDRA_INT(local_3c) >> 0x1f) != GHIDRA_INT(local_3c) >> 0x1f) {
local_28 = 0;
piVar8 = local_40;
shownItemsVecBegin = shownItems;
do {
pEVar5 = ownerPlayer;
if (*GHIDRA_CAST<char *>((local_28 + 4 + GHIDRA_INT(piVar8))) == '\x01') {
isOwned = (GHIDRA_CAST<Entity_Player *>((ownerPlayer)))->Entity_Player::HasTrinket(*GHIDRA_CAST<uint32_t *>((local_28 + 8 + GHIDRA_INT(piVar8))),0);
if (isOwned != 0) {
historyEntry = GHIDRA_CAST<uint32_t *>((GHIDRA_INT((pEVar5->_history)._historyItems._begin) + local_28));
if (puVar12 == shownItemsCapacity) {
msvc::vector<28byte>::_Emplace_reallocate(puVar12,historyEntry);
shownItemsCapacity = shownItemsVecCapacity;
puVar12 = shownItemsVecEnd;
}
else {
uVar2 = historyEntry[1];
uVar3 = historyEntry[2];
uVar4 = historyEntry[3];
*puVar12 = *historyEntry;
puVar12[1] = uVar2;
puVar12[2] = uVar3;
puVar12[3] = uVar4;
uVar2 = historyEntry[5];
puVar12[4] = historyEntry[4];
puVar12[5] = uVar2;
puVar12[6] = historyEntry[6];
shownItemsVecEnd = puVar12 + 7;
puVar12 = shownItemsVecEnd;
}
}
}
local_28 = local_28 + 0x1c;
local_34 = local_34 + 1;
piVar8 = (ownerPlayer->_history)._historyItems._begin;
} while (local_34 <
GHIDRA_UINT(((GHIDRA_INT((ownerPlayer->_history)._historyItems._end) - GHIDRA_INT(piVar8)) / 0x1c)));
shownItems = shownItemsVecBegin;
in_ECX = local_48;
}
deviceId = local_44;
piVar8 = GHIDRA_CAST<int *>(in_ECX[0xd]);
local_28 = (GHIDRA_INT(puVar12) - GHIDRA_INT(shownItems)) / 0x1c;
shownItemsVecBegin = shownItems;
local_40 = piVar8;
if (local_28 == 0) {
in_ECX[0xc] = 0;
in_ECX[0xd] = 0;
in_ECX[0xe] = 0;
(GHIDRA_CAST<KAGE::SmartPointer *>((in_ECX + 0xf)))->KAGE::SmartPointer::reset((void *)0x0);
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((in_ECX + 0xc1)),GHIDRA_CAST<uint8_t *>("ItemsArrowUp"));
arrowLayer->_visible = 0;
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((in_ECX + 0xc1)),GHIDRA_CAST<uint8_t *>("ItemsArrowDown"));
arrowLayer->_visible = 0;
goto LAB_008d3fcb;
}
if (in_ECX[5] == 0) {
iVar9 = in_ECX[0x192];
if ((iVar9 == 1) || ((0x1e < iVar9 && (iVar9 == (iVar9 / 0xf) * 0xf)))) {
local_3c = (void *)0x14;
cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(local_44,FUN_00a20940,&local_3c,0,0,uVar7);
if (cVar6 == '\0') {
local_34 = 0x15;
cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(deviceId,FUN_00a20940,&local_34,0,0);
if (cVar6 == '\0') goto LAB_008d3bc8;
iVar9 = local_28 + -1;
if (in_ECX[0xd] + 1 < local_28 + -1) {
iVar9 = in_ECX[0xd] + 1;
}
}
else {
iVar9 = 0;
if (0 < in_ECX[0xd] + -1) {
iVar9 = in_ECX[0xd] + -1;
}
}
in_ECX[0xd] = iVar9;
}
LAB_008d3bc8:
deviceId = local_44;
iVar9 = in_ECX[0x193];
if ((iVar9 == 1) || ((0x1e < iVar9 && (iVar9 == (iVar9 / 0xf) * 0xf)))) {
actionMenuUp = 0x16;
cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(local_44,FUN_00a20940,&actionMenuUp,0,0);
if (cVar6 == '\0') {
actionMenuDown = 0x17;
cVar6 = (**(code **)(PTR_vftable_00c57b18 + 0x74))
(deviceId,FUN_00a20940,&actionMenuDown,0,0);
if ((cVar6 != '\0') && (in_ECX[0xd] + *in_ECX <= local_28 + -1)) {
in_ECX[0xd] = in_ECX[0xd] + *in_ECX;
}
}
else if (*in_ECX <= in_ECX[0xd]) {
iVar11 = in_ECX[0xd] - *in_ECX;
iVar9 = 0;
if (0 < iVar11) {
iVar9 = iVar11;
}
in_ECX[0xd] = iVar9;
}
}
piVar8 = GHIDRA_CAST<int *>(in_ECX[0xd]);
iVar9 = in_ECX[0xc];
if (GHIDRA_INT(piVar8) < iVar9) {
iVar11 = 0;
if (0 < iVar9 + -6) {
iVar11 = iVar9 + -6;
}
}
else {
if (GHIDRA_INT(piVar8) < in_ECX[2] + iVar9) goto LAB_008d3caf;
iVar11 = local_28 + -1;
if (iVar9 + 6 < local_28 + -1) {
iVar11 = iVar9 + 6;
}
}
in_ECX[0xc] = iVar11;
}
LAB_008d3caf:
piVar1 = GHIDRA_CAST<int *>(in_ECX[0xe]);
if (piVar1 == GHIDRA_CAST<int *>(0x0)) {
LAB_008d3d91:
piVar1 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(shownItems) + GHIDRA_INT(piVar8) * 0x1c + 8));
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(shownItems) + GHIDRA_INT(piVar8) * 0x1c + 4)) == '\0') {
local_44 = &g_manager->_infoDisplay;
local_54 = piVar1;
msvc::set<int>::find_node(local_74,&local_54);
if (((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_6c) + 0xd)) == '\0') &&
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_6c) + 0x10)) <= GHIDRA_INT(piVar1))) &&
(local_6c != (local_44->_collectibles)._head)) {
local_6c = (void *)(GHIDRA_INT(local_6c) + 0x14);
}
else {
local_6c = &local_44->_defaultEntry;
}
in_ECX[0xe] = GHIDRA_INT(local_6c);
(GHIDRA_CAST<StatsPanel *>((local_6c)))->StatsPanel::set(ownerPlayer,0);
uVar7 = *GHIDRA_CAST<uint32_t *>((in_ECX[0xe] + 4));
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
if (GHIDRA_INT(uVar7) < 0) goto LAB_008d3f32;
}
else if (GHIDRA_INT(uVar7) < 0) {
if ((GHIDRA_INT(uVar7) < 0) &&
(pvVar10 = (g_game->_proceduralItemManager)._proceduralItems._begin,
GHIDRA_INT(~uVar7) <
GHIDRA_INT((g_game->_proceduralItemManager)._proceduralItems._end) - GHIDRA_INT(pvVar10) >> 2)) {
iVar9 = **GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar10) + ~uVar7 * 4));
}
else {
iVar9 = 0;
}
goto LAB_008d3ede;
}
pvVar10 = (g_manager->_itemConfig)._collectibles._begin;
if (GHIDRA_INT(uVar7) < GHIDRA_INT((g_manager->_itemConfig)._collectibles._end) - GHIDRA_INT(pvVar10) >> 2) {
iVar9 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + uVar7 * 4));
goto LAB_008d3ede;
}
LAB_008d3f32:
(GHIDRA_CAST<KAGE::SmartPointer *>((in_ECX + 0xf)))->KAGE::SmartPointer::reset((void *)0x0);
}
else {
local_44 = GHIDRA_CAST<InfoDisplay *>((GHIDRA_UINT(piVar1) & 0xffff7fff));
msvc::set<int>::find_node(local_5c,&local_44);
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_54) + 0xd)) == '\0') &&
(local_54[4] <= GHIDRA_INT((GHIDRA_UINT(piVar1) & 0xffff7fff)))) {
piVar8 = local_54;
}
else {
piVar8 = (g_manager->_infoDisplay)._trinkets._head;
}
if (piVar8 == (g_manager->_infoDisplay)._trinkets._head) {
piVar8 = &(g_manager->_infoDisplay)._defaultEntry;
}
else {
piVar8 = piVar8 + 5;
}
in_ECX[0xe] = GHIDRA_INT(piVar8);
(GHIDRA_CAST<StatsPanel *>((piVar8)))->StatsPanel::set(ownerPlayer,0);
uVar7 = *GHIDRA_CAST<uint32_t *>((in_ECX[0xe] + 4)) & 0x7fff;
pvVar10 = (g_manager->_itemConfig)._trinkets._begin;
if (GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar10) >> 2 <= GHIDRA_INT(uVar7))
goto LAB_008d3f32;
iVar9 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar10) + uVar7 * 4));
LAB_008d3ede:
if (iVar9 == 0) goto LAB_008d3f32;
path = GHIDRA_CAST<uint8_t *>((iVar9 + 0x38));
if (0xf < *GHIDRA_CAST<uint32_t *>((iVar9 + 0x4c))) {
path = *GHIDRA_CAST<uint8_t **>(path);
}
pvVar10 = Manager::LoadImage(loadedImage,path);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
(GHIDRA_CAST<KAGE::SmartPointer *>((in_ECX + 0xf)))->KAGE::SmartPointer::operator_assign(pvVar10);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (((local_54 != GHIDRA_CAST<int *>(0x0)) && (cVar6 = (**(code **)(*local_54 + 0xc))(), cVar6 != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(loadedImage);
}
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
}
in_ECX[0x11] = 0;
iVar9 = in_ECX[0xe];
piVar8 = GHIDRA_CAST<int *>(local_48[0xd]);
local_48[0x12] =
(*GHIDRA_CAST<int *>((iVar9 + 0x24)) - *GHIDRA_CAST<int *>((iVar9 + 0x20))) / 0x68 +
(*GHIDRA_CAST<int *>((iVar9 + 0x30)) - *GHIDRA_CAST<int *>((iVar9 + 0x2c))) / 0x68;
in_ECX = local_48;
}
else if (*piVar1 == 0) {
if (piVar1[1] != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(shownItems) + GHIDRA_INT(piVar8) * 0x1c + 8))) goto LAB_008d3d91;
}
else if ((*piVar1 == 1) &&
(local_54 = piVar8, piVar1[1] != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(shownItems) + GHIDRA_INT(piVar8) * 0x1c + 8))))
goto LAB_008d3d91;
manager = g_manager;
if (piVar8 != local_40) {
local_48 = GHIDRA_CAST<int *>(0x11a);
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_48));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_48),1.0,2,0,1.0,0.0);
}
isArrowVisible = 0 < in_ECX[0xc];
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((in_ECX + 0xc1)),GHIDRA_CAST<uint8_t *>("ItemsArrowUp"));
arrowLayer->_visible = isArrowVisible;
isArrowVisible = GHIDRA_UINT(in_ECX[2]) < GHIDRA_UINT((local_28 - in_ECX[0xc]));
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((in_ECX + 0xc1)),GHIDRA_CAST<uint8_t *>("ItemsArrowDown"));
arrowLayer->_visible = isArrowVisible;
LAB_008d3fcb:
if (shownItems != (void *)0x0) {
uVar7 = ((GHIDRA_INT(shownItemsCapacity) - GHIDRA_INT(shownItems)) / 0x1c) * 0x1c;
pvVar10 = shownItems;
if (0xfff < uVar7) {
pvVar10 = *(void **)(GHIDRA_CAST<char *>(shownItems) + -4);
uVar7 = uVar7 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(shownItems) + (-4 - GHIDRA_INT(pvVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar10,uVar7);
}
ExceptionList = local_1c;
return;
}
// 008d4040
void PauseScreen::update_trinket_display()
{
char cVar1;
uint8_t *path;
void *pvVar2;
uint32_t scrollLimit;
LayerState *arrowLayer;
uint32_t uVar3;
Entity_Player *pEVar4;
uint32_t in_stack_ffffffb8;
uint8_t local_2c [8];
void *infoNode;
PauseScreen *pauseScreen;
uint8_t trinketImage [4];
int *local_18;
Entity_Player *local_14;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
int trinketConfig;
local_8 = 0xffffffff;
puStack_c = &LAB_00b05d9d;
local_10 = ExceptionList;
ExceptionList = &local_10;
trinketConfig = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18))));
if (GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) - trinketConfig)) < 4) {
local_14 = GHIDRA_CAST<Entity_Player *>(0x0);
trinketConfig = 0;
}
else {
local_14 = *GHIDRA_CAST<Entity_Player **>((trinketConfig + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) * 4));
trinketConfig = *GHIDRA_CAST<int *>((trinketConfig + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) * 4));
}
pauseScreen = this;
if ((*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) < 2) &&
(uVar3 = *GHIDRA_CAST<uint32_t *>((trinketConfig + 0x16c0 + *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) * 4)), uVar3 != 0)) {
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c)))) == 0) || (uVar3 != *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c)))) + 4)))) {
local_18 = GHIDRA_CAST<int *>((uVar3 & 0xffff7fff));
msvc::set<int>::find_node(local_2c,&local_18);
pEVar4 = local_14;
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(infoNode) + 0xd)) != '\0') ||
(GHIDRA_INT((uVar3 & 0xffff7fff)) < *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(infoNode) + 0x10)))) {
infoNode = (g_manager->_infoDisplay)._trinkets._head;
}
if (infoNode == (g_manager->_infoDisplay)._trinkets._head) {
infoNode = &(g_manager->_infoDisplay)._defaultEntry;
}
else {
infoNode = (void *)(GHIDRA_INT(infoNode) + 0x14);
}
*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c))) = infoNode;
in_stack_ffffffb8 = 0x8d412a;
(GHIDRA_CAST<StatsPanel *>((infoNode)))->StatsPanel::set(local_14,(uint8_t)(uVar3 >> 0xf) & 1);
uVar3 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c)))) + 4)) & 0x7fff;
pvVar2 = (g_manager->_itemConfig)._trinkets._begin;
if ((GHIDRA_INT(uVar3) < GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(pvVar2) >> 2) &&
(trinketConfig = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + uVar3 * 4)), trinketConfig != 0)) {
path = GHIDRA_CAST<uint8_t *>((trinketConfig + 0x38));
if (0xf < *GHIDRA_CAST<uint32_t *>((trinketConfig + 0x4c))) {
path = *GHIDRA_CAST<uint8_t **>(path);
}
in_stack_ffffffb8 = 0x8d416d;
pvVar2 = Manager::LoadImage(trinketImage,path);
local_8 = 0;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x50))))))->KAGE::SmartPointer::operator_assign(pvVar2);
local_8 = 1;
if (((local_18 != GHIDRA_CAST<int *>(0x0)) && (cVar1 = (**(code **)(*local_18 + 0xc))(), cVar1 != '\0'))
&& (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(trinketImage);
}
local_8 = 0xffffffff;
}
else {
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x50))))))->KAGE::SmartPointer::reset((void *)0x0);
}
}
else {
pEVar4 = local_14;
}
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c)))) != 0) {
FUN_008d47c0(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c)))),&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x58))),&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5c))),in_stack_ffffffb8,
0x41f00000,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) == 2);
scrollLimit = InfoDisplayEntry::count_lines(pEVar4,pEVar4->_trinketsID[0]);
trinketConfig = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x58))));
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("TrinketArrowUp"));
arrowLayer->_visible = 0 < trinketConfig;
uVar3 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pauseScreen)) + 0x5c))));
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("TrinketArrowDown"));
arrowLayer->_visible = uVar3 < scrollLimit;
ExceptionList = local_10;
return;
}
}
else {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4c)))) = 0;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x50))))))->KAGE::SmartPointer::reset((void *)0x0);
}
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("TrinketArrowUp"));
arrowLayer->_visible = 0;
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x304)))),GHIDRA_CAST<uint8_t *>("TrinketArrowDown"));
arrowLayer->_visible = 0;
ExceptionList = local_10;
return;
}
// 008d42a0
void PauseScreen::update_pocket_item_display()
{
PauseScreen *entityConfig = this;
int pocketId;
EntityConfig_Entity *pickupConfig;
uint32_t cardDisplay;
void *pvVar2;
std_string *anm2PathChars;
LayerState *arrowLayer;
char *freePtr;
Entity_Player *player;
uint32_t uVar3;
uint32_t uVar4;
int iVar5;
uint32_t in_stack_ffffff80;
std_string cardAnm2Path;
std_string anm2PathStr;
uint32_t local_24;
void **ppvStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
EntityConfig *entityConfig;
bool isAnyLayerVisible;
Manager *manager;
int pocketId;
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50);
local_14 = 0xffffffff;
puStack_18 = &LAB_00b05ddd;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_INT(&cardAnm2Path) + 0x44U;
ExceptionList = &local_1c;
if (GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x1c)))) - *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x18)))))) < 4) {
player = GHIDRA_CAST<Entity_Player *>(0x0);
}
else {
player = *GHIDRA_CAST<Entity_Player **>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x18)))) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x24)))) * 4));
}
pocketId = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x2c))));
if (pocketId < 1) {
pocketId = 0;
}
iVar5 = 3;
if (pocketId < 3) {
iVar5 = pocketId;
}
pocketId = player->_pocketSlots[iVar5 * 2 + 1];
if (pocketId == 0) {
pocketId = player->_pocketSlots[iVar5 * 2];
joined_r0x008d4475:
if (pocketId == 0) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x60)))) = 0;
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))));
goto LAB_008d448a;
}
}
else if (pocketId == 1) {
pocketId = player->_pocketSlots[iVar5 * 2];
goto joined_r0x008d4475;
}
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x60)))) == 0) || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x178)))) != pocketId)) ||
(ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50),
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x60)))) + 4)) != player->_pocketSlots[iVar5 * 2])) {
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x178)))) = pocketId;
if (player->_pocketSlots[iVar5 * 2 + 1] == 0) {
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50);
pocketId = (GHIDRA_CAST<ItemPool *>((&g_game->_itemPool)))->ItemPool::GetPillEffect(player->_pocketSlots[iVar5 * 2],player);
pocketId = InfoDisplay::get_pill(pocketId);
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x60)))) = pocketId;
uVar3 = player->_pocketSlots[iVar5 * 2] & 0x7ff;
uVar3 = -GHIDRA_UINT((uVar3 != 0)) & uVar3;
uVar4 = 0xe;
if (uVar3 < 0xe) {
uVar4 = uVar3;
}
entityConfig = &g_manager->_entityConfig;
*GHIDRA_CAST<bool *>((pocketId + 0x44)) = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>((&g_game->_itemPool + 1)) + uVar4 + 0x3c)) == '\0';
in_stack_ffffff80 = 5;
pickupConfig = EntityConfig::GetEntity(entityConfig,5,0x46,player->_pocketSlots[iVar5 * 2]);
if (pickupConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))));
}
else {
anm2PathChars = &pickupConfig->anm2Path;
if (0xf < (pickupConfig->anm2Path)._capacity) {
anm2PathChars = *GHIDRA_CAST<std_string **>(anm2PathChars->_buf);
}
(GHIDRA_CAST<msvc::string *>((anm2PathStr._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>(anm2PathChars));
local_14 = 0;
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))),&anm2PathStr,1);
local_14 = 0xffffffff;
if (0xf < anm2PathStr._capacity) {
uVar4 = anm2PathStr._capacity + 1;
freePtr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2PathStr._buf))) + 0x0)));
if (0xfff < uVar4) {
freePtr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2PathStr._buf)) + 0x0))) + -4));
uVar4 = anm2PathStr._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2PathStr._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freePtr,uVar4);
}
in_stack_ffffff80 = 0x8d44e9;
ANM2::Play(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))),s_Idle,0);
}
}
else {
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50);
if (player->_pocketSlots[iVar5 * 2 + 1] == 1) {
ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50);
cardDisplay = InfoDisplay::get_card(player->_pocketSlots[iVar5 * 2]);
manager = g_manager;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x60)))) = cardDisplay;
pocketId = player->_pocketSlots[iVar5 * 2];
if ((pocketId < 0) ||
(GHIDRA_INT((manager->_itemConfig)._cards._end) - GHIDRA_INT((manager->_itemConfig)._cards._begin) >> 2
<= pocketId)) {
pocketId = 0;
}
else {
pocketId = *GHIDRA_CAST<int *>((GHIDRA_INT((manager->_itemConfig)._cards._begin) + pocketId * 4));
}
in_stack_ffffff80 = 5;
pickupConfig = EntityConfig::GetEntity(&manager->_entityConfig,5,300,*GHIDRA_CAST<int *>((pocketId + 0x54)))
;
if (pickupConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))));
}
else {
anm2PathStr._size = 0;
anm2PathStr._capacity = 0xf;
anm2PathStr._buf[0] = '\0';
anm2PathStr._buf[1] = '\0';
anm2PathStr._buf[2] = '\0';
anm2PathStr._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2PathStr._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2PathStr._size = 0x19;
anm2PathStr._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2PathStr._buf))) + 0x0))),"gfx/ui/ui_cardspills.anm2",0x1a);
local_14 = 1;
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))),&anm2PathStr,1);
local_14 = 0xffffffff;
if (0xf < anm2PathStr._capacity) {
uVar4 = anm2PathStr._capacity + 1;
freePtr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2PathStr._buf))) + 0x0)));
if (0xfff < uVar4) {
freePtr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2PathStr._buf)) + 0x0))) + -4));
uVar4 = anm2PathStr._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2PathStr._buf)) + 0x0))) + (-4 - GHIDRA_INT(freePtr))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freePtr,uVar4);
}
in_stack_ffffff80 = 0x8d4636;
ANM2::SetFrame(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))),GHIDRA_CAST<std_string *>("CardFronts"),
player->_pocketSlots[iVar5 * 2]);
uVar4 = 0;
isAnyLayerVisible = false;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0xe4)))) != 0) {
do {
pvVar2 = AnimationState::GetLayerFrame(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x94)))),uVar4);
if ((pvVar2 != (void *)0x0) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar2) + 0x2c)) != '\0')) {
isAnyLayerVisible = true;
}
uVar4 = uVar4 + 1;
} while (uVar4 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0xe4)))));
if (isAnyLayerVisible) goto LAB_008d471f;
}
anm2PathChars = &pickupConfig->anm2Path;
if (0xf < (pickupConfig->anm2Path)._capacity) {
anm2PathChars = *GHIDRA_CAST<std_string **>(anm2PathChars->_buf);
}
(GHIDRA_CAST<msvc::string *>((cardAnm2Path._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>(anm2PathChars));
local_14 = 2;
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))),&cardAnm2Path,1);
local_14 = 0xffffffff;
if (0xf < cardAnm2Path._capacity) {
uVar4 = cardAnm2Path._capacity + 1;
pvVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)cardAnm2Path._buf)) + 0x0)));
if (0xfff < uVar4) {
pvVar2 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(cardAnm2Path._buf)) + 0x0))) + -4);
uVar4 = cardAnm2Path._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(cardAnm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar2,uVar4);
}
cardAnm2Path._size = 0;
cardAnm2Path._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(cardAnm2Path._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(cardAnm2Path._buf)) + 0x0))) & 0xffffff00;
in_stack_ffffff80 = 0x8d4712;
ANM2::Play(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x64)))),&DAT_00b6b338,0);
}
}
}
}
LAB_008d471f:
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x60)))) != 0) {
FUN_008d47c0(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x60)))),&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x17c))),&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x180))),
in_stack_ffffff80,0x41f00000,*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x14)))) == 3);
uVar3 = InfoDisplayEntry::count_lines(player,player->_pocketSlots[0]);
pocketId = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x17c))));
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x304)))),GHIDRA_CAST<uint8_t *>("PocketArrowUp"));
arrowLayer->_visible = 0 < pocketId;
uVar4 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x180))));
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x304)))),GHIDRA_CAST<uint8_t *>("PocketArrowDown"));
arrowLayer->_visible = uVar4 < uVar3;
ExceptionList = local_1c;
return;
}
LAB_008d448a:
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x304)))),GHIDRA_CAST<uint8_t *>("PocketArrowUp"));
arrowLayer->_visible = 0;
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entityConfig)) + 0x304)))),GHIDRA_CAST<uint8_t *>("PocketArrowDown"));
arrowLayer->_visible = 0;
ExceptionList = local_1c;
return;
}
// 008d84f0
void PauseScreen::update_items_menu_selection()
{
char isPressed;
uint32_t uVar1;
int iVar2;
int clampedActiveSlot;
int *piVar3;
int activeSlot;
uint32_t uVar4;
Entity_Player *pEVar5;
uint8_t *puVar6;
int *newPlayersEnd;
size_t _Size;
int *playersBegin;
int *playersEnd;
int *playersCapacity;
int local_20;
Entity_Player *local_1c;
void *listBegin;
int *playersBuffer;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
puStack_c = &LAB_00af1e1d;
local_10 = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
ExceptionList = &local_10;
newPlayersEnd = GHIDRA_CAST<int *>(0x0);
playersBuffer = GHIDRA_CAST<int *>(0x0);
playersBegin = GHIDRA_CAST<int *>(0x0);
playersEnd = GHIDRA_CAST<int *>(0x0);
playersCapacity = GHIDRA_CAST<int *>(0x0);
local_8 = 0;
local_1c = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((g_game->_pauseScreen)._playerIdx);
if (local_1c == GHIDRA_CAST<Entity_Player *>(0x0)) {
piVar3 = GHIDRA_CAST<int *>(0x0);
}
else {
msvc::vector<unsigned_int>::_Emplace_reallocate(0,&local_1c);
pEVar5 = local_1c;
local_1c = GHIDRA_CAST<Entity_Player *>(local_1c->_twinPlayer);
if (local_1c != GHIDRA_CAST<Entity_Player *>(0x0)) {
if (playersEnd == playersCapacity) {
msvc::vector<unsigned_int>::_Emplace_reallocate(playersEnd,&local_1c);
}
else {
*playersEnd = GHIDRA_INT(local_1c);
playersEnd = playersEnd + 1;
}
}
local_1c = GHIDRA_CAST<Entity_Player *>(pEVar5->_subPlayer);
if (local_1c != GHIDRA_CAST<Entity_Player *>(0x0)) {
if (playersEnd == playersCapacity) {
msvc::vector<unsigned_int>::_Emplace_reallocate(playersEnd,&local_1c);
}
else {
*playersEnd = GHIDRA_INT(local_1c);
playersEnd = playersEnd + 1;
}
}
local_1c = pEVar5->_backupPlayer;
if (local_1c != GHIDRA_CAST<Entity_Player *>(0x0)) {
if (playersEnd == playersCapacity) {
msvc::vector<unsigned_int>::_Emplace_reallocate(playersEnd,&local_1c);
playersBuffer = playersBegin;
piVar3 = playersBegin;
newPlayersEnd = playersEnd;
goto LAB_008d85f0;
}
*playersEnd = GHIDRA_INT(local_1c);
playersEnd = playersEnd + 1;
}
playersBuffer = playersBegin;
piVar3 = playersBegin;
newPlayersEnd = playersEnd;
}
LAB_008d85f0:
listBegin = *(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18)));
_Size = GHIDRA_INT(newPlayersEnd) - GHIDRA_INT(piVar3);
local_1c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(_Size) >> 2));
if (local_1c == GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) - GHIDRA_INT(listBegin) >> 2))) {
uVar4 = 0;
if (local_1c != GHIDRA_CAST<Entity_Player *>(0x0)) {
local_20 = GHIDRA_INT(listBegin) - GHIDRA_INT(playersBuffer);
do {
if (*piVar3 != *GHIDRA_CAST<int *>((local_20 + GHIDRA_INT(piVar3)))) goto LAB_008d878b;
uVar4 = uVar4 + 1;
piVar3 = piVar3 + 1;
} while (uVar4 < local_1c);
}
puVar6 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18)));
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
iVar2 = -1;
}
else {
iVar2 = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) - *GHIDRA_CAST<int *>(puVar6) >> 2 == 0) goto LAB_008d8819;
local_20 = 0xb;
isPressed = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar2,FUN_00a209e0,&local_20,0,0,uVar1);
if (isPressed == '\0') goto LAB_008d8819;
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14))));
if (iVar2 == 0) {
uVar1 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24))));
uVar4 = (uVar1 + 1) % GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) - *GHIDRA_CAST<int *>(puVar6) >> 2));
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = uVar4;
if (uVar1 == uVar4) goto LAB_008d8819;
goto LAB_008d87cd;
}
if (iVar2 != 2) {
if (iVar2 == 3) {
local_1c = *GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c))));
pEVar5 = local_1c;
do {
pEVar5 = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pEVar5)) + 0x1)))) & 3));
*GHIDRA_CAST<Entity_Player **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c)))) = pEVar5;
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) - *GHIDRA_CAST<int *>(puVar6) & 0xfffffffcU) == 0) {
iVar2 = 0;
}
else {
iVar2 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar6) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) * 4));
}
activeSlot = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c))));
if (activeSlot < 1) {
activeSlot = 0;
}
clampedActiveSlot = 3;
if (activeSlot < 3) {
clampedActiveSlot = activeSlot;
}
} while ((*GHIDRA_CAST<int *>((iVar2 + 0x17a0 + clampedActiveSlot * 8)) == 0) && (local_1c != pEVar5));
if (local_1c != pEVar5) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x17c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x180)))) = 0;
}
}
goto LAB_008d8819;
}
uVar1 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28))));
uVar4 = uVar1;
do {
uVar4 = uVar4 - 1 & 1;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) = uVar4;
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) - *GHIDRA_CAST<int *>(puVar6) & 0xfffffffcU) == 0) {
iVar2 = 0;
}
else {
iVar2 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(puVar6) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) * 4));
}
} while (((1 < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28))))) ||
(*GHIDRA_CAST<int *>((iVar2 + 0x16c0 + *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) * 4)) == 0)) && (uVar1 != uVar4));
if (uVar1 == uVar4) goto LAB_008d8819;
}
else {
LAB_008d878b:
*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c))) = listBegin;
if (GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18)))) != &playersBegin) {
if (GHIDRA_CAST<Entity_Player *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) - GHIDRA_INT(listBegin) >> 2)) < local_1c) {
msvc::vector<int>::reserve_clear(local_1c);
listBegin = *(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18)));
}
memmove(listBegin,playersBuffer,_Size);
*GHIDRA_CAST<size_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) = GHIDRA_INT(listBegin) + _Size;
}
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = 0;
LAB_008d87cd:
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x180)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x17c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x48)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x34)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x30)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) = 0;
}
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x58)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5c)))) = 0;
LAB_008d8819:
if (playersBuffer != GHIDRA_CAST<int *>(0x0)) {
uVar1 = GHIDRA_INT(playersCapacity) - GHIDRA_INT(playersBuffer) & 0xfffffffc;
newPlayersEnd = playersBuffer;
if (0xfff < uVar1) {
newPlayersEnd = GHIDRA_CAST<int *>(playersBuffer[-1]);
uVar1 = uVar1 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(playersBuffer) + (-4 - GHIDRA_INT(newPlayersEnd))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(newPlayersEnd,uVar1);
}
ExceptionList = local_10;
return;
}
// 009b5320
void PauseScreen::constructor()
{
GenericPrompt *pGVar1;
ANM2 *pAVar2;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00b0e5c3;
local_10 = ExceptionList;
ExceptionList = &local_10;
this->_menuType = 0;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c)))));
local_8 = 0;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x140)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x254)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x368)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
ANM2::constructor(&(this->_genericPrompt)._sprite);
(this->_genericPrompt)._isOnlineVote = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x114)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x118)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x11c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x120)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x124)))) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5b0)))))))->Menu_Options::constructor();
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x838)))) = 6;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x83c)))) = 6;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x840)))) = 0x24;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x844)))) = 2;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x848))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x84c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x850)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x854)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x858)))) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x868)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x86c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x870)))) = 0;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x874))))))->KAGE::SmartPointer::SmartPointer((void *)0x0);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x87c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x880)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x884)))) = 0;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x888))))))->KAGE::SmartPointer::SmartPointer((void *)0x0);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x890)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x894)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x898)))) = 0;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x89c)))));
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9b0)))) = 0xffffffff;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9b4)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9b8)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9bc)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9cc)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9d0)))) = 0xf;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9bc))) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 10;
Font::Font(GHIDRA_CAST<Font *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x9d4)))));
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa20)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa24)))) = 0x3f800000;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xa28)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xc;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xb3c)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xd;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc50)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xe;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xd64)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xf;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe78))))))->KAGE::SmartPointer::SmartPointer((void *)0x0);
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe80)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe84)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe88)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe8c)))) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x11;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe94)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x12;
(GHIDRA_CAST<MenuDialog *>((this + 1)))->MenuDialog::constructor();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x13;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x268)))) = 0;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x26c)))));
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0x14);
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x380)))));
pGVar1 = &this[1]._genericPrompt;
(pGVar1->_sprite)._animDefaultName._buf[0] = '\0';
(pGVar1->_sprite)._animDefaultName._buf[1] = '\0';
(pGVar1->_sprite)._animDefaultName._buf[2] = '\0';
(pGVar1->_sprite)._animDefaultName._buf[3] = '\0';
pAVar2 = &this[1]._genericPrompt._sprite;
(pAVar2->_animDefaultName)._buf[4] = '\0';
(pAVar2->_animDefaultName)._buf[5] = '\0';
(pAVar2->_animDefaultName)._buf[6] = '\0';
(pAVar2->_animDefaultName)._buf[7] = '\0';
pAVar2 = &this[1]._genericPrompt._sprite;
(pAVar2->_animDefaultName)._buf[8] = '\0';
(pAVar2->_animDefaultName)._buf[9] = '\0';
(pAVar2->_animDefaultName)._buf[10] = '\0';
(pAVar2->_animDefaultName)._buf[0xb] = '\0';
pAVar2 = &this[1]._genericPrompt._sprite;
(pAVar2->_animDefaultName)._buf[0xc] = '\0';
(pAVar2->_animDefaultName)._buf[0xd] = '\0';
(pAVar2->_animDefaultName)._buf[0xe] = '@';
(pAVar2->_animDefaultName)._buf[0xf] = '?';
*GHIDRA_CAST<uint8_t *>(&this[1]._genericPrompt._sprite._animDefaultName._size) = 0;
ExceptionList = local_10;
return;
}
// 009b5600
PauseScreen::~PauseScreen()
{
char isImageReleasable;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00b0e5e0;
local_10 = ExceptionList;
ExceptionList = &local_10;
FUN_008d0f10(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
(GHIDRA_CAST<MenuDialog *>((this + 1)))->MenuDialog::~MenuDialog();
local_8 = 0;
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe94)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xee4)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xec4)))));
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xeac))))))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe94))))))->msvc::string::_Tidy_deallocate();
local_8 = 1;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe8c)))) != GHIDRA_CAST<int *>(0x0)) {
isImageReleasable = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe8c)))) + 0xc))();
if ((isImageReleasable != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe88))));
}
}
(GHIDRA_CAST<PauseScreen_MyStuff *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x838))))))->PauseScreen_MyStuff::~PauseScreen_MyStuff();
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5b0)))))))->Menu_Options::~Menu_Options();
local_8 = 2;
ANM2::Reset(&(this->_genericPrompt)._sprite);
AnimationState::~AnimationState(&(this->_genericPrompt)._sprite._overlayAnimState);
AnimationState::~AnimationState(&(this->_genericPrompt)._sprite._animState);
(GHIDRA_CAST<msvc::string *>(((this->_genericPrompt)._sprite._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_genericPrompt))))->msvc::string::_Tidy_deallocate();
local_8 = 3;
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x368)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3b8)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))));
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x380))))))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x368))))))->msvc::string::_Tidy_deallocate();
local_8 = 4;
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x254)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a4)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x284)))));
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x26c))))))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x254))))))->msvc::string::_Tidy_deallocate();
local_8 = 5;
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x140)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x190)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x170)))));
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x158))))))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x140))))))->msvc::string::_Tidy_deallocate();
local_8 = 6;
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x7c)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5c)))));
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x44))))))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c))))))->msvc::string::_Tidy_deallocate();
ExceptionList = local_10;
return;
}
// 009b5840
void PauseScreen::Init()
{
PauseScreen *deathScreenSprite = this;
PauseScreen *pPVar1;
uint8_t bVar2;
char isLastRef;
uint8_t *curAnimName;
LayerState *layer;
void *other;
char *pcVar3;
uint32_t uVar4;
uint8_t *pbVar5;
uint8_t *deathScreenSprite;
bool isLess;
uint8_t myStuffImage [4];
int *myStuffImageRefCount;
Vector optionsPos;
PauseScreen *pauseScreen;
std_string anm2Path;
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
puStack_20 = myStuffImage + 0x4c;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0e62d;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((myStuffImage + 0x40));
ExceptionList = &local_1c;
optionsPos.x = 0.0;
optionsPos.y = 0.0;
pauseScreen = deathScreenSprite;
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x5b0)))))))->Menu_Options::Init(&optionsPos,1);
(GHIDRA_CAST<PauseScreen_MyStuff *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x838))))))->PauseScreen_MyStuff::Init();
CompletionMarks::Load(1);
deathScreenSprite->_state = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x8)))) = 2;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x24)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x28)))) = 0;
*GHIDRA_CAST<uint8_t *>(&deathScreenSprite[1]._genericPrompt._sprite._animDefaultName._size) = 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<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x17;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen.anm2",0x18);
local_14 = 0;
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x2c)))),&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar4 = anm2Path._capacity + 1;
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar4) {
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar4 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar3,uVar4);
}
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x1d;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen_small.anm2",0x1e);
local_14 = 1;
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x140)))),&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar4 = anm2Path._capacity + 1;
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar4) {
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar4 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar3,uVar4);
}
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x1c;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreenStats.anm2",0x1d);
local_14 = 2;
ANM2::Load(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x254)))),&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar4 = anm2Path._capacity + 1;
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar4) {
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar4 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar3,uVar4);
}
deathScreenSprite = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x368)));
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x18;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19);
local_14 = 3;
ANM2::Load(GHIDRA_CAST<ANM2 *>(deathScreenSprite),&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar4 = anm2Path._capacity + 1;
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar4) {
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar4 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar3,uVar4);
}
pbVar5 = *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x39c))));
if (pbVar5 != GHIDRA_CAST<uint8_t *>(0x0)) {
curAnimName = pbVar5;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar5 + 0x14))) {
curAnimName = *GHIDRA_CAST<uint8_t **>(pbVar5);
}
pcVar3 = "Diary";
do {
bVar2 = *curAnimName;
isLess = bVar2 < (uint8_t)*pcVar3;
if (bVar2 != *pcVar3) {
LAB_009b5bd0:
uVar4 = -GHIDRA_UINT(isLess) | 1;
goto LAB_009b5bd5;
}
if (bVar2 == 0) break;
bVar2 = curAnimName[1];
isLess = bVar2 < (uint8_t)pcVar3[1];
if (bVar2 != pcVar3[1]) goto LAB_009b5bd0;
curAnimName = curAnimName + 2;
pcVar3 = pcVar3 + 2;
} while (bVar2 != 0);
uVar4 = 0;
LAB_009b5bd5:
if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x3ac))) != '\0')))) goto LAB_009b5c01;
}
bVar2 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(deathScreenSprite),GHIDRA_CAST<uint8_t *>("Diary"),1);
if (bVar2 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x398)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((deathScreenSprite)) + 0x3ac))) = 1;
}
LAB_009b5c01:
pbVar5 = GHIDRA_CAST<uint8_t *>(0x0);
do {
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(deathScreenSprite),pbVar5);
pbVar5 = pbVar5 + 1;
layer->_visible = 0;
} while (GHIDRA_INT(pbVar5) < 7);
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(deathScreenSprite),&DAT_00000006);
layer->_visible = 1;
other = Manager::LoadImage(myStuffImage,GHIDRA_CAST<uint8_t *>("gfx/ui/menu_mystuff.png"));
pPVar1 = pauseScreen;
local_14 = 4;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pauseScreen)) + 0xe88))))))->KAGE::SmartPointer::operator_assign(other);
local_14 = 5;
if (myStuffImageRefCount != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*myStuffImageRefCount + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(myStuffImage);
}
}
local_14 = 0xffffffff;
(GHIDRA_CAST<GenericPrompt *>((&pPVar1->_genericPrompt)))->GenericPrompt::Initialize(1);
load_drop_player_menu();
ExceptionList = local_1c;
return;
}
// 009b5d20
void PauseScreen::Update()
{
char cVar1;
uint8_t bVar2;
uint32_t lobbyMemberCount;
ItemConfig_Item *itemConfig;
Entity_Player *player;
int iVar3;
LayerState *backKeyLayer;
uint8_t *pbVar4;
uint8_t *quitLine1;
void *pvVar5;
uint8_t *puVar6;
uint8_t *prevHistoryItem;
int iVar7;
float fStack_80;
float fStack_7c;
KColor fadeColor;
uint64_t local_60;
Entity_Player *local_58 [2];
uint8_t *local_50;
uint32_t local_4c;
uint32_t local_48;
uint32_t local_44;
PauseScreen *savedThis;
uint8_t *local_3c;
void *local_38;
Entity_Player *local_34;
int local_30;
uint8_t *cleanupFlags;
int controllerIndex;
uint8_t local_21;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
Entity_Player *local_14;
Game *game;
Manager *manager;
puStack_20 = GHIDRA_CAST<uint8_t *>((local_58 + 0x15));
local_14 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
puStack_18 = &LAB_00b0e69f;
local_1c = ExceptionList;
ExceptionList = &local_1c;
local_3c = GHIDRA_CAST<uint8_t *>(0x0);
cleanupFlags = GHIDRA_CAST<uint8_t *>(0x0);
savedThis = this;
cVar1 = FUN_009c3990(__security_cookie ^ GHIDRA_UINT((local_58 + 0x12)));
if (cVar1 != '\0') {
ExceptionList = local_1c;
return;
}
iVar3 = this->_state;
if (iVar3 == 2) {
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5b0)))))))->Menu_Options::Update();
}
else if (iVar3 == 3) {
update_items_menu(GHIDRA_CAST<PauseScreen *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x838)))));
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x848))) == '\0') {
this->_state = 1;
ExceptionList = local_1c;
return;
}
}
else if (iVar3 == 6) {
update_player_info_page(GHIDRA_CAST<PauseScreen *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x268)))));
}
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
controllerIndex = player->_controllerIndex;
}
else {
controllerIndex = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
iVar7 = controllerIndex;
iVar3 = this->_state;
if (iVar3 == 0) {
if ((controllerIndex == 0) &&
((local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60),
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x290)))) != 0 ||
(local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60),
0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x2d8)))))))) goto switchD_009b63f7_default;
bVar2 = input_is_action_triggered(g_manager,0xc,controllerIndex,GHIDRA_CAST<Entity *>(0x0),0);
if (bVar2 == 0) {
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if (iVar7 != 0) goto switchD_009b63f7_default;
bVar2 = input_is_action_triggered(g_manager,0xf,0,GHIDRA_CAST<Entity *>(0x0),0);
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if ((bVar2 == 0) ||
(local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60), g_game->_emoteMenuState != 0))
goto switchD_009b63f7_default;
}
Show(this);
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
goto switchD_009b63f7_default;
}
if (iVar3 != 1) {
if (iVar3 == 2) {
local_58[0] = GHIDRA_CAST<Entity_Player *>(&DAT_0000000f);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,local_58,0,0);
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if (cVar1 != '\0') {
this->_state = 1;
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
}
}
else {
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if (iVar3 == 5) {
online_chat_window_update();
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
}
}
goto switchD_009b63f7_default;
}
local_3c = GHIDRA_CAST<uint8_t *>(0xc);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,&local_3c,0,0);
if (cVar1 != '\0') {
LAB_009b66f6:
this->PopupWindow::hide();
g_manager->_isWindowFocused = 1;
ExceptionList = local_1c;
return;
}
local_3c = &DAT_0000000f;
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_3c,0,0);
if (cVar1 != '\0') goto LAB_009b66f6;
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
local_38 = (void *)0x1c;
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_38,0,0);
if (cVar1 != '\0') {
lobbyMemberCount = online_lobby_get_member_count();
if (1 < lobbyMemberCount) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x268)))) = 0;
this->_state = 6;
}
goto LAB_009b6311;
}
}
if ((g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) ||
((g_game->_dailyChallenge)._id != 0)) {
LAB_009b5fbf:
local_21 = 0;
}
else {
local_3c = GHIDRA_CAST<uint8_t *>(0x18);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_3c,0,0);
if (cVar1 == '\0') goto LAB_009b5fbf;
(GHIDRA_CAST<Multiplayer *>((&DAT_00c79a50)))->Multiplayer::get_lobby(&local_60);
local_14 = GHIDRA_CAST<Entity_Player *>(0x0);
cleanupFlags = GHIDRA_CAST<uint8_t *>(0x1);
local_3c = GHIDRA_CAST<uint8_t *>(0x1);
cVar1 = FUN_00a284b0();
local_21 = 1;
if (cVar1 != '\0') goto LAB_009b5fbf;
}
local_14 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
if ((GHIDRA_UINT(cleanupFlags) & 1) != 0) {
cleanupFlags = GHIDRA_CAST<uint8_t *>((GHIDRA_UINT(cleanupFlags) & 0xfffffffe));
(GHIDRA_CAST<KAGE::Network::Multiplayer::ConstLobby *>((&local_60)))->KAGE::Network::Multiplayer::ConstLobby::~ConstLobby();
}
if (local_21 == 0) {
local_44 = 0x16;
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_44,0,0);
if (cVar1 == '\0') {
local_48 = 0x17;
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,&local_48,0,0);
if (cVar1 == '\0') {
local_4c = 0x14;
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a20940,&local_4c,0,0);
if (cVar1 == '\0') {
local_50 = GHIDRA_CAST<uint8_t *>(0x15);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a20940,&local_50,0,0);
if ((cVar1 != '\0') &&
((iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))), iVar3 == 0 ||
((0x1d < iVar3 && (iVar3 % 10 == 0)))))) {
local_58[0] = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
pvVar5 = (local_58[0]->_history)._historyItems._end;
local_3c = (local_58[0]->_history)._historyItems._begin;
iVar7 = (GHIDRA_INT(pvVar5) - GHIDRA_INT(local_3c)) / 0x1c;
iVar3 = iVar7 + -0x18;
local_30 = 0;
if (0 < iVar3) {
local_30 = iVar3;
}
local_38 = (void *)0x4;
if (iVar7 != 0) {
local_34 = GHIDRA_CAST<Entity_Player *>(0x0);
puVar6 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(pvVar5) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) * -0x1c));
if (puVar6 != local_3c) {
do {
if (0x17 < GHIDRA_INT(local_34)) break;
prevHistoryItem = puVar6 + -0x1c;
if (puVar6[-0x18] == '\0') {
local_3c = *GHIDRA_CAST<uint8_t **>((puVar6 + -0x14));
}
else {
local_3c = GHIDRA_CAST<uint8_t *>(0x0);
}
itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,GHIDRA_INT(local_3c));
if (itemConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
LAB_009b62cb:
local_30 = local_30 + -1;
if (GHIDRA_INT(local_34) < GHIDRA_INT(local_38)) {
local_38 = (void *)(GHIDRA_INT(local_38) + 1);
}
}
else {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
bVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::HasCollectible(GHIDRA_INT(local_3c),1);
if (bVar2 == 0) goto LAB_009b62cb;
local_34 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_34)) + 0x1))));
}
puVar6 = prevHistoryItem;
} while (prevHistoryItem != (local_58[0]->_history)._historyItems._begin);
}
}
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24))));
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = iVar3 + GHIDRA_INT(local_38);
if (local_30 + 3 < iVar3 + GHIDRA_INT(local_38)) {
iVar7 = 0;
if (0 < iVar3) {
iVar7 = iVar3;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = iVar7;
}
iVar7 = controllerIndex;
}
}
else {
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28))));
if ((iVar3 == 0) || ((0x1d < iVar3 && (iVar3 % 10 == 0)))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
local_30 = 4;
local_34 = player;
LAB_009b60e4:
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) + -1;
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = iVar3;
if (0 < iVar3) {
do {
local_38 = (player->_history)._historyItems._begin;
iVar3 = (GHIDRA_INT((player->_history)._historyItems._end) - GHIDRA_INT(local_38)) / 0x1c - iVar3;
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_38) + iVar3 * 0x1c + 4)) == '\0') &&
(itemConfig = ItemConfig::GetCollectible
(&g_manager->_itemConfig,
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38) + iVar3 * 0x1c + 8))),
itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
bVar2 = Entity_Player::HasCollectible
(player,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38) + iVar3 * 0x1c + 8)),1);
if (bVar2 != 0) goto LAB_009b618a;
}
iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) + -1;
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = iVar3;
if (iVar3 < 1) goto LAB_009b618a;
player = local_34;
} while( true );
}
goto LAB_009b6190;
}
}
}
else {
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) + 1;
if (3 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))))) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 0;
}
}
}
else {
puVar6 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)));
*GHIDRA_CAST<int *>(puVar6) = *GHIDRA_CAST<int *>(puVar6) + -1;
if (*GHIDRA_CAST<int *>(puVar6) < 0) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 3;
}
}
}
else {
(GHIDRA_CAST<InviteFriendsMenu *>((this + 1)))->InviteFriendsMenu::load_graphics();
this->_state = 5;
}
LAB_009b6311:
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
bVar2 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::IsLocalPlayer();
if ((bVar2 != 0) && ((g_manager->_lobbySettings)._password._size != 0)) {
local_58[0] = GHIDRA_CAST<Entity_Player *>(&DAT_0000001d);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(iVar7,FUN_00a209e0,local_58,0,0);
if (cVar1 != '\0') {
*GHIDRA_CAST<bool *>(&this[1]._genericPrompt._sprite._animDefaultName._size) =
(char)this[1]._genericPrompt._sprite._animDefaultName._size == '\0';
}
}
}
iVar7 = 0x194;
iVar3 = 0x194;
if (this->_menuType != 1) {
iVar3 = 0x80;
}
if (*GHIDRA_CAST<int *>(((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c)) != 0) {
iVar3 = 400;
if (this->_menuType != 1) {
iVar3 = 0x7c;
}
AnimationState::SetFrameFloat
(GHIDRA_CAST<AnimationState *>(((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c)),
(float)*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))));
}
local_58[0] = GHIDRA_CAST<Entity_Player *>(&DAT_0000000e);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(controllerIndex,FUN_00a209e0,local_58,0,0);
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if (cVar1 == '\0') goto switchD_009b63f7_default;
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
switch(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8))))) {
case 0:
if (this->_menuType != 1) {
iVar7 = 0x80;
}
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if (*GHIDRA_CAST<int *>(((this->_genericPrompt)._sprite._filename._buf + iVar7 + -0x47c)) != 0) {
this->_state = 2;
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5b0)))))))->Menu_Options::reload();
}
break;
case 1:
if (this->_menuType != 1) {
iVar7 = 0x80;
}
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if (*GHIDRA_CAST<int *>(((this->_genericPrompt)._sprite._filename._buf + iVar7 + -0x47c)) != 0) {
this->_state = 3;
FUN_008d3250();
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((g_game->_pauseScreen)._playerIdx);
iVar3 = player->_controllerIndex;
}
else {
iVar3 = (GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
local_21 = iVar3 == 0;
backKeyLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xb3c)))),GHIDRA_CAST<uint8_t *>("BackKey"));
backKeyLayer->_visible = local_21;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x848))) = 1;
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
}
break;
case 2:
this->PopupWindow::hide();
ExceptionList = local_1c;
return;
case 3:
if ((g_game->_dailyChallenge)._id != 0) {
local_58[0] = (Entity_Player *)
string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#QUIT_DAILY_RUN_4"));
local_50 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#QUIT_DAILY_RUN_3"));
pbVar4 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#QUIT_DAILY_RUN_2"));
quitLine1 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#QUIT_DAILY_RUN_1"));
this = savedThis;
FUN_00838230(quitLine1,pbVar4,local_50,local_58[0],0);
(GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Show(0);
this->_state = 4;
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
break;
}
iVar3 = 400;
if (this->_menuType != 1) {
iVar3 = 0x7c;
}
AnimationState::SetAnimationData
(GHIDRA_CAST<AnimationState *>(((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c)),
(void *)0x0);
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
if (player->_dead != 0) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
iVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetExtraLives();
if (iVar3 < 1) {
Game::DeleteSaveState();
}
}
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
manager = g_manager;
game = g_game;
fStack_7c = (g_game->_fadeOutColor)._alpha;
fStack_80 = fadeColor._blue;
g_game->_fadeSpeed = 0.08;
game->_fadeOutTarget = 2;
(game->_fadeOutColor)._red = fadeColor._red;
(game->_fadeOutColor)._green = fadeColor._green;
(game->_fadeOutColor)._blue = fadeColor._blue;
(game->_fadeOutColor)._alpha = fStack_7c;
(game->_fadeOutColor)._unk = 0;
(game->_fadeOutColor)._alpha = (game->_fadeOutColor)._alpha + 0.08;
if (manager->_netplayManager == *GHIDRA_CAST<int *>((manager + 1))) {
LAB_009b6686:
local_21 = 0;
}
else {
pvVar5 = (GHIDRA_CAST<Multiplayer *>((&DAT_00c79a50)))->Multiplayer::get_lobby(&fadeColor._blue);
local_14 = GHIDRA_CAST<Entity_Player *>(0x1);
local_3c = GHIDRA_CAST<uint8_t *>((GHIDRA_UINT(cleanupFlags) | 2));
cleanupFlags = local_3c;
if (*GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar5) + 4)) == GHIDRA_CAST<int *>(0x0)) goto LAB_009b6686;
iVar3 = (**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(pvVar5) + 4)) + 0x3c))();
local_21 = 1;
if (iVar3 != 3) goto LAB_009b6686;
}
local_14 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
if ((GHIDRA_UINT(cleanupFlags) & 2) != 0) {
(GHIDRA_CAST<KAGE::Network::Multiplayer::ConstLobby *>((&fadeColor._blue)))->KAGE::Network::Multiplayer::ConstLobby::~ConstLobby();
}
manager = g_manager;
local_60 = CONCAT44((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_60)) + 0x4))),(uint32_t)local_60);
if (local_21 != 0) {
(GHIDRA_CAST<Multiplayer *>((&DAT_00c79a50)))->Multiplayer::get_lobby(&fStack_80);
local_14 = GHIDRA_CAST<Entity_Player *>(0x2);
local_60 = FUN_00a23920();
pbVar4 = map_u64_bool_subscript(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x8f4))),&local_60);
local_14 = GHIDRA_CAST<Entity_Player *>(0xffffffff);
*pbVar4 = 1;
(GHIDRA_CAST<KAGE::Network::Multiplayer::ConstLobby *>((&fStack_80)))->KAGE::Network::Multiplayer::ConstLobby::~ConstLobby();
}
}
switchD_009b63f7_default:
(GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Update(1);
if (((((this->_genericPrompt)._sprite._animState._animData == (void *)0x0) ||
((this->_genericPrompt)._sprite._animState._isPlaying == 0)) && (this->_state == 4)) &&
(iVar3 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_genericPrompt))) + 0x12c)))), this->_state = 1, iVar3 == 1)) {
(GHIDRA_CAST<Game *>((g_game)))->Game::End(1);
}
local_58[0] = GHIDRA_CAST<Entity_Player *>(0x15);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,local_58,0,0);
if (cVar1 == '\0') {
local_34 = GHIDRA_CAST<Entity_Player *>(0x14);
cVar1 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&local_34,0,0);
if (cVar1 == '\0') {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) = 0;
ExceptionList = local_1c;
return;
}
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x28)))) + 1;
ExceptionList = local_1c;
return;
LAB_009b618a:
player = local_34;
LAB_009b6190:
local_30 = local_30 + -1;
if (local_30 == 0) goto code_r0x009b619c;
goto LAB_009b60e4;
code_r0x009b619c:
local_30 = 0;
iVar7 = controllerIndex;
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) < 0) {
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = 0;
}
goto LAB_009b6311;
}
// 009b7190
void PauseScreen::Render()
{
uint8_t bVar1;
LayerState *layer;
LayerState *targetLayer;
float *widgetNullFrame;
int spriteOffset;
int iVar2;
uint8_t *layerName;
Game *game;
Vector local_18;
Vector renderPos;
game = g_game;
if ((*GHIDRA_CAST<int *>(&g_game->_roomTransition) == 0) || ((g_game->_roomTransition)._bossIntroBossId == 0))
{
iVar2 = this->_menuType;
spriteOffset = 0x140;
if (iVar2 != 1) {
spriteOffset = 0x2c;
}
local_18.x = (float)ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
spriteOffset + -0x47c)),GHIDRA_CAST<uint8_t *>("Menu Title"));
if (GHIDRA_CAST<LayerState *>(local_18.x) != GHIDRA_CAST<LayerState *>(0x0)) {
if ((g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) ||
((game->_dailyChallenge)._id != 0)) {
bVar1 = 0;
}
else {
bVar1 = 1;
}
(GHIDRA_CAST<LayerState *>(local_18.x))->_visible = bVar1;
iVar2 = this->_menuType;
}
spriteOffset = 0x140;
if (iVar2 != 1) {
spriteOffset = 0x2c;
}
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
spriteOffset + -0x47c)),GHIDRA_CAST<uint8_t *>("SeedPaper"));
if (layer != GHIDRA_CAST<LayerState *>(0x0)) {
layer->_visible = (game->_dailyChallenge)._id == 0;
iVar2 = this->_menuType;
}
renderPos.x = g_screenWidth * 0.6;
renderPos.y = g_screenHeight * 0.5;
if (iVar2 == 1) {
renderPos.x = g_screenWidth * 0.7;
renderPos.y = g_screenHeight - g_screenHeight * 0.025;
}
switch(this->_state) {
case 1:
case 4:
spriteOffset = 0x140;
if (iVar2 != 1) {
spriteOffset = 0x2c;
}
ANM2::Render(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c)),
&renderPos,&g_vectorZero,&g_vectorZero);
render_lobby_buttons(this,&renderPos);
iVar2 = 0x170;
if (this->_menuType != 1) {
iVar2 = 0x5c;
}
layer = AnimationState::GetLayerFrame
((AnimationState *)
((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c),1);
local_18.x = (float)layer;
if ((layer != GHIDRA_CAST<LayerState *>(0x0)) && (this->_menuType != 1)) {
layerName = GHIDRA_CAST<uint8_t *>(0x0);
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2d4)))) != 0) {
do {
targetLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x254)))),layerName);
(targetLayer->_pos).x = *GHIDRA_CAST<float *>(((layer->_spriteSheetPath)._buf + 8));
(targetLayer->_pos).y = *GHIDRA_CAST<float *>(((layer->_spriteSheetPath)._buf + 0xc));
targetLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x254)))),layerName);
layerName = layerName + 1;
(targetLayer->_size).x = (float)(layer->_spriteSheetPath)._size;
(targetLayer->_size).y = (float)(layer->_spriteSheetPath)._capacity;
} while (layerName < *GHIDRA_CAST<uint8_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2d4)))));
}
ANM2::Render(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x254)))),&renderPos,&g_vectorZero,&g_vectorZero);
}
iVar2 = 0x170;
render_seed_paper(this,&renderPos);
game = g_game;
bVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsInTimedSet(10);
if (bVar1 == 0) {
if (this->_menuType == 0) {
render_my_stuff(this,&renderPos);
game = g_game;
}
if (((0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xfa8))))) && (*GHIDRA_CAST<char *>(&game->_seedEffects) == '\0')) &&
(bVar1 = (GHIDRA_CAST<Seeds *>((&game->_seedEffects)))->Seeds::AchievementUnlocksDisallowed(), bVar1 == 0)) {
spriteOffset = 0x174;
if (this->_menuType != 1) {
spriteOffset = 0x60;
}
if (*GHIDRA_CAST<int *>(((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c)) != 0)
{
if (this->_menuType != 1) {
iVar2 = 0x5c;
}
widgetNullFrame =
AnimationState::GetNullFrame
((AnimationState *)
((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c),
GHIDRA_CAST<uint8_t *>("CompletionWidget"));
if (widgetNullFrame != GHIDRA_CAST<float *>(0x0)) {
local_18.x = renderPos.x + *widgetNullFrame;
local_18.y = renderPos.y + widgetNullFrame[1];
CompletionWidget::Render
(GHIDRA_CAST<CompletionWidget *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe90)))),&local_18,
GHIDRA_CAST<Vector *>((widgetNullFrame + 4)));
(GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Render();
return;
}
}
}
}
break;
case 2:
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5b0)))))))->Menu_Options::Render();
(GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Render();
return;
case 3:
render_items_page();
(GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Render();
return;
case 5:
InviteFriendsMenu::Render();
(GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Render();
return;
case 6:
kick_player_menu_render();
}
(GHIDRA_CAST<GenericPrompt *>((&this->_genericPrompt)))->GenericPrompt::Render();
}
return;
}
// 009b7680
void PauseScreen::Show()
{
uint8_t bVar1;
int iVar2;
Entity_Player *player;
LayerState *bloodLayer;
uint32_t playerIdx;
int *playerSlot;
uint32_t playerCount;
int iVar3;
ANM2 *menuSprite;
int menuType;
float statLevel;
Vector local_10;
Game *game;
Manager *manager;
local_10.x = 0.0;
local_10.y = 0.0;
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5b0)))))))->Menu_Options::Init(&local_10,1);
manager = g_manager;
this->_menuType = 1;
this->_playerIdx = 0;
game = g_game;
if (manager->_netplayManager != *GHIDRA_CAST<int *>((manager + 1))) {
FUN_0090b070();
iVar2 = FUN_004253d0();
playerSlot = (game->_playerManager)._playerList._begin;
playerIdx = 0;
playerCount = GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(playerSlot) >> 2;
if (playerCount != 0) {
do {
if (*playerSlot == iVar2) goto LAB_009b7713;
playerIdx = playerIdx + 1;
playerSlot = playerSlot + 1;
} while (playerIdx < playerCount);
}
playerIdx = 0xffffffff;
LAB_009b7713:
this->_playerIdx = playerIdx;
manager = g_manager;
}
(GHIDRA_CAST<SFXManager *>((&manager->_sfxManager)))->SFXManager::StopLoopingSounds();
FUN_006f4170();
iVar2 = 0x140;
this->_state = 1;
iVar3 = 0x140;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 2;
if (this->_menuType != 1) {
iVar3 = 0x2c;
}
menuSprite = GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c));
bVar1 = ANM2::SetAnimation(menuSprite,GHIDRA_CAST<uint8_t *>("Appear"),1);
if (bVar1 != 0) {
AnimationState::Rewind(&menuSprite->_animState);
(menuSprite->_animState)._isPlaying = 1;
}
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
}
else {
iVar3 = FUN_0090b070();
if (iVar3 == 0) goto LAB_009b77c7;
FUN_0090b070();
player = GHIDRA_CAST<Entity_Player *>(FUN_004253d0());
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_009b77c7;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xe90)))) = player->_playerType;
LAB_009b77c7:
manager = g_manager;
local_10.x = 2.38221e-44;
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_10));
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_10.x),0.7,2,0,1.0,0.0);
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
statLevel = player->_movespeed * 4.5 - 2.0;
if (statLevel <= 0.0) {
statLevel = 0.0;
}
if (7.0 <= statLevel) {
statLevel = 7.0;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0xc)))) = GHIDRA_INT(statLevel);
statLevel = pow(30.0 / (player->_maxfiredelay + 1.0),0.75);
statLevel = statLevel * 2.120391 - 2.0;
if (statLevel <= 0.0) {
statLevel = 0.0;
}
if (7.0 <= statLevel) {
statLevel = 7.0;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x10)))) = GHIDRA_INT(statLevel);
statLevel = pow(player->_damage,0.56);
iVar3 = 0x140;
statLevel = statLevel * 2.231179 - 2.0;
if (statLevel <= 0.0) {
statLevel = 0.0;
}
if (7.0 <= statLevel) {
statLevel = 7.0;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x14)))) = GHIDRA_INT(statLevel);
statLevel = (player->_tearrange - 230.0) / 60.0 + 2.0;
if (statLevel <= 0.0) {
statLevel = 0.0;
}
if (7.0 <= statLevel) {
statLevel = 7.0;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x18)))) = GHIDRA_INT(statLevel);
statLevel = player->_shotspeed * 5.0 - 2.5;
if (statLevel <= 0.0) {
statLevel = 0.0;
}
if (7.0 <= statLevel) {
statLevel = 7.0;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) = GHIDRA_INT(statLevel);
statLevel = player->_luck + 2.5;
menuType = this->_menuType;
if (statLevel <= 0.0) {
statLevel = 0.0;
}
if (7.0 <= statLevel) {
statLevel = 7.0;
}
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) = GHIDRA_INT(statLevel);
if (menuType != 1) {
iVar3 = 0x2c;
}
local_10.x = (float)ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
iVar3 + -0x47c)),GHIDRA_CAST<uint8_t *>("Invite"));
if (GHIDRA_CAST<LayerState *>(local_10.x) != GHIDRA_CAST<LayerState *>(0x0)) {
(GHIDRA_CAST<LayerState *>(local_10.x))->_visible = g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1));
menuType = this->_menuType;
}
iVar3 = 0x140;
if (menuType != 1) {
iVar3 = 0x2c;
}
local_10.x = (float)ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
iVar3 + -0x47c)),&DAT_00b79bb0);
if (GHIDRA_CAST<LayerState *>(local_10.x) != GHIDRA_CAST<LayerState *>(0x0)) {
if ((g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) ||
(GHIDRA_UINT((*GHIDRA_CAST<int *>((g_manager + 1)) - g_manager->_netplayManager >> 2)) < 2)) {
bVar1 = 0;
}
else {
bVar1 = 1;
}
(GHIDRA_CAST<LayerState *>(local_10.x))->_visible = bVar1;
menuType = this->_menuType;
}
if (menuType != 1) {
iVar2 = 0x2c;
}
bloodLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
iVar2 + -0x47c)),GHIDRA_CAST<uint8_t *>("Blood"));
if (bloodLayer != GHIDRA_CAST<LayerState *>(0x0)) {
bloodLayer->_visible = g_game->_difficulty == 1;
}
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) = 0;
return;
}
// 009b7a20
void PauseScreen::load_graphics()
{
uint8_t bVar1;
char isLastRef;
uint8_t *curAnimName;
LayerState *layer;
void *image;
int in_ECX;
char *pcVar2;
uint32_t uVar3;
uint8_t *curAnimName;
ANM2 *diarySprite;
bool isLess;
uint8_t loadedImage [4];
int *loadedImageRefCount;
int savedThis;
std_string deathScreenPath;
std_string anm2Path;
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
int temp_3f06a66df3;
puStack_20 = loadedImage + 0x5c;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0e735;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((loadedImage + 0x50));
ExceptionList = &local_1c;
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
savedThis = in_ECX;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x17;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen.anm2",0x18);
local_14 = 0;
ANM2::Load(GHIDRA_CAST<ANM2 *>((in_ECX + 0x2c)),&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar3 = anm2Path._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar3 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x1d;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen_small.anm2",0x1e);
local_14 = 1;
ANM2::Load(GHIDRA_CAST<ANM2 *>((in_ECX + 0x140)),&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar3 = anm2Path._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar3 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x1c;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreenStats.anm2",0x1d);
local_14 = 2;
ANM2::Load(GHIDRA_CAST<ANM2 *>((in_ECX + 0x254)),&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar3 = anm2Path._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar3 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
(GHIDRA_CAST<GenericPrompt *>((GHIDRA_CAST<GenericPrompt *>((in_ECX + 0x47c)))))->GenericPrompt::Initialize(1);
diarySprite = GHIDRA_CAST<ANM2 *>((in_ECX + 0x368));
anm2Path._size = 0;
anm2Path._capacity = 0xf;
anm2Path._buf[0] = '\0';
anm2Path._buf[1] = '\0';
anm2Path._buf[2] = '\0';
anm2Path._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
anm2Path._size = 0x18;
anm2Path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19);
local_14 = 3;
ANM2::Load(diarySprite,&anm2Path,1);
local_14 = 0xffffffff;
if (0xf < anm2Path._capacity) {
uVar3 = anm2Path._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
uVar3 = anm2Path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
curAnimName = *GHIDRA_CAST<uint8_t **>((in_ECX + 0x39c));
if (curAnimName == GHIDRA_CAST<uint8_t *>(0x0)) {
LAB_009b7d75:
bVar1 = ANM2::SetAnimation(diarySprite,GHIDRA_CAST<uint8_t *>("Diary"),1);
if (bVar1 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((in_ECX + 0x398)));
*GHIDRA_CAST<uint8_t *>((in_ECX + 0x3ac)) = 1;
}
}
else {
curAnimName = curAnimName;
if (0xf < *GHIDRA_CAST<uint32_t *>((curAnimName + 0x14))) {
curAnimName = *GHIDRA_CAST<uint8_t **>(curAnimName);
}
pcVar2 = "Diary";
do {
bVar1 = *curAnimName;
isLess = bVar1 < (uint8_t)*pcVar2;
if (bVar1 != *pcVar2) {
LAB_009b7d62:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_009b7d67;
}
if (bVar1 == 0) break;
bVar1 = curAnimName[1];
isLess = bVar1 < (uint8_t)pcVar2[1];
if (bVar1 != pcVar2[1]) goto LAB_009b7d62;
curAnimName = curAnimName + 2;
pcVar2 = pcVar2 + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_009b7d67:
if ((uVar3 != 0) || ((curAnimName[0x34] != 0 && (*GHIDRA_CAST<char *>((in_ECX + 0x3ac)) == '\0'))))
goto LAB_009b7d75;
}
curAnimName = GHIDRA_CAST<uint8_t *>(0x0);
do {
layer = ANM2::GetLayer(diarySprite,curAnimName);
curAnimName = curAnimName + 1;
layer->_visible = 0;
} while (GHIDRA_INT(curAnimName) < 7);
layer = ANM2::GetLayer(diarySprite,&DAT_00000006);
layer->_visible = 1;
image = Manager::LoadImage(loadedImage,GHIDRA_CAST<uint8_t *>("gfx/ui/menu_mystuff.png"));
temp_3f06a66df3 = savedThis;
local_14 = 4;
(GHIDRA_CAST<KAGE::SmartPointer *>(((void *)(savedThis + 0xe88))))->KAGE::SmartPointer::operator_assign(image);
local_14 = 5;
if (loadedImageRefCount != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*loadedImageRefCount + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(loadedImage);
}
}
local_14 = 0xffffffff;
(GHIDRA_CAST<Menu_Options *>((GHIDRA_CAST<Menu_Options *>((temp_3f06a66df3 + 0x5b0)))))->Menu_Options::load_menu_anm2();
diarySprite = GHIDRA_CAST<ANM2 *>((temp_3f06a66df3 + 0xc50));
deathScreenPath._size = 0;
deathScreenPath._capacity = 0xf;
deathScreenPath._buf[0] = '\0';
deathScreenPath._buf[1] = '\0';
deathScreenPath._buf[2] = '\0';
deathScreenPath._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
deathScreenPath._size = 0x18;
deathScreenPath._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(deathScreenPath._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19);
local_14 = 6;
ANM2::Load(diarySprite,&deathScreenPath,1);
local_14 = 0xffffffff;
if (0xf < deathScreenPath._capacity) {
uVar3 = deathScreenPath._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(deathScreenPath._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) + -4));
uVar3 = deathScreenPath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
curAnimName = *GHIDRA_CAST<uint8_t **>((temp_3f06a66df3 + 0xc84));
deathScreenPath._size = 0;
deathScreenPath._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(deathScreenPath._buf)) + 0x0))) & 0xffffff00;
if (curAnimName != GHIDRA_CAST<uint8_t *>(0x0)) {
curAnimName = curAnimName;
if (0xf < *GHIDRA_CAST<uint32_t *>((curAnimName + 0x14))) {
curAnimName = *GHIDRA_CAST<uint8_t **>(curAnimName);
}
pcVar2 = "Diary";
do {
bVar1 = *curAnimName;
isLess = bVar1 < (uint8_t)*pcVar2;
if (bVar1 != *pcVar2) {
LAB_009b7f03:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_009b7f08;
}
if (bVar1 == 0) break;
bVar1 = curAnimName[1];
isLess = bVar1 < (uint8_t)pcVar2[1];
if (bVar1 != pcVar2[1]) goto LAB_009b7f03;
curAnimName = curAnimName + 2;
pcVar2 = pcVar2 + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_009b7f08:
if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*GHIDRA_CAST<char *>((temp_3f06a66df3 + 0xc94)) != '\0'))))
goto LAB_009b7f34;
}
bVar1 = ANM2::SetAnimation(diarySprite,GHIDRA_CAST<uint8_t *>("Diary"),1);
if (bVar1 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((temp_3f06a66df3 + 0xc80)));
*GHIDRA_CAST<uint8_t *>((temp_3f06a66df3 + 0xc94)) = 1;
}
LAB_009b7f34:
curAnimName = GHIDRA_CAST<uint8_t *>(0x0);
if (*GHIDRA_CAST<int *>((savedThis + 0xcd0)) != 0) {
do {
layer = ANM2::GetLayer(diarySprite,curAnimName);
curAnimName = curAnimName + 1;
layer->_visible = 0;
} while (curAnimName < *GHIDRA_CAST<uint8_t **>((savedThis + 0xcd0)));
}
layer = ANM2::GetLayer(diarySprite,GHIDRA_CAST<uint8_t *>("Items"));
layer->_visible = 1;
ExceptionList = local_1c;
return;
}
// 009b7f90
void PauseScreen::update_stuff_arrows()
{
PauseScreen *currentPlayer = this;
uint8_t isOwned;
Entity_Player *pEVar1;
ItemConfig_Item *item;
Entity_Player *currentPlayer;
LayerState *arrowLayer;
void *historyEntry;
int iVar2;
int arrowSpriteOffset;
int iVar3;
int shownCount;
int maxScroll;
void *historyBegin;
iVar3 = currentPlayer->_menuType;
if (iVar3 == 0) {
pEVar1 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(currentPlayer->_playerIdx);
historyEntry = (pEVar1->_history)._historyItems._end;
historyBegin = (pEVar1->_history)._historyItems._begin;
iVar2 = (GHIDRA_INT(historyEntry) - GHIDRA_INT(historyBegin)) / 0x1c;
iVar3 = iVar2 + -0x18;
maxScroll = 0;
if (0 < iVar3) {
maxScroll = iVar3;
}
if (iVar2 != 0) {
shownCount = 0;
historyEntry = (void *)(GHIDRA_INT(historyEntry) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentPlayer)) + 0x24)))) * -0x1c);
if (historyEntry != historyBegin) {
do {
if (0x17 < shownCount) break;
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(historyEntry) + -0x18)) == '\0') {
iVar3 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(historyEntry) + -0x14));
}
else {
iVar3 = 0;
}
item = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar3);
if (item == GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
LAB_009b8065:
maxScroll = maxScroll + -1;
}
else {
currentPlayer = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(currentPlayer->_playerIdx);
isOwned = (GHIDRA_CAST<Entity_Player *>((currentPlayer)))->Entity_Player::HasCollectible(iVar3,0);
if (isOwned == 0) goto LAB_009b8065;
shownCount = shownCount + 1;
}
historyEntry = (void *)(GHIDRA_INT(historyEntry) + -0x1c);
} while (historyEntry != (pEVar1->_history)._historyItems._begin);
}
}
iVar2 = 0x140;
iVar3 = 0x140;
if (currentPlayer->_menuType != 1) {
iVar3 = 0x2c;
}
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((currentPlayer->_genericPrompt)._sprite._filename._buf +
iVar3 + -0x47c)),GHIDRA_CAST<uint8_t *>("StuffArrow1"));
if (arrowLayer != GHIDRA_CAST<LayerState *>(0x0)) {
arrowLayer->_visible = 0 < *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentPlayer)) + 0x24))));
}
if (currentPlayer->_menuType != 1) {
iVar2 = 0x2c;
}
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((currentPlayer->_genericPrompt)._sprite._filename._buf +
iVar2 + -0x47c)),GHIDRA_CAST<uint8_t *>("StuffArrow2"));
if (arrowLayer != GHIDRA_CAST<LayerState *>(0x0)) {
arrowLayer->_visible = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((currentPlayer)) + 0x24)))) < maxScroll;
return;
}
}
else {
arrowSpriteOffset = 0x140;
iVar2 = 0x140;
if (iVar3 != 1) {
iVar2 = 0x2c;
}
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((currentPlayer->_genericPrompt)._sprite._filename._buf +
iVar2 + -0x47c)),GHIDRA_CAST<uint8_t *>("StuffArrow1"));
if (arrowLayer != GHIDRA_CAST<LayerState *>(0x0)) {
arrowLayer->_visible = 0;
iVar3 = currentPlayer->_menuType;
}
if (iVar3 != 1) {
arrowSpriteOffset = 0x2c;
}
arrowLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((currentPlayer->_genericPrompt)._sprite._filename._buf +
arrowSpriteOffset + -0x47c)),GHIDRA_CAST<uint8_t *>("StuffArrow2"));
if (arrowLayer != GHIDRA_CAST<LayerState *>(0x0)) {
arrowLayer->_visible = 0;
}
}
return;
}
// 009b8130
void PauseScreen::render_seed_paper(Vector *renderOffset)
{
LayerState *seedPaperLayer;
float *nullFrame;
void *settings;
std_string *psVar1;
void *settings_00;
int iVar2;
KColor *color;
size_t *psVar3;
KColor *color_00;
uint32_t uVar4;
FontSettings secondHalfSettings [9];
FontSettings firstHalfSettings [6];
uint32_t local_80;
uint32_t local_7c;
KColor textColor;
Vector secondLinePos;
Vector firstLinePos;
size_t local_54;
size_t local_50;
std_string *seedString [4];
uint32_t seedStringSize;
uint32_t seedStringCapacity;
uint8_t halfText [16];
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
Game *game;
Manager *manager;
puStack_20 = halfText + 0x30;
local_14 = 0xffffffff;
puStack_18 = &DAT_00b0e783;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((halfText + 0x24));
ExceptionList = &local_1c;
iVar2 = 0x140;
if (this->_menuType != 1) {
iVar2 = 0x2c;
}
seedPaperLayer =
ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c)),
GHIDRA_CAST<uint8_t *>("SeedPaper"));
if (seedPaperLayer != GHIDRA_CAST<LayerState *>(0x0)) {
if ((g_game->_dailyChallenge)._id == 0) {
seedPaperLayer->_visible = 1;
iVar2 = 0x170;
if (this->_menuType != 1) {
iVar2 = 0x5c;
}
nullFrame = AnimationState::GetNullFrame
((AnimationState *)
((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c),
&DAT_00b7562c);
game = g_game;
if (nullFrame != GHIDRA_CAST<float *>(0x0)) {
firstLinePos.x = *nullFrame + renderOffset->x;
firstLinePos.y = nullFrame[1] + renderOffset->y;
uVar4 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_seedEffects))) + 0x4))));
secondLinePos.x = firstLinePos.x + 0.0;
secondLinePos.y = firstLinePos.y + 15.0;
if (uVar4 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Error: Game Start Seed was not set.\n"));
uVar4 = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((game->_seedEffects))) + 0x4))));
}
Seeds::Seed2String(GHIDRA_CAST<std_string *>(seedString),uVar4);
local_14 = 0;
local_50 = seedStringSize;
local_54 = 4;
psVar3 = &local_50;
if (3 < seedStringSize) {
psVar3 = &local_54;
}
halfText[0] = 0;
halfText[1] = 0;
halfText[2] = 0;
halfText[3] = 0;
halfText[4] = 0;
halfText[5] = 0;
halfText[6] = 0;
halfText[7] = 0;
halfText[8] = 0;
halfText[9] = 0;
halfText[10] = 0;
halfText[0xb] = 0;
halfText[0xc] = 0;
halfText[0xd] = 0;
halfText[0xe] = 0;
halfText[0xf] = 0;
psVar1 = GHIDRA_CAST<std_string *>(seedString);
if (0xf < seedStringCapacity) {
psVar1 = seedString[0];
}
memcpy(halfText,psVar1,*psVar3);
manager = g_manager;
FontSettings::constructor(firstHalfSettings);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xff362f2d);
Font::DrawStringScaled(&manager->_font2_TeamMeatEx12,halfText,&firstLinePos,color,settings);
local_50 = 4;
local_54 = seedStringSize - 4;
local_80 = 0;
psVar3 = &local_54;
if (3 < seedStringSize - 4) {
psVar3 = &local_50;
}
local_7c = 0;
psVar1 = GHIDRA_CAST<std_string *>(seedString);
if (0xf < seedStringCapacity) {
psVar1 = seedString[0];
}
halfText[0] = 0;
halfText[1] = 0;
halfText[2] = 0;
halfText[3] = 0;
halfText[4] = 0;
halfText[5] = 0;
halfText[6] = 0;
halfText[7] = 0;
halfText[8] = 0;
halfText[9] = 0;
halfText[10] = 0;
halfText[0xb] = 0;
halfText[0xc] = 0;
halfText[0xd] = 0;
halfText[0xe] = 0;
halfText[0xf] = 0;
memcpy(halfText,psVar1->_buf + 5,*psVar3);
manager = g_manager;
FontSettings::constructor(secondHalfSettings);
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xff362f2d);
Font::DrawStringScaled
(&manager->_font2_TeamMeatEx12,halfText,&secondLinePos,color_00,settings_00);
if (0xf < seedStringCapacity) {
uVar4 = seedStringCapacity + 1;
psVar1 = seedString[0];
if (0xfff < uVar4) {
psVar1 = GHIDRA_CAST<std_string *>(seedString[0][-1]._capacity);
uVar4 = seedStringCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(seedString[0]) + (-4 - GHIDRA_INT(psVar1))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(psVar1,uVar4);
}
}
}
else {
seedPaperLayer->_visible = 0;
}
}
ExceptionList = local_1c;
return;
}
// 009b83a0
void PauseScreen::render_my_stuff(Vector *pos)
{
uint8_t bVar1;
int iVar2;
int iVar3;
LayerState *pLVar4;
Sprite *menuSprite;
void *pvVar5;
Entity_Player *pEVar6;
ItemConfig_Item *itemConfig;
int iVar7;
ANM2 *pAVar8;
uint8_t *puVar9;
uint32_t blendMode;
uint32_t uStack_90;
uint32_t uStack_8c;
uint32_t uStack_88;
uint32_t local_84;
Vector modIconPos;
Vector itemScale;
Vector iconPos;
History *history;
float scaleY;
float scaleX;
Sprite *local_5c;
uint8_t *local_58;
float slotY;
uint32_t collectibleId;
LayerState *local_4c;
LayerState *local_48;
Vector *local_44;
ColorMod iconColor;
float local_14;
local_14 = (float)(__security_cookie ^ GHIDRA_UINT(((&iconColor)[1]._tint + 1)));
local_44 = pos;
local_58 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x140)));
iVar2 = 0x140;
if (this->_menuType != 1) {
iVar2 = 0x2c;
}
local_5c = GHIDRA_CAST<Sprite *>(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c));
local_4c = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(local_5c),GHIDRA_CAST<uint8_t *>("MyStuff"));
if (local_4c != GHIDRA_CAST<LayerState *>(0x0)) {
if (local_4c->_layerData == GHIDRA_CAST<int *>(0x0)) {
iVar2 = -1;
}
else {
iVar2 = *GHIDRA_CAST<int *>(local_4c->_layerData);
}
(GHIDRA_CAST<Sprite *>((local_5c)))->Sprite::RenderLayer(iVar2,pos,&g_vectorZero,&g_vectorZero);
iVar2 = this->_menuType;
iVar3 = 0x140;
if (iVar2 != 1) {
iVar3 = 0x2c;
}
local_48 = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
iVar3 + -0x47c)),GHIDRA_CAST<uint8_t *>("StuffArrow1"));
if (local_48 != GHIDRA_CAST<LayerState *>(0x0)) {
menuSprite = GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c))));
if (iVar2 == 1) {
menuSprite = GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x140))));
}
if (local_48->_layerData == GHIDRA_CAST<int *>(0x0)) {
iVar2 = -1;
}
else {
iVar2 = *GHIDRA_CAST<int *>(local_48->_layerData);
}
(GHIDRA_CAST<Sprite *>((menuSprite)))->Sprite::RenderLayer(iVar2,local_44,&g_vectorZero,&g_vectorZero);
iVar2 = this->_menuType;
}
pAVar8 = GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c))));
if (iVar2 == 1) {
pAVar8 = GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x140))));
}
pLVar4 = ANM2::GetLayer(pAVar8,GHIDRA_CAST<uint8_t *>("StuffArrow2"));
if (pLVar4 != GHIDRA_CAST<LayerState *>(0x0)) {
menuSprite = GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c))));
if (iVar2 == 1) {
menuSprite = GHIDRA_CAST<Sprite *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x140))));
}
if (pLVar4->_layerData == GHIDRA_CAST<int *>(0x0)) {
iVar2 = -1;
}
else {
iVar2 = *GHIDRA_CAST<int *>(pLVar4->_layerData);
}
(GHIDRA_CAST<Sprite *>((menuSprite)))->Sprite::RenderLayer(iVar2,local_44,&g_vectorZero,&g_vectorZero);
iVar2 = this->_menuType;
}
puVar9 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2c)));
if (iVar2 == 1) {
puVar9 = local_58;
}
if (local_4c->_layerData == GHIDRA_CAST<int *>(0x0)) {
iVar2 = -1;
}
else {
iVar2 = *GHIDRA_CAST<int *>(local_4c->_layerData);
}
pvVar5 = AnimationState::GetLayerFrame(GHIDRA_CAST<AnimationState *>((puVar9 + 0x30)),iVar2);
if (pvVar5 != (void *)0x0) {
local_58 = GHIDRA_CAST<uint8_t *>((local_44->x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x10))));
local_5c = GHIDRA_CAST<Sprite *>((local_44->y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x14))));
itemScale.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x18));
itemScale.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar5) + 0x1c));
scaleY = itemScale.y;
scaleX = itemScale.x;
pEVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
history = &pEVar6->_history;
local_44 = GHIDRA_CAST<Vector *>(g_vectorZero.x);
slotY = g_vectorZero.y;
if (local_48->_layerData == GHIDRA_CAST<int *>(0x0)) {
iVar2 = -1;
}
else {
iVar2 = *GHIDRA_CAST<int *>(local_48->_layerData);
}
pvVar5 = AnimationState::GetLayerFrame(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))),iVar2);
if (pvVar5 != (void *)0x0) {
local_4c = *GHIDRA_CAST<LayerState **>((GHIDRA_CAST<char *>(pvVar5) + 0x10));
local_48 = *GHIDRA_CAST<LayerState **>((GHIDRA_CAST<char *>(pvVar5) + 0x14));
pLVar4 = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x368)))),&DAT_00000006);
(pLVar4->_pos).x = -(float)local_4c;
(pLVar4->_pos).y = -(float)local_48;
pLVar4 = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x368)))),&DAT_00000006);
(pLVar4->_size).x = scaleX;
(pLVar4->_size).y = scaleY;
}
local_48 = GHIDRA_CAST<LayerState *>(0x0);
pvVar5 = (void *)(GHIDRA_INT((history->_historyItems)._end) + *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x24)))) * -0x1c);
if (pvVar5 != (history->_historyItems)._begin) {
do {
if (0x17 < GHIDRA_INT(local_48)) {
return;
}
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar5) + -0x18)) == '\0') {
collectibleId = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar5) + -0x14));
}
else {
collectibleId = 0;
}
itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,collectibleId);
if (itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
pEVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
bVar1 = (GHIDRA_CAST<Entity_Player *>((pEVar6)))->Entity_Player::HasCollectible(collectibleId,0);
if (bVar1 != 0) {
if (GHIDRA_INT(collectibleId) < 0) {
collectibleId = 0x1b9;
}
local_48 = GHIDRA_CAST<LayerState *>((GHIDRA_INT(local_48) + 1));
if (collectibleId < 0x2dd) {
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x39c)))) != 0) &&
((6 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))) + 0x80)) ||
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
6 < *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))) + 0x80)))))) {
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x39c))));
local_4c = *GHIDRA_CAST<LayerState **>((iVar2 + 0x50));
if ((iVar2 == 0) ||
((GHIDRA_INT(local_4c) < 0 || (*GHIDRA_CAST<int *>((iVar2 + 0x1c)) <= GHIDRA_INT(local_4c))))) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
}
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3a0)))) + GHIDRA_INT(local_4c) * 4)) = 0;
AnimationState::AdvanceLayerPosition
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))),GHIDRA_INT(local_4c),
(float)GHIDRA_INT((collectibleId - 1)));
}
iconPos.x = ((float)local_44 - 36.0) * scaleX + (float)local_58;
iconPos.y = (slotY - 15.0) * scaleY + (float)local_5c;
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x471))) != '\0') {
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3d8))) == '\0') {
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x39c))));
if (((iVar2 != 0) && (6 < (*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))))->_layerCount)) &&
(iVar3 = *GHIDRA_CAST<int *>((iVar2 + 0x50)), -1 < iVar3)) {
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((iVar3 * 0x10 + *GHIDRA_CAST<int *>((iVar2 + 0x18)))),&iconPos,
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3a0)))) + iVar3 * 4)),&g_vectorZero,
&g_vectorZero,*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))));
}
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3bc))));
if (((iVar2 != 0) &&
(pAVar8 = *GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3b8)))), 6 < pAVar8->_layerCount)) &&
(iVar3 = *GHIDRA_CAST<int *>((iVar2 + 0x50)), -1 < iVar3)) {
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3c0))));
goto LAB_009b8908;
}
}
else {
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3bc))));
if (((iVar2 != 0) && (6 < (*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3b8)))))->_layerCount)) &&
(iVar3 = *GHIDRA_CAST<int *>((iVar2 + 0x50)), -1 < iVar3)) {
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((iVar3 * 0x10 + *GHIDRA_CAST<int *>((iVar2 + 0x18)))),&iconPos,
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3c0)))) + iVar3 * 4)),&g_vectorZero,
&g_vectorZero,*GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3b8)))));
}
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x39c))));
if (((iVar2 != 0) &&
(pAVar8 = *GHIDRA_CAST<ANM2 **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x398)))), 6 < pAVar8->_layerCount)) &&
(iVar3 = *GHIDRA_CAST<int *>((iVar2 + 0x50)), -1 < iVar3)) {
iVar7 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3a0))));
LAB_009b8908:
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((iVar3 * 0x10 + *GHIDRA_CAST<int *>((iVar2 + 0x18)))),&iconPos,
*GHIDRA_CAST<int *>((iVar7 + iVar3 * 4)),&g_vectorZero,&g_vectorZero,pAVar8);
}
}
}
}
else {
local_84 = 7;
if (((uint8_t)g_graphicsManager_flags & 4) == 0) {
uStack_90 = 6;
}
else {
uStack_90 = 1;
}
blendMode = 0;
uStack_8c = 7;
uStack_88 = 1;
iconColor._offset[0] = 0.0;
iconColor._tint[0] = 1.0;
iconColor._tint[1] = 1.0;
iconColor._tint[2] = 1.0;
iconColor._tint[3] = 1.0;
iconColor._offset[1] = 0.0;
iconColor._offset[2] = 0.0;
iconColor._colorize[0] = 0.0;
iconColor._colorize[1] = 0.0;
iconColor._colorize[2] = 0.0;
iconColor._colorize[3] = 0.0;
modIconPos.x = ((float)local_44 - 36.0) * scaleX + (float)local_58;
modIconPos.y = (slotY - 15.0) * scaleY + (float)local_5c;
ModManager::RenderCustomCollectionItem
(GHIDRA_CAST<ModManager *>(&g_manager->_modManager),collectibleId,&modIconPos,
&itemScale,&iconColor,&blendMode);
}
local_44 = GHIDRA_CAST<Vector *>(((float)local_44 + 0.0));
slotY = slotY + 16.0;
if (64.0 <= slotY) {
slotY = slotY - 64.0;
local_44 = GHIDRA_CAST<Vector *>(((float)local_44 + 16.0));
}
}
}
pvVar5 = (void *)(GHIDRA_INT(pvVar5) + -0x1c);
} while (pvVar5 != (history->_historyItems)._begin);
}
}
}
return;
}
// 009b8990
void PauseScreen::render_lobby_buttons(Vector *pos)
{
ColorMod color;
Vector pos_00;
Vector pos_01;
Vector pos_02;
Vector pos_03;
uint8_t bVar1;
Entity_Player *player;
int iVar2;
uint8_t *animName;
uint32_t cmpResult;
LayerState *buttonLayer;
float *nullFrame;
uint8_t *idleName;
KColor *color_00;
int iVar3;
int controllerIndex;
bool bVar4;
Color aCStackY_16cc [128];
uint32_t in_stack_ffffff60;
uint32_t in_stack_ffffff64;
uint32_t in_stack_ffffff68;
uint32_t in_stack_ffffff6c;
uint32_t in_stack_ffffff70;
uint32_t in_stack_ffffff74;
uint64_t *in_stack_ffffff78;
float in_stack_ffffff7c;
float in_stack_ffffff80;
uint32_t in_stack_ffffff84;
float in_stack_ffffff88;
float fVar5;
float fVar6;
uint32_t fontSettings;
uint32_t local_5c;
uint32_t local_58;
uint32_t local_54;
uint32_t local_50;
uint32_t local_4c;
uint32_t local_48;
KColor textColor;
Vector local_30;
char isShowPassword;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
Manager *manager;
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
local_14 = 0xffffffff;
puStack_18 = &DAT_00b0e7bd;
local_1c = ExceptionList;
ExceptionList = &local_1c;
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(this->_playerIdx);
local_30.y = (float)player->_controllerIndex;
}
else {
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
local_30.y = (float)(GHIDRA_CAST<InputManager *>((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
}
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
LAB_009b8a56:
isShowPassword = '\0';
}
else {
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
if (((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
(bVar1 = NetplayManager::IsIdxLocalPlayer
(GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager),player->_controllerIndex),
bVar1 == 0)) || (isShowPassword = '\x01', (g_manager->_lobbySettings)._password._size == 0))
goto LAB_009b8a56;
}
manager = g_manager;
if ((this->_state != 1) && (this->_state != 4)) {
ExceptionList = local_1c;
return;
}
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
ExceptionList = local_1c;
return;
}
iVar3 = this->_menuType;
iVar2 = 0x174;
if (iVar3 != 1) {
iVar2 = 0x60;
}
if (*GHIDRA_CAST<int *>(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c)) != 0) {
iVar2 = 0x184;
if (iVar3 != 1) {
iVar2 = 0x70;
}
if ((this->_genericPrompt)._sprite._filename._buf[iVar2 + -0x47c] == '\0') {
iVar2 = 0x174;
if (iVar3 != 1) {
iVar2 = 0x60;
}
animName = *GHIDRA_CAST<uint8_t **>(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c));
if (0xf < *GHIDRA_CAST<uint32_t *>((animName + 0x14))) {
animName = *GHIDRA_CAST<uint8_t **>(animName);
}
idleName = s_Idle;
do {
bVar1 = *animName;
bVar4 = bVar1 < *idleName;
if (bVar1 != *idleName) {
LAB_009b8af8:
cmpResult = -GHIDRA_UINT(bVar4) | 1;
goto LAB_009b8afd;
}
if (bVar1 == 0) break;
bVar1 = animName[1];
bVar4 = bVar1 < idleName[1];
if (bVar1 != idleName[1]) goto LAB_009b8af8;
animName = animName + 2;
idleName = idleName + 2;
} while (bVar1 != 0);
cmpResult = 0;
LAB_009b8afd:
if (cmpResult == 0) {
fontSettings = 0;
local_5c = 0xffff;
in_stack_ffffff7c = pos->x - 160.0;
in_stack_ffffff80 = pos->y - 16.0;
local_58 = 0;
local_54 = 0x3f800000;
local_50 = 0xffffffff;
local_4c = 0;
local_48 = 0;
local_14 = 0;
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xff362f2d);
in_stack_ffffff88 = 0.6;
in_stack_ffffff84 = 0x3f19999a;
in_stack_ffffff78 = &DAT_00b1bddc;
in_stack_ffffff74 = 0x9b8ba1;
pos_00.y = in_stack_ffffff80;
pos_00.x = in_stack_ffffff7c;
Font::DrawString(&manager->_font1_TeamMeatEx10,GHIDRA_CAST<uint8_t *>(&DAT_00b1bddc),pos_00,
(Vector)0x3f19999a3f19999a,color_00,GHIDRA_CAST<FontSettings *>(&fontSettings));
local_14 = 0xffffffff;
}
}
}
if (local_30.y != 0.0) {
iVar3 = 0x140;
if (this->_menuType != 1) {
iVar3 = 0x2c;
}
buttonLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
iVar3 + -0x47c)),GHIDRA_CAST<uint8_t *>("Invite"));
iVar3 = 0x170;
if (buttonLayer->_visible != 0) {
iVar2 = 0x174;
if (this->_menuType != 1) {
iVar2 = 0x60;
}
if (*GHIDRA_CAST<int *>(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c)) == 0) {
nullFrame = GHIDRA_CAST<float *>(0x0);
}
else {
iVar2 = 0x170;
if (this->_menuType != 1) {
iVar2 = 0x5c;
}
nullFrame = AnimationState::GetNullFrame
((AnimationState *)
((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c),
GHIDRA_CAST<uint8_t *>("InviteButton"));
}
local_30.x = *nullFrame + pos->x;
local_30.y = nullFrame[1] + pos->y;
iVar2 = FUN_009b5800();
in_stack_ffffff70 = 0;
in_stack_ffffff74 = 0;
in_stack_ffffff78 = GHIDRA_CAST<uint64_t *>(0x0);
in_stack_ffffff7c = 0.0;
in_stack_ffffff80 = 0.0;
in_stack_ffffff84 = 0;
in_stack_ffffff88 = 0.0;
in_stack_ffffff60 = 0x3f800000;
in_stack_ffffff64 = 0x3f800000;
in_stack_ffffff68 = 0x3f800000;
in_stack_ffffff6c = 0x3f800000;
pos_01.y = local_30.y;
pos_01.x = local_30.x;
render_input_button_icon
(iVar2,0x18,0,1,
(ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),
pos_01);
}
iVar2 = 0x140;
if (this->_menuType != 1) {
iVar2 = 0x2c;
}
buttonLayer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(((this->_genericPrompt)._sprite._filename._buf +
iVar2 + -0x47c)),&DAT_00b79bb0);
if (buttonLayer->_visible != 0) {
iVar2 = 0x174;
if (this->_menuType != 1) {
iVar2 = 0x60;
}
if (*GHIDRA_CAST<int *>(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c)) == 0) {
nullFrame = GHIDRA_CAST<float *>(0x0);
}
else {
if (this->_menuType != 1) {
iVar3 = 0x5c;
}
nullFrame = AnimationState::GetNullFrame
((AnimationState *)
((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c),
GHIDRA_CAST<uint8_t *>("KickButton"));
}
local_30.x = *nullFrame + pos->x;
local_30.y = nullFrame[1] + pos->y;
iVar3 = FUN_009b5800();
in_stack_ffffff70 = 0;
in_stack_ffffff74 = 0;
in_stack_ffffff78 = GHIDRA_CAST<uint64_t *>(0x0);
in_stack_ffffff7c = 0.0;
in_stack_ffffff80 = 0.0;
in_stack_ffffff84 = 0;
in_stack_ffffff88 = 0.0;
in_stack_ffffff60 = 0x3f800000;
in_stack_ffffff64 = 0x3f800000;
in_stack_ffffff68 = 0x3f800000;
in_stack_ffffff6c = 0x3f800000;
pos_02.y = local_30.y;
pos_02.x = local_30.x;
render_input_button_icon
(iVar3,0x1c,0,1,
(ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),
pos_02);
}
if ((char)this[1]._genericPrompt._sprite._animDefaultName._size != '\0') goto LAB_009b8e1f;
if (isShowPassword != '\0') {
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x174)))) == 0) {
nullFrame = GHIDRA_CAST<float *>(0x0);
}
else {
nullFrame = AnimationState::GetNullFrame
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x170)))),GHIDRA_CAST<uint8_t *>("PasswordButton"));
}
local_30.x = *nullFrame + pos->x;
local_30.y = nullFrame[1] + pos->y;
FUN_009b5800();
fVar5 = local_30.x;
fVar6 = local_30.y;
(GHIDRA_CAST<Color *>((aCStackY_16cc + 0x81)))->Color::Color(1.0,1.0,1.0,1.0);
color._tint[1] = (float)in_stack_ffffff64;
color._tint[0] = (float)in_stack_ffffff60;
color._tint[2] = (float)in_stack_ffffff68;
color._tint[3] = (float)in_stack_ffffff6c;
color._colorize[0] = (float)in_stack_ffffff70;
color._colorize[1] = (float)in_stack_ffffff74;
color._colorize[2] = (float)in_stack_ffffff78;
color._colorize[3] = in_stack_ffffff7c;
color._offset[0] = in_stack_ffffff80;
color._offset[1] = (float)in_stack_ffffff84;
color._offset[2] = in_stack_ffffff88;
pos_03.y = fVar6;
pos_03.x = fVar5;
render_input_button_icon(controllerIndex,0x1d,0,1,color,pos_03);
}
}
if ((char)this[1]._genericPrompt._sprite._animDefaultName._size == '\0') {
ExceptionList = local_1c;
return;
}
LAB_009b8e1f:
if (isShowPassword != '\0') {
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x174)))) == 0) {
nullFrame = GHIDRA_CAST<float *>(0x0);
}
else {
nullFrame = AnimationState::GetNullFrame
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x170)))),GHIDRA_CAST<uint8_t *>("PasswordPos"));
}
local_30.x = *nullFrame + pos->x;
local_30.y = nullFrame[1] + pos->y;
lobby_password_render(&(g_manager->_lobbySettings)._password,&local_30,1.0);
}
ExceptionList = local_1c;
return;
}