Files
isaac-port/generated-src/hud.cpp
T
shweetandClaude Opus 5.5 fd8b965350 Curation round 4: popups, Seeds/Random, Game, KeyConfigs, offline NetplayManager, Console, TextureCache, render passes
Six agents took over PopupButtons/PopupQueue/AchievementOverlay, Seeds with the global Random (now seeded from the
clock as in the original), Game (g_game exists from Manager::Init on), KeyConfigs, an offline NetplayManager, Console's
output and printing, TextureCache, the color-mod and sprite shader passes, mod shaders and reload_resource_paths. An
integration pass moved callers to the new APIs (0 errors, 0 warnings with -Wall -Wextra). build/isaac loads the 34
installed mods and stops at ScoreSheet::ScoreSheet in Game's constructor; with the remaining stubs skipped under gdb the
intro cutscene plays through and the main menu's frame loop runs.

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

6329 lines
260 KiB
C++

#include "classes.h"
// 004aaee0
void HUD::SetVisible(uint8_t param_2)
{
this->_isVisible = param_2;
return;
}
// 006f2060
void HUD::constructor()
{
int remaining;
uint32_t *cursor;
uint8_t *pbVar1;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00afba54;
local_10 = ExceptionList;
ExceptionList = &local_10;
_eh_vector_constructor_iterator_(this,0x6dc,8,FUN_006efc70,FUN_006efde0);
local_8 = 0;
Font::Font(&this->_font);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
Font::Font(&this->_fontKR);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
ANM2::constructor(&this->_chargeBarSprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
ANM2::constructor(&this->_chargeBarSmallSprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
ANM2::constructor(&this->_heartsSprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
ANM2::constructor(&this->_pickupHUDSprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
ANM2::constructor(&this->_cardsPillsSprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
FUN_008405b0();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
_eh_vector_constructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3ed0))),500,6,FUN_008405b0,HUD_Message::~HUD_Message)
;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 9;
_eh_vector_constructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a88))),500,4,FUN_008405b0,HUD_Message::~HUD_Message)
;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 10;
ANM2::constructor(&this->_fortuneSprite);
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x536c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5370)))) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xc;
ANM2::constructor(&this->_statsSprite);
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5488)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x548c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a0)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a4)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a8)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54ac)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b0)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b4)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54bc)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c0)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c4)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c8)))) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x13;
ANM2::constructor(&this->_coopMenuSprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x14;
ANM2::constructor(&this->_inventorySprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x15;
ANM2::constructor(&this->_craftingTableSprite);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x16;
ANM2::constructor(&this->_poopSpellsSprite);
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x592c)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5930)))) = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x18;
remaining = 4;
cursor = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5934))));
do {
cursor[1] = 0;
*cursor = 0;
remaining = remaining + -1;
cursor = cursor + 2;
} while (remaining != 0);
remaining = 8;
cursor = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5954))));
do {
cursor[1] = 0;
*cursor = 0;
remaining = remaining + -1;
cursor = cursor + 2;
} while (remaining != 0);
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x59a0)))) = 0;
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x599c)))) = 0;
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&this->_statHUD));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x19;
cursor = GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5ab8))));
remaining = 2;
do {
*cursor = 0;
_vector_constructor_iterator_(cursor + 1,0x14,10,GHIDRA_CAST<_func_void_ptr_void_ptr *>(&LAB_006efa10));
cursor = cursor + 0x33;
remaining = remaining + -1;
} while (remaining != 0);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x1a;
_eh_vector_constructor_iterator_
(&this->_historyHUD,0x14,2,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0083ab90),
GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006f3050));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x1b;
text_image_cache_clear(&this->_historyHUD);
this[1]._playerHUD[0x2c] = 0;
this[1]._playerHUD[0x2d] = 0;
this[1]._playerHUD[0x2e] = 0;
this[1]._playerHUD[0x2f] = 0;
this[1]._playerHUD[0x30] = 0;
this[1]._playerHUD[0x31] = 0;
this[1]._playerHUD[0x32] = 0;
this[1]._playerHUD[0x33] = 0;
this[1]._playerHUD[0x34] = 0;
this[1]._playerHUD[0x35] = 0;
this[1]._playerHUD[0x36] = 0;
this[1]._playerHUD[0x37] = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x1d;
ANM2::constructor(GHIDRA_CAST<ANM2 *>((this[1]._playerHUD + 0x38)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x1e;
ANM2::constructor(GHIDRA_CAST<ANM2 *>((this[1]._playerHUD + 0x14c)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x1f;
SharedPtrPair::constructor();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x20;
ANM2::constructor(GHIDRA_CAST<ANM2 *>((this[1]._playerHUD + 0x28c)));
this[1]._playerHUD[0x3a0] = 0xff;
this[1]._playerHUD[0x3a1] = 0xff;
this[1]._playerHUD[0x3a2] = 0xff;
this[1]._playerHUD[0x3a3] = 0xff;
this[1]._playerHUD[0x3a8] = 0;
this[1]._playerHUD[0x3a9] = 0;
this[1]._playerHUD[0x3aa] = 0;
this[1]._playerHUD[0x3ab] = 0;
this[1]._playerHUD[0x3a4] = 0;
this[1]._playerHUD[0x3a5] = 0;
this[1]._playerHUD[0x3a6] = 0;
this[1]._playerHUD[0x3a7] = 0;
pbVar1 = this[1]._playerHUD + 0x3ac;
pbVar1[0] = 0;
pbVar1[1] = 0;
pbVar1[2] = 0;
pbVar1[3] = 0;
this[1]._playerHUD[0x3bc] = 0;
this[1]._playerHUD[0x3bd] = 0;
this[1]._playerHUD[0x3be] = 0;
this[1]._playerHUD[0x3bf] = 0;
this[1]._playerHUD[0x3c0] = 0xf;
this[1]._playerHUD[0x3c1] = 0;
this[1]._playerHUD[0x3c2] = 0;
this[1]._playerHUD[0x3c3] = 0;
*pbVar1 = 0;
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0x22);
Font::Font(GHIDRA_CAST<Font *>((this[1]._playerHUD + 0x3c4)));
this[1]._playerHUD[0x410] = 0;
this[1]._playerHUD[0x411] = 0;
this[1]._playerHUD[0x412] = 0;
this[1]._playerHUD[0x413] = 0;
this[1]._playerHUD[0x414] = 0;
this[1]._playerHUD[0x415] = 0;
this[1]._playerHUD[0x416] = 0x80;
this[1]._playerHUD[0x417] = 0x3f;
ExceptionList = local_10;
return;
}
// 006f23d0
void HUD::destructor()
{
std_map *fontCharMap;
char isLastRef;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
local_8 = 0xffffffff;
puStack_c = &LAB_00afba80;
local_10 = ExceptionList;
ExceptionList = &local_10;
FUN_0083c4c0(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
local_8 = 0;
_eh_vector_destructor_iterator_(&this->_historyHUD,0x14,2,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006f3050));
local_8 = 1;
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&this->_statHUD));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x59f4)))));
AnimationState::~AnimationState(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x59d4)))));
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x59bc))))))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_statHUD))))->msvc::string::_Tidy_deallocate();
local_8 = 2;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5930)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5930)))) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x592c))));
}
}
local_8 = 3;
ANM2::Reset(&this->_poopSpellsSprite);
AnimationState::~AnimationState(&(this->_poopSpellsSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_poopSpellsSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_poopSpellsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_poopSpellsSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 4;
ANM2::Reset(&this->_craftingTableSprite);
AnimationState::~AnimationState(&(this->_craftingTableSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_craftingTableSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_craftingTableSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_craftingTableSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 5;
ANM2::Reset(&this->_inventorySprite);
AnimationState::~AnimationState(&(this->_inventorySprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_inventorySprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_inventorySprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_inventorySprite))))->msvc::string::_Tidy_deallocate();
local_8 = 6;
ANM2::Reset(&this->_coopMenuSprite);
AnimationState::~AnimationState(&(this->_coopMenuSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_coopMenuSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_coopMenuSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_coopMenuSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 7;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c8)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c8)))) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c4))));
}
}
local_8 = 8;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c0)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c0)))) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54bc))));
}
}
local_8 = 9;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b4)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b4)))) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b0))));
}
}
local_8 = 10;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54ac)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54ac)))) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a8))));
}
}
local_8 = 0xb;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a4)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a4)))) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a0))));
}
}
local_8 = 0xc;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x548c)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x548c)))) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5488))));
}
}
local_8 = 0xd;
ANM2::Reset(&this->_statsSprite);
AnimationState::~AnimationState(&(this->_statsSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_statsSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_statsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_statsSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0xe;
if (*GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5370)))) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5370)))) + 0xc))();
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x536c))));
}
}
local_8 = 0xf;
ANM2::Reset(&this->_fortuneSprite);
AnimationState::~AnimationState(&(this->_fortuneSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_fortuneSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_fortuneSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_fortuneSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0xffffffff;
_eh_vector_destructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a88))),500,4,HUD_Message::~HUD_Message);
_eh_vector_destructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3ed0))),500,6,HUD_Message::~HUD_Message);
(GHIDRA_CAST<HUD_Message *>((GHIDRA_CAST<HUD_Message *>(&this->_messageMain))))->HUD_Message::~HUD_Message();
local_8 = 0x10;
ANM2::Reset(&this->_cardsPillsSprite);
AnimationState::~AnimationState(&(this->_cardsPillsSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_cardsPillsSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_cardsPillsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_cardsPillsSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0x11;
ANM2::Reset(&this->_pickupHUDSprite);
AnimationState::~AnimationState(&(this->_pickupHUDSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_pickupHUDSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_pickupHUDSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_pickupHUDSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0x12;
ANM2::Reset(&this->_heartsSprite);
AnimationState::~AnimationState(&(this->_heartsSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_heartsSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_heartsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_heartsSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0x13;
ANM2::Reset(&this->_chargeBarSmallSprite);
AnimationState::~AnimationState(&(this->_chargeBarSmallSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_chargeBarSmallSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_chargeBarSmallSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_chargeBarSmallSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0x14;
ANM2::Reset(&this->_chargeBarSprite);
AnimationState::~AnimationState(&(this->_chargeBarSprite)._overlayAnimState);
AnimationState::~AnimationState(&(this->_chargeBarSprite)._animState);
(GHIDRA_CAST<msvc::string *>(((this->_chargeBarSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_chargeBarSprite))))->msvc::string::_Tidy_deallocate();
local_8 = 0xffffffff;
Font::Unload(&this->_fontKR);
fontCharMap = &(this->_fontKR)._charsBlock;
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
(fontCharMap,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharMap,
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT((this->_fontKR)._charsBlock._head) + 4));
operator_delete(fontCharMap->_head,0x18);
FUN_004b3950();
Font::Unload(&this->_font);
fontCharMap = &(this->_font)._charsBlock;
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
(fontCharMap,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharMap,
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT((this->_font)._charsBlock._head) + 4));
operator_delete(fontCharMap->_head,0x18);
FUN_004b3950();
_eh_vector_destructor_iterator_(this,0x6dc,8,FUN_006efde0);
ExceptionList = local_10;
return;
}
// 0083ac20
void HUD::render_extra_hud(float *param_2, uint8_t param_3)
{
char cVar1;
uint32_t uVar2;
uint32_t secondListRows;
void *quad;
uint8_t *shader;
Vector *position;
uint32_t *extraout_EAX;
uint8_t *iconQuad;
int iVar3;
uint32_t *copySrc;
uint32_t *copyDst;
float itemY;
float itemX;
float fVar4;
float cachedBottomY;
float cachedOriginY;
double dVar5;
uint8_t auStackY_350 [128];
Vector *size;
uint32_t *imageRefCount;
KColor *color;
uint8_t auStack_2b8 [8];
float listX;
float iconSize;
float originY;
uint32_t *local_2a4;
Vector local_2a0;
uint32_t local_298;
float bottomY;
Vector local_290;
int itemIndex;
int listIndex;
KColor quadColor [2];
KColor whiteColor;
Vector smallIconSize;
Vector smallIconPos;
Vector bigIconSize;
Vector bigIconPos;
SourceQuad sourceQuad;
uint32_t colorQuad [28];
uint8_t backdropQuad [112];
uint8_t smallIconQuad [112];
uint8_t bigIconQuad [112];
ColorMod shaderColor;
uint32_t local_14;
uint32_t *itemEntry;
int *itemImage;
uint8_t shaderFlags;
local_14 = __security_cookie ^ GHIDRA_UINT(auStack_2b8);
originY = param_2[1];
listX = *param_2;
iconSize = 16.0;
if (param_3 == 0) {
iconSize = (float)&DAT_42000000;
}
uVar2 = GHIDRA_UINT(param_3) * 2 + 2;
local_2a0.x = (((1.0 - (g_manager->_optionsConfig)._hudOffset) * 14.0 + (g_screenHeight - 64.0)) -
originY) / iconSize;
local_298 = uVar2;
dVar5 = ceil((double)local_2a0.x);
bottomY = (float)dVar5 * iconSize + originY;
if (originY < bottomY) {
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x14)) != 0) {
listX = listX - 2.0;
local_298 = uVar2 >> 1;
uVar2 = ((*GHIDRA_CAST<int *>((this->_playerHUD + 0xc)) - *GHIDRA_CAST<int *>((this->_playerHUD + 8))) / 0x28 - 1U) /
local_298;
secondListRows =
((*GHIDRA_CAST<int *>((this->_playerHUD + 0x20)) - *GHIDRA_CAST<int *>((this->_playerHUD + 0x1c))) / 0x28 - 1U) /
local_298;
if (GHIDRA_INT((uVar2 + 1)) < GHIDRA_INT((secondListRows + 1))) {
uVar2 = secondListRows;
}
iVar3 = uVar2 + 1;
if (0 < iVar3) {
quadColor[0]._unk = 0;
local_290.x = 1.0;
local_2a0.y = originY;
quadColor[0]._red = 0.5019608;
quadColor[0]._green = 0.5019608;
quadColor[0]._blue = 0.5019608;
quadColor[0]._alpha = 0.5019608;
if (GHIDRA_INT(dVar5) < iVar3) {
iVar3 = GHIDRA_INT(dVar5);
}
local_290.y = (float)iVar3 * iconSize;
local_2a0.x = listX + 32.0;
render_quad_set_rect(backdropQuad,&local_2a0,&local_290,quadColor);
render_color_shader_pass(quad);
}
}
local_2a0.x = (float)(this->_playerHUD + 0xc);
listIndex = 0;
fVar4 = iconSize;
cachedBottomY = bottomY;
cachedOriginY = originY;
do {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<HUD *>((GHIDRA_INT(local_2a0.x) + -0xc)))->_playerHUD) == 0) break;
local_2a4 = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(local_2a0.x) + -4));
itemIndex = 0;
if (local_2a4 != *GHIDRA_CAST<uint32_t **>(local_2a0.x)) {
do {
quadColor[0]._unk = 0;
quadColor[0]._red = 1.0;
quadColor[0]._green = 1.0;
quadColor[0]._blue = 1.0;
quadColor[0]._alpha = 0.5;
itemY = (float)(itemIndex / GHIDRA_INT(local_298)) * fVar4 + cachedOriginY;
itemX = (float)(itemIndex % GHIDRA_INT(local_298)) * fVar4 + listX;
if (cachedBottomY <= itemY) break;
uVar2 = *local_2a4;
shaderColor._offset[0] = 0.0;
shaderColor._offset[1] = 0.0;
shaderColor._offset[2] = 0.0;
shaderColor._tint[0] = 1.0;
shaderColor._tint[1] = 1.0;
shaderColor._tint[2] = 1.0;
shaderColor._tint[3] = 1.0;
shaderColor._colorize[0] = 0.0;
shaderColor._colorize[1] = 0.0;
shaderColor._colorize[2] = 0.0;
shaderColor._colorize[3] = 0.0;
if (uVar2 == 0x279) {
shader = &DAT_00c791b8;
shaderFlags = DAT_00c791bc;
LAB_0083aeee:
if ((shaderFlags & 1) == 0) {
shader = g_currentShader;
}
uVar2 = g_manager->_framecount / 2 & 0x800000ff;
if (GHIDRA_INT(uVar2) < 0) {
uVar2 = (uVar2 - 1 | 0xffffff00) + 1;
}
shaderColor._colorize[3] = (float)GHIDRA_INT(uVar2) * 0.00390625;
g_currentShader = shader;
}
else {
if ((0 < GHIDRA_INT(uVar2)) && ((uVar2 & 0x88000) == 0x88000)) {
shader = &DAT_00c79208;
shaderFlags = DAT_00c7920c;
goto LAB_0083aeee;
}
shader = &g_shaders;
if ((DAT_00c7911c & 1) == 0) {
shader = g_currentShader;
}
g_currentShader = shader;
}
sourceQuad._topLeft.x = g_vectorZero.x;
if (((char)local_2a4[4] != '\0') && (local_2a4[5] == 0x14)) {
sourceQuad._topLeft.x =
g_vectorZero.x +
(float)(3 - *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<HUD *>((GHIDRA_INT(local_2a0.x) + -0xc)))->_playerHUD) +
0x1394))) * 32.0;
}
sourceQuad._topRight.y = g_vectorZero.y;
sourceQuad._topRight.x = sourceQuad._topLeft.x + 32.0;
sourceQuad._topLeft.y = g_vectorZero.y;
sourceQuad._bottomLeft.y = g_vectorZero.y + 32.0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(sourceQuad._coordinateSpace)) + 0x0))) = 1;
whiteColor._unk = 0;
whiteColor._red = 1.0;
whiteColor._green = 1.0;
whiteColor._blue = 1.0;
whiteColor._alpha = 1.0;
sourceQuad._bottomLeft.x = sourceQuad._topLeft.x;
sourceQuad._bottomRight.x = sourceQuad._topRight.x;
sourceQuad._bottomRight.y = sourceQuad._bottomLeft.y;
(GHIDRA_CAST<ColorQuad *>((colorQuad)))->ColorQuad::ColorQuad(&whiteColor);
whiteColor._unk = 0;
whiteColor._red = 1.0;
whiteColor._green = 1.0;
whiteColor._blue = 1.0;
whiteColor._alpha = 1.0;
itemX = itemX + (g_game->_screenShakeOffset).x;
itemY = itemY + (g_game->_screenShakeOffset).y;
color = &whiteColor;
if (param_3 == 0) {
size = &bigIconSize;
bigIconSize.x = (float)&DAT_42000000;
bigIconSize.y = (float)&DAT_42000000;
position = &bigIconPos;
iconQuad = bigIconQuad;
bigIconPos.x = itemX;
bigIconPos.y = itemY;
}
else {
size = &smallIconSize;
smallIconSize.x = 16.0;
smallIconSize.y = 16.0;
position = &smallIconPos;
iconQuad = smallIconQuad;
smallIconPos.x = itemX;
smallIconPos.y = itemY;
}
render_quad_set_rect(iconQuad,position,size,color);
itemEntry = local_2a4;
copySrc = extraout_EAX;
copyDst = colorQuad;
for (iVar3 = 0x1c; iVar3 != 0; iVar3 = iVar3 + -1) {
*copyDst = *copySrc;
copySrc = copySrc + 1;
copyDst = copyDst + 1;
}
if (local_2a4[1] == 0) {
if (GHIDRA_INT(*local_2a4) < 0) {
local_290.x = (float)(auStackY_350 + 0x88);
KAGE::SmartPointer::operator_assign
(auStackY_350 + 0x88,&(g_game->_proceduralItemManager)._renderTarget);
apply_sprite_shader_params(&shaderColor,1,size,color);
GlitchedCollectibleGfx::render_item
(&g_game->_proceduralItemManager,*itemEntry,&sourceQuad,colorQuad,quadColor)
;
goto LAB_0083b1fb;
}
}
else {
if ((char)local_2a4[4] != '\0') {
if ((local_2a4[5] & 0x7fff) == 0x4b) {
quadColor[0]._red = 0.5176471;
quadColor[0]._green = 0.101960786;
quadColor[0]._blue = 0.101960786;
quadColor[0]._alpha = 0.5019608;
quadColor[0]._unk = 0;
}
else if ((local_2a4[5] & 0x7fff) == 0xa6) {
shaderColor._colorize[0] = 0.5976471;
shaderColor._colorize[1] = 0.33411765;
shaderColor._colorize[2] = 0.31058824;
shaderColor._colorize[3] = 1.0;
}
}
iconQuad = GHIDRA_CAST<uint8_t *>(0x0);
imageRefCount = GHIDRA_CAST<uint32_t *>(0x0);
itemImage = GHIDRA_CAST<int *>(local_2a4[2]);
local_290.x = (float)local_2a4[1];
local_2a4 = GHIDRA_CAST<uint32_t *>(itemImage);
if (itemImage != GHIDRA_CAST<int *>(0x0)) {
cVar1 = (**(code **)(*itemImage + 4))();
if (cVar1 != '\0') {
if (imageRefCount != GHIDRA_CAST<uint32_t *>(0x0)) {
cVar1 = (**(code **)(*imageRefCount + 0xc))();
if ((cVar1 != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(auStackY_350 + 0x88);
}
}
iconQuad = GHIDRA_CAST<uint8_t *>(local_290.x);
imageRefCount = local_2a4;
}
}
apply_sprite_shader_params(&shaderColor,1,iconQuad,imageRefCount);
(**(code **)(*GHIDRA_CAST<int *>(itemEntry[1]) + 0x14))(&sourceQuad);
LAB_0083b1fb:
fVar4 = iconSize;
cachedBottomY = bottomY;
cachedOriginY = originY;
}
local_2a4 = itemEntry + 10;
itemIndex = itemIndex + 1;
} while (local_2a4 != *GHIDRA_CAST<uint32_t **>(local_2a0.x));
}
listX = listX + 33.0;
local_2a0.x = (float)(GHIDRA_INT(local_2a0.x) + 0x14);
listIndex = listIndex + 1;
} while (listIndex < 2);
shader_cache_find(GHIDRA_INT(local_2a0.x));
}
return;
}
// 0083b280
void HUD::rebuild_player_item_icons(void *iconCaches, uint32_t playerIdx, uint8_t isRebuild)
{
char isLastRef;
RoomDescriptor *room;
uint32_t seed;
void *newIcon;
std_string *path;
int *piVar1;
uint32_t *iconIt;
int historyIt;
uint32_t trinketId;
int *cacheKey;
uint32_t uStack_160;
int *tmpLoadedImageRef;
int *tmpCachedImageRef;
int *tmpEmptyImageRef;
uint8_t loadedIconImage [4];
int *loadedIconImageRef;
uint32_t local_cc;
uint32_t uStack_c8;
uint32_t uStack_c4;
uint32_t uStack_c0;
uint32_t local_bc;
uint32_t uStack_b8;
uint32_t local_b4;
int cachedIconKey;
uint8_t cachedIconImage [4];
int *cachedIconImageRef;
uint32_t local_a4;
uint32_t uStack_a0;
uint32_t uStack_9c;
uint32_t uStack_98;
uint32_t local_94;
uint32_t uStack_90;
uint32_t local_8c;
int emptyIconKey;
uint8_t emptyIconImage [4];
int *emptyIconImageRef;
uint32_t local_7c;
uint32_t uStack_78;
uint32_t uStack_74;
uint32_t uStack_70;
uint32_t local_6c;
uint32_t uStack_68;
uint32_t local_64;
int *playerHud;
uint32_t oldIconKey;
uint8_t oldIconImage [4];
int *local_50;
int image;
int *imageRef;
int *icons;
int *oldImagesHead;
int *local_38;
int *local_34;
int *local_30;
ItemConfig_Item *itemConfig;
uint32_t *historyEntry;
char isTrinket;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
int local_14;
puStack_20 = oldIconImage + 0x50;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0272c;
local_1c = ExceptionList;
ExceptionList = &local_1c;
if (playerIdx < 2) {
piVar1 = GHIDRA_CAST<int *>((GHIDRA_INT(iconCaches) + playerIdx * 0x14));
local_38 = GHIDRA_CAST<int *>(*piVar1);
if (local_38 != GHIDRA_CAST<int *>(0x0)) {
if (isRebuild == 0) {
*GHIDRA_CAST<uint8_t *>((piVar1 + 1)) = 1;
}
else {
playerHud = piVar1;
FUN_0083bf50();
icons = piVar1 + 2;
local_14 = 0;
iconIt = GHIDRA_CAST<uint32_t *>(*icons);
if (iconIt != GHIDRA_CAST<uint32_t *>(piVar1[3])) {
do {
if (iconIt[1] != 0) {
oldIconKey = *iconIt;
(GHIDRA_CAST<KAGE::SmartPointer *>((oldIconImage)))->KAGE::SmartPointer::operator_assign(iconIt + 1);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
uStack_160 = 0x83b33b;
FUN_0083c320();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
if (((local_50 != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(*local_50 + 0xc))(), isLastRef != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)();
}
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
}
iconIt = iconIt + 10;
} while (iconIt != GHIDRA_CAST<uint32_t *>(piVar1[3]));
}
FUN_00709300();
piVar1[3] = piVar1[2];
historyIt = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38) + 0x1df0));
if (historyIt != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38) + 0x1dec))) {
historyEntry = GHIDRA_CAST<uint32_t *>((historyIt + -0x14));
do {
isTrinket = (char)historyEntry[-1];
if (isTrinket == '\0') {
local_30 = GHIDRA_CAST<int *>(*historyEntry);
LAB_0083b473:
trinketId = 0;
itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,GHIDRA_INT(local_30));
piVar1 = local_30;
}
else {
trinketId = *historyEntry;
piVar1 = GHIDRA_CAST<int *>(0x0);
if ((trinketId & 0x7fff) == 0x4b) {
uStack_160 = 0x83b3d1;
room = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(g_game))))->Level::GetRoomByIdx(g_game->_currentRoomIdx,-1);
seed = room->SpawnSeed;
if (seed != 0) {
seed = seed >> 2 ^ seed;
seed = seed << 7 ^ seed;
trinketId = (seed >> 0x19 ^ seed) % 0xbd + 1 | *historyEntry & 0x8000;
}
piVar1 = GHIDRA_CAST<int *>(0x0);
}
else if ((trinketId & 0x7fff) == 0xa6) {
piVar1 = *GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_38) + 0x1fb8));
local_30 = piVar1;
if (piVar1 != GHIDRA_CAST<int *>(0x0)) {
isTrinket = '\0';
goto LAB_0083b473;
}
}
local_34 = (g_manager->_itemConfig)._trinkets._begin;
if (GHIDRA_INT((trinketId & 0x7fff)) <
GHIDRA_INT((g_manager->_itemConfig)._trinkets._end) - GHIDRA_INT(local_34) >> 2) {
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(local_34[trinketId & 0x7fff]);
}
else {
itemConfig = GHIDRA_CAST<ItemConfig_Item *>(0x0);
}
}
if ((itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) && (itemConfig->type != 3)) {
if (itemConfig->id < 0) {
(GHIDRA_CAST<KAGE::SmartPointer *>((&uStack_160)))->KAGE::SmartPointer::SmartPointer((void *)0x0);
newIcon = (void *)FUN_0083aae0();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
emptyIconKey = itemConfig->id;
(GHIDRA_CAST<KAGE::SmartPointer *>((emptyIconImage)))->KAGE::SmartPointer::operator_assign(newIcon);
local_7c = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 8));
uStack_78 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0xc));
uStack_74 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x10));
uStack_70 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x14));
local_6c = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x18));
uStack_68 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x1c));
local_64 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x20));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
FUN_0083bf90();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
if (((emptyIconImageRef != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(*emptyIconImageRef + 0xc))(), isLastRef != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)();
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
if (tmpEmptyImageRef != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpEmptyImageRef + 0xc))();
joined_r0x0083b790:
if ((isLastRef != '\0') && (g_imageReleaseFn != (code *)0x0)) {
(*g_imageReleaseFn)();
}
}
}
else {
cacheKey = GHIDRA_CAST<int *>((trinketId | 0x80000));
if (isTrinket == '\0') {
cacheKey = piVar1;
}
uStack_160 = 0x83b587;
local_34 = cacheKey;
msvc::set<int>::find_node();
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_50) + 0xd)) != '\0') ||
(local_30 = local_50, GHIDRA_INT(cacheKey) < local_50[4])) {
local_30 = oldImagesHead;
}
if (local_30 != oldImagesHead) {
(GHIDRA_CAST<KAGE::SmartPointer *>((&uStack_160)))->KAGE::SmartPointer::operator_assign(local_30 + 5);
newIcon = (void *)FUN_0083aae0();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
cachedIconKey = local_30[4];
(GHIDRA_CAST<KAGE::SmartPointer *>((cachedIconImage)))->KAGE::SmartPointer::operator_assign(newIcon);
local_a4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 8));
uStack_a0 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0xc));
uStack_9c = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x10));
uStack_98 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x14));
local_94 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x18));
uStack_90 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x1c));
local_8c = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x20));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
FUN_0083bf90();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
if (((cachedIconImageRef != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(*cachedIconImageRef + 0xc))(), isLastRef != '\0'))
&& (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)();
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 10;
if (((tmpCachedImageRef != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(*tmpCachedImageRef + 0xc))(), isLastRef != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)();
}
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
uStack_160 = 0x83b686;
FUN_00414d60();
goto LAB_0083b7a8;
}
path = &itemConfig->gfxFilename;
if (0xf < (itemConfig->gfxFilename)._capacity) {
path = *GHIDRA_CAST<std_string **>(path->_buf);
}
uStack_160 = 0x83b6a3;
Manager::LoadImage(&image,GHIDRA_CAST<uint8_t *>(path));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xb;
if (image != 0) {
(GHIDRA_CAST<KAGE::SmartPointer *>((&uStack_160)))->KAGE::SmartPointer::operator_assign(&image);
newIcon = (void *)FUN_0083aae0();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xc;
(GHIDRA_CAST<KAGE::SmartPointer *>((loadedIconImage)))->KAGE::SmartPointer::operator_assign(newIcon);
local_cc = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 8));
uStack_c8 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0xc));
uStack_c4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x10));
uStack_c0 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x14));
local_bc = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x18));
uStack_b8 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x1c));
local_b4 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(newIcon) + 0x20));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xd;
FUN_0083bf90();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xe;
if (((loadedIconImageRef != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(*loadedIconImageRef + 0xc))(), isLastRef != '\0'))
&& (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)();
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0xf;
if (((tmpLoadedImageRef != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(*tmpLoadedImageRef + 0xc))(), isLastRef != '\0')) &&
(g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)();
}
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 0x10;
if (imageRef != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*imageRef + 0xc))();
goto joined_r0x0083b790;
}
}
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
}
LAB_0083b7a8:
historyIt = historyIt + -0x1c;
historyEntry = historyEntry + -7;
} while (historyIt != *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_38) + 0x1dec)));
piVar1 = playerHud;
}
local_38 = GHIDRA_CAST<int *>(*oldImagesHead);
if (local_38 != oldImagesHead) {
do {
(GHIDRA_CAST<KAGE::SmartPointer *>((local_38 + 5)))->KAGE::SmartPointer::reset((void *)0x0);
msvc::
_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
::operator++((_Tree_unchecked_const_iterator<msvc::_Tree_val<msvc::_Tree_simple_types<unsigned_int>_>,msvc::_Iterator_base0>
*)&local_38);
} while (local_38 != oldImagesHead);
}
*GHIDRA_CAST<uint8_t *>((piVar1 + 1)) = 0;
uStack_160 = 0x83b800;
msvc::map<unsigned_int_ImagePtr>::_Erase_tree();
uStack_160 = 0x83b80a;
operator_delete(oldImagesHead,0x1c);
}
}
}
ExceptionList = local_1c;
return;
}
// 0083b850
void HUD::update_player_hud_slots(uint8_t param_2)
{
void *pvVar1;
char isLastRef;
int iVar2;
uint8_t *pbVar3;
uint32_t uVar4;
int *piVar5;
uint32_t hudSlot;
void *pvVar6;
int *ptr;
HUD *pHVar7;
PlayerManager *playerManager;
uint8_t *entry;
uint8_t isRebuild;
void *movedImagesBegin;
void *movedImagesEnd;
int local_34;
uint32_t slotIndex;
HUD *slotEntry;
uint32_t shiftIndex;
int movedImagesCapacity;
void *local_20;
uint8_t *local_1c;
HUD *hud;
uint8_t local_11;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
void *imagesBegin;
local_8 = 0xffffffff;
puStack_c = &LAB_00b02750;
local_10 = ExceptionList;
ExceptionList = &local_10;
slotEntry = GHIDRA_CAST<HUD *>((this->_playerHUD + 0x14));
slotIndex = 2;
hud = this;
do {
pHVar7 = slotEntry;
uVar4 = slotIndex;
if (*GHIDRA_CAST<int *>(slotEntry->_playerHUD) != 0) {
iVar2 = FUN_0083bbc0(*GHIDRA_CAST<int *>(slotEntry->_playerHUD));
if (iVar2 < 0) {
*GHIDRA_CAST<int *>(pHVar7->_playerHUD) = 0;
shiftIndex = uVar4;
if (uVar4 < 2) {
local_1c = pHVar7->_playerHUD + 0x10;
do {
entry = local_1c;
local_11 = local_1c[-0xc];
pbVar3 = local_1c + 0xc;
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<HUD *>((local_1c + -0x10)))->_playerHUD);
local_34 = *GHIDRA_CAST<int *>(local_1c);
local_1c[0] = 0;
local_1c[1] = 0;
local_1c[2] = 0;
local_1c[3] = 0;
pvVar6 = *(void **)(local_1c + -4);
local_1c[-0xffffffff00000004] = 0;
local_1c[-0xffffffff00000003] = 0;
local_1c[-0xffffffff00000002] = 0;
local_1c[-0xffffffff00000001] = 0;
imagesBegin = *(void **)(local_1c + -8);
local_1c[-0xffffffff00000008] = 0;
local_1c[-0xffffffff00000007] = 0;
local_1c[-0xffffffff00000006] = 0;
local_1c[-0xffffffff00000005] = 0;
*GHIDRA_CAST<int *>((GHIDRA_CAST<HUD *>((local_1c + -0x10)))->_playerHUD) = *GHIDRA_CAST<int *>((local_1c + 4));
local_1c[-0xc] = local_1c[8];
if (local_1c + -8 != pbVar3) {
*GHIDRA_CAST<int *>((local_1c + -8)) = *GHIDRA_CAST<int *>(pbVar3);
*GHIDRA_CAST<int *>((local_1c + -4)) = *GHIDRA_CAST<int *>((local_1c + 0x10));
*GHIDRA_CAST<int *>(local_1c) = *GHIDRA_CAST<int *>((local_1c + 0x14));
pbVar3[0] = 0;
pbVar3[1] = 0;
pbVar3[2] = 0;
pbVar3[3] = 0;
local_1c[0x10] = 0;
local_1c[0x11] = 0;
local_1c[0x12] = 0;
local_1c[0x13] = 0;
local_1c[0x14] = 0;
local_1c[0x15] = 0;
local_1c[0x16] = 0;
local_1c[0x17] = 0;
}
local_1c[8] = local_11;
*GHIDRA_CAST<int *>((local_1c + 4)) = iVar2;
movedImagesBegin = imagesBegin;
movedImagesEnd = pvVar6;
movedImagesCapacity = local_34;
local_20 = pvVar6;
if ((void **)(local_1c + 0xc) == &movedImagesBegin) {
if (imagesBegin != (void *)0x0) {
if (imagesBegin != pvVar6) {
iVar2 = GHIDRA_INT(imagesBegin) + 4;
do {
local_8 = 2;
if (((*GHIDRA_CAST<int **>((iVar2 + 4)) != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(**GHIDRA_CAST<int **>((iVar2 + 4)) + 0xc))(), isLastRef != '\0'
)) && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(iVar2);
}
local_8 = 0xffffffff;
pvVar1 = (void *)(iVar2 + 0x24);
iVar2 = iVar2 + 0x28;
} while (pvVar1 != pvVar6);
}
entry = local_1c;
uVar4 = ((movedImagesCapacity - GHIDRA_INT(imagesBegin)) / 0x28) * 0x28;
pvVar6 = imagesBegin;
if (0xfff < uVar4) {
pvVar6 = *(void **)(GHIDRA_CAST<char *>(imagesBegin) + -4);
uVar4 = uVar4 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(imagesBegin) + (-4 - GHIDRA_INT(pvVar6))))) goto LAB_0083bba5;
}
operator_delete(pvVar6,uVar4);
goto LAB_0083ba90;
}
}
else {
piVar5 = *GHIDRA_CAST<int **>((local_1c + 0xc));
if (piVar5 != GHIDRA_CAST<int *>(0x0)) {
pbVar3 = *GHIDRA_CAST<uint8_t **>((local_1c + 0x10));
local_1c = pbVar3;
if (GHIDRA_CAST<uint8_t *>(piVar5) != pbVar3) {
do {
local_8 = 1;
if (GHIDRA_CAST<int *>(piVar5[2]) != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*GHIDRA_CAST<int *>(piVar5[2]) + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(piVar5 + 1);
}
pbVar3 = local_1c;
}
piVar5 = piVar5 + 10;
local_8 = 0xffffffff;
} while (GHIDRA_CAST<uint8_t *>(piVar5) != pbVar3);
piVar5 = *GHIDRA_CAST<int **>((entry + 0xc));
}
uVar4 = ((*GHIDRA_CAST<int *>((entry + 0x14)) - GHIDRA_INT(piVar5)) / 0x28) * 0x28;
ptr = piVar5;
if (0xfff < uVar4) {
ptr = GHIDRA_CAST<int *>(piVar5[-1]);
uVar4 = uVar4 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(piVar5) + (-4 - GHIDRA_INT(ptr))))) {
LAB_0083bba5:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar4);
}
*(void **)(entry + 0x10) = local_20;
*(void **)(entry + 0xc) = imagesBegin;
*GHIDRA_CAST<int *>((entry + 0x14)) = movedImagesCapacity;
LAB_0083ba90:
local_34 = 0;
movedImagesEnd = (void *)0x0;
movedImagesBegin = (void *)0x0;
local_1c = entry;
}
local_1c = local_1c + 0x14;
shiftIndex = shiftIndex + 1;
uVar4 = slotIndex;
pHVar7 = slotEntry;
} while (GHIDRA_INT(shiftIndex) < 2);
}
}
}
slotIndex = uVar4 - 1;
slotEntry = GHIDRA_CAST<HUD *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pHVar7[0xffffffff])) + 0x5c44))));
if (GHIDRA_INT(slotIndex) < 1) {
uVar4 = 0;
playerManager = &g_game->_playerManager;
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin)
>> 2 != 0) {
do {
pvVar6 = (playerManager->_playerList)._end;
if (GHIDRA_INT(pvVar6) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
pvVar6 = (playerManager->_playerList)._end;
}
piVar5 = (playerManager->_playerList)._begin;
if (uVar4 < GHIDRA_UINT((GHIDRA_INT(pvVar6) - GHIDRA_INT(piVar5) >> 2))) {
piVar5 = piVar5 + uVar4;
}
iVar2 = *piVar5;
isRebuild = param_2;
hudSlot = FUN_0083bbc0(iVar2);
rebuild_player_item_icons(hud,hudSlot,isRebuild);
if ((((*GHIDRA_CAST<int *>((iVar2 + 0x1e6c)) != 0) &&
((*GHIDRA_CAST<int *>((iVar2 + 0x13c0)) == 0x1d || (*GHIDRA_CAST<int *>((iVar2 + 0x13c0)) == 0x26)))) &&
(hudSlot = FUN_0083bbc0(*GHIDRA_CAST<int *>((iVar2 + 0x1e6c))), hudSlot < 2)) &&
(*GHIDRA_CAST<int *>((hud->_playerHUD + hudSlot * 0x14)) != 0)) {
hud->_playerHUD[hudSlot * 0x14 + 4] = 1;
}
uVar4 = uVar4 + 1;
playerManager = &g_game->_playerManager;
} while (uVar4 < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
}
ExceptionList = local_10;
return;
}
} while( true );
}
// 0083c5f0
void HUD::load_item_info_graphics()
{
uint8_t bVar1;
uint8_t *currentAnimName;
char *pcVar2;
uint32_t uVar3;
bool isLess;
std_string chargeIconsPath;
std_string resourcePath;
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
uint8_t *currentAnim;
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0288d;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
ExceptionList = &local_1c;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(resourcePath._buf)) + 0x0))) = msvc::_Allocate(0x30);
resourcePath._size = 0x20;
resourcePath._capacity = 0x2f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(resourcePath._buf))) + 0x0))),"font/TeamMeatEx/TeamMeatEx12.fnt",0x21);
local_14 = 0;
RichText::load_font(this->_playerHUD + 900,&resourcePath);
local_14 = 0xffffffff;
if (0xf < resourcePath._capacity) {
uVar3 = resourcePath._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(resourcePath._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(resourcePath._buf)) + 0x0))) + -4));
uVar3 = resourcePath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(resourcePath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
this->_playerHUD[0x3ec] = 0x66;
this->_playerHUD[0x3ed] = 0x66;
this->_playerHUD[0x3ee] = 0x66;
this->_playerHUD[0x3ef] = 0x3f;
ANM2::Reset(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x10)));
chargeIconsPath._size = 0;
chargeIconsPath._capacity = 0xf;
chargeIconsPath._buf[0] = '\0';
chargeIconsPath._buf[1] = '\0';
chargeIconsPath._buf[2] = '\0';
chargeIconsPath._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeIconsPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
chargeIconsPath._size = 0x1b;
chargeIconsPath._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(chargeIconsPath._buf))) + 0x0))),"gfx/ui/ui_charge_icons.anm2",0x1c);
local_14 = 1;
ANM2::Load(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x124)),&chargeIconsPath,1);
local_14 = 0xffffffff;
if (0xf < chargeIconsPath._capacity) {
uVar3 = chargeIconsPath._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(chargeIconsPath._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeIconsPath._buf)) + 0x0))) + -4));
uVar3 = chargeIconsPath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(chargeIconsPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
currentAnim = *GHIDRA_CAST<uint8_t **>((this->_playerHUD + 0x158));
if (currentAnim != GHIDRA_CAST<uint8_t *>(0x0)) {
currentAnimName = currentAnim;
if (0xf < *GHIDRA_CAST<uint32_t *>((currentAnim + 0x14))) {
currentAnimName = *GHIDRA_CAST<uint8_t **>(currentAnim);
}
pcVar2 = "ChargeIcon";
do {
bVar1 = *currentAnimName;
isLess = bVar1 < (uint8_t)*pcVar2;
if (bVar1 != *pcVar2) {
LAB_0083c7c0:
uVar3 = -GHIDRA_UINT(isLess) | 1;
goto LAB_0083c7c5;
}
if (bVar1 == 0) break;
bVar1 = currentAnimName[1];
isLess = bVar1 < (uint8_t)pcVar2[1];
if (bVar1 != pcVar2[1]) goto LAB_0083c7c0;
currentAnimName = currentAnimName + 2;
pcVar2 = pcVar2 + 2;
} while (bVar1 != 0);
uVar3 = 0;
LAB_0083c7c5:
if ((uVar3 == 0) && ((currentAnim[0x34] == 0 || (this->_playerHUD[0x168] != 0))))
goto LAB_0083c7f1;
}
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x124)),GHIDRA_CAST<uint8_t *>("ChargeIcon"),1);
if (bVar1 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((this->_playerHUD + 0x154)));
this->_playerHUD[0x168] = 1;
}
LAB_0083c7f1:
resourcePath._size = 0;
resourcePath._capacity = 0xf;
this->_playerHUD[0x260] = 0;
this->_playerHUD[0x261] = 0;
this->_playerHUD[0x262] = 0x80;
this->_playerHUD[0x263] = 0x40;
resourcePath._buf[0] = '\0';
resourcePath._buf[1] = '\0';
resourcePath._buf[2] = '\0';
resourcePath._buf[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(resourcePath._buf)) + 0x0))) = msvc::_Allocate(0x20);
resourcePath._size = 0x19;
resourcePath._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(resourcePath._buf))) + 0x0))),"gfx/ui/minimap_icons.anm2",0x1a);
local_14 = 2;
ANM2::Load(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x264)),&resourcePath,1);
if (0xf < resourcePath._capacity) {
uVar3 = resourcePath._capacity + 1;
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(resourcePath._buf))) + 0x0)));
if (0xfff < uVar3) {
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(resourcePath._buf)) + 0x0))) + -4));
uVar3 = resourcePath._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(resourcePath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pcVar2,uVar3);
}
ExceptionList = local_1c;
return;
}
// 0083c8d0
void HUD::update_item_info()
{
uint8_t *popupId;
float fVar1;
int iVar2;
void **ppvVar3;
uint8_t bVar4;
char cVar5;
uint32_t uVar6;
PersistentGameData *gameData;
LayerState *layer;
int iVar7;
void *pvVar8;
ItemConfig_Item *itemConfig;
std_string *tmpCStr;
uint8_t *******pppppppbVar9;
uint32_t uVar10;
EntityConfig_Entity *entityConfig;
ItemConfig_Card *card;
Entity_Player *pEVar11;
Entity_Player *player;
Vector *pVVar12;
int *popupNode;
HUD *extraout_ECX;
char *this_00;
char *ptr;
HUD *extraout_ECX_00;
HUD *extraout_ECX_01;
HUD *extraout_ECX_02;
HUD *extraout_ECX_03;
HUD *pHVar13;
HUD *extraout_ECX_04;
HUD *extraout_ECX_05;
uint32_t extraout_ECX_06;
uint32_t extraout_ECX_07;
uint32_t i;
int *this_01;
float fVar14;
float fVar15;
int64_t elapsedMs;
double dVar16;
uint8_t popup [8];
uint32_t local_1b8;
uint32_t local_1b4;
uint32_t local_1a8;
uint8_t *local_1a4;
uint8_t *local_1a0;
float local_194;
uint32_t local_18c;
uint32_t local_188;
uint32_t local_184;
uint32_t local_180;
uint32_t uStack_17c;
uint32_t uStack_178;
uint32_t uStack_174;
uint32_t local_170;
code *local_14c;
HUD *local_148;
Vector popupSize;
uint8_t *******local_110;
KColor local_10c;
float local_f8;
float local_f4;
HUD *local_f0;
Vector local_ec;
float local_e4;
HUD *local_e0;
Entity_Player *local_dc;
char infoText [24];
uint8_t local_c0 [12];
uint8_t local_b4 [12];
uint8_t local_a8 [12];
uint8_t local_9c [12];
uint8_t local_90 [12];
uint8_t local_84 [24];
char *prefixText [4];
uint32_t prefixTextSize;
uint32_t prefixTextCapacity;
void *spindownText [4];
uint32_t spindownTextSize;
uint32_t spindownTextCapacity;
std_string tmpString;
uint32_t stackCookie;
uint8_t *puStack_20;
void *prevExceptionList;
uint8_t *puStack_18;
void *ehState;
Manager *manager;
HUD *nearestPickup;
int pickupVariant;
int *popupListHead;
puStack_20 = GHIDRA_CAST<uint8_t *>((spindownText + 0x14));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0xffffff;
puStack_18 = &LAB_00b02924;
prevExceptionList = ExceptionList;
uVar6 = __security_cookie ^ GHIDRA_UINT((spindownText + 0x11));
ExceptionList = &prevExceptionList;
gameData = GHIDRA_CAST<PersistentGameData *>((g_manager[1]._persistentGameData._achievements + 0xc));
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
gameData = &g_manager->_persistentGameData;
}
local_f0 = this;
stackCookie = uVar6;
if (((gameData->_achievements[0x281] == 0) &&
(((ppvVar3 = spindownText + 0x14, *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2 ||
(ppvVar3 = spindownText + 0x14, g_game == GHIDRA_CAST<Game *>(0x0))) ||
(((g_game->_dailyChallenge)._id == 0 &&
(ppvVar3 = spindownText + 0x14, g_game->_isDebug == 0)))))) ||
(((ppvVar3 = spindownText + 0x14, g_game->_challenge == 0x20 ||
(ppvVar3 = spindownText + 0x14, (g_manager->_optionsConfig)._itemInfoDisplayEnabled == 0)) ||
(ppvVar3 = spindownText + 0x14, (*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)
))) goto LAB_0083d192;
local_dc = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::get_first_local_main_player();
pHVar13 = extraout_ECX;
if (local_dc == GHIDRA_CAST<Entity_Player *>(0x0)) goto LAB_0083d199;
i = 0;
local_e0 = GHIDRA_CAST<HUD *>(0x0);
local_ec.y = 10000.0;
pvVar8 = g_game->_room;
ppvVar3 = (void **)puStack_20;
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x1264)) != 0) {
do {
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x125c));
iVar2 = *GHIDRA_CAST<int *>((iVar7 + i * 4));
if (*GHIDRA_CAST<int *>((iVar2 + 0x28)) == 5) {
pickupVariant = *GHIDRA_CAST<int *>((iVar2 + 0x2c));
if (pickupVariant == 100) {
LAB_0083ca27:
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>((iVar2 + 0x48)),GHIDRA_CAST<uint8_t *>(0x1));
tmpCStr = &layer->_spriteSheetPath;
if (0xf < (layer->_spriteSheetPath)._capacity) {
tmpCStr = *GHIDRA_CAST<std_string **>(tmpCStr->_buf);
}
bVar4 = str_eq(GHIDRA_CAST<uint8_t *>(tmpCStr),(layer->_spriteSheetPath)._size,
GHIDRA_CAST<uint8_t *>("gfx/Items/Collectibles/questionmark.png"),0x27);
if ((bVar4 == 0) &&
(iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + 0x125c)), *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar7 + i * 4)) + 0x30)) != 0)
) {
LAB_0083ca61:
pHVar13 = *GHIDRA_CAST<HUD **>((iVar7 + i * 4));
fVar14 = (local_dc->_pos).x - *GHIDRA_CAST<float *>((pHVar13->_playerHUD + 0x33c));
fVar15 = (local_dc->_pos).y - *GHIDRA_CAST<float *>((pHVar13->_playerHUD + 0x340));
fVar14 = fVar15 * fVar15 + fVar14 * fVar14;
if (fVar14 < local_ec.y) {
local_ec.y = fVar14;
local_e0 = pHVar13;
}
}
}
else if (((pickupVariant == 0x15e) || (pickupVariant == 0x46)) || (pickupVariant == 300)) {
if (pickupVariant == 100) goto LAB_0083ca27;
goto LAB_0083ca61;
}
}
nearestPickup = local_e0;
this = local_f0;
i = i + 1;
} while (i < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar8) + 0x1264)));
ppvVar3 = (void **)puStack_20;
if ((local_e0 != GHIDRA_CAST<HUD *>(0x0)) && (*GHIDRA_CAST<int *>((local_e0->_playerHUD + 0x30)) != 0)) {
iVar7 = ItemPool::GetPillEffect
(&g_game->_itemPool,*GHIDRA_CAST<uint32_t *>((local_e0->_playerHUD + 0x30)),local_dc);
pHVar13 = *GHIDRA_CAST<HUD **>(this->_playerHUD);
if ((pHVar13 == GHIDRA_CAST<HUD *>(0x0)) || (nearestPickup != pHVar13)) {
LAB_0083cb4f:
*GHIDRA_CAST<HUD **>(this->_playerHUD) = nearestPickup;
manager = g_manager;
iVar7 = *GHIDRA_CAST<int *>((nearestPickup->_playerHUD + 0x2c));
if (iVar7 == 100) {
pvVar8 = (void *)InfoDisplay::get_collectible();
*(void **)(this->_playerHUD + 4) = pvVar8;
(GHIDRA_CAST<StatsPanel *>((pvVar8)))->StatsPanel::set(local_dc,0);
iVar7 = *GHIDRA_CAST<int *>((this->_playerHUD + 4));
FUN_00856840();
*GHIDRA_CAST<uint32_t *>((iVar7 + 0x3c)) = *GHIDRA_CAST<uint32_t *>((iVar7 + 0x38));
bVar4 = (GHIDRA_CAST<Entity_Player *>((local_dc)))->Entity_Player::HasCollectible(0x2d3,0);
pHVar13 = local_e0;
if ((bVar4 != 0) && (*GHIDRA_CAST<int *>((local_e0->_playerHUD + 0x528)) == 0)) {
bVar4 = (GHIDRA_CAST<Entity_Pickup *>((GHIDRA_CAST<Entity_Pickup *>(local_e0))))->Entity_Pickup::CanReroll();
if (bVar4 != 0) {
iVar7 = *GHIDRA_CAST<int *>((pHVar13->_playerHUD + 0x30));
bVar4 = (GHIDRA_CAST<Entity_Player *>((local_dc)))->Entity_Player::HasCollectible(0x164,0);
local_dc = GHIDRA_CAST<Entity_Player *>(0x1);
if (bVar4 != 0) {
local_dc = GHIDRA_CAST<Entity_Player *>(0x2);
}
local_ec.y = 0.0;
LAB_0083cc10:
pEVar11 = local_dc;
LAB_0083cc16:
iVar7 = iVar7 + -1;
if (iVar7 < 1) goto LAB_0083cc50;
itemConfig = ItemConfig::GetCollectible(&g_manager->_itemConfig,iVar7);
if (itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) goto code_r0x0083cc39;
goto LAB_0083cc10;
}
}
LAB_0083ced0:
itemConfig = ItemConfig::GetCollectible
(&g_manager->_itemConfig,*GHIDRA_CAST<int *>((pHVar13->_playerHUD + 0x30)));
if (itemConfig != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
tmpCStr = &itemConfig->gfxFilename;
if (0xf < (itemConfig->gfxFilename)._capacity) {
tmpCStr = *GHIDRA_CAST<std_string **>(tmpCStr->_buf);
}
pvVar8 = Manager::LoadImage(&local_f8,GHIDRA_CAST<uint8_t *>(tmpCStr));
ehState = (void *)0x5;
goto LAB_0083cf7d;
}
LAB_0083cfa5:
(GHIDRA_CAST<KAGE::SmartPointer *>((this->_playerHUD + 8)))->KAGE::SmartPointer::reset((void *)0x0);
ANM2::Reset(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x10)));
pHVar13 = extraout_ECX_01;
}
else if (iVar7 == 0x15e) {
pvVar8 = (void *)InfoDisplay::get_trinket();
*(void **)(this->_playerHUD + 4) = pvVar8;
(GHIDRA_CAST<StatsPanel *>((pvVar8)))->StatsPanel::set(local_dc,
(uint8_t)(*GHIDRA_CAST<uint32_t *>((nearestPickup->_playerHUD + 0x30)) >> 0xf) & 1);
itemConfig = ItemConfig::GetTrinket
(&g_manager->_itemConfig,
*GHIDRA_CAST<uint32_t *>((nearestPickup->_playerHUD + 0x30)));
if (itemConfig == GHIDRA_CAST<ItemConfig_Item *>(0x0)) goto LAB_0083cfa5;
tmpCStr = &itemConfig->gfxFilename;
if (0xf < (itemConfig->gfxFilename)._capacity) {
tmpCStr = *GHIDRA_CAST<std_string **>(tmpCStr->_buf);
}
pvVar8 = Manager::LoadImage(&local_f8,GHIDRA_CAST<uint8_t *>(tmpCStr));
ehState = (void *)0x6;
LAB_0083cf7d:
(GHIDRA_CAST<KAGE::SmartPointer *>((this->_playerHUD + 8)))->KAGE::SmartPointer::operator_assign(pvVar8);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0xffffff;
TexturePtr::release();
ANM2::Reset(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x10)));
pHVar13 = extraout_ECX_00;
}
else if (iVar7 == 0x46) {
ItemPool::GetPillEffect
(&g_game->_itemPool,*GHIDRA_CAST<uint32_t *>((nearestPickup->_playerHUD + 0x30)),local_dc);
manager = g_manager;
uVar10 = InfoDisplay::get_pill();
*GHIDRA_CAST<uint32_t *>((this->_playerHUD + 4)) = uVar10;
entityConfig = EntityConfig::GetEntity
(&manager->_entityConfig,5,0x46,
*GHIDRA_CAST<int *>((local_e0->_playerHUD + 0x30)));
if (entityConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) {
LAB_0083d11f:
ANM2::Reset(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x10)));
}
else {
tmpCStr = &entityConfig->anm2Path;
if (0xf < (entityConfig->anm2Path)._capacity) {
tmpCStr = *GHIDRA_CAST<std_string **>(tmpCStr->_buf);
}
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>(tmpCStr));
ehState = (void *)0x7;
LAB_0083d02f:
ANM2::Load(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x10)),&tmpString,1);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0xffffff;
if (0xf < tmpString._capacity) {
uVar6 = tmpString._capacity + 1;
pvVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar6) {
pvVar8 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar6 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar8))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar8,uVar6);
}
ANM2::Play(GHIDRA_CAST<ANM2 *>((this->_playerHUD + 0x10)),s_Idle,0);
}
(GHIDRA_CAST<KAGE::SmartPointer *>((this->_playerHUD + 8)))->KAGE::SmartPointer::reset((void *)0x0);
pHVar13 = extraout_ECX_03;
}
else if (iVar7 == 300) {
uVar10 = InfoDisplay::get_card();
*GHIDRA_CAST<uint32_t *>((this->_playerHUD + 4)) = uVar10;
card = ItemConfig::GetCard(&manager->_itemConfig,*GHIDRA_CAST<int *>((local_e0->_playerHUD + 0x30)));
if (card != GHIDRA_CAST<ItemConfig_Card *>(0x0)) {
entityConfig = EntityConfig::GetEntity
(&g_manager->_entityConfig,5,300,card->pickupSubtype);
if (entityConfig == GHIDRA_CAST<EntityConfig_Entity *>(0x0)) goto LAB_0083d11f;
tmpCStr = &entityConfig->anm2Path;
if (0xf < (entityConfig->anm2Path)._capacity) {
tmpCStr = *GHIDRA_CAST<std_string **>(tmpCStr->_buf);
}
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST<uint8_t *>(tmpCStr));
ehState = (void *)0x8;
goto LAB_0083d02f;
}
this->_playerHUD[4] = 0;
this->_playerHUD[5] = 0;
this->_playerHUD[6] = 0;
this->_playerHUD[7] = 0;
this->_playerHUD[0] = 0;
this->_playerHUD[1] = 0;
this->_playerHUD[2] = 0;
this->_playerHUD[3] = 0;
pHVar13 = extraout_ECX_02;
}
popupId = this->_playerHUD + 0x378;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x378)) != -1) {
local_e4 = -NAN;
(GHIDRA_CAST<PopupManager *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))))))->PopupManager::close(GHIDRA_CAST<int *>(popupId),GHIDRA_CAST<int *>(&local_e4));
popupId[0] = 0xff;
popupId[1] = 0xff;
popupId[2] = 0xff;
popupId[3] = 0xff;
pHVar13 = extraout_ECX_04;
}
}
else {
pHVar13 = *GHIDRA_CAST<HUD **>((nearestPickup->_playerHUD + 0x2c));
if (pHVar13 == GHIDRA_CAST<HUD *>(0x64)) {
pHVar13 = *GHIDRA_CAST<HUD **>((this->_playerHUD + 4));
if (*GHIDRA_CAST<int *>((nearestPickup->_playerHUD + 0x30)) == *GHIDRA_CAST<int *>((pHVar13->_playerHUD + 4)))
goto LAB_0083d16f;
goto LAB_0083cb4f;
}
if (pHVar13 == GHIDRA_CAST<HUD *>(0x15e)) {
pHVar13 = *GHIDRA_CAST<HUD **>((this->_playerHUD + 4));
if ((*GHIDRA_CAST<uint32_t *>((nearestPickup->_playerHUD + 0x30)) & 0x7fff) !=
*GHIDRA_CAST<uint32_t *>((pHVar13->_playerHUD + 4))) goto LAB_0083cb4f;
}
else if ((pHVar13 == GHIDRA_CAST<HUD *>(0x46)) && (iVar7 != *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((this->_playerHUD + 4)) + 4)))
) goto LAB_0083cb4f;
}
LAB_0083d16f:
local_f0 = *GHIDRA_CAST<HUD **>((this->_playerHUD + 4));
if (local_f0 != GHIDRA_CAST<HUD *>(0x0)) {
cVar5 = ItemInfo::is_pickup_known();
local_f0->_playerHUD[0x44] = cVar5 == '\0';
pHVar13 = local_f0;
}
goto LAB_0083d199;
}
}
LAB_0083d192:
puStack_20 = GHIDRA_CAST<uint8_t *>(ppvVar3);
ItemInfo::reset(uVar6);
pHVar13 = extraout_ECX_05;
LAB_0083d199:
local_f0 = GHIDRA_CAST<HUD *>(&DAT_bf800000);
if ((*GHIDRA_CAST<int *>(this->_playerHUD) != 0) && (*GHIDRA_CAST<int *>((this->_playerHUD + 0x378)) == -1)) {
ItemInfo::measure(&local_f8,pHVar13);
local_ec.x = local_f8 + 0.0;
local_ec.y = local_f4 - 12.0;
MessagePopup::MessagePopup
(popup,&g_manager->_font1_TeamMeatEx10,(void *)0x0,(void *)0x0,&local_ec);
ehState = (void *)0x9;
local_194 = 150.0 / DAT_00c7997c;
popup[0] = popup[0] & 0xf8;
local_18c = 2;
local_188 = 0x40c00000;
local_1a8 = 1;
local_184 = 1;
local_170 = 0;
local_14c = ItemInfo::render_popup_callback;
local_180 = 0;
uStack_17c = 0;
uStack_178 = 0;
uStack_174 = 0x3f19999a;
local_148 = this;
cVar5 = ItemInfo::is_collectible_seen();
if (cVar5 == '\0') {
local_1b8 = 0x41200000;
local_1b4 = 0x40c00000;
(GHIDRA_CAST<KColor *>((&local_10c)))->KColor::SetFromARGB(0xffffffff);
local_ec.y = 1.4013e-45;
MessagePopup::add_text(&DAT_00b6d12c,&g_vectorZero,&local_ec.y,extraout_ECX_06);
(GHIDRA_CAST<KColor *>((&local_10c)))->KColor::SetFromARGB(0xffffffff);
local_ec.y = 1.4013e-45;
MessagePopup::add_text
("##GAME###ITEM_INFO_UNIDENTIFIED",&g_vectorZero,&local_ec.y,extraout_ECX_07);
local_1a4 = &DAT_bf800000;
local_1a0 = &DAT_bf800000;
}
iVar7 = PopupQueue::push(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))),popup);
*GHIDRA_CAST<int *>((this->_playerHUD + 0x378)) = iVar7;
*GHIDRA_CAST<float *>((this->_playerHUD + 0x37c)) = local_f8;
*GHIDRA_CAST<float *>((this->_playerHUD + 0x380)) = local_f4;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0xffffff;
FUN_00420710();
}
if ((*GHIDRA_CAST<int *>((this->_playerHUD + 0x378)) != -1) &&
(pEVar11 = GHIDRA_CAST<Entity_Player *>(PopupQueue)::find(), pEVar11 != (void *)0x0)) {
local_dc = pEVar11;
player = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::get_first_local_main_player();
local_f4 = 0.0;
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
fVar14 = 0.0;
fVar15 = 0.0;
}
else {
local_ec.y = g_displayPixelRatio * g_screenPointScale;
pvVar8 = g_game->_room;
local_e4 = ((g_screenWidth - 338.0) * 0.5 + ((player->_pos).x - 60.0) * 0.65) * local_ec.y +
0.5;
dVar16 = floor((double)local_e4);
pEVar11 = local_dc;
local_f4 = (float)dVar16 / local_ec.y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar8) + 0x1204));
local_e4 = DAT_00c7997c;
if (local_f4 <= DAT_00c7997c * 0.5) {
local_ec.y = -90.0;
}
else {
local_ec.y = 65.0;
local_f0 = GHIDRA_CAST<HUD *>(0x3f800000);
}
local_e0 = DAT_00c79980;
pVVar12 = Popup::get_size(local_dc,&popupSize);
fVar14 = (local_ec.y - local_e4 * (float)local_f0 * 0.5) + (float)local_f0 * pVVar12->x * 0.5;
fVar15 = (0.0 - (float)local_e0 * 0.5) + pVVar12->y * 0.5 + 60.0;
}
fVar1 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pEVar11) + 0x48));
if (((fVar1 < 0.0) && (local_f4 < DAT_00c7997c * 0.5 - 20.0)) ||
((0.0 < fVar1 && (DAT_00c7997c * 0.5 + 20.0 < local_f4)))) {
local_ec.y = (float)g_manager;
local_f0 = GHIDRA_CAST<HUD *>(0xffffffff);
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x378)) != -1) {
local_f4 = fVar1;
(**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf8)))) + 0xc))();
this_01 = GHIDRA_CAST<int *>(0x0);
popupListHead = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(((GHIDRA_CAST<Manager *>((GHIDRA_INT(local_ec.y) + 0x4b3dc)))->_gamestate))) + 0xcf0))))
;
popupNode = GHIDRA_CAST<int *>(*popupListHead);
if (popupNode != popupListHead) {
while (this_01 = GHIDRA_CAST<int *>(popupNode[2]), *this_01 != *GHIDRA_CAST<int *>((this->_playerHUD + 0x378))) {
popupNode = GHIDRA_CAST<int *>(*popupNode);
if (popupNode == popupListHead) {
(**(code **)(*GHIDRA_CAST<int *>(&((GHIDRA_CAST<Manager *>((GHIDRA_INT(local_ec.y) + 0x4b3dc)))->_gamestate)).
field_0xcf8 + 0x10))();
this->_playerHUD[0x378] = 0xff;
this->_playerHUD[0x379] = 0xff;
this->_playerHUD[0x37a] = 0xff;
this->_playerHUD[0x37b] = 0xff;
ExceptionList = prevExceptionList;
return;
}
}
}
(**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(((GHIDRA_CAST<Manager *>((GHIDRA_INT(local_ec.y) + 0x4b3dc)))->_gamestate))) + 0xcf8)))) +
0x10))();
if ((this_01 != GHIDRA_CAST<int *>(0x0)) && (this_01[1] < 3)) {
elapsedMs = Popup::get_elapsed_ms(this_01);
if ((GHIDRA_INT(((uint64_t)elapsedMs >> 0x20)) == 0) && (GHIDRA_UINT(elapsedMs) < GHIDRA_UINT(this_01[0x15])))
{
this_01[6] = GHIDRA_INT(local_f0);
this->_playerHUD[0x378] = 0xff;
this->_playerHUD[0x379] = 0xff;
this->_playerHUD[0x37a] = 0xff;
this->_playerHUD[0x37b] = 0xff;
ExceptionList = prevExceptionList;
return;
}
this_01[6] = -0x1010102;
if ((code *)this_01[0x28] != (code *)0x0) {
(*(code *)this_01[0x28])(&local_f0);
}
Popup::set_state(this_01,3);
}
}
this->_playerHUD[0x378] = 0xff;
this->_playerHUD[0x379] = 0xff;
this->_playerHUD[0x37a] = 0xff;
this->_playerHUD[0x37b] = 0xff;
}
else {
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pEVar11) + 0x48)) = fVar14;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pEVar11) + 0x4c)) = fVar15;
}
}
ExceptionList = prevExceptionList;
return;
code_r0x0083cc39:
bVar4 = (GHIDRA_CAST<Item *>((itemConfig)))->Item::IsAvailable(3);
pEVar11 = local_dc;
if (bVar4 == 0) goto LAB_0083cc16;
LAB_0083cc50:
local_ec.y = (float)(GHIDRA_INT(local_ec.y) + 1);
if (GHIDRA_INT(local_ec.y) < GHIDRA_INT(pEVar11)) goto LAB_0083cc16;
if (0 < iVar7) {
iVar2 = *GHIDRA_CAST<int *>((this->_playerHUD + 4));
tmpCStr = int_to_string(&tmpString,iVar7);
ehState = (void *)0x0;
prefixText[0] = msvc::_Allocate(0x30);
prefixTextSize = 0x2f;
prefixTextCapacity = 0x2f;
builtin_strncpy(prefixText[0],"<color=0xFF00FF00>Spins down into <collectible=",0x30);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(spindownText))))->msvc::string::concat_move(GHIDRA_INT(local_f4),prefixText,tmpCStr);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 2;
FUN_0060c790();
InfoDisplayText::constructor(infoText);
ehState = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),4);
pppppppbVar9 = GHIDRA_CAST<uint8_t *******>(&local_110);
if (0xf < GHIDRA_UINT(local_10c._unk)) {
pppppppbVar9 = local_110;
}
(GHIDRA_CAST<msvc::string *>((this_00)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(pppppppbVar9),GHIDRA_UINT(local_10c._alpha));
pvVar8 = *(void **)(iVar2 + 0x3c);
if (pvVar8 == *(void **)(iVar2 + 0x40)) {
msvc::vector<104byte>::_Emplace_reallocate(pvVar8,infoText);
}
else {
InfoDisplayEntry::copy_constructor(pvVar8,infoText);
*GHIDRA_CAST<int *>((iVar2 + 0x3c)) = *GHIDRA_CAST<int *>((iVar2 + 0x3c)) + 0x68;
}
FID_conflict__Tidy(local_84);
FID_conflict__Tidy(local_90);
FID_conflict__Tidy(local_9c);
FID_conflict__Tidy(local_a8);
FID_conflict__Tidy(local_b4);
FID_conflict__Tidy(local_c0);
(GHIDRA_CAST<msvc::string *>((infoText)))->msvc::string::_Tidy_deallocate();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 2;
if (0xf < GHIDRA_UINT(local_10c._unk)) {
uVar6 = local_10c._unk + 1;
pppppppbVar9 = local_110;
if (0xfff < uVar6) {
pppppppbVar9 = GHIDRA_CAST<uint8_t *******>(local_110[-1]);
uVar6 = local_10c._unk + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_110) + (-4 - GHIDRA_INT(pppppppbVar9))))) goto LAB_0083cea2;
}
operator_delete(pppppppbVar9,uVar6);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 1;
local_10c._alpha = 0.0;
local_10c._unk = 0xf;
local_110 = GHIDRA_CAST<uint8_t *******>((GHIDRA_UINT(local_110) & 0xffffff00));
if (0xf < spindownTextCapacity) {
uVar6 = spindownTextCapacity + 1;
pvVar8 = spindownText[0];
if (0xfff < uVar6) {
pvVar8 = *(void **)(GHIDRA_INT(spindownText[0]) + -4);
uVar6 = spindownTextCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(spindownText[0]) + (-4 - GHIDRA_INT(pvVar8))))) goto LAB_0083cea2;
}
operator_delete(pvVar8,uVar6);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0;
spindownTextSize = 0;
spindownTextCapacity = 0xf;
spindownText[0] = (void *)(GHIDRA_UINT(spindownText[0]) & 0xffffff00);
if (0xf < prefixTextCapacity) {
uVar6 = prefixTextCapacity + 1;
ptr = prefixText[0];
if (0xfff < uVar6) {
ptr = *GHIDRA_CAST<char **>((prefixText[0] + -4));
uVar6 = prefixTextCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < prefixText[0] + (-4 - GHIDRA_INT(ptr))) goto LAB_0083cea2;
}
operator_delete(ptr,uVar6);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0xffffff;
if (0xf < tmpString._capacity) {
uVar6 = tmpString._capacity + 1;
pvVar8 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpString._buf)) + 0x0)));
if (0xfff < uVar6) {
pvVar8 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4);
uVar6 = tmpString._capacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar8))))) {
LAB_0083cea2:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar8,uVar6);
}
tmpString._size = 0;
tmpString._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) & 0xffffff00;
this = local_f0;
}
pHVar13 = local_e0;
goto LAB_0083ced0;
}
// 0085e1c0
uint8_t HUD::IsVisible()
{
return this->_isVisible;
}
// 0085e750
uint32_t HUD::ShowItemText(void *param_1)
{
char cVar1;
int iVar2;
uint32_t uVar3;
uint8_t *title;
uint32_t uVar4;
int luaType;
void *pvVar5;
HUD *in_ECX;
HUD *messageSlot;
uint32_t uVar6;
code *unrefFn;
void *arg4Ref;
uint32_t arg4RefId;
void *arg2Ref;
int arg2RefId;
void *arg3Ref;
int arg3RefId;
void *arg5Ref;
ItemConfig_Item *local_60;
HUD *local_5c;
void *local_58;
int local_54;
uint32_t refCleanupFlags;
char local_49;
void *descriptionText [4];
uint32_t descriptionTextSize;
uint32_t descriptionTextCapacity;
void *titleText [4];
uint32_t titleTextSize;
uint32_t titleTextCapacity;
uint32_t local_18;
void *local_10;
uint8_t *puStack_c;
void *local_8;
local_8 = (void *)0xffffffff;
puStack_c = &LAB_00b03b3f;
local_10 = ExceptionList;
local_18 = __security_cookie ^ GHIDRA_UINT((titleText + 0xb));
ExceptionList = &local_10;
refCleanupFlags = 0;
local_5c = in_ECX;
lua_pushvalue(param_1,2,local_18);
arg2Ref = param_1;
arg2RefId = luaL_ref(param_1,0xfff0b9d8);
local_8 = (void *)0x0;
lua_pushvalue(param_1,3);
arg3Ref = param_1;
arg3RefId = luaL_ref(param_1,0xfff0b9d8);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
if (arg2RefId == -1) {
LAB_0085e7ff:
if (arg3RefId != -1) {
(GHIDRA_CAST<LuaRef *>((&arg3Ref)))->LuaRef::push(param_1);
iVar2 = lua_type(param_1,0xffffffff);
lua_settop(param_1,0xfffffffe);
if (iVar2 == 4) goto LAB_0085e82e;
}
(GHIDRA_CAST<LuaRef *>((&arg2Ref)))->LuaRef::push(param_1);
iVar2 = lua_gettop(param_1);
luaType = lua_type(param_1,iVar2);
if (luaType == 0) {
local_5c = GHIDRA_CAST<HUD *>(0x0);
}
else {
pvVar5 = luabridge::Userdata::getClass(param_1,iVar2,&g_luaClassKeyEntityPlayer,0);
local_5c = *GHIDRA_CAST<HUD **>((GHIDRA_CAST<char *>(pvVar5) + 4));
}
lua_settop(param_1,0xfffffffe);
(GHIDRA_CAST<LuaRef *>((&arg3Ref)))->LuaRef::push(param_1);
local_54 = lua_gettop(param_1);
iVar2 = lua_type(param_1,local_54);
local_60 = GHIDRA_CAST<ItemConfig_Item *>(0x0);
if (iVar2 != 0) {
pvVar5 = luabridge::Userdata::getClass(param_1,local_54,&g_luaClassKeyItem,1);
local_60 = *GHIDRA_CAST<ItemConfig_Item **>((GHIDRA_CAST<char *>(pvVar5) + 4));
}
lua_settop(param_1,0xfffffffe);
lua_pushvalue(param_1,4);
arg4Ref = param_1;
arg4RefId = luaL_ref(param_1,0xfff0b9d8);
refCleanupFlags = 0x10;
cVar1 = FUN_0085c300();
if (cVar1 == '\0') {
lua_pushvalue(param_1,4);
local_58 = param_1;
local_54 = luaL_ref(param_1,0xfff0b9d8);
refCleanupFlags = 0x30;
cVar1 = FUN_00872820();
pvVar5 = param_1;
if (cVar1 == '\x01') goto LAB_0085ebfd;
local_49 = '\0';
}
else {
pvVar5 = local_58;
LAB_0085ebfd:
local_49 = '\x01';
}
unrefFn = luaL_unref_exref;
if ((refCleanupFlags & 0x20) != 0) {
refCleanupFlags = refCleanupFlags & 0xffffffdf;
luaL_unref(pvVar5,0xfff0b9d8,local_54);
}
if ((refCleanupFlags & 0x10) != 0) {
luaL_unref(param_1,0xfff0b9d8,arg4RefId);
}
if (local_49 != '\0') {
FUN_009a3560();
}
if ((local_5c != GHIDRA_CAST<HUD *>(0x0)) && (local_60 != GHIDRA_CAST<ItemConfig_Item *>(0x0))) {
ShowItemText(in_ECX,GHIDRA_CAST<Entity_Player *>(local_5c),local_60);
}
goto LAB_0085ec63;
}
(GHIDRA_CAST<LuaRef *>((&arg2Ref)))->LuaRef::push(param_1);
iVar2 = lua_type(param_1,0xffffffff);
lua_settop(param_1,0xfffffffe);
if (iVar2 != 4) goto LAB_0085e7ff;
LAB_0085e82e:
lua_pushvalue(param_1,5);
arg5Ref = param_1;
local_60 = GHIDRA_CAST<ItemConfig_Item *>(luaL_ref(param_1,0xfff0b9d8));
uVar6 = 1;
refCleanupFlags = 1;
if (local_60 == GHIDRA_CAST<ItemConfig_Item *>(0xffffffff)) {
LAB_0085e8d4:
local_49 = '\x01';
}
else {
(GHIDRA_CAST<LuaRef *>((&arg5Ref)))->LuaRef::push(param_1);
iVar2 = lua_type(param_1,0xffffffff);
lua_settop(param_1,0xfffffffe);
if (iVar2 == 0) goto LAB_0085e8d4;
lua_pushvalue(param_1,5);
local_58 = param_1;
local_54 = luaL_ref(param_1,0xfff0b9d8);
uVar6 = 3;
refCleanupFlags = 3;
(GHIDRA_CAST<LuaRef *>((&local_58)))->LuaRef::push(param_1);
uVar3 = lua_gettop(param_1);
iVar2 = lua_toboolean(param_1,uVar3);
lua_settop(param_1,0xfffffffe);
local_49 = '\0';
if (iVar2 != 0) goto LAB_0085e8d4;
}
if ((uVar6 & 2) != 0) {
uVar6 = uVar6 & 0xfffffffd;
refCleanupFlags = uVar6;
luaL_unref(local_58,0xfff0b9d8,local_54);
}
if ((uVar6 & 1) != 0) {
uVar6 = uVar6 & 0xfffffffe;
refCleanupFlags = uVar6;
luaL_unref(param_1,0xfff0b9d8,local_60);
}
if (local_49 != '\0') {
FUN_009a3560();
}
lua_pushvalue(param_1,4);
arg4Ref = param_1;
arg4RefId = luaL_ref(param_1,0xfff0b9d8);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
(GHIDRA_CAST<LuaRef *>((&arg4Ref)))->LuaRef::push(param_1);
uVar3 = lua_gettop(param_1);
iVar2 = lua_toboolean(param_1,uVar3);
local_54 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_54)) + 0x1))),iVar2 != 0);
lua_settop(param_1,0xfffffffe);
if (arg3RefId == -1) {
LAB_0085e9c1:
local_60 = GHIDRA_CAST<ItemConfig_Item *>(&s_empty);
}
else {
(GHIDRA_CAST<LuaRef *>((&arg3Ref)))->LuaRef::push(param_1);
iVar2 = lua_type(param_1,0xffffffff);
lua_settop(param_1,0xfffffffe);
if (iVar2 == 0) goto LAB_0085e9c1;
local_60 = GHIDRA_CAST<ItemConfig_Item *>(FUN_00872860(descriptionText));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
uVar6 = uVar6 | 4;
refCleanupFlags = uVar6;
if (0xf < *GHIDRA_CAST<uint32_t *>(((local_60->name)._buf + 0xc))) {
local_60 = GHIDRA_CAST<ItemConfig_Item *>(local_60->type);
}
}
if (arg2RefId == -1) {
LAB_0085ea17:
title = &s_empty;
}
else {
(GHIDRA_CAST<LuaRef *>((&arg2Ref)))->LuaRef::push(param_1);
iVar2 = lua_type(param_1,0xffffffff);
lua_settop(param_1,0xfffffffe);
if (iVar2 == 0) goto LAB_0085ea17;
title = GHIDRA_CAST<uint8_t *>(FUN_00872860(titleText));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))) = 0;
uVar6 = uVar6 | 8;
refCleanupFlags = uVar6;
if (0xf < *GHIDRA_CAST<uint32_t *>((title + 0x14))) {
title = *GHIDRA_CAST<uint8_t **>(title);
}
}
uVar4 = 0;
messageSlot = local_5c;
do {
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((messageSlot)) + 0x3ed8))) == '\0') {
(GHIDRA_CAST<HUD_Message *>((GHIDRA_CAST<HUD_Message *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((messageSlot)) + 0x3ed0)))))))->HUD_Message::Show(title,GHIDRA_CAST<uint8_t *>(local_60),1,
(uint8_t)local_54);
break;
}
uVar4 = uVar4 + 1;
messageSlot = GHIDRA_CAST<HUD *>((messageSlot->_playerHUD + 500));
} while (uVar4 < 6);
if ((uVar6 & 8) != 0) {
uVar6 = uVar6 & 0xfffffff7;
if (0xf < titleTextCapacity) {
uVar4 = titleTextCapacity + 1;
pvVar5 = titleText[0];
if (0xfff < uVar4) {
pvVar5 = *(void **)(GHIDRA_INT(titleText[0]) + -4);
uVar4 = titleTextCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(titleText[0]) + (-4 - GHIDRA_INT(pvVar5))))) goto LAB_0085eac1;
}
operator_delete(pvVar5,uVar4);
}
titleTextSize = 0;
titleTextCapacity = 0xf;
titleText[0] = (void *)(GHIDRA_UINT(titleText[0]) & 0xffffff00);
}
if ((uVar6 & 4) != 0) {
if (0xf < descriptionTextCapacity) {
uVar6 = descriptionTextCapacity + 1;
pvVar5 = descriptionText[0];
if (0xfff < uVar6) {
pvVar5 = *(void **)(GHIDRA_INT(descriptionText[0]) + -4);
uVar6 = descriptionTextCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(descriptionText[0]) + (-4 - GHIDRA_INT(pvVar5))))) {
LAB_0085eac1:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar5,uVar6);
}
descriptionTextSize = 0;
descriptionTextCapacity = 0xf;
descriptionText[0] = (void *)(GHIDRA_UINT(descriptionText[0]) & 0xffffff00);
}
unrefFn = luaL_unref_exref;
luaL_unref(param_1,0xfff0b9d8,arg4RefId);
LAB_0085ec63:
(*unrefFn)(param_1,0xfff0b9d8,arg3RefId);
(*unrefFn)(param_1,0xfff0b9d8,arg2RefId);
ExceptionList = local_10;
return 0;
}
// 0085eca0
void HUD::ShowFortuneText(int **param_2)
{
uint32_t uVar1;
int refId;
uint32_t *puVar2;
uint32_t stackTop;
uint8_t *text;
uint32_t *listNode;
int **argRef;
int iStack_58;
HUD *hud;
uint32_t textLength;
int argIndex;
uint32_t *puStack_48;
uint32_t *lineList;
int lineCount;
uint32_t lineText;
uint32_t uStack_38;
uint32_t uStack_34;
uint32_t uStack_30;
uint32_t uStack_2c;
uint32_t uStack_28;
uint32_t uStack_24;
uint8_t *puStack_20;
void *pvStack_1c;
uint8_t *puStack_18;
uint32_t uStack_14;
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
uStack_14 = 0xffffffff;
puStack_18 = &DAT_00b03b9d;
pvStack_1c = ExceptionList;
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
ExceptionList = &pvStack_1c;
lineList = GHIDRA_CAST<uint32_t *>(0x0);
lineCount = 0;
hud = this;
uStack_24 = uVar1;
lineList = operator_new(0x20);
*lineList = lineList;
lineList[1] = lineList;
uStack_14 = 0;
argIndex = 2;
argRef = param_2;
do {
lua_pushvalue(param_2,argIndex,uVar1);
refId = luaL_ref(param_2,0xfff0b9d8);
iStack_58 = refId;
if (refId == -1) {
puVar2 = GHIDRA_CAST<uint32_t *>(0x0);
}
else {
(GHIDRA_CAST<LuaRef *>((&argRef)))->LuaRef::push(param_2);
puStack_48 = GHIDRA_CAST<uint32_t *>(lua_type(param_2,0xffffffff));
lua_settop(param_2,0xfffffffe);
puVar2 = puStack_48;
}
if (puVar2 != GHIDRA_CAST<uint32_t *>(&DAT_00000004)) {
uStack_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_14))) + 0x1))) << 8;
luaL_unref(param_2,0xfff0b9d8,refId);
break;
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 2;
(GHIDRA_CAST<LuaRef *>((&argRef)))->LuaRef::push(param_2);
stackTop = lua_gettop(param_2);
text = GHIDRA_CAST<uint8_t *>(luaL_checklstring(param_2,stackTop,&textLength));
uStack_2c = 0;
uStack_28 = 0xf;
lineText = 0;
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&lineText))))->msvc::string::assign(text,textLength);
lua_settop(param_2,0xfffffffe);
uStack_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x1))),3);
puStack_48 = lineList;
if (lineCount == 0x7ffffff) {
/* WARNING: Subroutine does not return */
msvc::_Xlength_error("list too long");
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(uStack_14)) + 0x0))) = 4;
listNode = operator_new(0x20);
listNode[6] = 0;
listNode[7] = 0;
listNode[2] = lineText;
listNode[3] = uStack_38;
listNode[4] = uStack_34;
listNode[5] = uStack_30;
*GHIDRA_CAST<uint64_t *>((listNode + 6)) = CONCAT44(uStack_28,uStack_2c);
lineCount = lineCount + 1;
puVar2 = GHIDRA_CAST<uint32_t *>(puStack_48[1]);
*listNode = puStack_48;
listNode[1] = puVar2;
puStack_48[1] = listNode;
*puVar2 = listNode;
uStack_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(uStack_14))) + 0x1))) << 8;
luaL_unref(param_2,0xfff0b9d8,refId);
argIndex = argIndex + 1;
} while (argIndex < 0x22);
render_fortune_text(hud,&lineList);
*GHIDRA_CAST<uint32_t *>(lineList[1]) = 0;
puVar2 = GHIDRA_CAST<uint32_t *>(*lineList);
while (puVar2 != GHIDRA_CAST<uint32_t *>(0x0)) {
listNode = GHIDRA_CAST<uint32_t *>(*puVar2);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((puVar2 + 2)))))->msvc::string::_Tidy_deallocate();
operator_delete(puVar2,0x20);
puVar2 = listNode;
}
operator_delete(lineList,0x20);
ExceptionList = pvStack_1c;
return;
}
// 008f8ee0
void HUD::render_modded_coop_portrait(int playerType, Vector *position, Vector *scale, ColorMod *color)
{
float fVar1;
float fVar2;
float fVar3;
uint8_t bVar4;
EntityConfig_Player *playerConfig;
uint8_t *currentAnimName;
uint32_t uVar5;
void *playersBytes;
std_string *nameCursor;
void *pvVar6;
ANM2 *portrait;
bool isLess;
std_string *animName;
void *displayName [4];
uint32_t displayNameSize;
uint32_t displayNameCapacity;
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
void *local_14;
uint8_t *animData;
puStack_20 = GHIDRA_CAST<uint8_t *>((displayName + 0xe));
local_14 = (void *)0xffffffff;
puStack_18 = &LAB_00af85cd;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((displayName + 0xb));
if (playerType < 0) {
return;
}
pvVar6 = (g_manager->_entityConfig)._players._begin;
playersBytes = (void *)(GHIDRA_INT((g_manager->_entityConfig)._players._end) - GHIDRA_INT(pvVar6));
if (GHIDRA_INT(playersBytes) / 0x148 <= playerType) {
return;
}
playerConfig = GHIDRA_CAST<EntityConfig_Player *>((playerType * 0x148 + GHIDRA_INT(pvVar6)));
if (playerConfig == GHIDRA_CAST<EntityConfig_Player *>(0x0)) {
return;
}
portrait = playerConfig->_moddedCoopMenuANM2;
if (portrait == GHIDRA_CAST<ANM2 *>(0x0)) {
return;
}
ExceptionList = &local_1c;
animName = EntityConfig_Player::GetDisplayName
(playerConfig,GHIDRA_CAST<std_string *>(displayName),playersBytes);
local_14 = (void *)0x0;
if (0xf < animName->_capacity) {
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
}
animData = (portrait->_animState)._animData;
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
currentAnimName = animData;
nameCursor = animName;
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
currentAnimName = *GHIDRA_CAST<uint8_t **>(animData);
}
do {
bVar4 = *currentAnimName;
isLess = bVar4 < (uint8_t)nameCursor->_buf[0];
if (bVar4 != nameCursor->_buf[0]) {
LAB_008f8fd0:
uVar5 = -GHIDRA_UINT(isLess) | 1;
goto LAB_008f8fd5;
}
if (bVar4 == 0) break;
bVar4 = currentAnimName[1];
isLess = bVar4 < (uint8_t)nameCursor->_buf[1];
if (bVar4 != nameCursor->_buf[1]) goto LAB_008f8fd0;
currentAnimName = currentAnimName + 2;
nameCursor = GHIDRA_CAST<std_string *>((nameCursor->_buf + 2));
} while (bVar4 != 0);
uVar5 = 0;
LAB_008f8fd5:
if ((uVar5 == 0) && ((animData[0x34] == 0 || ((portrait->_animState)._isPlaying != 0))))
goto LAB_008f9000;
}
bVar4 = ANM2::SetAnimation(portrait,GHIDRA_CAST<uint8_t *>(animName),1);
if (bVar4 != 0) {
AnimationState::Rewind(&portrait->_animState);
(portrait->_animState)._isPlaying = 1;
}
LAB_008f9000:
local_14 = (void *)0xffffffff;
if (0xf < displayNameCapacity) {
uVar5 = displayNameCapacity + 1;
pvVar6 = displayName[0];
if (0xfff < uVar5) {
pvVar6 = *(void **)(GHIDRA_INT(displayName[0]) + -4);
uVar5 = displayNameCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(displayName[0]) + (-4 - GHIDRA_INT(pvVar6))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar6,uVar5);
}
displayNameSize = 0;
displayNameCapacity = 0xf;
pvVar6 = playerConfig->_moddedCoopMenuANM2;
displayName[0] = (void *)(GHIDRA_UINT(displayName[0]) & 0xffffff00);
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0x9c)) = scale->x;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar6) + 0xa0)) = scale->y;
portrait = playerConfig->_moddedCoopMenuANM2;
if (&portrait->_color != color) {
fVar1 = color->_tint[1];
fVar2 = color->_tint[2];
fVar3 = color->_tint[3];
(portrait->_color)._tint[0] = color->_tint[0];
(portrait->_color)._tint[1] = fVar1;
(portrait->_color)._tint[2] = fVar2;
(portrait->_color)._tint[3] = fVar3;
fVar1 = color->_colorize[1];
fVar2 = color->_colorize[2];
fVar3 = color->_colorize[3];
(portrait->_color)._colorize[0] = color->_colorize[0];
(portrait->_color)._colorize[1] = fVar1;
(portrait->_color)._colorize[2] = fVar2;
(portrait->_color)._colorize[3] = fVar3;
*GHIDRA_CAST<uint64_t *>((portrait->_color)._offset) = *GHIDRA_CAST<uint64_t *>(color->_offset);
(portrait->_color)._offset[2] = color->_offset[2];
portrait = playerConfig->_moddedCoopMenuANM2;
}
ANM2::Render(portrait,position,&g_vectorZero,&g_vectorZero);
ExceptionList = local_1c;
return;
}
// 009a1a30
void HUD::LoadGraphics()
{
char isLastRef;
uint8_t isAnimSet;
uint8_t *extraout_EAX;
uint8_t *extraout_EAX_00;
uint8_t *redirectedPathChars;
void *pvVar1;
KColor *clearColor;
char *freeBlock;
uint32_t allocatedBytes;
int remaining;
uint32_t local_ac [8];
uint32_t local_8c;
uint32_t uStack_88;
uint32_t local_84;
HUD *hud;
uint8_t tmpImage2 [4];
int *tmpImage2Ref;
uint8_t tmpImage [4];
int *tmpImageRef;
void *redirectedFontPath [4];
uint32_t redirectedFontPathSize;
uint32_t redirectedFontPathCapacity;
std_string path;
uint8_t tmpPath [16];
uint32_t tmpPathSize;
uint32_t tmpPathCapacity;
uint32_t stackCookie;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
int *coopMenuImage;
Manager *manager;
HUD *self;
ColorMod *statsColor;
manager = g_manager;
puStack_20 = tmpPath + 0x38;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0db25;
local_1c = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((tmpPath + 0x2c));
ExceptionList = &local_1c;
if (this->_isGraphicsLoaded == 0) {
hud = this;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) = msvc::_Allocate(0x20);
path._size = 0x12;
path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0))),"font/MPlus_12b.fnt",0x13);
local_14 = 0;
ModManager::TryRedirectPath(GHIDRA_CAST<ModManager *>(&manager->_modManager),GHIDRA_CAST<std_string *>(tmpPath),&path);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
redirectedPathChars = extraout_EAX;
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX + 0x14))) {
redirectedPathChars = *GHIDRA_CAST<uint8_t **>(extraout_EAX);
}
Font::Load(&this->_font,redirectedPathChars,0);
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
pvVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpPath)) + 0x0)));
if (0xfff < allocatedBytes) {
pvVar1 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4);
allocatedBytes = tmpPathCapacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(pvVar1))))) goto LAB_009a1b64;
}
operator_delete(pvVar1,allocatedBytes);
}
local_14 = -1;
tmpPathSize = 0;
tmpPathCapacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) & 0xffffff00;
if (0xf < path._capacity) {
allocatedBytes = path._capacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + -4));
allocatedBytes = path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
LAB_009a1b64:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
manager = g_manager;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) = msvc::_Allocate(0x20);
path._size = 0x12;
path._capacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0))),"font/KR_Font14.fnt",0x13);
local_14 = 2;
ModManager::TryRedirectPath
(GHIDRA_CAST<ModManager *>(&manager->_modManager),GHIDRA_CAST<std_string *>(redirectedFontPath),&path);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
redirectedPathChars = extraout_EAX_00;
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_00 + 0x14))) {
redirectedPathChars = *GHIDRA_CAST<uint8_t **>(extraout_EAX_00);
}
Font::Load(&this->_fontKR,redirectedPathChars,0);
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
if (0xf < redirectedFontPathCapacity) {
allocatedBytes = redirectedFontPathCapacity + 1;
pvVar1 = redirectedFontPath[0];
if (0xfff < allocatedBytes) {
pvVar1 = *(void **)(GHIDRA_INT(redirectedFontPath[0]) + -4);
allocatedBytes = redirectedFontPathCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedFontPath[0]) + (-4 - GHIDRA_INT(pvVar1))))) goto LAB_009a1c55;
}
operator_delete(pvVar1,allocatedBytes);
}
local_14 = 0xffffffff;
redirectedFontPathSize = 0;
redirectedFontPathCapacity = 0xf;
redirectedFontPath[0] = (void *)(GHIDRA_UINT(redirectedFontPath[0]) & 0xffffff00);
if (0xf < path._capacity) {
allocatedBytes = path._capacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + -4));
allocatedBytes = path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
LAB_009a1c55:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
tmpPathSize = 0;
tmpPathCapacity = 0xf;
tmpPath[0] = '\0';
tmpPath[1] = '\0';
tmpPath[2] = '\0';
tmpPath[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = msvc::_Allocate(0x20);
tmpPathSize = 0x15;
tmpPathCapacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0))),"gfx/ui/ui_hearts.anm2",0x16);
local_14 = 4;
ANM2::Load(&this->_heartsSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4));
allocatedBytes = tmpPathCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
tmpPathSize = 0;
tmpPathCapacity = 0xf;
tmpPath[0] = '\0';
tmpPath[1] = '\0';
tmpPath[2] = '\0';
tmpPath[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = msvc::_Allocate(0x20);
tmpPathSize = 0x16;
tmpPathCapacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0))),"gfx/ui/hudpickups.anm2",0x17);
local_14 = 5;
ANM2::Load(&this->_pickupHUDSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4));
allocatedBytes = tmpPathCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
tmpPathSize = 0;
tmpPathCapacity = 0xf;
tmpPath[0] = '\0';
tmpPath[1] = '\0';
tmpPath[2] = '\0';
tmpPath[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = msvc::_Allocate(0x20);
tmpPathSize = 0x18;
tmpPathCapacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0))),"gfx/ui/ui_chargebar.anm2",0x19);
local_14 = 6;
ANM2::Load(&this->_chargeBarSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4));
allocatedBytes = tmpPathCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
tmpPathSize = 0;
tmpPathCapacity = 0xf;
tmpPath[0] = '\0';
tmpPath[1] = '\0';
tmpPath[2] = '\0';
tmpPath[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = msvc::_Allocate(0x20);
tmpPathSize = 0x1e;
tmpPathCapacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0))),"gfx/ui/ui_chargebar_small.anm2",0x1f);
local_14 = 7;
ANM2::Load(&this->_chargeBarSmallSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4));
allocatedBytes = tmpPathCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
tmpPathSize = 0;
tmpPathCapacity = 0xf;
tmpPath[0] = '\0';
tmpPath[1] = '\0';
tmpPath[2] = '\0';
tmpPath[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = msvc::_Allocate(0x20);
tmpPathSize = 0x19;
tmpPathCapacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0))),"gfx/ui/ui_cardspills.anm2",0x1a);
local_14 = 8;
ANM2::Load(&this->_cardsPillsSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4));
allocatedBytes = tmpPathCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
tmpPathSize = 0;
tmpPathCapacity = 0xf;
tmpPath[0] = '\0';
tmpPath[1] = '\0';
tmpPath[2] = '\0';
tmpPath[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = msvc::_Allocate(0x20);
tmpPathSize = 0x14;
tmpPathCapacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0))),"gfx/ui/hudstats.anm2",0x15);
local_14 = 9;
ANM2::Load(&this->_statsSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4));
allocatedBytes = tmpPathCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
statsColor = &(this->_statsSprite)._color;
tmpPathSize = 0;
tmpPathCapacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) & 0xffffff00;
local_8c = 0;
uStack_88 = 0;
local_84 = 0;
if (statsColor != GHIDRA_CAST<ColorMod *>(local_ac)) {
(this->_statsSprite)._color._colorize[0] = 0.0;
(this->_statsSprite)._color._colorize[1] = 0.0;
(this->_statsSprite)._color._colorize[2] = 0.0;
(this->_statsSprite)._color._colorize[3] = 0.0;
(this->_statsSprite)._color._offset[0] = 0.0;
(this->_statsSprite)._color._offset[1] = 0.0;
statsColor->_tint[0] = 1.0;
(this->_statsSprite)._color._tint[1] = 1.0;
(this->_statsSprite)._color._tint[2] = 1.0;
(this->_statsSprite)._color._tint[3] = 0.5;
(this->_statsSprite)._color._offset[2] = 0.0;
}
pvVar1 = Manager::LoadImage(tmpImage,GHIDRA_CAST<uint8_t *>("gfx/ui/ui_bosshealthbar.png"));
local_14 = 10;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a0))))))->KAGE::SmartPointer::operator_assign(pvVar1);
local_14 = 0xb;
if (tmpImageRef != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImageRef + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpImage);
}
}
local_14 = 0xffffffff;
pvVar1 = Manager::LoadImage(tmpImage2,GHIDRA_CAST<uint8_t *>("gfx/ui/ui_bosshealthbar_mini.png"));
local_14 = 0xc;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a8))))))->KAGE::SmartPointer::operator_assign(pvVar1);
local_14 = 0xd;
if (tmpImage2Ref != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImage2Ref + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpImage2);
}
}
local_14 = 0xffffffff;
pvVar1 = Manager::LoadImage(tmpImage,GHIDRA_CAST<uint8_t *>("gfx/ui/ui_bosshealthbar_static.png"));
local_14 = 0xe;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b0))))))->KAGE::SmartPointer::operator_assign(pvVar1);
local_14 = 0xf;
if (tmpImageRef != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImageRef + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpImage);
}
}
local_14 = 0xffffffff;
pvVar1 = Manager::LoadImage(tmpImage2,GHIDRA_CAST<uint8_t *>("gfx/ui/ui_bosshealthbar_stone.png"));
local_14 = 0x10;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54bc))))))->KAGE::SmartPointer::operator_assign(pvVar1);
local_14 = 0x11;
if (tmpImage2Ref != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImage2Ref + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpImage2);
}
}
local_14 = 0xffffffff;
pvVar1 = Manager::LoadImage(tmpImage,GHIDRA_CAST<uint8_t *>("gfx/ui/ui_bosshealthbar_rush.png"));
local_14 = 0x12;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c4))))))->KAGE::SmartPointer::operator_assign(pvVar1);
local_14 = 0x13;
if (tmpImageRef != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImageRef + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpImage);
}
}
local_14 = 0xffffffff;
tmpPathSize = 0;
tmpPathCapacity = 0xf;
tmpPath[0] = '\0';
tmpPath[1] = '\0';
tmpPath[2] = '\0';
tmpPath[3] = '\0';
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = msvc::_Allocate(0x20);
tmpPathSize = 0x1b;
tmpPathCapacity = 0x1f;
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0))),"gfx/ui/ui_FortunePaper.anm2",0x1c);
local_14 = 0x14;
ANM2::Load(&this->_fortuneSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4));
allocatedBytes = tmpPathCapacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
tmpPathSize = 0;
tmpPathCapacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((tmpPath)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/ui/coop menu.anm2"),0x15);
local_14 = 0x15;
ANM2::Load(&this->_coopMenuSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
pvVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpPath)) + 0x0)));
if (0xfff < allocatedBytes) {
pvVar1 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4);
allocatedBytes = tmpPathCapacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(pvVar1))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar1,allocatedBytes);
}
ANM2::Play(&this->_coopMenuSprite,&DAT_00b6767c,0);
ANM2::PlayOverlay(&this->_coopMenuSprite,GHIDRA_CAST<uint8_t *>("Arrows"),0);
tmpPathSize = 0;
tmpPathCapacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((tmpPath)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/ui/ui_inventory.anm2"),0x18);
local_14 = 0x16;
ANM2::Load(&this->_inventorySprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
pvVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpPath)) + 0x0)));
if (0xfff < allocatedBytes) {
pvVar1 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4);
allocatedBytes = tmpPathCapacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(pvVar1))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar1,allocatedBytes);
}
ANM2::Play(&this->_inventorySprite,s_Idle,0);
tmpPathSize = 0;
tmpPathCapacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((tmpPath)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/ui/ui_crafting.anm2"),0x17);
local_14 = 0x17;
ANM2::Load(&this->_craftingTableSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
pvVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpPath)) + 0x0)));
if (0xfff < allocatedBytes) {
pvVar1 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4);
allocatedBytes = tmpPathCapacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(pvVar1))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar1,allocatedBytes);
}
ANM2::Play(&this->_craftingTableSprite,s_Idle,0);
tmpPathSize = 0;
tmpPathCapacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) = (void *)0x0;
(GHIDRA_CAST<msvc::string *>((tmpPath)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/ui/ui_poops.anm2"),0x14);
local_14 = 0x18;
ANM2::Load(&this->_poopSpellsSprite,GHIDRA_CAST<std_string *>(tmpPath),1);
local_14 = 0xffffffff;
if (0xf < tmpPathCapacity) {
allocatedBytes = tmpPathCapacity + 1;
pvVar1 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)tmpPath)) + 0x0)));
if (0xfff < allocatedBytes) {
pvVar1 = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + -4);
allocatedBytes = tmpPathCapacity + 0x24;
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath)) + 0x0))) + (-4 - GHIDRA_INT(pvVar1))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pvVar1,allocatedBytes);
}
ANM2::Play(&this->_poopSpellsSprite,s_Idle,0);
HUD_Message::load_graphics();
remaining = 6;
do {
HUD_Message::load_graphics();
remaining = remaining + -1;
} while (remaining != 0);
remaining = 4;
do {
HUD_Message::load_graphics();
remaining = remaining + -1;
} while (remaining != 0);
pvVar1 = Manager::LoadImage(tmpImage2,GHIDRA_CAST<uint8_t *>("gfx/Spidermod_Healthbar.png"));
self = hud;
local_14 = 0x19;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((hud)) + 0x5488))))))->KAGE::SmartPointer::operator_assign(pvVar1);
local_14 = 0x1a;
if (tmpImage2Ref != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImage2Ref + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpImage2);
}
}
local_14 = 0xffffffff;
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>((tmpPath + 4)))))->KColor::SetFromARGB(0);
pvVar1 = KAGE_Graphics::create_render_target
(tmpImage2,400,0x80,GHIDRA_CAST<uint8_t *>("Fortune Text Surface"),clearColor);
local_14 = 0x1b;
(GHIDRA_CAST<shared_ptr *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x536c))))))->shared_ptr::operator_assign(pvVar1);
local_14 = 0x1c;
if (tmpImage2Ref != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImage2Ref + 0xc))();
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
(*g_renderTargetReleaseFn)(tmpImage2);
}
}
local_14 = 0xffffffff;
pvVar1 = Manager::LoadImage(tmpImage,GHIDRA_CAST<uint8_t *>("gfx/ui/coop menu.png"));
local_14 = 0x1d;
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x592c))))))->KAGE::SmartPointer::operator_assign(pvVar1);
local_14 = 0x1e;
if (tmpImageRef != GHIDRA_CAST<int *>(0x0)) {
isLastRef = (**(code **)(*tmpImageRef + 0xc))();
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
(*g_imageReleaseFn)(tmpImage);
}
}
local_14 = 0xffffffff;
coopMenuImage = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x592c))));
if ((coopMenuImage[0xc] != 1) || (coopMenuImage[0xd] != 1)) {
(**(code **)(*coopMenuImage + 0x44))(1,1);
coopMenuImage[0xc] = 1;
coopMenuImage[0xd] = 1;
}
path._size = 0;
path._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) = GHIDRA_CAST<char *>(0x0);
(GHIDRA_CAST<msvc::string *>((path._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("gfx/ui/hudstats2.anm2"),0x15);
local_14 = 0x1f;
ANM2::Load(GHIDRA_CAST<ANM2 *>(&self->_statHUD),&path,1);
local_14 = 0xffffffff;
if (0xf < path._capacity) {
allocatedBytes = path._capacity + 1;
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0)));
if (0xfff < allocatedBytes) {
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + -4));
allocatedBytes = path._capacity + 0x24;
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(freeBlock,allocatedBytes);
}
path._size = 0;
path._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) & 0xffffff00;
isAnimSet = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(&self->_statHUD),s_Idle,1);
if ((isAnimSet != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x59d8)))) != 0)) {
AnimationState::SetFrameFloat(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x59d4)))),0.0);
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x59d8)))) != 0) {
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((self)) + 0x59e8))) = 0;
}
}
self->_isGraphicsLoaded = 1;
}
ExceptionList = local_1c;
return;
}
// 009a27d0
void HUD::unload_graphics()
{
uint32_t extraout_ECX;
uint32_t extraout_ECX_00;
uint32_t extraout_ECX_01;
uint32_t extraout_ECX_02;
uint8_t *messageSlot;
HUD *playerHUD;
int remaining;
Font::Unload(&this->_font);
Font::Unload(&this->_fontKR);
ANM2::Reset(&this->_chargeBarSprite);
ANM2::Reset(&this->_chargeBarSmallSprite);
ANM2::Reset(&this->_heartsSprite);
ANM2::Reset(&this->_pickupHUDSprite);
ANM2::Reset(&this->_statsSprite);
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a0))))))->KAGE::SmartPointer::reset((void *)0x0);
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a8))))))->KAGE::SmartPointer::reset((void *)0x0);
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b0))))))->KAGE::SmartPointer::reset((void *)0x0);
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54bc))))))->KAGE::SmartPointer::reset((void *)0x0);
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c4))))))->KAGE::SmartPointer::reset((void *)0x0);
ANM2::Reset(&this->_cardsPillsSprite);
ANM2::Reset(&this->_fortuneSprite);
ANM2::Reset(&this->_inventorySprite);
ANM2::Reset(&this->_craftingTableSprite);
ANM2::Reset(&this->_poopSpellsSprite);
ANM2::Reset(&this->_coopMenuSprite);
(GHIDRA_CAST<HUD_Message *>((GHIDRA_CAST<HUD_Message *>(&this->_messageMain))))->HUD_Message::free_text_buffers();
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3cfc)))));
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3ce4))) = 0;
messageSlot = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x3ee8)));
remaining = 6;
do {
(GHIDRA_CAST<HUD_Message *>((GHIDRA_CAST<HUD_Message *>((messageSlot + -0x18)))))->HUD_Message::free_text_buffers();
ANM2::Reset(GHIDRA_CAST<ANM2 *>((messageSlot + 8)));
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_00);
messageSlot[-0x10] = 0;
messageSlot = messageSlot + 500;
remaining = remaining + -1;
} while (remaining != 0);
messageSlot = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4aa0)));
remaining = 4;
do {
(GHIDRA_CAST<HUD_Message *>((GHIDRA_CAST<HUD_Message *>((messageSlot + -0x18)))))->HUD_Message::free_text_buffers();
ANM2::Reset(GHIDRA_CAST<ANM2 *>((messageSlot + 8)));
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_01);
messageSlot[-0x10] = 0;
messageSlot = messageSlot + 500;
remaining = remaining + -1;
} while (remaining != 0);
remaining = 8;
playerHUD = this;
do {
(GHIDRA_CAST<PlayerHUD *>((GHIDRA_CAST<PlayerHUD *>(playerHUD))))->PlayerHUD::reset();
playerHUD = GHIDRA_CAST<HUD *>((playerHUD->_playerHUD + 0x6dc));
remaining = remaining + -1;
} while (remaining != 0);
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_02);
(GHIDRA_CAST<KAGE::SmartPointer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x592c))))))->KAGE::SmartPointer::reset((void *)0x0);
this->_isGraphicsLoaded = 0;
text_image_cache_clear(&this->_historyHUD);
text_image_cache_reset(&this->_statHUD);
return;
}
// 009a2990
void HUD::Update()
{
uint8_t isEventTriggered;
int remaining;
Manager *manager;
float Pitch;
HUD *local_8;
AnimationState *fortuneAnimState;
if (this->_isRefreshTick != 0) {
this->_hudRefreshCountdown = this->_hudRefreshCountdown + -1;
this->_isRefreshTick = 0;
if (this->_hudRefreshCountdown < 1) {
this->_hudRefreshType = 0;
}
}
if (-1 < this->_bossHPBarDamageFlash) {
this->_bossHPBarDamageFlash = this->_bossHPBarDamageFlash + -1;
}
if (-1 < this->_bossHPBarHealFlash) {
this->_bossHPBarHealFlash = this->_bossHPBarHealFlash + -1;
}
local_8 = this;
FUN_00840ce0();
remaining = 6;
do {
FUN_00840ce0();
remaining = remaining + -1;
} while (remaining != 0);
remaining = 4;
do {
FUN_00840ce0();
remaining = remaining + -1;
} while (remaining != 0);
fortuneAnimState = &(this->_fortuneSprite)._animState;
if ((this->_fortuneSprite)._loaded != 0) {
AnimationState::Update(fortuneAnimState);
AnimationState::Update(&(this->_fortuneSprite)._overlayAnimState);
}
if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a;
isEventTriggered = AnimationState::IsEventTriggered(fortuneAnimState,GHIDRA_CAST<uint8_t *>("SlideIn"));
manager = g_manager;
if (isEventTriggered == 0) {
LAB_009a2aae:
if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a;
isEventTriggered = AnimationState::IsEventTriggered(fortuneAnimState,GHIDRA_CAST<uint8_t *>("SlideOut"));
manager = g_manager;
if (((isEventTriggered == 0) || ((this->_fortuneSprite)._animState._animData == (void *)0x0)) ||
((this->_fortuneSprite)._animState._isPlaying == 0)) goto LAB_009a2b1a;
local_8 = GHIDRA_CAST<HUD *>(0xfc);
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
Pitch = 1.0;
}
else {
if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a;
if ((this->_fortuneSprite)._animState._isPlaying == 0) goto LAB_009a2aae;
local_8 = GHIDRA_CAST<HUD *>(0xfc);
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_8));
Pitch = 1.5;
}
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_8),0.5,2,0,Pitch,0.0);
LAB_009a2b1a:
update_item_info(GHIDRA_CAST<HUD *>((this[1]._playerHUD + 0x28)));
return;
}
// 009a2b30
void HUD::PostUpdate()
{
HUD *pHVar1;
uint32_t playerIdx;
int hudsLeft;
hudsLeft = 8;
pHVar1 = this;
do {
if (*GHIDRA_CAST<int *>(pHVar1->_playerHUD) != 0) {
(GHIDRA_CAST<PlayerHUD *>((GHIDRA_CAST<PlayerHUD *>(pHVar1))))->PlayerHUD::Update();
}
pHVar1 = GHIDRA_CAST<HUD *>((pHVar1->_playerHUD + 0x6dc));
hudsLeft = hudsLeft + -1;
} while (hudsLeft != 0);
if (0 < (g_manager->_optionsConfig)._historyHudMode) {
if (this[1]._playerHUD[0x24] == 0) {
this[1]._playerHUD[0x24] = 1;
update_player_hud_slots(GHIDRA_CAST<HUD *>(&this->_historyHUD),0);
}
playerIdx = 0;
pHVar1 = this + 1;
do {
if (pHVar1->_playerHUD[0] != 0) {
rebuild_player_item_icons(&this->_historyHUD,playerIdx,1);
}
playerIdx = playerIdx + 1;
pHVar1 = GHIDRA_CAST<HUD *>((pHVar1->_playerHUD + 0x14));
} while (GHIDRA_INT(playerIdx) < 2);
}
FUN_0084c170();
return;
}
// 009a2bc0
void HUD::FlashChargeBar(Entity_Player *player, int activeSlot)
{
uint32_t playerHudIndex;
uint8_t *flashTimer;
playerHudIndex = 0;
do {
if (*GHIDRA_CAST<Entity_Player **>(this->_playerHUD) == player) {
if ((-1 < activeSlot) && (GHIDRA_UINT(activeSlot) < 4)) {
flashTimer = this->_playerHUD + activeSlot * 0x1c + 0x1a8;
flashTimer[0] = 8;
flashTimer[1] = 0;
flashTimer[2] = 0;
flashTimer[3] = 0;
}
return;
}
playerHudIndex = playerHudIndex + 1;
this = GHIDRA_CAST<HUD *>((this->_playerHUD + 0x6dc));
} while (playerHudIndex < 8);
return;
}
// 009a2c00
void HUD::InvalidateActiveItem(Entity_Player *player, int activeSlot)
{
uint32_t hudIndex;
uint8_t *slotFlags;
hudIndex = 0;
do {
if (*GHIDRA_CAST<Entity_Player **>(this->_playerHUD) == player) {
if (activeSlot < 4) {
if (activeSlot < 0) {
this->_playerHUD[400] = 0;
this->_playerHUD[0x191] = 0;
this->_playerHUD[0x192] = 0;
this->_playerHUD[0x193] = 0;
this->_playerHUD[0x1ac] = 0;
this->_playerHUD[0x1ad] = 0;
this->_playerHUD[0x1ae] = 0;
this->_playerHUD[0x1af] = 0;
this->_playerHUD[0x1c8] = 0;
this->_playerHUD[0x1c9] = 0;
this->_playerHUD[0x1ca] = 0;
this->_playerHUD[0x1cb] = 0;
this->_playerHUD[0x1e4] = 0;
this->_playerHUD[0x1e5] = 0;
this->_playerHUD[0x1e6] = 0;
this->_playerHUD[0x1e7] = 0;
return;
}
slotFlags = this->_playerHUD + activeSlot * 0x1c + 400;
slotFlags[0] = 0;
slotFlags[1] = 0;
slotFlags[2] = 0;
slotFlags[3] = 0;
}
return;
}
hudIndex = hudIndex + 1;
this = GHIDRA_CAST<HUD *>((this->_playerHUD + 0x6dc));
} while (hudIndex < 8);
return;
}
// 009a2c70
void HUD::InvalidateCraftingItem(Entity_Player *player)
{
uint32_t hudIndex;
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
if (*GHIDRA_CAST<int *>(this->_playerHUD) != 0) {
this->_playerHUD[0x6ad] = 1;
}
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x6dc)) != 0) {
this->_playerHUD[0xd89] = 1;
}
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0xdb8)) != 0) {
this->_playerHUD[0x1465] = 1;
}
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x1494)) != 0) {
this->_playerHUD[0x1b41] = 1;
}
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x1b70)) != 0) {
this->_playerHUD[0x221d] = 1;
}
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x224c)) != 0) {
this->_playerHUD[0x28f9] = 1;
}
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x2928)) != 0) {
this->_playerHUD[0x2fd5] = 1;
}
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x3004)) != 0) {
this->_playerHUD[0x36b1] = 1;
}
return;
}
hudIndex = 0;
do {
if (*GHIDRA_CAST<Entity_Player **>(this->_playerHUD) == player) {
this->_playerHUD[0x6ad] = 1;
return;
}
hudIndex = hudIndex + 1;
this = GHIDRA_CAST<HUD *>((this->_playerHUD + 0x6dc));
} while (hudIndex < 8);
return;
}
// 009a2d20
void HUD::ShowItemText(Entity_Player *player, ItemConfig_Item *item)
{
wchar_t wVar1;
int *piVar2;
int *piVar3;
uint64_t qVar4;
uint8_t bVar5;
uint32_t uVar6;
int iVar7;
char *scrambledText;
wchar_t *title;
ItemConfig_Item *pIVar8;
LayerState *layer;
int unused;
uint8_t *pbVar9;
uint32_t charIndex;
uint8_t *******pppppppbVar10;
uint8_t *size;
uint8_t *******pppppppbVar11;
uint64_t *heapCounter;
uint8_t *pbVar12;
uint32_t descriptionLength;
wchar_t *pwVar13;
HUD_Message *hudMessage;
char acStackY_178 [128];
void *in_stack_ffffff0c;
int in_stack_ffffff10;
char *in_stack_ffffff14;
uint8_t unused2;
ItemConfig_Item **textCapacity;
ItemConfig_Item *local_c0;
uint8_t local_b9;
std_string itemDescription;
std_string itemName;
uint8_t *******tmpString [3];
uint8_t *****local_7c;
uint32_t local_78;
uint8_t *local_74;
wchar_t zzazzPattern;
uint8_t local_6e [74];
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 = local_6e + 0x6a;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0db73;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((local_6e + 0x5e));
ExceptionList = &local_1c;
local_c0 = item;
ItemConfig_Item::GetLocalizedName(item,&itemName,0x14);
local_14 = 0;
ItemConfig_Item::get_localized_description(item,&itemDescription,unused);
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
iVar7 = item->type;
if (((iVar7 == 1) || (iVar7 == 3)) || (iVar7 == 4)) {
if (item->id == 0x7b) {
uVar6 = Random();
if (uVar6 % 3 == 0) {
pbVar12 = GHIDRA_CAST<uint8_t *>(&itemName);
if (0xf < itemName._capacity) {
pbVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *>(itemName._buf))) + 0x0)));
}
bVar5 = str_eq(pbVar12,itemName._size,GHIDRA_CAST<uint8_t *>("Monster Manual"),0xe);
if (bVar5 != 0) {
(GHIDRA_CAST<msvc::string *>((itemName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Monster Manuel"),0xe);
}
}
}
if ((item->id == 0x26b) && (player != GHIDRA_CAST<Entity_Player *>(0x0))) {
iVar7 = FUN_0069bd10();
manager = g_manager;
if (*GHIDRA_CAST<int *>((iVar7 + 0x104)) == 0) {
pbVar12 = &s_empty;
}
else {
pbVar12 = GHIDRA_CAST<uint8_t *>((iVar7 + 0xf4));
if (0xf < *GHIDRA_CAST<uint32_t *>((iVar7 + 0x108))) {
pbVar12 = *GHIDRA_CAST<uint8_t **>(pbVar12);
}
if (*pbVar12 == 0x23) {
local_b9 = 0;
in_stack_ffffff14 = "Players";
in_stack_ffffff10 = 0x9a2e92;
StringTable::get_string
(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("Players"),*GHIDRA_CAST<int *>(&g_manager->_stringTable),
pbVar12 + 1,&local_b9);
if (local_b9 == 0) {
local_b9 = 0;
in_stack_ffffff14 = "Players";
in_stack_ffffff10 = 0x9a2ec5;
pbVar12 = StringTable::get_string
(&manager->_stringTable,GHIDRA_CAST<uint8_t *>("Players"),
*GHIDRA_CAST<int *>(&manager->_stringTable),pbVar12 + 1,&local_b9);
}
}
item = local_c0;
}
tmpString[0] = GHIDRA_CAST<uint8_t *******>(0x0);
local_78 = 0;
local_74 = &DAT_0000000f;
pbVar9 = pbVar12;
do {
bVar5 = *pbVar9;
pbVar9 = pbVar9 + 1;
} while (bVar5 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(tmpString))))->msvc::string::assign(pbVar12,GHIDRA_INT(pbVar9) - GHIDRA_INT((pbVar12 + 1)));
FUN_004215a0();
if (&DAT_0000000f < local_74) {
size = local_74 + 1;
pppppppbVar10 = tmpString[0];
if (GHIDRA_CAST<uint8_t *>(0xfff) < size) {
pppppppbVar10 = GHIDRA_CAST<uint8_t *******>(tmpString[0][-1]);
size = local_74 + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(tmpString[0]) + (-4 - GHIDRA_INT(pppppppbVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pppppppbVar10,GHIDRA_UINT(size));
}
}
}
game = g_game;
textCapacity = &local_c0;
pppppppbVar10 = GHIDRA_CAST<uint8_t *******>(&local_7c);
local_c0 = GHIDRA_CAST<ItemConfig_Item *>(0x9);
iVar7 = 0x9a2f65;
msvc::set<int>::find_node();
if (((local_74[0xd] == '\0') && (*GHIDRA_CAST<int *>((local_74 + 0x10)) < 10)) &&
(local_74 != (game->_seedEffects)._seedEffects)) {
(GHIDRA_CAST<msvc::string *>((acStackY_178 + 0x84)))->msvc::string::string(&itemName);
scrambledText =
string_scramble_seeded
(tmpString,in_stack_ffffff0c,in_stack_ffffff10,GHIDRA_INT(in_stack_ffffff14),iVar7,
GHIDRA_UINT(pppppppbVar10),GHIDRA_UINT(textCapacity));
if (&itemName != GHIDRA_CAST<std_string *>(scrambledText)) {
textCapacity = GHIDRA_CAST<ItemConfig_Item **>(0x9a2fb7);
(GHIDRA_CAST<msvc::string *>((itemName._buf)))->msvc::string::_Tidy_deallocate();
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemName._buf)) + 0x0))) = *GHIDRA_CAST<uint32_t *>(scrambledText);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemName._buf)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((scrambledText + 4));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemName._buf)) + 0x8))) = *GHIDRA_CAST<uint32_t *>((scrambledText + 8));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemName._buf)) + 0xc))) = *GHIDRA_CAST<uint32_t *>((scrambledText + 0xc));
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(itemName)) + 0x10))) = *GHIDRA_CAST<uint64_t *>((scrambledText + 0x10));
scrambledText[0x10] = '\0';
scrambledText[0x11] = '\0';
scrambledText[0x12] = '\0';
scrambledText[0x13] = '\0';
scrambledText[0x14] = '\x0f';
scrambledText[0x15] = '\0';
scrambledText[0x16] = '\0';
scrambledText[0x17] = '\0';
*scrambledText = '\0';
}
if (&DAT_0000000f < local_74) {
textCapacity = GHIDRA_CAST<ItemConfig_Item **>((local_74 + 1));
pppppppbVar10 = tmpString[0];
if (GHIDRA_CAST<ItemConfig_Item **>(0xfff) < textCapacity) {
pppppppbVar10 = GHIDRA_CAST<uint8_t *******>(tmpString[0][-1]);
textCapacity = GHIDRA_CAST<ItemConfig_Item **>((local_74 + 0x24));
if (0x1f < GHIDRA_UINT((GHIDRA_INT(tmpString[0]) + (-4 - GHIDRA_INT(pppppppbVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
iVar7 = 0x9a300f;
operator_delete(pppppppbVar10,GHIDRA_UINT(textCapacity));
}
(GHIDRA_CAST<msvc::string *>((acStackY_178 + 0x84)))->msvc::string::string(&itemDescription);
scrambledText =
string_scramble_seeded
(tmpString,in_stack_ffffff0c,in_stack_ffffff10,GHIDRA_INT(in_stack_ffffff14),iVar7,
GHIDRA_UINT(pppppppbVar10),GHIDRA_UINT(textCapacity));
if (&itemDescription != GHIDRA_CAST<std_string *>(scrambledText)) {
textCapacity = GHIDRA_CAST<ItemConfig_Item **>(0x9a3041);
(GHIDRA_CAST<msvc::string *>((itemDescription._buf)))->msvc::string::_Tidy_deallocate();
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0x0))) = *GHIDRA_CAST<uint32_t *>(scrambledText);
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0x4))) = *GHIDRA_CAST<uint32_t *>((scrambledText + 4));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0x8))) = *GHIDRA_CAST<uint32_t *>((scrambledText + 8));
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0xc))) = *GHIDRA_CAST<uint32_t *>((scrambledText + 0xc));
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(itemDescription)) + 0x10))) = *GHIDRA_CAST<uint64_t *>((scrambledText + 0x10));
scrambledText[0x10] = '\0';
scrambledText[0x11] = '\0';
scrambledText[0x12] = '\0';
scrambledText[0x13] = '\0';
scrambledText[0x14] = '\x0f';
scrambledText[0x15] = '\0';
scrambledText[0x16] = '\0';
scrambledText[0x17] = '\0';
*scrambledText = '\0';
}
if (&DAT_0000000f < local_74) {
textCapacity = GHIDRA_CAST<ItemConfig_Item **>((local_74 + 1));
pppppppbVar10 = tmpString[0];
if (GHIDRA_CAST<ItemConfig_Item **>(0xfff) < textCapacity) {
pppppppbVar10 = GHIDRA_CAST<uint8_t *******>(tmpString[0][-1]);
textCapacity = GHIDRA_CAST<ItemConfig_Item **>((local_74 + 0x24));
if (0x1f < GHIDRA_UINT((GHIDRA_INT(tmpString[0]) + (-4 - GHIDRA_INT(pppppppbVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pppppppbVar10,GHIDRA_UINT(textCapacity));
}
}
unused2 = (uint8_t)textCapacity;
bVar5 = (uint8_t)pppppppbVar10;
pbVar12 = GHIDRA_CAST<uint8_t *>(&itemName);
if (0xf < itemName._capacity) {
pbVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *>(itemName._buf))) + 0x0)));
}
title = utf8_to_utf16_alloc(pbVar12);
pbVar12 = GHIDRA_CAST<uint8_t *>(&itemDescription);
if (0xf < itemDescription._capacity) {
pbVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *>(itemDescription._buf))) + 0x0)));
}
pIVar8 = GHIDRA_CAST<ItemConfig_Item *>(utf8_to_utf16_alloc(pbVar12));
local_c0 = pIVar8;
if (item->id == 0x2d1) {
pbVar9 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#ZZAZZ_PATTERN"));
local_78 = 0;
local_74 = GHIDRA_CAST<uint8_t *>(0xf);
tmpString[0] = GHIDRA_CAST<uint8_t *******>(0x0);
pbVar12 = pbVar9;
do {
bVar5 = *pbVar12;
pbVar12 = pbVar12 + 1;
} while (bVar5 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(tmpString))))->msvc::string::assign(pbVar9,GHIDRA_INT(pbVar12) - GHIDRA_INT((pbVar9 + 1)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
pppppppbVar10 = GHIDRA_CAST<uint8_t *******>(tmpString);
if ((local_74 < 0x10) || (pppppppbVar10 = tmpString[0], tmpString[0] != GHIDRA_CAST<uint8_t *******>(0x0))) {
pppppppbVar11 = pppppppbVar10;
do {
bVar5 = *GHIDRA_CAST<uint8_t *>(pppppppbVar11);
pppppppbVar11 = GHIDRA_CAST<uint8_t *******>((GHIDRA_INT(pppppppbVar11) + 1));
} while (bVar5 != 0);
iVar7 = GHIDRA_INT(pppppppbVar11) - GHIDRA_INT((GHIDRA_INT(pppppppbVar10) + 1));
}
else {
iVar7 = 0;
}
unused2 = 1;
bVar5 = 0x21;
text_convert_encoding(GHIDRA_CAST<uint8_t *>(pppppppbVar10),iVar7,0,&zzazzPattern,0x21,1);
pwVar13 = &zzazzPattern;
do {
wVar1 = *pwVar13;
pwVar13 = pwVar13 + 1;
} while (wVar1 != L'\0');
uVar6 = GHIDRA_INT(pwVar13) - GHIDRA_INT(local_6e) >> 1;
piVar2 = &pIVar8->type;
if (0x20 < uVar6) {
uVar6 = 0x20;
}
do {
piVar3 = &pIVar8->type;
pIVar8 = GHIDRA_CAST<ItemConfig_Item *>((GHIDRA_INT(&pIVar8->type) + 2));
} while ((wchar_t)*piVar3 != L'\0');
descriptionLength = GHIDRA_INT(pIVar8) - GHIDRA_INT((GHIDRA_INT(piVar2) + 2)) >> 1;
if (100 < descriptionLength) {
descriptionLength = 100;
}
charIndex = 0;
if (descriptionLength != 0) {
do {
if (*GHIDRA_CAST<short *>((local_6e + (charIndex % uVar6) * 2 + -2)) != 0x2e) {
*GHIDRA_CAST<short *>(((local_c0->name)._buf + charIndex * 2 + -8)) =
*GHIDRA_CAST<short *>((local_6e + (charIndex % uVar6) * 2 + -2));
}
charIndex = charIndex + 1;
} while (charIndex < descriptionLength);
}
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
if (0xf < local_74) {
uVar6 = GHIDRA_INT(local_74) + 1;
pppppppbVar10 = tmpString[0];
if (0xfff < uVar6) {
pppppppbVar10 = GHIDRA_CAST<uint8_t *******>(tmpString[0][-1]);
uVar6 = GHIDRA_INT(local_74) + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(tmpString[0]) + (-4 - GHIDRA_INT(pppppppbVar10))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pppppppbVar10,uVar6);
unused2 = (uint8_t)uVar6;
bVar5 = (uint8_t)pppppppbVar10;
}
local_78 = 0;
local_74 = &DAT_0000000f;
tmpString[0] = GHIDRA_CAST<uint8_t *******>((GHIDRA_UINT(tmpString[0]) & 0xffffff00));
}
pIVar8 = local_c0;
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
ShowStackedItemTextCustomUTF16(this,title,GHIDRA_CAST<wchar_t *>(local_c0),bVar5,unused2);
}
else {
iVar7 = GetPlayerHudIndex(this,player);
hudMessage = GHIDRA_CAST<HUD_Message *>((GHIDRA_INT(&this->_fortuneSprite) + iVar7 * 500 + -2000));
if (title == GHIDRA_CAST<wchar_t *>(0x0)) {
KAGE_LogMessage(8,(uint8_t *)
"(GHIDRA_CAST<HUD_Message *>(()))->HUD_Message::Show() recieved NULL messageText (This will have no effect) \n"
);
}
else {
(GHIDRA_CAST<HUD_Message *>((hudMessage)))->HUD_Message::text_out();
(GHIDRA_CAST<HUD_Message *>((hudMessage)))->HUD_Message::set_text_line(title,0);
if (pIVar8 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
(GHIDRA_CAST<HUD_Message *>((hudMessage)))->HUD_Message::set_text_line(GHIDRA_CAST<short *>(pIVar8),1);
}
*GHIDRA_CAST<uint16_t *>((hudMessage + 3)) = 1;
bVar5 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(hudMessage[10])) + 0x2)))),&DAT_00b1c208,1);
if (bVar5 != 0) {
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(hudMessage[0x1a])) + 0x2)))));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(hudMessage[0x21])) + 0x1))) = 1;
pIVar8 = local_c0;
}
local_b9 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(hudMessage[3])) + 0x1)));
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(hudMessage[10])) + 0x2)))),GHIDRA_CAST<uint8_t *>(0x1));
layer->_visible = local_b9;
(GHIDRA_CAST<HUD_Message *>((hudMessage)))->HUD_Message::UpdateTextImage();
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(hudMessage[2])) + 0x2))) = 1;
}
}
heapCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
if (g_mainHeap == (void *)0x0) {
heapCounter = &g_allocatedBytesNoHeap;
}
if (title != GHIDRA_CAST<wchar_t *>(0x0)) {
uVar6 = *GHIDRA_CAST<uint32_t *>((title + -2));
qVar4 = *heapCounter;
*GHIDRA_CAST<uint32_t *>(heapCounter) = GHIDRA_UINT(*heapCounter) - uVar6;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapCounter) + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar4) < uVar6));
free(title + -2);
}
heapCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
if (g_mainHeap == (void *)0x0) {
heapCounter = &g_allocatedBytesNoHeap;
}
if (pIVar8 != GHIDRA_CAST<ItemConfig_Item *>(0x0)) {
uVar6 = pIVar8[-1]._initCharge;
qVar4 = *heapCounter;
*GHIDRA_CAST<uint32_t *>(heapCounter) = GHIDRA_UINT(*heapCounter) - uVar6;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapCounter) + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(heapCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar4) < uVar6));
free(&pIVar8[-1]._initCharge);
}
if (0xf < itemDescription._capacity) {
uVar6 = itemDescription._capacity + 1;
pbVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *>(itemDescription._buf))) + 0x0)));
if (0xfff < uVar6) {
pbVar12 = *GHIDRA_CAST<uint8_t **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0x0))) + 0xfffffffc));
uVar6 = itemDescription._capacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar12)))))
goto LAB_009a33db;
}
operator_delete(pbVar12,uVar6);
}
itemDescription._size = 0;
itemDescription._capacity = 0xf;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemDescription._buf)) + 0x0))) & 0xffffff00;
if (0xf < itemName._capacity) {
uVar6 = itemName._capacity + 1;
pbVar12 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *>(itemName._buf))) + 0x0)));
if (0xfff < uVar6) {
pbVar12 = *GHIDRA_CAST<uint8_t **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemName._buf)) + 0x0))) + 0xfffffffc));
uVar6 = itemName._capacity + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(itemName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar12))))) {
LAB_009a33db:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(pbVar12,uVar6);
}
ExceptionList = local_1c;
return;
}
// 009a3590
void HUD::show_fortune_line(uint8_t *text, int unused1, int unused2)
{
uint8_t *textEnd;
void *allocBlock;
uint32_t allocSize;
uint32_t *lines;
uint32_t lineCount;
void *lineText [4];
uint32_t lineTextSize;
uint32_t lineTextCapacity;
uint32_t local_18;
void *local_10;
uint8_t *puStack_c;
void *local_8;
uint32_t *nextNode;
uint32_t *node;
uint8_t textChar;
local_8 = (void *)0xffffffff;
puStack_c = &LAB_00b0dbb5;
local_10 = ExceptionList;
local_18 = __security_cookie ^ GHIDRA_UINT((lineText + 0xb));
ExceptionList = &local_10;
lines = GHIDRA_CAST<uint32_t *>(0x0);
lineCount = 0;
lines = operator_new(0x20);
*lines = lines;
lines[1] = lines;
local_8 = (void *)0x0;
lineTextSize = 0;
lineTextCapacity = 0xf;
lineText[0] = (void *)0x0;
textEnd = text;
do {
textChar = *textEnd;
textEnd = textEnd + 1;
} while (textChar != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(lineText))))->msvc::string::assign(text,GHIDRA_INT(textEnd) - GHIDRA_INT((text + 1)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
list_string_push_back_move(lineText);
local_8 = (void *)((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8);
if (0xf < lineTextCapacity) {
allocSize = lineTextCapacity + 1;
allocBlock = lineText[0];
if (0xfff < allocSize) {
allocBlock = *(void **)(GHIDRA_INT(lineText[0]) + -4);
allocSize = lineTextCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(lineText[0]) + (-4 - GHIDRA_INT(allocBlock))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(allocBlock,allocSize);
}
render_fortune_text(this,&lines);
*GHIDRA_CAST<uint32_t *>(lines[1]) = 0;
node = GHIDRA_CAST<uint32_t *>(*lines);
while (node != GHIDRA_CAST<uint32_t *>(0x0)) {
nextNode = GHIDRA_CAST<uint32_t *>(*node);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((node + 2)))))->msvc::string::_Tidy_deallocate();
operator_delete(node,0x20);
node = nextNode;
}
operator_delete(lines,0x20);
ExceptionList = local_10;
return;
}
// 009a36d0
void HUD::show_fortune_text_impl(uint8_t *text)
{
uint8_t bVar1;
uint32_t *puVar2;
uint64_t qVar3;
wint_t *wideText;
int iVar4;
uint8_t *pbVar5;
uint32_t *puVar6;
void *ptr;
uint64_t *allocatedBytes;
wint_t *lineEnd;
uint32_t uVar7;
wint_t *cursor;
wint_t *lastSpace;
Font *font;
uint32_t charBuffer;
wint_t *lineStart;
uint32_t *lines;
int lineCount;
uint32_t *local_144;
void *lineText;
uint32_t uStack_13c;
uint32_t uStack_138;
uint32_t uStack_134;
uint32_t lineTextSize;
uint32_t lineTextCapacity;
uint8_t lineBuffer [260];
uint32_t local_24;
uint8_t *puStack_20;
void *local_1c;
uint8_t *puStack_18;
uint32_t local_14;
wint_t currentChar;
puStack_20 = lineBuffer + 0x124;
local_14 = 0xffffffff;
puStack_18 = &LAB_00b0dc11;
local_1c = ExceptionList;
local_24 = __security_cookie ^ GHIDRA_UINT((lineBuffer + 0x118));
ExceptionList = &local_1c;
font = &this->_font;
if ((*GHIDRA_CAST<char *>(&this->_font) == '\0') && (font = &this->_fontKR, *GHIDRA_CAST<char *>(&this->_fontKR) == '\0')) {
font = &g_manager->_font7_Upheaval;
}
wideText = GHIDRA_CAST<wint_t *>(utf8_to_utf16_alloc(text));
lines = GHIDRA_CAST<uint32_t *>(0x0);
lineCount = 0;
lines = operator_new(0x20);
*lines = lines;
lines[1] = lines;
local_14 = 0;
local_144 = GHIDRA_CAST<uint32_t *>(0x0);
charBuffer = 0;
currentChar = *wideText;
cursor = wideText;
lastSpace = wideText;
lineStart = wideText;
do {
if (currentChar == 0) {
text_convert_encoding
(GHIDRA_CAST<uint8_t *>(lineStart),GHIDRA_INT(cursor) - GHIDRA_INT(lineStart) >> 1,1,lineBuffer,0x100,0);
pbVar5 = lineBuffer;
lineTextSize = 0;
lineTextCapacity = 0xf;
lineText = (void *)0x0;
do {
bVar1 = *pbVar5;
pbVar5 = pbVar5 + 1;
} while (bVar1 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&lineText))))->msvc::string::assign(lineBuffer,GHIDRA_INT(pbVar5) - GHIDRA_INT((lineBuffer + 1)));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
list_string_push_back_move(&lineText);
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
if (0xf < lineTextCapacity) {
uVar7 = lineTextCapacity + 1;
ptr = lineText;
if (0xfff < uVar7) {
ptr = *(void **)(GHIDRA_CAST<char *>(lineText) + -4);
uVar7 = lineTextCapacity + 0x24;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(lineText) + (-4 - GHIDRA_INT(ptr))))) {
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar7);
}
if (g_mainHeap == (void *)0x0) {
allocatedBytes = &g_allocatedBytesNoHeap;
}
else {
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
}
uVar7 = *GHIDRA_CAST<uint32_t *>((wideText + -2));
qVar3 = *allocatedBytes;
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar7;
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar3) < uVar7));
free(wideText + -2);
local_14 = local_14 & 0xffffff00;
render_fortune_text(this,&lines);
*GHIDRA_CAST<uint32_t *>(lines[1]) = 0;
puVar2 = GHIDRA_CAST<uint32_t *>(*lines);
while (puVar2 != GHIDRA_CAST<uint32_t *>(0x0)) {
puVar6 = GHIDRA_CAST<uint32_t *>(*puVar2);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((puVar2 + 2)))))->msvc::string::_Tidy_deallocate();
operator_delete(puVar2,0x20);
puVar2 = puVar6;
}
operator_delete(lines,0x20);
ExceptionList = local_1c;
return;
}
iVar4 = iswspace(currentChar);
charBuffer = CONCAT22((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(charBuffer)) + 0x2))),*cursor);
if (iVar4 != 0) {
lastSpace = cursor;
}
iVar4 = Font::get_string_width_utf16(font,GHIDRA_CAST<short *>(&charBuffer),-1);
local_144 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(local_144) + iVar4));
if (0x10e < local_144) {
lineEnd = cursor;
if (lastSpace != lineStart) {
lineEnd = lastSpace;
}
text_convert_encoding
(GHIDRA_CAST<uint8_t *>(lineStart),GHIDRA_INT(lineEnd) - GHIDRA_INT(lineStart) >> 1,0,lineBuffer,0x100,1);
pbVar5 = lineBuffer;
lineTextSize = 0;
lineTextCapacity = 0xf;
lineText = (void *)0x0;
do {
bVar1 = *pbVar5;
pbVar5 = pbVar5 + 1;
} while (bVar1 != 0);
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&lineText))))->msvc::string::assign(lineBuffer,GHIDRA_INT(pbVar5) - GHIDRA_INT((lineBuffer + 1)));
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
local_144 = lines;
if (lineCount == 0x7ffffff) {
/* WARNING: Subroutine does not return */
msvc::_Xlength_error("list too long");
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
puVar6 = operator_new(0x20);
puVar6[6] = 0;
puVar6[7] = 0;
puVar6[2] = lineText;
puVar6[3] = uStack_13c;
puVar6[4] = uStack_138;
puVar6[5] = uStack_134;
puVar6[6] = lineTextSize;
puVar6[7] = lineTextCapacity;
lineCount = lineCount + 1;
puVar2 = GHIDRA_CAST<uint32_t *>(local_144[1]);
cursor = cursor + -1;
if (lastSpace != lineStart) {
cursor = lastSpace;
}
*puVar6 = local_144;
puVar6[1] = puVar2;
local_144[1] = puVar6;
*puVar2 = puVar6;
lastSpace = cursor + 1;
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
local_144 = GHIDRA_CAST<uint32_t *>(0x0);
lineStart = lastSpace;
}
currentChar = cursor[1];
cursor = cursor + 1;
} while( true );
}
// 009a3ac0
void HUD::render_fortune_text(void *lines)
{
KColor color;
HUD *pHVar1;
uint8_t isAnimChanged;
uint32_t *renderTargetEntry;
uint32_t lineWidth;
uint8_t *lineText;
void *glyphs;
uint32_t maxWidth;
int iVar2;
Font *font;
int *piVar3;
int *lineNode;
uint32_t prevMaxWidth;
float textHeight;
float fullLineHeight;
char *anim;
uint32_t drawSettings;
uint32_t local_54;
uint32_t local_50;
uint32_t local_4c;
uint32_t local_48;
uint32_t local_44;
uint32_t local_40;
uint8_t glyphBuffer [16];
Vector local_2c;
float local_24;
float lineHeight;
float textScale;
HUD *hud;
void *local_10;
uint8_t *puStack_c;
uint32_t local_8;
void *lineList;
lineList = lines;
local_8 = 0xffffffff;
puStack_c = &LAB_00b0dc55;
local_10 = ExceptionList;
ExceptionList = &local_10;
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(lines) + 4));
hud = this;
if (iVar2 == 0) {
isAnimChanged = ANM2::SetAnimation(&this->_fortuneSprite,&DAT_00b1c208,1);
if (isAnimChanged != 0) {
AnimationState::Rewind(&(this->_fortuneSprite)._animState);
(this->_fortuneSprite)._animState._isPlaying = 1;
}
local_2c.x = 0.0;
local_2c.y = 0.0;
msvc::vector::resize(&local_2c);
renderTargetEntry = msvc::deque::back();
if (GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
*GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
}
*renderTargetEntry = g_graphicsManager_renderTarget;
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x536c))),0);
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
pop_render_target();
ExceptionList = local_10;
return;
}
font = &this->_font;
textScale = 1.0;
if ((*GHIDRA_CAST<char *>(&this->_font) == '\0') && (font = &this->_fontKR, *GHIDRA_CAST<char *>(&this->_fontKR) == '\0')) {
font = &g_manager->_font7_Upheaval;
}
fullLineHeight = 21.0;
maxWidth = 0;
lineHeight = 21.0;
piVar3 = GHIDRA_CAST<int *>(**(int **))lines;
prevMaxWidth = 0;
if (piVar3 != *GHIDRA_CAST<int **>(lines)) {
do {
lineText = GHIDRA_CAST<uint8_t *>((piVar3 + 2));
if (0xf < GHIDRA_UINT(piVar3[7])) {
lineText = *GHIDRA_CAST<uint8_t **>(lineText);
}
lineWidth = Font::get_string_width_n(font,lineText,-1);
maxWidth = prevMaxWidth;
if (prevMaxWidth < lineWidth) {
maxWidth = lineWidth;
}
piVar3 = GHIDRA_CAST<int *>(*piVar3);
prevMaxWidth = maxWidth;
} while (piVar3 != GHIDRA_CAST<int *>(*GHIDRA_CAST<int *>(lines)));
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(lines) + 4));
local_24 = (float)maxWidth;
}
pHVar1 = hud;
textHeight = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * fullLineHeight;
if ((0x111 < maxWidth) || (63.0 < textHeight)) {
textScale = 0.5;
lineHeight = 10.5;
textHeight = textHeight * 0.5;
}
if (textHeight <= 42.0) {
if (textHeight <= fullLineHeight) {
anim = &DAT_00b1c208;
}
else {
anim = "Text2";
}
}
else {
anim = "Text3";
}
isAnimChanged = ANM2::SetAnimation(&hud->_fortuneSprite,GHIDRA_CAST<uint8_t *>(anim),1);
if (isAnimChanged != 0) {
AnimationState::Rewind(&(pHVar1->_fortuneSprite)._animState);
(pHVar1->_fortuneSprite)._animState._isPlaying = 1;
}
local_2c.x = 0.0;
local_2c.y = 0.0;
msvc::vector::resize(&local_2c);
renderTargetEntry = msvc::deque::back();
pHVar1 = hud;
if (GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)) != GHIDRA_CAST<uint8_t *>(0x0)) {
*GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)) = (uint8_t)(g_graphicsManager_flags >> 5) & 1;
}
*renderTargetEntry = g_graphicsManager_renderTarget;
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((hud)) + 0x536c))),0);
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
g_graphicsManager_blendMode[0] = 0;
g_graphicsManager_blendMode[1] = 1;
g_graphicsManager_blendMode[2] = 7;
g_graphicsManager_blendMode[3] = 1;
g_graphicsManager_blendMode[4] = 7;
iVar2 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pHVar1)) + 0x536c)))) + 0x10));
piVar3 = *GHIDRA_CAST<int **>(lines);
lineNode = GHIDRA_CAST<int *>(*piVar3);
local_24 = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * 0.5;
lines = (void *)0x0;
if (lineNode != piVar3) {
local_2c.y = textScale;
local_2c.x = textScale;
do {
drawSettings = 1;
local_54 = 0xffff;
local_50 = 0;
local_4c = 0x3f800000;
local_48 = 0xffffffff;
local_44 = 0;
local_40 = 0;
lineText = GHIDRA_CAST<uint8_t *>((lineNode + 2));
local_8 = 0;
if (0xf < GHIDRA_UINT(lineNode[7])) {
lineText = *GHIDRA_CAST<uint8_t **>(lineText);
}
glyphs = Font::measure_string(font,glyphBuffer,lineText,&drawSettings,&local_2c);
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
color._alpha = 1.0;
color._red = 0.0;
color._green = 0.0;
color._blue = 0.0;
color._unk = 0;
Font::render_glyph_quads
(font,glyphs,local_24,(float)lines,textScale,textScale,color,&drawSettings);
msvc::vector<12byte>::clear();
msvc::vector<12byte>::_Tidy();
lines = (void *)((float)lines + lineHeight);
local_8 = 0xffffffff;
lineNode = GHIDRA_CAST<int *>(*lineNode);
} while (lineNode != GHIDRA_CAST<int *>(*GHIDRA_CAST<int *>(lineList)));
}
_glfw_context_reset(1);
if (g_renderTargetStackSize == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("PopRenderTarget: stack is empty!\n"));
}
renderTargetEntry = msvc::deque::back();
KAGE_Graphics::SetRenderTarget
(&DAT_00c798e0,(void *)*renderTargetEntry,*GHIDRA_CAST<uint8_t *>((renderTargetEntry + 1)));
g_renderTargetStackSize = g_renderTargetStackSize - 1;
if (g_renderTargetStackSize == 0) {
DAT_00c7978c = 0;
}
ExceptionList = local_10;
return;
}
// 009a3eb0
void HUD::Render()
{
void *pvVar1;
ANM2 *animation;
Vector VVar2;
Vector pos;
Vector pos_00;
Vector pos_01;
Vector pos_02;
Vector pos_03;
Vector pos_04;
Vector barPos;
uint8_t bVar3;
char isLastRef;
Vector *minimapSize;
void *settings;
int iVar4;
Entity_Player *pEVar5;
KColor *color;
KColor *color_00;
KColor *color_01;
KColor *color_02;
KColor *color_03;
KColor *color_04;
RoomDescriptor *currentRoomDesc;
PersistentGameData *profileData;
uint8_t *animNameCursor;
ChallengeParam *challengeParams;
Entity_Player *extraout_EAX;
KColor *color_05;
KColor *color_06;
uint32_t extraout_ECX;
int unused;
uint8_t *pbVar6;
AnimationState *lastAnimState;
int unusedArg;
AnimationState *secondAnimState;
KColor *color_07;
char *destinationCursor;
int destinationFrame;
uint8_t *idleCursor;
uint32_t uVar7;
KColor *color_08;
uint8_t *******statusTextBuf;
Game *pGVar8;
char extraout_DL;
uint32_t *ptr;
float portraitEnd;
PlayerManager *playerManager;
PersistentGameData *data;
bool isLess;
int *piVar9;
float portraitAlpha;
float fVar10;
float fVar11;
uint64_t uVar12;
uint8_t quadBuffer [116];
Vector portraitScaleX;
uint8_t lobbyFindResult [4];
Vector local_130;
Vector local_128;
KColor local_120;
uint32_t drawSettings;
uint32_t local_108;
uint32_t local_104;
uint32_t local_100;
uint32_t local_fc;
uint32_t local_f8;
uint32_t local_f4;
uint32_t drawSettingsAlt;
uint32_t local_ec;
KColor local_e8;
Vector local_d4;
uint32_t *iconFrames;
Vector local_c8;
float lobbyUserId;
float local_bc;
Entity_Player *local_b8;
char isStatHudHidden;
char isAchievementsDisabled;
char isHardMode;
float userId;
Entity_Player *local_ac;
Vector local_a8;
char isInClearedGreedBossRoom;
HUD *local_98;
float local_94;
float local_90;
Game *local_8c;
Vector cursorPos;
uint8_t local_7e;
char isGreedMode;
Entity_Player *local_7c;
float local_78;
float local_74;
uint8_t local_70 [36];
float local_4c;
float local_48;
uint8_t *******statusText;
KColor local_40;
uint8_t ambushText [4];
int coopPlayerType;
uint32_t stackCookie;
uint8_t *puStack_20;
void *savedExceptionList;
uint8_t *puStack_18;
uint32_t ehState;
code *drawQuadFn;
Manager *temp_3fc998231f;
pvVar1 = ExceptionList;
puStack_20 = ambushText + 0x28;
ehState = 0xffffffff;
puStack_18 = &LAB_00b0dd45;
savedExceptionList = ExceptionList;
stackCookie = __security_cookie ^ GHIDRA_UINT((ambushText + 0x1c));
ExceptionList = &savedExceptionList;
this->_playerHUD[0x6bc] = 0x80;
this->_playerHUD[0x6bd] = 0x96;
this->_playerHUD[0x6be] = 0x18;
this->_playerHUD[0x6bf] = 0x4b;
this->_playerHUD[0x6c0] = 0x80;
this->_playerHUD[0x6c1] = 0x96;
this->_playerHUD[0x6c2] = 0x18;
this->_playerHUD[0x6c3] = 0x4b;
this->_playerHUD[0x6c4] = 0x80;
this->_playerHUD[0x6c5] = 0x96;
this->_playerHUD[0x6c6] = 0x18;
this->_playerHUD[0x6c7] = 0xcb;
this->_playerHUD[0x6c8] = 0x80;
this->_playerHUD[0x6c9] = 0x96;
this->_playerHUD[0x6ca] = 0x18;
this->_playerHUD[0x6cb] = 0xcb;
this->_playerHUD[0xd98] = 0x80;
this->_playerHUD[0xd99] = 0x96;
this->_playerHUD[0xd9a] = 0x18;
this->_playerHUD[0xd9b] = 0x4b;
this->_playerHUD[0xd9c] = 0x80;
this->_playerHUD[0xd9d] = 0x96;
this->_playerHUD[0xd9e] = 0x18;
this->_playerHUD[0xd9f] = 0x4b;
this->_playerHUD[0xda0] = 0x80;
this->_playerHUD[0xda1] = 0x96;
this->_playerHUD[0xda2] = 0x18;
this->_playerHUD[0xda3] = 0xcb;
this->_playerHUD[0xda4] = 0x80;
this->_playerHUD[0xda5] = 0x96;
this->_playerHUD[0xda6] = 0x18;
this->_playerHUD[0xda7] = 0xcb;
this->_playerHUD[0x1474] = 0x80;
this->_playerHUD[0x1475] = 0x96;
this->_playerHUD[0x1476] = 0x18;
this->_playerHUD[0x1477] = 0x4b;
this->_playerHUD[0x1478] = 0x80;
this->_playerHUD[0x1479] = 0x96;
this->_playerHUD[0x147a] = 0x18;
this->_playerHUD[0x147b] = 0x4b;
this->_playerHUD[0x147c] = 0x80;
this->_playerHUD[0x147d] = 0x96;
this->_playerHUD[0x147e] = 0x18;
this->_playerHUD[0x147f] = 0xcb;
this->_playerHUD[0x1480] = 0x80;
this->_playerHUD[0x1481] = 0x96;
this->_playerHUD[0x1482] = 0x18;
this->_playerHUD[0x1483] = 0xcb;
this->_playerHUD[0x1b50] = 0x80;
this->_playerHUD[0x1b51] = 0x96;
this->_playerHUD[0x1b52] = 0x18;
this->_playerHUD[0x1b53] = 0x4b;
this->_playerHUD[0x1b54] = 0x80;
this->_playerHUD[0x1b55] = 0x96;
this->_playerHUD[0x1b56] = 0x18;
this->_playerHUD[6999] = 0x4b;
this->_playerHUD[7000] = 0x80;
this->_playerHUD[0x1b59] = 0x96;
this->_playerHUD[0x1b5a] = 0x18;
this->_playerHUD[0x1b5b] = 0xcb;
this->_playerHUD[0x1b5c] = 0x80;
this->_playerHUD[0x1b5d] = 0x96;
this->_playerHUD[0x1b5e] = 0x18;
this->_playerHUD[0x1b5f] = 0xcb;
this->_playerHUD[0x222c] = 0x80;
this->_playerHUD[0x222d] = 0x96;
this->_playerHUD[0x222e] = 0x18;
this->_playerHUD[0x222f] = 0x4b;
this->_playerHUD[0x2230] = 0x80;
this->_playerHUD[0x2231] = 0x96;
this->_playerHUD[0x2232] = 0x18;
this->_playerHUD[0x2233] = 0x4b;
this->_playerHUD[0x2234] = 0x80;
this->_playerHUD[0x2235] = 0x96;
this->_playerHUD[0x2236] = 0x18;
this->_playerHUD[0x2237] = 0xcb;
this->_playerHUD[0x2238] = 0x80;
this->_playerHUD[0x2239] = 0x96;
this->_playerHUD[0x223a] = 0x18;
this->_playerHUD[0x223b] = 0xcb;
this->_playerHUD[0x2908] = 0x80;
this->_playerHUD[0x2909] = 0x96;
this->_playerHUD[0x290a] = 0x18;
this->_playerHUD[0x290b] = 0x4b;
this->_playerHUD[0x290c] = 0x80;
this->_playerHUD[0x290d] = 0x96;
this->_playerHUD[0x290e] = 0x18;
this->_playerHUD[0x290f] = 0x4b;
this->_playerHUD[0x2910] = 0x80;
this->_playerHUD[0x2911] = 0x96;
this->_playerHUD[0x2912] = 0x18;
this->_playerHUD[0x2913] = 0xcb;
this->_playerHUD[0x2914] = 0x80;
this->_playerHUD[0x2915] = 0x96;
this->_playerHUD[0x2916] = 0x18;
this->_playerHUD[0x2917] = 0xcb;
this->_playerHUD[0x2fe4] = 0x80;
this->_playerHUD[0x2fe5] = 0x96;
this->_playerHUD[0x2fe6] = 0x18;
this->_playerHUD[0x2fe7] = 0x4b;
this->_playerHUD[0x2fe8] = 0x80;
this->_playerHUD[0x2fe9] = 0x96;
this->_playerHUD[0x2fea] = 0x18;
this->_playerHUD[0x2feb] = 0x4b;
this->_playerHUD[0x2fec] = 0x80;
this->_playerHUD[0x2fed] = 0x96;
this->_playerHUD[0x2fee] = 0x18;
this->_playerHUD[0x2fef] = 0xcb;
this->_playerHUD[0x2ff0] = 0x80;
this->_playerHUD[0x2ff1] = 0x96;
this->_playerHUD[0x2ff2] = 0x18;
this->_playerHUD[0x2ff3] = 0xcb;
this->_playerHUD[0x36c0] = 0x80;
this->_playerHUD[0x36c1] = 0x96;
this->_playerHUD[0x36c2] = 0x18;
this->_playerHUD[0x36c3] = 0x4b;
this->_playerHUD[0x36c4] = 0x80;
this->_playerHUD[0x36c5] = 0x96;
this->_playerHUD[0x36c6] = 0x18;
this->_playerHUD[0x36c7] = 0x4b;
this->_playerHUD[0x36c8] = 0x80;
this->_playerHUD[0x36c9] = 0x96;
this->_playerHUD[0x36ca] = 0x18;
this->_playerHUD[0x36cb] = 0xcb;
this->_playerHUD[0x36cc] = 0x80;
pGVar8 = g_game;
this->_playerHUD[0x36cd] = 0x96;
this->_playerHUD[0x36ce] = 0x18;
this->_playerHUD[0x36cf] = 0xcb;
if (this->_isVisible == 0) {
ExceptionList = pvVar1;
return;
}
local_ac = GHIDRA_CAST<Entity_Player *>(0xa);
local_98 = this;
msvc::set<int>::find_node(&local_120._blue,&local_ac);
if ((*GHIDRA_CAST<char *>((local_120._unk + 0xd)) != '\0') ||
(piVar9 = GHIDRA_CAST<int *>(local_120._unk), 10 < *GHIDRA_CAST<int *>((local_120._unk + 0x10)))) {
piVar9 = (pGVar8->_seedEffects)._seedEffects;
}
if (piVar9 != (pGVar8->_seedEffects)._seedEffects) {
ExceptionList = savedExceptionList;
return;
}
piVar9 = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pGVar8->_room) + 4)) + 0x10));
if (((piVar9 == GHIDRA_CAST<int *>(0x0)) || (piVar9[2] != 0x10)) || (*piVar9 != 0x23)) {
isStatHudHidden = '\0';
}
else {
isStatHudHidden = '\x01';
}
local_90 = (pGVar8->_screenShakeOffset).x;
local_94 = (pGVar8->_screenShakeOffset).y;
update_hud_offset(this);
local_ac = GHIDRA_CAST<Entity_Player *>((g_manager->_optionsConfig)._historyHudMode);
if ((0 < GHIDRA_INT(local_ac)) && (extraout_DL == '\0')) {
fVar10 = 1.0 - (g_manager->_optionsConfig)._hudOffset;
portraitAlpha = fVar10 * -14.0;
fVar10 = fVar10 * 24.0;
minimapSize = (GHIDRA_CAST<Minimap *>((&pGVar8->_minimap)))->Minimap::GetDisplayedSize(&local_130);
local_a8.y = portraitAlpha + minimapSize->y + 32.0;
local_a8.x = (g_screenWidth - 87.0) + fVar10;
render_extra_hud(GHIDRA_CAST<HUD *>(&this->_historyHUD),&local_a8,local_ac == GHIDRA_CAST<Entity_Player *>(0x2));
pGVar8 = g_game;
}
if (*GHIDRA_CAST<int *>(&pGVar8->_deathmatchManager) < 2) {
(GHIDRA_CAST<Minimap *>((&pGVar8->_minimap)))->Minimap::Render();
pGVar8 = g_game;
if (((g_game->_ambush)._isActive != 0) && (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8)) == 0x11)) {
local_a8.x = 64.0;
local_a8.y = 32.0;
local_d4.x = (g_screenWidth - 64.0) * 0.5 + local_90;
local_7c = (Entity_Player *)
((1.0 - (g_manager->_optionsConfig)._hudOffset) * -24.0 + 20.0 + local_94);
if (0.0 < *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_minimap))) + 0x2d0))))) {
local_7c = GHIDRA_CAST<Entity_Player *>(((float)local_7c + 20.0));
}
if ((g_game->_dailyChallenge)._id != 0) {
local_7c = GHIDRA_CAST<Entity_Player *>(((float)local_7c + 20.0));
}
local_d4.y = (float)local_7c;
local_ac = GHIDRA_CAST<Entity_Player *>(local_d4.x);
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
render_quad_set_rect(quadBuffer,&local_d4,&local_a8,color_06);
drawQuadFn = *(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54c4)))) + 0x1c);
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
(*drawQuadFn)(quadBuffer,extraout_ECX);
sprintf_s(ambushText,8,GHIDRA_CAST<uint8_t *>("%d/%d"));
temp_3fc998231f = g_manager;
FontSettings::constructor(GHIDRA_CAST<FontSettings *>((local_70 + 0x10)));
ehState = 0;
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
iVar4 = Font::get_string_width_n
(&temp_3fc998231f->_font6_PFTempestaSevenCondensed,ambushText,-1);
Font::DrawString(&temp_3fc998231f->_font6_PFTempestaSevenCondensed,ambushText,&local_120,
settings,((float)local_ac + 53.0) -
(float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]),
(float)local_7c + 7.0);
ehState = 0xffffffff;
local_4c = 0.0;
local_48 = 0.0;
pGVar8 = g_game;
this = local_98;
}
}
cursorPos.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5934)))) + 20.0;
piVar9 = (pGVar8->_playerManager)._playerList._begin;
local_8c = GHIDRA_CAST<Game *>(&g_manager->_font6_PFTempestaSevenCondensed);
cursorPos.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5938)))) + 46.0;
local_7c = GHIDRA_CAST<Entity_Player *>(0x41400000);
local_78 = cursorPos.y;
if (GHIDRA_INT((pGVar8->_playerManager)._playerList._end) - GHIDRA_INT(piVar9) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
piVar9 = (pGVar8->_playerManager)._playerList._begin;
pGVar8 = g_game;
}
local_bc = (float)*piVar9;
if (1 < *GHIDRA_CAST<int *>(&pGVar8->_deathmatchManager)) {
iVar4 = FUN_0090b070();
if (iVar4 != 0) {
local_bc = (float)FUN_004253d0();
}
pGVar8 = g_game;
}
if (local_bc == 0.0) {
ExceptionList = savedExceptionList;
return;
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_bc) + 0x13c0)) == 0x13) {
cursorPos.y = local_78 + 14.0;
local_78 = cursorPos.y;
}
playerManager = &pGVar8->_playerManager;
local_98 = GHIDRA_CAST<HUD *>((GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager)::FirstPlayerByType(0x12);
local_b8 = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::FirstPlayerByType(0x24);
local_7e = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::are_all_players_tainted_blue_baby(unused);
local_ac = (GHIDRA_CAST<PlayerManager *>((playerManager)))->PlayerManager::FirstPlayerByType(0x19);
if (((local_98 != GHIDRA_CAST<HUD *>(0x0)) || (local_b8 != GHIDRA_CAST<Entity_Player *>(0x0))) ||
((local_ac != GHIDRA_CAST<Entity_Player *>(0x0) && (local_7e == 0)))) {
local_7c = GHIDRA_CAST<Entity_Player *>(0x41300000);
}
bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,s_Idle,1);
if (((bVar3 != 0) && ((this->_pickupHUDSprite)._animState._animData != (void *)0x0)) &&
(AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,0.0),
(this->_pickupHUDSprite)._animState._animData != (void *)0x0)) {
(this->_pickupHUDSprite)._animState._isPlaying = 0;
}
if ((this->_pickupHUDSprite)._loaded == 0) {
local_74 = local_78;
}
else if ((this->_pickupHUDSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(this->_pickupHUDSprite)._animState,&cursorPos,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(&(this->_pickupHUDSprite)._overlayAnimState,&cursorPos,&g_vectorZero,&g_vectorZero);
local_74 = cursorPos.y;
}
else {
AnimationState::Render
(&(this->_pickupHUDSprite)._overlayAnimState,&cursorPos,&g_vectorZero,&g_vectorZero);
AnimationState::Render
(&(this->_pickupHUDSprite)._animState,&cursorPos,&g_vectorZero,&g_vectorZero);
local_74 = cursorPos.y;
}
local_78 = local_90 + cursorPos.x;
local_74 = local_94 + local_74;
pEVar5 = PlayerManager::FirstCollectibleOwner
(&g_game->_playerManager,0x1a0,GHIDRA_CAST<RNG **>(&g_game->_playerManager),1);
pbVar6 = &DAT_00b6d170;
if (pEVar5 == GHIDRA_CAST<Entity_Player *>(0x0)) {
pbVar6 = &DAT_00b7ddac;
}
sprintf_s(&DAT_00c94328,0x10,pbVar6);
drawSettingsAlt = 0;
local_ec = 0xffff;
local_e8._red = 0.0;
local_e8._green = 1.0;
local_e8._blue = -NAN;
local_e8._alpha = 0.0;
local_e8._unk = 0;
ehState = 1;
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
VVar2.y = local_74 + 1.0;
VVar2.x = local_78 + 16.0;
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,VVar2,(Vector)0x3f8000003f800000,color,
GHIDRA_CAST<FontSettings *>(&drawSettingsAlt));
ehState = 0xffffffff;
cursorPos.x = local_78 - local_90;
cursorPos.y = (local_74 - local_94) + (float)local_7c;
if (local_7e == 0) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_bc) + 0x1dd4)) == 0) {
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_bc) + 0x1361)) == '\0') {
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
fVar10 = 2.0;
goto LAB_009a4737;
}
}
else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
fVar10 = 6.0;
LAB_009a4737:
AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar10);
}
}
else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
fVar10 = 14.0;
goto LAB_009a4737;
}
ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero);
local_78 = local_90 + cursorPos.x;
local_74 = local_94 + cursorPos.y;
sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac);
drawSettingsAlt = 0;
local_ec = 0xffff;
local_e8._red = 0.0;
local_e8._green = 1.0;
local_e8._blue = -NAN;
local_e8._alpha = 0.0;
local_e8._unk = 0;
ehState = 2;
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
pos.y = local_74 + 1.0;
pos.x = local_78 + 16.0;
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,pos,(Vector)0x3f8000003f800000,color_00,
GHIDRA_CAST<FontSettings *>(&drawSettingsAlt));
cursorPos.x = local_78 - local_90;
cursorPos.y = (local_74 - local_94) + (float)local_7c;
}
ehState = 0xffffffff;
if (local_ac != GHIDRA_CAST<Entity_Player *>(0x0)) {
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,16.0);
}
ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero);
local_78 = local_90 + cursorPos.x;
local_74 = local_94 + cursorPos.y;
pEVar5 = (GHIDRA_CAST<PlayerManager *>((&g_game->_playerManager)))->PlayerManager::FirstBirthrightOwner(0x19);
pbVar6 = &DAT_00b7ddac;
if (pEVar5 == GHIDRA_CAST<Entity_Player *>(0x0)) {
pbVar6 = s__d;
}
sprintf_s(&DAT_00c94328,0x10,pbVar6);
drawSettingsAlt = 0;
local_ec = 0xffff;
local_e8._red = 0.0;
local_e8._green = 1.0;
local_e8._blue = -NAN;
local_e8._alpha = 0.0;
local_e8._unk = 0;
ehState = 3;
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
pos_00.y = local_74 + 1.0;
pos_00.x = local_78 + 16.0;
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,pos_00,(Vector)0x3f8000003f800000,color_01,
GHIDRA_CAST<FontSettings *>(&drawSettingsAlt));
cursorPos.x = local_78 - local_90;
cursorPos.y = (local_74 - local_94) + (float)local_7c;
}
ehState = 0xffffffff;
secondAnimState = &(this->_pickupHUDSprite)._animState;
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_bc) + 0x1360)) == '\0') {
fVar10 = 1.0;
}
else {
fVar10 = 3.0;
}
AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar10);
}
if ((this->_pickupHUDSprite)._loaded != 0) {
if ((this->_pickupHUDSprite)._overlayRenderFirst == 0) {
AnimationState::Render(secondAnimState,&cursorPos,&g_vectorZero,&g_vectorZero);
lastAnimState = &(this->_pickupHUDSprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(this->_pickupHUDSprite)._overlayAnimState,&cursorPos,&g_vectorZero,&g_vectorZero)
;
lastAnimState = secondAnimState;
}
AnimationState::Render(lastAnimState,&cursorPos,&g_vectorZero,&g_vectorZero);
}
local_78 = local_90 + cursorPos.x;
local_74 = local_94 + cursorPos.y;
sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac);
drawSettingsAlt = 0;
local_ec = 0xffff;
local_e8._red = 0.0;
local_e8._green = 1.0;
local_e8._blue = -NAN;
local_e8._alpha = 0.0;
local_e8._unk = 0;
ehState = 4;
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
pos_01.y = local_74 + 1.0;
pos_01.x = local_78 + 16.0;
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,pos_01,(Vector)0x3f8000003f800000,color_02,
GHIDRA_CAST<FontSettings *>(&drawSettingsAlt));
ehState = 0xffffffff;
cursorPos.x = local_78 - local_90;
local_74 = local_74 - local_94;
local_78 = cursorPos.x;
if (local_b8 != GHIDRA_CAST<Entity_Player *>(0x0)) {
cursorPos.y = local_74 + (float)local_7c;
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat(secondAnimState,15.0);
}
ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero);
local_78 = local_90 + cursorPos.x;
local_74 = local_94 + cursorPos.y;
sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac);
drawSettingsAlt = 0;
local_ec = 0xffff;
local_e8._red = 0.0;
local_e8._green = 1.0;
local_e8._blue = -NAN;
local_e8._alpha = 0.0;
local_e8._unk = 0;
ehState = 5;
(GHIDRA_CAST<KColor *>((&local_40)))->KColor::SetFromARGB(0xffffffff);
pos_02.y = local_74 + 1.0;
pos_02.x = local_78 + 16.0;
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,pos_02,(Vector)0x3f8000003f800000,color_03,
GHIDRA_CAST<FontSettings *>(&drawSettingsAlt));
local_78 = local_78 - local_90;
local_74 = local_74 - local_94;
}
ehState = 0xffffffff;
if (local_98 != GHIDRA_CAST<HUD *>(0x0)) {
cursorPos.y = (float)local_7c + local_74;
cursorPos.x = local_78;
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat(secondAnimState,12.0);
}
ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero);
local_78 = local_90 + cursorPos.x;
local_74 = local_94 + cursorPos.y;
sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac);
drawSettings = 0;
local_108 = 0xffff;
local_104 = 0;
local_100 = 0x3f800000;
local_fc = 0xffffffff;
local_f8 = 0;
local_f4 = 0;
ehState = 6;
(GHIDRA_CAST<KColor *>((&local_e8)))->KColor::SetFromARGB(0xffffffff);
pos_03.y = local_74 + 1.0;
pos_03.x = local_78 + 16.0;
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,pos_03,(Vector)0x3f8000003f800000,color_04,
GHIDRA_CAST<FontSettings *>(&drawSettings));
local_78 = local_78 - local_90;
local_74 = local_74 - local_94;
}
pGVar8 = g_game;
ehState = 0xffffffff;
cursorPos.x = local_78;
cursorPos.y = local_74;
if (((*GHIDRA_CAST<char *>(&g_game->_seedEffects) != '\0') ||
(bVar3 = Seeds::AchievementUnlocksDisallowed(&g_game->_seedEffects), bVar3 != 0)) ||
((bVar3 = Manager::IsGameplayInputActive(unusedArg), bVar3 != 0 ||
((pGVar8->_isRerun != 0 || (isAchievementsDisabled = '\0', pGVar8->_challenge != 0)))))) {
isAchievementsDisabled = '\x01';
}
local_98 = GHIDRA_CAST<HUD *>((pGVar8->_dailyChallenge)._id);
if ((local_98 == GHIDRA_CAST<HUD *>(0x0)) && (pGVar8->_challenge == 0)) {
local_7e = '\0';
}
else {
local_7e = '\x01';
}
iVar4 = pGVar8->_difficulty;
if ((iVar4 == 1) && (local_7e == '\0')) {
isHardMode = '\x01';
LAB_009a4ece:
isGreedMode = '\0';
LAB_009a4ed3:
isInClearedGreedBossRoom = '\0';
}
else {
isHardMode = '\0';
if (((iVar4 != 2) && (iVar4 != 3)) || (1 < *GHIDRA_CAST<int *>(&pGVar8->_deathmatchManager)))
goto LAB_009a4ece;
isGreedMode = '\x01';
currentRoomDesc = (GHIDRA_CAST<Level *>((GHIDRA_CAST<Level *>(pGVar8))))->Level::GetRoomByIdx(pGVar8->_currentRoomIdx,-1);
if (((currentRoomDesc->ListIndex != g_game->_lastBossRoomListIdx) ||
((*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x44)) & 1) == 0)) || (g_game->_stage != 7))
goto LAB_009a4ed3;
isInClearedGreedBossRoom = '\x01';
}
iconFrames = GHIDRA_CAST<uint32_t *>(0x0);
local_c8.x = 0.0;
local_c8.y = 0.0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 7;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0;
msvc::vector<unsigned_int>::_Reallocate(3);
if (isHardMode != '\0') {
local_ac = GHIDRA_CAST<Entity_Player *>(&DAT_00000004);
if (local_c8.x == local_c8.y) {
msvc::vector<unsigned_int>::_Emplace_reallocate(local_c8.x,&local_ac);
}
else {
*GHIDRA_CAST<uint32_t *>(local_c8.x) = 4;
local_c8.x = (float)(GHIDRA_INT(local_c8.x) + 4);
}
}
if (isAchievementsDisabled == '\0') {
if (local_98 != GHIDRA_CAST<HUD *>(0x0)) goto LAB_009a500e;
}
else {
if (local_98 == GHIDRA_CAST<HUD *>(0x0)) {
local_ac = GHIDRA_CAST<Entity_Player *>(&DAT_00000005);
if (local_c8.x != local_c8.y) {
*GHIDRA_CAST<uint32_t *>(local_c8.x) = 5;
local_c8.x = (float)(GHIDRA_INT(local_c8.x) + 4);
goto LAB_009a504a;
}
}
else {
LAB_009a500e:
local_ac = GHIDRA_CAST<Entity_Player *>(&DAT_00000008);
if (local_c8.x != local_c8.y) {
*GHIDRA_CAST<uint32_t *>(local_c8.x) = 8;
local_c8.x = (float)(GHIDRA_INT(local_c8.x) + 4);
goto LAB_009a504a;
}
}
msvc::vector<unsigned_int>::_Emplace_reallocate(local_c8.x,&local_ac);
}
LAB_009a504a:
if (isGreedMode != '\0') {
if (isInClearedGreedBossRoom == '\0') {
local_ac = GHIDRA_CAST<Entity_Player *>((GHIDRA_UINT((g_game->_difficulty == 3)) * 4 + 7));
if (local_c8.x == local_c8.y) goto LAB_009a50b3;
*GHIDRA_CAST<Entity_Player **>(local_c8.x) = local_ac;
local_c8.x = (float)(GHIDRA_INT(local_c8.x) + 4);
}
else {
local_ac = GHIDRA_CAST<Entity_Player *>(&DAT_00000009);
if (local_c8.x == local_c8.y) {
LAB_009a50b3:
msvc::vector<unsigned_int>::_Emplace_reallocate(local_c8.x,&local_ac);
}
else {
*GHIDRA_CAST<uint32_t *>(local_c8.x) = 9;
local_c8.x = (float)(GHIDRA_INT(local_c8.x) + 4);
}
}
}
local_7c = GHIDRA_CAST<Entity_Player *>(g_vectorZero.x);
local_b8 = GHIDRA_CAST<Entity_Player *>(g_vectorZero.y);
local_bc = local_78;
if (iconFrames != GHIDRA_CAST<uint32_t *>(local_c8.x)) {
cursorPos.y = local_74 + 16.0;
fVar10 = (float)(GHIDRA_INT(local_c8.x) - GHIDRA_INT(iconFrames) >> 2);
local_74 = cursorPos.y;
if (fVar10 == 1.4013e-45) {
if ((local_7e == '\0') && ((isGreedMode == '\0' || (6 < g_game->_stage)))) {
local_7c = GHIDRA_CAST<Entity_Player *>(0x40800000);
local_b8 = GHIDRA_CAST<Entity_Player *>(0x0);
}
}
else if (fVar10 == 0.0) goto LAB_009a5258;
local_ac = GHIDRA_CAST<Entity_Player *>((cursorPos.y + (float)local_b8));
local_98 = GHIDRA_CAST<HUD *>(0x0);
pEVar5 = local_7c;
do {
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat
(&(this->_pickupHUDSprite)._animState,(float)GHIDRA_INT(iconFrames[GHIDRA_INT(local_98)]));
pEVar5 = local_7c;
}
local_d4.x = (float)pEVar5 + local_78;
local_d4.y = (float)local_ac;
if ((this->_pickupHUDSprite)._loaded != 0) {
if ((this->_pickupHUDSprite)._overlayRenderFirst == 0) {
AnimationState::Render
(&(this->_pickupHUDSprite)._animState,&local_d4,&g_vectorZero,&g_vectorZero);
secondAnimState = &(this->_pickupHUDSprite)._overlayAnimState;
}
else {
AnimationState::Render
(&(this->_pickupHUDSprite)._overlayAnimState,&local_d4,&g_vectorZero,
&g_vectorZero);
secondAnimState = &(this->_pickupHUDSprite)._animState;
}
AnimationState::Render(secondAnimState,&local_d4,&g_vectorZero,&g_vectorZero);
pEVar5 = local_7c;
}
cursorPos.x = local_78 + 16.0;
local_98 = GHIDRA_CAST<HUD *>((GHIDRA_INT(local_98) + 1));
local_78 = cursorPos.x;
} while (local_98 < GHIDRA_UINT(fVar10));
}
LAB_009a5258:
if (isGreedMode == '\0') {
if (local_7e == '\0') {
if (0 < g_game->_victoryLap) {
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,10.0);
}
ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero);
local_74 = local_94 + cursorPos.y;
sprintf_s(&DAT_00c94328,0x10,s__d);
drawSettings = 0;
local_108 = 0xffff;
local_104 = 0;
local_100 = 0x3f800000;
local_fc = 0xffffffff;
local_f8 = 0;
local_f4 = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xb;
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,color_08,&drawSettings,
local_90 + cursorPos.x + 18.0,local_74);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 7;
fVar10 = local_74 - local_94;
cursorPos.y = fVar10;
goto LAB_009a5660;
}
}
else {
pbVar6 = (this->_pickupHUDSprite)._animState._animData;
if (pbVar6 == GHIDRA_CAST<uint8_t *>(0x0)) {
LAB_009a54b9:
bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,GHIDRA_CAST<uint8_t *>("Destination"),1);
if (bVar3 != 0) {
AnimationState::Rewind(&(this->_pickupHUDSprite)._animState);
(this->_pickupHUDSprite)._animState._isPlaying = 1;
}
}
else {
animNameCursor = pbVar6;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar6 + 0x14))) {
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar6);
}
destinationCursor = "Destination";
do {
bVar3 = *animNameCursor;
isLess = bVar3 < (uint8_t)*destinationCursor;
if (bVar3 != *destinationCursor) {
LAB_009a5498:
uVar7 = -GHIDRA_UINT(isLess) | 1;
goto LAB_009a549d;
}
if (bVar3 == 0) break;
bVar3 = animNameCursor[1];
isLess = bVar3 < (uint8_t)destinationCursor[1];
if (bVar3 != destinationCursor[1]) goto LAB_009a5498;
animNameCursor = animNameCursor + 2;
destinationCursor = destinationCursor + 2;
} while (bVar3 != 0);
uVar7 = 0;
LAB_009a549d:
if ((uVar7 != 0) ||
((pbVar6[0x34] != 0 && ((this->_pickupHUDSprite)._animState._isPlaying == 0))))
goto LAB_009a54b9;
}
challengeParams = Game::GetChallengeParams(g_game);
if (challengeParams->_isMegaSatan == 0) {
iVar4 = challengeParams->_pathType;
if (iVar4 == 3) {
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
fVar10 = 12.0;
goto LAB_009a55b3;
}
}
else if (challengeParams->_endStage == 0xc) {
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
fVar10 = 9.0;
goto LAB_009a55b3;
}
}
else {
switch(challengeParams->_endStage) {
case 6:
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
fVar10 = 0.0;
goto LAB_009a55b3;
}
break;
case 8:
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
destinationFrame = 1;
if (iVar4 == 2) {
destinationFrame = 0xb;
}
LAB_009a55b0:
fVar10 = (float)destinationFrame;
goto LAB_009a55b3;
}
break;
case 10:
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
destinationFrame = 3 - GHIDRA_UINT((iVar4 != 1));
goto LAB_009a55b0;
}
break;
case 0xb:
if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
destinationFrame = 5 - GHIDRA_UINT((iVar4 != 1));
goto LAB_009a55b0;
}
}
}
}
else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) {
fVar10 = 6.0;
LAB_009a55b3:
AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar10);
}
local_a8.y = (float)local_b8 + local_74;
local_a8.x = (float)local_7c + local_78;
ANM2::Render(&this->_pickupHUDSprite,&local_a8,&g_vectorZero,&g_vectorZero);
pbVar6 = (this->_pickupHUDSprite)._animState._animData;
if (pbVar6 != GHIDRA_CAST<uint8_t *>(0x0)) {
animNameCursor = pbVar6;
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar6 + 0x14))) {
animNameCursor = *GHIDRA_CAST<uint8_t **>(pbVar6);
}
idleCursor = s_Idle;
do {
bVar3 = *animNameCursor;
isLess = bVar3 < *idleCursor;
if (bVar3 != *idleCursor) {
LAB_009a5637:
uVar7 = -GHIDRA_UINT(isLess) | 1;
goto LAB_009a563c;
}
if (bVar3 == 0) break;
bVar3 = animNameCursor[1];
isLess = bVar3 < idleCursor[1];
if (bVar3 != idleCursor[1]) goto LAB_009a5637;
animNameCursor = animNameCursor + 2;
idleCursor = idleCursor + 2;
} while (bVar3 != 0);
uVar7 = 0;
LAB_009a563c:
if ((uVar7 == 0) &&
((pbVar6[0x34] == 0 || ((this->_pickupHUDSprite)._animState._isPlaying != 0))))
goto LAB_009a565b;
}
bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,s_Idle,1);
if (bVar3 != 0) {
AnimationState::Rewind(&(this->_pickupHUDSprite)._animState);
(this->_pickupHUDSprite)._animState._isPlaying = 1;
}
}
LAB_009a565b:
fVar10 = local_74;
goto LAB_009a5660;
}
local_90 = local_90 + local_78;
local_74 = local_94 + local_74;
if (g_game->_stage < 7) {
sprintf_s(&DAT_00c94328,0x10,GHIDRA_CAST<uint8_t *>("%d/%d"));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 8;
LAB_009a5404:
local_f4 = 0;
local_f8 = 0;
local_fc = 0xffffffff;
local_100 = 0x3f800000;
local_104 = 0;
local_108 = 0xffff;
drawSettings = 0;
(GHIDRA_CAST<KColor *>((&local_120)))->KColor::SetFromARGB(0xffffffff);
Font::DrawString(GHIDRA_CAST<Font *>(local_8c),&DAT_00c94328,color_07,&drawSettings,local_90 + 4.0,local_74);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 7;
}
else if (isInClearedGreedBossRoom != '\0') {
data = &g_manager->_persistentGameData;
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
local_130.y = (float)g_userProfile;
local_130.x = (float)KAGE::System::UserProfile::vftable;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 9;
if (g_userProfile == (void *)0x0) {
local_a8.y = 0.0;
local_a8.x = 0.0;
}
else {
local_a8.x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_userProfile) + 8));
local_a8.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_userProfile) + 0xc));
}
profileData = GHIDRA_CAST<PersistentGameData *>(FUN_0090c300(&local_a8));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 7;
if (profileData != GHIDRA_CAST<PersistentGameData *>(0x0)) {
data = profileData;
}
}
pEVar5 = Game::GetPlayer(g_game,0);
(GHIDRA_CAST<Entity_Player *>((pEVar5)))->Entity_Player::GetGreedDonationJamChance(data);
sprintf_s(&DAT_00c94328,0x10,&DAT_00b6d148);
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 10;
goto LAB_009a5404;
}
fVar10 = local_74 - local_94;
cursorPos.y = local_74 - local_94;
LAB_009a5660:
cursorPos.x = local_bc;
if (isStatHudHidden == '\0') {
local_a8.y = fVar10 + 16.0;
local_a8.x = local_bc + 0.0;
StatHUD::Render(&local_a8);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0xffffff;
if (iconFrames != GHIDRA_CAST<uint32_t *>(0x0)) {
uVar7 = (GHIDRA_INT(local_c8.y) - GHIDRA_INT(iconFrames) >> 2) * 4;
ptr = iconFrames;
if (0xfff < uVar7) {
ptr = GHIDRA_CAST<uint32_t *>(iconFrames[-1]);
uVar7 = uVar7 + 0x23;
if (0x1f < GHIDRA_UINT((GHIDRA_INT(iconFrames) + (-4 - GHIDRA_INT(ptr))))) {
LAB_009a56f1:
/* WARNING: Subroutine does not return */
_invalid_parameter_noinfo_noreturn();
}
}
operator_delete(ptr,uVar7);
}
render_streak_texts(this);
local_7c = GHIDRA_CAST<Entity_Player *>(0x0);
uVar7 = 0;
local_8c = GHIDRA_CAST<Game *>(this);
do {
pGVar8 = local_8c;
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
LAB_009a5887:
if (*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<HUD *>(pGVar8))->_playerHUD) != GHIDRA_CAST<Entity_Player *>(0x0)) {
iVar4 = GetPlayerHUDLayout(this,uVar7,*GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<HUD *>(pGVar8))->_playerHUD));
render_player_hud(this,uVar7,iVar4);
pGVar8 = local_8c;
if (uVar7 < 4) {
local_7c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_7c) + 1));
}
}
}
else {
uVar12 = FUN_009a84c0();
pGVar8 = GHIDRA_CAST<Game *>(((uint64_t)uVar12 >> 0x20));
if (((GHIDRA_INT(uVar12) != 3) || (uVar7 == 0)) || (uVar7 == 4)) goto LAB_009a5887;
}
uVar7 = uVar7 + 1;
local_8c = GHIDRA_CAST<Game *>(((GHIDRA_CAST<HUD *>(pGVar8))->_playerHUD + 0x6dc));
} while (uVar7 < 8);
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
local_b8 = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x8bc))));
local_120._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable;
local_120._alpha = 0.0;
local_120._unk = 0;
ehState = 0xc;
(GHIDRA_CAST<msvc::shared_ptr *>((&local_120._alpha)))->msvc::shared_ptr::assign(&g_multiplayerLobbyPtr);
local_120._blue = (float)KAGE::Network::Multiplayer::Lobby::vftable;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0;
local_8c = GHIDRA_CAST<Game *>(0x0);
while ((((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xd, local_120._alpha != 0.0 &&
(local_8c <
GHIDRA_CAST<Font *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_120._alpha) + 0x14)) -
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_120._alpha) + 0x10)) >> 3)))) && (local_7c < 4))) {
local_d4.x = (float)KAGE::System::UserProfileBase::vftable;
UserProfile::find_or_create
((void *)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_120._alpha) + 0x10)) + GHIDRA_INT(local_8c) * 8));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xe;
local_d4.x = (float)KAGE::System::UserProfile::vftable;
local_d4.y = (float)extraout_EAX;
if (((extraout_EAX != GHIDRA_CAST<Entity_Player *>(0x0)) &&
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((extraout_EAX)) + 0x8)))) != 0 || *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((extraout_EAX)) + 0xc)))) != 0)) &&
(extraout_EAX->_pendingDamage == 0.0)) {
(GHIDRA_CAST<KAGE::System::UserProfile *>((&local_d4)))->KAGE::System::UserProfile::load_steam_avatar();
}
fVar10 = local_d4.y;
if (GHIDRA_CAST<Entity_Player *>(local_d4.y) == GHIDRA_CAST<Entity_Player *>(0x0)) {
local_a8.x = 0.0;
local_a8.y = 0.0;
VVar2 = local_a8;
local_a8.y = 0.0;
local_a8.x = 0.0;
userId = local_a8.x;
local_ac = GHIDRA_CAST<Entity_Player *>(local_a8.y);
local_a8 = VVar2;
}
else {
userId = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_d4.y) + 8));
local_ac = *GHIDRA_CAST<Entity_Player **>((GHIDRA_CAST<char *>(local_d4.y) + 0xc));
}
pEVar5 = PlayerManager::get_player_by_user_id
(GHIDRA_CAST<PlayerManager *>(&g_manager->_netplayManager),GHIDRA_CAST<uint64_t *>(&userId));
if (pEVar5 == GHIDRA_CAST<Entity_Player *>(0x0)) {
local_40._unk = 0xf;
local_40._alpha = 1.12104e-44;
statusText = GHIDRA_CAST<uint8_t *******>(0x4c204e49);
local_40._red = (float)0x5942424f;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40._green)) + 0x0))) = 0;
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),0x10);
if (GHIDRA_CAST<Entity_Player *>(fVar10) == GHIDRA_CAST<Entity_Player *>(0x0)) {
local_a8.x = 0.0;
local_a8.y = 0.0;
VVar2 = local_a8;
local_a8.y = 0.0;
local_a8.x = 0.0;
lobbyUserId = local_a8.x;
fVar10 = local_a8.y;
local_a8 = VVar2;
}
else {
lobbyUserId = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar10) + 8));
fVar10 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar10) + 0xc));
}
local_bc = fVar10;
local_98 = GHIDRA_CAST<HUD *>(lobbyUserId);
FUN_00731ee0(lobbyFindResult,&lobbyUserId);
if ((((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_130.y) + 0xd)) == '\0') &&
(GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_130.y) + 0x14))) <= GHIDRA_UINT(fVar10))) &&
((GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_130.y) + 0x14))) < GHIDRA_UINT(fVar10) ||
(GHIDRA_UINT(*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_130.y) + 0x10))) <= local_98)))) &&
((void *)local_130.y != *(void **)local_b8)) {
local_40._alpha = 9.80909e-45;
memmove(&statusText,"WAITING",7);
local_40._red = (float)(GHIDRA_UINT(local_40._red) & 0xffffff);
uVar7 = g_manager->_framecount & 0x78;
if (0x1d < uVar7) {
if (uVar7 < 0x3c) {
iVar4 = 1;
}
else {
if (0x59 < uVar7) goto LAB_009a5af4;
iVar4 = 2;
}
do {
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&statusText))))->msvc::string::append(&DAT_00b1cebc,1);
iVar4 = iVar4 + -1;
} while (iVar4 != 0);
}
}
LAB_009a5af4:
pEVar5 = local_7c;
get_player_hud_position(this,&local_128,GHIDRA_INT(local_7c),4);
render_player_net_status
(this,GHIDRA_INT(pEVar5),KAGE::System::UserProfile::vftable,(void *)local_d4.y,
local_128.x,local_128.y);
temp_3fc998231f = g_manager;
fVar10 = local_128.y + 8.0;
drawSettings = 0;
local_108 = 0xffff;
local_104 = 0;
local_100 = 0x3f800000;
local_fc = 0xffffffff;
local_f8 = 0;
local_f4 = 0;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0x11;
local_128.y = fVar10;
(GHIDRA_CAST<KColor *>((&local_e8)))->KColor::SetFromARGB(0xffffffff);
statusTextBuf = GHIDRA_CAST<uint8_t *******>(&statusText);
if (0xf < GHIDRA_UINT(local_40._unk)) {
statusTextBuf = statusText;
}
pos_04.y = fVar10 - 14.0;
pos_04.x = local_128.x;
Font::DrawString(&temp_3fc998231f->_font1_TeamMeatEx10,GHIDRA_CAST<uint8_t *>(statusTextBuf),pos_04,
(Vector)0x3f8000003f800000,color_05,GHIDRA_CAST<FontSettings *>(&drawSettings));
local_7c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_7c) + 1));
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xf;
if (0xf < GHIDRA_UINT(local_40._unk)) {
uVar7 = local_40._unk + 1;
statusTextBuf = statusText;
if (0xfff < uVar7) {
statusTextBuf = GHIDRA_CAST<uint8_t *******>(statusText[-1]);
uVar7 = local_40._unk + 0x24;
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(statusText) + (-4 - GHIDRA_INT(statusTextBuf)))))
goto LAB_009a56f1;
}
operator_delete(statusTextBuf,uVar7);
}
local_40._alpha = 0.0;
local_40._unk = 0xf;
statusText = GHIDRA_CAST<uint8_t *******>((GHIDRA_UINT(statusText) & 0xffffff00));
}
local_8c = GHIDRA_CAST<Game *>((GHIDRA_INT(local_8c) + 1));
local_d4.x = (float)KAGE::System::UserProfileBase::vftable;
}
local_120._blue = (float)KAGE::Network::Multiplayer::ConstLobby::vftable;
ehState = 0x12;
if (((GHIDRA_CAST<int *>(local_120._unk) != GHIDRA_CAST<int *>(0x0)) &&
(isLastRef = (**(code **)(*GHIDRA_CAST<int *>(local_120._unk) + 0xc))(), isLastRef != '\0')) &&
(g_lobbyReleaseFn != (void *)0x0)) {
(*g_lobbyReleaseFn)(&local_120._alpha);
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xff;
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0xffffff;
}
local_ac = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5954))));
local_bc = 0.0;
local_8c = g_game;
pGVar8 = g_game;
do {
fVar10 = local_bc;
if ((-1 < *GHIDRA_CAST<int *>((GHIDRA_INT(&(pGVar8->_playerManager)._coopSlots[0]._controllerIndex) + GHIDRA_INT(local_bc)
))) &&
(-1 < *GHIDRA_CAST<int *>((GHIDRA_INT(&(pGVar8->_playerManager)._coopSlots[0]._state) + GHIDRA_INT(local_bc))))) {
local_94 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_ac)) + 0x0))));
local_90 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_ac)) + 0x4))));
local_a8.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_ac)) + 0x0))));
local_a8.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_ac)) + 0x4))));
if (local_94 < 0.0) {
local_94 = local_94 + g_screenWidth;
local_a8.x = local_94;
}
if (local_90 < 0.0) {
local_90 = local_90 + g_screenHeight;
local_a8.y = local_90;
}
portraitAlpha =
*GHIDRA_CAST<float *>((GHIDRA_INT(&(pGVar8->_playerManager)._coopSlots[0]._menuPosition) + GHIDRA_INT(local_bc)));
portraitEnd = portraitAlpha + 1.0;
local_78 = (float)GHIDRA_INT(portraitEnd);
portraitEnd = (float)GHIDRA_INT(portraitEnd);
local_7c = GHIDRA_CAST<Entity_Player *>(GHIDRA_INT((portraitAlpha - 1.0)));
if (GHIDRA_INT(local_7c) <= GHIDRA_INT(portraitEnd)) {
do {
fVar11 = (float)GHIDRA_INT(local_7c) -
*GHIDRA_CAST<float *>((GHIDRA_INT(&(pGVar8->_playerManager)._coopSlots[0]._menuPosition) +
GHIDRA_INT(fVar10)));
local_74 = fVar11 * 24.0;
fVar11 = ABS(fVar11);
portraitAlpha = 1.0 - fVar11 * 0.5;
piVar9 = GHIDRA_CAST<int *>((1.0 - fVar11 * 0.25));
local_98 = GHIDRA_CAST<HUD *>(0.0);
if (0.0 <= portraitAlpha) {
local_98 = GHIDRA_CAST<HUD *>(portraitAlpha);
}
local_b8 = GHIDRA_CAST<Entity_Player *>(GHIDRA_CAST<int *>(0x3f000000));
if (0.5 <= (float)piVar9) {
local_b8 = GHIDRA_CAST<Entity_Player *>(piVar9);
}
if (0.0 < (float)local_98) {
pvVar1 = (pGVar8->_playerManager)._coopPlayerTypes._begin;
uVar7 = GHIDRA_INT((pGVar8->_playerManager)._coopPlayerTypes._end) - GHIDRA_INT(pvVar1) >> 2;
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + ((GHIDRA_INT(local_7c) + uVar7) % uVar7) * 4));
coopPlayerType = iVar4;
if (iVar4 < 0x29) {
if (((this->_coopMenuSprite)._animState._animData != (void *)0x0) &&
((0 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_coopMenuSprite)._animState._animation) + 0x80)) ||
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
0 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_coopMenuSprite)._animState._animation) + 0x80)))))) {
pvVar1 = (this->_coopMenuSprite)._animState._animData;
local_128.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar1) + 0x38));
if ((pvVar1 == (void *)0x0) ||
((GHIDRA_INT(local_128.y) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x1c)) <= GHIDRA_INT(local_128.y))))) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
}
*(uint32_t *)
(GHIDRA_INT((this->_coopMenuSprite)._animState._layerFrames) + GHIDRA_INT(local_128.y) * 4) = 0;
AnimationState::AdvanceLayerPosition
(&(this->_coopMenuSprite)._animState,GHIDRA_INT(local_128.y),
(float)(coopPlayerType + 1));
}
(this->_coopMenuSprite)._color._tint[3] = (float)local_98;
fVar10 = (float)local_b8 * g_vectorOne.y;
(this->_coopMenuSprite)._scale.x = (float)local_b8 * g_vectorOne.x;
local_130.x = local_74 + local_94;
(this->_coopMenuSprite)._scale.y = fVar10;
pvVar1 = (this->_coopMenuSprite)._animState._animData;
local_130.y = local_90 + 0.0;
if (((pvVar1 != (void *)0x0) &&
(animation = (this->_coopMenuSprite)._animState._animation,
0 < animation->_layerCount)) && (iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x38)), -1 < iVar4)
) {
AnimationLayer::RenderFrame
(GHIDRA_CAST<AnimationLayer *>((iVar4 * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x18)))),
&local_130,
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_coopMenuSprite)._animState._layerFrames) + iVar4 * 4
)),&g_vectorZero,&g_vectorZero,animation);
}
}
else {
(GHIDRA_CAST<Color *>((GHIDRA_CAST<Color *>(local_70))))->Color::Reset();
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0xc))) = local_98;
portraitScaleX.x = (float)local_b8 * g_vectorOne.x;
portraitScaleX.y = (float)local_b8 * g_vectorOne.y;
local_c8.x = local_74 + local_94;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x0))) = 1.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x4))) = 1.0;
local_c8.y = local_90 + 0.0;
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_70)) + 0x8))) = 1.0;
render_modded_coop_portrait(iVar4,&local_c8,&portraitScaleX,GHIDRA_CAST<ColorMod *>(local_70));
}
pGVar8 = local_8c;
portraitEnd = local_78;
fVar10 = local_bc;
}
local_7c = GHIDRA_CAST<Entity_Player *>((GHIDRA_INT(local_7c) + 1));
} while (GHIDRA_INT(local_7c) <= GHIDRA_INT(portraitEnd));
pGVar8 = g_game;
}
(this->_coopMenuSprite)._color._tint[3] = 1.0;
(this->_coopMenuSprite)._scale.x = g_vectorOne.x;
(this->_coopMenuSprite)._scale.y = g_vectorOne.y;
if ((this->_coopMenuSprite)._overlayAnimState._animData != (void *)0x0) {
AnimationState::SetFrameFloat
(&(this->_coopMenuSprite)._overlayAnimState,
(float)(9 < pGVar8->_frameCount % 0x14));
}
AnimationState::Render
(&(this->_coopMenuSprite)._overlayAnimState,&local_a8,&g_vectorZero,&g_vectorZero);
local_8c = g_game;
pGVar8 = g_game;
}
local_bc = (float)(GHIDRA_INT(fVar10) + 0x14);
local_ac = GHIDRA_CAST<Entity_Player *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_ac)) + 0x8))));
} while (GHIDRA_UINT(local_bc) < 0x50);
barPos.y = cursorPos.y;
barPos.x = cursorPos.x;
render_boss_health_bar(this,barPos);
ExceptionList = savedExceptionList;
return;
}
// 009a6140
Vector * HUD::get_player_hud_position(Vector *outPosition, int hudIndex, int layout)
{
int iVar1;
float fVar2;
float posY;
iVar1 = hudIndex * 0x6dc;
fVar2 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>((&this->_poopSpellsSprite + 1)) + hudIndex * 8 + 0x28));
outPosition->y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>((&this->_poopSpellsSprite + 1)) + hudIndex * 8 + 0x2c));
outPosition->x = fVar2;
if ((*GHIDRA_CAST<short *>((this->_playerHUD + iVar1 + 8)) < 4) ||
(*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((this->_playerHUD + iVar1)) + 0x20a9)) != '\0')) {
LAB_009a61ba:
if (((layout != 3) || (*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((this->_playerHUD + iVar1)) + 0x20a9)) != '\0')) ||
((hudIndex != 2 && (((hudIndex != 3 && (hudIndex != 6)) && (hudIndex != 7))))))
goto LAB_009a6204;
fVar2 = outPosition->y - (*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5994)))) * 6.0 + 16.0);
}
else {
if (layout != 1) {
outPosition->x = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>((&this->_poopSpellsSprite + 1)) + hudIndex * 8 + 8));
outPosition->y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>((&this->_poopSpellsSprite + 1)) + hudIndex * 8 + 0xc));
goto LAB_009a61ba;
}
fVar2 = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5950)))) - 33.0;
outPosition->x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x594c)))) - 64.0;
}
outPosition->y = fVar2;
LAB_009a6204:
fVar2 = outPosition->x;
if (fVar2 < 0.0) {
fVar2 = fVar2 + g_screenWidth;
outPosition->x = fVar2;
}
posY = outPosition->y;
if (posY < 0.0) {
posY = posY + g_screenHeight;
outPosition->y = posY;
}
if ((((hudIndex & 1U) != 0) && (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1)))) &&
((*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2 && ((g_manager->_optionsConfig)._onlineHud == 1)))) {
fVar2 = fVar2 + 24.0;
outPosition->x = fVar2;
}
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) {
if ((hudIndex & 1U) == 0) {
fVar2 = fVar2 + 12.0;
}
else {
fVar2 = fVar2 - 12.0;
}
outPosition->x = fVar2;
}
iVar1 = *GHIDRA_CAST<int *>((this->_playerHUD + iVar1));
if (((iVar1 != 0) && (1 < GHIDRA_UINT(hudIndex))) && (*GHIDRA_CAST<char *>((iVar1 + 0x20a9)) == '\0')) {
iVar1 = *GHIDRA_CAST<int *>((iVar1 + 0x13c0));
if (iVar1 == 0x15) {
outPosition->y = outPosition->y - 22.0;
}
else {
if (iVar1 == 0x19) {
outPosition->y = posY - 22.0;
return outPosition;
}
if (iVar1 == 0x17) {
outPosition->y = posY - 18.0;
return outPosition;
}
}
}
return outPosition;
}
// 009a64f0
int HUD::GetPlayerHudIndex(Entity_Player *player)
{
uint32_t hudIndex;
Entity_Player *mainPlayer;
if (player == GHIDRA_CAST<Entity_Player *>(0x0)) {
KAGE_LogMessage(8,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<HUD *>(()))->HUD::GetPlayerHudIndex() recieved NULL player entity! \n"));
hudIndex = 0xffffffff;
}
else {
mainPlayer = GHIDRA_CAST<Entity_Player *>(player->_twinPlayer);
if (((mainPlayer == GHIDRA_CAST<Entity_Player *>(0x0)) || (mainPlayer->_playerIndex == -1)) ||
(player->_playerIndex <= mainPlayer->_playerIndex)) {
mainPlayer = player;
}
hudIndex = 0;
while (*GHIDRA_CAST<Entity_Player **>(this->_playerHUD) != mainPlayer) {
hudIndex = hudIndex + 1;
this = GHIDRA_CAST<HUD *>((this->_playerHUD + 0x6dc));
if (3 < hudIndex) {
KAGE_LogMessage(4,(uint8_t *)
"(GHIDRA_CAST<HUD *>(()))->HUD::GetPlayerHudIndex() could not for a Player HUD for the giveiten player entity \n"
);
return -1;
}
}
}
return hudIndex;
}
// 009a6570
int HUD::GetPlayerHUDLayout(int playerHudIndex, Entity_Player *player)
{
int iVar1;
uint8_t hudCount;
int layout;
bool isCompactOnlineHud;
layout = g_manager->_netplayManager;
iVar1 = *GHIDRA_CAST<int *>((g_manager + 1));
if (layout == iVar1) {
LAB_009a65a9:
isCompactOnlineHud = false;
if ((layout != iVar1) || ((playerHudIndex != 0 && (playerHudIndex != 4)))) {
LAB_009a661a:
if ((player == GHIDRA_CAST<Entity_Player *>(0x0)) ||
((player->_playerType != 0x13 && (player->_playerType != 0x14)))) {
return 2;
}
hudCount = count_player_huds(this);
if (2 < hudCount) {
return 3;
}
goto joined_r0x009a663e;
}
}
else {
if (1 < *GHIDRA_CAST<int *>(&g_game->_deathmatchManager)) goto LAB_009a661a;
if ((g_manager->_optionsConfig)._onlineHud != 3) goto LAB_009a65a9;
isCompactOnlineHud = true;
}
if ((player == GHIDRA_CAST<Entity_Player *>(0x0)) ||
((player->_playerType != 0x13 && (player->_playerType != 0x14)))) {
if (isCompactOnlineHud) {
return 0;
}
layout = 0;
hudCount = count_player_huds(this);
if (2 < hudCount) {
layout = 2;
}
return layout;
}
if (isCompactOnlineHud) {
return 1;
}
hudCount = count_player_huds(this);
if (3 < hudCount) {
return 3;
}
joined_r0x009a663e:
if (layout == iVar1) {
return 1;
}
return 3;
}
// 009a6a70
void HUD::render_streak_texts()
{
HUD *mainAnimState = this;
char *pcVar1;
uint8_t bVar2;
int iVar3;
int *controllerIdPtr;
uint32_t uVar4;
uint32_t uVar5;
AnimationState *laterAnimState;
float *nullFrame;
uint32_t i;
char *message;
uint8_t *puVar6;
HUD *pHVar7;
float fVar8;
Vector textPos;
HUD *hud;
HUD *local_b8;
Vector local_b4;
float centerX;
Vector local_a8;
KColor color;
uint8_t quad [124];
bool isJacobOrEsau;
AnimationState *mainAnimState;
int texHeight;
centerX = g_screenWidth * 0.5;
pHVar7 = GHIDRA_CAST<HUD *>(0x42400000);
local_b8 = GHIDRA_CAST<HUD *>(0x42400000);
hud = mainAnimState;
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((mainAnimState)) + 0x3ce4))) != '\0') {
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((mainAnimState)) + 0x3ce5))) == '\0') {
local_b4.y = g_screenHeight - 48.0;
}
else {
local_b4.y = 48.0;
}
textPos.y = local_b4.y;
textPos.x = centerX;
local_b4.x = centerX;
FUN_00840e10(centerX,local_b4.y);
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((mainAnimState)) + 0x3ce5))) == '\0') {
pHVar7 = GHIDRA_CAST<HUD *>(0x42a60000);
local_b8 = GHIDRA_CAST<HUD *>(0x42a60000);
}
else {
pHVar7 = GHIDRA_CAST<HUD *>(0x42400000);
}
}
i = 0;
puVar6 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((mainAnimState)) + 0x3ed0)));
do {
if (puVar6[8] != '\0') {
textPos.x = centerX + 0.0;
textPos.y = (float)((double)GHIDRA_INT(i) + __uint_to_double_fixup[-(GHIDRA_INT(i) >> 0x1f)]) * 35.0 +
(float)pHVar7;
FUN_00840e10(textPos.x,textPos.y);
}
i = i + 1;
puVar6 = puVar6 + 500;
pHVar7 = local_b8;
} while (i < 6);
i = 0;
local_a8.x = (float)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((hud)) + 0x4a90)));
pHVar7 = hud;
local_b8 = hud;
do {
message = GHIDRA_CAST<char *>(local_a8.x);
fVar8 = 35.0;
if (*GHIDRA_CAST<char *>(local_a8.x) != '\0') {
if (*GHIDRA_CAST<int *>(local_b8->_playerHUD) == 0) {
(GHIDRA_CAST<HUD_Message *>((GHIDRA_CAST<HUD_Message *>((GHIDRA_INT(local_a8.x) + -8)))))->HUD_Message::free_text_buffers();
*message = '\0';
}
else {
get_player_hud_position(pHVar7,&textPos,i,2);
iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(local_b8->_playerHUD) + 0x13c0));
if ((iVar3 == 0x13) || (iVar3 == 0x14)) {
isJacobOrEsau = true;
}
else {
isJacobOrEsau = false;
}
if (i < 2) {
iVar3 = 0x23;
if (isJacobOrEsau) {
iVar3 = 0x41;
}
textPos.y = (float)iVar3 + textPos.y;
if (i != 0) goto LAB_009a6dfc;
LAB_009a6c53:
textPos.x = textPos.x + fVar8;
}
else {
iVar3 = 0x1e;
if (isJacobOrEsau) {
iVar3 = 0x32;
}
textPos.y = textPos.y - (float)iVar3;
LAB_009a6dfc:
if (i == 2) goto LAB_009a6c53;
textPos.x = textPos.x + 20.0;
}
iVar3 = 0;
controllerIdPtr = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_game->_playerManager))) + 0x60))));
do {
if (*controllerIdPtr == *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(local_b8->_playerHUD) + 0x1618)))
goto LAB_009a6c87;
iVar3 = iVar3 + 1;
controllerIdPtr = controllerIdPtr + 1;
} while (iVar3 < 4);
iVar3 = 5;
LAB_009a6c87:
PlayerManager::GetPlayerColorValue(&color,iVar3);
uVar4 = __ftoui3();
iVar3 = __ftoui3();
uVar5 = __ftoui3();
local_b4.x = (float)(((uVar4 & 0xff | iVar3 << 8) << 8 | uVar5 & 0xff) << 8);
bVar2 = __ftoui3();
message = GHIDRA_CAST<char *>(local_a8.x);
color._red = ((float)(uVar4 & 0xff) + 0.0) / 255.0;
color._green = ((float)(uVar5 & 0xff) + 0.0) / 255.0;
color._blue = ((float)bVar2 + 0.0) / 255.0;
color._alpha = ((float)((iVar3 << 8 & 0xffffU) >> 8) + 0.0) / 255.0;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_a8.x) + 300)) = color._red;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_a8.x) + 0x130)) = color._green;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_a8.x) + 0x134)) = color._blue;
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_a8.x) + 0x138)) = color._alpha;
pcVar1 = GHIDRA_CAST<char *>((GHIDRA_INT(local_a8.x) + 0x13c));
pcVar1[0] = '\0';
pcVar1[1] = '\0';
pcVar1[2] = '\0';
pcVar1[3] = '\0';
FUN_00840e10(textPos.x,textPos.y);
}
pHVar7 = hud;
}
i = i + 1;
local_b8 = GHIDRA_CAST<HUD *>((local_b8->_playerHUD + 0x6dc));
local_a8.x = (float)(message + 500);
if (3 < i) {
if (((pHVar7->_fortuneSprite)._animState._animData != (void *)0x0) &&
((pHVar7->_fortuneSprite)._animState._isPlaying != 0)) {
textPos.x = centerX;
textPos.y = 64.0;
if ((pHVar7->_fortuneSprite)._loaded != 0) {
mainAnimState = &(pHVar7->_fortuneSprite)._animState;
laterAnimState = &(pHVar7->_fortuneSprite)._overlayAnimState;
if ((pHVar7->_fortuneSprite)._overlayRenderFirst == 0) {
AnimationState::Render(mainAnimState,&textPos,&g_vectorZero,&g_vectorZero);
}
else {
AnimationState::Render(laterAnimState,&textPos,&g_vectorZero,&g_vectorZero);
laterAnimState = mainAnimState;
}
AnimationState::Render(laterAnimState,&textPos,&g_vectorZero,&g_vectorZero);
pHVar7 = hud;
}
if ((pHVar7->_fortuneSprite)._animState._animData == (void *)0x0) {
nullFrame = GHIDRA_CAST<float *>(0x0);
}
else {
nullFrame = AnimationState::GetNullFrameById(&(pHVar7->_fortuneSprite)._animState,0);
pHVar7 = hud;
}
color._unk = 0;
iVar3 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pHVar7)) + 0x536c)))) + 0x10));
texHeight = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pHVar7)) + 0x536c)))) + 0x14));
local_b4.x = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) *
nullFrame[4];
local_b4.y = (float)((double)texHeight + __uint_to_double_fixup[-(texHeight >> 0x1f)]) *
nullFrame[5];
local_a8.x = ((textPos.x + *nullFrame) - local_b4.x * 0.5) + (g_game->_screenShakeOffset).x;
local_a8.y = ((textPos.y + nullFrame[1]) - 16.0) + (g_game->_screenShakeOffset).y;
color._red = 1.0;
color._green = 1.0;
color._blue = 1.0;
color._alpha = 1.0;
render_quad_set_rect(quad,&local_a8,&local_b4,&color);
(**(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((hud)) + 0x536c)))) + 0x1c))(quad,g_drawRectUnset);
}
return;
}
} while( true );
}
// 009a6fe0
void HUD::render_player_hud(int playerHudIdx, int hudLayout)
{
void *pvVar1;
Vector pos;
char cVar2;
int iVar3;
PlayerHUD *this_00;
uint32_t trinketSlot;
float fVar4;
Vector *alpha;
float fVar5;
float unused;
Vector *local_40;
int *trinketEntry;
float local_38;
int *trinketEntrySmall;
Vector local_30;
Vector local_28;
Vector hudPos;
Vector trinket1Pos;
Vector heartsExtent;
bool isAnyTrinketDrawn;
bool isNetplayCompactHud;
void *twinPlayer;
get_player_hud_position(this,&hudPos,playerHudIdx,hudLayout);
this_00 = GHIDRA_CAST<PlayerHUD *>((this->_playerHUD + playerHudIdx * 0x6dc));
local_30.x = (float)GHIDRA_UINT((uint16_t)this_00->_playerHudIndex);
pvVar1 = this_00->_player;
if (pvVar1 == (void *)0x0) {
return;
}
local_28.x = local_30.x;
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
(((((twinPlayer = *(void **)(GHIDRA_CAST<char *>(pvVar1) + 0x1e68), twinPlayer == (void *)0x0 ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twinPlayer) + 0x161c)) == -1)) ||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x161c)) <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twinPlayer) + 0x161c)))) ||
(twinPlayer == pvVar1)) &&
(iVar3 = FUN_0090b010(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar1) + 0x1618))), iVar3 != 0)))) {
render_player_net_status
(this,playerHudIdx,KAGE::System::UserProfile::vftable,*(void **)(iVar3 + 0x374),
hudPos.x,hudPos.y);
}
pos.y = hudPos.y;
pos.x = hudPos.x;
PlayerHUD::RenderHearts(this_00,&heartsExtent,&this->_heartsSprite,hudLayout,1.0,pos);
if (((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
(*GHIDRA_CAST<int *>(&g_game->_deathmatchManager) < 2)) &&
(((g_manager->_optionsConfig)._onlineHud == 2 && ((playerHudIdx != 0 && (playerHudIdx != 4)))))
) {
return;
}
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x2c)) != 0) {
return;
}
fVar4 = 1.0;
local_40 = GHIDRA_CAST<Vector *>(0x3f800000);
local_38 = 1.0;
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x13c0)) == 0x13) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x13c0)) == 0x14)) {
if ((g_manager->_optionsConfig)._jacobEsauControls == 0) {
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x1e68)) != 0) {
local_38 = *GHIDRA_CAST<float *>(&this_00[1]._playerHudIndex) * 0.7;
local_40 = GHIDRA_CAST<Vector *>((1.0 - local_38));
local_38 = local_38 + 0.3;
}
}
else {
fVar5 = *GHIDRA_CAST<float *>(&this_00[1]._playerHudIndex) * 0.7;
cVar2 = FUN_00753bf0();
if (cVar2 == '\0') {
local_40 = GHIDRA_CAST<Vector *>((fVar5 + 0.3));
}
else {
local_40 = GHIDRA_CAST<Vector *>((fVar4 - fVar5));
}
local_38 = (float)local_40;
}
}
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar1) + 0x202c)) != '\0') {
local_40 = GHIDRA_CAST<Vector *>(0x3e4ccccd);
}
alpha = local_40;
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
LAB_009a71e5:
isNetplayCompactHud = false;
}
else {
iVar3 = FUN_009a84c0();
if (((iVar3 != 1) || (playerHudIdx == 0)) || (playerHudIdx == 4)) goto LAB_009a71e5;
isNetplayCompactHud = true;
}
if (hudLayout == 0) {
local_28.x = hudPos.x - 53.0;
local_30.x = hudPos.y - 12.0;
local_28.y = local_30.x;
PlayerHUD::RenderActiveItem(this_00,1,&local_28,0,1.0,(float)alpha,0);
hudPos.x = hudPos.x - 44.0;
hudPos.y = local_30.x;
fVar4 = 1.0;
PlayerHUD::RenderActiveItem(this_00,0,&hudPos,0,1.0,(float)local_40,0);
trinketSlot = 1;
hudPos.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5944)))) + 44.0;
trinket1Pos.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5944)))) + 20.0;
local_40 = &trinket1Pos;
hudPos.y = ((g_screenHeight - 28.0) - 16.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5948))));
trinket1Pos.y = ((g_screenHeight - 52.0) - 16.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5948))));
do {
PlayerHUD::RenderTrinket(this_00,trinketSlot,local_40,fVar4,1.0,0);
local_40 = local_40 + -1;
trinketSlot = trinketSlot - 1;
} while (-1 < GHIDRA_INT(trinketSlot));
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x13c0)) == 0x15) {
hudPos.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5934)))) + 58.0;
hudPos.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5938)))) + 45.0;
(GHIDRA_CAST<PlayerHUD *>((this_00)))->PlayerHUD::render_inventory(&hudPos,1.0);
}
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x13c0)) == 0x19) {
hudPos.x = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5934)))) + 58.0;
hudPos.y = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5938)))) + 49.0;
(GHIDRA_CAST<PlayerHUD *>((this_00)))->PlayerHUD::RenderSpellQueue(&hudPos,1.0);
}
hudPos.x = (g_screenWidth - 28.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x594c))));
hudPos.y = (g_screenHeight - 18.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5950))));
PlayerHUD::RenderPocketItems(this_00,&hudPos,0,local_38,1.0);
return;
}
if (((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_30.x)) + 0x0))) < 4) || (hudLayout != 1)) {
if (hudLayout == 3) {
if ((*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(&(local_28.x)) + 0x0))) < 4) {
fVar4 = hudPos.x;
fVar5 = hudPos.y;
}
else {
fVar4 = hudPos.x + 0.0;
fVar5 = hudPos.y + 32.0;
}
local_30.x = fVar4 - 34.0;
local_30.y = fVar5 - 8.0;
local_28.x = local_30.y;
PlayerHUD::RenderActiveItem(this_00,1,&local_30,3,0.5,(float)alpha,0);
local_30.x = fVar4 - 25.0;
local_30.y = local_28.x;
unused = 0.5;
PlayerHUD::RenderActiveItem(this_00,0,&local_30,3,0.5,(float)local_40,0);
fVar4 = fVar4 - 12.0;
fVar5 = fVar5 + 20.0;
hudPos.x = fVar4;
hudPos.y = fVar5;
iVar3 = FUN_009a84c0();
if (((iVar3 == 1) && (playerHudIdx != 0)) && (playerHudIdx != 4)) {
hudPos.y = fVar5 - 8.0;
fVar4 = fVar4 + 0.0;
hudPos.x = fVar4;
}
trinketEntrySmall = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x218))));
trinketSlot = 1;
do {
if (*trinketEntrySmall != 0) {
PlayerHUD::RenderTrinket(this_00,trinketSlot,&hudPos,unused,0.5,1);
fVar4 = hudPos.x + 16.0;
hudPos.x = fVar4;
}
trinketEntrySmall = trinketEntrySmall + -6;
trinketSlot = trinketSlot - 1;
} while (-1 < GHIDRA_INT(trinketSlot));
hudPos.x = fVar4 - 2.0;
hudPos.y = hudPos.y + 1.0;
hudLayout = 3;
goto LAB_009a7996;
}
local_30.x = hudPos.x - 45.0;
local_30.y = hudPos.y - 16.0;
PlayerHUD::RenderActiveItem(this_00,1,&local_30,hudLayout,1.0,(float)alpha,0);
local_30.x = hudPos.x - 44.0;
local_30.y = hudPos.y - 12.0;
fVar4 = 1.0;
PlayerHUD::RenderActiveItem(this_00,0,&local_30,hudLayout,1.0,(float)local_40,0);
local_30.x = hudPos.x + 0.0;
isAnyTrinketDrawn = false;
local_28.y = hudPos.y + 22.0;
if (isNetplayCompactHud) {
local_28.y = local_28.y - 9.0;
}
local_40 = GHIDRA_CAST<Vector *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x218))));
trinketSlot = 1;
local_28.x = local_30.x;
do {
if (*GHIDRA_CAST<int *>(local_40) != 0) {
PlayerHUD::RenderTrinket(this_00,trinketSlot,&local_28,fVar4,0.5,1);
local_28.x = local_28.x + 16.0;
isAnyTrinketDrawn = true;
}
local_40 = GHIDRA_CAST<Vector *>((GHIDRA_INT(local_40) + -0x18));
trinketSlot = trinketSlot - 1;
} while (-1 < GHIDRA_INT(trinketSlot));
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x13c0)) == 0x15) {
local_30.x = local_30.x + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5934))));
local_30.y = hudPos.y + 33.0 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5938))));
(GHIDRA_CAST<PlayerHUD *>((this_00)))->PlayerHUD::render_inventory(&local_30,1.0);
}
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x13c0)) == 0x19) {
local_30.x = local_30.x + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5934))));
local_30.y = hudPos.y + 39.0 + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5938))));
(GHIDRA_CAST<PlayerHUD *>((this_00)))->PlayerHUD::RenderSpellQueue(&local_30,1.0);
}
local_28.x = local_28.x - 3.0;
if (isAnyTrinketDrawn) {
local_28.x = local_28.x - 3.0;
}
}
else {
local_30.x = hudPos.x + 28.0;
local_30.y = hudPos.y - 16.0;
PlayerHUD::RenderActiveItem(this_00,1,&local_30,1,1.0,(float)alpha,0);
local_30.x = hudPos.x + 12.0;
local_30.y = hudPos.y - 12.0;
fVar5 = 1.0;
PlayerHUD::RenderActiveItem(this_00,0,&local_30,1,1.0,(float)local_40,0);
trinketEntry = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this_00)) + 0x218))));
fVar4 = hudPos.x + 0.0;
trinketSlot = 1;
local_28.y = hudPos.y + 20.0;
local_28.x = fVar4;
do {
if (*trinketEntry != 0) {
PlayerHUD::RenderTrinket(this_00,trinketSlot,&local_28,fVar5,0.5,1);
fVar4 = local_28.x - 16.0;
local_28.x = fVar4;
}
trinketEntry = trinketEntry + -6;
trinketSlot = trinketSlot - 1;
} while (-1 < GHIDRA_INT(trinketSlot));
local_28.x = fVar4 + 0.0;
if (((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x17a4)) == 0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x17a4)) == 1)) &&
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar1) + 0x17a0)) == 0)) {
return;
}
hudLayout = 1;
}
local_28.y = local_28.y + 1.0;
LAB_009a7996:
PlayerHUD::RenderPocketItems(this_00,&local_28,hudLayout,local_38,0.5);
return;
}
// 009a7c90
void HUD::render_boss_health_bar(Vector barPos)
{
code *pcVar1;
Manager *pMVar2;
char cVar3;
int iVar4;
uint32_t uVar5;
KColor *color;
int unused;
KColor *color_00;
KColor *color_01;
float fillYOffset;
uint8_t auStackY_2d4 [128];
void *in_stack_fffffdb0;
void *pvVar6;
void *other;
uint8_t auStack_23a [2];
uint8_t fillQuad [112];
uint8_t frameQuad [112];
uint8_t counterQuad [116];
uint8_t fillSourceQuad [36];
uint8_t frameSourceQuad [36];
uint32_t fontSettings;
uint32_t local_8c;
float local_88;
float fStack_84;
float fStack_80;
float fStack_7c;
uint32_t local_78;
KColor whiteColor;
Vector local_60;
int *barImage;
int *barImageRefCount;
Vector local_50;
Color barColor;
Vector local_1c;
uint32_t local_14;
void *local_10;
uint8_t *puStack_c;
float local_8;
int *roomConfig;
local_8 = -NAN;
puStack_c = &LAB_00b0ddc8;
local_10 = ExceptionList;
local_14 = __security_cookie ^ GHIDRA_UINT(((&barColor)[1]._colorize + 2));
fillYOffset = 0.0;
if (0.0 <= this->_bossHPBarFill) {
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1bb0));
if (((iVar4 != 0x37) && (iVar4 != 0x58)) &&
((roomConfig = *GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 4)) + 0x10)), roomConfig == GHIDRA_CAST<int *>(0x0)
|| ((roomConfig[2] != 0x10 || (*roomConfig != 0x23)))))) {
local_50.y = (float)&DAT_42000000;
ExceptionList = &local_10;
if (iVar4 == 0x53) {
local_50.x = 64.0;
barPos.x = (g_screenWidth - 64.0) * 0.5;
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x549c))) == '\0') && ((g_manager->_optionsConfig)._bossHpOnBottom == 0)) {
barPos.y = 8.0 - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5998))));
}
else {
barPos.y = ((g_screenHeight - 32.0) - 8.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5998))));
}
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
render_quad_set_rect(counterQuad,&barPos,&local_50,color);
pcVar1 = *(code **)(**GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54bc)))) + 0x1c);
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
(*pcVar1)();
sprintf_s(GHIDRA_CAST<uint8_t *>(&local_1c),8,GHIDRA_CAST<uint8_t *>("%d/%d"));
pMVar2 = g_manager;
fontSettings = 0;
local_8c = 0xffff;
local_88 = 0.0;
fStack_84 = 1.0;
fStack_80 = -NAN;
fStack_7c = 0.0;
local_78 = 0;
local_8 = 0.0;
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
iVar4 = Font::get_string_width_n
(&pMVar2->_font6_PFTempestaSevenCondensed,GHIDRA_CAST<uint8_t *>(&local_1c),-1);
Font::DrawString(&pMVar2->_font6_PFTempestaSevenCondensed,GHIDRA_CAST<uint8_t *>(&local_1c),&whiteColor,
&fontSettings,
(barPos.x + 48.0) -
(float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]),
barPos.y + 7.0);
ExceptionList = local_10;
return;
}
local_50.x = 148.0;
barPos.x = (g_screenWidth - 148.0) * 0.5;
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x549c))) == '\0') && ((g_manager->_optionsConfig)._bossHpOnBottom == 0)) {
barPos.y = 8.0 - *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5998))));
}
else {
barPos.y = ((g_screenHeight - 32.0) - 8.0) + *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5998))));
}
local_1c.x = 0.0;
local_1c.y = (float)&DAT_42000000;
quad_set_rect(frameSourceQuad,&local_1c,&local_50,iVar4);
local_1c.x = this->_bossHPBarFill * 110.0;
local_1c.y = (float)&DAT_42000000;
local_60.x = 20.0;
local_60.y = 0.0;
quad_set_rect(fillSourceQuad,&local_60,&local_1c,unused);
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
render_quad_set_rect(frameQuad,&barPos,&local_50,color_00);
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
local_60.x = this->_bossHPBarFill * 110.0;
local_50.x = barPos.x + 20.0;
local_50.y = barPos.y + fillYOffset;
local_60.y = (float)&DAT_42000000;
render_quad_set_rect(fillQuad,&local_50,&local_60,color_01);
(GHIDRA_CAST<Color *>((&barColor)))->Color::Color();
pvVar6 = (void *)0x9a800c;
(GHIDRA_CAST<KAGE::SmartPointer *>((&barImage)))->KAGE::SmartPointer::operator_assign(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a0))));
local_8 = 1.4013e-45;
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(g_game->_room) + 8));
if (((iVar4 != 5) && (iVar4 != 0x11)) && (iVar4 != 0xb)) {
pvVar6 = (void *)0x9a8037;
uVar5 = Game::GetStageID(g_game,(uint8_t)g_game);
if (uVar5 != 0x23) {
pvVar6 = (void *)0x9a804b;
(GHIDRA_CAST<KAGE::SmartPointer *>((&barImage)))->KAGE::SmartPointer::operator_assign(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54a8))));
}
}
local_1c.y = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(g_game->_room) + 0x1d18));
if (local_1c.y == 7.56701e-44) {
shader_stack_push(2);
uVar5 = g_game->_frameCount & 0x800000ff;
if (GHIDRA_INT(uVar5) < 0) {
uVar5 = (uVar5 - 1 | 0xffffff00) + 1;
}
other = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x54b0)));
barColor._colorize[3] = (float)GHIDRA_INT(uVar5) * 0.00390625;
pvVar6 = (void *)0x9a80a9;
(GHIDRA_CAST<KAGE::SmartPointer *>((&barImage)))->KAGE::SmartPointer::operator_assign(other);
}
else {
other = (void *)0x9a80b2;
shader_stack_push(0);
}
(GHIDRA_CAST<KAGE::SmartPointer *>((auStack_23a + -10)))->KAGE::SmartPointer::operator_assign(&barImage);
apply_sprite_shader_params(GHIDRA_CAST<ColorMod *>(&barColor),1,pvVar6,other);
pcVar1 = *(code **)(*barImage + 0x14);
(GHIDRA_CAST<KColor *>((&whiteColor)))->KColor::SetFromARGB(0xffffffff);
pvVar6 = (void *)0x9a80f1;
(*pcVar1)();
if (this->_bossHPBarHealFlash < 1) {
if (-1 < this->_bossHPBarDamageFlash) {
uVar5 = this->_bossHPBarDamageFlash & 0x80000001;
if (GHIDRA_INT(uVar5) < 0) {
uVar5 = (uVar5 - 1 | 0xfffffffe) + 1;
}
if (uVar5 != 1) {
if (local_1c.y == 7.56701e-44) {
barColor._tint[0] = 1.0;
barColor._tint[1] = 0.6;
barColor._tint[2] = 0.6;
}
else {
barColor._tint[0] = 0.48;
barColor._tint[1] = 0.0;
barColor._tint[2] = 0.0;
}
goto LAB_009a8185;
}
}
if (local_1c.y == 7.56701e-44) {
barColor._tint[0] = 1.0;
barColor._tint[1] = 1.0;
barColor._tint[2] = 1.0;
}
else {
barColor._tint[0] = 0.8;
barColor._tint[1] = 0.0;
barColor._tint[2] = 0.0;
}
}
else {
uVar5 = this->_bossHPBarHealFlash & 0x80000001;
if (GHIDRA_INT(uVar5) < 0) {
uVar5 = (uVar5 - 1 | 0xfffffffe) + 1;
}
if (uVar5 == 1) {
if (local_1c.y == 7.56701e-44) {
barColor._tint[0] = 1.0;
barColor._tint[1] = 0.8;
barColor._tint[2] = 0.6;
}
else {
barColor._tint[0] = 0.87;
barColor._tint[1] = 0.4;
barColor._tint[2] = 0.0;
}
}
else if (local_1c.y == 7.56701e-44) {
barColor._tint[0] = 1.0;
barColor._tint[1] = 0.95;
barColor._tint[2] = 0.8;
}
else {
barColor._tint[0] = 0.6;
barColor._tint[1] = 0.25;
barColor._tint[2] = 0.0;
}
}
LAB_009a8185:
barColor._tint[3] = 1.0;
(GHIDRA_CAST<KAGE::SmartPointer *>((auStackY_2d4 + 0x84)))->KAGE::SmartPointer::operator_assign(&barImage);
apply_sprite_shader_params(GHIDRA_CAST<ColorMod *>(&barColor),1,in_stack_fffffdb0,pvVar6);
local_78 = 0;
local_88 = barColor._tint[0];
fStack_84 = barColor._tint[1];
fStack_80 = barColor._tint[2];
fStack_7c = barColor._tint[3];
(**(code **)(*barImage + 0x14))(fillSourceQuad);
FUN_00682350();
local_8 = 2.8026e-45;
if (barImageRefCount == GHIDRA_CAST<int *>(0x0)) {
ExceptionList = local_10;
return;
}
cVar3 = (**(code **)(*barImageRefCount + 0xc))();
if (cVar3 == '\0') {
ExceptionList = local_10;
return;
}
if (g_imageReleaseFn == (void *)0x0) {
ExceptionList = local_10;
return;
}
(*g_imageReleaseFn)();
ExceptionList = local_10;
return;
}
}
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x549c))) = 0;
return;
}
// 009a8230
void HUD::update_hud_offset()
{
float hudScale;
float hudScaleTimes6;
float hudScaleTimes16;
float storedHudScale;
hudScale = 1.0 - (g_manager->_optionsConfig)._hudOffset;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5994)))) = hudScale;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5940)))) = hudScale * -12.0;
storedHudScale = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5994))));
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5938)))) = hudScale * -12.0;
hudScaleTimes6 = storedHudScale * 6.0;
hudScaleTimes16 = storedHudScale * 16.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5998)))) = storedHudScale * 12.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5958)))) = hudScale * -12.0 + 30.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x59a0)))) = storedHudScale * -14.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5960)))) = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5938)))) + 30.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5934)))) = hudScale * -20.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x593c)))) = hudScale * 24.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5944)))) = storedHudScale * -22.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5968)))) = hudScaleTimes6 - 33.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5948)))) = hudScaleTimes16;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x594c)))) = hudScaleTimes16;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5950)))) = hudScaleTimes6;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x599c)))) = hudScaleTimes16;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5954)))) = hudScale * -20.0 + 68.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x595c)))) = hudScale * 24.0 - 151.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5964)))) = storedHudScale * -22.0 + 80.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x596c)))) = hudScaleTimes16 - 151.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5970)))) = hudScaleTimes6 - 33.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5974)))) = hudScaleTimes16 - 64.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5978)))) = hudScaleTimes6 - 33.0;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x597c)))) = g_vectorZero.x;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5980)))) = g_vectorZero.y;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5984)))) = g_vectorZero.x;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5988)))) = g_vectorZero.y;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x598c)))) = g_vectorZero.x;
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x5990)))) = g_vectorZero.y;
return;
}
// 009a8430
uint8_t HUD::count_player_huds()
{
uint8_t hudCount;
uint8_t hudCountNext;
bool bVar1;
bVar1 = *GHIDRA_CAST<int *>(this->_playerHUD) != 0;
hudCount = bVar1 + 1;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x6dc)) == 0) {
hudCount = bVar1;
}
hudCountNext = hudCount + 1;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0xdb8)) == 0) {
hudCountNext = hudCount;
}
hudCount = hudCountNext + 1;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x1494)) == 0) {
hudCount = hudCountNext;
}
hudCountNext = hudCount + 1;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x1b70)) == 0) {
hudCountNext = hudCount;
}
hudCount = hudCountNext + 1;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x224c)) == 0) {
hudCount = hudCountNext;
}
hudCountNext = hudCount + 1;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x2928)) == 0) {
hudCountNext = hudCount;
}
hudCount = hudCountNext + 1;
if (*GHIDRA_CAST<int *>((this->_playerHUD + 0x3004)) == 0) {
hudCount = hudCountNext;
}
return hudCount;
}
// 009a8620
void HUD::AssignPlayerHUDs()
{
int iVar1;
int iVar2;
void *pvVar3;
uint32_t i;
PlayerHUD *playerHud;
PlayerManager *playerManager;
PlayerHUD *hud;
int iVar4;
int *playerSlot;
Game *game;
void *twinPlayer;
iVar4 = 8;
playerHud = GHIDRA_CAST<PlayerHUD *>(this);
do {
if (playerHud->_player != (void *)0x0) {
(GHIDRA_CAST<PlayerHUD *>((playerHud)))->PlayerHUD::reset();
playerHud->_player = (void *)0x0;
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((playerHud)) + 0x6ac)))) = 0x101;
}
game = g_game;
playerHud = GHIDRA_CAST<PlayerHUD *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(playerHud[1])) + 0x2c))));
iVar4 = iVar4 + -1;
} while (iVar4 != 0);
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((g_game->_playerManager)._playerList._begin) >> 2 != 0) {
(g_game->_playerManager)._coopSlots[0]._controllerIndex = -1;
i = 0;
(game->_playerManager)._coopSlots[1]._controllerIndex = -1;
(game->_playerManager)._coopSlots[0]._state = -1;
(game->_playerManager)._coopSlots[0]._menuPosition = 0.0;
(game->_playerManager)._coopSlots[0]._playerType = 0;
(game->_playerManager)._coopSlots[1]._state = -1;
(game->_playerManager)._coopSlots[1]._menuPosition = 0.0;
(game->_playerManager)._coopSlots[1]._playerType = 0;
(game->_playerManager)._coopSlots[2]._controllerIndex = -1;
(game->_playerManager)._coopSlots[2]._state = -1;
(game->_playerManager)._coopSlots[2]._menuPosition = 0.0;
(game->_playerManager)._coopSlots[2]._playerType = 0;
(game->_playerManager)._coopSlots[3]._controllerIndex = -1;
(game->_playerManager)._coopSlots[3]._state = -1;
(game->_playerManager)._coopSlots[3]._menuPosition = 0.0;
(game->_playerManager)._coopSlots[3]._playerType = 0;
pvVar3 = (game->_playerManager)._playerList._begin;
if (GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(pvVar3) >> 2 != 0) {
do {
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + i * 4));
iVar1 = *GHIDRA_CAST<int *>((iVar4 + 0x1e68));
if (((((iVar1 == 0) || (*GHIDRA_CAST<int *>((iVar1 + 0x161c)) == -1)) ||
(*GHIDRA_CAST<int *>((iVar4 + 0x161c)) <= *GHIDRA_CAST<int *>((iVar1 + 0x161c)))) || (iVar1 == iVar4)) &&
((*GHIDRA_CAST<int *>((iVar4 + 0x3bc)) == 0 && (*GHIDRA_CAST<char *>((iVar4 + 0x172)) != '\0')))) {
PlayerManager::GetPlayerSlotFromController
(&g_game->_playerManager,*GHIDRA_CAST<int *>((iVar4 + 0x1618)));
pvVar3 = (game->_playerManager)._playerList._begin;
}
i = i + 1;
} while (i < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) - GHIDRA_INT(pvVar3) >> 2)));
}
}
i = 0;
playerManager = &g_game->_playerManager;
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2
!= 0) {
do {
pvVar3 = (playerManager->_playerList)._end;
if (GHIDRA_INT(pvVar3) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
pvVar3 = (playerManager->_playerList)._end;
}
playerSlot = (playerManager->_playerList)._begin;
if (i < GHIDRA_UINT((GHIDRA_INT(pvVar3) - GHIDRA_INT(playerSlot) >> 2))) {
playerSlot = playerSlot + i;
}
pvVar3 = (void *)*playerSlot;
twinPlayer = *(void **)(GHIDRA_CAST<char *>(pvVar3) + 0x1e68);
if ((((twinPlayer == (void *)0x0) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twinPlayer) + 0x161c)) == -1)) ||
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x161c)) <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(twinPlayer) + 0x161c)) ||
(twinPlayer == pvVar3)))) &&
((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x3bc)) == 0 && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(pvVar3) + 0x172)) != '\0')))) {
iVar4 = PlayerManager::GetPlayerSlotFromController
(&g_game->_playerManager,*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x1618)));
if (iVar4 < 0) {
KAGE_LogMessage(8,(uint8_t *)
"(GHIDRA_CAST<HUD *>(()))->HUD::AssignPlayerHUDs() could not determine player HUD slot for player entity %d (ControlerIndex = %d) \n"
);
}
else {
KAGE_LogMessage(1,(uint8_t *)
"Assinging player entity %d (ControlerIndex = %d) to HUD slot %d \n");
hud = GHIDRA_CAST<PlayerHUD *>((this->_playerHUD + iVar4 * 0x6dc));
if (pvVar3 != hud->_player) {
(GHIDRA_CAST<PlayerHUD *>((hud)))->PlayerHUD::reset();
hud->_player = pvVar3;
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((hud)) + 0x6ac)))) = 0x101;
}
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x1e68));
if ((((iVar1 != 0) && (*GHIDRA_CAST<char *>((iVar1 + 0x172)) != '\0')) &&
(iVar2 = *GHIDRA_CAST<int *>((iVar1 + 0x13c0)), iVar2 != 0x28)) &&
((((iVar2 != 0x1d && (iVar2 != 0x26)) ||
((iVar2 = *GHIDRA_CAST<int *>((iVar1 + 0x1e68)), iVar2 == 0 ||
((*GHIDRA_CAST<int *>((iVar2 + 0x161c)) == -1 ||
(*GHIDRA_CAST<int *>((iVar1 + 0x161c)) <= *GHIDRA_CAST<int *>((iVar2 + 0x161c)))))))) || (iVar2 == iVar1))))
{
KAGE_LogMessage(1,(uint8_t *)
"Assinging player entity %d\'s twin (ControlerIndex = %d) to HUD slot %d \n"
);
pvVar3 = *(void **)(GHIDRA_CAST<char *>(pvVar3) + 0x1e68);
hud = GHIDRA_CAST<PlayerHUD *>((this->_playerHUD + iVar4 * 0x6dc + 0x1b70));
if (pvVar3 != hud->_player) {
(GHIDRA_CAST<PlayerHUD *>((hud)))->PlayerHUD::reset();
hud->_player = pvVar3;
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((hud)) + 0x6ac)))) = 0x101;
}
}
}
}
i = i + 1;
playerManager = &g_game->_playerManager;
} while (i < GHIDRA_UINT((GHIDRA_INT((g_game->_playerManager)._playerList._end) -
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
}
return;
}
// 009a8970
void HUD::mark_all_slots_dirty(HUD *hud, uint8_t isRebuildIcons, uint8_t isClearTextCache)
{
undefined3 in_stack_00000005;
uint32_t *historyHud;
if (*GHIDRA_CAST<int *>(hud->_playerHUD) != 0) {
hud->_playerHUD[0x6ac] = 1;
}
if (*GHIDRA_CAST<int *>((hud->_playerHUD + 0x6dc)) != 0) {
hud->_playerHUD[0xd88] = 1;
}
if (*GHIDRA_CAST<int *>((hud->_playerHUD + 0xdb8)) != 0) {
hud->_playerHUD[0x1464] = 1;
}
if (*GHIDRA_CAST<int *>((hud->_playerHUD + 0x1494)) != 0) {
hud->_playerHUD[0x1b40] = 1;
}
if (*GHIDRA_CAST<int *>((hud->_playerHUD + 0x1b70)) != 0) {
hud->_playerHUD[0x221c] = 1;
}
if (*GHIDRA_CAST<int *>((hud->_playerHUD + 0x224c)) != 0) {
hud->_playerHUD[0x28f8] = 1;
}
if (*GHIDRA_CAST<int *>((hud->_playerHUD + 0x2928)) != 0) {
hud->_playerHUD[0x2fd4] = 1;
}
if (*GHIDRA_CAST<int *>((hud->_playerHUD + 0x3004)) != 0) {
hud->_playerHUD[14000] = 1;
}
historyHud = &hud->_historyHUD;
if ((g_manager->_optionsConfig)._historyHudMode == 0) {
if (*historyHud != 0) {
text_image_cache_clear(historyHud);
}
return;
}
if (isClearTextCache != 0) {
text_image_cache_clear(historyHud);
}
update_player_hud_slots(GHIDRA_CAST<HUD *>(historyHud),_isRebuildIcons);
return;
}