The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
683 lines
30 KiB
C++
683 lines
30 KiB
C++
#include "classes.h"
|
|
|
|
// 008cf610
|
|
void Menu_DailyChallenge::Update()
|
|
{
|
|
KColor fadeColor;
|
|
byte bVar1;
|
|
char isActionTriggered;
|
|
Menu_DailyChallenge curAnimChar;
|
|
uint cmpResult;
|
|
tm *gmTime;
|
|
char *animName;
|
|
Manager *manager;
|
|
bool isLess;
|
|
KColor aKStackY_a7c [128];
|
|
undefined4 uVar2;
|
|
code *pcVar3;
|
|
Menu_DailyChallenge *pMVar4;
|
|
undefined4 cmpResult;
|
|
undefined *puVar6;
|
|
Menu_DailyChallenge local_48;
|
|
byte serverTime [8];
|
|
__time64_t serverTime64;
|
|
tm serverTm;
|
|
undefined4 local_8;
|
|
Menu_DailyChallenge animData;
|
|
|
|
local_8 = __security_cookie ^ GHIDRA_UINT((serverTime + 0x40));
|
|
bVar1 = (GHIDRA_CAST<NetplayManager *>((&g_manager->_netplayManager)))->NetplayManager::check_connection();
|
|
if (bVar1 == 0) {
|
|
return;
|
|
}
|
|
if (((g_manager->_framecount & 1) == 0) && ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x47])) + 0x1))) != '\0')) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x11)))))->AnimationState::Update();
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x19)))))->AnimationState::Update();
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x4f)))))->ANM2::update_appear_then_idle();
|
|
(GHIDRA_CAST<GenericPrompt *>((GHIDRA_CAST<GenericPrompt *>((this + 0x9c)))))->GenericPrompt::Update(1);
|
|
if (*this == (Menu_DailyChallenge)0x0) {
|
|
daily_challenge_refresh();
|
|
FUN_008d0940();
|
|
}
|
|
manager = g_manager;
|
|
if (g_menuManager->_fadeOutActive != 0) {
|
|
if (1.0 <= g_menuManager->_fadeOutProgress) {
|
|
animData = this[2];
|
|
(g_manager->_dailyChallenge)._isPractice = animData == (Menu_DailyChallenge)0x2;
|
|
manager->_rerunAvailable = 0;
|
|
manager->_startingFromRerun = 0;
|
|
manager->_debugStart = 0;
|
|
manager->_starting = 1;
|
|
manager->_networkPlay = 0;
|
|
manager->_consecutiveResetCount = 0;
|
|
if (animData != (Menu_DailyChallenge)0x2) {
|
|
if ((manager->_persistentGameData)._eventCounters[0xbf] != 0) {
|
|
PersistentGameData::IncreaseEventCounter
|
|
(&manager->_persistentGameData,0xc0,
|
|
-(manager->_persistentGameData)._eventCounters[0xc0]);
|
|
manager = g_manager;
|
|
}
|
|
(manager->_persistentGameData)._eventCounters[0xbf] = 1;
|
|
(GHIDRA_CAST<PersistentGameData *>((&manager->_persistentGameData)))->PersistentGameData::IncreaseEventCounter(0xbe,1);
|
|
}
|
|
}
|
|
FUN_008d0840();
|
|
return;
|
|
}
|
|
if ((this[0x5c] == (Menu_DailyChallenge)0x0) || (*GHIDRA_CAST<char *>((this + 0x60)) == '\0')) {
|
|
if (this[0xea] == (Menu_DailyChallenge)0x0) {
|
|
animData = *this;
|
|
if (((animData != (Menu_DailyChallenge)0x0) && (animData != (Menu_DailyChallenge)0x1)) &&
|
|
(animData != (Menu_DailyChallenge)0x4)) {
|
|
pMVar4 = &local_48;
|
|
cmpResult = 0;
|
|
pcVar3 = FUN_00a209e0;
|
|
uVar2 = 0xffffffff;
|
|
local_48 = (Menu_DailyChallenge)0xe;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered == '\0') {
|
|
local_48 = (Menu_DailyChallenge)0x16;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered == '\0') {
|
|
local_48 = (Menu_DailyChallenge)0x17;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if ((isActionTriggered != '\0') &&
|
|
((animData = this[1], animData == (Menu_DailyChallenge)0x0 ||
|
|
((0x31 < GHIDRA_INT(animData) && (GHIDRA_INT(animData) % 10 == 0)))))) {
|
|
animData = (Menu_DailyChallenge)(GHIDRA_INT(this[2]) + 1);
|
|
this[2] = animData;
|
|
if (3 < GHIDRA_INT(animData)) {
|
|
this[2] = (Menu_DailyChallenge)0x0;
|
|
animData = (Menu_DailyChallenge)0x0;
|
|
}
|
|
while (((animData == (Menu_DailyChallenge)0x0 ||
|
|
(animData == (Menu_DailyChallenge)0x1)) && (*this != (Menu_DailyChallenge)0x2)
|
|
)) {
|
|
animData = (Menu_DailyChallenge)(GHIDRA_INT(animData) + 1);
|
|
this[2] = animData;
|
|
}
|
|
if (animData == (Menu_DailyChallenge)0x2) {
|
|
animData = this[2];
|
|
if (*this != (Menu_DailyChallenge)0x3) {
|
|
animData = (Menu_DailyChallenge)0x3;
|
|
}
|
|
this[2] = animData;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
animData = this[1];
|
|
if ((animData == (Menu_DailyChallenge)0x0) ||
|
|
((0x31 < GHIDRA_INT(animData) && (GHIDRA_INT(animData) % 10 == 0)))) {
|
|
animData = (Menu_DailyChallenge)(GHIDRA_INT(this[2]) + -1);
|
|
this[2] = animData;
|
|
if ((animData == (Menu_DailyChallenge)0x2) && (*this != (Menu_DailyChallenge)0x3)) {
|
|
this[2] = (Menu_DailyChallenge)0x1;
|
|
animData = (Menu_DailyChallenge)0x1;
|
|
}
|
|
while (((animData == (Menu_DailyChallenge)0x0 ||
|
|
(animData == (Menu_DailyChallenge)0x1)) && (*this != (Menu_DailyChallenge)0x2)
|
|
)) {
|
|
animData = (Menu_DailyChallenge)(GHIDRA_INT(animData) + -1);
|
|
this[2] = animData;
|
|
}
|
|
if (GHIDRA_INT(animData) < 0) {
|
|
this[2] = (Menu_DailyChallenge)0x3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
switch(this[2]) {
|
|
case (Menu_DailyChallenge)0x0:
|
|
input_poll_active_device();
|
|
DAT_00c5ab40 = 0;
|
|
FUN_00a51aa0();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 5)))))->ANM2::Play(GHIDRA_CAST<byte *>("Loading"),0);
|
|
break;
|
|
case (Menu_DailyChallenge)0x1:
|
|
bVar1 = show_beta_disclaimer_popup(1,FUN_008d0ed0,this);
|
|
if (bVar1 == 0) {
|
|
func_0x008d0810();
|
|
}
|
|
break;
|
|
case (Menu_DailyChallenge)0x2:
|
|
puVar6 = &UNK_008cf88f;
|
|
daily_challenge_refresh();
|
|
(GHIDRA_CAST<KColor *>((aKStackY_a7c + 0x81)))->KColor::SetFromARGB(0xff000000);
|
|
fadeColor._green = (float)pcVar3;
|
|
fadeColor._red = (float)uVar2;
|
|
fadeColor._blue = (float)pMVar4;
|
|
fadeColor._alpha = (float)cmpResult;
|
|
fadeColor._unk = GHIDRA_INT(puVar6);
|
|
MenuManager::start_game(fadeColor);
|
|
break;
|
|
case (Menu_DailyChallenge)0x3:
|
|
daily_challenge_refresh();
|
|
local_48 = (Menu_DailyChallenge)(g_manager->_dailyChallenge)._id;
|
|
*GHIDRA_CAST<undefined4 *>((this + 0xe9)) = 1;
|
|
this[0xea] = (Menu_DailyChallenge)0x1;
|
|
animData = this[0x13f];
|
|
if (animData == (Menu_DailyChallenge)0x0) {
|
|
code_r0x008cf92b:
|
|
bVar1 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x132)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Appear"),1);
|
|
if (bVar1 != 0) {
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x13e)))))->AnimationState::Rewind();
|
|
*GHIDRA_CAST<undefined1 *>((this + 0x143)) = 1;
|
|
}
|
|
}
|
|
else {
|
|
curAnimChar = animData;
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animData) + 0x14))) {
|
|
curAnimChar = *GHIDRA_CAST<Menu_DailyChallenge *>(animData);
|
|
}
|
|
animName = "Appear";
|
|
do {
|
|
bVar1 = *GHIDRA_CAST<byte *>(curAnimChar);
|
|
isLess = bVar1 < (byte)*animName;
|
|
if (bVar1 != *animName) {
|
|
code_r0x008cf907:
|
|
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
|
goto code_r0x008cf90c;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(curAnimChar) + 1));
|
|
isLess = bVar1 < (byte)animName[1];
|
|
if (bVar1 != animName[1]) goto code_r0x008cf907;
|
|
curAnimChar = (Menu_DailyChallenge)(GHIDRA_INT(curAnimChar) + 2);
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
cmpResult = 0;
|
|
code_r0x008cf90c:
|
|
if ((cmpResult != 0) ||
|
|
((*GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(animData) + 0x34)) != 0 && (*GHIDRA_CAST<char *>((this + 0x143)) == '\0'))))
|
|
goto code_r0x008cf92b;
|
|
}
|
|
this[0x17c] = (Menu_DailyChallenge)0xffffffff;
|
|
this[0x17e] = local_48;
|
|
this[0x17d] = local_48;
|
|
(GHIDRA_CAST<DailyChallenge *>((GHIDRA_CAST<DailyChallenge *>((this + 0x17f)))))->DailyChallenge::Init(GHIDRA_UINT(local_48));
|
|
KAGE::System::LeaderboardManager::release_result(GHIDRA_INT(this[0x177]));
|
|
KAGE::System::LeaderboardManager::release_result(GHIDRA_INT(this[0x178]));
|
|
KAGE::System::LeaderboardManager::release_result(GHIDRA_INT(this[0x179]));
|
|
KAGE::System::LeaderboardManager::release_result(GHIDRA_INT(this[0x17a]));
|
|
this[0x17a] = (Menu_DailyChallenge)0x0;
|
|
this[0x179] = (Menu_DailyChallenge)0x0;
|
|
this[0x178] = (Menu_DailyChallenge)0x0;
|
|
this[0x177] = (Menu_DailyChallenge)0x0;
|
|
*GHIDRA_CAST<undefined2 *>((this + 0x1d3)) = 0x101;
|
|
(GHIDRA_CAST<Leaderboard *>((GHIDRA_CAST<Leaderboard *>((this + 0xe9)))))->Leaderboard::get_leaderboard(0,2);
|
|
manager = g_manager;
|
|
(g_manager->_popupButtons)._buttons[0]._targetSlideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[0]._slideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[1]._targetSlideOffset = 96.0;
|
|
(manager->_popupButtons)._buttons[1]._slideOffset = 96.0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Leaderboard *>((GHIDRA_CAST<Leaderboard *>((this + 0xe9)))))->Leaderboard::update_input();
|
|
}
|
|
}
|
|
else {
|
|
local_48 = (Menu_DailyChallenge)0xe;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered == '\0') {
|
|
local_48 = (Menu_DailyChallenge)0xf;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered == '\0') goto LAB_008cfb19;
|
|
}
|
|
FUN_00837590();
|
|
}
|
|
LAB_008cfb19:
|
|
if ((this[0xea] == (Menu_DailyChallenge)0x0) &&
|
|
((this[0x5c] == (Menu_DailyChallenge)0x0 || (*GHIDRA_CAST<char *>((this + 0x60)) == '\0')))) {
|
|
local_48 = (Menu_DailyChallenge)0xf;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered != '\0') {
|
|
FUN_0098aec0();
|
|
}
|
|
}
|
|
animData = this[2];
|
|
while (((animData == (Menu_DailyChallenge)0x0 || (animData == (Menu_DailyChallenge)0x1)) &&
|
|
(*this == (Menu_DailyChallenge)0x3))) {
|
|
animData = (Menu_DailyChallenge)(GHIDRA_INT(animData) + 1);
|
|
this[2] = animData;
|
|
}
|
|
if ((animData == (Menu_DailyChallenge)0x2) && (*this == (Menu_DailyChallenge)0x2)) {
|
|
this[2] = (Menu_DailyChallenge)0x1;
|
|
}
|
|
local_48 = (Menu_DailyChallenge)0x16;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered == '\0') {
|
|
local_48 = (Menu_DailyChallenge)0x17;
|
|
isActionTriggered = (**(code **)(PTR_vftable_00c57b18 + 0x74))();
|
|
if (isActionTriggered == '\0') {
|
|
this[1] = (Menu_DailyChallenge)0x0;
|
|
goto LAB_008cfbf4;
|
|
}
|
|
}
|
|
this[1] = (Menu_DailyChallenge)(GHIDRA_INT(this[1]) + 1);
|
|
LAB_008cfbf4:
|
|
Leaderboard::Update();
|
|
FUN_008d0840();
|
|
if (*this != (Menu_DailyChallenge)0x0) {
|
|
get_server_time(serverTime);
|
|
if ((serverTime[0] & 2) != 0) {
|
|
serverTime64 = _mkgmtime64(&serverTm);
|
|
}
|
|
if ((serverTime[0] & 3) != 0) {
|
|
gmTime = _gmtime64(&serverTime64);
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_sec)) + 0x0))) = (char)gmTime->tm_sec;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_sec)) + 0x1))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_sec) + 1));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_sec)) + 0x2))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_sec) + 2));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_sec)) + 0x3))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_sec) + 3));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_min)) + 0x0))) = (char)gmTime->tm_min;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_min)) + 0x1))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_min) + 1));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_min)) + 0x2))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_min) + 2));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_min)) + 0x3))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_min) + 3));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_hour)) + 0x0))) = (char)gmTime->tm_hour;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_hour)) + 0x1))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_hour) + 1));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_hour)) + 0x2))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_hour) + 2));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_hour)) + 0x3))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_hour) + 3));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_mday)) + 0x0))) = (undefined1)gmTime->tm_mday;
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_mday)) + 0x1))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_mday) + 1));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_mday)) + 0x2))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_mday) + 2));
|
|
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(serverTm.tm_mday)) + 0x3))) = *GHIDRA_CAST<undefined1 *>((GHIDRA_INT(&gmTime->tm_mday) + 3));
|
|
serverTm.tm_mon = gmTime->tm_mon;
|
|
serverTm.tm_year = gmTime->tm_year;
|
|
serverTm.tm_wday = gmTime->tm_wday;
|
|
serverTm.tm_yday = gmTime->tm_yday;
|
|
serverTm.tm_isdst = gmTime->tm_isdst;
|
|
}
|
|
this[0x4b] = (Menu_DailyChallenge)(0x17 - (char)serverTm.tm_hour);
|
|
serverTime[0] = serverTime[0] & 0xfc;
|
|
this[0x4c] = (Menu_DailyChallenge)(0x3b - (char)serverTm.tm_min);
|
|
this[0x4d] = (Menu_DailyChallenge)(0x3b - (char)serverTm.tm_sec);
|
|
if (((this[0x4b] == (Menu_DailyChallenge)0x17) && (this[0x4c] == (Menu_DailyChallenge)0x3b)) &&
|
|
((Menu_DailyChallenge)(0x3b - (char)serverTm.tm_sec) == (Menu_DailyChallenge)0x3b)) {
|
|
*this = (Menu_DailyChallenge)0x0;
|
|
}
|
|
}
|
|
if (((*GHIDRA_CAST<char *>((this + 0x4e)) != '\0') &&
|
|
((this[0x5c] == (Menu_DailyChallenge)0x0 || (*GHIDRA_CAST<char *>((this + 0x60)) == '\0')))) &&
|
|
((this[0xa9] == (Menu_DailyChallenge)0x0 || (*GHIDRA_CAST<char *>((this + 0xad)) == '\0')))) {
|
|
this[0xea] = (Menu_DailyChallenge)0x0;
|
|
FUN_0098aec0();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 008cfd40
|
|
void Menu_DailyChallenge::Render()
|
|
{
|
|
Vector pos;
|
|
Vector pos_00;
|
|
uint uVar1;
|
|
byte *pbVar2;
|
|
uint animCompare;
|
|
LayerState *text2Layer;
|
|
float *scoreNullFrame;
|
|
void *settings;
|
|
AnimationState *secondAnimState;
|
|
byte *pbVar3;
|
|
KColor *color;
|
|
KColor *color_00;
|
|
KColor *color_01;
|
|
KColor *color_02;
|
|
KColor *color_03;
|
|
int iVar4;
|
|
Font *font;
|
|
bool bVar5;
|
|
float fVar6;
|
|
float fVar7;
|
|
FontSettings scoreFontSettings [5];
|
|
undefined4 local_48c;
|
|
undefined4 local_488;
|
|
float *playerNameNullFrame;
|
|
undefined4 local_480;
|
|
undefined4 local_47c;
|
|
KColor local_478;
|
|
Font *selectedFont;
|
|
FontSettings fontSettings;
|
|
undefined4 local_45c;
|
|
undefined4 local_458;
|
|
undefined4 local_454;
|
|
undefined4 local_450;
|
|
undefined4 local_44c;
|
|
undefined4 local_448;
|
|
float renderY;
|
|
float renderX;
|
|
short playerNameWide [512];
|
|
KColor local_3c;
|
|
undefined1 local_28 [16];
|
|
undefined *local_18;
|
|
uint local_14;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
Menu_DailyChallenge animName;
|
|
byte nameChar;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b05b94;
|
|
local_10 = ExceptionList;
|
|
uVar1 = __security_cookie ^ GHIDRA_UINT((local_28 + 0x24));
|
|
ExceptionList = &local_10;
|
|
selectedFont = &g_manager->_font2_TeamMeatEx12;
|
|
if (*GHIDRA_CAST<int *>(&g_manager->_stringTable) == 0) {
|
|
selectedFont = &g_manager->_font3_TeamMeatEx16;
|
|
}
|
|
font = selectedFont;
|
|
renderX = (g_menuManager->_ViewPosition).x + (float)this[3];
|
|
renderY = (g_menuManager->_ViewPosition).y + (float)this[4];
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_28)) + 0xc))) = renderX;
|
|
local_18 = GHIDRA_CAST<undefined *>(renderY);
|
|
local_14 = uVar1;
|
|
if ((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(this[0x47])) + 0x1))) != '\0') {
|
|
if (*GHIDRA_CAST<char *>((this + 0x21)) == '\0') {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((this + 0x11)),GHIDRA_CAST<Vector *>((local_28 + 0xc)),&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x19));
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(GHIDRA_CAST<AnimationState *>((this + 0x19)),GHIDRA_CAST<Vector *>((local_28 + 0xc)),&g_vectorZero,
|
|
&g_vectorZero);
|
|
secondAnimState = GHIDRA_CAST<AnimationState *>((this + 0x11));
|
|
}
|
|
AnimationState::Render(secondAnimState,GHIDRA_CAST<Vector *>((local_28 + 0xc)),&g_vectorZero,&g_vectorZero);
|
|
}
|
|
animName = this[0x12];
|
|
if (animName == (Menu_DailyChallenge)0x0) {
|
|
pbVar2 = &s_empty;
|
|
}
|
|
else {
|
|
pbVar2 = GHIDRA_CAST<byte *>(animName);
|
|
if (0xf < *GHIDRA_CAST<uint *>((GHIDRA_CAST<char *>(animName) + 0x14))) {
|
|
pbVar2 = *GHIDRA_CAST<byte **>(animName);
|
|
}
|
|
}
|
|
pbVar3 = s_Idle;
|
|
do {
|
|
nameChar = *pbVar2;
|
|
bVar5 = nameChar < *pbVar3;
|
|
if (nameChar != *pbVar3) {
|
|
LAB_008cfe70:
|
|
animCompare = -GHIDRA_UINT(bVar5) | 1;
|
|
goto LAB_008cfe75;
|
|
}
|
|
if (nameChar == 0) break;
|
|
nameChar = *GHIDRA_CAST<byte *>((GHIDRA_CAST<char *>(pbVar2) + 1));
|
|
bVar5 = nameChar < pbVar3[1];
|
|
if (nameChar != pbVar3[1]) goto LAB_008cfe70;
|
|
pbVar2 = GHIDRA_CAST<byte *>((GHIDRA_INT(pbVar2) + 2));
|
|
pbVar3 = pbVar3 + 2;
|
|
} while (nameChar != 0);
|
|
animCompare = 0;
|
|
LAB_008cfe75:
|
|
renderY = (float)local_18;
|
|
renderX = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&((float)local_28)) + 0xc)));
|
|
if (animCompare == 0) {
|
|
if ((animName != (Menu_DailyChallenge)0x0) &&
|
|
(playerNameNullFrame =
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x11)))))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("PlayerName")),
|
|
playerNameNullFrame != GHIDRA_CAST<float *>(0x0))) {
|
|
local_18 = g_userProfile;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_28)) + 0xc))) = KAGE::System::UserProfile::vftable;
|
|
local_8 = 0;
|
|
pbVar2 = GHIDRA_CAST<byte *>(FUN_00a5f1c0(uVar1));
|
|
local_8 = 0xffffffff;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_28)) + 0xc))) = KAGE::System::UserProfileBase::vftable;
|
|
if (pbVar2 == GHIDRA_CAST<byte *>(0x0)) {
|
|
iVar4 = 0;
|
|
}
|
|
else {
|
|
pbVar3 = pbVar2;
|
|
do {
|
|
nameChar = *pbVar3;
|
|
pbVar3 = pbVar3 + 1;
|
|
} while (nameChar != 0);
|
|
iVar4 = GHIDRA_INT(pbVar3) - GHIDRA_INT((pbVar2 + 1));
|
|
}
|
|
text_convert_encoding(pbVar2,iVar4,0,playerNameWide,0x200,1);
|
|
iVar4 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_utf16(playerNameWide,-1);
|
|
local_18 = (undefined *)
|
|
(175.0 / (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]));
|
|
if ((float)local_18 <= 0.0) {
|
|
local_18 = GHIDRA_CAST<undefined *>(0x0);
|
|
}
|
|
if (1.0 <= (float)local_18) {
|
|
local_18 = GHIDRA_CAST<undefined *>(0x3f800000);
|
|
}
|
|
uVar1 = __ftoui3();
|
|
local_480 = 0;
|
|
local_47c = 0xffff;
|
|
fVar6 = renderX + *playerNameNullFrame;
|
|
fVar7 = renderY + playerNameNullFrame[1];
|
|
local_478._red = 0.0;
|
|
local_478._green = 1.0;
|
|
local_478._blue = -NAN;
|
|
local_478._alpha = 0.0;
|
|
local_478._unk = 0;
|
|
local_8 = 1;
|
|
(GHIDRA_CAST<KColor *>((&local_3c)))->KColor::SetFromARGB(0xff362f2d);
|
|
Font::draw_string_wide
|
|
(font,playerNameWide,fVar6 - ((float)(uVar1 >> 1) + 0.0),fVar7 - 8.0,(float)local_18
|
|
,(float)local_18,color,&local_480);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
text2Layer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 5)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("Text2"));
|
|
if (text2Layer == GHIDRA_CAST<LayerState *>(0x0)) {
|
|
KAGE_LogMessage(4,GHIDRA_CAST<byte *>("[warn] no layer named %s\n"));
|
|
}
|
|
else {
|
|
iVar4 = FUN_0040a8a0(*GHIDRA_CAST<undefined4 *>(text2Layer->_layerData));
|
|
if (iVar4 == 0) {
|
|
if (this[0x12] == (Menu_DailyChallenge)0x0) goto LAB_008d033d;
|
|
scoreNullFrame =
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x11)))))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("Score"));
|
|
if (scoreNullFrame != GHIDRA_CAST<float *>(0x0)) {
|
|
sprintf_s(GHIDRA_CAST<byte *>(&local_3c._green),0x10,s__d);
|
|
iVar4 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(GHIDRA_CAST<byte *>(&local_3c._green),-1);
|
|
fVar6 = renderX + *scoreNullFrame;
|
|
fVar7 = renderY + scoreNullFrame[1];
|
|
(GHIDRA_CAST<FontSettings *>((scoreFontSettings)))->FontSettings::constructor();
|
|
local_8 = 2;
|
|
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(local_28))))->KColor::SetFromARGB(0xff362f2d);
|
|
font = selectedFont;
|
|
(GHIDRA_CAST<Font *>((selectedFont)))->Font::DrawString(GHIDRA_CAST<byte *>(&local_3c._green),color_00,settings,
|
|
fVar6 - (float)(iVar4 / 2),fVar7 - 8.0);
|
|
local_8 = 0xffffffff;
|
|
local_48c = 0;
|
|
local_488 = 0;
|
|
}
|
|
}
|
|
}
|
|
if (this[0x12] != (Menu_DailyChallenge)0x0) {
|
|
scoreNullFrame =
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x11)))))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("CurrentStreak"));
|
|
if (scoreNullFrame != GHIDRA_CAST<float *>(0x0)) {
|
|
local_18 = &DAT_00b75810;
|
|
pbVar2 = s__d;
|
|
if (GHIDRA_UINT((g_manager->_persistentGameData)._eventCounters[0xc0]) <
|
|
GHIDRA_UINT((g_manager->_persistentGameData)._eventCounters[0x20a])) {
|
|
pbVar2 = &DAT_00b75810;
|
|
}
|
|
sprintf_s(local_28 + 4,0x10,pbVar2);
|
|
(GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(local_28 + 4,-1);
|
|
fVar7 = renderX + *scoreNullFrame;
|
|
fVar6 = renderY + scoreNullFrame[1];
|
|
fontSettings = (FontSettings)0x0;
|
|
local_45c = 0xffff;
|
|
local_458 = 0;
|
|
local_454 = 0x3f800000;
|
|
local_450 = 0xffffffff;
|
|
local_44c = 0;
|
|
local_448 = 0;
|
|
local_8 = 3;
|
|
(GHIDRA_CAST<KColor *>((&local_478)))->KColor::SetFromARGB(0xff362f2d);
|
|
pos.y = fVar6;
|
|
pos.x = fVar7;
|
|
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(local_28 + 4,pos,(Vector)0x3f4000003f400000,color_01,&fontSettings);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
if ((this[0x12] != (Menu_DailyChallenge)0x0) &&
|
|
(scoreNullFrame =
|
|
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((this + 0x11)))))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("BestStreak")),
|
|
scoreNullFrame != GHIDRA_CAST<float *>(0x0))) {
|
|
sprintf_s(GHIDRA_CAST<byte *>(&local_3c._green),0x10,s__d);
|
|
(GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(GHIDRA_CAST<byte *>(&local_3c._green),-1);
|
|
fVar7 = renderX + *scoreNullFrame;
|
|
fVar6 = renderY + scoreNullFrame[1];
|
|
fontSettings = (FontSettings)0x0;
|
|
local_45c = 0xffff;
|
|
local_458 = 0;
|
|
local_454 = 0x3f800000;
|
|
local_450 = 0xffffffff;
|
|
local_44c = 0;
|
|
local_448 = 0;
|
|
local_8 = 4;
|
|
(GHIDRA_CAST<KColor *>((&local_478)))->KColor::SetFromARGB(0xff362f2d);
|
|
pos_00.y = fVar6;
|
|
pos_00.x = fVar7;
|
|
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(GHIDRA_CAST<byte *>(&local_3c._green),pos_00,(Vector)0x3f4000003f400000,color_02,
|
|
&fontSettings);
|
|
}
|
|
}
|
|
}
|
|
LAB_008d033d:
|
|
sprintf_s(GHIDRA_CAST<byte *>(&local_3c._blue),10,GHIDRA_CAST<byte *>("%02d:%02d:%02d"));
|
|
uVar1 = (GHIDRA_CAST<Font *>((font)))->Font::get_string_width_n(GHIDRA_CAST<byte *>(&local_3c._blue),-1);
|
|
fVar7 = renderY + 78.0;
|
|
fontSettings = (FontSettings)0x0;
|
|
local_45c = 0xffff;
|
|
local_458 = 0;
|
|
local_454 = 0x3f800000;
|
|
local_450 = 0xffffffff;
|
|
local_44c = 0;
|
|
local_448 = 0;
|
|
fVar6 = (398.0 - ((float)(uVar1 >> 1) + 0.0)) + renderX;
|
|
local_8 = 5;
|
|
(GHIDRA_CAST<KColor *>((&local_478)))->KColor::SetFromARGB(0xff362f2d);
|
|
(GHIDRA_CAST<Font *>((font)))->Font::DrawString(GHIDRA_CAST<byte *>(&local_3c._blue),color_03,&fontSettings,fVar6,fVar7);
|
|
local_8 = 0xffffffff;
|
|
(GHIDRA_CAST<GenericPopup *>((GHIDRA_CAST<GenericPopup *>((this + 0x4f)))))->GenericPopup::Render();
|
|
(GHIDRA_CAST<GenericPrompt *>((GHIDRA_CAST<GenericPrompt *>((this + 0x9c)))))->GenericPrompt::Render();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 008d0470
|
|
void Menu_DailyChallenge::load_graphics()
|
|
{
|
|
char *freeBlock;
|
|
undefined4 extraout_ECX;
|
|
uint freeSize;
|
|
std_string leaderboardPath;
|
|
std_string anm2Path;
|
|
uint local_24;
|
|
undefined1 *puStack_20;
|
|
void *local_1c;
|
|
undefined1 *puStack_18;
|
|
undefined4 local_14;
|
|
|
|
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b05bdd;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x30);
|
|
anm2Path._size = 0x23;
|
|
anm2Path._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/Menu_DailyRun.anm2",0x24);
|
|
local_14 = 0;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 5)))))->ANM2::Load(&anm2Path,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
freeSize = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
freeSize = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0xed)))))->ANM2::Reset();
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x132)))))->ANM2::Reset();
|
|
anm2Path._size = 0;
|
|
anm2Path._capacity = 0xf;
|
|
anm2Path._buf[0] = '\0';
|
|
anm2Path._buf[1] = '\0';
|
|
anm2Path._buf[2] = '\0';
|
|
anm2Path._buf[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
|
|
anm2Path._size = 0x15;
|
|
anm2Path._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/ScoreMenu.anm2",0x16);
|
|
local_14 = 1;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0xed)))))->ANM2::Load(&anm2Path,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < anm2Path._capacity) {
|
|
freeSize = anm2Path._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
|
freeSize = anm2Path._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
leaderboardPath._size = 0;
|
|
leaderboardPath._capacity = 0xf;
|
|
leaderboardPath._buf[0] = '\0';
|
|
leaderboardPath._buf[1] = '\0';
|
|
leaderboardPath._buf[2] = '\0';
|
|
leaderboardPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(leaderboardPath._buf)) + 0x0))) = std::_Allocate(0x20);
|
|
leaderboardPath._size = 0x1b;
|
|
leaderboardPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(leaderboardPath._buf))) + 0x0))),"gfx/ui/LeaderboardMenu.anm2",0x1c);
|
|
local_14 = 2;
|
|
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((this + 0x132)))))->ANM2::Load(&leaderboardPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < leaderboardPath._capacity) {
|
|
freeSize = leaderboardPath._capacity + 1;
|
|
freeBlock = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(leaderboardPath._buf))) + 0x0)));
|
|
if (0xfff < freeSize) {
|
|
freeBlock = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(leaderboardPath._buf)) + 0x0))) + -4));
|
|
freeSize = leaderboardPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(leaderboardPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(freeBlock))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(freeBlock,freeSize);
|
|
}
|
|
leaderboardPath._size = 0;
|
|
leaderboardPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(leaderboardPath._buf)) + 0x0))) = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(leaderboardPath._buf)) + 0x0))) & 0xffffff00;
|
|
FUN_008370f0();
|
|
FUN_00837740(extraout_ECX);
|
|
(GHIDRA_CAST<GenericPrompt *>((GHIDRA_CAST<GenericPrompt *>((this + 0x9c)))))->GenericPrompt::Initialize(0);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|