- anm2.h/.cpp take over ANM2, AnimationState, LayerState, AnmCache and the frame data. They read Anm2Ed's JSON documents with simdjson and play them as the game does (interpolation baked at load). src/anm2/ and msvc.h are retired. - font, formatted_text, string_table and rich_text take over the text classes. FormattedText::parse is still bit-exact against its assembly. - options_config and challenge_params take over OptionsConfig, ChallengeParams and the .ini helpers. The tests include Save's exact bytes. - platform.h/.cpp and main.cpp run IsaacMain on SDL3: the window and GL context open, and the run stops at the first built-in shader (FUN_00a13fa0). - source_tree.py: a taken-over parent stays bytes, taken-over methods are not re-emitted as a namespace, and every address in a (a, b, c to d) list on a comment counts as taken over. - log.h: reconstruction_missing() for a taken-over class's methods that are not written yet. 206 functions taken over, boot path 89/615. The full build waits for wave B: item_config, entity_config and mod_manager still use the old APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2063 lines
88 KiB
C++
2063 lines
88 KiB
C++
#include "classes.h"
|
|
|
|
// 009b1fc0
|
|
void Menu_Options::constructor()
|
|
{
|
|
Menu_Options *pMVar1;
|
|
ANM2 *pAVar2;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0e420;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
this->PositionY_duplicate = 0.0;
|
|
this->PositionX_duplicate = 0.0;
|
|
this->PositionY = 0.0;
|
|
this->PositionX = 0.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) = 0;
|
|
ANM2::constructor(&this->OptionsSprite);
|
|
local_8 = 0;
|
|
ANM2::constructor(&this->GammaMenuSprite);
|
|
this[1].SelectedElement = 0;
|
|
this[1].PositionY = 0.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x1c)))) = 0xf;
|
|
*GHIDRA_CAST<uint8_t *>(&this[1].SelectedElement) = 0;
|
|
pMVar1 = this + 1;
|
|
(pMVar1->OptionsSprite)._filename._buf[0] = '\0';
|
|
(pMVar1->OptionsSprite)._filename._buf[1] = '\0';
|
|
(pMVar1->OptionsSprite)._filename._buf[2] = '\0';
|
|
(pMVar1->OptionsSprite)._filename._buf[3] = '\0';
|
|
pAVar2 = &this[1].OptionsSprite;
|
|
(pAVar2->_filename)._buf[4] = '\0';
|
|
(pAVar2->_filename)._buf[5] = '\0';
|
|
(pAVar2->_filename)._buf[6] = '\0';
|
|
(pAVar2->_filename)._buf[7] = '\0';
|
|
pAVar2 = &this[1].OptionsSprite;
|
|
(pAVar2->_filename)._buf[8] = '\0';
|
|
(pAVar2->_filename)._buf[9] = '\0';
|
|
(pAVar2->_filename)._buf[10] = '\0';
|
|
(pAVar2->_filename)._buf[0xb] = '\0';
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009b2090
|
|
Menu_Options::~Menu_Options()
|
|
{
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af0b40;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
FID_conflict__Tidy(&this[1].OptionsSprite);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this[1].SelectedElement))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 0;
|
|
ANM2::Reset(&this->GammaMenuSprite);
|
|
AnimationState::~AnimationState(&(this->GammaMenuSprite)._overlayAnimState);
|
|
AnimationState::~AnimationState(&(this->GammaMenuSprite)._animState);
|
|
(GHIDRA_CAST<msvc::string *>(((this->GammaMenuSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->GammaMenuSprite))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 1;
|
|
ANM2::Reset(&this->OptionsSprite);
|
|
AnimationState::~AnimationState(&(this->OptionsSprite)._overlayAnimState);
|
|
AnimationState::~AnimationState(&(this->OptionsSprite)._animState);
|
|
(GHIDRA_CAST<msvc::string *>(((this->OptionsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->OptionsSprite))))->msvc::string::_Tidy_deallocate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009b2150
|
|
void Menu_Options::Init(Vector *position, uint8_t isPauseScreen)
|
|
{
|
|
char *ptr;
|
|
uint32_t size;
|
|
undefined3 in_stack_00000009;
|
|
std_string anm2Path;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af18ad;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
anm2Path._size = 0x21;
|
|
anm2Path._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/OptionsMenu.anm2",0x22);
|
|
local_14 = 0;
|
|
ANM2::Load(&this->OptionsSprite,&anm2Path,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
size = anm2Path._capacity + 1;
|
|
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < size) {
|
|
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
size = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,size);
|
|
}
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) & 0xffffff00;
|
|
*GHIDRA_CAST<uint32_t *>(this) = _isPauseScreen;
|
|
load_graphics(this);
|
|
this->PositionX_duplicate = position->x;
|
|
this->PositionY_duplicate = position->y;
|
|
this->PositionX = position->x;
|
|
this->PositionY = position->y;
|
|
*GHIDRA_CAST<uint8_t *>((this + 1)) = 0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009b22a0
|
|
void Menu_Options::load_menu_anm2()
|
|
{
|
|
char *ptr;
|
|
uint32_t size;
|
|
std_string anm2Path;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af84fd;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
anm2Path._size = 0x21;
|
|
anm2Path._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/OptionsMenu.anm2",0x22);
|
|
local_14 = 0;
|
|
ANM2::Load(&this->OptionsSprite,&anm2Path,1);
|
|
if (0xf < anm2Path._capacity) {
|
|
size = anm2Path._capacity + 1;
|
|
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < size) {
|
|
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
size = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,size);
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009b23a0
|
|
void Menu_Options::Update()
|
|
{
|
|
Manager *pMVar1;
|
|
char isTriggered;
|
|
uint32_t uVar2;
|
|
int iVar3;
|
|
Manager **ppMVar4;
|
|
Manager **ppMVar5;
|
|
uint32_t onlineHudMode;
|
|
uint32_t uVar6;
|
|
Entity_Player *player;
|
|
int unused;
|
|
int iVar7;
|
|
void *pvVar8;
|
|
int *piVar9;
|
|
uint32_t *this_00;
|
|
int scrollStep;
|
|
Manager *manager;
|
|
float fVar10;
|
|
float dirX;
|
|
Manager *pMVar11;
|
|
int *device;
|
|
int *deviceRef;
|
|
uint32_t actionId;
|
|
Manager *local_34;
|
|
Manager *local_30;
|
|
float actionIds [3];
|
|
Manager *local_20;
|
|
Manager *local_1c;
|
|
float local_18;
|
|
char isPauseMenu;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
float local_8;
|
|
Game *game;
|
|
MenuManager *menuManager;
|
|
int menuMode;
|
|
|
|
local_8 = -NAN;
|
|
puStack_c = &LAB_00b0e44d;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((actionIds + 10));
|
|
ExceptionList = &local_10;
|
|
if ((*GHIDRA_CAST<int *>(this) == 1) || (isPauseMenu = '\0', *GHIDRA_CAST<int *>(this) == 2)) {
|
|
isPauseMenu = '\x01';
|
|
}
|
|
if (*GHIDRA_CAST<char *>((this + 1)) != '\0') {
|
|
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
MenuManager::unload_graphics();
|
|
}
|
|
if (g_manager != GHIDRA_CAST<Manager *>(0x0)) {
|
|
pause_screen_unload_sprites();
|
|
}
|
|
game = g_game;
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
(GHIDRA_CAST<HUD *>((&g_game->_hud)))->HUD::unload_graphics();
|
|
ANM2::Reset(&(game->_genericPrompt)._sprite);
|
|
(game->_genericPrompt)._isOnlineVote = 0;
|
|
ANM2::Reset(&game->_completionWidgetSprite);
|
|
}
|
|
manager = g_manager;
|
|
pvVar8 = g_luaEngine;
|
|
if (g_manager != GHIDRA_CAST<Manager *>(0x0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Lua is resetting!\n"));
|
|
(GHIDRA_CAST<LuaEngine *>((pvVar8)))->LuaEngine::destroy();
|
|
(GHIDRA_CAST<LuaEngine *>((pvVar8)))->LuaEngine::Init(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar8) + 0x1c)));
|
|
FUN_008f5960();
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::ListMods();
|
|
}
|
|
TextureCache::Purge();
|
|
AnmCache::Clear();
|
|
if (g_manager != GHIDRA_CAST<Manager *>(0x0)) {
|
|
(GHIDRA_CAST<Manager *>((g_manager)))->Manager::validate_language(unused);
|
|
}
|
|
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
MenuManager::LoadGraphics();
|
|
}
|
|
if (g_manager != GHIDRA_CAST<Manager *>(0x0)) {
|
|
FUN_00954710();
|
|
}
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
Game::ReloadStagesXmlOnLuaReset();
|
|
}
|
|
if (g_manager != GHIDRA_CAST<Manager *>(0x0)) {
|
|
this_00 = &g_manager->_modManager;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(this_00))))->ModManager::LoadShaders();
|
|
Manager::unload_configs();
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(this_00))))->ModManager::LoadModContent();
|
|
ModManager::LoadModCurses();
|
|
}
|
|
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
(GHIDRA_CAST<Menu_Character *>((&g_menuManager->_menuCharacter)))->Menu_Character::Reset();
|
|
}
|
|
uVar2 = GHIDRA_INT((g_menuManager->_menuStateHistory)._end) -
|
|
GHIDRA_INT((g_menuManager->_menuStateHistory)._begin) >> 2;
|
|
if ((uVar2 < 2) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_INT((g_menuManager->_menuStateHistory)._begin) + uVar2 * 4 + -8)) !=
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))))) {
|
|
(GHIDRA_CAST<MenuManager *>((g_menuManager)))->MenuManager::SetState(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))),0);
|
|
*GHIDRA_CAST<uint8_t *>((this + 1)) = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
OptionsConfig::Save(&g_manager->_optionsConfig);
|
|
menuManager = g_menuManager;
|
|
pvVar8 = (g_menuManager->_menuStateHistory)._end;
|
|
if (1 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT((g_menuManager->_menuStateHistory)._begin) >> 2))) {
|
|
pvVar8 = (void *)(GHIDRA_INT(pvVar8) + -4);
|
|
(g_menuManager->_menuStateHistory)._end = pvVar8;
|
|
}
|
|
(GHIDRA_CAST<MenuManager *>((menuManager)))->MenuManager::SetState(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + -4)),0);
|
|
*GHIDRA_CAST<uint8_t *>((this + 1)) = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
if (((g_manager->_framecount & 1) == 0) && ((this->OptionsSprite)._loaded != 0)) {
|
|
AnimationState::Update(&(this->OptionsSprite)._animState);
|
|
AnimationState::Update(&(this->OptionsSprite)._overlayAnimState);
|
|
}
|
|
manager = g_manager;
|
|
if (isPauseMenu == '\0') {
|
|
scrollStep = -1;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))) != '\0') {
|
|
local_20 = *GHIDRA_CAST<Manager **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c))));
|
|
local_18 = (float)local_20 - this->PositionX;
|
|
local_1c = GHIDRA_CAST<Manager *>((*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) - this->PositionY));
|
|
fVar10 = sqrtf(local_18 * local_18 + (float)local_1c * (float)local_1c);
|
|
if (1.0 < fVar10) {
|
|
pMVar11 = local_1c;
|
|
dirX = local_18;
|
|
if (0.0 < fVar10) {
|
|
dirX = local_18 * (1.0 / fVar10);
|
|
pMVar11 = GHIDRA_CAST<Manager *>(((float)local_1c * (1.0 / fVar10)));
|
|
}
|
|
local_20 = GHIDRA_CAST<Manager *>(0x3f800000);
|
|
local_1c = GHIDRA_CAST<Manager *>((fVar10 * 0.1));
|
|
ppMVar4 = &local_20;
|
|
if (1.0 <= fVar10 * 0.1) {
|
|
ppMVar4 = &local_1c;
|
|
}
|
|
pMVar1 = *ppMVar4;
|
|
this->PositionX = dirX * (float)*ppMVar4 + this->PositionX;
|
|
this->PositionY = (float)pMVar11 * (float)pMVar1 + this->PositionY;
|
|
}
|
|
else {
|
|
this->PositionX = (float)local_20;
|
|
this->PositionY = *GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))) = 0;
|
|
}
|
|
}
|
|
if (manager->_netplayManager == *GHIDRA_CAST<int *>((manager + 1))) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((g_game->_pauseScreen)._playerIdx);
|
|
scrollStep = player->_controllerIndex;
|
|
}
|
|
else {
|
|
scrollStep = (GHIDRA_CAST<InputManager *>((&manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
|
|
}
|
|
}
|
|
local_20 = GHIDRA_CAST<Manager *>(0xe);
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(scrollStep,FUN_00a209e0,&local_20,0,0,uVar2);
|
|
manager = g_manager;
|
|
game = g_game;
|
|
if (isTriggered == '\0') {
|
|
local_18 = 3.08286e-44;
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollStep,FUN_00a20940,&local_18,0,0);
|
|
if (isTriggered == '\0') {
|
|
actionIds[2] = 3.22299e-44;
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(scrollStep,FUN_00a20940,actionIds + 2,0,0);
|
|
if (isTriggered == '\0') {
|
|
actionIds[1] = 2.8026e-44;
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(scrollStep,FUN_00a20940,actionIds + 1,0,0);
|
|
if (isTriggered == '\0') {
|
|
actionIds[0] = 2.94273e-44;
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(scrollStep,FUN_00a20940,actionIds,0,0);
|
|
if (isTriggered == '\0') {
|
|
local_34 = GHIDRA_CAST<Manager *>(0xf);
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(scrollStep,FUN_00a209e0,&local_34,0,0);
|
|
manager = g_manager;
|
|
if (isTriggered != '\0') {
|
|
if (*GHIDRA_CAST<int *>(&g_manager->_stringTable) != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x20))))) {
|
|
*GHIDRA_CAST<uint8_t *>((this + 1)) = 1;
|
|
uVar6 = FUN_0098aef0();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))) = uVar6;
|
|
goto switchD_009b2b40_caseD_a;
|
|
}
|
|
OptionsConfig::Save(&g_manager->_optionsConfig);
|
|
if (isPauseMenu == '\0') {
|
|
FUN_0098aec0();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar2 = this->HoldRightCounter;
|
|
if ((uVar2 == 0) ||
|
|
((0x31 < uVar2 &&
|
|
((uVar2 % 10 == 0 ||
|
|
((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this[1].OptionsSprite._filename._buf) + this->SelectedElement * 4
|
|
)) == 8 && ((this->HoldRightCounter & 1) == 0)))))))) {
|
|
scrollStep = 1;
|
|
goto LAB_009b2b22;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar2 = this->HoldLeftCounter;
|
|
if ((uVar2 == 0) ||
|
|
((0x31 < uVar2 &&
|
|
((uVar2 % 10 == 0 ||
|
|
((*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this[1].OptionsSprite._filename._buf) + this->SelectedElement * 4))
|
|
== 8 && ((this->HoldLeftCounter & 1) == 0)))))))) {
|
|
scrollStep = -1;
|
|
goto LAB_009b2b22;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar2 = this->HoldUpDownCounter;
|
|
if ((uVar2 == 0) || ((0x31 < uVar2 && (uVar2 % 10 == 0)))) {
|
|
this->SelectedElement = this->SelectedElement + 1;
|
|
scrollStep = *GHIDRA_CAST<int *>(this[1].OptionsSprite._filename._buf);
|
|
iVar7 = this->SelectedElement;
|
|
if (*GHIDRA_CAST<int *>((this[1].OptionsSprite._filename._buf + 4)) - scrollStep >> 2 <= iVar7) {
|
|
this->SelectedElement = 0;
|
|
iVar7 = 0;
|
|
}
|
|
menuManager = g_menuManager;
|
|
if (isPauseMenu == '\0') {
|
|
iVar3 = *GHIDRA_CAST<int *>((this[1].OptionsSprite._filename._buf + 4));
|
|
menuMode = *GHIDRA_CAST<int *>(this);
|
|
if (menuMode == 3) {
|
|
g_menuManager->_viewPositionSet[0x14].y = -1350.0;
|
|
}
|
|
else {
|
|
g_menuManager->_viewPositionSet[10].y = -1080.0;
|
|
}
|
|
if (3 < iVar7) {
|
|
iVar3 = (iVar3 - scrollStep >> 2) + -4;
|
|
local_1c = GHIDRA_CAST<Manager *>(0xf7a8);
|
|
scrollStep = 0xf758;
|
|
if (menuMode == 3) {
|
|
scrollStep = 0xf7a8;
|
|
}
|
|
if (iVar3 < iVar7) {
|
|
iVar7 = iVar3;
|
|
}
|
|
*GHIDRA_CAST<float *>(((menuManager->_MenuShadowSprite)._filename._buf + scrollStep + -0x4c)) =
|
|
*GHIDRA_CAST<float *>(((menuManager->_MenuShadowSprite)._filename._buf + scrollStep + -0x4c))
|
|
- (float)(iVar7 + -3) * 20.0;
|
|
}
|
|
menuManager->_state = 1;
|
|
}
|
|
else {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) = 0;
|
|
if (3 < iVar7) {
|
|
scrollStep = (*GHIDRA_CAST<int *>((this[1].OptionsSprite._filename._buf + 4)) - scrollStep >> 2) +
|
|
-4;
|
|
if (scrollStep < iVar7) {
|
|
iVar7 = scrollStep;
|
|
}
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) = 0.0 - (float)(iVar7 + -3) * 20.0;
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))) = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
uVar2 = this->HoldUpDownCounter;
|
|
scrollStep = 10;
|
|
if ((uVar2 == 0) || ((0x31 < uVar2 && (uVar2 % 10 == 0)))) {
|
|
piVar9 = &this->SelectedElement;
|
|
*piVar9 = *piVar9 + -1;
|
|
iVar7 = this->SelectedElement;
|
|
if (*piVar9 < 0) {
|
|
iVar7 = (*GHIDRA_CAST<int *>((this[1].OptionsSprite._filename._buf + 4)) -
|
|
*GHIDRA_CAST<int *>(this[1].OptionsSprite._filename._buf) >> 2) + -1;
|
|
this->SelectedElement = iVar7;
|
|
}
|
|
if (isPauseMenu == '\0') {
|
|
if (*GHIDRA_CAST<int *>(this) == 3) {
|
|
scrollStep = 0x14;
|
|
}
|
|
MenuManager::scroll_options_menu
|
|
(scrollStep,iVar7,
|
|
*GHIDRA_CAST<int *>((this[1].OptionsSprite._filename._buf + 4)) -
|
|
*GHIDRA_CAST<int *>(this[1].OptionsSprite._filename._buf) >> 2);
|
|
}
|
|
else {
|
|
FUN_009b5250(iVar7);
|
|
}
|
|
}
|
|
}
|
|
goto LAB_009b300c;
|
|
}
|
|
scrollStep = 0;
|
|
iVar7 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>(this[1].OptionsSprite._filename._buf) + this->SelectedElement * 4));
|
|
if (iVar7 == 0) {
|
|
if (*GHIDRA_CAST<int *>(&g_manager->_stringTable) == *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x20))))) {
|
|
MenuManager::push_menu(0xb,this->SelectedElement);
|
|
scrollStep = 0;
|
|
goto LAB_009b2b22;
|
|
}
|
|
*GHIDRA_CAST<uint8_t *>((this + 1)) = 1;
|
|
scrollStep = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x4)))) = 0xb;
|
|
}
|
|
else {
|
|
if (iVar7 == 1) {
|
|
local_1c = g_manager;
|
|
pvVar8 = (g_game->_playerManager)._playerList._end;
|
|
piVar9 = (g_game->_playerManager)._playerList._begin;
|
|
uVar2 = (g_game->_pauseScreen)._playerIdx;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar9) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
pvVar8 = (game->_playerManager)._playerList._end;
|
|
piVar9 = (game->_playerManager)._playerList._begin;
|
|
}
|
|
if (uVar2 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar9) >> 2))) {
|
|
piVar9 = piVar9 + uVar2;
|
|
}
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(&device,*GHIDRA_CAST<int *>((*piVar9 + 0x1618)));
|
|
local_8 = 0.0;
|
|
if (device != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*device + 0x54))(0xe);
|
|
}
|
|
manager = local_1c;
|
|
if (local_1c->_netplayManager == *GHIDRA_CAST<int *>((local_1c + 1))) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((game->_pauseScreen)._playerIdx);
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::SetControllerIndex(-1,1);
|
|
}
|
|
else {
|
|
FUN_0090af30(0xffffffff);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4abd0))) = 1;
|
|
local_8 = 1.4013e-45;
|
|
if (((deviceRef != GHIDRA_CAST<int *>(0x0)) &&
|
|
(isTriggered = (**(code **)(*deviceRef + 0xc))(), isTriggered != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&device);
|
|
}
|
|
local_8 = -NAN;
|
|
scrollStep = 0;
|
|
}
|
|
LAB_009b2b22:
|
|
manager = g_manager;
|
|
}
|
|
switch(*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(this[1].OptionsSprite._filename._buf) + this->SelectedElement * 4)))
|
|
{
|
|
case 2:
|
|
local_1c = GHIDRA_CAST<Manager *>(0x0);
|
|
local_30 = GHIDRA_CAST<Manager *>(((float)scrollStep * 0.1 + (manager->_optionsConfig)._sfxVolume));
|
|
local_34 = GHIDRA_CAST<Manager *>(0x3f800000);
|
|
ppMVar4 = &local_30;
|
|
if ((float)local_30 <= 0.0) {
|
|
ppMVar4 = &local_1c;
|
|
}
|
|
ppMVar5 = &local_34;
|
|
if ((float)*ppMVar4 <= 1.0 && (float)*ppMVar4 != 1.0) {
|
|
ppMVar5 = ppMVar4;
|
|
}
|
|
(manager->_optionsConfig)._sfxVolume = (float)*ppMVar5;
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::ClearVolumeModifier();
|
|
manager = g_manager;
|
|
goto LAB_009b2c21;
|
|
case 3:
|
|
if ((manager->_musicManager)._isEnabled == 0) {
|
|
fVar10 = 0.0;
|
|
}
|
|
else {
|
|
fVar10 = (manager->_optionsConfig)._musicVolume;
|
|
}
|
|
local_30 = GHIDRA_CAST<Manager *>(0x0);
|
|
local_1c = GHIDRA_CAST<Manager *>(((float)scrollStep * 0.1 + fVar10));
|
|
ppMVar4 = &local_1c;
|
|
if ((float)local_1c <= 0.0) {
|
|
ppMVar4 = &local_30;
|
|
}
|
|
pMVar11 = *ppMVar4;
|
|
if (1.0 <= (float)pMVar11) {
|
|
pMVar11 = GHIDRA_CAST<Manager *>(0x3f800000);
|
|
}
|
|
OptionsConfig::SetMusicVolume(&manager->_optionsConfig,(float)pMVar11);
|
|
break;
|
|
case 4:
|
|
case 5:
|
|
local_30 = GHIDRA_CAST<Manager *>(0x0);
|
|
local_1c = GHIDRA_CAST<Manager *>(0x3f800000);
|
|
local_34 = GHIDRA_CAST<Manager *>(((float)scrollStep * 0.1 + (manager->_optionsConfig)._mapOpacity));
|
|
ppMVar4 = &local_34;
|
|
if ((float)local_34 <= 0.0) {
|
|
ppMVar4 = &local_30;
|
|
}
|
|
ppMVar5 = &local_1c;
|
|
if ((float)*ppMVar4 <= 1.0 && (float)*ppMVar4 != 1.0) {
|
|
ppMVar5 = ppMVar4;
|
|
}
|
|
(manager->_optionsConfig)._mapOpacity = (float)*ppMVar5;
|
|
goto LAB_009b2c21;
|
|
case 6:
|
|
OptionsConfig::set_fullscreen
|
|
(&manager->_optionsConfig,(manager->_optionsConfig)._isFullscreen == 0);
|
|
goto LAB_009b300c;
|
|
case 7:
|
|
(manager->_optionsConfig)._filterEnabled = (manager->_optionsConfig)._filterEnabled == 0;
|
|
break;
|
|
case 8:
|
|
fVar10 = (float)scrollStep * 0.01 + (manager->_optionsConfig)._gamma;
|
|
if (fVar10 <= 0.5) {
|
|
fVar10 = 0.5;
|
|
}
|
|
if (1.5 <= fVar10) {
|
|
fVar10 = 1.5;
|
|
}
|
|
(manager->_optionsConfig)._gamma = fVar10;
|
|
break;
|
|
case 9:
|
|
uVar2 = (manager->_optionsConfig)._popupsMode + scrollStep;
|
|
if (GHIDRA_INT(uVar2) < 0) {
|
|
uVar2 = 2;
|
|
}
|
|
(manager->_optionsConfig)._popupsMode = -GHIDRA_UINT((uVar2 < 3)) & uVar2;
|
|
break;
|
|
case 0xb:
|
|
iVar3 = (manager->_optionsConfig)._cameraStyle + scrollStep;
|
|
iVar7 = iVar3 + 1;
|
|
if (scrollStep != 0) {
|
|
iVar7 = iVar3;
|
|
}
|
|
if (iVar7 < 3) {
|
|
if (iVar7 < 1) {
|
|
iVar7 = 2;
|
|
}
|
|
(manager->_optionsConfig)._cameraStyle = iVar7;
|
|
}
|
|
else {
|
|
(manager->_optionsConfig)._cameraStyle = 1;
|
|
}
|
|
break;
|
|
case 0xc:
|
|
(manager->_optionsConfig)._historyHudMode =
|
|
((manager->_optionsConfig)._historyHudMode + scrollStep + 3) % 3;
|
|
if (isPauseMenu == '\0') break;
|
|
HUD::mark_all_slots_dirty(&g_game->_hud,1,0);
|
|
goto LAB_009b300c;
|
|
case 0xd:
|
|
local_30 = GHIDRA_CAST<Manager *>(0x0);
|
|
local_1c = GHIDRA_CAST<Manager *>(0x3f800000);
|
|
local_34 = GHIDRA_CAST<Manager *>(((float)scrollStep * 0.1 + (manager->_optionsConfig)._hudOffset));
|
|
ppMVar4 = &local_34;
|
|
if ((float)local_34 <= 0.0) {
|
|
ppMVar4 = &local_30;
|
|
}
|
|
ppMVar5 = &local_1c;
|
|
if ((float)*ppMVar4 <= 1.0 && (float)*ppMVar4 != 1.0) {
|
|
ppMVar5 = ppMVar4;
|
|
}
|
|
(manager->_optionsConfig)._hudOffset = (float)*ppMVar5;
|
|
LAB_009b2c21:
|
|
local_1c = GHIDRA_CAST<Manager *>(0xed);
|
|
seed_fart_sound_override(GHIDRA_CAST<int *>(&local_1c));
|
|
(GHIDRA_CAST<SoundEffects *>((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_1c),1.0,0,0,1.0,0.0);
|
|
LAB_009b300c:
|
|
manager = g_manager;
|
|
break;
|
|
case 0xe:
|
|
(manager->_optionsConfig)._enableFoundHUD = (manager->_optionsConfig)._enableFoundHUD == 0;
|
|
break;
|
|
case 0xf:
|
|
(manager->_optionsConfig)._enableRumble = (manager->_optionsConfig)._enableRumble == 0;
|
|
break;
|
|
case 0x10:
|
|
(manager->_optionsConfig)._enableChargeBars = (manager->_optionsConfig)._enableChargeBars == 0;
|
|
break;
|
|
case 0x11:
|
|
(manager->_optionsConfig)._enableBulletVisibility =
|
|
(manager->_optionsConfig)._enableBulletVisibility == 0;
|
|
break;
|
|
case 0x12:
|
|
(manager->_optionsConfig)._enableAimLock = (manager->_optionsConfig)._enableAimLock == 0;
|
|
break;
|
|
case 0x13:
|
|
scrollStep = (manager->_optionsConfig)._touchMode + scrollStep;
|
|
if (scrollStep < 1) {
|
|
(manager->_optionsConfig)._touchMode = 1;
|
|
}
|
|
else {
|
|
if (2 < scrollStep) {
|
|
scrollStep = 2;
|
|
}
|
|
(manager->_optionsConfig)._touchMode = scrollStep;
|
|
}
|
|
break;
|
|
case 0x14:
|
|
uVar2 = (manager->_optionsConfig)._jacobEsauControls + scrollStep;
|
|
if (GHIDRA_INT(uVar2) < 0) {
|
|
uVar2 = 1;
|
|
}
|
|
(manager->_optionsConfig)._jacobEsauControls = -GHIDRA_UINT((uVar2 < 2)) & uVar2;
|
|
break;
|
|
case 0x15:
|
|
uVar2 = (manager->_optionsConfig)._onlineHud + scrollStep;
|
|
if (GHIDRA_INT(uVar2) < 0) {
|
|
uVar2 = 3;
|
|
}
|
|
onlineHudMode = 0;
|
|
if (uVar2 < 4) {
|
|
onlineHudMode = uVar2;
|
|
}
|
|
(manager->_optionsConfig)._onlineHud = onlineHudMode;
|
|
break;
|
|
case 0x16:
|
|
(manager->_optionsConfig)._streamerMode = (manager->_optionsConfig)._streamerMode == 0;
|
|
break;
|
|
case 0x17:
|
|
(manager->_optionsConfig)._onlineChatEnabled = (manager->_optionsConfig)._onlineChatEnabled == 0
|
|
;
|
|
break;
|
|
case 0x18:
|
|
FUN_00923fa0((manager->_optionsConfig)._onlinePlayerVolume + scrollStep);
|
|
break;
|
|
case 0x19:
|
|
FUN_00923fd0((manager->_optionsConfig)._onlinePlayerOpacity + scrollStep);
|
|
break;
|
|
case 0x1a:
|
|
scrollStep = (manager->_optionsConfig)._onlineColorSet + scrollStep;
|
|
if (scrollStep < 0) {
|
|
(manager->_optionsConfig)._onlineColorSet = 3;
|
|
}
|
|
else {
|
|
if (3 < scrollStep) {
|
|
scrollStep = 0;
|
|
}
|
|
(manager->_optionsConfig)._onlineColorSet = scrollStep;
|
|
}
|
|
break;
|
|
case 0x1b:
|
|
FUN_00925bc0((manager->_optionsConfig)._onlineInputDelay + scrollStep);
|
|
break;
|
|
case 0x1c:
|
|
(manager->_optionsConfig)._itemInfoDisplayEnabled =
|
|
(manager->_optionsConfig)._itemInfoDisplayEnabled == 0;
|
|
}
|
|
switchD_009b2b40_caseD_a:
|
|
if ((*GHIDRA_CAST<int *>(this) == 1) || (*GHIDRA_CAST<int *>(this) == 2)) {
|
|
if (manager->_netplayManager == *GHIDRA_CAST<int *>((manager + 1))) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer((g_game->_pauseScreen)._playerIdx);
|
|
scrollStep = player->_controllerIndex;
|
|
}
|
|
else {
|
|
scrollStep = (GHIDRA_CAST<InputManager *>((&manager->_netplayManager)))->InputManager::FirstLocalDeviceID();
|
|
}
|
|
}
|
|
else {
|
|
scrollStep = -1;
|
|
}
|
|
local_34 = GHIDRA_CAST<Manager *>(0x14);
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollStep,FUN_00a20940,&local_34,0,0);
|
|
if (isTriggered == '\0') {
|
|
this->HoldLeftCounter = 0;
|
|
}
|
|
else {
|
|
this->HoldLeftCounter = this->HoldLeftCounter + 1;
|
|
}
|
|
local_34 = GHIDRA_CAST<Manager *>(0x15);
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollStep,FUN_00a20940,&local_34,0,0);
|
|
if (isTriggered == '\0') {
|
|
this->HoldRightCounter = 0;
|
|
}
|
|
else {
|
|
this->HoldRightCounter = this->HoldRightCounter + 1;
|
|
}
|
|
local_34 = GHIDRA_CAST<Manager *>(0x16);
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollStep,FUN_00a20940,&local_34,0,0);
|
|
if (isTriggered == '\0') {
|
|
actionId = 0x17;
|
|
isTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))(scrollStep,FUN_00a20940,&actionId,0,0);
|
|
if (isTriggered == '\0') {
|
|
this->HoldUpDownCounter = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
}
|
|
this->HoldUpDownCounter = this->HoldUpDownCounter + 1;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009b31c0
|
|
void Menu_Options::Render()
|
|
{
|
|
Menu_Options *font = this;
|
|
KColor color;
|
|
Vector position;
|
|
Vector position_00;
|
|
uint8_t bVar1;
|
|
char *animName;
|
|
int iVar2;
|
|
float *optionPositionsFrame;
|
|
LayerState *pLVar3;
|
|
void *pvVar4;
|
|
void *renderer;
|
|
uint32_t *shaderEntry;
|
|
uint8_t *str;
|
|
int extraout_ECX;
|
|
int extraout_ECX_00;
|
|
int extraout_ECX_01;
|
|
int extraout_ECX_02;
|
|
AnimationState *lastAnimState;
|
|
int unused;
|
|
ANM2 *sprite;
|
|
bool isOptionOff;
|
|
long double roundedSpacing;
|
|
float fVar5;
|
|
double dVar6;
|
|
uint8_t screenQuad [112];
|
|
uint8_t glyphRun [16];
|
|
float touchModeCounterX;
|
|
float touchModeCounterY;
|
|
float gammaCounterX;
|
|
float gammaCounterY;
|
|
float sfxVolume;
|
|
float optionSpacing;
|
|
uint32_t local_80;
|
|
uint32_t local_7c;
|
|
uint32_t local_78;
|
|
uint32_t local_74;
|
|
KColor local_70;
|
|
Vector optionPos;
|
|
float musicVolume;
|
|
float optionsOriginY;
|
|
float local_4c;
|
|
float local_48;
|
|
float optionsOriginX;
|
|
float menuY;
|
|
float menuX;
|
|
int local_38;
|
|
Vector local_34;
|
|
float local_2c;
|
|
uint32_t local_28;
|
|
float local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Font *font;
|
|
Manager *manager;
|
|
uint32_t shaderStackSize;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0e488;
|
|
local_1c = ExceptionList;
|
|
ExceptionList = &local_1c;
|
|
iVar2 = *GHIDRA_CAST<int *>(font);
|
|
if ((iVar2 == 1) || (iVar2 == 2)) {
|
|
menuX = (g_screenWidth - 480.0) * 0.5 + font->PositionX;
|
|
menuY = (g_screenHeight - 270.0) * 0.5 + font->PositionY;
|
|
local_34.x = menuX;
|
|
local_34.y = menuY;
|
|
pLVar3 = ANM2::GetLayer(&font->OptionsSprite,GHIDRA_CAST<uint8_t *>(0x0));
|
|
local_70._red = 0.0;
|
|
local_70._green = 0.0;
|
|
local_70._blue = 0.0;
|
|
local_70._alpha = 0.60784316;
|
|
local_70._unk = 0;
|
|
pLVar3->_visible = 0;
|
|
pvVar4 = render_quad_set_uniform_color
|
|
(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,&local_70);
|
|
render_color_shader_pass(pvVar4);
|
|
iVar2 = *GHIDRA_CAST<int *>(font);
|
|
}
|
|
else {
|
|
menuX = (g_menuManager->_ViewPosition).x + font->PositionX;
|
|
menuY = (g_menuManager->_ViewPosition).y + font->PositionY;
|
|
local_34.x = menuX;
|
|
local_34.y = menuY;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
}
|
|
sprite = &font->OptionsSprite;
|
|
animName = "Background";
|
|
if (iVar2 == 3) {
|
|
animName = "BackgroundMultiplayer";
|
|
}
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
if ((font->OptionsSprite)._loaded != 0) {
|
|
if ((font->OptionsSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
menuY = local_34.y;
|
|
menuX = local_34.x;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
menuY = local_34.y;
|
|
menuX = local_34.x;
|
|
}
|
|
}
|
|
local_34.y = menuY + 16.0;
|
|
iVar2 = *GHIDRA_CAST<int *>((font[1].OptionsSprite._filename._buf + 4)) -
|
|
*GHIDRA_CAST<int *>(font[1].OptionsSprite._filename._buf);
|
|
local_34.x = menuX + 240.0;
|
|
local_4c = (float)((double)(iVar2 >> 2) + __uint_to_double_fixup[-(iVar2 >> 0x1f)]);
|
|
local_2c = ((local_4c * 20.0 - 52.0) - 52.0) / 52.0;
|
|
dVar6 = ceil((double)local_2c);
|
|
local_2c = (float)dVar6;
|
|
local_38 = __ftoui3();
|
|
local_2c = ((float)((double)local_38 + __uint_to_double_fixup[-(local_38 >> 0x1f)]) * 52.0 + 52.0
|
|
+ 52.0) / local_4c;
|
|
roundedSpacing = (long double)roundf(local_2c);
|
|
optionSpacing = (float)roundedSpacing;
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PaperTop"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
if ((font->OptionsSprite)._loaded != 0) {
|
|
if ((font->OptionsSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = &(font->OptionsSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = &(font->OptionsSprite)._animState;
|
|
}
|
|
AnimationState::Render(lastAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
local_34.y = local_34.y + 100.0;
|
|
for (; local_38 != 0; local_38 = local_38 + -1) {
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PaperMiddle"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
if ((font->OptionsSprite)._loaded != 0) {
|
|
if ((font->OptionsSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = &(font->OptionsSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = &(font->OptionsSprite)._animState;
|
|
}
|
|
AnimationState::Render(lastAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
local_34.y = local_34.y + 52.0;
|
|
}
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PaperBottom"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
if ((font->OptionsSprite)._loaded != 0) {
|
|
if ((font->OptionsSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._animState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = &(font->OptionsSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._overlayAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = &(font->OptionsSprite)._animState;
|
|
}
|
|
AnimationState::Render(lastAnimState,&local_34,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
optionsOriginY = 0.0;
|
|
optionsOriginX = 0.0;
|
|
optionPositionsFrame = ANM2::GetNullFrame(sprite,GHIDRA_CAST<uint8_t *>("Background"),GHIDRA_CAST<uint8_t *>("OptionPositions"),0)
|
|
;
|
|
if (optionPositionsFrame != GHIDRA_CAST<float *>(0x0)) {
|
|
optionsOriginX = *optionPositionsFrame;
|
|
optionsOriginY = optionPositionsFrame[1];
|
|
}
|
|
if ((g_manager->_musicManager)._isEnabled == 0) {
|
|
fVar5 = 0.0;
|
|
}
|
|
else {
|
|
fVar5 = (g_manager->_optionsConfig)._musicVolume;
|
|
}
|
|
local_2c = fVar5 * 10.0 + 0.5;
|
|
dVar6 = floor((double)local_2c);
|
|
musicVolume = (float)dVar6;
|
|
local_2c = (g_manager->_optionsConfig)._sfxVolume * 10.0 + 0.5;
|
|
dVar6 = floor((double)local_2c);
|
|
sfxVolume = (float)dVar6;
|
|
local_2c = (g_manager->_optionsConfig)._mapOpacity * 10.0 + 0.5;
|
|
dVar6 = floor((double)local_2c);
|
|
local_4c = (float)dVar6;
|
|
local_2c = (g_manager->_optionsConfig)._hudOffset * 10.0 + 0.5;
|
|
dVar6 = floor((double)local_2c);
|
|
local_2c = (float)dVar6;
|
|
local_48 = (g_manager->_optionsConfig)._gamma * 100.0 + 0.5;
|
|
dVar6 = floor((double)local_48);
|
|
local_34.y = (float)dVar6;
|
|
iVar2 = *GHIDRA_CAST<int *>(font[1].OptionsSprite._filename._buf);
|
|
local_38 = 0;
|
|
if (0 < *GHIDRA_CAST<int *>((font[1].OptionsSprite._filename._buf + 4)) - iVar2 >> 2) {
|
|
optionsOriginX = optionsOriginX + 0.0;
|
|
do {
|
|
local_48 = (float)local_38 * optionSpacing + optionsOriginY;
|
|
switch(*GHIDRA_CAST<uint32_t *>((iVar2 + local_38 * 4))) {
|
|
case 0:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Controls"),1);
|
|
if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
fVar5 = 0.0;
|
|
LAB_009b4475:
|
|
AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,fVar5);
|
|
if ((font->OptionsSprite)._animState._animData != (void *)0x0) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
}
|
|
break;
|
|
case 1:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("ChangeController"),1);
|
|
if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
fVar5 = 0.0;
|
|
goto LAB_009b4475;
|
|
}
|
|
break;
|
|
case 2:
|
|
bVar1 = ANM2::SetAnimation(sprite,&DAT_00b7e490,1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_28 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 0x44));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_28) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_28))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + local_28 * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,local_28,(float)GHIDRA_INT(sfxVolume));
|
|
}
|
|
break;
|
|
case 3:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Music"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_28 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 0x44));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_28) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_28))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + local_28 * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,local_28,(float)GHIDRA_INT(musicVolume));
|
|
}
|
|
break;
|
|
case 4:
|
|
animName = "MapOpacity";
|
|
goto LAB_009b39a1;
|
|
case 5:
|
|
animName = "PenOpacity";
|
|
LAB_009b39a1:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_28 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 0x44));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_28) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_28))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + local_28 * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,local_28,(float)GHIDRA_INT(local_4c));
|
|
}
|
|
break;
|
|
case 6:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Fullscreen"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_24 = (float)GHIDRA_UINT(((g_manager->_optionsConfig)._isFullscreen == 0));
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_28 = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar4) + 0x48));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_28) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_28))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + local_28 * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,local_28,(float)GHIDRA_INT(local_24));
|
|
}
|
|
break;
|
|
case 7:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Filter"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._filterEnabled == 0;
|
|
goto LAB_009b3b5d;
|
|
case 8:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Gamma"),1);
|
|
iVar2 = extraout_ECX;
|
|
if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0);
|
|
iVar2 = extraout_ECX_00;
|
|
if ((font->OptionsSprite)._animState._animData != (void *)0x0) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
}
|
|
gammaCounterX = optionsOriginX + menuX + 50.0;
|
|
gammaCounterY = local_48 + menuY + 0.0;
|
|
position.y = gammaCounterY;
|
|
position.x = gammaCounterX;
|
|
render_counter(font,GHIDRA_INT(local_34.y),iVar2,position);
|
|
break;
|
|
case 9:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Popups"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
iVar2 = (g_manager->_optionsConfig)._popupsMode;
|
|
if (iVar2 == 1) {
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x48));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_24) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_24))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + GHIDRA_INT(local_24) * 4))
|
|
= 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,GHIDRA_INT(local_24),0.0);
|
|
}
|
|
}
|
|
else {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
if (iVar2 == 2) {
|
|
if ((pvVar4 != (void *)0x0) &&
|
|
((4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x48));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_24) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_24))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*(uint32_t *)
|
|
(GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + GHIDRA_INT(local_24) * 4) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,GHIDRA_INT(local_24),1.0);
|
|
}
|
|
}
|
|
else if ((pvVar4 != (void *)0x0) &&
|
|
((4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x48));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_24) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_24))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + GHIDRA_INT(local_24) * 4))
|
|
= 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,GHIDRA_INT(local_24),2.0);
|
|
}
|
|
}
|
|
break;
|
|
case 0xb:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("ActiveCam"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_28 = GHIDRA_UINT(((g_manager->_optionsConfig)._cameraStyle != 1));
|
|
goto LAB_009b3b63;
|
|
case 0xc:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("ExtraHUD"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_28 = (g_manager->_optionsConfig)._historyHudMode;
|
|
goto LAB_009b3b63;
|
|
case 0xd:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("HUDOffset"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_28 = GHIDRA_UINT(((float)GHIDRA_INT(local_2c) != 10.0));
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x48));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_24) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_24))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + GHIDRA_INT(local_24) * 4)) =
|
|
0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,GHIDRA_INT(local_24),(float)GHIDRA_INT(local_28));
|
|
}
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
3 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x44));
|
|
if ((pvVar4 == (void *)0x0) ||
|
|
((GHIDRA_INT(local_24) < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_24))))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + GHIDRA_INT(local_24) * 4)) =
|
|
0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,GHIDRA_INT(local_24),(float)GHIDRA_INT(local_2c));
|
|
}
|
|
break;
|
|
case 0xe:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("FoundHUD"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._enableFoundHUD == 0;
|
|
goto LAB_009b3b5d;
|
|
case 0xf:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("Rumble"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._enableRumble == 0;
|
|
goto LAB_009b3b5d;
|
|
case 0x10:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("ChargeBars"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._enableChargeBars == 0;
|
|
goto LAB_009b3b5d;
|
|
case 0x11:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("BulletVisibility"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._enableBulletVisibility == 0;
|
|
goto LAB_009b3b5d;
|
|
case 0x12:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("AimLock"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._enableAimLock == 0;
|
|
goto LAB_009b3b5d;
|
|
case 0x13:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("TouchMode"),1);
|
|
iVar2 = extraout_ECX_01;
|
|
if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0);
|
|
iVar2 = extraout_ECX_02;
|
|
if ((font->OptionsSprite)._animState._animData != (void *)0x0) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
}
|
|
touchModeCounterY = local_48 + menuY + 0.0;
|
|
touchModeCounterX = optionsOriginX + menuX + 70.0;
|
|
position_00.y = touchModeCounterY;
|
|
position_00.x = touchModeCounterX;
|
|
render_counter(font,(g_manager->_optionsConfig)._touchMode,iVar2,position_00);
|
|
break;
|
|
case 0x14:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("JacobEsauControl"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_28 = GHIDRA_UINT(((g_manager->_optionsConfig)._jacobEsauControls != 1));
|
|
goto LAB_009b3b63;
|
|
case 0x15:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("MultiplayerHUD"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_28 = (g_manager->_optionsConfig)._onlineHud;
|
|
goto LAB_009b3b63;
|
|
case 0x16:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("StreamerMode"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._streamerMode == 0;
|
|
goto LAB_009b3b5d;
|
|
case 0x17:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("EnableChat"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._onlineChatEnabled == 0;
|
|
goto LAB_009b3b5d;
|
|
case 0x18:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PlayerSound"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_28 = (g_manager->_optionsConfig)._onlinePlayerVolume;
|
|
goto LAB_009b434b;
|
|
case 0x19:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PlayerOpacity"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_28 = (g_manager->_optionsConfig)._onlinePlayerOpacity;
|
|
LAB_009b434b:
|
|
if (((font->OptionsSprite)._animState._animData == (void *)0x0) ||
|
|
((*GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) < 4 &&
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) < 4)))) break;
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x44));
|
|
goto LAB_009b3ba4;
|
|
case 0x1a:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("PlayerColors"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
local_24 = (float)(g_manager->_optionsConfig)._onlineColorSet;
|
|
pLVar3 = ANM2::GetLayer(sprite,GHIDRA_CAST<uint8_t *>("OnOff2"));
|
|
if (pLVar3 == GHIDRA_CAST<LayerState *>(0x0)) {
|
|
KAGE_LogMessage(4,GHIDRA_CAST<uint8_t *>("[warn] no layer named %s\n"));
|
|
}
|
|
else {
|
|
ANM2::SetLayerFrame(sprite,*GHIDRA_CAST<int *>(pLVar3->_layerData),GHIDRA_INT(local_24));
|
|
}
|
|
break;
|
|
case 0x1b:
|
|
local_24 = (float)(g_manager->_optionsConfig)._onlineInputDelay;
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("InputDelay"),1);
|
|
if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
fVar5 = (float)GHIDRA_INT(local_24);
|
|
goto LAB_009b4475;
|
|
}
|
|
break;
|
|
case 0x1c:
|
|
bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST<uint8_t *>("ItemDescriptions"),1);
|
|
if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) &&
|
|
(AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0),
|
|
(font->OptionsSprite)._animState._animData != (void *)0x0)) {
|
|
(font->OptionsSprite)._animState._isPlaying = 0;
|
|
}
|
|
isOptionOff = (g_manager->_optionsConfig)._itemInfoDisplayEnabled == 0;
|
|
LAB_009b3b5d:
|
|
local_28 = GHIDRA_UINT(isOptionOff);
|
|
LAB_009b3b63:
|
|
if (((font->OptionsSprite)._animState._animData != (void *)0x0) &&
|
|
((4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
4 < *GHIDRA_CAST<int *>((GHIDRA_INT((font->OptionsSprite)._animState._animation) + 0x80)))))) {
|
|
pvVar4 = (font->OptionsSprite)._animState._animData;
|
|
local_24 = *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x48));
|
|
LAB_009b3ba4:
|
|
if (((pvVar4 == (void *)0x0) || (GHIDRA_INT(local_24) < 0)) ||
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar4) + 0x1c)) <= GHIDRA_INT(local_24))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((font->OptionsSprite)._animState._layerFrames) + GHIDRA_INT(local_24) * 4)) =
|
|
0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(font->OptionsSprite)._animState,GHIDRA_INT(local_24),(float)GHIDRA_INT(local_28));
|
|
}
|
|
}
|
|
if (local_38 == font->SelectedElement) {
|
|
pLVar3 = ANM2::GetLayer(sprite,&DAT_00000005);
|
|
pLVar3->_visible = 1;
|
|
}
|
|
else {
|
|
pLVar3 = ANM2::GetLayer(sprite,&DAT_00000005);
|
|
pLVar3->_visible = 0;
|
|
}
|
|
optionPos.x = optionsOriginX + menuX;
|
|
optionPos.y = local_48 + menuY;
|
|
if ((font->OptionsSprite)._loaded != 0) {
|
|
if ((font->OptionsSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._animState,&optionPos,&g_vectorZero,&g_vectorZero);
|
|
lastAnimState = &(font->OptionsSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(font->OptionsSprite)._overlayAnimState,&optionPos,&g_vectorZero,&g_vectorZero
|
|
);
|
|
lastAnimState = &(font->OptionsSprite)._animState;
|
|
}
|
|
AnimationState::Render(lastAnimState,&optionPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
iVar2 = *GHIDRA_CAST<int *>(font[1].OptionsSprite._filename._buf);
|
|
local_38 = local_38 + 1;
|
|
} while (local_38 < *GHIDRA_CAST<int *>((font[1].OptionsSprite._filename._buf + 4)) - iVar2 >> 2);
|
|
}
|
|
if (*GHIDRA_CAST<char *>((font + 1)) != '\0') {
|
|
fVar5 = 0.0;
|
|
local_70._red = 0.0;
|
|
local_70._green = 0.0;
|
|
local_70._blue = 0.0;
|
|
local_70._alpha = 0.5;
|
|
local_70._unk = 0;
|
|
pvVar4 = render_quad_set_uniform_color
|
|
(screenQuad,0.0,0.0,g_screenWidth,g_screenHeight,&local_70);
|
|
if ((*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x40)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x2c)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x54)) + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(pvVar4) + 0x68))) * 0.25 != fVar5) {
|
|
shader_push(GHIDRA_CAST<uint8_t *>("KAGE_ColorShader"));
|
|
local_70._red = 0.0;
|
|
local_80 = 0;
|
|
local_74 = 0;
|
|
local_7c = 0;
|
|
local_70._blue = 1.0;
|
|
local_78 = 0x3f800000;
|
|
local_70._alpha = 1.0;
|
|
local_70._green = 1.0;
|
|
local_70._unk = local_70._unk & 0xffffff00;
|
|
renderer = kage_graphics_flush((void *)0x0);
|
|
render_quad_draw(renderer,&local_80,pvVar4,1,unused);
|
|
if (g_shaderStackSize == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Shader stack empty\n"));
|
|
}
|
|
shaderStackSize = g_shaderStackSize;
|
|
shaderEntry = GHIDRA_CAST<uint32_t *>(FUN_00684fc0());
|
|
g_shaderStackSize = shaderStackSize - 1;
|
|
g_currentShader = (void *)*shaderEntry;
|
|
if (g_shaderStackSize == 0) {
|
|
DAT_00c379d8 = 0;
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
font = &g_manager->_font2_TeamMeatEx12;
|
|
str = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST<uint8_t *>("#LOADING"));
|
|
iVar2 = Font::get_string_width_n(font,str,-1);
|
|
local_78 = 0;
|
|
local_74 = 0xffff;
|
|
local_70._red = 0.0;
|
|
local_70._green = 1.0;
|
|
local_70._blue = -NAN;
|
|
local_70._alpha = 0.0;
|
|
local_70._unk = 0;
|
|
local_14 = 0;
|
|
local_34.y = (g_screenHeight - (float)(uint16_t)(manager->_font2_TeamMeatEx12)._lineHeight) * 0.5;
|
|
local_24 = (g_screenWidth - (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])) *
|
|
0.5;
|
|
pvVar4 = Font::measure_string(font,glyphRun,str,&local_78,&g_vectorOne);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
color._blue = 1.0;
|
|
color._red = 1.0;
|
|
color._green = 1.0;
|
|
color._alpha = 1.0;
|
|
color._unk = 0;
|
|
Font::render_glyph_quads(font,pvVar4,local_24,local_34.y,1.0,1.0,color,&local_78);
|
|
msvc::vector<12byte>::clear();
|
|
msvc::vector<12byte>::_Tidy();
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009b4810
|
|
void Menu_Options::load_graphics()
|
|
{
|
|
uint8_t bVar1;
|
|
PersistentGameData *persistentGameData;
|
|
LayerState *layer;
|
|
uint8_t *nameText;
|
|
char *pcVar2;
|
|
int layerCount;
|
|
uint32_t uVar3;
|
|
std_string *haystack;
|
|
uint8_t *pbVar4;
|
|
bool isLess;
|
|
uint32_t optionId;
|
|
std_string path;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
void *layerData;
|
|
uint32_t *optionIdsEnd;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af19c5;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>(this[1].OptionsSprite._filename._buf);
|
|
*GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4)) = optionIdsEnd;
|
|
if ((*GHIDRA_CAST<int *>(this) == 0) || (*GHIDRA_CAST<int *>(this) == 3)) {
|
|
optionId = 0;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8)))
|
|
goto LAB_009b489a;
|
|
*optionIdsEnd = 0;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
}
|
|
else {
|
|
optionId = 1;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
LAB_009b489a:
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 1;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>(this) != 3) {
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 2;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 2;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 3;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 3;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 4;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 4;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 6;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 6;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 7;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 7;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 8;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 8;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0xf;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0xf;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
persistentGameData =
|
|
GHIDRA_CAST<PersistentGameData *>((g_manager[1]._persistentGameData._achievements + 0xc));
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
persistentGameData = &g_manager->_persistentGameData;
|
|
}
|
|
if ((persistentGameData->_achievements[0x281] != 0) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x1c;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x1c;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
}
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 9;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 9;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0xb;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0xb;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0xc;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0xc;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(this) != 3) {
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0xd;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0xd;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0xe;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0xe;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
if (*GHIDRA_CAST<int *>(this) != 3) {
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x10;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x10;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x11;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x11;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x14;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x14;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>(this) == 1) {
|
|
LAB_009b4d28:
|
|
layerCount = (this->OptionsSprite)._layerCount;
|
|
pbVar4 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
if (0 < layerCount) {
|
|
do {
|
|
layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4);
|
|
layerData = layer->_layerData;
|
|
if (layerData == (void *)0x0) {
|
|
nameText = &s_empty;
|
|
}
|
|
else {
|
|
nameText = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(layerData) + 8));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(layerData) + 0x1c))) {
|
|
nameText = *GHIDRA_CAST<uint8_t **>(nameText);
|
|
}
|
|
}
|
|
pcVar2 = strstr(GHIDRA_CAST<char *>(nameText),"Sketch");
|
|
if (pcVar2 != GHIDRA_CAST<char *>(0x0)) {
|
|
layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4);
|
|
layer->_visible = 0;
|
|
}
|
|
layerCount = (this->OptionsSprite)._layerCount;
|
|
pbVar4 = pbVar4 + 1;
|
|
} while (GHIDRA_INT(pbVar4) < layerCount);
|
|
}
|
|
pbVar4 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
if (0 < layerCount) {
|
|
do {
|
|
layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4);
|
|
haystack = &layer->_spriteSheetPath;
|
|
if (0xf < (layer->_spriteSheetPath)._capacity) {
|
|
haystack = *GHIDRA_CAST<std_string **>(haystack->_buf);
|
|
}
|
|
uVar3 = msvc::string::find(GHIDRA_CAST<uint8_t *>(haystack),(layer->_spriteSheetPath)._size,0,
|
|
GHIDRA_CAST<uint8_t *>("OptionsMenu.png"),0xf);
|
|
if (uVar3 != 0xffffffff) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
path._size = 0x24;
|
|
path._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0))),"gfx/ui/main menu/OptionsMenuDark.png",0x25);
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&this->OptionsSprite))))->Sprite::ReplaceSpritesheet(GHIDRA_INT(pbVar4),&path);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < path._capacity) {
|
|
uVar3 = path._capacity + 1;
|
|
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + -4));
|
|
uVar3 = path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) goto LAB_009b4f13;
|
|
}
|
|
operator_delete(pcVar2,uVar3);
|
|
}
|
|
}
|
|
pbVar4 = pbVar4 + 1;
|
|
} while (GHIDRA_INT(pbVar4) < (this->OptionsSprite)._layerCount);
|
|
}
|
|
ANM2::LoadGraphics(&this->OptionsSprite,(uint8_t)&this->OptionsSprite);
|
|
}
|
|
else {
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x15;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x15;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x16;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x16;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x17;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x17;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x18;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x18;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x19;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x19;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x1a;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x1a;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
optionIdsEnd = *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 4));
|
|
optionId = 0x1b;
|
|
if (optionIdsEnd == *GHIDRA_CAST<uint32_t **>((this[1].OptionsSprite._filename._buf + 8))) {
|
|
msvc::vector<4byte>::_Emplace_reallocate(optionIdsEnd,&optionId);
|
|
}
|
|
else {
|
|
*optionIdsEnd = 0x1b;
|
|
pcVar2 = this[1].OptionsSprite._filename._buf + 4;
|
|
*GHIDRA_CAST<int *>(pcVar2) = *GHIDRA_CAST<int *>(pcVar2) + 4;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>(this) == 1) || (*GHIDRA_CAST<int *>(this) == 2)) goto LAB_009b4d28;
|
|
}
|
|
path._size = 0;
|
|
path._capacity = 0xf;
|
|
path._buf[0] = '\0';
|
|
path._buf[1] = '\0';
|
|
path._buf[2] = '\0';
|
|
path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
path._size = 0x1f;
|
|
path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0))),"gfx/ui/main menu/GammaMenu.anm2",0x20);
|
|
local_14 = 1;
|
|
ANM2::Load(&this->GammaMenuSprite,&path,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < path._capacity) {
|
|
uVar3 = path._capacity + 1;
|
|
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(path._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + -4));
|
|
uVar3 = path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
|
|
LAB_009b4f13:
|
|
local_14 = 0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar2,uVar3);
|
|
}
|
|
pbVar4 = (this->GammaMenuSprite)._animState._animData;
|
|
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
nameText = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
nameText = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
pcVar2 = "Counter";
|
|
do {
|
|
bVar1 = *nameText;
|
|
isLess = bVar1 < (uint8_t)*pcVar2;
|
|
if (bVar1 != *pcVar2) {
|
|
LAB_009b4f60:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009b4f65;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = nameText[1];
|
|
isLess = bVar1 < (uint8_t)pcVar2[1];
|
|
if (bVar1 != pcVar2[1]) goto LAB_009b4f60;
|
|
nameText = nameText + 2;
|
|
pcVar2 = pcVar2 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_009b4f65:
|
|
if ((uVar3 == 0) &&
|
|
((pbVar4[0x34] == 0 || ((this->GammaMenuSprite)._animState._isPlaying != 0))))
|
|
goto LAB_009b4fa2;
|
|
}
|
|
bVar1 = ANM2::SetAnimation(&this->GammaMenuSprite,GHIDRA_CAST<uint8_t *>("Counter"),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->GammaMenuSprite)._animState);
|
|
(this->GammaMenuSprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_009b4fa2:
|
|
this->SelectedElement = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4))) = 0;
|
|
this->PositionX = this->PositionX_duplicate;
|
|
this->PositionY = this->PositionY_duplicate;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x1c)))) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x20)))) = g_vectorZero.y;
|
|
this->HoldLeftCounter = 0;
|
|
this->HoldRightCounter = 0;
|
|
this->HoldUpDownCounter = 0;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009b5020
|
|
void Menu_Options::render_counter(int value, int unused, Vector position)
|
|
{
|
|
Menu_Options *digitAnim = this;
|
|
AnimationState *pAVar1;
|
|
AnimationState *digitAnim;
|
|
uint32_t remainingValue;
|
|
int digitGroupCounter;
|
|
|
|
digitGroupCounter = 0;
|
|
digitAnim = &(digitAnim->GammaMenuSprite)._animState;
|
|
remainingValue = -value;
|
|
if (-1 < value) {
|
|
remainingValue = value;
|
|
}
|
|
do {
|
|
if ((digitAnim->GammaMenuSprite)._animState._animData != (void *)0x0) {
|
|
AnimationState::SetFrameFloat(digitAnim,(float)(GHIDRA_INT(remainingValue) % 10));
|
|
}
|
|
if ((digitAnim->GammaMenuSprite)._loaded != 0) {
|
|
if ((digitAnim->GammaMenuSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render(digitAnim,&position,&g_vectorZero,&g_vectorZero);
|
|
pAVar1 = &(digitAnim->GammaMenuSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(digitAnim->GammaMenuSprite)._overlayAnimState,&position,&g_vectorZero,&g_vectorZero)
|
|
;
|
|
pAVar1 = digitAnim;
|
|
}
|
|
AnimationState::Render(pAVar1,&position,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
position.x = position.x - 11.0;
|
|
remainingValue = GHIDRA_UINT(((GHIDRA_INT(remainingValue) / 10) * 10)) / 10;
|
|
position.y = position.y + 0.0;
|
|
digitGroupCounter = digitGroupCounter + -1;
|
|
if (digitGroupCounter == 0) {
|
|
if ((digitAnim->GammaMenuSprite)._animState._animData != (void *)0x0) {
|
|
AnimationState::SetFrameFloat(digitAnim,10.0);
|
|
}
|
|
if ((digitAnim->GammaMenuSprite)._loaded != 0) {
|
|
if ((digitAnim->GammaMenuSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render(digitAnim,&position,&g_vectorZero,&g_vectorZero);
|
|
pAVar1 = &(digitAnim->GammaMenuSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(digitAnim->GammaMenuSprite)._overlayAnimState,&position,&g_vectorZero,
|
|
&g_vectorZero);
|
|
pAVar1 = digitAnim;
|
|
}
|
|
AnimationState::Render(pAVar1,&position,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
position.x = position.x - 6.0;
|
|
position.y = position.y + 0.0;
|
|
}
|
|
} while ((remainingValue != 0) || (-1 < digitGroupCounter));
|
|
if (value < 0) {
|
|
if ((digitAnim->GammaMenuSprite)._animState._animData != (void *)0x0) {
|
|
AnimationState::SetFrameFloat(digitAnim,11.0);
|
|
}
|
|
if ((digitAnim->GammaMenuSprite)._loaded != 0) {
|
|
if ((digitAnim->GammaMenuSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render(digitAnim,&position,&g_vectorZero,&g_vectorZero);
|
|
digitAnim = &(digitAnim->GammaMenuSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(digitAnim->GammaMenuSprite)._overlayAnimState,&position,&g_vectorZero,&g_vectorZero)
|
|
;
|
|
}
|
|
AnimationState::Render(digitAnim,&position,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009b52a0
|
|
void Menu_Options::reload()
|
|
{
|
|
this->HoldLeftCounter = 1;
|
|
this->HoldRightCounter = 1;
|
|
this->HoldUpDownCounter = 1;
|
|
if (*GHIDRA_CAST<int *>(this) == 1) {
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) goto LAB_009b530a;
|
|
*GHIDRA_CAST<uint32_t *>(this) = 2;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>(this) != 2) || (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))))
|
|
goto LAB_009b530a;
|
|
*GHIDRA_CAST<uint32_t *>(this) = 1;
|
|
}
|
|
load_graphics(this);
|
|
LAB_009b530a:
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1])) + 0x20)))) = *GHIDRA_CAST<uint32_t *>(&g_manager->_stringTable);
|
|
return;
|
|
}
|