- 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>
5723 lines
262 KiB
C++
5723 lines
262 KiB
C++
#include "classes.h"
|
|
|
|
// 006fa540
|
|
void Manager::update_ingame_input()
|
|
{
|
|
Game *pGVar1;
|
|
Game *pGVar2;
|
|
uint8_t bVar3;
|
|
uint32_t uVar4;
|
|
char isActionHeld;
|
|
Entity_Player *player;
|
|
uint8_t *anim;
|
|
int netplayPeer;
|
|
PersistentGameData *saveData;
|
|
int *netplayManager;
|
|
KColor fadeColor;
|
|
float local_24;
|
|
float fStack_20;
|
|
float fStack_1c;
|
|
float fStack_18;
|
|
int local_10;
|
|
int local_c;
|
|
uint32_t playerIndex;
|
|
code *actionTriggeredFn;
|
|
float fadeAlpha;
|
|
bool isRestartReady;
|
|
Manager *manager;
|
|
int statsPlayersEnd;
|
|
|
|
pGVar1 = g_game;
|
|
actionTriggeredFn = *(code **)(PTR_vftable_00c57b18 + 0x44);
|
|
uVar4 = (**(code **)(PTR_vftable_00c57b18 + 0x14))(0xc);
|
|
isActionHeld = (*actionTriggeredFn)(uVar4,0,0);
|
|
if (isActionHeld != '\0') {
|
|
pGVar1->_triggerWindowResize = 1;
|
|
}
|
|
netplayManager = (pGVar1->_playerManager)._playerList._begin;
|
|
local_10 = (g_manager->_persistentGameData)._eventCounters[0x15];
|
|
if (GHIDRA_INT((pGVar1->_playerManager)._playerList._end) - GHIDRA_INT(netplayManager) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"));
|
|
netplayManager = (pGVar1->_playerManager)._playerList._begin;
|
|
}
|
|
local_c = *GHIDRA_CAST<int *>((*netplayManager + 0x13c0));
|
|
bVar3 = is_any_player_restart_held();
|
|
netplayManager = &g_manager->_netplayManager;
|
|
if ((*netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(1 < GHIDRA_UINT((*GHIDRA_CAST<int *>((g_manager + 1)) - *netplayManager >> 2)))) {
|
|
bVar3 = 1;
|
|
playerIndex = 0;
|
|
do {
|
|
statsPlayersEnd = *netplayManager;
|
|
if (GHIDRA_UINT((netplayManager[1] - statsPlayersEnd >> 2)) <= playerIndex) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Out of bounds\n"));
|
|
statsPlayersEnd = *netplayManager;
|
|
}
|
|
netplayManager = *GHIDRA_CAST<int **>((statsPlayersEnd + playerIndex * 4));
|
|
if ((netplayManager == GHIDRA_CAST<int *>(0x0)) || (statsPlayersEnd = FUN_004253d0(), statsPlayersEnd == 0)
|
|
) {
|
|
bVar3 = 0;
|
|
}
|
|
else {
|
|
isActionHeld = (**(code **)(*netplayManager + 0x30))(0x12);
|
|
player = GHIDRA_CAST<Entity_Player *>(FUN_004253d0());
|
|
if (isActionHeld == '\0') {
|
|
bVar3 = 0;
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26d8))) != '\0') && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26dc)))) == 0x14)) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26d8))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26dc)))) = 0x3c;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26e0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26e4)))) = 0;
|
|
}
|
|
}
|
|
else {
|
|
Player_stats_add(&g_game->_onlinePlayerStats,8,player,1.0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26d8))) = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26e4)))) = 0;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26dc)))) != 0x14) {
|
|
anim = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2af4)));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26dc)))) = 0x14;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x26e0)))) = 0;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2b08))))) {
|
|
anim = *GHIDRA_CAST<uint8_t **>(anim);
|
|
}
|
|
ANM2::Play(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2800)))),anim,0);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2909))) != '\0') {
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2830)))));
|
|
AnimationState::Update(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((player)) + 0x2850)))));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
playerIndex = playerIndex + 1;
|
|
netplayManager = &g_manager->_netplayManager;
|
|
} while (playerIndex < GHIDRA_UINT((*GHIDRA_CAST<int *>((g_manager + 1)) - *netplayManager >> 2)));
|
|
}
|
|
if (bVar3 == 0) {
|
|
pGVar1->_restartHoldFrames = 0;
|
|
}
|
|
else if (pGVar1->_fadeOutTarget != 6) {
|
|
pGVar1->_restartHoldFrames = pGVar1->_restartHoldFrames + 1;
|
|
}
|
|
if ((((local_c == 9) || (local_c == 0x1e)) && (local_10 == 0)) ||
|
|
(((pGVar1->_dailyChallenge)._id != 0 || (pGVar1->_restartHoldFrames < 0x10)))) {
|
|
isRestartReady = false;
|
|
}
|
|
else {
|
|
isRestartReady = true;
|
|
}
|
|
if (bVar3 == 0) {
|
|
if (pGVar1->_fadeOutTarget == 6) {
|
|
pGVar1->_fadeSpeed = 0.13333334;
|
|
pGVar1->_fadeOutTarget = 0;
|
|
}
|
|
}
|
|
else if ((isRestartReady) && (pGVar1->_fadeOutTarget != 6)) {
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
local_24 = fadeColor._red;
|
|
fStack_20 = fadeColor._green;
|
|
fStack_1c = fadeColor._blue;
|
|
fStack_18 = (pGVar1->_fadeOutColor)._alpha;
|
|
pGVar1->_fadeSpeed = 0.033333335;
|
|
pGVar1->_fadeOutTarget = 6;
|
|
(pGVar1->_fadeOutColor)._red = fadeColor._red;
|
|
(pGVar1->_fadeOutColor)._green = fadeColor._green;
|
|
(pGVar1->_fadeOutColor)._blue = fadeColor._blue;
|
|
(pGVar1->_fadeOutColor)._alpha = fStack_18;
|
|
(pGVar1->_fadeOutColor)._unk = 0;
|
|
fadeAlpha = (pGVar1->_fadeOutColor)._alpha;
|
|
pGVar1->_restartHoldFrames = 0;
|
|
(pGVar1->_fadeOutColor)._alpha = fadeAlpha + 0.033333335;
|
|
}
|
|
(GHIDRA_CAST<Console *>((GHIDRA_CAST<Console *>(&pGVar1->_console))))->Console::Update();
|
|
if (pGVar1->_console == 0) {
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) goto LAB_006fa894;
|
|
}
|
|
else {
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
return;
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((g_manager + 1)) - g_manager->_netplayManager & 0xfffffffcU) == 4) {
|
|
return;
|
|
}
|
|
LAB_006fa894:
|
|
(GHIDRA_CAST<EmoteWheel *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar1)) + 0x25108))))))->EmoteWheel::Update();
|
|
}
|
|
if (*GHIDRA_CAST<char *>(&pGVar1->_onlineStatsScreen) != '\0') {
|
|
uVar4 = 0xffffffff;
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
statsPlayersEnd = FUN_0090b070();
|
|
if (*GHIDRA_CAST<int *>((statsPlayersEnd + 0x378)) == 0) {
|
|
uVar4 = 0xdeadbeef;
|
|
}
|
|
else {
|
|
uVar4 = *GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((statsPlayersEnd + 0x378)) + 0xc));
|
|
}
|
|
}
|
|
if ((g_game == GHIDRA_CAST<Game *>(0x0)) || ((g_game->_dailyChallenge)._id == 0)) {
|
|
local_10 = 0xe;
|
|
isActionHeld = (**(code **)(PTR_vftable_00c57b18 + 0x74))(uVar4,FUN_00a209e0,&local_10,0,0);
|
|
if (isActionHeld == '\0') {
|
|
local_c = 0xf;
|
|
isActionHeld = (**(code **)(PTR_vftable_00c57b18 + 0x74))(uVar4,FUN_00a209e0,&local_c,0,0);
|
|
if (isActionHeld == '\0') goto LAB_006fa9cc;
|
|
}
|
|
online_vote_send(0);
|
|
}
|
|
else {
|
|
local_10 = 0xe;
|
|
isActionHeld = (**(code **)(PTR_vftable_00c57b18 + 0x74))(uVar4,FUN_00a209e0,&local_10,0,0);
|
|
if (isActionHeld != '\0') {
|
|
if (*GHIDRA_CAST<char *>(&pGVar1->_onlineStatsScreen) != '\0') {
|
|
statsPlayersEnd = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pGVar1->_onlineStatsScreen))) + 0x56c))));
|
|
netplayPeer = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pGVar1->_onlineStatsScreen))) + 0x568))));
|
|
if (netplayPeer != statsPlayersEnd) {
|
|
do {
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((netplayPeer + 8)))))->msvc::string::_Tidy_deallocate();
|
|
netplayPeer = netplayPeer + 0x38;
|
|
} while (netplayPeer != statsPlayersEnd);
|
|
netplayPeer = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pGVar1->_onlineStatsScreen))) + 0x568))));
|
|
}
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pGVar1->_onlineStatsScreen))) + 0x56c)))) = netplayPeer;
|
|
*GHIDRA_CAST<uint8_t *>(&pGVar1->_onlineStatsScreen) = 0;
|
|
}
|
|
FUN_006f9f20(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pGVar1)) + 0x25ec8)))));
|
|
}
|
|
}
|
|
LAB_006fa9cc:
|
|
manager = g_manager;
|
|
if ((g_game->_dailyChallenge)._id == 0) {
|
|
statsPlayersEnd = FUN_0091cb10();
|
|
(manager->_popupButtons)._buttons[1]._isVisible = statsPlayersEnd == 0;
|
|
}
|
|
else {
|
|
(g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[0]._slideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[1]._textFrame = 6;
|
|
(manager->_popupButtons)._buttons[1]._isVisible = 1;
|
|
}
|
|
if (*GHIDRA_CAST<char *>(&pGVar1->_onlineStatsScreen) != '\0') {
|
|
return;
|
|
}
|
|
}
|
|
isActionHeld = FUN_009c3990();
|
|
if (isActionHeld == '\0') {
|
|
if (*GHIDRA_CAST<int *>(&pGVar1->_gameOver) == 0) goto LAB_006fac27;
|
|
statsPlayersEnd = -1;
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(netplayPeer = FUN_0090b070(), netplayPeer != 0)) {
|
|
if (*GHIDRA_CAST<int *>((netplayPeer + 0x378)) == 0) {
|
|
statsPlayersEnd = -0x21524111;
|
|
}
|
|
else {
|
|
statsPlayersEnd = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((netplayPeer + 0x378)) + 0xc));
|
|
}
|
|
}
|
|
bVar3 = input_is_action_triggered(g_manager,0xe,statsPlayersEnd,GHIDRA_CAST<Entity *>(0x0),0);
|
|
if (bVar3 == 0) {
|
|
bVar3 = input_is_action_triggered(g_manager,0xf,statsPlayersEnd,GHIDRA_CAST<Entity *>(0x0),0);
|
|
manager = g_manager;
|
|
if (bVar3 != 0) {
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
pGVar2 = g_game;
|
|
local_24 = fadeColor._red;
|
|
fStack_20 = fadeColor._green;
|
|
fStack_1c = fadeColor._blue;
|
|
fStack_18 = (g_game->_fadeOutColor)._alpha;
|
|
g_game->_fadeSpeed = 0.08;
|
|
pGVar2->_fadeOutTarget = 2;
|
|
(pGVar2->_fadeOutColor)._red = fadeColor._red;
|
|
(pGVar2->_fadeOutColor)._green = fadeColor._green;
|
|
(pGVar2->_fadeOutColor)._blue = fadeColor._blue;
|
|
(pGVar2->_fadeOutColor)._alpha = fStack_18;
|
|
(pGVar2->_fadeOutColor)._unk = 0;
|
|
(pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08;
|
|
(manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0;
|
|
}
|
|
else {
|
|
online_vote_send(0);
|
|
}
|
|
}
|
|
}
|
|
else if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
input_poll_active_device();
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
pGVar2 = g_game;
|
|
local_24 = fadeColor._red;
|
|
fStack_20 = fadeColor._green;
|
|
fStack_1c = fadeColor._blue;
|
|
fStack_18 = (g_game->_fadeOutColor)._alpha;
|
|
g_game->_fadeSpeed = 0.08;
|
|
pGVar2->_fadeOutTarget = 5;
|
|
(pGVar2->_fadeOutColor)._red = fadeColor._red;
|
|
(pGVar2->_fadeOutColor)._green = fadeColor._green;
|
|
(pGVar2->_fadeOutColor)._blue = fadeColor._blue;
|
|
(pGVar2->_fadeOutColor)._alpha = fStack_18;
|
|
(pGVar2->_fadeOutColor)._unk = 0;
|
|
(pGVar2->_fadeOutColor)._alpha = (pGVar2->_fadeOutColor)._alpha + 0.08;
|
|
manager = g_manager;
|
|
(g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0;
|
|
}
|
|
else {
|
|
online_vote_send(0);
|
|
}
|
|
}
|
|
if (*GHIDRA_CAST<int *>(&pGVar1->_gameOver) != 0) {
|
|
return;
|
|
}
|
|
LAB_006fac27:
|
|
(GHIDRA_CAST<Leaderboard *>((&pGVar1->_leaderboard)))->Leaderboard::update_input();
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pGVar1->_leaderboard))) + 0x4)))) == 0) {
|
|
bVar3 = input_is_action_triggered(g_manager,0xe,-1,GHIDRA_CAST<Entity *>(0x0),0);
|
|
statsPlayersEnd = *GHIDRA_CAST<int *>(&pGVar1->_roomTransition);
|
|
if (statsPlayersEnd == 2) {
|
|
if ((pGVar1->_roomTransition)._bossIntroBossId == 0) {
|
|
return;
|
|
}
|
|
if (bVar3 == 0) {
|
|
return;
|
|
}
|
|
if ((pGVar1->_roomTransition)._versusScreenSprite._animState._animData == (void *)0x0) {
|
|
return;
|
|
}
|
|
(pGVar1->_roomTransition)._versusScreenSprite._animState._isPlaying = 0;
|
|
}
|
|
if (statsPlayersEnd == 0) {
|
|
if (((pGVar1->_genericPrompt)._sprite._animState._animData != (void *)0x0) &&
|
|
((pGVar1->_genericPrompt)._sprite._animState._isPlaying != 0)) {
|
|
(GHIDRA_CAST<GenericPrompt *>((&pGVar1->_genericPrompt)))->GenericPrompt::handle_input();
|
|
return;
|
|
}
|
|
if (((((pGVar1->_fadeInColor)._alpha <= 0.0) && (*GHIDRA_CAST<int *>(&pGVar1->_stageTransition) == 0)) &&
|
|
(*GHIDRA_CAST<int *>(&pGVar1->_gameOver) == 0)) &&
|
|
((*GHIDRA_CAST<char *>(&pGVar1->_onlineStatsScreen) == '\0' &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pGVar1->_leaderboard))) + 0x4)))) == 0)))) {
|
|
(GHIDRA_CAST<PauseScreen *>((&pGVar1->_pauseScreen)))->PauseScreen::Update();
|
|
bVar3 = is_single_player(&pGVar1->_pauseScreen);
|
|
if (bVar3 != 0) {
|
|
return;
|
|
}
|
|
coop_join_menu_update(&pGVar1->_revivePlayerMenu);
|
|
}
|
|
if ((pGVar1->_pauseScreen)._state == 0) {
|
|
saveData = GHIDRA_CAST<PersistentGameData *>((g_manager[1]._persistentGameData._achievements + 0xc));
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
saveData = &g_manager->_persistentGameData;
|
|
}
|
|
if ((saveData->_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)))))) {
|
|
local_10 = 0x1f;
|
|
isActionHeld = (**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(0xffffffff,FUN_00a209e0,&local_10,0,0);
|
|
if (isActionHeld != '\0') {
|
|
(g_manager->_optionsConfig)._itemInfoDisplayEnabled =
|
|
(g_manager->_optionsConfig)._itemInfoDisplayEnabled == 0;
|
|
}
|
|
}
|
|
}
|
|
(GHIDRA_CAST<PlayerManager *>((&pGVar1->_playerManager)))->PlayerManager::handle_coop_join();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009292c0
|
|
void Manager::BackupSaveFile()
|
|
{
|
|
uint8_t *saveFileName;
|
|
__time64_t now;
|
|
uint8_t backupPath [1280];
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0a9c0;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((backupPath + 0x510));
|
|
ExceptionList = &local_10;
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
now = _time64(GHIDRA_CAST<__time64_t *>(0x0));
|
|
_localtime64(&now);
|
|
saveFileName = (GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<PersistentGameData *>(this))))->PersistentGameData::get_save_file_name();
|
|
sprintf(&DAT_00c93e50,GHIDRA_CAST<uint8_t *>("%s/save_backups/"));
|
|
sprintf_s(backupPath,0x500,GHIDRA_CAST<uint8_t *>("%s%d.%s"));
|
|
local_8 = 0;
|
|
tracked_alloc(1,saveFileName,0);
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<PersistentGameData *>((GHIDRA_CAST<PersistentGameData *>(this))))->PersistentGameData::write_file(backupPath);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00950610
|
|
Manager * Manager::constructor()
|
|
{
|
|
std_map *psVar1;
|
|
AchievementOverlay *pAVar2;
|
|
OptionsConfig *pOVar3;
|
|
int *containerProxy;
|
|
int remaining;
|
|
void *headNode;
|
|
MusicChannel *entry;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint8_t *container;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0bd34;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
*GHIDRA_CAST<uint8_t *>(this) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 0;
|
|
(GHIDRA_CAST<PersistentGameData *>((&this->_persistentGameData)))->PersistentGameData::constructor();
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<GameState *>((&this->_gamestate)))->GameState::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
this->_isSavingGameState = 0;
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x4))),0x4c,0x1b,CutsceneEntry::Constructor,
|
|
CutsceneEntry::Destructor);
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x80c)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x810)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x81c))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x814)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x818)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x824)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x820)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0xc)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x10)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x14)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x18)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x1c)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x20)))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x134)))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
|
|
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_nightmareScene))) + 0x248)))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
|
|
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x219d0)))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
|
|
container = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x21ae8)));
|
|
*GHIDRA_CAST<uint32_t *>(container) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x21aec)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x21af0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x21af4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x21af8)))) = 0;
|
|
containerProxy = operator_new(8);
|
|
containerProxy[1] = 0;
|
|
*GHIDRA_CAST<int **>(container) = containerProxy;
|
|
*containerProxy = GHIDRA_INT(container);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 9;
|
|
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x21afc)))));
|
|
pAVar2 = &this->_achievementOverlay;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 10;
|
|
(pAVar2->_queue)._proxy = (void *)0x0;
|
|
(this->_achievementOverlay)._queue._map = (void *)0x0;
|
|
(this->_achievementOverlay)._queue._mapSize = 0;
|
|
(this->_achievementOverlay)._queue._offset = 0;
|
|
(this->_achievementOverlay)._queue._size = 0;
|
|
containerProxy = operator_new(8);
|
|
containerProxy[1] = 0;
|
|
(pAVar2->_queue)._proxy = containerProxy;
|
|
*containerProxy = GHIDRA_INT(pAVar2);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xb;
|
|
ANM2::constructor(&(this->_achievementOverlay)._sprite);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xc;
|
|
_eh_vector_constructor_iterator_
|
|
((this->_achievementOverlay)._entries,0x34,0x282,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00931490),
|
|
FUN_00420b00);
|
|
(this->_achievementOverlay)._currentEntry = 0;
|
|
(this->_achievementOverlay)._state = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xd;
|
|
entry = (this->_musicManager)._channels;
|
|
_eh_vector_constructor_iterator_(entry,0x184,2,FUN_007df300,FUN_007df3f0);
|
|
(this->_musicManager)._entries._begin = (void *)0x0;
|
|
(this->_musicManager)._entries._end = (void *)0x0;
|
|
(this->_musicManager)._entries._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0xf;
|
|
(GHIDRA_CAST<SoundInstance *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a2e8))))))->SoundInstance::SoundInstance();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a300)))) = 0x3f800000;
|
|
remaining = 2;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a304)))) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a308)))) = 0x3f800000;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a30c)))) = 0x3da3d70a;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a310))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a314)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a318)))) = 0;
|
|
(this->_musicManager)._currentChannel = 0;
|
|
(this->_musicManager)._queuedMusicID = 0;
|
|
(this->_musicManager)._pitch = 1.0;
|
|
(this->_musicManager)._targetPitch = 1.0;
|
|
(this->_musicManager)._currentMusicID = 0;
|
|
(this->_musicManager)._isEnabled = 1;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a320)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a31c)))) = 0x3f800000;
|
|
do {
|
|
*GHIDRA_CAST<MusicChannel **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entry)) + 0x30)))) = entry;
|
|
*GHIDRA_CAST<MusicChannel **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entry)) + 0x64)))) = entry;
|
|
*GHIDRA_CAST<MusicChannel **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entry)) + 0x98)))) = entry;
|
|
*GHIDRA_CAST<MusicChannel **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entry)) + 0xcc)))) = entry;
|
|
*GHIDRA_CAST<MusicChannel **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entry)) + 0x100)))) = entry;
|
|
*GHIDRA_CAST<MusicChannel **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entry)) + 0x134)))) = entry;
|
|
*GHIDRA_CAST<MusicChannel **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((entry)) + 0x168)))) = entry;
|
|
entry = entry + 1;
|
|
remaining = remaining + -1;
|
|
} while (remaining != 0);
|
|
(this->_sfxManager)._sounds._begin = (void *)0x0;
|
|
(this->_sfxManager)._sounds._end = (void *)0x0;
|
|
(this->_sfxManager)._sounds._capacity = (void *)0x0;
|
|
(this->_sfxManager)._volumeModifier = 1.0;
|
|
(this->_sfxManager)._volumeModifierStep = 0.005;
|
|
pOVar3 = &this->_optionsConfig;
|
|
(pOVar3->_optionsIniFilePath)._buf[0] = '\0';
|
|
(pOVar3->_optionsIniFilePath)._buf[1] = '\0';
|
|
(pOVar3->_optionsIniFilePath)._buf[2] = '\0';
|
|
(pOVar3->_optionsIniFilePath)._buf[3] = '\0';
|
|
(this->_optionsConfig)._optionsIniFilePath._size = 0;
|
|
(this->_optionsConfig)._optionsIniFilePath._capacity = 0xf;
|
|
(pOVar3->_optionsIniFilePath)._buf[0] = '\0';
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x12;
|
|
OptionsConfig::reset_defaults();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x13;
|
|
(GHIDRA_CAST<ItemConfig *>((&this->_itemConfig)))->ItemConfig::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x14;
|
|
(this->_infoDisplay)._collectibles._head = (void *)0x0;
|
|
(this->_infoDisplay)._collectibles._size = 0;
|
|
headNode = operator_new(0x128);
|
|
*(void **)headNode = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 4) = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 8) = headNode;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(headNode) + 0xc)) = 0x101;
|
|
(this->_infoDisplay)._collectibles._head = headNode;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x15;
|
|
psVar1 = &(this->_infoDisplay)._trinkets;
|
|
psVar1->_head = (void *)0x0;
|
|
(this->_infoDisplay)._trinkets._size = 0;
|
|
headNode = operator_new(0x128);
|
|
*(void **)headNode = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 4) = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 8) = headNode;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(headNode) + 0xc)) = 0x101;
|
|
psVar1->_head = headNode;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x16;
|
|
container = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_infoDisplay))) + 0x10)));
|
|
*GHIDRA_CAST<uint32_t *>(container) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_infoDisplay))) + 0x14)))) = 0;
|
|
headNode = operator_new(0x128);
|
|
*(void **)headNode = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 4) = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 8) = headNode;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(headNode) + 0xc)) = 0x101;
|
|
*(void **)container = headNode;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x17;
|
|
container = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_infoDisplay))) + 0x18)));
|
|
*GHIDRA_CAST<uint32_t *>(container) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_infoDisplay))) + 0x1c)))) = 0;
|
|
headNode = operator_new(0x128);
|
|
*(void **)headNode = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 4) = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 8) = headNode;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(headNode) + 0xc)) = 0x101;
|
|
*(void **)container = headNode;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x18;
|
|
(GHIDRA_CAST<InfoDisplayEntry *>((&(this->_infoDisplay)._defaultEntry)))->InfoDisplayEntry::InfoDisplayEntry();
|
|
(this->_challengeParams)._begin = (void *)0x0;
|
|
(this->_challengeParams)._end = (void *)0x0;
|
|
(this->_challengeParams)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x1a;
|
|
(this->_entityConfig)._entities._head = (void *)0x0;
|
|
(this->_entityConfig)._entities._size = 0;
|
|
headNode = operator_new(0x180);
|
|
*(void **)headNode = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 4) = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 8) = headNode;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(headNode) + 0xc)) = 0x101;
|
|
(this->_entityConfig)._entities._head = headNode;
|
|
(this->_entityConfig)._players._begin = (void *)0x0;
|
|
(this->_entityConfig)._players._end = (void *)0x0;
|
|
(this->_entityConfig)._players._capacity = (void *)0x0;
|
|
(this->_entityConfig)._babies._begin = (void *)0x0;
|
|
(this->_entityConfig)._babies._end = (void *)0x0;
|
|
(this->_entityConfig)._babies._capacity = (void *)0x0;
|
|
(this->_entityConfig)._bosses._begin = (void *)0x0;
|
|
(this->_entityConfig)._bosses._end = (void *)0x0;
|
|
(this->_entityConfig)._bosses._capacity = (void *)0x0;
|
|
(this->_entityConfig)._edenHair._begin = (void *)0x0;
|
|
(this->_entityConfig)._edenHair._end = (void *)0x0;
|
|
(this->_entityConfig)._edenHair._capacity = (void *)0x0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6a8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6ac)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6b0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6b4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6b8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6bc)))) = 0;
|
|
this->_modManager = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6c4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6c8)))) = 0;
|
|
memset(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x2a6cc))),0,0x20000);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6d0))) = 0;
|
|
*GHIDRA_CAST<uint8_t ***>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6cc)))) = KAGE::Thread::vftable;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6d4)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6d8))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6dc)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6ec)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6f0)))) = 0xf;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6dc))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x1f;
|
|
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a6f4)))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x20;
|
|
ANM2::constructor(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a808)))));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a91c)))) = 0;
|
|
if (DAT_00c79860 != 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4a91c)))) = 3;
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x21;
|
|
StringTable::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x22;
|
|
StringTable::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x23;
|
|
_eh_vector_constructor_iterator_(&this->_popupButtons,0x130,2,FUN_00951130,FUN_008ba170);
|
|
(this->_popupButtons)._callback = (void *)0x0;
|
|
(this->_popupButtons)._callbackContext = (void *)0x0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4abc8)))) = 0xffffffff;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4abcc)))) = 0xffffffff;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4abd0))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4abd8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4abdc)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4abe0)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x25;
|
|
ANM2::constructor(&this->_buttonsSprite);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x26;
|
|
ANM2::constructor(&this->_platformIconsSprite);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x27;
|
|
_eh_vector_constructor_iterator_
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4ae0c))),8,2,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040c5b0),TexturePtr::release);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x28;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4ae20)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4ae24)))) = 0;
|
|
Font::Font(&this->_font1_TeamMeatEx10);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x29;
|
|
Font::Font(&this->_font2_TeamMeatEx12);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x2a;
|
|
Font::Font(&this->_font3_TeamMeatEx16);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x2b;
|
|
Font::Font(&this->_font4_terminus);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x2c;
|
|
Font::Font(&this->_font5_terminus8);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x2d;
|
|
Font::Font(&this->_font6_PFTempestaSevenCondensed);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x2e;
|
|
Font::Font(&this->_font7_Upheaval);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x2f;
|
|
Font::Font(&this->_font8_LuaMiniOutlined);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x30;
|
|
Font::Font(&this->_font9_PFTempestaSevenCondensedAgain);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x31;
|
|
(GHIDRA_CAST<LobbySettings *>((&this->_lobbySettings)))->LobbySettings::reset();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x32;
|
|
Seeds::constructor();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b1a8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b1b8)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b1bc)))) = 0xf;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b1a8))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x34;
|
|
(GHIDRA_CAST<ChallengeParams *>((&(this->_dailyChallenge)._params)))->ChallengeParams::ChallengeParams();
|
|
(this->_dailyChallenge)._id = 0;
|
|
(this->_dailyChallenge)._seed = 0;
|
|
(this->_dailyChallenge)._specialDailyId = 0;
|
|
(this->_dailyChallenge)._isPractice = 0;
|
|
ChallengeParam::Reset(&(this->_dailyChallenge)._params);
|
|
(this->_lobbyMembers)._begin = (void *)0x0;
|
|
(this->_lobbyMembers)._end = (void *)0x0;
|
|
(this->_lobbyMembers)._capacity = (void *)0x0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x35;
|
|
(this->_pendingMenuFadeColor)._unk = 0;
|
|
(this->_pendingMenuFadeColor)._red = 0.0;
|
|
(this->_pendingMenuFadeColor)._green = 0.0;
|
|
(this->_pendingMenuFadeColor)._blue = 0.0;
|
|
(this->_pendingMenuFadeColor)._alpha = 0.0;
|
|
ANM2::constructor(&this->_cursorSprite);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x36;
|
|
(this->_lastMousePosition).y = 0.0;
|
|
(this->_lastMousePosition).x = 0.0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b3d0)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b3cc)))) = 0;
|
|
SaveSlotManager::constructor();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 0x37;
|
|
container = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1]._gamestate)) + 0xcf0)));
|
|
*GHIDRA_CAST<uint32_t *>(container) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1]._gamestate)) + 0xcf4)))) = 0;
|
|
headNode = operator_new(0xc);
|
|
*(void **)headNode = headNode;
|
|
*(void **)(GHIDRA_CAST<char *>(headNode) + 4) = headNode;
|
|
*(void **)container = headNode;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1]._gamestate)) + 0xcfc))) = 0;
|
|
*GHIDRA_CAST<uint8_t ***>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1]._gamestate)) + 0xcf8)))) = KAGE::Mutex::vftable;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(this[1]._gamestate)) + 0xd00)))) = 0;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),0x39);
|
|
FUN_00a15770();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b3d4))) = DAT_00c71673;
|
|
ExceptionList = local_10;
|
|
return this;
|
|
}
|
|
|
|
// 00951160
|
|
void Manager::destructor()
|
|
{
|
|
void **seedEffectsTree;
|
|
std_map *fontCharsTree;
|
|
uint32_t extraout_ECX;
|
|
uint32_t extraout_ECX_00;
|
|
uint32_t extraout_ECX_01;
|
|
uint32_t extraout_ECX_02;
|
|
ANM2 *popupButtonSprite;
|
|
int buttonsLeft;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint32_t *saveFile;
|
|
uint8_t *temp_27f248e98e1;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0bd80;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
popupButtonSprite = GHIDRA_CAST<ANM2 *>(&this->_popupButtons);
|
|
buttonsLeft = 2;
|
|
do {
|
|
ANM2::Reset(popupButtonSprite);
|
|
popupButtonSprite = GHIDRA_CAST<ANM2 *>((popupButtonSprite[1]._animDefaultName._buf + 4));
|
|
buttonsLeft = buttonsLeft + -1;
|
|
} while (buttonsLeft != 0);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_00);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_01);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_02);
|
|
StringTable::clear(&this->_stringTable);
|
|
StringTable::clear(&this->_stringTablePc);
|
|
FUN_008f5960();
|
|
if (this->_netplayManager != *GHIDRA_CAST<int *>((this + 1))) {
|
|
(GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&this->_netplayManager))))->NetplayManager::reset(1);
|
|
}
|
|
PopupQueue::destructor();
|
|
(GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&this->_netplayManager))))->NetplayManager::~NetplayManager();
|
|
local_8 = 0;
|
|
ANM2::Reset(&this->_cursorSprite);
|
|
AnimationState::~AnimationState(&(this->_cursorSprite)._overlayAnimState);
|
|
AnimationState::~AnimationState(&(this->_cursorSprite)._animState);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_cursorSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_cursorSprite))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 0xffffffff;
|
|
msvc::vector<UserProfileEntry>::_Tidy();
|
|
FUN_004269f0();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b1a8))))))->msvc::string::_Tidy_deallocate();
|
|
seedEffectsTree = &(this->_startSeeds)._seedEffects;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(seedEffectsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)seedEffectsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT((this->_startSeeds)._seedEffects) + 4));
|
|
operator_delete(*seedEffectsTree,0x14);
|
|
msvc::vector<Vector>::_Tidy();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lobbySettings)._password._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>(((this->_lobbySettings)._seed._buf)))->msvc::string::_Tidy_deallocate();
|
|
Font::Unload(&this->_font9_PFTempestaSevenCondensedAgain);
|
|
fontCharsTree = &(this->_font9_PFTempestaSevenCondensedAgain)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font9_PFTempestaSevenCondensedAgain)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font8_LuaMiniOutlined);
|
|
fontCharsTree = &(this->_font8_LuaMiniOutlined)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font8_LuaMiniOutlined)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font7_Upheaval);
|
|
fontCharsTree = &(this->_font7_Upheaval)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font7_Upheaval)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font6_PFTempestaSevenCondensed);
|
|
fontCharsTree = &(this->_font6_PFTempestaSevenCondensed)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font6_PFTempestaSevenCondensed)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font5_terminus8);
|
|
fontCharsTree = &(this->_font5_terminus8)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font5_terminus8)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font4_terminus);
|
|
fontCharsTree = &(this->_font4_terminus)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font4_terminus)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font3_TeamMeatEx16);
|
|
fontCharsTree = &(this->_font3_TeamMeatEx16)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font3_TeamMeatEx16)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font2_TeamMeatEx12);
|
|
fontCharsTree = &(this->_font2_TeamMeatEx12)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font2_TeamMeatEx12)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
Font::Unload(&this->_font1_TeamMeatEx10);
|
|
fontCharsTree = &(this->_font1_TeamMeatEx10)._charsBlock;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(fontCharsTree,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)fontCharsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)
|
|
(GHIDRA_INT((this->_font1_TeamMeatEx10)._charsBlock._head) + 4));
|
|
operator_delete(fontCharsTree->_head,0x18);
|
|
FUN_004b3950();
|
|
_eh_vector_destructor_iterator_(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4ae0c))),8,2,TexturePtr::release);
|
|
local_8 = 1;
|
|
ANM2::Reset(&this->_platformIconsSprite);
|
|
AnimationState::~AnimationState(&(this->_platformIconsSprite)._overlayAnimState);
|
|
AnimationState::~AnimationState(&(this->_platformIconsSprite)._animState);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_platformIconsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_platformIconsSprite))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 2;
|
|
ANM2::Reset(&this->_buttonsSprite);
|
|
AnimationState::~AnimationState(&(this->_buttonsSprite)._overlayAnimState);
|
|
AnimationState::~AnimationState(&(this->_buttonsSprite)._animState);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_buttonsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_buttonsSprite))))->msvc::string::_Tidy_deallocate();
|
|
msvc::vector<260byte>::~vector();
|
|
local_8 = 3;
|
|
(this->_popupButtons)._callback = (void *)0x0;
|
|
(this->_popupButtons)._callbackContext = (void *)0x0;
|
|
_eh_vector_destructor_iterator_(&this->_popupButtons,0x130,2,FUN_008ba170);
|
|
StringTable::clear(&this->_stringTablePc);
|
|
temp_27f248e98e1 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTablePc))) + 0xc)));
|
|
msvc::map<StringTable_category>::_Erase_tree
|
|
(temp_27f248e98e1,*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTablePc))) + 0xc)))) + 4)));
|
|
operator_delete(*(void **)temp_27f248e98e1,0x28);
|
|
temp_27f248e98e1 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTablePc))) + 0x4)));
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(temp_27f248e98e1,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)temp_27f248e98e1,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTablePc))) + 0x4)))) + 4));
|
|
operator_delete(*(void **)temp_27f248e98e1,0x18);
|
|
StringTable::clear(&this->_stringTable);
|
|
temp_27f248e98e1 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTable))) + 0xc)));
|
|
msvc::map<StringTable_category>::_Erase_tree
|
|
(temp_27f248e98e1,*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTable))) + 0xc)))) + 4)));
|
|
operator_delete(*(void **)temp_27f248e98e1,0x28);
|
|
temp_27f248e98e1 = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTable))) + 0x4)));
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(temp_27f248e98e1,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)temp_27f248e98e1,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTable))) + 0x4)))) + 4));
|
|
operator_delete(*(void **)temp_27f248e98e1,0x18);
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&this->_modManager))))->ModManager::~ModManager();
|
|
FUN_00694ea0();
|
|
msvc::vector<164byte>::_Tidy();
|
|
(GHIDRA_CAST<InfoDisplay *>((&this->_infoDisplay)))->InfoDisplay::~InfoDisplay();
|
|
(GHIDRA_CAST<ItemConfig *>((&this->_itemConfig)))->ItemConfig::destructor();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_optionsConfig))))->msvc::string::_Tidy_deallocate();
|
|
msvc::vector<SoundEffect>::_Tidy();
|
|
MusicManager::~MusicManager();
|
|
(GHIDRA_CAST<AchievementOverlay *>((&this->_achievementOverlay)))->AchievementOverlay::~AchievementOverlay();
|
|
(GHIDRA_CAST<NightmareScene *>((&this->_nightmareScene)))->NightmareScene::~NightmareScene();
|
|
local_8 = 4;
|
|
(GHIDRA_CAST<VideoPlayer *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x80c))))))->VideoPlayer::unload();
|
|
_eh_vector_destructor_iterator_
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_cutsceneManager))) + 0x4))),0x4c,0x1b,CutsceneEntry::Destructor);
|
|
(GHIDRA_CAST<GameState *>((&this->_gamestate)))->GameState::~GameState();
|
|
local_8 = 5;
|
|
saveFile = (this->_persistentGameData)._saveFile;
|
|
if (saveFile != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(**(code **)*saveFile)(1);
|
|
}
|
|
PersistentGameData_Bestiary::~PersistentGameData_Bestiary
|
|
(GHIDRA_CAST<PersistentGameData_Bestiary *>(&(this->_persistentGameData)._bestiaryEncounters));
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_persistentGameData))) + 0x20))))))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_persistentGameData))) + 0x8))))))->msvc::string::_Tidy_deallocate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00951730
|
|
void Manager::create_render_surfaces()
|
|
{
|
|
char isLastRef;
|
|
uint32_t uVar1;
|
|
void *newSurface;
|
|
KColor *clearColor;
|
|
KColor *clearColor_00;
|
|
KColor *clearColor_01;
|
|
KColor blackColor;
|
|
uint8_t tmpSurface2 [4];
|
|
int *tmpSurfaceRef2;
|
|
uint8_t tmpSurface [4];
|
|
int *tmpSurfaceRef;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
int *hq4xSurface;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0bdbd;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_UINT((tmpSurface + 0x14));
|
|
ExceptionList = &local_10;
|
|
if ((DAT_00c79890 == GHIDRA_CAST<int *>(0x0)) && ((this->_optionsConfig)._enableFilter != 0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("HQ4X size: %dx%d\n"));
|
|
(GHIDRA_CAST<KColor *>((&blackColor)))->KColor::SetFromARGB(0);
|
|
newSurface = KAGE_Graphics::create_render_target
|
|
(tmpSurface,g_framebufferWidth,DAT_00c79114,
|
|
GHIDRA_CAST<uint8_t *>("HQ4X Surface (Manager)"),clearColor);
|
|
local_8 = 0;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c79890)))->shared_ptr::operator_assign(newSurface);
|
|
local_8 = 1;
|
|
if (tmpSurfaceRef != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpSurfaceRef + 0xc))(uVar1);
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpSurface);
|
|
}
|
|
}
|
|
hq4xSurface = DAT_00c79890;
|
|
local_8 = 0xffffffff;
|
|
if ((DAT_00c79890[0xe] != 0) || (DAT_00c79890[0xf] != 0)) {
|
|
(**(code **)(*DAT_00c79890 + 0x48))(0,0);
|
|
hq4xSurface[0xe] = 0;
|
|
hq4xSurface[0xf] = 0;
|
|
}
|
|
}
|
|
if ((DAT_00c798a8 == 0) && ((g_manager->_optionsConfig)._enableColorCorrection != 0)) {
|
|
(GHIDRA_CAST<KColor *>((&blackColor)))->KColor::SetFromARGB(0);
|
|
newSurface = KAGE_Graphics::create_render_target
|
|
(tmpSurface,g_framebufferWidth,DAT_00c79114,
|
|
GHIDRA_CAST<uint8_t *>("Color Correction Surface"),clearColor_00);
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c798a8)))->shared_ptr::operator_assign(newSurface);
|
|
local_8 = 3;
|
|
if (tmpSurfaceRef != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpSurfaceRef + 0xc))();
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpSurface);
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
}
|
|
if (DAT_00c798a0 == 0) {
|
|
(GHIDRA_CAST<KColor *>((&blackColor)))->KColor::SetFromARGB(0);
|
|
newSurface = KAGE_Graphics::create_render_target
|
|
(tmpSurface2,g_framebufferWidth,DAT_00c79114,
|
|
GHIDRA_CAST<uint8_t *>("Render Surface (Manager)"),clearColor_01);
|
|
local_8 = 4;
|
|
(GHIDRA_CAST<shared_ptr *>((&DAT_00c798a0)))->shared_ptr::operator_assign(newSurface);
|
|
local_8 = 5;
|
|
if (tmpSurfaceRef2 != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*tmpSurfaceRef2 + 0xc))();
|
|
if ((isLastRef != '\0') && (g_renderTargetReleaseFn != (void *)0x0)) {
|
|
(*g_renderTargetReleaseFn)(tmpSurface2);
|
|
}
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00951920
|
|
void Manager::load_fonts()
|
|
{
|
|
uint8_t bVar1;
|
|
uint8_t *extraout_EAX;
|
|
uint8_t *extraout_EAX_00;
|
|
uint8_t *extraout_EAX_01;
|
|
uint8_t *extraout_EAX_02;
|
|
uint8_t *extraout_EAX_03;
|
|
int fallbackGlyph;
|
|
uint8_t *pbVar2;
|
|
void *freeBlock;
|
|
char *pcVar3;
|
|
uint32_t freeSize;
|
|
char *secondaryFontPath;
|
|
ModManager *local_70;
|
|
void *redirectedPathB [4];
|
|
uint32_t redirectedPathBSize;
|
|
uint32_t redirectedPathBCapacity;
|
|
void *redirectedPathA [4];
|
|
uint32_t redirectedPathASize;
|
|
uint32_t redirectedPathACapacity;
|
|
std_string local_3c;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
void *local_14;
|
|
Manager *manager;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((redirectedPathA + 0x14));
|
|
local_14 = (void *)0xffffffff;
|
|
puStack_18 = &LAB_00b0be35;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((redirectedPathA + 0x11));
|
|
ExceptionList = &local_1c;
|
|
Font::Unload(&this->_font9_PFTempestaSevenCondensedAgain);
|
|
Font::Unload(&this->_font7_Upheaval);
|
|
fallbackGlyph = *GHIDRA_CAST<int *>(&g_manager->_stringTable);
|
|
if (fallbackGlyph == 2) {
|
|
pcVar3 = "font/MPlus_12b.fnt";
|
|
LAB_009519b0:
|
|
secondaryFontPath = "font/CJK/LanaPixel.fnt";
|
|
}
|
|
else {
|
|
if (fallbackGlyph == 0xb) {
|
|
pcVar3 = "font/KR_MeatFont14.fnt";
|
|
goto LAB_009519b0;
|
|
}
|
|
if (fallbackGlyph == 0xd) {
|
|
pcVar3 = "font/UpheavalExtended.fnt";
|
|
goto LAB_009519b0;
|
|
}
|
|
pcVar3 = "font/Upheaval.fnt";
|
|
secondaryFontPath = "font/PFTempestaSevenCondensed.fnt";
|
|
}
|
|
local_70 = GHIDRA_CAST<ModManager *>(&g_manager->_modManager);
|
|
local_3c._size = 0;
|
|
local_3c._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = (void *)0x0;
|
|
pbVar2 = GHIDRA_CAST<uint8_t *>(pcVar3);
|
|
do {
|
|
bVar1 = *pbVar2;
|
|
pbVar2 = pbVar2 + 1;
|
|
} while (bVar1 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((local_3c._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(pcVar3),GHIDRA_INT(pbVar2) - GHIDRA_INT((pcVar3 + 1)));
|
|
local_14 = (void *)0x0;
|
|
(GHIDRA_CAST<ModManager *>((local_70)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPathA),&local_3c);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
pbVar2 = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(extraout_EAX);
|
|
}
|
|
Font::Load(&this->_font7_Upheaval,pbVar2,0);
|
|
local_14 = (void *)((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8);
|
|
if (0xf < redirectedPathACapacity) {
|
|
freeSize = redirectedPathACapacity + 1;
|
|
freeBlock = redirectedPathA[0];
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)(GHIDRA_INT(redirectedPathA[0]) + -4);
|
|
freeSize = redirectedPathACapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathA[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_00951a98;
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathASize = 0;
|
|
redirectedPathACapacity = 0xf;
|
|
redirectedPathA[0] = (void *)(GHIDRA_UINT(redirectedPathA[0]) & 0xffffff00);
|
|
if (0xf < local_3c._capacity) {
|
|
freeSize = local_3c._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_3c._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4);
|
|
freeSize = local_3c._capacity + 0x24;
|
|
if ((void *)0x1f < (void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock)))) {
|
|
LAB_00951a98:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
local_70 = GHIDRA_CAST<ModManager *>(&g_manager->_modManager);
|
|
local_3c._size = 0;
|
|
local_3c._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = (void *)0x0;
|
|
pbVar2 = GHIDRA_CAST<uint8_t *>(secondaryFontPath);
|
|
do {
|
|
bVar1 = *pbVar2;
|
|
pbVar2 = pbVar2 + 1;
|
|
} while (bVar1 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((local_3c._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(secondaryFontPath),
|
|
GHIDRA_INT(pbVar2) - GHIDRA_INT((secondaryFontPath + 1)));
|
|
local_14 = (void *)0x2;
|
|
(GHIDRA_CAST<ModManager *>((local_70)))->ModManager::TryRedirectPath(GHIDRA_CAST<std_string *>(redirectedPathB),&local_3c);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
pbVar2 = extraout_EAX_00;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_00 + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(extraout_EAX_00);
|
|
}
|
|
Font::Load(&this->_font9_PFTempestaSevenCondensedAgain,pbVar2,0);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
|
|
if (0xf < redirectedPathBCapacity) {
|
|
freeSize = redirectedPathBCapacity + 1;
|
|
freeBlock = redirectedPathB[0];
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)(GHIDRA_INT(redirectedPathB[0]) + -4);
|
|
freeSize = redirectedPathBCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathB[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_00951b8a;
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathBSize = 0;
|
|
redirectedPathBCapacity = 0xf;
|
|
redirectedPathB[0] = (void *)(GHIDRA_UINT(redirectedPathB[0]) & 0xffffff00);
|
|
if (0xf < local_3c._capacity) {
|
|
freeSize = local_3c._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)local_3c._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4);
|
|
freeSize = local_3c._capacity + 0x24;
|
|
if ((void *)0x1f < (void *)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock)))) {
|
|
LAB_00951b8a:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
local_3c._size = 0x20;
|
|
local_3c._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0))),"font/TeamMeatEx/TeamMeatEx10.fnt",0x21);
|
|
local_14 = (void *)0x4;
|
|
ModManager::TryRedirectPath
|
|
(GHIDRA_CAST<ModManager *>(&manager->_modManager),GHIDRA_CAST<std_string *>(redirectedPathA),&local_3c);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
|
pbVar2 = extraout_EAX_01;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_01 + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(extraout_EAX_01);
|
|
}
|
|
Font::Load(&this->_font1_TeamMeatEx10,pbVar2,0);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),4);
|
|
if (0xf < redirectedPathACapacity) {
|
|
freeSize = redirectedPathACapacity + 1;
|
|
freeBlock = redirectedPathA[0];
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)(GHIDRA_INT(redirectedPathA[0]) + -4);
|
|
freeSize = redirectedPathACapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathA[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_00951c7b;
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathASize = 0;
|
|
redirectedPathACapacity = 0xf;
|
|
redirectedPathA[0] = (void *)(GHIDRA_UINT(redirectedPathA[0]) & 0xffffff00);
|
|
if (0xf < local_3c._capacity) {
|
|
freeSize = local_3c._capacity + 1;
|
|
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4));
|
|
freeSize = local_3c._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
|
|
LAB_00951c7b:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar3,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
local_3c._size = 0x20;
|
|
local_3c._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0))),"font/TeamMeatEx/TeamMeatEx12.fnt",0x21);
|
|
local_14 = (void *)0x6;
|
|
ModManager::TryRedirectPath
|
|
(GHIDRA_CAST<ModManager *>(&manager->_modManager),GHIDRA_CAST<std_string *>(redirectedPathB),&local_3c);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 7;
|
|
pbVar2 = extraout_EAX_02;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_02 + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(extraout_EAX_02);
|
|
}
|
|
Font::Load(&this->_font2_TeamMeatEx12,pbVar2,0);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),6);
|
|
if (0xf < redirectedPathBCapacity) {
|
|
freeSize = redirectedPathBCapacity + 1;
|
|
freeBlock = redirectedPathB[0];
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)(GHIDRA_INT(redirectedPathB[0]) + -4);
|
|
freeSize = redirectedPathBCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathB[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_00951d6c;
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
local_14 = (void *)0xffffffff;
|
|
redirectedPathBSize = 0;
|
|
redirectedPathBCapacity = 0xf;
|
|
redirectedPathB[0] = (void *)(GHIDRA_UINT(redirectedPathB[0]) & 0xffffff00);
|
|
if (0xf < local_3c._capacity) {
|
|
freeSize = local_3c._capacity + 1;
|
|
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4));
|
|
freeSize = local_3c._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
|
|
LAB_00951d6c:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar3,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
local_3c._size = 0x20;
|
|
local_3c._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0))),"font/TeamMeatEx/TeamMeatEx16.fnt",0x21);
|
|
local_14 = (void *)0x8;
|
|
ModManager::TryRedirectPath
|
|
(GHIDRA_CAST<ModManager *>(&manager->_modManager),GHIDRA_CAST<std_string *>(redirectedPathA),&local_3c);
|
|
local_14 = (void *)CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),9);
|
|
pbVar2 = extraout_EAX_03;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_03 + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<uint8_t **>(extraout_EAX_03);
|
|
}
|
|
Font::Load(&this->_font3_TeamMeatEx16,pbVar2,0);
|
|
if (0xf < redirectedPathACapacity) {
|
|
freeSize = redirectedPathACapacity + 1;
|
|
freeBlock = redirectedPathA[0];
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)(GHIDRA_INT(redirectedPathA[0]) + -4);
|
|
freeSize = redirectedPathACapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPathA[0]) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_00951e52;
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
redirectedPathASize = 0;
|
|
redirectedPathACapacity = 0xf;
|
|
redirectedPathA[0] = (void *)(GHIDRA_UINT(redirectedPathA[0]) & 0xffffff00);
|
|
if ((void *)0xf < local_3c._capacity) {
|
|
freeSize = local_3c._capacity + 1;
|
|
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_3c._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + -4));
|
|
freeSize = local_3c._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_3c._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
|
|
LAB_00951e52:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar3,freeSize);
|
|
}
|
|
(this->_font1_TeamMeatEx10)._missingCharacter = -1;
|
|
local_70 = GHIDRA_CAST<ModManager *>(0x3f);
|
|
_Find_lower_bound<>(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&local_3c) + 0xc)),&local_70);
|
|
if (((*GHIDRA_CAST<char *>((local_3c._capacity + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint32_t *>((local_3c._capacity + 0x10)) < 0x40)) &&
|
|
((void *)local_3c._capacity != (this->_font1_TeamMeatEx10)._charsBlock._head)) {
|
|
fallbackGlyph = *GHIDRA_CAST<int *>((local_3c._capacity + 0x14));
|
|
}
|
|
else {
|
|
fallbackGlyph = -1;
|
|
}
|
|
(this->_font1_TeamMeatEx10)._missingCharacter = fallbackGlyph;
|
|
(this->_font2_TeamMeatEx12)._missingCharacter = -1;
|
|
local_70 = GHIDRA_CAST<ModManager *>(0x3f);
|
|
_Find_lower_bound<>(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&local_3c) + 0xc)),&local_70);
|
|
if (((*GHIDRA_CAST<char *>((local_3c._capacity + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint32_t *>((local_3c._capacity + 0x10)) < 0x40)) &&
|
|
((void *)local_3c._capacity != (this->_font2_TeamMeatEx12)._charsBlock._head)) {
|
|
fallbackGlyph = *GHIDRA_CAST<int *>((local_3c._capacity + 0x14));
|
|
}
|
|
else {
|
|
fallbackGlyph = -1;
|
|
}
|
|
(this->_font2_TeamMeatEx12)._missingCharacter = fallbackGlyph;
|
|
(this->_font3_TeamMeatEx16)._missingCharacter = -1;
|
|
local_70 = GHIDRA_CAST<ModManager *>(0x3f);
|
|
_Find_lower_bound<>(GHIDRA_CAST<uint8_t *>((GHIDRA_INT(&local_3c) + 0xc)),&local_70);
|
|
if (((*GHIDRA_CAST<char *>((local_3c._capacity + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<uint32_t *>((local_3c._capacity + 0x10)) < 0x40)) &&
|
|
((void *)local_3c._capacity != (this->_font3_TeamMeatEx16)._charsBlock._head)) {
|
|
fallbackGlyph = *GHIDRA_CAST<int *>((local_3c._capacity + 0x14));
|
|
}
|
|
else {
|
|
fallbackGlyph = -1;
|
|
}
|
|
(this->_font3_TeamMeatEx16)._missingCharacter = fallbackGlyph;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009522b0
|
|
void Manager::render_loading_icon(float alpha)
|
|
{
|
|
char isLastRef;
|
|
uint32_t uVar1;
|
|
uint32_t blinkFrame;
|
|
uint32_t iconSlot;
|
|
uint32_t iconColor;
|
|
uint32_t local_34;
|
|
uint32_t local_30;
|
|
float local_2c;
|
|
uint32_t local_28;
|
|
Vector drawPos;
|
|
int *icon;
|
|
int *iconRef;
|
|
float alphaLocal;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b05d9d;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
blinkFrame = g_manager->_framecount & 0x8000000f;
|
|
if (GHIDRA_INT(blinkFrame) < 0) {
|
|
blinkFrame = (blinkFrame - 1 | 0xfffffff0) + 1;
|
|
}
|
|
iconSlot = 0;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>((&g_manager->_platformIconsSprite + 1)) + GHIDRA_UINT((7 < GHIDRA_INT(blinkFrame))) * 8)) != 0)
|
|
{
|
|
iconSlot = GHIDRA_UINT((7 < GHIDRA_INT(blinkFrame)));
|
|
}
|
|
alphaLocal = alpha;
|
|
KAGE::SmartPointer::operator_assign
|
|
(&icon,(void *)(GHIDRA_INT((&g_manager->_platformIconsSprite + 1)) + iconSlot * 8));
|
|
local_8 = 0;
|
|
if (icon != GHIDRA_CAST<int *>(0x0)) {
|
|
local_2c = alphaLocal;
|
|
local_28 = 0;
|
|
iconColor = 0x3f800000;
|
|
local_34 = 0x3f800000;
|
|
local_30 = 0x3f800000;
|
|
drawPos.y = (g_screenHeight -
|
|
(float)((double)icon[5] + __uint_to_double_fixup[-(icon[5] >> 0x1f)])) * 0.5;
|
|
drawPos.x = (g_screenWidth -
|
|
(float)((double)icon[4] + __uint_to_double_fixup[-(icon[4] >> 0x1f)])) * 0.5;
|
|
(**(code **)(*icon + 0x20))(&drawPos,&iconColor,uVar1);
|
|
}
|
|
local_8 = 1;
|
|
if (iconRef != GHIDRA_CAST<int *>(0x0)) {
|
|
isLastRef = (**(code **)(*iconRef + 0xc))();
|
|
if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) {
|
|
(*g_imageReleaseFn)(&icon);
|
|
}
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00952410
|
|
void Manager::Init()
|
|
{
|
|
uint32_t *stringTable;
|
|
uint8_t bVar1;
|
|
char cVar2;
|
|
uint8_t *pbVar3;
|
|
int *piVar4;
|
|
Game *extraout_EAX;
|
|
uint8_t *animNameChar;
|
|
int unused;
|
|
char *pathEnd;
|
|
int extraout_ECX;
|
|
int extraout_ECX_00;
|
|
uint8_t *wantedAnimNameChar;
|
|
char *pcVar5;
|
|
uint32_t uVar6;
|
|
int iVar7;
|
|
Manager *manager;
|
|
bool isLess;
|
|
ANM2 *device;
|
|
int *deviceRefCount;
|
|
ANM2 *deviceCopy;
|
|
int *deviceCopyRefCount;
|
|
Manager *savedManager;
|
|
char isOptionsIniFound;
|
|
Game *local_230;
|
|
std_string anm2Path;
|
|
uint8_t optionsIniPath [255];
|
|
char cStack_115;
|
|
uint8_t oldOptionsIniPath [256];
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Game *buttonsSprite;
|
|
StringTable *stringTable;
|
|
|
|
manager = g_manager;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0bf11;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((oldOptionsIniPath + 0x110));
|
|
ExceptionList = &local_10;
|
|
savedManager = g_manager;
|
|
stringTable = &g_manager->_stringTable;
|
|
g_manager->_isSavingGameState = 0;
|
|
StringTable::Load(stringTable,GHIDRA_CAST<uint8_t *>("stringtable.sta"));
|
|
StringTable::Load(&manager->_stringTablePc,GHIDRA_CAST<uint8_t *>("stringtable_pc.sta"));
|
|
validate_language(manager,unused);
|
|
manager->_selectedDifficulty = 0;
|
|
manager->_isWindowFocused = 1;
|
|
sprintf_s(optionsIniPath,0x100,&DAT_00b60c28);
|
|
pbVar3 = FileSystem::ResolvePath(optionsIniPath);
|
|
isOptionsIniFound = pbVar3 != GHIDRA_CAST<uint8_t *>(0x0);
|
|
if (pbVar3 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
local_8 = 0;
|
|
tracked_alloc(1,pbVar3,0);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
if (isOptionsIniFound == '\0') {
|
|
memset(oldOptionsIniPath,0,0x100);
|
|
pbVar3 = optionsIniPath;
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
pbVar3 = pbVar3 + 1;
|
|
} while (bVar1 != 0);
|
|
strncpy(GHIDRA_CAST<char *>(oldOptionsIniPath),GHIDRA_CAST<char *>(optionsIniPath),
|
|
(size_t)(pbVar3 + (-0x28 - GHIDRA_INT((optionsIniPath + 1)))));
|
|
pbVar3 = oldOptionsIniPath;
|
|
do {
|
|
local_230 = GHIDRA_CAST<Game *>(pbVar3);
|
|
pbVar3 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_230) + 1));
|
|
} while (*GHIDRA_CAST<uint8_t *>(local_230) != 0);
|
|
strncpy(GHIDRA_CAST<char *>(local_230),"Binding of Isaac Repentance",0x1c);
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5 + 1;
|
|
pcVar5 = pcVar5 + 1;
|
|
} while (*pathEnd != '\0');
|
|
pcVar5[0] = '/';
|
|
pcVar5[1] = '\0';
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5;
|
|
pcVar5 = pathEnd + 1;
|
|
} while (pathEnd[1] != '\0');
|
|
builtin_strncpy(pathEnd + 1,"options.ini",0xc);
|
|
bVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath);
|
|
if (bVar1 == 0) {
|
|
strncpy(GHIDRA_CAST<char *>(local_230),"Binding of Isaac Afterbirth+",0x1d);
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5 + 1;
|
|
pcVar5 = pcVar5 + 1;
|
|
} while (*pathEnd != '\0');
|
|
pcVar5[0] = '/';
|
|
pcVar5[1] = '\0';
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5;
|
|
pcVar5 = pathEnd + 1;
|
|
} while (pathEnd[1] != '\0');
|
|
builtin_strncpy(pathEnd + 1,"options.ini",0xc);
|
|
bVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath);
|
|
if (bVar1 == 0) {
|
|
strncpy(GHIDRA_CAST<char *>(local_230),"Binding of Isaac Afterbirth",0x1c);
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5 + 1;
|
|
pcVar5 = pcVar5 + 1;
|
|
} while (*pathEnd != '\0');
|
|
pcVar5[0] = '/';
|
|
pcVar5[1] = '\0';
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5;
|
|
pcVar5 = pathEnd + 1;
|
|
} while (pathEnd[1] != '\0');
|
|
builtin_strncpy(pathEnd + 1,"options.ini",0xc);
|
|
bVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath);
|
|
if (bVar1 == 0) {
|
|
strncpy(GHIDRA_CAST<char *>(local_230),"Binding of Isaac Rebirth",0x19);
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5 + 1;
|
|
pcVar5 = pcVar5 + 1;
|
|
} while (*pathEnd != '\0');
|
|
pcVar5[0] = '/';
|
|
pcVar5[1] = '\0';
|
|
pcVar5 = &cStack_115;
|
|
do {
|
|
pathEnd = pcVar5;
|
|
pcVar5 = pathEnd + 1;
|
|
} while (pathEnd[1] != '\0');
|
|
builtin_strncpy(pathEnd + 1,"options.ini",0xc);
|
|
bVar1 = file_copy_to_save_data(oldOptionsIniPath,optionsIniPath);
|
|
if (bVar1 == 0) {
|
|
KAGE_LogMessage(8,GHIDRA_CAST<uint8_t *>("Couldn\'t retrieve previous version of options config\n"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
manager = savedManager;
|
|
}
|
|
OptionsConfig::load_config_ini(&manager->_optionsConfig);
|
|
OptionsConfig::Load(&manager->_optionsConfig,optionsIniPath);
|
|
piVar4 = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00c5c3a4));
|
|
if ((*piVar4 == 0) || (iVar7 = extraout_ECX, (manager->_optionsConfig)._enableSteamCloud == 0)) {
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"[warn] SteamCloud is either not available or disabled in Options.ini.\n");
|
|
iVar7 = extraout_ECX_00;
|
|
}
|
|
validate_language(manager,iVar7);
|
|
PopupButtons::Init();
|
|
stringTable = &manager->_modManager;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(stringTable))))->ModManager::ListMods();
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(stringTable))))->ModManager::LoadShaders();
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget((void *)0x0,0);
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
_glfw_context_reset(1);
|
|
Seeds::InitSeedInfo();
|
|
manager->_isConsoleEnabled = (manager->_optionsConfig)._enableDebugConsole;
|
|
create_render_surfaces(manager);
|
|
manager->_previousState = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x8)))) = 0;
|
|
manager->_currentSaveSlot = 0;
|
|
manager->_framecount = 0;
|
|
*GHIDRA_CAST<uint16_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4abc4)))) = 0;
|
|
manager->_consecutiveResetCount = 0;
|
|
load_configs(manager);
|
|
local_230 = operator_new(0x68e88);
|
|
local_8 = 1;
|
|
if (local_230 == GHIDRA_CAST<Game *>(0x0)) {
|
|
g_game = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Game *>((local_230)))->Game::constructor();
|
|
g_game = extraout_EAX;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
Game::LoadConfigXmls();
|
|
bVar1 = (manager->_optionsConfig)._enableMouseControl;
|
|
manager->_framecount = 0;
|
|
manager->_activeControllerIndex = 0;
|
|
if (bVar1 != 0) {
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x12;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/cursor.anm2",0x13);
|
|
local_8 = 2;
|
|
ANM2::Load(&manager->_cursorSprite,&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar6 = anm2Path._capacity + 1;
|
|
pcVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pcVar5 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar6 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar5,uVar6);
|
|
}
|
|
pbVar3 = (manager->_cursorSprite)._animState._animData;
|
|
if (pbVar3 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_00952994:
|
|
bVar1 = ANM2::SetAnimation(&manager->_cursorSprite,s_Idle,1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(manager->_cursorSprite)._animState);
|
|
(manager->_cursorSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
animNameChar = pbVar3;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar3 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(pbVar3);
|
|
}
|
|
wantedAnimNameChar = s_Idle;
|
|
do {
|
|
bVar1 = *animNameChar;
|
|
isLess = bVar1 < *wantedAnimNameChar;
|
|
if (bVar1 != *wantedAnimNameChar) {
|
|
LAB_00952970:
|
|
uVar6 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00952975;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = animNameChar[1];
|
|
isLess = bVar1 < wantedAnimNameChar[1];
|
|
if (bVar1 != wantedAnimNameChar[1]) goto LAB_00952970;
|
|
animNameChar = animNameChar + 2;
|
|
wantedAnimNameChar = wantedAnimNameChar + 2;
|
|
} while (bVar1 != 0);
|
|
uVar6 = 0;
|
|
LAB_00952975:
|
|
if ((uVar6 != 0) ||
|
|
((pbVar3[0x34] != 0 && ((manager->_cursorSprite)._animState._isPlaying == 0))))
|
|
goto LAB_00952994;
|
|
}
|
|
manager->_cursorVisibleTimer = 0;
|
|
}
|
|
if ((DAT_00c796bc & 1) == 0) {
|
|
(manager->_optionsConfig)._enableWaterSurface = 0;
|
|
}
|
|
manager->_isMenuPending = 0;
|
|
manager->_starting = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 0;
|
|
manager->_isNightmarePending = 0;
|
|
*GHIDRA_CAST<uint8_t *>(manager) = 0;
|
|
manager->_isHotkeysEnabled = 1;
|
|
manager->_isRenderSurfaceResetPending = 0;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4b3cc)))) = g_vectorZero.x;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4b3d0)))) = g_vectorZero.y;
|
|
*GHIDRA_CAST<uint16_t *>(&manager->_isSaveOnExit) = 0;
|
|
input_configs_load();
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
local_230 = GHIDRA_CAST<Game *>(&manager->_buttonsSprite);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x13;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/Buttons.anm2",0x14);
|
|
local_8 = 3;
|
|
ANM2::Load(&manager->_buttonsSprite,&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar6 = anm2Path._capacity + 1;
|
|
pcVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pcVar5 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar6 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar5,uVar6);
|
|
}
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anm2Path._size = 0x19;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/PlatformIcons.anm2",0x1a);
|
|
local_8 = 4;
|
|
ANM2::Load(&manager->_platformIconsSprite,&anm2Path,1);
|
|
local_8 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
uVar6 = anm2Path._capacity + 1;
|
|
pcVar5 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < uVar6) {
|
|
pcVar5 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
uVar6 = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar5))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar5,uVar6);
|
|
}
|
|
buttonsSprite = local_230;
|
|
pbVar3 = (GHIDRA_CAST<AnimationState *>((GHIDRA_INT(local_230) + 0x30)))->_animData;
|
|
if (pbVar3 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
animNameChar = pbVar3;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar3 + 0x14))) {
|
|
animNameChar = *GHIDRA_CAST<uint8_t **>(pbVar3);
|
|
}
|
|
wantedAnimNameChar = &DAT_00b7b76c;
|
|
do {
|
|
bVar1 = *animNameChar;
|
|
isLess = bVar1 < *wantedAnimNameChar;
|
|
if (bVar1 != *wantedAnimNameChar) {
|
|
LAB_00952c05:
|
|
uVar6 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_00952c0a;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = animNameChar[1];
|
|
isLess = bVar1 < wantedAnimNameChar[1];
|
|
if (bVar1 != wantedAnimNameChar[1]) goto LAB_00952c05;
|
|
animNameChar = animNameChar + 2;
|
|
wantedAnimNameChar = wantedAnimNameChar + 2;
|
|
} while (bVar1 != 0);
|
|
uVar6 = 0;
|
|
LAB_00952c0a:
|
|
if ((uVar6 == 0) &&
|
|
((pbVar3[0x34] == 0 || ((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(local_230) + 0x30)))->_isPlaying != 0))))
|
|
goto LAB_00952c36;
|
|
}
|
|
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>(local_230),&DAT_00b7b76c,1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((GHIDRA_INT(buttonsSprite) + 0x30)));
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_INT(buttonsSprite) + 0x30)))->_isPlaying = 1;
|
|
}
|
|
LAB_00952c36:
|
|
msvc::list<msvc::pair<int_int>>::push_back(FUN_0095b290,0);
|
|
uVar6 = 0;
|
|
while( true ) {
|
|
(**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff);
|
|
iVar7 = DAT_00c57b24 - _DAT_00c57b20;
|
|
local_8 = 5;
|
|
(**(code **)(PTR_vftable_00c57b2c + 0x10))();
|
|
local_8 = 0xffffffff;
|
|
if (GHIDRA_UINT((iVar7 >> 3)) <= uVar6) break;
|
|
(GHIDRA_CAST<KAGE::Input::Manager *>((GHIDRA_CAST<Manager *>(&PTR_vftable_00c57b18))))->KAGE::Input::Manager::get_device(&device,uVar6);
|
|
piVar4 = deviceRefCount;
|
|
local_8 = 6;
|
|
local_230 = GHIDRA_CAST<Game *>(device);
|
|
if (device != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
deviceCopy = GHIDRA_CAST<ANM2 *>(0x0);
|
|
deviceCopyRefCount = GHIDRA_CAST<int *>(0x0);
|
|
if ((deviceRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*deviceRefCount + 4))(), cVar2 != '\0')) {
|
|
if ((deviceCopyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
((cVar2 = (**(code **)(*deviceCopyRefCount + 0xc))(), cVar2 != '\0' &&
|
|
(g_inputDeviceRelease != (void *)0x0)))) {
|
|
(*g_inputDeviceRelease)(&deviceCopy);
|
|
}
|
|
deviceCopyRefCount = piVar4;
|
|
deviceCopy = GHIDRA_CAST<ANM2 *>(local_230);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
|
|
KeyConfigs::apply_to_device
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x4abd8))),*GHIDRA_CAST<int *>(((deviceCopy->_filename)._buf + 0xc)));
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),8);
|
|
if (((deviceCopyRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*deviceCopyRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&deviceCopy);
|
|
}
|
|
}
|
|
local_8 = 9;
|
|
if (((deviceRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar2 = (**(code **)(*deviceRefCount + 0xc))(), cVar2 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&device);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
uVar6 = uVar6 + 1;
|
|
}
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(stringTable))))->ModManager::LoadModContent();
|
|
(GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&savedManager->_netplayManager))))->NetplayManager::Init();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00952df0
|
|
void Manager::load_configs()
|
|
{
|
|
Manager *itemConfig = this;
|
|
uint8_t *extraout_EAX;
|
|
uint8_t *extraout_EAX_00;
|
|
uint8_t *extraout_EAX_01;
|
|
uint8_t *extraout_EAX_02;
|
|
uint8_t *extraout_EAX_03;
|
|
uint8_t *extraout_EAX_04;
|
|
uint8_t *extraout_EAX_05;
|
|
uint8_t *extraout_EAX_06;
|
|
uint8_t *extraout_EAX_07;
|
|
uint8_t *extraout_EAX_08;
|
|
uint8_t *extraout_EAX_09;
|
|
uint8_t *extraout_EAX_10;
|
|
uint8_t *extraout_EAX_11;
|
|
uint8_t *extraout_EAX_12;
|
|
uint8_t *extraout_EAX_13;
|
|
uint8_t *extraout_EAX_14;
|
|
uint8_t *extraout_EAX_15;
|
|
uint8_t *extraout_EAX_16;
|
|
uint8_t *extraout_EAX_17;
|
|
uint8_t *extraout_EAX_18;
|
|
uint8_t *extraout_EAX_19;
|
|
uint8_t *extraout_EAX_20;
|
|
uint8_t *extraout_EAX_21;
|
|
uint8_t *extraout_EAX_22;
|
|
uint8_t *pathBytes;
|
|
char *freeChars;
|
|
void *freeBlock;
|
|
uint32_t freeSize;
|
|
ItemConfig *itemConfig;
|
|
std_string fontPath;
|
|
std_string redirectedPath;
|
|
std_string tmpPath;
|
|
std_string fileName;
|
|
uint32_t local_24;
|
|
char **ppcStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Manager *manager;
|
|
|
|
ppcStack_20 = GHIDRA_CAST<char **>((GHIDRA_INT(&tmpPath) + 0x50));
|
|
puStack_18 = &LAB_00b0c0c5;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_INT(&tmpPath) + 0x44U;
|
|
ExceptionList = &local_1c;
|
|
fileName._capacity = 0xf;
|
|
fileName._size = 9;
|
|
builtin_strncpy(fileName._buf,"music.xm",8);
|
|
fileName._buf[8] = 'l';
|
|
fileName._buf[9] = '\0';
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&g_manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
pathBytes = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX);
|
|
}
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&itemConfig->_musicManager))))->Music::LoadConfig(pathBytes,0);
|
|
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
if (0xf < redirectedPath._capacity) {
|
|
freeSize = redirectedPath._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)redirectedPath._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(redirectedPath._buf)) + 0x0))) + -4);
|
|
freeSize = redirectedPath._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(redirectedPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_00952f07;
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
local_14 = -1;
|
|
redirectedPath._size = 0;
|
|
redirectedPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(redirectedPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(redirectedPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
LAB_00952f07:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
builtin_strncpy(fileName._buf + 8,"s.xml",6);
|
|
fileName._capacity = 0xf;
|
|
fileName._size = 0xd;
|
|
builtin_strncpy(fileName._buf,"cutscene",8);
|
|
local_14 = 2;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&g_manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
pathBytes = extraout_EAX_00;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_00 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_00);
|
|
}
|
|
(GHIDRA_CAST<Cutscene *>((&itemConfig->_cutsceneManager)))->Cutscene::load_xml(pathBytes);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),2);
|
|
if (0xf < tmpPath._capacity) {
|
|
freeSize = tmpPath._capacity + 1;
|
|
freeChars = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeChars = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4));
|
|
freeSize = tmpPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeChars))))) goto LAB_00952ff1;
|
|
}
|
|
operator_delete(freeChars,freeSize);
|
|
}
|
|
local_14 = 0xffffffff;
|
|
tmpPath._size = 0;
|
|
tmpPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
LAB_00952ff1:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
(GHIDRA_CAST<AchievementOverlay *>((&itemConfig->_achievementOverlay)))->AchievementOverlay::load_graphics();
|
|
manager = g_manager;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
tmpPath._size = 0x10;
|
|
tmpPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0))),"achievements.xml",0x11);
|
|
local_14 = 4;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&tmpPath);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),5);
|
|
pathBytes = extraout_EAX_01;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_01 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_01);
|
|
}
|
|
(GHIDRA_CAST<AchievementOverlay *>((&itemConfig->_achievementOverlay)))->AchievementOverlay::load_xml(pathBytes);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < tmpPath._capacity) {
|
|
freeSize = tmpPath._capacity + 1;
|
|
freeChars = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(tmpPath._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeChars = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + -4));
|
|
freeSize = tmpPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeChars))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeChars,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("sounds.xml"),10);
|
|
local_14 = 6;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),7);
|
|
pathBytes = extraout_EAX_02;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_02 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_02);
|
|
}
|
|
(GHIDRA_CAST<SFXManager *>((&itemConfig->_sfxManager)))->SFXManager::load_xml(pathBytes,0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&itemConfig->_nightmareScene) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x35c)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x360)))) = 0;
|
|
FUN_0042f0c0();
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x18)))) =
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x14))));
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemConfig)) + 0x21c10))) = 0;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x36c)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x374)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x37c)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x384)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x38c)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x394)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((itemConfig->_nightmareScene))) + 0x39c)))) = 0x1100000011;
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("nightmares.xml"),0xe);
|
|
local_14 = 8;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),9);
|
|
pathBytes = extraout_EAX_03;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_03 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_03);
|
|
}
|
|
(GHIDRA_CAST<NightmareScene *>((&itemConfig->_nightmareScene)))->NightmareScene::load_nightmares_xml(pathBytes);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
itemConfig = &itemConfig->_itemConfig;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("items.xml"),9);
|
|
local_14 = 10;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0xb);
|
|
pathBytes = extraout_EAX_04;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_04 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_04);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::Load(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("costumes2.xml"),0xd);
|
|
local_14 = 0xc;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0xd);
|
|
pathBytes = extraout_EAX_05;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_05 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_05);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::load_costumes_xml(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("items_metadata.xml"),0x12);
|
|
local_14 = 0xe;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0xf);
|
|
pathBytes = extraout_EAX_06;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_06 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_06);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::load_metadata_xml(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("pocketitems.xml"),0xf);
|
|
local_14 = 0x10;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x11);
|
|
pathBytes = extraout_EAX_07;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_07 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_07);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::load_pocketitems_xml(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("playerforms.xml"),0xf);
|
|
local_14 = 0x12;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x13);
|
|
pathBytes = extraout_EAX_08;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_08 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_08);
|
|
}
|
|
playerforms_xml_load(itemConfig,pathBytes);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("bombcostumes.xml"),0x10);
|
|
local_14 = 0x14;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x15);
|
|
pathBytes = extraout_EAX_09;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_09 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_09);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::LoadBombCostumes(pathBytes,0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("wisps.xml"),9);
|
|
local_14 = 0x16;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x17);
|
|
pathBytes = extraout_EAX_10;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_10 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_10);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::load_wisps_xml(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("locusts.xml"),0xb);
|
|
local_14 = 0x18;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x19);
|
|
pathBytes = extraout_EAX_11;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_11 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_11);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::LoadLocustConfig(pathBytes,GHIDRA_CAST<ModEntry *>(0x0));
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("recipes.xml"),0xb);
|
|
local_14 = 0x1a;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x1b);
|
|
pathBytes = extraout_EAX_12;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_12 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_12);
|
|
}
|
|
(GHIDRA_CAST<ItemConfig *>((itemConfig)))->ItemConfig::load_recipes_xml(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemConfig)) + 0x2a554)))) = 0;
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemConfig)) + 0x2a558))))))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("Unknown"),7);
|
|
(itemConfig->_infoDisplay)._defaultEntry = 0;
|
|
(GHIDRA_CAST<InfoDisplay *>((&itemConfig->_infoDisplay)))->InfoDisplay::load_xml(GHIDRA_CAST<uint8_t *>("info_display.xml"),(void *)0x0);
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("challenges.xml"),0xe);
|
|
local_14 = 0x1c;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x1d);
|
|
pathBytes = extraout_EAX_13;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_13 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_13);
|
|
}
|
|
challenges_xml_load(itemConfig,pathBytes,0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("entities2.xml"),0xd);
|
|
local_14 = 0x1e;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x1f);
|
|
pathBytes = extraout_EAX_14;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_14 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_14);
|
|
}
|
|
(GHIDRA_CAST<EntityConfig *>((&itemConfig->_entityConfig)))->EntityConfig::LoadEntities(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("bosscolors.xml"),0xe);
|
|
local_14 = 0x20;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x21);
|
|
pathBytes = extraout_EAX_15;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_15 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_15);
|
|
}
|
|
(GHIDRA_CAST<EntityConfig *>((&itemConfig->_entityConfig)))->EntityConfig::load_boss_colors(pathBytes);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("players.xml"),0xb);
|
|
local_14 = 0x22;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x23);
|
|
pathBytes = extraout_EAX_16;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_16 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_16);
|
|
}
|
|
(GHIDRA_CAST<EntityConfig *>((&itemConfig->_entityConfig)))->EntityConfig::load_players_xml(pathBytes,(void *)0x0);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("babies.xml"),10);
|
|
local_14 = 0x24;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x25);
|
|
pathBytes = extraout_EAX_17;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_17 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_17);
|
|
}
|
|
(GHIDRA_CAST<EntityConfig *>((&itemConfig->_entityConfig)))->EntityConfig::LoadBabies(pathBytes);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("bossportraits.xml"),0x11);
|
|
local_14 = 0x26;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x27);
|
|
pathBytes = extraout_EAX_18;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_18 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_18);
|
|
}
|
|
load_bossportraits_xml(&itemConfig->_entityConfig,pathBytes);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("font/terminus.fnt"),0x11);
|
|
local_14 = 0x28;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x29);
|
|
pathBytes = extraout_EAX_19;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_19 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_19);
|
|
}
|
|
Font::Load(&itemConfig->_font4_terminus,pathBytes,0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("font/terminus8.fnt"),0x12);
|
|
local_14 = 0x2a;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x2b);
|
|
pathBytes = extraout_EAX_20;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_20 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_20);
|
|
}
|
|
Font::Load(&itemConfig->_font5_terminus8,pathBytes,0);
|
|
(GHIDRA_CAST<msvc::string *>((redirectedPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("font/PFTempestaSevenCondensed.fnt"),0x21);
|
|
local_14 = 0x2c;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&tmpPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x2d);
|
|
pathBytes = extraout_EAX_21;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_21 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_21);
|
|
}
|
|
Font::Load(&itemConfig->_font6_PFTempestaSevenCondensed,pathBytes,0);
|
|
(GHIDRA_CAST<msvc::string *>((tmpPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
manager = g_manager;
|
|
fileName._size = 0;
|
|
fileName._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST<uint64_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) & 0xffffffff00000000;
|
|
(GHIDRA_CAST<msvc::string *>((fileName._buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>("font/LuaMiniOutlined.fnt"),0x18);
|
|
local_14 = 0x2e;
|
|
(GHIDRA_CAST<ModManager *>((GHIDRA_CAST<ModManager *>(&manager->_modManager))))->ModManager::TryRedirectPath(&fontPath,&fileName);
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),0x2f);
|
|
pathBytes = extraout_EAX_22;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX_22 + 0x14))) {
|
|
pathBytes = *GHIDRA_CAST<uint8_t **>(extraout_EAX_22);
|
|
}
|
|
Font::Load(&itemConfig->_font8_LuaMiniOutlined,pathBytes,0);
|
|
(GHIDRA_CAST<msvc::string *>((fontPath._buf)))->msvc::string::_Tidy_deallocate();
|
|
local_14 = 0xffffffff;
|
|
if (0xf < fileName._capacity) {
|
|
freeSize = fileName._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)fileName._buf)) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + -4);
|
|
freeSize = fileName._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(fileName._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
load_fonts(itemConfig);
|
|
*GHIDRA_CAST<uint8_t *>(itemConfig) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((itemConfig)) + 0x4)))) = 3;
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 00953f10
|
|
void Manager::unload_configs()
|
|
{
|
|
int *piVar1;
|
|
uint32_t extraout_ECX;
|
|
uint32_t size;
|
|
Manager *manager;
|
|
int *clipSlot;
|
|
char *stringCursor;
|
|
void *challengeCursor;
|
|
int *clipList;
|
|
void *pvVar2;
|
|
int emptyVector [3];
|
|
void *challengeCapacity;
|
|
Manager *savedManager;
|
|
int entriesLeft;
|
|
void *challengeBegin;
|
|
std_vector *challengeParams;
|
|
char *stringsEnd;
|
|
|
|
manager = g_manager;
|
|
savedManager = g_manager;
|
|
*GHIDRA_CAST<uint32_t *>(&g_manager->_cutsceneManager) = 0;
|
|
clipList = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x70))));
|
|
entriesLeft = 0x1a;
|
|
do {
|
|
clipSlot = GHIDRA_CAST<int *>(clipList[-1]);
|
|
if (clipSlot != GHIDRA_CAST<int *>(*clipList)) {
|
|
do {
|
|
piVar1 = GHIDRA_CAST<int *>(*clipSlot);
|
|
if ((piVar1[0xc] != 0) && ((void *)piVar1[9] != (void *)0x0)) {
|
|
operator_delete((void *)piVar1[9],0x1c);
|
|
piVar1 = GHIDRA_CAST<int *>(*clipSlot);
|
|
}
|
|
(**(code **)(*piVar1 + 8))();
|
|
if (GHIDRA_CAST<uint32_t *>(*clipSlot) != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(*(code *)**GHIDRA_CAST<uint32_t **>(*clipSlot))(1);
|
|
}
|
|
clipSlot = clipSlot + 1;
|
|
} while (clipSlot != GHIDRA_CAST<int *>(*clipList));
|
|
}
|
|
clipList = clipList + 0x13;
|
|
entriesLeft = entriesLeft + -1;
|
|
} while (entriesLeft != 0);
|
|
TheoraVideoManager::destroyVideoClip(*(void **)&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x810))));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x810)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x80c)))) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x81c))) = 0;
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
|
|
*GHIDRA_CAST<uint32_t *>(&manager->_nightmareScene) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x4)))) = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x360)))) = 0;
|
|
stringsEnd = *GHIDRA_CAST<char **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0xc))));
|
|
stringCursor = *GHIDRA_CAST<char **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x8))));
|
|
if (stringCursor != stringsEnd) {
|
|
do {
|
|
(GHIDRA_CAST<msvc::string *>((stringCursor)))->msvc::string::_Tidy_deallocate();
|
|
stringCursor = stringCursor + 0x18;
|
|
} while (stringCursor != stringsEnd);
|
|
stringCursor = *GHIDRA_CAST<char **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x8))));
|
|
}
|
|
*GHIDRA_CAST<char **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0xc)))) = stringCursor;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x18)))) =
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x14))));
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x36c)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x374)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x37c)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x384)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x38c)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x394)))) = 0x1100000011;
|
|
*GHIDRA_CAST<uint64_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x39c)))) = 0x1100000011;
|
|
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_nightmareScene))) + 0x248)))));
|
|
ANM2::Reset(GHIDRA_CAST<ANM2 *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x219d0)))));
|
|
ItemConfig::clear();
|
|
(GHIDRA_CAST<ItemConfig *>((&manager->_itemConfig)))->ItemConfig::reset();
|
|
challengeParams = &manager->_challengeParams;
|
|
if (GHIDRA_CAST<std_vector *>(emptyVector) != challengeParams) {
|
|
challengeBegin = challengeParams->_begin;
|
|
challengeCapacity = (manager->_challengeParams)._capacity;
|
|
pvVar2 = (manager->_challengeParams)._end;
|
|
challengeParams->_begin = (void *)0x0;
|
|
(manager->_challengeParams)._end = (void *)0x0;
|
|
(manager->_challengeParams)._capacity = (void *)0x0;
|
|
if (challengeBegin != (void *)0x0) {
|
|
challengeCursor = challengeBegin;
|
|
if (challengeBegin != pvVar2) {
|
|
do {
|
|
FUN_004269f0();
|
|
challengeCursor = (void *)(GHIDRA_INT(challengeCursor) + 0xa4);
|
|
} while (challengeCursor != pvVar2);
|
|
manager = savedManager;
|
|
}
|
|
size = ((GHIDRA_INT(challengeCapacity) - GHIDRA_INT(challengeBegin)) / 0xa4) * 0xa4;
|
|
pvVar2 = challengeBegin;
|
|
if (0xfff < size) {
|
|
pvVar2 = *(void **)(GHIDRA_CAST<char *>(challengeBegin) + -4);
|
|
size = size + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(challengeBegin) + (-4 - GHIDRA_INT(pvVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar2,size);
|
|
}
|
|
}
|
|
FUN_0069bbf0();
|
|
Font::Unload(&manager->_font5_terminus8);
|
|
Font::Unload(&manager->_font6_PFTempestaSevenCondensed);
|
|
Font::Unload(&manager->_font7_Upheaval);
|
|
Font::Unload(&manager->_font8_LuaMiniOutlined);
|
|
Font::Unload(&manager->_font9_PFTempestaSevenCondensedAgain);
|
|
load_configs(manager);
|
|
return;
|
|
}
|
|
|
|
// 00954150
|
|
void Manager::update_screen_scale(int width, int height, uint8_t isFill)
|
|
{
|
|
int framebufferWidth;
|
|
int framebufferHeight;
|
|
int displayModes;
|
|
uint32_t extraout_ECX;
|
|
int iVar2;
|
|
float fVar3;
|
|
float scaleX;
|
|
float scaleY;
|
|
float heightF;
|
|
float widthF;
|
|
int displayModes;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
framebufferWidth = (GHIDRA_CAST<GraphicsWindow *>((&DAT_00c798e0)))->GraphicsWindow::get_framebuffer_width();
|
|
framebufferHeight = (GHIDRA_CAST<Window *>((&DAT_00c798e0)))->Window::get_framebuffer_height();
|
|
fVar3 = (float)framebufferWidth / (float)width + 0.5;
|
|
FUN_008370b0();
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x808)))) * 0x4c;
|
|
displayModes = *GHIDRA_CAST<int *>((GHIDRA_INT(&(manager->_achievementOverlay)._sprite._filename) + iVar2 + -0xe28));
|
|
g_displayPixelRatio = fVar3;
|
|
if ((displayModes < 0) ||
|
|
(displayModes = *GHIDRA_CAST<int *>((GHIDRA_INT(&(manager->_achievementOverlay)._sprite._filename) +
|
|
iVar2 + -0xe4c)),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&(manager->_achievementOverlay)._sprite._filename) + iVar2 + -0xe48)) -
|
|
displayModes >> 2 <= displayModes)) {
|
|
displayModes = 0x1e0;
|
|
iVar2 = 0x10e;
|
|
}
|
|
else {
|
|
displayModes = (**(code **)(**GHIDRA_CAST<int **>((displayModes + displayModes * 4)) + 0x24))();
|
|
iVar2 = (**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_INT(&(manager->_achievementOverlay)._sprite._filename)
|
|
+ iVar2 + -0xe4c)) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&(manager->_achievementOverlay)._sprite._filename) +
|
|
iVar2 + -0xe28)) * 4)) + 0x28))();
|
|
}
|
|
heightF = (float)height;
|
|
scaleY = (float)iVar2 / heightF;
|
|
widthF = (float)width;
|
|
scaleX = (float)displayModes / widthF;
|
|
fVar3 = scaleY;
|
|
if (isFill == 0) {
|
|
if (scaleX <= scaleY) {
|
|
fVar3 = scaleX;
|
|
}
|
|
}
|
|
else if (scaleY <= scaleX) {
|
|
fVar3 = scaleX;
|
|
}
|
|
g_screenHeight = heightF * fVar3;
|
|
g_screenWidth = widthF * fVar3;
|
|
g_screenPointScale = 1.0 / fVar3;
|
|
_DAT_00bf9420 = g_screenPointScale;
|
|
g_framebufferWidth = framebufferWidth;
|
|
DAT_00c79114 = framebufferHeight;
|
|
DAT_00c7997c = g_screenWidth;
|
|
DAT_00c79980 = g_screenHeight;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x820)))) = (fVar3 - scaleX) * widthF * 0.5;
|
|
*GHIDRA_CAST<float *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x824)))) = (fVar3 - scaleY) * heightF * 0.5;
|
|
_DAT_00c79994 = framebufferWidth;
|
|
_DAT_00c79998 = framebufferHeight;
|
|
DAT_00c799a8 = framebufferWidth;
|
|
DAT_00c799ac = framebufferHeight;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::update_depth_renderbuffer(0);
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
g_game->_triggerWindowResize = 1;
|
|
}
|
|
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
|
|
create_menu_colormod_surface();
|
|
}
|
|
manager->_isRenderSurfaceResetPending = 1;
|
|
return;
|
|
}
|
|
|
|
// 00954320
|
|
void Manager::set_viewport_size(int width, int height)
|
|
{
|
|
int iVar1;
|
|
float *pointScaleSource;
|
|
float displayPixelRatio;
|
|
float fVar2;
|
|
double dVar3;
|
|
double dVar4;
|
|
float local_4c;
|
|
Manager *savedManager;
|
|
float pixelScale;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
savedManager = g_manager;
|
|
iVar1 = (GHIDRA_CAST<GraphicsWindow *>((&DAT_00c798e0)))->GraphicsWindow::get_framebuffer_width();
|
|
(GHIDRA_CAST<Window *>((&DAT_00c798e0)))->Window::get_framebuffer_height();
|
|
displayPixelRatio = (float)iVar1 / (float)width + 0.5;
|
|
FUN_008370b0();
|
|
fVar2 = (float)height / 240.0;
|
|
if ((float)width / 400.0 <= (float)height / 240.0) {
|
|
fVar2 = (float)width / 400.0;
|
|
}
|
|
pixelScale = fVar2 + 1e-05;
|
|
if (5.0 <= pixelScale) {
|
|
pixelScale = fVar2 - 1e-05;
|
|
}
|
|
local_4c = displayPixelRatio * pixelScale;
|
|
g_displayPixelRatio = displayPixelRatio;
|
|
dVar3 = floor((double)local_4c);
|
|
local_4c = 1.0 / displayPixelRatio;
|
|
iVar1 = (manager->_optionsConfig)._maxScale;
|
|
pointScaleSource = &g_screenPointScale;
|
|
if ((float)dVar3 / displayPixelRatio <= 1.0 / displayPixelRatio) {
|
|
pointScaleSource = &local_4c;
|
|
}
|
|
fVar2 = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]);
|
|
g_screenPointScale = *pointScaleSource;
|
|
if (fVar2 <= g_screenPointScale) {
|
|
g_screenPointScale = fVar2;
|
|
}
|
|
local_4c = (float)width / g_screenPointScale;
|
|
_DAT_00bf9420 = g_screenPointScale;
|
|
dVar3 = floor((double)local_4c);
|
|
local_4c = (float)height / g_screenPointScale;
|
|
g_screenWidth = (float)dVar3;
|
|
dVar4 = floor((double)local_4c);
|
|
g_screenHeight = (float)dVar4;
|
|
DAT_00c7997c = (float)dVar3;
|
|
DAT_00c79980 = g_screenHeight;
|
|
local_4c = g_screenHeight;
|
|
DAT_00c799a8 = __ftoui3();
|
|
DAT_00c799ac = __ftoui3();
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Viewport: %dx%d\n"));
|
|
iVar1 = (savedManager->_optionsConfig)._maxRenderScale;
|
|
fVar2 = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) / g_displayPixelRatio;
|
|
if (fVar2 <= g_screenPointScale) {
|
|
g_screenPointScale = fVar2;
|
|
}
|
|
local_4c = g_screenPointScale * g_displayPixelRatio;
|
|
iVar1 = __ftoui3();
|
|
g_framebufferWidth = iVar1;
|
|
DAT_00c79114 = __ftoui3();
|
|
_DAT_00c79994 = iVar1;
|
|
_DAT_00c79998 = DAT_00c79114;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::update_depth_renderbuffer(0);
|
|
g_graphicsManager_flags = g_graphicsManager_flags & 0xffffff7f | 0x40;
|
|
DAT_00c79984 = g_vectorZero.x;
|
|
DAT_00c79988 = g_vectorZero.y;
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
g_game->_triggerWindowResize = 1;
|
|
}
|
|
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
KAGE::SmartPointer<RenderTargetBase>::reset();
|
|
create_menu_colormod_surface();
|
|
}
|
|
savedManager->_isRenderSurfaceResetPending = 1;
|
|
KAGE_LogMessage(1,(uint8_t *)
|
|
"Framebuffer Width: %d \n Render Width: %d \n Window Width: %d \n Multiplier: %f \n DP per point: %f \n Point Scale: %f \n"
|
|
);
|
|
return;
|
|
}
|
|
|
|
// 00954760
|
|
void Manager::validate_language(int unused)
|
|
{
|
|
uint8_t local_14 [8];
|
|
int foundNode;
|
|
uint32_t languageKey;
|
|
|
|
languageKey = 0;
|
|
msvc::set<int>::find_node(local_14,&languageKey);
|
|
if (((*GHIDRA_CAST<char *>((foundNode + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((foundNode + 0x10)) < 1)) &&
|
|
(foundNode != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTable))) + 0x4)))))) {
|
|
*GHIDRA_CAST<uint32_t *>(&this->_stringTable) = 0;
|
|
}
|
|
languageKey = 0;
|
|
msvc::set<int>::find_node(local_14,&languageKey);
|
|
if (((*GHIDRA_CAST<char *>((foundNode + 0xd)) == '\0') && (*GHIDRA_CAST<int *>((foundNode + 0x10)) < 1)) &&
|
|
(foundNode != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_stringTablePc))) + 0x4)))))) {
|
|
*GHIDRA_CAST<uint32_t *>(&this->_stringTablePc) = 0;
|
|
}
|
|
reload_resource_paths();
|
|
return;
|
|
}
|
|
|
|
// 009547f0
|
|
uint8_t * Manager::GetLanguage()
|
|
{
|
|
switch(*GHIDRA_CAST<uint32_t *>(&g_manager->_stringTable)) {
|
|
case 0:
|
|
case 1:
|
|
return &DAT_00b9fbd0;
|
|
case 2:
|
|
return &DAT_00b9fbdc;
|
|
case 3:
|
|
return &DAT_00b9fbe0;
|
|
case 4:
|
|
return &DAT_00b9fbd4;
|
|
case 5:
|
|
return &DAT_00b9fbd8;
|
|
case 6:
|
|
return &DAT_00b9fbb8;
|
|
case 7:
|
|
return &DAT_00b9fbbc;
|
|
case 8:
|
|
case 9:
|
|
return &DAT_00b9fbb0;
|
|
case 10:
|
|
return &DAT_00b9fbb4;
|
|
case 0xb:
|
|
return &DAT_00b9fbc8;
|
|
case 0xc:
|
|
case 0xd:
|
|
return &DAT_00b9fbcc;
|
|
case 0xe:
|
|
return &DAT_00b9fbc0;
|
|
case 0xf:
|
|
return &DAT_00b6d518;
|
|
case 0x10:
|
|
return &DAT_00b9fbc4;
|
|
case 0x11:
|
|
return &DAT_00b9fbec;
|
|
case 0x12:
|
|
return &DAT_00b9fbf0;
|
|
case 0x13:
|
|
return &DAT_00b9fbe4;
|
|
default:
|
|
return &DAT_00b9fbe8;
|
|
}
|
|
}
|
|
|
|
// 009548d0
|
|
void Manager::update_hotkeys()
|
|
{
|
|
uint32_t uVar1;
|
|
uint8_t bVar2;
|
|
char cVar3;
|
|
HWND hWnd;
|
|
LONG windowStyle;
|
|
int *steamContext;
|
|
uint32_t *statsContext;
|
|
int extraout_ECX;
|
|
int iVar4;
|
|
uint32_t newMax;
|
|
uint32_t uVar5;
|
|
int iVar6;
|
|
uint32_t local_40;
|
|
char isAchieved;
|
|
int achievementIds [4];
|
|
uint8_t local_28 [32];
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((local_28 + 0x24));
|
|
if (this->_isHotkeysEnabled == 0) goto LAB_009549c7;
|
|
bVar2 = input_is_action_triggered(this,0x11,-1,GHIDRA_CAST<Entity *>(0x0),0);
|
|
manager = g_manager;
|
|
iVar4 = extraout_ECX;
|
|
if (bVar2 != 0) {
|
|
if ((this->_musicManager)._isEnabled == 0) {
|
|
(this->_musicManager)._isEnabled = 1;
|
|
(this->_musicManager)._channels[(this->_musicManager)._currentChannel]._volume =
|
|
(manager->_optionsConfig)._musicVolume;
|
|
iVar6 = (this->_musicManager)._currentChannel;
|
|
iVar4 = iVar6 * 0x184;
|
|
(this->_musicManager)._channels[iVar6]._targetVolume = (manager->_optionsConfig)._musicVolume;
|
|
}
|
|
else {
|
|
(this->_musicManager)._isEnabled = 0;
|
|
}
|
|
}
|
|
if ((g_graphicsManager_flags & 0x100) == 0) {
|
|
iVar6 = -0x10;
|
|
hWnd = (HWND)FUN_00a5f090(iVar4);
|
|
windowStyle = GetWindowLongA(hWnd,iVar6);
|
|
if (windowStyle < 0) goto LAB_0095497c;
|
|
bVar2 = 0;
|
|
}
|
|
else {
|
|
LAB_0095497c:
|
|
bVar2 = 1;
|
|
}
|
|
local_40 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_40)) + 0x1))),bVar2);
|
|
if (bVar2 != (this->_optionsConfig)._isFullscreen) {
|
|
OptionsConfig::set_fullscreen(&this->_optionsConfig,bVar2);
|
|
}
|
|
bVar2 = input_is_action_triggered(g_manager,0x10,-1,GHIDRA_CAST<Entity *>(0x0),0);
|
|
if (bVar2 != 0) {
|
|
OptionsConfig::set_fullscreen(&this->_optionsConfig,(this->_optionsConfig)._isFullscreen == 0);
|
|
}
|
|
LAB_009549c7:
|
|
local_40 = 0x156;
|
|
cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20730,&local_40,0,0);
|
|
if (cVar3 != '\0') {
|
|
local_40 = 0x123;
|
|
cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_40,0,0);
|
|
if (((cVar3 != '\0') && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1)) &&
|
|
(g_menuManager->_selectedMenuID == 9)) {
|
|
steamContext = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00bf93c8));
|
|
if (*steamContext != 0) {
|
|
uVar5 = 1;
|
|
do {
|
|
sprintf_s(local_28,0x20,s__d);
|
|
statsContext = GHIDRA_CAST<uint32_t *>(SteamInternal_ContextInit(&PTR_FUN_00bf93c8));
|
|
cVar3 = (**(code **)(*GHIDRA_CAST<int *>(*statsContext) + 0x14))(local_28,&isAchieved);
|
|
if ((cVar3 != '\0') && (isAchieved != '\0')) {
|
|
(this->_persistentGameData)._achievements[uVar5] = 1;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < 0x282);
|
|
achievementIds[0] = 0;
|
|
achievementIds[1] = 0x51;
|
|
achievementIds[2] = 0x96;
|
|
achievementIds[3] = 8;
|
|
uVar5 = 1;
|
|
local_28[0] = 0x8b;
|
|
local_28[1] = 0;
|
|
local_28[2] = 0;
|
|
local_28[3] = 0;
|
|
local_28[4] = 0x21;
|
|
local_28[5] = 0;
|
|
local_28[6] = 0;
|
|
local_28[7] = 0;
|
|
local_28[8] = 0x8c;
|
|
local_28[9] = 0;
|
|
local_28[10] = 0;
|
|
local_28[0xb] = 0;
|
|
local_28[0xc] = 0x8d;
|
|
local_28[0xd] = 0;
|
|
local_28[0xe] = 0;
|
|
local_28[0xf] = 0;
|
|
local_28[0x10] = 10;
|
|
local_28[0x11] = 0;
|
|
local_28[0x12] = 0;
|
|
local_28[0x13] = 0;
|
|
local_28[0x14] = 0xb;
|
|
local_28[0x15] = 0;
|
|
local_28[0x16] = 0;
|
|
local_28[0x17] = 0;
|
|
local_28[0x18] = 0x20;
|
|
local_28[0x19] = 0;
|
|
local_28[0x1a] = 0;
|
|
local_28[0x1b] = 0;
|
|
local_28[0x1c] = 0x22;
|
|
local_28[0x1d] = 0;
|
|
local_28[0x1e] = 0;
|
|
local_28[0x1f] = 0;
|
|
do {
|
|
if ((this->_persistentGameData)._achievements[achievementIds[uVar5]] != 0) {
|
|
uVar1 = (this->_persistentGameData)._eventCounters[1];
|
|
newMax = uVar5;
|
|
if (uVar5 < uVar1) {
|
|
newMax = uVar1;
|
|
}
|
|
(this->_persistentGameData)._eventCounters[1] = newMax;
|
|
}
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < 0xb);
|
|
}
|
|
BackupSaveFile(GHIDRA_CAST<Manager *>(&this->_persistentGameData));
|
|
cVar3 = FUN_00956750();
|
|
if (cVar3 != '\0') {
|
|
(GHIDRA_CAST<PersistentGameData *>((&this->_persistentGameData)))->PersistentGameData::SaveToSteamCloud();
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&this->_persistentGameData)))->PersistentGameData::Save();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00954cd0
|
|
void Manager::Update(char param_1)
|
|
{
|
|
float fVar1;
|
|
void *pvVar2;
|
|
float fVar3;
|
|
Manager *pMVar4;
|
|
char cVar5;
|
|
uint8_t bVar6;
|
|
uint32_t uVar7;
|
|
int iVar8;
|
|
Camera **ppCVar9;
|
|
int iVar10;
|
|
int extraout_ECX;
|
|
CoopJoinSlot *coopSlot;
|
|
MenuManager *this;
|
|
Camera **ppCVar11;
|
|
char *anim;
|
|
float *buttonSlide;
|
|
bool isShortOfTarget;
|
|
Camera *pCVar12;
|
|
float fVar13;
|
|
float fVar14;
|
|
uint8_t auStack_488 [4];
|
|
Camera *local_484;
|
|
PopupButtons *local_480;
|
|
Manager *local_47c;
|
|
Camera *local_478;
|
|
Camera *local_474;
|
|
double cursorY;
|
|
double cursorX;
|
|
float local_460;
|
|
float fStack_45c;
|
|
float fStack_458;
|
|
float fStack_454;
|
|
KColor fadeColor;
|
|
uint8_t local_420 [8];
|
|
uint8_t screenshotDir [1028];
|
|
uint32_t stackCookie;
|
|
Game *game;
|
|
|
|
pMVar4 = g_manager;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(auStack_488);
|
|
local_47c = g_manager;
|
|
uVar7 = g_manager->_framecount & 0x80000001;
|
|
if (GHIDRA_INT(uVar7) < 0) {
|
|
uVar7 = (uVar7 - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if ((uVar7 == 1) && ((g_manager->_optionsConfig)._enableInterpolation == 0)) {
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x4abc4))) == '\0') || ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x4abc5))) != '\0')) {
|
|
g_manager->_framecount = g_manager->_framecount + 1;
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (*GHIDRA_CAST<char *>(g_manager) != '\0') {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) = 4;
|
|
*GHIDRA_CAST<uint8_t *>(pMVar4) = 0;
|
|
}
|
|
start_pending_game(pMVar4);
|
|
start_pending_menu(pMVar4);
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pMVar4->_cutsceneManager))) + 0x848))) == '\0') {
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8))));
|
|
}
|
|
else {
|
|
if ((pMVar4->_cutsceneManager)._isQueuedCleanup != 0) {
|
|
pMVar4->_isSaveOnExit = 0;
|
|
unload_state(pMVar4);
|
|
}
|
|
(GHIDRA_CAST<Cutscene *>((&pMVar4->_cutsceneManager)))->Cutscene::Show((pMVar4->_cutsceneManager)._queuedCutsceneId);
|
|
pMVar4->_previousState = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8))));
|
|
iVar8 = 3;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8)))) = 3;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pMVar4->_cutsceneManager))) + 0x848))) = 0;
|
|
}
|
|
if (pMVar4->_isNightmarePending == 0) {
|
|
if (iVar8 == 3) {
|
|
iVar10 = *GHIDRA_CAST<int *>(&pMVar4->_cutsceneManager);
|
|
goto joined_r0x00954dfc;
|
|
}
|
|
if (iVar8 == 5) goto LAB_00954e0c;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NightmareScene *>((&pMVar4->_nightmareScene)))->NightmareScene::Show((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x4b2a5))));
|
|
pMVar4->_previousState = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8))));
|
|
iVar8 = 5;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8)))) = 5;
|
|
pMVar4->_isNightmarePending = 0;
|
|
LAB_00954e0c:
|
|
iVar10 = *GHIDRA_CAST<int *>(&pMVar4->_nightmareScene);
|
|
joined_r0x00954dfc:
|
|
if (iVar10 == 0) {
|
|
(pMVar4->_achievementOverlay)._isPopupBlocked = 0;
|
|
if ((iVar8 == 3) && ((pMVar4->_cutsceneManager)._isQueuedCleanup != 0)) {
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8)))) = pMVar4->_previousState;
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((pMVar4->_cutsceneManager))) + 0x808)))) * 0x4c;
|
|
buttonSlide = GHIDRA_CAST<float *>((GHIDRA_INT(&(pMVar4->_achievementOverlay)._sprite._filename) +
|
|
iVar8 + -0xe3c));
|
|
fVar13 = *buttonSlide;
|
|
fVar14 = buttonSlide[1];
|
|
fVar1 = buttonSlide[2];
|
|
fVar3 = buttonSlide[3];
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_INT(&(pMVar4->_achievementOverlay)._sprite._filename) + iVar8 + -0xe2c));
|
|
pMVar4->_pendingMenuState = pMVar4->_cutsceneNextMenuState;
|
|
(pMVar4->_pendingMenuFadeColor)._red = fVar13;
|
|
(pMVar4->_pendingMenuFadeColor)._green = fVar14;
|
|
(pMVar4->_pendingMenuFadeColor)._blue = fVar1;
|
|
(pMVar4->_pendingMenuFadeColor)._alpha = fVar3;
|
|
(pMVar4->_pendingMenuFadeColor)._unk = iVar8;
|
|
pMVar4->_isMenuPending = 1;
|
|
start_pending_menu(pMVar4);
|
|
}
|
|
else {
|
|
bVar6 = pMVar4[1]._persistentGameData._achievements[0];
|
|
iVar8 = pMVar4->_previousState;
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8)))) = iVar8;
|
|
if (bVar6 != 0) {
|
|
input_poll_active_device();
|
|
(GHIDRA_CAST<KColor *>((&fadeColor)))->KColor::SetFromARGB(0xff000000);
|
|
game = g_game;
|
|
local_460 = fadeColor._red;
|
|
fStack_454 = (g_game->_fadeOutColor)._alpha;
|
|
fStack_45c = fadeColor._green;
|
|
fStack_458 = fadeColor._blue;
|
|
g_game->_fadeSpeed = 1.0;
|
|
game->_fadeOutTarget = 8;
|
|
(game->_fadeOutColor)._red = fadeColor._red;
|
|
(game->_fadeOutColor)._green = fadeColor._green;
|
|
(game->_fadeOutColor)._blue = fadeColor._blue;
|
|
(game->_fadeOutColor)._alpha = fStack_454;
|
|
(game->_fadeOutColor)._unk = 0;
|
|
(game->_fadeOutColor)._alpha = (game->_fadeOutColor)._alpha + 1.0;
|
|
iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8))));
|
|
}
|
|
if (iVar8 == 1) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Cutscene End\n"));
|
|
(GHIDRA_CAST<MusicManager *>((&g_manager->_musicManager)))->MusicManager::Crossfade(0x3f,0.08);
|
|
}
|
|
}
|
|
pMVar4[1]._persistentGameData._achievements[0] = 0;
|
|
}
|
|
}
|
|
if (param_1 != '\0') {
|
|
if (_glfw == 0) {
|
|
_glfwInputError(0x10001,0);
|
|
}
|
|
else {
|
|
(*DAT_00c7378c)();
|
|
}
|
|
Gamepad_processEvents();
|
|
(GHIDRA_CAST<KAGE::Input::Manager *>((GHIDRA_CAST<Manager *>(&PTR_vftable_00c57b18))))->KAGE::Input::Manager::update_devices();
|
|
}
|
|
update_controller_popups(pMVar4);
|
|
PopupQueue::Update();
|
|
local_480 = &pMVar4->_popupButtons;
|
|
FUN_00424220();
|
|
uVar7 = 0;
|
|
fVar13 = 6.0;
|
|
buttonSlide = &local_480->_buttons[0]._slideOffset;
|
|
do {
|
|
local_484 = GHIDRA_CAST<Camera *>(buttonSlide[1]);
|
|
fVar14 = *buttonSlide;
|
|
if (fVar14 <= (float)local_484) {
|
|
pCVar12 = GHIDRA_CAST<Camera *>((fVar14 + fVar13));
|
|
ppCVar11 = &local_474;
|
|
local_474 = pCVar12;
|
|
isShortOfTarget = (float)pCVar12 < (float)local_484;
|
|
}
|
|
else {
|
|
pCVar12 = GHIDRA_CAST<Camera *>((fVar14 - fVar13));
|
|
ppCVar11 = &local_478;
|
|
local_478 = pCVar12;
|
|
isShortOfTarget = (float)local_484 < (float)pCVar12;
|
|
}
|
|
ppCVar9 = &local_484;
|
|
if (isShortOfTarget || (float)local_484 == (float)pCVar12) {
|
|
ppCVar9 = ppCVar11;
|
|
}
|
|
*buttonSlide = (float)*ppCVar9;
|
|
if (buttonSlide[4] != 4.48416e-44) {
|
|
FUN_00424130(local_420,uVar7);
|
|
}
|
|
pMVar4 = local_47c;
|
|
uVar7 = uVar7 + 1;
|
|
buttonSlide = buttonSlide + 0x4c;
|
|
} while (uVar7 < 2);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((local_47c)) + 0x4abc5))) = 0;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_47c[1]._gamestate)) + 0x290)))) == 0) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_47c[1]._gamestate)) + 0x2d8)))) < 1)) {
|
|
update_hotkeys(local_47c);
|
|
local_47c = GHIDRA_CAST<Manager *>(0x12a);
|
|
cVar5 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0,FUN_00a207d0,&local_47c,0,0);
|
|
if (cVar5 != '\0') {
|
|
sprintf(screenshotDir,GHIDRA_CAST<uint8_t *>("%sscreenshots"));
|
|
CreateDirectoryA((LPCSTR)screenshotDir,(LPSECURITY_ATTRIBUTES)0x0);
|
|
save_screenshot();
|
|
}
|
|
}
|
|
bVar6 = (GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&pMVar4->_netplayManager))))->NetplayManager::Update();
|
|
if ((bVar6 == 0) &&
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8)))) == 2 || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8)))) == 5)) &&
|
|
(g_game != GHIDRA_CAST<Game *>(0x0))))) {
|
|
(GHIDRA_CAST<Console *>((GHIDRA_CAST<Console *>(&g_game->_console))))->Console::Update();
|
|
(GHIDRA_CAST<Console *>((GHIDRA_CAST<Console *>(&g_game->_console))))->Console::update_state();
|
|
cVar5 = FUN_006f9730();
|
|
if (cVar5 == '\0') {
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<PauseScreen *>((GHIDRA_CAST<PauseScreen *>((extraout_ECX + 0x23a74)))))->PauseScreen::Update();
|
|
netplay_lobby_menu_update();
|
|
return;
|
|
}
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x4abc4))) != '\0') && ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x4abc5))) == '\0')) {
|
|
return;
|
|
}
|
|
iVar8 = (pMVar4->_achievementOverlay)._state;
|
|
if (iVar8 != 0) {
|
|
if ((pMVar4->_achievementOverlay)._isPopupBlocked == 0) {
|
|
(GHIDRA_CAST<AchievementOverlay *>((&pMVar4->_achievementOverlay)))->AchievementOverlay::Update();
|
|
iVar8 = (pMVar4->_achievementOverlay)._state;
|
|
}
|
|
if (((iVar8 != 0) && ((pMVar4->_achievementOverlay)._isPopupBlocked == 0)) &&
|
|
(((pMVar4->_optionsConfig)._popupsMode == 1 &&
|
|
(pMVar4->_netplayManager == *GHIDRA_CAST<int *>((pMVar4 + 1)))))) goto switchD_0095519c_caseD_4;
|
|
}
|
|
switch(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((pMVar4)) + 0x8))))) {
|
|
case 1:
|
|
cVar5 = FUN_009c3990();
|
|
if (((g_menuManager->_selectedMenuID == 0x11) || (cVar5 == '\0')) &&
|
|
(cVar5 = FUN_009505e0(), cVar5 == '\0')) {
|
|
this->MenuManager::Update();
|
|
}
|
|
break;
|
|
case 2:
|
|
cVar5 = FUN_009c3990();
|
|
if ((cVar5 == '\0') && (cVar5 = FUN_009505e0(), cVar5 == '\0')) {
|
|
update_ingame_input();
|
|
}
|
|
if (pMVar4->_starting != 0) break;
|
|
if ((pMVar4->_framecount & 1) == 0) {
|
|
uVar7 = 0;
|
|
pvVar2 = g_game->_room;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x1264)) != 0) {
|
|
do {
|
|
iVar8 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x125c)) + uVar7 * 4));
|
|
if (*GHIDRA_CAST<char *>((iVar8 + 0x175)) != '\0') {
|
|
*GHIDRA_CAST<uint32_t *>((iVar8 + 0x33c)) = *GHIDRA_CAST<uint32_t *>((iVar8 + 0x344));
|
|
*GHIDRA_CAST<uint32_t *>((iVar8 + 0x340)) = *GHIDRA_CAST<uint32_t *>((iVar8 + 0x348));
|
|
*GHIDRA_CAST<uint8_t *>((iVar8 + 0x175)) = 0;
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar2) + 0x1264)));
|
|
}
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Update();
|
|
}
|
|
else if ((pMVar4->_optionsConfig)._enableInterpolation != 0) {
|
|
Game::interpolate_update();
|
|
}
|
|
game = g_game;
|
|
local_484 = *GHIDRA_CAST<Camera **>((GHIDRA_CAST<char *>(g_game->_room) + 0x11f8));
|
|
local_480 = GHIDRA_CAST<PopupButtons *>((CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_480)) + 0x1))),(char)pMVar4->_framecount) & 0xffffff01));
|
|
bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused();
|
|
pCVar12 = local_484;
|
|
if ((bVar6 == 0) ||
|
|
((*GHIDRA_CAST<int *>(&game->_roomTransition) != 0 && ((game->_roomTransition)._animation == 0x13)))) {
|
|
iVar8 = (g_manager->_optionsConfig)._cameraStyle;
|
|
if ((iVar8 == 1) || (iVar8 != 2)) {
|
|
(GHIDRA_CAST<Camera *>((local_484)))->Camera::update_focus_position((uint8_t)local_480);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Camera *>((local_484)))->Camera::update_follow();
|
|
if ((char)local_480 == '\0') goto LAB_009552c4;
|
|
}
|
|
pCVar12->_shouldOverride = 0;
|
|
}
|
|
LAB_009552c4:
|
|
game = g_game;
|
|
iVar8 = 4;
|
|
coopSlot = (g_game->_playerManager)._coopSlots;
|
|
do {
|
|
if (-1 < coopSlot->_controllerIndex) {
|
|
iVar10 = GHIDRA_INT((game->_playerManager)._coopPlayerTypes._end) -
|
|
GHIDRA_INT((game->_playerManager)._coopPlayerTypes._begin);
|
|
fVar14 = (float)((double)(iVar10 >> 2) + __uint_to_double_fixup[-(iVar10 >> 0x1f)]);
|
|
for (fVar13 = (float)coopSlot->_state - coopSlot->_menuPosition; fVar14 * 0.5 <= fVar13;
|
|
fVar13 = fVar13 - fVar14) {
|
|
}
|
|
for (; fVar13 < -fVar14 * 0.5; fVar13 = fVar13 + fVar14) {
|
|
}
|
|
if (0.25 <= ABS(fVar13)) {
|
|
if (fVar13 <= 0.0) {
|
|
fVar13 = -0.25;
|
|
}
|
|
else {
|
|
fVar13 = 0.25;
|
|
}
|
|
coopSlot->_menuPosition = fVar13 + coopSlot->_menuPosition;
|
|
}
|
|
else {
|
|
coopSlot->_menuPosition = (float)coopSlot->_state;
|
|
}
|
|
}
|
|
coopSlot = coopSlot + 1;
|
|
iVar8 = iVar8 + -1;
|
|
} while (iVar8 != 0);
|
|
break;
|
|
case 3:
|
|
update_state_loading();
|
|
break;
|
|
case 5:
|
|
(GHIDRA_CAST<NightmareScene *>((&pMVar4->_nightmareScene)))->NightmareScene::Update();
|
|
}
|
|
switchD_0095519c_caseD_4:
|
|
if ((g_game != GHIDRA_CAST<Game *>(0x0)) && (bVar6 = (GHIDRA_CAST<Game *>((g_game)))->Game::IsPaused(), bVar6 == 0)) {
|
|
fVar13 = (pMVar4->_sfxManager)._volumeModifier;
|
|
fVar14 = 1.0;
|
|
if ((fVar13 != 1.0) && (fVar1 = (pMVar4->_sfxManager)._volumeModifierStep, fVar1 != 0.0)) {
|
|
if (fVar1 < ABS(fVar13 - 1.0)) {
|
|
if (1.0 <= fVar13) {
|
|
fVar14 = fVar13 - fVar1;
|
|
}
|
|
else {
|
|
fVar14 = fVar13 + fVar1;
|
|
}
|
|
}
|
|
(pMVar4->_sfxManager)._volumeModifier = fVar14;
|
|
(GHIDRA_CAST<SoundEffects *>((&pMVar4->_sfxManager)))->SoundEffects::ClearVolumeModifier();
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Music *>((GHIDRA_CAST<Music *>(&pMVar4->_musicManager))))->Music::Update();
|
|
if ((pMVar4->_optionsConfig)._enableMouseControl != 0) {
|
|
iVar8 = glfwGetMouseButton();
|
|
anim = "Clicked";
|
|
if (iVar8 == 0) {
|
|
anim = GHIDRA_CAST<char *>(s_Idle);
|
|
}
|
|
ANM2::Play(&pMVar4->_cursorSprite,GHIDRA_CAST<uint8_t *>(anim),0);
|
|
pvVar2 = g_glfwWindow;
|
|
if (g_glfwWindow == (void *)0x0) {
|
|
_wassert(L"window != NULL",
|
|
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c"
|
|
,0x310);
|
|
}
|
|
cursorX = 0.0;
|
|
cursorY = 0.0;
|
|
if (_glfw == 0) {
|
|
_glfwInputError(0x10001,0);
|
|
}
|
|
else if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar2) + 0x70)) == 0x34003) {
|
|
cursorX = *GHIDRA_CAST<double *>((GHIDRA_CAST<char *>(pvVar2) + 0x1e0));
|
|
cursorY = *GHIDRA_CAST<double *>((GHIDRA_CAST<char *>(pvVar2) + 0x1e8));
|
|
}
|
|
else {
|
|
(*DAT_00c736a0)(pvVar2,&cursorX,&cursorY);
|
|
}
|
|
if (((float)cursorX == (pMVar4->_lastMousePosition).x) &&
|
|
((float)cursorY == (pMVar4->_lastMousePosition).y)) {
|
|
if (0 < pMVar4->_cursorVisibleTimer) {
|
|
pMVar4->_cursorVisibleTimer = pMVar4->_cursorVisibleTimer + -1;
|
|
}
|
|
}
|
|
else {
|
|
pMVar4->_cursorVisibleTimer = 300;
|
|
}
|
|
(pMVar4->_lastMousePosition).x = (float)cursorX;
|
|
(pMVar4->_lastMousePosition).y = (float)cursorY;
|
|
}
|
|
pMVar4->_framecount = pMVar4->_framecount + 1;
|
|
return;
|
|
}
|
|
|
|
// 009555c0
|
|
void Manager::Render()
|
|
{
|
|
Manager *pMVar1;
|
|
uint8_t *puVar2;
|
|
uint32_t uVar3;
|
|
HWND hWnd;
|
|
LONG windowStyle;
|
|
int *piVar4;
|
|
uint32_t *renderTargetEntry;
|
|
int iVar5;
|
|
void *colorQuad;
|
|
KColor *color;
|
|
LayerState *overlayLayer;
|
|
uint32_t extraout_ECX;
|
|
uint32_t extraout_ECX_00;
|
|
uint32_t extraout_ECX_01;
|
|
uint32_t extraout_ECX_02;
|
|
int unused;
|
|
int unused_00;
|
|
MenuManager *extraout_ECX_03;
|
|
MenuManager *extraout_ECX_04;
|
|
MenuManager *extraout_ECX_05;
|
|
MenuManager *extraout_ECX_06;
|
|
MenuManager *extraout_ECX_07;
|
|
MenuManager *local_ECX_505;
|
|
MenuManager *extraout_ECX_08;
|
|
KColor *color_00;
|
|
int extraout_ECX_09;
|
|
float *pfVar6;
|
|
AnimationState *secondAnimState;
|
|
int unused_01;
|
|
int unused_02;
|
|
int extraout_ECX_10;
|
|
int unused_03;
|
|
int unused_04;
|
|
KColor *color_01;
|
|
int extraout_ECX_11;
|
|
KColor *color_02;
|
|
int extraout_ECX_12;
|
|
KColor *color_03;
|
|
uint8_t *puVar7;
|
|
uint8_t *text;
|
|
float cursorScaleX;
|
|
int iVar8;
|
|
uint8_t cutsceneQuadBuffer [112];
|
|
uint8_t upscaleQuadBuffer [112];
|
|
uint8_t quadBuffer [112];
|
|
uint32_t upscaleDrawParams;
|
|
uint32_t local_8c;
|
|
uint32_t local_88;
|
|
uint32_t local_84;
|
|
uint32_t local_80;
|
|
uint32_t local_7c;
|
|
uint32_t local_78;
|
|
uint32_t local_74;
|
|
uint8_t local_70;
|
|
int windowSize;
|
|
float *cutsceneAnimsEnd;
|
|
uint32_t drawParams;
|
|
uint32_t local_60;
|
|
uint32_t local_5c;
|
|
uint32_t local_58;
|
|
uint32_t local_54;
|
|
uint32_t local_50;
|
|
uint32_t local_4c;
|
|
uint32_t local_48;
|
|
uint32_t local_44;
|
|
float local_40;
|
|
char isFramebufferResized;
|
|
char isFilterEnabled;
|
|
uint8_t local_38 [12];
|
|
Vector scratchVec;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
ANM2 *achievementSprite;
|
|
Manager *temp_3f5a48c29e;
|
|
|
|
temp_3f5a48c29e = g_manager;
|
|
puStack_20 = local_38 + 0x34;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0c12d;
|
|
local_1c = ExceptionList;
|
|
uVar3 = __security_cookie ^ GHIDRA_UINT((local_38 + 0x28));
|
|
if (((g_manager->_framecount & 1) == 0) && ((g_manager->_optionsConfig)._enableInterpolation == 0)
|
|
) {
|
|
return;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
local_24 = uVar3;
|
|
puVar2 = local_38 + 0x34;
|
|
if (g_manager->_isRenderSurfaceResetPending != 0) {
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(this);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_00);
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(extraout_ECX_01);
|
|
create_render_surfaces(temp_3f5a48c29e);
|
|
if ((g_graphicsManager_flags & 0x100) == 0) {
|
|
iVar8 = -0x10;
|
|
hWnd = (HWND)FUN_00a5f090(extraout_ECX_02);
|
|
windowStyle = GetWindowLongA(hWnd,iVar8);
|
|
if (-1 < windowStyle) {
|
|
piVar4 = glfw_get_window_size(GHIDRA_CAST<int *>(&scratchVec),unused);
|
|
(temp_3f5a48c29e->_optionsConfig)._windowWidth = *piVar4;
|
|
piVar4 = glfw_get_window_size(GHIDRA_CAST<int *>(&scratchVec),unused_00);
|
|
(temp_3f5a48c29e->_optionsConfig)._windowHeight = piVar4[1];
|
|
}
|
|
}
|
|
temp_3f5a48c29e->_isRenderSurfaceResetPending = 0;
|
|
puVar2 = puStack_20;
|
|
}
|
|
puStack_20 = puVar2;
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget((void *)0x0,0);
|
|
local_ECX_505 = extraout_ECX_03;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x8)))) != 3) {
|
|
iVar8 = (GHIDRA_CAST<GraphicsWindow *>((&DAT_00c798e0)))->GraphicsWindow::get_framebuffer_width();
|
|
local_ECX_505 = extraout_ECX_04;
|
|
if (iVar8 != g_framebufferWidth) {
|
|
isFramebufferResized = '\x01';
|
|
scratchVec.x = 0.0;
|
|
scratchVec.y = 0.0;
|
|
msvc::vector::resize(&scratchVec);
|
|
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(DAT_00c798a0,1);
|
|
local_ECX_505 = extraout_ECX_05;
|
|
goto LAB_00955727;
|
|
}
|
|
}
|
|
isFramebufferResized = '\0';
|
|
LAB_00955727:
|
|
if ((((temp_3f5a48c29e->_optionsConfig)._enableFilter == 0) ||
|
|
((temp_3f5a48c29e->_optionsConfig)._filterEnabled == 0)) ||
|
|
(((*GHIDRA_CAST<int *>(&temp_3f5a48c29e->_cutsceneManager) == 1 &&
|
|
(iVar8 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((temp_3f5a48c29e->_cutsceneManager))) + 0x810)))), iVar8 != 0)) &&
|
|
((*GHIDRA_CAST<char *>((iVar8 + 0x74)) == '\0' ||
|
|
((iVar5 = FUN_00aaa450(uVar3), iVar5 != 0 &&
|
|
(local_ECX_505 = extraout_ECX_06, *GHIDRA_CAST<float *>((iVar5 + 4)) < *GHIDRA_CAST<float *>((iVar8 + 0x58)))))))))) {
|
|
isFilterEnabled = '\0';
|
|
}
|
|
else {
|
|
isFilterEnabled = '\x01';
|
|
scratchVec.x = 0.0;
|
|
scratchVec.y = 0.0;
|
|
msvc::vector::resize(&scratchVec);
|
|
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(DAT_00c79890,1);
|
|
local_ECX_505 = extraout_ECX_07;
|
|
}
|
|
if ((g_manager->_optionsConfig)._enableColorCorrection != 0) {
|
|
FUN_00683680();
|
|
(GHIDRA_CAST<KAGE_Graphics *>((&DAT_00c798e0)))->KAGE_Graphics::SetRenderTarget(DAT_00c798a8,1);
|
|
local_ECX_505 = extraout_ECX_08;
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a6d8))) == '\0') {
|
|
switch(*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x8))))) {
|
|
case 1:
|
|
(GHIDRA_CAST<MenuManager *>((local_ECX_505)))->MenuManager::Render();
|
|
break;
|
|
case 2:
|
|
(GHIDRA_CAST<Game *>((g_game)))->Game::Render();
|
|
break;
|
|
case 3:
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
iVar5 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((temp_3f5a48c29e->_cutsceneManager))) + 0x808)))) * 0x4c;
|
|
colorQuad = render_quad_set_uniform_color
|
|
(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,
|
|
(KColor *)
|
|
(GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) +
|
|
iVar5 + -0xe3c));
|
|
render_color_shader_pass(colorQuad);
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) +
|
|
iVar5 + -0xe28));
|
|
pfVar6 = GHIDRA_CAST<float *>((GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) +
|
|
iVar5 + -0xe4c));
|
|
if ((iVar8 < 0) ||
|
|
(cutsceneAnimsEnd = pfVar6 + 1, GHIDRA_INT(*cutsceneAnimsEnd) - GHIDRA_INT(*pfVar6) >> 2 <= iVar8)) {
|
|
local_40 = *pfVar6;
|
|
cutsceneAnimsEnd = pfVar6 + 1;
|
|
scratchVec.y = (float)pfVar6;
|
|
if (local_40 != *cutsceneAnimsEnd) {
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_CAST<char *>(local_40) + -4 +
|
|
(GHIDRA_INT(*cutsceneAnimsEnd) - GHIDRA_INT(local_40) >> 2) * 4)) + 0x14))
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((temp_3f5a48c29e->_cutsceneManager))) + 0x820))));
|
|
pfVar6 = GHIDRA_CAST<float *>(scratchVec.y);
|
|
}
|
|
}
|
|
else {
|
|
(**(code **)(**GHIDRA_CAST<int **>((GHIDRA_INT(*pfVar6) + iVar8 * 4)) + 0x14))
|
|
(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((temp_3f5a48c29e->_cutsceneManager))) + 0x820))));
|
|
pfVar6 = GHIDRA_CAST<float *>((GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) +
|
|
iVar5 + -0xe4c));
|
|
}
|
|
if (((*GHIDRA_CAST<char *>((GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) +
|
|
iVar5 + -0xe40)) != '\0') &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) +
|
|
iVar5 + -0xe20)) != '\0' ||
|
|
(GHIDRA_INT(*cutsceneAnimsEnd) - GHIDRA_INT(*pfVar6) >> 2 <=
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) + iVar5 + -0xe28
|
|
)))))) ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) + iVar5 + -0xe3f))
|
|
!= '\0')) {
|
|
*(uint32_t *)
|
|
(GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) + iVar5 + -0xe30) =
|
|
*(uint32_t *)
|
|
(GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) + iVar5 + -0xe24);
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
colorQuad = render_quad_set_uniform_color
|
|
(cutsceneQuadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,
|
|
(KColor *)
|
|
(GHIDRA_INT(&(temp_3f5a48c29e->_achievementOverlay)._sprite._filename) +
|
|
iVar5 + -0xe3c));
|
|
render_color_shader_pass(colorQuad);
|
|
}
|
|
break;
|
|
case 5:
|
|
(GHIDRA_CAST<NightmareScene *>((&temp_3f5a48c29e->_nightmareScene)))->NightmareScene::Render();
|
|
}
|
|
if (((temp_3f5a48c29e->_achievementOverlay)._state != 0) &&
|
|
((temp_3f5a48c29e->_achievementOverlay)._isPopupBlocked == 0)) {
|
|
scratchVec.y = g_screenHeight * 0.5;
|
|
scratchVec.x = g_screenWidth * 0.5;
|
|
if (((g_manager->_optionsConfig)._popupsMode == 2) ||
|
|
(g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1)))) {
|
|
achievementSprite = &(temp_3f5a48c29e->_achievementOverlay)._sprite;
|
|
scratchVec.y = g_screenHeight * 0.5 * 1.75;
|
|
scratchVec.x = g_screenWidth * 0.5 * 0.25;
|
|
overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
overlayLayer->_minFilterMode = 1;
|
|
overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
overlayLayer->_magFilterMode = 1;
|
|
}
|
|
else {
|
|
achievementSprite = &(temp_3f5a48c29e->_achievementOverlay)._sprite;
|
|
overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
overlayLayer->_minFilterMode = 0;
|
|
overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST<uint8_t *>(0x3));
|
|
overlayLayer->_magFilterMode = 0;
|
|
}
|
|
if ((temp_3f5a48c29e->_achievementOverlay)._sprite._loaded != 0) {
|
|
if ((temp_3f5a48c29e->_achievementOverlay)._sprite._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(temp_3f5a48c29e->_achievementOverlay)._sprite._animState,&scratchVec,
|
|
&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = &(temp_3f5a48c29e->_achievementOverlay)._sprite._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(temp_3f5a48c29e->_achievementOverlay)._sprite._overlayAnimState,&scratchVec,
|
|
&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = &(temp_3f5a48c29e->_achievementOverlay)._sprite._animState;
|
|
}
|
|
AnimationState::Render(secondAnimState,&scratchVec,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
(GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&temp_3f5a48c29e->_netplayManager))))->NetplayManager::Render();
|
|
PopupQueue::render_layer(3);
|
|
PopupButtons::Render();
|
|
iVar8 = unused_01;
|
|
if (((temp_3f5a48c29e->_optionsConfig)._enableMouseControl != 0) &&
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x8)))) == 2 || (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x8)))) == 1)) &&
|
|
(0 < temp_3f5a48c29e->_cursorVisibleTimer)))) {
|
|
local_40 = DAT_00c79980;
|
|
piVar4 = glfw_get_window_size(GHIDRA_CAST<int *>(&scratchVec),unused_01);
|
|
iVar8 = piVar4[1];
|
|
scratchVec.y = DAT_00c7997c;
|
|
piVar4 = glfw_get_window_size(&windowSize,unused_02);
|
|
cursorScaleX = scratchVec.y /
|
|
(float)((double)*piVar4 + __uint_to_double_fixup[-(*piVar4 >> 0x1f)]);
|
|
scratchVec.y = (local_40 / (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]))
|
|
* (temp_3f5a48c29e->_lastMousePosition).y;
|
|
scratchVec.x = cursorScaleX * (temp_3f5a48c29e->_lastMousePosition).x;
|
|
ANM2::Render(&temp_3f5a48c29e->_cursorSprite,&scratchVec,&g_vectorZero,&g_vectorZero);
|
|
iVar8 = extraout_ECX_10;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(local_38))))->KColor::SetFromARGB(0xff000000);
|
|
colorQuad = render_quad_set_uniform_color
|
|
(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color_00);
|
|
render_color_shader_pass(colorQuad);
|
|
scratchVec.y = (g_screenHeight - 270.0) * 0.5;
|
|
scratchVec.x = (g_screenWidth - 480.0) * 0.5;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a7fd))) != '\0') {
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a764))) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a724)))),&scratchVec,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a744))));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a744)))),&scratchVec,&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a724))));
|
|
}
|
|
AnimationState::Render(secondAnimState,&scratchVec,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
pMVar1 = g_manager;
|
|
local_5c = 1;
|
|
local_58 = 0xffff;
|
|
local_54 = 0;
|
|
local_50 = 0x3f800000;
|
|
local_4c = 0xffffffff;
|
|
local_48 = 0;
|
|
local_44 = 0;
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(local_38))))->KColor::SetFromARGB(0xffffffff);
|
|
text = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a6dc)));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((temp_3f5a48c29e)) + 0x4a6f0))))) {
|
|
text = *GHIDRA_CAST<uint8_t **>(text);
|
|
}
|
|
Font::DrawString(&pMVar1->_font2_TeamMeatEx12,text,color,&local_5c,g_screenWidth * 0.5,
|
|
g_screenHeight * 0.5 + 80.0);
|
|
local_14 = 0xffffffff;
|
|
iVar8 = extraout_ECX_09;
|
|
}
|
|
if ((g_manager->_optionsConfig)._enableColorCorrection != 0) {
|
|
_glfw_context_reset(1);
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
puVar7 = &DAT_00c79398;
|
|
if ((DAT_00c7939c & 1) == 0) {
|
|
puVar7 = g_currentShader;
|
|
}
|
|
scratchVec.y = (g_manager->_optionsConfig)._exposure;
|
|
local_40 = 1.0 / (g_manager->_optionsConfig)._gamma;
|
|
g_currentShader = puVar7;
|
|
(GHIDRA_CAST<Shader *>((puVar7)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Exposure"),8,&scratchVec.y,unused_03);
|
|
(GHIDRA_CAST<Shader *>((puVar7)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("Gamma"),8,&local_40,unused_04);
|
|
local_54 = 0;
|
|
drawParams = 0;
|
|
local_58 = 0;
|
|
local_60 = 0;
|
|
local_4c = 0x3f800000;
|
|
local_5c = 0x3f800000;
|
|
local_48 = 0x3f800000;
|
|
local_50 = 0x3f800000;
|
|
local_44 = local_44 & 0xffffff00;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(local_38))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color_01);
|
|
(**(code **)(*DAT_00c798a8 + 0x14))(&drawParams,quadBuffer,g_drawRectUnset);
|
|
iVar8 = extraout_ECX_11;
|
|
}
|
|
if (isFilterEnabled != '\0') {
|
|
_glfw_context_reset(1);
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
if ((g_graphicsManager_flags & 4) == 0) {
|
|
g_graphicsManager_blendMode[1] = 6;
|
|
}
|
|
g_graphicsManager_blendMode[2] = 7;
|
|
puVar7 = &DAT_00c793e8;
|
|
if ((DAT_00c793ec & 1) == 0) {
|
|
puVar7 = g_currentShader;
|
|
}
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 7;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_38)) + 0x8))) =
|
|
(BADTYPE)((double)DAT_00c79890[6] + __uint_to_double_fixup[-(DAT_00c79890[6] >> 0x1f)]);
|
|
scratchVec.y = g_displayPixelRatio * g_screenPointScale * 0.5;
|
|
scratchVec.x = (float)((double)DAT_00c79890[7] +
|
|
__uint_to_double_fixup[-(DAT_00c79890[7] >> 0x1f)]);
|
|
g_currentShader = puVar7;
|
|
(GHIDRA_CAST<Shader *>((puVar7)))->Shader::set_uniform(GHIDRA_CAST<uint8_t *>("ScreenSizePow2"),10,local_38 + 8,GHIDRA_INT(DAT_00c79890));
|
|
local_54 = 0;
|
|
drawParams = 0;
|
|
local_58 = 0;
|
|
local_60 = 0;
|
|
local_4c = 0x3f800000;
|
|
local_5c = 0x3f800000;
|
|
local_48 = 0x3f800000;
|
|
local_50 = 0x3f800000;
|
|
local_44 = local_44 & 0xffffff00;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(local_38))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color_02);
|
|
(**(code **)(*DAT_00c79890 + 0x14))(&drawParams,quadBuffer,g_drawRectUnset);
|
|
iVar8 = extraout_ECX_12;
|
|
}
|
|
shader_cache_find(iVar8);
|
|
if (isFramebufferResized != '\0') {
|
|
_glfw_context_reset(1);
|
|
pop_render_target();
|
|
(GHIDRA_CAST<RenderTarget *>((&DAT_00c798e0)))->RenderTarget::Clear();
|
|
g_graphicsManager_blendMode[0] = 0;
|
|
g_graphicsManager_blendMode[1] = 1;
|
|
g_graphicsManager_blendMode[2] = 0;
|
|
g_graphicsManager_blendMode[3] = 1;
|
|
g_graphicsManager_blendMode[4] = 0;
|
|
local_80 = 0;
|
|
upscaleDrawParams = 0;
|
|
local_84 = 0;
|
|
local_8c = 0;
|
|
local_78 = 0x3f800000;
|
|
local_88 = 0x3f800000;
|
|
local_74 = 0x3f800000;
|
|
local_7c = 0x3f800000;
|
|
local_70 = 0;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(local_38))))->KColor::SetFromARGB(0xffffffff);
|
|
render_quad_set_uniform_color(upscaleQuadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,color_03);
|
|
(**(code **)(*DAT_00c798a0 + 0x14))(&upscaleDrawParams,upscaleQuadBuffer,g_drawRectUnset);
|
|
}
|
|
_glfw_context_reset(1);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009569a0
|
|
ChallengeParam * Manager::GetChallengeParams(int challengeID)
|
|
{
|
|
uint32_t requestedIndex;
|
|
uint32_t index;
|
|
void *paramsBegin;
|
|
|
|
paramsBegin = (g_manager->_challengeParams)._begin;
|
|
index = (GHIDRA_INT((g_manager->_challengeParams)._end) - GHIDRA_INT(paramsBegin)) / 0xa4 - 1;
|
|
requestedIndex = -GHIDRA_UINT((challengeID != 0)) & challengeID;
|
|
if (requestedIndex < index) {
|
|
index = requestedIndex;
|
|
}
|
|
return GHIDRA_CAST<ChallengeParam *>((index * 0xa4 + GHIDRA_INT(paramsBegin)));
|
|
}
|
|
|
|
// 009588a0
|
|
void * Manager::LoadImage(void *outImage, uint8_t *path)
|
|
{
|
|
uint8_t bVar1;
|
|
std_string *psVar2;
|
|
uint8_t *pathEnd;
|
|
uint32_t extraout_ECX;
|
|
void *ptr;
|
|
uint32_t extraout_ECX_00;
|
|
uint32_t uVar3;
|
|
uint32_t allocSize;
|
|
std_string *redirectedPath [5];
|
|
uint32_t redirectedPathCapacity;
|
|
std_string pathString;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0c295;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_INT(&pathString) + 0x28U;
|
|
ExceptionList = &local_10;
|
|
pathString._size = 0;
|
|
pathString._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(pathString._buf)) + 0x0))) = (void *)0x0;
|
|
pathEnd = path;
|
|
do {
|
|
bVar1 = *pathEnd;
|
|
pathEnd = pathEnd + 1;
|
|
} while (bVar1 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((pathString._buf)))->msvc::string::assign(path,GHIDRA_INT(pathEnd) - GHIDRA_INT((path + 1)));
|
|
local_8 = 1;
|
|
ModManager::TryRedirectPath
|
|
(GHIDRA_CAST<ModManager *>(&manager->_modManager),GHIDRA_CAST<std_string *>(redirectedPath),&pathString);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
|
|
uVar3 = extraout_ECX;
|
|
if (0xf < pathString._capacity) {
|
|
allocSize = pathString._capacity + 1;
|
|
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&((void *)pathString._buf)) + 0x0)));
|
|
if (0xfff < allocSize) {
|
|
ptr = *(void **)((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(pathString._buf)) + 0x0))) + -4);
|
|
allocSize = pathString._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(pathString._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) goto LAB_00958992;
|
|
}
|
|
operator_delete(ptr,allocSize);
|
|
uVar3 = extraout_ECX_00;
|
|
}
|
|
psVar2 = GHIDRA_CAST<std_string *>(redirectedPath);
|
|
if (0xf < redirectedPathCapacity) {
|
|
psVar2 = redirectedPath[0];
|
|
}
|
|
KAGE_Graphics_ImageManager::load_image_file(outImage,psVar2,uVar3);
|
|
if (0xf < redirectedPathCapacity) {
|
|
allocSize = redirectedPathCapacity + 1;
|
|
psVar2 = redirectedPath[0];
|
|
if (0xfff < allocSize) {
|
|
psVar2 = GHIDRA_CAST<std_string *>(redirectedPath[0][-1]._capacity);
|
|
allocSize = redirectedPathCapacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(psVar2))))) {
|
|
LAB_00958992:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(psVar2,allocSize);
|
|
}
|
|
ExceptionList = local_10;
|
|
return outImage;
|
|
}
|
|
|
|
// 009589d0
|
|
void Manager::queue_achievement_popup(int achievementId)
|
|
{
|
|
char cVar1;
|
|
uint32_t uVar2;
|
|
void *pvVar3;
|
|
uint32_t uVar4;
|
|
Manager *manager;
|
|
uint32_t mapSize;
|
|
int mapSlotOffset;
|
|
uint32_t *queueSize;
|
|
|
|
manager = g_manager;
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(cVar1 = FUN_0091b510(), cVar1 == '\0')) {
|
|
return;
|
|
}
|
|
if ((manager->_optionsConfig)._popupsMode != 0) {
|
|
uVar4 = (manager->_achievementOverlay)._queue._size;
|
|
uVar2 = (manager->_achievementOverlay)._queue._offset;
|
|
if (((uVar2 + uVar4 & 3) == 0) &&
|
|
((manager->_achievementOverlay)._queue._mapSize <= uVar4 + 4 >> 2)) {
|
|
msvc::deque<4byte>::_Growmap(uVar4);
|
|
uVar2 = (manager->_achievementOverlay)._queue._offset;
|
|
uVar4 = (manager->_achievementOverlay)._queue._size;
|
|
}
|
|
mapSize = (manager->_achievementOverlay)._queue._mapSize;
|
|
uVar2 = mapSize * 4 - 1 & uVar2;
|
|
(manager->_achievementOverlay)._queue._offset = uVar2;
|
|
uVar4 = uVar4 + uVar2;
|
|
pvVar3 = (manager->_achievementOverlay)._queue._map;
|
|
uVar2 = mapSize - 1 & uVar4 >> 2;
|
|
mapSlotOffset = uVar2 * 4;
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + uVar2 * 4)) == 0) {
|
|
pvVar3 = operator_new(0x10);
|
|
*(void **)(mapSlotOffset + GHIDRA_INT((manager->_achievementOverlay)._queue._map)) = pvVar3;
|
|
pvVar3 = (manager->_achievementOverlay)._queue._map;
|
|
}
|
|
*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((mapSlotOffset + GHIDRA_INT(pvVar3))) + (uVar4 & 3) * 4)) = achievementId;
|
|
queueSize = &(manager->_achievementOverlay)._queue._size;
|
|
*queueSize = *queueSize + 1;
|
|
(GHIDRA_CAST<AchievementOverlay *>((&manager->_achievementOverlay)))->AchievementOverlay::Update();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 00958aa0
|
|
void Manager::StartNewGame(int playerType, int challenge, Seeds unk, int difficulty)
|
|
{
|
|
Seeds *other;
|
|
Seeds seedsCopy;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
int local_8;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
puStack_c = &LAB_00b0c2d5;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT(&(&seedsCopy)[1]._rng._shift2);
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
g_manager->_startPlayerType = playerType;
|
|
manager->_startChallenge = challenge;
|
|
manager->_rerunAvailable = 0;
|
|
manager->_startingFromRerun = 0;
|
|
manager->_debugStart = 0;
|
|
(GHIDRA_CAST<Seeds *>((&seedsCopy)))->Seeds::construct_from_copy(&unk);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
(GHIDRA_CAST<Seeds *>((&manager->_startSeeds)))->Seeds::operator_assign(other);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&seedsCopy._seedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&seedsCopy._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedsCopy._seedEffects) + 4));
|
|
operator_delete(seedsCopy._seedEffects,0x14);
|
|
manager->_startDifficulty = difficulty;
|
|
(manager->_dailyChallenge)._id = 0;
|
|
(manager->_dailyChallenge)._seed = 0;
|
|
(manager->_dailyChallenge)._specialDailyId = 0;
|
|
(manager->_dailyChallenge)._isPractice = 0;
|
|
ChallengeParam::Reset(&(manager->_dailyChallenge)._params);
|
|
manager->_starting = 1;
|
|
manager->_networkPlay = 0;
|
|
manager->_consecutiveResetCount = 0;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&unk._seedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&unk._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(unk._seedEffects) + 4));
|
|
operator_delete(unk._seedEffects,0x14);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00958cb0
|
|
void Manager::RestartGame()
|
|
{
|
|
void *seedEffectsHead;
|
|
Manager *pMVar2;
|
|
Seeds *other;
|
|
uint32_t seed;
|
|
void **seedEffectsTree;
|
|
Seeds SStack00000004;
|
|
char in_stack_00000060;
|
|
char in_stack_00000064;
|
|
Seeds seedsCopy;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
int local_8;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
puStack_c = &LAB_00b0c315;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT(&(&seedsCopy)[1]._rng._shift2);
|
|
ExceptionList = &local_10;
|
|
local_8 = 0;
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Game must not be NULL"));
|
|
}
|
|
(GHIDRA_CAST<Seeds *>((&seedsCopy)))->Seeds::construct_from_copy(&SStack00000004);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
(GHIDRA_CAST<Seeds *>((&manager->_startSeeds)))->Seeds::operator_assign(other);
|
|
local_8 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_8))) + 0x1))) << 8;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&seedsCopy._seedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)&seedsCopy._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedsCopy._seedEffects) + 4));
|
|
operator_delete(seedsCopy._seedEffects,0x14);
|
|
if ((*GHIDRA_CAST<char *>(&manager->_startSeeds) == '\0') || (g_game->_challenge != 0)) {
|
|
seed = 0;
|
|
}
|
|
else {
|
|
seed = *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_startSeeds))) + 0x4))));
|
|
}
|
|
(GHIDRA_CAST<Seeds *>((&manager->_startSeeds)))->Seeds::set_start_seed(seed);
|
|
game = g_game;
|
|
if ((in_stack_00000060 != '\0') && (g_game != GHIDRA_CAST<Game *>(0x0))) {
|
|
seedEffectsHead = (g_game->_seedEffects)._seedEffects;
|
|
seedEffectsTree = &(g_game->_seedEffects)._seedEffects;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(seedEffectsTree,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)seedEffectsTree,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(seedEffectsHead) + 4));
|
|
*(void **)(GHIDRA_CAST<char *>(seedEffectsHead) + 4) = seedEffectsHead;
|
|
*(void **)seedEffectsHead = seedEffectsHead;
|
|
*(void **)(GHIDRA_CAST<char *>(seedEffectsHead) + 8) = seedEffectsHead;
|
|
(game->_seedEffects)._seedEffectsCount = 0;
|
|
}
|
|
if (g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
manager->_starting = 1;
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager))))->NetplayManager::process_pending_joins(1);
|
|
}
|
|
*GHIDRA_CAST<uint16_t *>(&manager->_isSaveOnExit) = 0;
|
|
if (in_stack_00000064 == '\0') {
|
|
manager->_consecutiveResetCount = 0;
|
|
}
|
|
else {
|
|
manager->_consecutiveResetCount = manager->_consecutiveResetCount + 1;
|
|
if (6 < manager->_consecutiveResetCount) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::TryUnlock(0x148);
|
|
}
|
|
}
|
|
pMVar2 = g_manager;
|
|
(manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0;
|
|
(GHIDRA_CAST<PersistentGameData *>((&pMVar2->_persistentGameData)))->PersistentGameData::set_run_mask(0,0);
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(GHIDRA_CAST<uint32_t *>((GHIDRA_INT(register0x00000010) + 0x58)),
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)
|
|
(GHIDRA_INT(register0x00000010) + 0x58),
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(SStack00000004._seedEffects) + 4));
|
|
operator_delete(SStack00000004._seedEffects,0x14);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00958e60
|
|
void Manager::ShowCutscene(uint32_t cutsceneID, uint8_t shouldCleanup, uint32_t UNKNOWN)
|
|
{
|
|
int *cutsceneCounter;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
if (0x1a < cutsceneID) {
|
|
KAGE_LogMessage(8,GHIDRA_CAST<uint8_t *>("Invalid cutscene ID \")%d\" \n");
|
|
return;
|
|
}
|
|
cutsceneCounter = (g_manager->_persistentGameData)._cutsceneCounters + cutsceneID;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<uint8_t *>(&manager->_persistentGameData) = 1;
|
|
if (cutsceneID != 1) {
|
|
cutsceneCounter = (manager->_persistentGameData)._cutsceneCounters + 2;
|
|
*cutsceneCounter = *cutsceneCounter + 1;
|
|
*GHIDRA_CAST<uint8_t *>(&manager->_persistentGameData) = 1;
|
|
}
|
|
(manager->_cutsceneManager)._isQueuedCleanup = shouldCleanup;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_cutsceneManager))) + 0x848))) = 1;
|
|
manager->_cutsceneNextMenuState = UNKNOWN;
|
|
(manager->_cutsceneManager)._queuedCutsceneId = cutsceneID;
|
|
(manager->_achievementOverlay)._isPopupBlocked = 1;
|
|
return;
|
|
}
|
|
|
|
// 00958ed0
|
|
void Manager::save_game_state()
|
|
{
|
|
GameState *state;
|
|
Game *this;
|
|
Manager *pMVar1;
|
|
uint8_t uVar2;
|
|
char isFileOpen;
|
|
Entity_Player *player;
|
|
int iVar3;
|
|
int *piVar4;
|
|
uint8_t *path;
|
|
uint8_t *saveFileName;
|
|
void *saveWriter;
|
|
uint8_t *writerFileName;
|
|
uint32_t local_1c;
|
|
uint32_t local_18;
|
|
uint8_t local_14;
|
|
uint32_t local_10;
|
|
uint32_t local_c;
|
|
int *saveFile;
|
|
Manager *manager;
|
|
uint32_t *oldSaveFile;
|
|
|
|
manager = g_manager;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] Cannot save game state while not in game.\n"));
|
|
return;
|
|
}
|
|
if (((g_game->_dailyChallenge)._id == 0) &&
|
|
(g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1)))) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
if (player->_dead != 0) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(0);
|
|
iVar3 = (GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::GetExtraLives();
|
|
if (iVar3 < 1) {
|
|
return;
|
|
}
|
|
}
|
|
this = g_game;
|
|
state = &manager->_gamestate;
|
|
manager->_isSavingGameState = 1;
|
|
this->Game::store_game_state(state);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_gamestate))) + 0x19d70)))) = manager->_startPlayerType;
|
|
uVar2 = FUN_008f8cd0();
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_gamestate))) + 0x19d74))) = uVar2;
|
|
piVar4 = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00c5c3a4));
|
|
if ((*piVar4 == 0) || ((manager->_optionsConfig)._enableSteamCloud == 0)) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_gamestate))) + 0x1fdbc)))) == 0) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("[warn] GameState::Save: no filename specified.\n"));
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<GameState *>((state)))->GameState::DeleteRerun();
|
|
oldSaveFile = (manager->_gamestate)._saveFile;
|
|
if (oldSaveFile != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
(**(code **)*oldSaveFile)(1);
|
|
}
|
|
saveFileName = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_gamestate))) + 0x1fdac)));
|
|
path = saveFileName;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_gamestate))) + 0x1fdc0))))) {
|
|
path = *GHIDRA_CAST<uint8_t **>(saveFileName);
|
|
}
|
|
saveFile = (GHIDRA_CAST<SaveDataManager *>((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_write(path,0);
|
|
(manager->_gamestate)._saveFile = saveFile;
|
|
if (saveFile != GHIDRA_CAST<int *>(0x0)) {
|
|
isFileOpen = (**(code **)(*saveFile + 0x30))();
|
|
if ((isFileOpen != '\0') && (iVar3 = _fileno(GHIDRA_CAST<FILE *>(saveFile[3])), -1 < iVar3)) {
|
|
flock(iVar3,2);
|
|
}
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_gamestate))) + 0x1fdc0))))) {
|
|
saveFileName = *GHIDRA_CAST<uint8_t **>(saveFileName);
|
|
}
|
|
saveWriter = (manager->_gamestate)._saveFile;
|
|
local_1c = 0;
|
|
local_c = 1;
|
|
local_18 = 0;
|
|
local_14 = 0;
|
|
local_10 = 0xfedcba76;
|
|
writerFileName = saveFileName;
|
|
(GHIDRA_CAST<GameState *>((state)))->GameState::write(&saveWriter);
|
|
piVar4 = (manager->_gamestate)._saveFile;
|
|
isFileOpen = (**(code **)(*piVar4 + 0x30))();
|
|
if ((isFileOpen != '\0') && (iVar3 = _fileno(GHIDRA_CAST<FILE *>(piVar4[3])), -1 < iVar3)) {
|
|
flock(iVar3,8);
|
|
}
|
|
(**(code **)(*GHIDRA_CAST<int *>((manager->_gamestate)._saveFile) + 0x34))();
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
FUN_009cad40();
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_persistentGameData))) + 0xf84)))) =
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((manager->_gamestate))) + 0x1fda4))));
|
|
*GHIDRA_CAST<uint8_t *>(&manager->_persistentGameData) = 1;
|
|
if ((manager->_persistentGameData)._isFileLoaded != 0) {
|
|
*GHIDRA_CAST<uint8_t *>(&manager->_persistentGameData) = 0;
|
|
BackupSaveFile(GHIDRA_CAST<Manager *>(&manager->_persistentGameData));
|
|
pMVar1 = g_manager;
|
|
piVar4 = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00c5c3a4));
|
|
if ((*piVar4 != 0) && ((pMVar1->_optionsConfig)._enableSteamCloud != 0)) {
|
|
(GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::SaveToSteamCloud();
|
|
manager->_isSavingGameState = 0;
|
|
return;
|
|
}
|
|
(GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::Save();
|
|
}
|
|
manager->_isSavingGameState = 0;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009595e0
|
|
uint8_t Manager::IsGameplayInputActive(int unusedArg)
|
|
{
|
|
char cVar1;
|
|
uint8_t bVar2;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) ||
|
|
((g_manager->_starting != 0 && (g_manager->_networkPlay != 0)))) {
|
|
bVar2 = FUN_0091b510();
|
|
return bVar2 ^ 1;
|
|
}
|
|
cVar1 = FUN_008f8cd0();
|
|
if ((((cVar1 == '\0') && ((manager->_optionsConfig)._enableDebugConsole == 0)) ||
|
|
((manager->_persistentGameData)._achievements[4] != 0)) ||
|
|
(((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x8)))) == 2 && (g_game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((g_game->_dailyChallenge)._id != 0 || (g_game->_isDebug != 0)))))) {
|
|
return 0;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// 00959670
|
|
void Manager::unload_state()
|
|
{
|
|
MenuManager *menuManager;
|
|
|
|
menuManager = g_menuManager;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 1) {
|
|
if (g_menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
MenuManager::~MenuManager();
|
|
operator_delete(menuManager,0xf930);
|
|
g_menuManager = GHIDRA_CAST<MenuManager *>(0x0);
|
|
}
|
|
}
|
|
else if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2) {
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
Game::Exit(this->_isSaveOnExit);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x4b285))) = 0;
|
|
if ((this->_sfxManager)._volumeModifier != 1.0) {
|
|
(this->_sfxManager)._volumeModifier = 1.0;
|
|
(GHIDRA_CAST<SoundEffects *>((&this->_sfxManager)))->SoundEffects::ClearVolumeModifier();
|
|
}
|
|
(this->_sfxManager)._volumeModifierStep = 0.005;
|
|
}
|
|
FUN_00429170();
|
|
TextureCache::Purge();
|
|
return;
|
|
}
|
|
TextureCache::Purge();
|
|
return;
|
|
}
|
|
|
|
// 00959720
|
|
void Manager::start_pending_game()
|
|
{
|
|
Manager *profileMap = this;
|
|
int iVar1;
|
|
Seeds seeds;
|
|
std_string roomFile;
|
|
char isNetplayReady;
|
|
uint8_t isRerunAvailable;
|
|
Game *game;
|
|
Game *extraout_EAX;
|
|
int iVar2;
|
|
Seeds *other;
|
|
Seeds *other_00;
|
|
uint32_t frameParity;
|
|
uint8_t isNetworkPlay;
|
|
KColor *color;
|
|
Game *hud;
|
|
Game *netplayManager;
|
|
void *pvVar3;
|
|
NetplayManager *netplayManager;
|
|
Manager *pMVar4;
|
|
Seeds aSStackY_2fd4 [128];
|
|
uint8_t in_stack_fffffe8c [56];
|
|
uint32_t in_stack_fffffec4;
|
|
uint32_t in_stack_fffffec8;
|
|
uint32_t in_stack_fffffecc;
|
|
uint32_t in_stack_fffffed0;
|
|
uint64_t in_stack_fffffed4;
|
|
uint32_t in_stack_fffffedc;
|
|
uint32_t in_stack_fffffee0;
|
|
float *in_stack_fffffee4;
|
|
void **ppvVar5;
|
|
char acStack_112 [2];
|
|
KColor local_100;
|
|
uint64_t local_ec;
|
|
void *local_e4;
|
|
Manager *local_e0;
|
|
void *local_d8;
|
|
Seeds savedRunSeeds;
|
|
Seeds rerunSeeds;
|
|
uint32_t stackCookie;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
int local_8;
|
|
HUD *hud;
|
|
uint8_t *profileMap;
|
|
int *profileMapHead;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0c36d;
|
|
local_10 = ExceptionList;
|
|
stackCookie = __security_cookie ^ GHIDRA_UINT(&(&rerunSeeds)[1]._rng._shift3);
|
|
ExceptionList = &local_10;
|
|
if ((profileMap->_starting != 0) &&
|
|
((local_e0 = profileMap, profileMap->_networkPlay == 0 ||
|
|
(isNetplayReady = FUN_0090c400(), isNetplayReady != '\0')))) {
|
|
if ((profileMap->_framecount & 1U) != 0) {
|
|
profileMap->_framecount = profileMap->_framecount + 1;
|
|
}
|
|
ppvVar5 = (void **)0x959797;
|
|
unload_state(profileMap);
|
|
if (g_game == GHIDRA_CAST<Game *>(0x0)) {
|
|
in_stack_fffffee4 = GHIDRA_CAST<float *>(0x9597aa);
|
|
game = operator_new(0x68e88);
|
|
local_ec = CONCAT44(game,(void *)local_ec);
|
|
local_8 = 0;
|
|
if (game == GHIDRA_CAST<Game *>(0x0)) {
|
|
g_game = GHIDRA_CAST<Game *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Game *>((game)))->Game::constructor();
|
|
g_game = extraout_EAX;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
ppvVar5 = (void **)0x9597da;
|
|
Game::LoadConfigXmls();
|
|
}
|
|
netplayManager = GHIDRA_CAST<NetplayManager *>(&profileMap->_netplayManager);
|
|
if (profileMap->_netplayManager != *GHIDRA_CAST<int *>((profileMap + 1))) {
|
|
ppvVar5 = (void **)0x0;
|
|
in_stack_fffffee4 = GHIDRA_CAST<float *>(0x9597fe);
|
|
(GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&g_manager->_netplayManager))))->NetplayManager::reset(0);
|
|
}
|
|
pMVar4 = g_manager;
|
|
if (profileMap->_networkPlay != 0) {
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x2e0)))) = 0;
|
|
profileMap = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMVar4[1]._gamestate)) + 0x288)));
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMVar4[1]._gamestate)) + 0x2dc)))) = 0;
|
|
profileMapHead = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(pMVar4[1]._gamestate)) + 0x288))));
|
|
local_d8 = (void *)*profileMapHead;
|
|
if (local_d8 != profileMapHead) {
|
|
do {
|
|
pvVar3 = local_d8;
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_d8) + 0x20));
|
|
if ((iVar2 == 0) || (*GHIDRA_CAST<int *>((iVar2 + 8)) == 0 && *GHIDRA_CAST<int *>((iVar2 + 0xc)) == 0)) {
|
|
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_d8);
|
|
in_stack_fffffee4 = (GHIDRA_CAST<msvc::_Tree *>((profileMap)))->msvc::_Tree::_Extract(pvVar3);
|
|
msvc::vector<12byte>::clear();
|
|
msvc::vector<12byte>::_Tidy();
|
|
ppvVar5 = (void **)0x48;
|
|
in_stack_fffffee4[7] = (float)KAGE::System::UserProfileBase::vftable;
|
|
in_stack_fffffee0 = 0x95989c;
|
|
operator_delete(in_stack_fffffee4,0x48);
|
|
}
|
|
else {
|
|
ppvVar5 = (void **)0x95985a;
|
|
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_d8);
|
|
}
|
|
} while (local_d8 != *(void **)profileMap);
|
|
profileMap = local_e0;
|
|
}
|
|
pvVar3 = (profileMap->_lobbyMembers)._begin;
|
|
if (pvVar3 != (profileMap->_lobbyMembers)._end) {
|
|
do {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0xc)) == 9) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0xc)) == 0x1e)) {
|
|
iVar2 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 4));
|
|
if (iVar2 == 0) {
|
|
local_ec = 0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_ec)) + 0x4))) = GHIDRA_CAST<Manager *>(0x0);
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_ec)) + 0x0))) = (void *)0x0;
|
|
local_e4 = (void *)local_ec;
|
|
pMVar4 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_ec)) + 0x4)));
|
|
}
|
|
else {
|
|
local_e4 = *(void **)(iVar2 + 8);
|
|
pMVar4 = *GHIDRA_CAST<Manager **>((iVar2 + 0xc));
|
|
}
|
|
ppvVar5 = &local_e4;
|
|
in_stack_fffffee4 = &local_100._blue;
|
|
in_stack_fffffee0 = 0x959929;
|
|
local_e0 = pMVar4;
|
|
local_d8 = local_e4;
|
|
FUN_00731ee0();
|
|
if ((((*GHIDRA_CAST<char *>((local_100._unk + 0xd)) == '\0') &&
|
|
(*GHIDRA_CAST<Manager **>((local_100._unk + 0x14)) <= pMVar4)) &&
|
|
((*GHIDRA_CAST<Manager **>((local_100._unk + 0x14)) < pMVar4 ||
|
|
(*(void **)(local_100._unk + 0x10) <= local_d8)))) &&
|
|
(local_100._unk != *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(profileMap[1]._gamestate)) + 0xc0)))))) {
|
|
ppvVar5 = &local_e4;
|
|
in_stack_fffffee4 = GHIDRA_CAST<float *>(0x959961);
|
|
iVar2 = FUN_00914150();
|
|
if ((iVar2 != 0) && (*GHIDRA_CAST<int *>((iVar2 + 0x310)) == 0)) {
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(pvVar3) + 0xc)) = 0;
|
|
}
|
|
}
|
|
}
|
|
pvVar3 = (void *)(GHIDRA_INT(pvVar3) + 0x14);
|
|
} while (pvVar3 != (profileMap->_lobbyMembers)._end);
|
|
}
|
|
netplayManager = GHIDRA_CAST<NetplayManager *>(&profileMap->_netplayManager);
|
|
if (((profileMap->_networkPlay != 0) && (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((profileMap->_startSeeds))) + 0x4)))) != 0)) &&
|
|
(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(profileMap[1])) + 0x8)))) == 0)) {
|
|
FUN_006eef20();
|
|
ppvVar5 = (void **)0x9599b0;
|
|
online_session_reset();
|
|
}
|
|
}
|
|
isNetworkPlay = profileMap->_networkPlay;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((profileMap)) + 0x8)))) = 2;
|
|
if ((isNetworkPlay == 0) || (isRerunAvailable = profileMap->_rerunAvailable, isRerunAvailable == 0)) {
|
|
ppvVar5 = (void **)0x9599d6;
|
|
FUN_00923450();
|
|
isNetworkPlay = profileMap->_networkPlay;
|
|
isRerunAvailable = profileMap->_rerunAvailable;
|
|
}
|
|
game = g_game;
|
|
if (isNetworkPlay == 0) {
|
|
if (isRerunAvailable == 0) {
|
|
if (profileMap->_startingFromRerun == 0) {
|
|
if ((profileMap->_dailyChallenge)._id == 0) {
|
|
frameParity = profileMap->_startDifficulty;
|
|
local_e0 = GHIDRA_CAST<Manager *>(frameParity);
|
|
if (profileMap->_debugStart == 0) {
|
|
iVar2 = profileMap->_startChallenge;
|
|
iVar1 = profileMap->_startPlayerType;
|
|
(GHIDRA_CAST<Seeds *>((GHIDRA_CAST<Seeds *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(aSStackY_2fd4[0x81])) + 0x4)))))))->Seeds::construct_from_copy(&profileMap->_startSeeds)
|
|
;
|
|
seeds._stageSeeds[8] = in_stack_fffffec4;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(seeds)) + 0x0))) = in_stack_fffffe8c;
|
|
seeds._stageSeeds[9] = in_stack_fffffec8;
|
|
seeds._stageSeeds[10] = in_stack_fffffecc;
|
|
seeds._stageSeeds[0xb] = in_stack_fffffed0;
|
|
seeds._stageSeeds[0xc] = GHIDRA_INT(in_stack_fffffed4);
|
|
seeds._stageSeeds[0xd] = GHIDRA_INT(((uint64_t)in_stack_fffffed4 >> 0x20));
|
|
seeds._playerInitSeed = in_stack_fffffedc;
|
|
seeds._seedEffects = (void *)in_stack_fffffee0;
|
|
seeds._seedEffectsCount = GHIDRA_INT(in_stack_fffffee4);
|
|
(GHIDRA_CAST<Game *>((netplayManager)))->Game::Start(iVar1,iVar2,seeds,frameParity);
|
|
}
|
|
else {
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((profileMap)) + 0x4b1a4))));
|
|
iVar1 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((profileMap)) + 0x4b1a0))));
|
|
(GHIDRA_CAST<msvc::string *>((acStack_112 + -0x1a)))->msvc::string::string(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((profileMap)) + 0x4b1a8))));
|
|
roomFile._buf[8] = (char)in_stack_fffffedc;
|
|
roomFile._buf[9] = (char)(GHIDRA_UINT(in_stack_fffffedc) >> 8);
|
|
roomFile._buf[10] = (char)(GHIDRA_UINT(in_stack_fffffedc) >> 0x10);
|
|
roomFile._buf[0xb] = (char)(GHIDRA_UINT(in_stack_fffffedc) >> 0x18);
|
|
roomFile._buf[0] = (char)in_stack_fffffed4;
|
|
roomFile._buf[1] = (char)((uint64_t)in_stack_fffffed4 >> 8);
|
|
roomFile._buf[2] = (char)((uint64_t)in_stack_fffffed4 >> 0x10);
|
|
roomFile._buf[3] = (char)((uint64_t)in_stack_fffffed4 >> 0x18);
|
|
roomFile._buf[4] = (char)((uint64_t)in_stack_fffffed4 >> 0x20);
|
|
roomFile._buf[5] = (char)((uint64_t)in_stack_fffffed4 >> 0x28);
|
|
roomFile._buf[6] = (char)((uint64_t)in_stack_fffffed4 >> 0x30);
|
|
roomFile._buf[7] = (char)((uint64_t)in_stack_fffffed4 >> 0x38);
|
|
roomFile._buf[0xc] = (char)in_stack_fffffee0;
|
|
roomFile._buf[0xd] = (char)(GHIDRA_UINT(in_stack_fffffee0) >> 8);
|
|
roomFile._buf[0xe] = (char)(GHIDRA_UINT(in_stack_fffffee0) >> 0x10);
|
|
roomFile._buf[0xf] = (char)(GHIDRA_UINT(in_stack_fffffee0) >> 0x18);
|
|
roomFile._size = GHIDRA_UINT(in_stack_fffffee4);
|
|
roomFile._capacity = GHIDRA_UINT(ppvVar5);
|
|
(GHIDRA_CAST<Game *>((hud)))->Game::StartDebug(iVar1,iVar2,GHIDRA_INT(local_e0),roomFile);
|
|
}
|
|
}
|
|
else {
|
|
profileMap->_startPlayerType = (profileMap->_dailyChallenge)._params._playerType;
|
|
(GHIDRA_CAST<Game *>((GHIDRA_CAST<Game *>(&profileMap->_dailyChallenge))))->Game::StartDailyChallenge(&profileMap->_dailyChallenge);
|
|
}
|
|
}
|
|
else {
|
|
profileMap->_startPlayerType = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((profileMap->_gamestate))) + 0x19d70))));
|
|
profileMap->_startChallenge = *GHIDRA_CAST<int *>(&profileMap->_gamestate);
|
|
profileMap->_startDifficulty = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((profileMap->_gamestate))) + 0x8))));
|
|
profileMap->_startingFromRerun = 0;
|
|
(GHIDRA_CAST<Seeds *>((&savedRunSeeds)))->Seeds::construct_from_copy(GHIDRA_CAST<Seeds *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((profileMap->_gamestate))) + 0x1e724)))));
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<Seeds *>((&profileMap->_startSeeds)))->Seeds::operator_assign(other_00);
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&savedRunSeeds._seedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)
|
|
&savedRunSeeds._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(savedRunSeeds._seedEffects) + 4));
|
|
operator_delete(savedRunSeeds._seedEffects,0x14);
|
|
Game::StartFromRerunState(&profileMap->_gamestate);
|
|
}
|
|
}
|
|
else {
|
|
profileMap->_startPlayerType = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((profileMap->_gamestate))) + 0x19d70))));
|
|
profileMap->_startChallenge = *GHIDRA_CAST<int *>(&profileMap->_gamestate);
|
|
profileMap->_startDifficulty = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((profileMap->_gamestate))) + 0x8))));
|
|
profileMap->_rerunAvailable = 0;
|
|
(GHIDRA_CAST<Seeds *>((&rerunSeeds)))->Seeds::construct_from_copy(GHIDRA_CAST<Seeds *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((profileMap->_gamestate))) + 0x1e724)))));
|
|
local_8 = 1;
|
|
(GHIDRA_CAST<Seeds *>((&profileMap->_startSeeds)))->Seeds::operator_assign(other);
|
|
local_8 = 0xffffffff;
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(&rerunSeeds._seedEffects,
|
|
(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)
|
|
&rerunSeeds._seedEffects,
|
|
*(_Tree_node<unsigned_int,void*> **)(GHIDRA_INT(rerunSeeds._seedEffects) + 4));
|
|
operator_delete(rerunSeeds._seedEffects,0x14);
|
|
game = g_game;
|
|
hud = &g_game->_hud;
|
|
g_game->_isStarted = 1;
|
|
game->_isStartingFromState = 1;
|
|
(GHIDRA_CAST<HUD *>((hud)))->HUD::LoadGraphics();
|
|
(GHIDRA_CAST<Game *>((game)))->Game::restore_game_state(&profileMap->_gamestate,1);
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::restore_controller_assignment();
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::enter_level();
|
|
(GHIDRA_CAST<PlayerManager *>((&game->_playerManager)))->PlayerManager::trigger_new_room_effects();
|
|
(GHIDRA_CAST<Room *>((game->_room)))->Room::Update();
|
|
(GHIDRA_CAST<KColor *>((&local_100)))->KColor::SetFromARGB(0xff000000);
|
|
(GHIDRA_CAST<Game *>((game)))->Game::Fadein(0.04,1,color);
|
|
game->_framesSinceRoomTransition = 0;
|
|
LuaEngine::PostGameStart(1);
|
|
game->_isStartingFromState = 0;
|
|
}
|
|
}
|
|
else {
|
|
if (isRerunAvailable == 0) {
|
|
FUN_00429170();
|
|
(GHIDRA_CAST<NetplayManager *>((netplayManager)))->NetplayManager::reset(0);
|
|
}
|
|
else {
|
|
profileMap->_rerunAvailable = 0;
|
|
*GHIDRA_CAST<uint32_t *>(&game->_stageTransition) = 2;
|
|
(game->_stageTransition)._duration = 0x32;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((game->_stageTransition))) + 0x4)))) = 0x31;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((game)) + 0x1ba84))) = 0;
|
|
}
|
|
iVar2 = profileMap->_startChallenge;
|
|
(GHIDRA_CAST<Seeds *>((aSStackY_2fd4 + 0x81)))->Seeds::construct_from_copy(&profileMap->_startSeeds);
|
|
FUN_006f5850(&profileMap->_lobbyMembers,&profileMap->_dailyChallenge,iVar2);
|
|
FUN_00959500();
|
|
}
|
|
frameParity = profileMap->_framecount & 0x80000001;
|
|
if (GHIDRA_INT(frameParity) < 0) {
|
|
frameParity = (frameParity - 1 | 0xfffffffe) + 1;
|
|
}
|
|
if (frameParity == 1) {
|
|
profileMap->_framecount = profileMap->_framecount + 1;
|
|
}
|
|
profileMap->_starting = 0;
|
|
*GHIDRA_CAST<uint16_t *>(&profileMap->_isSaveOnExit) = 1;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00959d00
|
|
void Manager::start_pending_menu()
|
|
{
|
|
MenuManager *menuManager;
|
|
MenuManager *extraout_EAX;
|
|
int iVar1;
|
|
int unused2;
|
|
uint32_t isNormalRun;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
float fadeAlpha;
|
|
float fadeBlue;
|
|
float fadeGreen;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0c3b7;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
if (this->_isMenuPending != 0) {
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) == 2) && (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))))
|
|
{
|
|
if ((g_game->_challenge != 0) || (isNormalRun = 1, (g_game->_dailyChallenge)._id != 0)) {
|
|
isNormalRun = 0;
|
|
}
|
|
FUN_0090cd10(0,isNormalRun,__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
|
unused2 = 1;
|
|
iVar1 = 0x959d8c;
|
|
(GHIDRA_CAST<NetplayManager *>((GHIDRA_CAST<NetplayManager *>(&this->_netplayManager))))->NetplayManager::reset(1);
|
|
if (this->_pendingMenuState != 0x11) {
|
|
netplay_leave_lobby(&this->_netplayManager,iVar1,unused2);
|
|
}
|
|
}
|
|
unload_state(this);
|
|
online_session_reset();
|
|
menuManager = g_menuManager;
|
|
*GHIDRA_CAST<uint32_t *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((this)) + 0x8)))) = 1;
|
|
if (menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
menuManager = operator_new(0xf930);
|
|
local_8 = 0;
|
|
if (menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
g_menuManager = GHIDRA_CAST<MenuManager *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<MenuManager *>((menuManager)))->MenuManager::constructor();
|
|
g_menuManager = extraout_EAX;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<MenuManager *>((g_menuManager)))->MenuManager::Init();
|
|
menuManager = g_menuManager;
|
|
}
|
|
(GHIDRA_CAST<MenuManager *>((menuManager)))->MenuManager::SetState(this->_pendingMenuState,1);
|
|
menuManager = g_menuManager;
|
|
fadeGreen = (this->_pendingMenuFadeColor)._green;
|
|
fadeBlue = (this->_pendingMenuFadeColor)._blue;
|
|
fadeAlpha = (this->_pendingMenuFadeColor)._alpha;
|
|
iVar1 = (this->_pendingMenuFadeColor)._unk;
|
|
(g_menuManager->_fadeInColor)._red = (this->_pendingMenuFadeColor)._red;
|
|
(menuManager->_fadeInColor)._green = fadeGreen;
|
|
(menuManager->_fadeInColor)._blue = fadeBlue;
|
|
(menuManager->_fadeInColor)._alpha = fadeAlpha;
|
|
(menuManager->_fadeInColor)._unk = iVar1;
|
|
menuManager->_fadeInActive = 1;
|
|
this->_isMenuPending = 0;
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 00959e70
|
|
void Manager::SetSaveSlot(uint32_t slot)
|
|
{
|
|
uint8_t isLoaded;
|
|
int *steamContext;
|
|
uint8_t *nameEnd;
|
|
uint8_t fileName [1028];
|
|
uint32_t local_c;
|
|
uint8_t auStack_8 [4];
|
|
|
|
local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4));
|
|
(GHIDRA_CAST<PersistentGameData *>((&this->_persistentGameData)))->PersistentGameData::Clear(1);
|
|
if (slot != 0) {
|
|
steamContext = GHIDRA_CAST<int *>(SteamInternal_ContextInit(&PTR_FUN_00c5c3a4));
|
|
if ((*steamContext == 0) || ((this->_optionsConfig)._enableSteamCloud == 0)) {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Loading PersistentData %d from local folder!\n"));
|
|
sprintf_s(fileName,0x400,GHIDRA_CAST<uint8_t *>("%spersistentgamedata%d.dat"));
|
|
isLoaded = (GHIDRA_CAST<PersistentGameData *>((&this->_persistentGameData)))->PersistentGameData::Load(fileName);
|
|
}
|
|
else {
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Loading PersistentData %d from SteamCloud!\n"));
|
|
sprintf_s(fileName,0x400,GHIDRA_CAST<uint8_t *>("rep+persistentgamedata%d.dat"));
|
|
nameEnd = fileName;
|
|
do {
|
|
isLoaded = *nameEnd;
|
|
nameEnd = nameEnd + 1;
|
|
} while (isLoaded != 0);
|
|
(GHIDRA_CAST<msvc::string *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((this->_persistentGameData))) + 0x20))))))->msvc::string::assign(fileName,
|
|
GHIDRA_INT(nameEnd) - GHIDRA_INT((fileName + 1)));
|
|
isLoaded = (GHIDRA_CAST<PersistentGameData *>((&this->_persistentGameData)))->PersistentGameData::LoadFromSteamCloud();
|
|
}
|
|
if (isLoaded == 0) {
|
|
(GHIDRA_CAST<GameState *>((&this->_gamestate)))->GameState::Clear();
|
|
KAGE_LogMessage(1,GHIDRA_CAST<uint8_t *>("Cannot load GameState if PersistentData is missing!\n"));
|
|
}
|
|
else {
|
|
(g_manager->_optionsConfig)._tryImportSave = 0;
|
|
FUN_00959fa0(slot);
|
|
}
|
|
}
|
|
this->_currentSaveSlot = slot;
|
|
return;
|
|
}
|
|
|
|
// 0095ad30
|
|
void Manager::render_button_sprite(int frame, Vector position)
|
|
{
|
|
float fVar1;
|
|
AnimationState *secondAnimState;
|
|
Vector renderPos;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
fVar1 = g_vectorOne.y;
|
|
renderPos.x = position.x;
|
|
renderPos.y = position.y;
|
|
(g_manager->_buttonsSprite)._scale.x = g_vectorOne.x;
|
|
(manager->_buttonsSprite)._scale.y = fVar1;
|
|
if ((manager->_buttonsSprite)._animState._animData != (void *)0x0) {
|
|
AnimationState::SetFrameFloat(&(manager->_buttonsSprite)._animState,(float)frame);
|
|
}
|
|
if ((manager->_buttonsSprite)._loaded != 0) {
|
|
if ((manager->_buttonsSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(manager->_buttonsSprite)._animState,&renderPos,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = &(manager->_buttonsSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(manager->_buttonsSprite)._overlayAnimState,&renderPos,&g_vectorZero,&g_vectorZero
|
|
);
|
|
secondAnimState = &(manager->_buttonsSprite)._animState;
|
|
}
|
|
AnimationState::Render(secondAnimState,&renderPos,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 0095b180
|
|
void Manager::apply_device_key_config(int deviceId)
|
|
{
|
|
char cVar1;
|
|
uint32_t uVar2;
|
|
int deviceName;
|
|
uint8_t *deviceNameChar;
|
|
uint32_t nameCompare;
|
|
uint32_t *savedConfig;
|
|
uint8_t *savedNameChar;
|
|
bool isLess;
|
|
int *local_1c;
|
|
int *deviceRefCount;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
Manager *manager;
|
|
uint8_t nameChar;
|
|
|
|
manager = g_manager;
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0c42d;
|
|
local_10 = ExceptionList;
|
|
uVar2 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &local_10;
|
|
(GHIDRA_CAST<InputManager *>((&PTR_vftable_00c57b18)))->InputManager::get_device(&local_1c,deviceId);
|
|
local_8 = 0;
|
|
if (local_1c == GHIDRA_CAST<int *>(0x0)) {
|
|
local_8 = 1;
|
|
}
|
|
else {
|
|
savedConfig = *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4abd8))));
|
|
if (savedConfig != *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4abdc))))) {
|
|
do {
|
|
deviceName = (**(code **)(*local_1c + 0xc))(uVar2);
|
|
if (deviceName != 0) {
|
|
savedNameChar = GHIDRA_CAST<uint8_t *>(*savedConfig);
|
|
deviceNameChar = GHIDRA_CAST<uint8_t *>((**(code **)(*local_1c + 0xc))());
|
|
do {
|
|
nameChar = *deviceNameChar;
|
|
isLess = nameChar < *savedNameChar;
|
|
if (nameChar != *savedNameChar) {
|
|
LAB_0095b217:
|
|
nameCompare = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_0095b21c;
|
|
}
|
|
if (nameChar == 0) break;
|
|
nameChar = deviceNameChar[1];
|
|
isLess = nameChar < savedNameChar[1];
|
|
if (nameChar != savedNameChar[1]) goto LAB_0095b217;
|
|
deviceNameChar = deviceNameChar + 2;
|
|
savedNameChar = savedNameChar + 2;
|
|
} while (nameChar != 0);
|
|
nameCompare = 0;
|
|
LAB_0095b21c:
|
|
if (nameCompare == 0) {
|
|
FUN_00835ba0(deviceId);
|
|
break;
|
|
}
|
|
}
|
|
savedConfig = savedConfig + 0x41;
|
|
} while (savedConfig != *GHIDRA_CAST<uint32_t **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x4abdc)))));
|
|
}
|
|
input_configs_save();
|
|
local_8 = 2;
|
|
}
|
|
if (((deviceRefCount != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar1 = (**(code **)(*deviceRefCount + 0xc))(), cVar1 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&local_1c);
|
|
}
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 0095b310
|
|
void Manager::update_controller_popups()
|
|
{
|
|
Manager *menuManager = this;
|
|
uint64_t uVar1;
|
|
int64_t lVar2;
|
|
int64_t lVar3;
|
|
char cVar4;
|
|
uint32_t uVar5;
|
|
int *piVar6;
|
|
Entity_Player *player;
|
|
int *piVar7;
|
|
void *pvVar8;
|
|
Game *game;
|
|
uint32_t *playerIt;
|
|
uint32_t uVar9;
|
|
int iVar10;
|
|
int iVar11;
|
|
PlayerManager *playerManager;
|
|
uint8_t *popupQueueLock;
|
|
uint64_t timeNs;
|
|
uint8_t popup [20];
|
|
uint32_t local_140;
|
|
uint8_t local_100 [12];
|
|
uint8_t local_f4 [12];
|
|
uint32_t local_e8;
|
|
uint32_t local_e4;
|
|
uint32_t local_e0;
|
|
uint32_t local_dc;
|
|
uint32_t local_d8;
|
|
uint32_t local_d4;
|
|
uint32_t local_ac;
|
|
uint8_t device [4];
|
|
int *deviceCtrl;
|
|
Vector popupPos;
|
|
uint8_t defaultDevice [4];
|
|
int *defaultDeviceCtrl;
|
|
uint32_t deviceIdx;
|
|
int popupResult;
|
|
int *openPopup;
|
|
int popupLine;
|
|
char *lineText;
|
|
uint32_t local_74;
|
|
uint32_t local_70;
|
|
KColor lineColor;
|
|
Vector lineOffset;
|
|
int *idsEnd;
|
|
Vector local_3c;
|
|
int local_34;
|
|
int *local_30;
|
|
int *controllerCount;
|
|
uint32_t slot;
|
|
int deviceId;
|
|
void *controllerIds;
|
|
int *popupIdSlot;
|
|
int controllerId;
|
|
Manager *manager;
|
|
void *savedExceptionList;
|
|
uint8_t *puStack_c;
|
|
uint32_t ehState;
|
|
MenuManager *menuManager;
|
|
|
|
puStack_c = &LAB_00b0c4b3;
|
|
savedExceptionList = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U;
|
|
ExceptionList = &savedExceptionList;
|
|
manager = menuManager;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abc8)))) == -1) {
|
|
uVar9 = 0;
|
|
while( true ) {
|
|
ehState = 0xffffffff;
|
|
(**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff,uVar5);
|
|
iVar10 = DAT_00c57b24 - _DAT_00c57b20;
|
|
ehState = 0;
|
|
(**(code **)(PTR_vftable_00c57b2c + 0x10))();
|
|
ehState = 0xffffffff;
|
|
if (GHIDRA_UINT((iVar10 >> 3)) <= uVar9) break;
|
|
(GHIDRA_CAST<KAGE::Input::Manager *>((GHIDRA_CAST<Manager *>(&PTR_vftable_00c57b18))))->KAGE::Input::Manager::get_device(&local_34,uVar9);
|
|
ehState = 1;
|
|
if (local_34 == 0) {
|
|
ehState = 2;
|
|
}
|
|
else {
|
|
iVar10 = __RTDynamicCast(local_34,0,&KAGE::Input::InputDeviceBase::RTTI_Type_Descriptor,
|
|
&KAGE::Input::InputDeviceGamepad::RTTI_Type_Descriptor,0);
|
|
if ((iVar10 != 0) &&
|
|
(((*GHIDRA_CAST<uint8_t *>((iVar10 + 8)) & 0x20) != 0 || (*GHIDRA_CAST<int *>((iVar10 + 900)) == 3)))) {
|
|
iVar11 = *GHIDRA_CAST<int *>((iVar10 + 0x10));
|
|
if (GHIDRA_UINT((*GHIDRA_CAST<int *>((iVar10 + 0x14)) - iVar11 >> 4)) < 0xf) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("ActionId is out of range\n"));
|
|
iVar11 = *GHIDRA_CAST<int *>((iVar10 + 0x10));
|
|
}
|
|
if ((*GHIDRA_CAST<int *>((iVar11 + 0xe0)) == -1) && (*GHIDRA_CAST<int *>((iVar11 + 0xe4)) == -1)) {
|
|
local_3c.x = (float)&DAT_bf800000;
|
|
local_3c.y = (float)&DAT_bf800000;
|
|
MessagePopup::MessagePopup
|
|
(popup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_3c);
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),3);
|
|
local_140 = 3;
|
|
MessagePopup::add_blank_footer
|
|
(GHIDRA_CAST<uint8_t *>("##PLATFORM###UNRECOGNIZED_CONTROLLER_HEADER"),
|
|
GHIDRA_CAST<uint8_t *>("##PLATFORM###UNRECOGNIZED_CONTROLLER_MESSAGE"),popup);
|
|
iVar10 = (GHIDRA_CAST<PopupQueue *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))))))->PopupQueue::push(popup);
|
|
*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abc8)))) = iVar10;
|
|
FUN_00420710();
|
|
FUN_004242b0();
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
}
|
|
ehState = 4;
|
|
}
|
|
if (((local_30 != GHIDRA_CAST<int *>(0x0)) && (cVar4 = (**(code **)(*local_30 + 0xc))(), cVar4 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&local_34);
|
|
}
|
|
uVar9 = uVar9 + 1;
|
|
}
|
|
}
|
|
controllerIds = (void *)0x0;
|
|
idsEnd = GHIDRA_CAST<int *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))) = 0;
|
|
piVar6 = GHIDRA_CAST<int *>(0x0);
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
iVar10 = menuManager->_netplayManager;
|
|
if ((iVar10 == *GHIDRA_CAST<int *>((menuManager + 1))) || (GHIDRA_UINT((*GHIDRA_CAST<int *>((menuManager + 1)) - iVar10)) < 4)) {
|
|
if (g_game->_fadeOutTarget == 0) {
|
|
playerManager = &g_game->_playerManager;
|
|
uVar5 = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) {
|
|
do {
|
|
pvVar8 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n")
|
|
);
|
|
pvVar8 = (playerManager->_playerList)._end;
|
|
game = g_game;
|
|
}
|
|
piVar6 = (playerManager->_playerList)._begin;
|
|
if (uVar5 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar6) >> 2))) {
|
|
piVar6 = piVar6 + uVar5;
|
|
}
|
|
controllerId = *GHIDRA_CAST<int *>((*piVar6 + 0x1618));
|
|
if (idsEnd == GHIDRA_CAST<int *>(0x0)) {
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(0,&controllerId);
|
|
game = g_game;
|
|
}
|
|
else {
|
|
*idsEnd = controllerId;
|
|
idsEnd = idsEnd + 1;
|
|
}
|
|
playerManager = &game->_playerManager;
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
piVar6 = idsEnd;
|
|
menuManager = manager;
|
|
controllerCount = idsEnd;
|
|
goto LAB_0095b634;
|
|
}
|
|
}
|
|
piVar6 = GHIDRA_CAST<int *>(0x0);
|
|
}
|
|
else {
|
|
controllerId = (GHIDRA_CAST<InputManager *>((&menuManager->_netplayManager)))->InputManager::FirstLocalDeviceID();
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(0,&controllerId);
|
|
piVar6 = idsEnd;
|
|
}
|
|
}
|
|
}
|
|
else if (g_menuControllerIndex != -1) {
|
|
controllerId = g_menuControllerIndex;
|
|
msvc::vector<unsigned_int>::_Emplace_reallocate(0,&controllerId);
|
|
piVar6 = idsEnd;
|
|
}
|
|
LAB_0095b634:
|
|
controllerIds = (void *)0x0;
|
|
piVar7 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abcc))));
|
|
popupIdSlot = piVar7;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abcc)))) != -1) && (piVar6 < &DAT_00000004)) {
|
|
controllerId = -1;
|
|
(GHIDRA_CAST<PopupManager *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(menuManager[1]._gamestate)) + 0xcf0))))))->PopupManager::close(piVar7,&controllerId);
|
|
*piVar7 = 0xffffffff;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abd0))) = 0;
|
|
}
|
|
slot = 0;
|
|
controllerCount = GHIDRA_CAST<int *>((GHIDRA_INT(piVar6) - GHIDRA_INT(controllerIds) >> 2));
|
|
if (controllerCount != GHIDRA_CAST<int *>(0x0)) {
|
|
do {
|
|
controllerId = -1;
|
|
if (*piVar7 == -1) {
|
|
piVar6 = GHIDRA_CAST<int *>((**(code **)(PTR_vftable_00c57b18 + 0x28))(defaultDevice));
|
|
iVar10 = *piVar6;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 6;
|
|
if (((defaultDeviceCtrl != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar4 = (**(code **)(*defaultDeviceCtrl + 0xc))(), cVar4 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(defaultDevice);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
|
|
if (iVar10 == 0) {
|
|
popupPos.x = (float)&DAT_bf800000;
|
|
popupPos.y = (float)&DAT_bf800000;
|
|
MessagePopup::MessagePopup
|
|
(popup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&popupPos);
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),7);
|
|
lineColor._red = 0.21568628;
|
|
lineColor._green = 0.16862746;
|
|
lineColor._blue = 0.1764706;
|
|
lineColor._alpha = 1.0;
|
|
local_74 = 0xffffffff;
|
|
local_70 = 0xffffffff;
|
|
popupLine = iVar10;
|
|
lineColor._unk = iVar10;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abd0))) == '\0') {
|
|
local_140 = 3;
|
|
lineText = "##GAME###CONTROLLER_DISCONNECTED_HEADER";
|
|
msvc::vector<48byte>::push_back(&popupLine);
|
|
lineText = "##GAME###CONTROLLER_DISCONNECTED_MESSAGE";
|
|
}
|
|
else {
|
|
lineText = "##GAME###RESELECT_CONTROLLER_HEADER";
|
|
msvc::vector<48byte>::push_back(&popupLine);
|
|
lineText = "##GAME###RESELECT_CONTROLLER_MESSAGE";
|
|
}
|
|
popupLine = 0;
|
|
local_74 = 0xffffffff;
|
|
local_70 = 0xffffffff;
|
|
lineColor._red = 0.21568628;
|
|
lineColor._green = 0.16862746;
|
|
lineColor._blue = 0.1764706;
|
|
lineColor._alpha = 1.0;
|
|
lineColor._unk = 0;
|
|
msvc::vector<48byte>::push_back(&popupLine);
|
|
iVar10 = (GHIDRA_CAST<PopupQueue *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(menuManager[1]._gamestate)) + 0xcf0))))))->PopupQueue::push(popup);
|
|
menuManager = g_menuManager;
|
|
*piVar7 = iVar10;
|
|
if (menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
if (menuManager->_netplayManager == *GHIDRA_CAST<int *>((menuManager + 1))) {
|
|
player = (GHIDRA_CAST<Game *>((g_game)))->Game::GetPlayer(slot);
|
|
(GHIDRA_CAST<Entity_Player *>((player)))->Entity_Player::SetControllerIndex(-1,1);
|
|
}
|
|
else {
|
|
FUN_0090af30(0xffffffff);
|
|
}
|
|
}
|
|
}
|
|
else if (menuManager->_selectedMenuID == 0xc) {
|
|
g_manager->_isHotkeysEnabled = 1;
|
|
pvVar8 = (menuManager->_menuStateHistory)._end;
|
|
if (1 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT((menuManager->_menuStateHistory)._begin) >> 2))) {
|
|
pvVar8 = (void *)(GHIDRA_INT(pvVar8) + -4);
|
|
(menuManager->_menuStateHistory)._end = pvVar8;
|
|
}
|
|
(GHIDRA_CAST<MenuManager *>((menuManager)))->MenuManager::SetState(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar8) + -4)),0);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
|
|
local_d8 = 0;
|
|
local_d4 = 0;
|
|
local_e0 = 0;
|
|
local_dc = 0;
|
|
local_e8 = 0;
|
|
local_e4 = 0;
|
|
FID_conflict__Tidy(local_f4);
|
|
FID_conflict__Tidy(local_100);
|
|
}
|
|
}
|
|
else {
|
|
piVar6 = GHIDRA_CAST<int *>((**(code **)(PTR_vftable_00c57b18 + 0x28)))
|
|
(device,*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(controllerIds) + slot * 4)));
|
|
iVar10 = *piVar6;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 8;
|
|
if (((deviceCtrl != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar4 = (**(code **)(*deviceCtrl + 0xc))(), cVar4 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(device);
|
|
}
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
|
|
if (iVar10 == 0) {
|
|
uVar5 = 0;
|
|
while( true ) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
|
|
deviceIdx = uVar5;
|
|
(**(code **)(PTR_vftable_00c57b2c + 0xc))(0xffffffff);
|
|
iVar11 = DAT_00c57b24 - _DAT_00c57b20;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 9;
|
|
(**(code **)(PTR_vftable_00c57b2c + 0x10))();
|
|
iVar10 = controllerId;
|
|
game = g_game;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 5;
|
|
if (GHIDRA_UINT((iVar11 >> 3)) <= uVar5) break;
|
|
(GHIDRA_CAST<KAGE::Input::Manager *>((GHIDRA_CAST<Manager *>(&PTR_vftable_00c57b18))))->KAGE::Input::Manager::get_device(&local_3c,uVar5);
|
|
ehState = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x1))),10);
|
|
if (GHIDRA_CAST<int *>(local_3c.x) == GHIDRA_CAST<int *>(0x0)) {
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xb;
|
|
if (GHIDRA_CAST<int *>(local_3c.y) == GHIDRA_CAST<int *>(0x0)) goto LAB_0095bc03;
|
|
cVar4 = (**(code **)(*GHIDRA_CAST<int *>(local_3c.y) + 0xc))();
|
|
if ((cVar4 == '\0') || (g_inputDeviceRelease == (void *)0x0)) goto LAB_0095bc03;
|
|
(*g_inputDeviceRelease)(&local_3c);
|
|
uVar5 = uVar5 + 1;
|
|
}
|
|
else {
|
|
iVar10 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_3c.x) + 0xc));
|
|
deviceId = iVar10;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abd0))) == '\0') {
|
|
cVar4 = (**(code **)(*GHIDRA_CAST<int *>(local_3c.x) + 0x1c))();
|
|
if (cVar4 != '\0') goto LAB_0095b9fd;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abd0))) != '\0') goto LAB_0095b9ee;
|
|
}
|
|
else {
|
|
LAB_0095b9ee:
|
|
cVar4 = (**(code **)(*GHIDRA_CAST<int *>(local_3c.x) + 0x20))();
|
|
if (cVar4 != '\0') {
|
|
LAB_0095b9fd:
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
playerManager = &g_game->_playerManager;
|
|
uVar5 = 0;
|
|
game = g_game;
|
|
if (GHIDRA_INT((g_game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2 != 0) {
|
|
do {
|
|
pvVar8 = (playerManager->_playerList)._end;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT((playerManager->_playerList)._begin) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n"
|
|
);
|
|
pvVar8 = (playerManager->_playerList)._end;
|
|
game = g_game;
|
|
}
|
|
piVar6 = (playerManager->_playerList)._begin;
|
|
if (uVar5 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT(piVar6) >> 2))) {
|
|
piVar6 = piVar6 + uVar5;
|
|
}
|
|
if (*GHIDRA_CAST<int *>((*piVar6 + 0x1618)) == iVar10) {
|
|
menuManager = manager;
|
|
goto LAB_0095bbd5;
|
|
}
|
|
playerManager = &game->_playerManager;
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < GHIDRA_UINT((GHIDRA_INT((game->_playerManager)._playerList._end) -
|
|
GHIDRA_INT((playerManager->_playerList)._begin) >> 2)));
|
|
}
|
|
menuManager = manager;
|
|
}
|
|
popupResult = -1;
|
|
piVar6 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abcc))));
|
|
controllerId = iVar10;
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abcc)))) != -1) {
|
|
popupQueueLock = &(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(menuManager[1]._gamestate)) + 0xcf8)));
|
|
(**(code **)(*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(menuManager[1]._gamestate)) + 0xcf8)))) + 0xc))(0xffffffff);
|
|
openPopup = GHIDRA_CAST<int *>(0x0);
|
|
piVar6 = *GHIDRA_CAST<int **>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xcf0))));
|
|
piVar7 = GHIDRA_CAST<int *>(*piVar6);
|
|
if (piVar7 == piVar6) {
|
|
LAB_0095bae2:
|
|
piVar6 = openPopup;
|
|
(**(code **)(*GHIDRA_CAST<int *>(popupQueueLock) + 0x10))();
|
|
if ((piVar6 != GHIDRA_CAST<int *>(0x0)) && (piVar6[1] < 3)) {
|
|
timeNs = GetTimeNs();
|
|
piVar6 = openPopup;
|
|
uVar5 = GHIDRA_UINT((timeNs >> 0x20));
|
|
uVar1 = (timeNs & 0xffffffff) * 0xd7b634db;
|
|
local_34 = GHIDRA_INT(uVar1);
|
|
lVar2 = (timeNs & 0xffffffff) * 0x431bde82;
|
|
local_30 = GHIDRA_CAST<int *>(((uint64_t)lVar2 >> 0x20));
|
|
lVar3 = (uint64_t)uVar5 * 0xd7b634db + (uVar1 >> 0x20);
|
|
local_ac = (uint32_t)(lVar3 + lVar2);
|
|
lVar2 = (uint64_t)uVar5 * 0x431bde82 +
|
|
(uint64_t)
|
|
CONCAT14(CARRY4(GHIDRA_UINT(((uint64_t)lVar3 >> 0x20)),
|
|
GHIDRA_INT(local_30) +
|
|
GHIDRA_UINT(CARRY4(GHIDRA_UINT(lVar2),GHIDRA_UINT(lVar3)))),
|
|
GHIDRA_INT(((uint64_t)(lVar3 + lVar2) >> 0x20)));
|
|
uVar9 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
uVar5 = GHIDRA_UINT(lVar2) >> 0x12 | uVar9 * 0x4000;
|
|
if (((uVar9 >> 0x12) - openPopup[5] == GHIDRA_UINT((uVar5 < GHIDRA_UINT(openPopup[4]))))
|
|
&& (uVar5 - openPopup[4] < GHIDRA_UINT(openPopup[0x15]))) {
|
|
openPopup[6] = popupResult;
|
|
}
|
|
else {
|
|
openPopup[6] = -0x1010102;
|
|
if ((code *)openPopup[0x28] != (code *)0x0) {
|
|
(*(code *)openPopup[0x28])(&popupResult,openPopup[0x29]);
|
|
}
|
|
(GHIDRA_CAST<Popup *>((piVar6)))->Popup::set_state(3);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
do {
|
|
openPopup = GHIDRA_CAST<int *>(piVar7[2]);
|
|
if (*openPopup == *popupIdSlot) goto LAB_0095bae2;
|
|
piVar7 = GHIDRA_CAST<int *>(*piVar7);
|
|
} while (piVar7 != piVar6);
|
|
(**(code **)(*GHIDRA_CAST<int *>(popupQueueLock) + 0x10))();
|
|
}
|
|
piVar6 = popupIdSlot;
|
|
iVar10 = deviceId;
|
|
menuManager = manager;
|
|
}
|
|
*piVar6 = -1;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abd0))) = 0;
|
|
if (menuManager->_netplayManager != *GHIDRA_CAST<int *>((menuManager + 1))) {
|
|
FUN_0090af30(iVar10);
|
|
}
|
|
}
|
|
}
|
|
LAB_0095bbd5:
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(ehState)) + 0x0))) = 0xc;
|
|
if (((GHIDRA_CAST<int *>(local_3c.y) != GHIDRA_CAST<int *>(0x0)) &&
|
|
(cVar4 = (**(code **)(*GHIDRA_CAST<int *>(local_3c.y) + 0xc))(), cVar4 != '\0')) &&
|
|
(g_inputDeviceRelease != (void *)0x0)) {
|
|
(*g_inputDeviceRelease)(&local_3c);
|
|
}
|
|
uVar5 = deviceIdx;
|
|
LAB_0095bc03:
|
|
uVar5 = uVar5 + 1;
|
|
}
|
|
}
|
|
if (controllerId != -1) {
|
|
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
|
if (g_game != GHIDRA_CAST<Game *>(0x0)) {
|
|
if (menuManager->_netplayManager == *GHIDRA_CAST<int *>((menuManager + 1))) {
|
|
pvVar8 = (g_game->_playerManager)._playerList._end;
|
|
playerIt = (g_game->_playerManager)._playerList._begin;
|
|
if (GHIDRA_INT(pvVar8) - GHIDRA_INT(playerIt) >> 2 == 0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"(GHIDRA_CAST<PlayerManager *>(()))->PlayerManager::GetPlayer() : There are no players! \n");
|
|
pvVar8 = (game->_playerManager)._playerList._end;
|
|
playerIt = (game->_playerManager)._playerList._begin;
|
|
}
|
|
uVar5 = slot;
|
|
if (slot < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT(playerIt) >> 2))) {
|
|
playerIt = playerIt + slot;
|
|
}
|
|
(GHIDRA_CAST<Entity_Player *>((GHIDRA_CAST<Entity_Player *>(*playerIt))))->Entity_Player::SetControllerIndex(iVar10,1);
|
|
if (uVar5 == 0) {
|
|
g_menuControllerIndex = iVar10;
|
|
}
|
|
}
|
|
else {
|
|
FUN_0090af30(controllerId);
|
|
g_menuControllerIndex = iVar10;
|
|
}
|
|
game = g_game;
|
|
(g_game->_playerManager)._coopSlots[0]._controllerIndex = -1;
|
|
(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;
|
|
}
|
|
}
|
|
else {
|
|
g_menuControllerIndex = controllerId;
|
|
}
|
|
FUN_00a21cb0();
|
|
}
|
|
piVar7 = GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((menuManager)) + 0x4abcc))));
|
|
}
|
|
}
|
|
slot = slot + 1;
|
|
} while (slot < controllerCount);
|
|
}
|
|
if (controllerIds != (void *)0x0) {
|
|
uVar5 = -GHIDRA_INT(controllerIds) & 0xfffffffc;
|
|
pvVar8 = controllerIds;
|
|
if (0xfff < uVar5) {
|
|
pvVar8 = *(void **)(GHIDRA_CAST<char *>(controllerIds) + -4);
|
|
uVar5 = uVar5 + 0x23;
|
|
if (0x1f < GHIDRA_UINT((GHIDRA_INT(controllerIds) + (-4 - GHIDRA_INT(pvVar8))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pvVar8,uVar5);
|
|
}
|
|
ExceptionList = savedExceptionList;
|
|
return;
|
|
}
|
|
|
|
// 0095df20
|
|
void Manager::update_state_loading()
|
|
{
|
|
int64_t lVar1;
|
|
int64_t lVar2;
|
|
int64_t lVar3;
|
|
uint8_t isCallbackHandled;
|
|
char cVar4;
|
|
uint32_t uVar5;
|
|
int iVar6;
|
|
float *pfVar7;
|
|
int iVar8;
|
|
int *piVar9;
|
|
int *in_ECX;
|
|
Manager *manager;
|
|
int unused;
|
|
int unused_00;
|
|
int unused_01;
|
|
int unused_02;
|
|
uint32_t uVar10;
|
|
uint32_t uVar11;
|
|
int *piVar12;
|
|
uint64_t uVar13;
|
|
uint64_t nowNs;
|
|
uint8_t *message;
|
|
uint8_t *messageRefCount;
|
|
uint8_t waitingPopup [172];
|
|
uint32_t textColor;
|
|
uint32_t uStack_60;
|
|
uint32_t uStack_5c;
|
|
uint32_t uStack_58;
|
|
uint32_t local_54;
|
|
uint8_t messageRef [4];
|
|
int *local_4c;
|
|
uint32_t local_48;
|
|
float local_44 [2];
|
|
int *loader;
|
|
Vector local_38;
|
|
float local_2c;
|
|
float local_28;
|
|
uint8_t isMenuConfirm;
|
|
uint8_t isMenuBack;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
float local_14;
|
|
float cutsceneEntryOffset;
|
|
uint32_t *entryStartTime;
|
|
uint32_t *firstCutsceneEntry;
|
|
|
|
manager = g_manager;
|
|
lVar1 = CONCAT44(local_38.y,local_28);
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_44 + 0x10));
|
|
local_14 = -NAN;
|
|
puStack_18 = &LAB_00b0c6e8;
|
|
local_1c = ExceptionList;
|
|
uVar5 = __security_cookie ^ GHIDRA_UINT((local_44 + 0xd));
|
|
iVar6 = *in_ECX;
|
|
loader = in_ECX;
|
|
if ((iVar6 != 1) && (iVar6 != 2)) {
|
|
if (iVar6 != 3) {
|
|
return;
|
|
}
|
|
local_2c = DAT_00c7997c / _DAT_00c5d2c0;
|
|
local_28 = DAT_00c79980 / _DAT_00c5d2c4;
|
|
pfVar7 = &local_28;
|
|
if (DAT_00c7997c / _DAT_00c5d2c0 <= DAT_00c79980 / _DAT_00c5d2c4) {
|
|
pfVar7 = &local_2c;
|
|
}
|
|
ExceptionList = &local_1c;
|
|
(g_manager->_popupButtons)._scale = *pfVar7;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x278))) == '\0') {
|
|
piVar9 = in_ECX + 0x20e;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_44 + 0x10));
|
|
if (in_ECX[0x20e] == -1) goto LAB_0095e179;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_44 + 0x10));
|
|
}
|
|
else {
|
|
piVar9 = in_ECX + 0x20e;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_44 + 0x10));
|
|
if (in_ECX[0x20e] == -1) {
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((local_44 + 0x10));
|
|
uVar13 = GetTimeNs();
|
|
uVar5 = GHIDRA_UINT((uVar13 >> 0x20));
|
|
lVar1 = (uVar13 & 0xffffffff) * 0x431bde82;
|
|
local_4c = GHIDRA_CAST<int *>(((uint64_t)lVar1 >> 0x20));
|
|
lVar2 = (uint64_t)uVar5 * 0xd7b634db;
|
|
local_28 = (float)((uint64_t)lVar2 >> 0x20);
|
|
lVar3 = (uint64_t)uVar5 * 0x431bde82;
|
|
local_44[0] = (float)((uint64_t)lVar3 >> 0x20);
|
|
local_2c = (float)lVar3;
|
|
uVar13 = lVar2 + ((uVar13 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar10 = GHIDRA_UINT((uVar13 >> 0x20));
|
|
lVar1 = lVar1 + (uVar13 & 0xffffffff);
|
|
local_38.x = (float)lVar1;
|
|
uVar5 = GHIDRA_UINT(((uint64_t)lVar1 >> 0x20));
|
|
lVar1 = lVar3 + (uint64_t)CONCAT14(CARRY4(uVar10,uVar5),uVar10 + uVar5);
|
|
uVar5 = GHIDRA_UINT(((uint64_t)lVar1 >> 0x20));
|
|
uVar10 = GHIDRA_UINT(lVar1) >> 0x12 | uVar5 * 0x4000;
|
|
if (((uVar5 >> 0x12) - loader[0x20d] == GHIDRA_UINT((uVar10 < GHIDRA_UINT(loader[0x20c])))) &&
|
|
(uVar10 - loader[0x20c] < 0x1f5)) {
|
|
local_38.y = 0.0;
|
|
}
|
|
else {
|
|
local_38.x = (float)&DAT_bf800000;
|
|
local_38.y = 80.0;
|
|
MessagePopup::MessagePopup
|
|
(waitingPopup,&g_manager->_font2_TeamMeatEx12,(void *)0x0,(void *)0x0,&local_38)
|
|
;
|
|
local_14 = 2.8026e-45;
|
|
local_54 = 0;
|
|
local_44[0] = 1.4013e-45;
|
|
textColor = 0x3e5cdcdd;
|
|
uStack_60 = 0x3e2cacad;
|
|
uStack_5c = 0x3e34b4b5;
|
|
uStack_58 = 0x3f800000;
|
|
local_38.x = 0.0;
|
|
local_38.y = 16.0;
|
|
MessagePopup::add_text
|
|
("##GAME###Online/WAITING_FOR_PLAYERS",&local_38,local_44,&textColor);
|
|
iVar6 = (GHIDRA_CAST<PopupQueue *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0xcf0))))))->PopupQueue::push(waitingPopup);
|
|
local_14 = -NAN;
|
|
loader[0x20e] = iVar6;
|
|
FUN_00420710();
|
|
lVar3 = CONCAT44(local_44[0],local_2c);
|
|
}
|
|
local_44[0] = (float)((uint64_t)lVar3 >> 0x20);
|
|
local_2c = (float)lVar3;
|
|
piVar9 = loader + 0x20e;
|
|
manager = g_manager;
|
|
in_ECX = loader;
|
|
}
|
|
}
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x278))) != '\0') {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (*piVar9 != -1) {
|
|
local_44[0] = -NAN;
|
|
(GHIDRA_CAST<PopupManager *>((&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0xcf0))))))->PopupManager::close(piVar9,GHIDRA_CAST<int *>(local_44));
|
|
manager = g_manager;
|
|
*piVar9 = -1;
|
|
}
|
|
LAB_0095e179:
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(manager[1]._gamestate)) + 0x278))) != '\0') {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
if (*piVar9 != -1) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
*in_ECX = 0;
|
|
if ((manager->_netplayManager != *GHIDRA_CAST<int *>((manager + 1))) &&
|
|
((manager->_cutsceneManager)._isQueuedCleanup != 0)) {
|
|
FUN_008fd750();
|
|
}
|
|
online_session_reset();
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
iVar6 = in_ECX[0x202];
|
|
local_2c = (float)(iVar6 * 0x4c);
|
|
ExceptionList = &local_1c;
|
|
pfVar7 = local_44 + 0x10;
|
|
if (GHIDRA_UINT(in_ECX[iVar6 * 0x13 + 0x11]) <
|
|
GHIDRA_UINT((in_ECX[iVar6 * 0x13 + 9] - in_ECX[iVar6 * 0x13 + 8] >> 2))) {
|
|
nowNs = GetTimeNs();
|
|
uVar10 = GHIDRA_UINT((nowNs >> 0x20));
|
|
uVar13 = (nowNs & 0xffffffff) * 0xd7b634db;
|
|
local_38.x = (float)uVar13;
|
|
lVar2 = (nowNs & 0xffffffff) * 0x431bde82;
|
|
local_4c = GHIDRA_CAST<int *>(((uint64_t)lVar2 >> 0x20));
|
|
lVar3 = (uint64_t)uVar10 * 0xd7b634db;
|
|
local_44[0] = (float)((uint64_t)lVar3 >> 0x20);
|
|
lVar1 = (uint64_t)uVar10 * 0x431bde82;
|
|
uVar13 = lVar3 + (uVar13 >> 0x20);
|
|
uVar11 = GHIDRA_UINT((uVar13 >> 0x20));
|
|
lVar2 = lVar2 + (uVar13 & 0xffffffff);
|
|
local_48 = (uint32_t)lVar2;
|
|
uVar10 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
lVar2 = lVar1 + (uint64_t)CONCAT14(CARRY4(uVar11,uVar10),uVar11 + uVar10);
|
|
uVar10 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
uVar11 = GHIDRA_UINT(lVar2) >> 0x12 | uVar10 * 0x4000;
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_2c) + 0x20 + GHIDRA_INT(loader))) +
|
|
loader[loader[0x202] * 0x13 + 0x11] * 4));
|
|
entryStartTime = GHIDRA_CAST<uint32_t *>((iVar6 + 0x38));
|
|
pfVar7 = GHIDRA_CAST<float *>(puStack_20);
|
|
if (((uVar10 >> 0x12) - *GHIDRA_CAST<int *>((iVar6 + 0x3c)) != GHIDRA_UINT((uVar11 < *entryStartTime))) ||
|
|
(piVar9 = loader, GHIDRA_UINT(loader[0x20a]) <= uVar11 - *entryStartTime)) goto LAB_0095e290;
|
|
}
|
|
else {
|
|
LAB_0095e290:
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>(pfVar7);
|
|
piVar9 = loader;
|
|
local_38.y = (float)((uint64_t)lVar1 >> 0x20);
|
|
local_28 = (float)lVar1;
|
|
if ((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) ||
|
|
((g_luaEngine == (void *)0x0 ||
|
|
(isCallbackHandled = lua_run_input_action_callback(GHIDRA_CAST<Entity *>(0x0),1,0xe,&isMenuConfirm),
|
|
isCallbackHandled == 0)))) {
|
|
local_38.y = 1.96182e-44;
|
|
isMenuConfirm =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_38.y,0,0,uVar5)
|
|
;
|
|
}
|
|
isMenuConfirm = isMenuConfirm != 0;
|
|
if (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) != 2) || (g_luaEngine == (void *)0x0)) ||
|
|
(isCallbackHandled = lua_run_input_action_callback(GHIDRA_CAST<Entity *>(0x0),1,0xf,&isMenuBack),
|
|
isCallbackHandled == 0)) {
|
|
local_4c = GHIDRA_CAST<int *>(0xf);
|
|
isMenuBack = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_4c,0,0)
|
|
;
|
|
}
|
|
if (g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) {
|
|
isMenuBack = 0;
|
|
isMenuConfirm = 0;
|
|
iVar6 = FUN_0090b070();
|
|
if (iVar6 != 0) {
|
|
if (*GHIDRA_CAST<int *>((iVar6 + 0x378)) == 0) {
|
|
iVar8 = -0x21524111;
|
|
}
|
|
else {
|
|
iVar8 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar6 + 0x378)) + 0xc));
|
|
}
|
|
isMenuConfirm = input_is_action_pressed(0xe,iVar8,GHIDRA_CAST<Entity *>(0x0),unused);
|
|
if (*GHIDRA_CAST<int *>((iVar6 + 0x378)) == 0) {
|
|
iVar6 = -0x21524111;
|
|
}
|
|
else {
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar6 + 0x378)) + 0xc));
|
|
}
|
|
isMenuBack = input_is_action_pressed(0xf,iVar6,GHIDRA_CAST<Entity *>(0x0),unused_00);
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
if ((g_manager->_netplayManager != *GHIDRA_CAST<int *>((g_manager + 1))) &&
|
|
(1 < GHIDRA_UINT((*GHIDRA_CAST<int *>((g_manager + 1)) - g_manager->_netplayManager >> 2)))) {
|
|
iVar6 = online_vote_get_local_choice();
|
|
(manager->_popupButtons)._buttons[1]._isVisible = iVar6 == 2;
|
|
manager = g_manager;
|
|
local_28 = DAT_00c7997c / _DAT_00c5d2c0;
|
|
local_44[0] = DAT_00c79980 / _DAT_00c5d2c4;
|
|
pfVar7 = local_44;
|
|
if (DAT_00c7997c / _DAT_00c5d2c0 <= DAT_00c79980 / _DAT_00c5d2c4) {
|
|
pfVar7 = &local_28;
|
|
}
|
|
(g_manager->_popupButtons)._scale = *pfVar7;
|
|
}
|
|
lVar1 = CONCAT44(local_38.y,local_28);
|
|
if ((isMenuConfirm != 0) || (isMenuBack != 0)) {
|
|
if ((manager->_netplayManager == *GHIDRA_CAST<int *>((manager + 1))) ||
|
|
(GHIDRA_UINT((*GHIDRA_CAST<int *>((manager + 1)) - manager->_netplayManager >> 2)) < 2)) {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(local_2c) + 0x4c + GHIDRA_INT(piVar9))) = 1;
|
|
}
|
|
else {
|
|
online_vote_send(0);
|
|
lVar1 = CONCAT44(local_38.y,local_28);
|
|
}
|
|
}
|
|
}
|
|
cutsceneEntryOffset = local_2c;
|
|
local_38.y = (float)((uint64_t)lVar1 >> 0x20);
|
|
local_28 = (float)lVar1;
|
|
if ((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(local_2c) + 0x4c + GHIDRA_INT(piVar9))) != '\0') ||
|
|
(((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x2c)) != '\0' &&
|
|
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x24)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x20))
|
|
>> 2 <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x44)))) ||
|
|
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x2d)) != '\0')))) {
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x48)) =
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x48)) + 0.05;
|
|
}
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x44));
|
|
piVar12 = piVar9;
|
|
if (iVar6 < 0) {
|
|
firstCutsceneEntry = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x20));
|
|
if (firstCutsceneEntry == *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x24)))
|
|
goto LAB_0095e570;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x44)) = 0;
|
|
(**(code **)(*GHIDRA_CAST<int *>(*firstCutsceneEntry) + 0xc))();
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x20)) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x44)) * 4));
|
|
local_38.y = (float)CONCAT31((int3)(GHIDRA_UINT(iVar6) >> 8),*GHIDRA_CAST<uint8_t *>((iVar6 + 8)));
|
|
iVar6 = (GHIDRA_CAST<Window *>((&DAT_00c798e0)))->Window::get_framebuffer_height();
|
|
iVar8 = (GHIDRA_CAST<GraphicsWindow *>((&DAT_00c798e0)))->GraphicsWindow::get_framebuffer_width();
|
|
}
|
|
else {
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x20));
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(local_2c) + 0x24)) - iVar8 >> 2 <= iVar6) goto LAB_0095e570;
|
|
(**(code **)(**GHIDRA_CAST<int **>((iVar8 + iVar6 * 4)) + 0x10))();
|
|
cVar4 = (**(code **)(**GHIDRA_CAST<int **>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x20)) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x44)) * 4)) +
|
|
0x18))();
|
|
lVar1 = CONCAT44(local_38.y,local_28);
|
|
if (cVar4 == '\0') goto LAB_0095e570;
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x44)) + 1;
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x44)) = iVar8;
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x20));
|
|
lVar1 = CONCAT44(local_38.y,local_28);
|
|
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x24)) - iVar6 >> 2 <= iVar8)
|
|
goto LAB_0095e570;
|
|
(**(code **)(**GHIDRA_CAST<int **>((iVar6 + iVar8 * 4)) + 0xc))();
|
|
iVar6 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x20)) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x44)) * 4));
|
|
local_38.y = (float)CONCAT31((int3)(GHIDRA_UINT(iVar6) >> 8),*GHIDRA_CAST<uint8_t *>((iVar6 + 8)));
|
|
iVar6 = (GHIDRA_CAST<Window *>((&DAT_00c798e0)))->Window::get_framebuffer_height();
|
|
iVar8 = (GHIDRA_CAST<GraphicsWindow *>((&DAT_00c798e0)))->GraphicsWindow::get_framebuffer_width();
|
|
}
|
|
update_screen_scale(iVar8,iVar6,SUB41(local_38.y,0));
|
|
piVar12 = loader;
|
|
lVar1 = CONCAT44(local_38.y,local_28);
|
|
LAB_0095e570:
|
|
local_38.y = (float)((uint64_t)lVar1 >> 0x20);
|
|
local_28 = (float)lVar1;
|
|
iVar6 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x20));
|
|
iVar8 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x24));
|
|
if ((((iVar6 == iVar8) ||
|
|
((iVar8 - iVar6 >> 2 <= *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x44)) &&
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x2c)) == '\0' ||
|
|
(1.0 <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x48)))))))) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x4c)) != '\0' &&
|
|
(1.0 <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x48)))))) ||
|
|
((*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x2d)) != '\0' &&
|
|
(1.0 <= *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x48)))))) {
|
|
(GHIDRA_CAST<CutsceneEntry *>((GHIDRA_CAST<CutsceneEntry *>((GHIDRA_INT(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 4)))))->CutsceneEntry::Unload();
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(piVar9) + GHIDRA_INT(cutsceneEntryOffset) + 0x4d)) != '\0') {
|
|
TheoraVideoManager::destroyVideoClip((void *)piVar12[0x204]);
|
|
piVar12[0x204] = 0;
|
|
piVar12[0x203] = 0;
|
|
*GHIDRA_CAST<uint8_t *>((piVar12 + 0x207)) = 0;
|
|
KAGE::SmartPointer<RenderTargetBase>::reset(piVar12 + 0x205);
|
|
}
|
|
TextureCache::Purge();
|
|
piVar9 = glfw_get_window_size(GHIDRA_CAST<int *>(&local_38),unused_01);
|
|
iVar6 = piVar9[1];
|
|
piVar9 = glfw_get_window_size(GHIDRA_CAST<int *>(&local_38),unused_02);
|
|
set_viewport_size(*piVar9,iVar6);
|
|
lVar1 = CONCAT44(local_28,local_4c);
|
|
if ((g_manager->_netplayManager == *GHIDRA_CAST<int *>((g_manager + 1))) ||
|
|
(GHIDRA_UINT((*GHIDRA_CAST<int *>((g_manager + 1)) - g_manager->_netplayManager >> 2)) < 2)) {
|
|
iVar6 = 0;
|
|
}
|
|
else {
|
|
uVar13 = GetTimeNs();
|
|
uVar5 = GHIDRA_UINT((uVar13 >> 0x20));
|
|
lVar2 = (uVar13 & 0xffffffff) * 0x431bde82;
|
|
local_44[0] = (float)((uint64_t)lVar2 >> 0x20);
|
|
lVar1 = (uint64_t)uVar5 * 0x431bde82;
|
|
uVar13 = (uint64_t)uVar5 * 0xd7b634db + ((uVar13 & 0xffffffff) * 0xd7b634db >> 0x20);
|
|
uVar10 = GHIDRA_UINT((uVar13 >> 0x20));
|
|
lVar2 = lVar2 + (uVar13 & 0xffffffff);
|
|
local_38.x = (float)lVar2;
|
|
uVar5 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
lVar2 = lVar1 + (uint64_t)CONCAT14(CARRY4(uVar10,uVar5),uVar10 + uVar5);
|
|
uVar5 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20));
|
|
loader[0x20c] = GHIDRA_UINT(lVar2) >> 0x12 | uVar5 * 0x4000;
|
|
iVar6 = 3;
|
|
loader[0x20d] = uVar5 >> 0x12;
|
|
}
|
|
local_28 = (float)((uint64_t)lVar1 >> 0x20);
|
|
local_4c = GHIDRA_CAST<int *>(lVar1);
|
|
*loader = iVar6;
|
|
if (((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x278))) != '\0') &&
|
|
((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(g_manager[1]._gamestate)) + 0x284))) == '\0')) {
|
|
local_38.y = 0.0;
|
|
if (g_multiplayerService == (void *)0x0) {
|
|
KAGE_LogMessage(0x10,(uint8_t *)
|
|
"Attempting to create a message when there is no multiplayer service\n"
|
|
);
|
|
lVar1 = CONCAT44(local_28,local_4c);
|
|
}
|
|
local_28 = (float)((uint64_t)lVar1 >> 0x20);
|
|
local_4c = GHIDRA_CAST<int *>(lVar1);
|
|
messageRefCount = &DAT_00000004;
|
|
message = &DAT_00000004;
|
|
NetConnection::send_message(g_multiplayerService,messageRef,1,&local_38.y,4,4);
|
|
manager = g_manager;
|
|
local_14 = 0.0;
|
|
FUN_008ef1d0(messageRef);
|
|
NetplayManager::send_message
|
|
(GHIDRA_CAST<NetplayManager *>(&manager->_netplayManager),0x11,message,messageRefCount);
|
|
local_14 = 1.4013e-45;
|
|
if (((local_4c != GHIDRA_CAST<int *>(0x0)) && (cVar4 = (**(code **)(*local_4c + 0xc))(), cVar4 != '\0')) &&
|
|
(g_multiplayerRelease != (void *)0x0)) {
|
|
(*g_multiplayerRelease)(messageRef);
|
|
}
|
|
}
|
|
manager = g_manager;
|
|
(g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009a9ef0
|
|
void Manager::ResizeWindowCallback(void *window, int windowWidth, int windowHeight)
|
|
{
|
|
int cutsceneEntries;
|
|
int iVar2;
|
|
int cutsceneEntries;
|
|
|
|
if (((window != (void *)0x0) && (windowWidth != 0)) &&
|
|
((window != DAT_00c7b638 || (windowWidth != DAT_00c7b63c)))) {
|
|
DAT_00c7b638 = window;
|
|
DAT_00c7b63c = windowWidth;
|
|
cutsceneEntries = (GHIDRA_CAST<GraphicsWindow *>((&DAT_00c798e0)))->GraphicsWindow::get_framebuffer_width();
|
|
iVar2 = (GHIDRA_CAST<Window *>((&DAT_00c798e0)))->Window::get_framebuffer_height();
|
|
if ((cutsceneEntries != 0) && (iVar2 != 0)) {
|
|
if (*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((g_manager)) + 0x8)))) == 3) {
|
|
iVar2 = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&((g_manager->_cutsceneManager))) + 0x808)))) * 0x4c;
|
|
cutsceneEntries = *GHIDRA_CAST<int *>((GHIDRA_INT(&(g_manager->_achievementOverlay)._sprite._filename) + iVar2 + -0xe28));
|
|
if (-1 < cutsceneEntries) {
|
|
cutsceneEntries =
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT(&(g_manager->_achievementOverlay)._sprite._filename) + iVar2 + -0xe4c));
|
|
if (cutsceneEntries < *GHIDRA_CAST<int *>((GHIDRA_INT(&(g_manager->_achievementOverlay)._sprite._filename) +
|
|
iVar2 + -0xe48)) - cutsceneEntries >> 2) {
|
|
update_screen_scale(GHIDRA_INT(window),windowWidth,
|
|
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((cutsceneEntries + cutsceneEntries * 4)) + 8)));
|
|
return;
|
|
}
|
|
}
|
|
update_screen_scale(GHIDRA_INT(window),windowWidth,0);
|
|
return;
|
|
}
|
|
set_viewport_size(GHIDRA_INT(window),windowWidth);
|
|
}
|
|
}
|
|
return;
|
|
}
|