Seven agents took over LuaEngine (the mod API registration deferred), the rest of Manager (LoadConfigs, fonts, render surfaces, Update/Render), MusicManager/SFXManager, MenuManager with the title/save/game menus, Cutscene/NightmareScene/ Backdrop, RoomConfig (src/rooms ported and retired) with ItemPool, and PersistentGameData (the original binary save format) with InfoDisplay. An integration pass moved call sites to the new APIs, declared the taken-over free functions, fixed two data.cpp crashes (an empty children array, null attribute strings), and made the generator keep a header's own name where a prototype names another address. Clean build (0 warnings with -Wall -Wextra). build/isaac runs the game's Lua scripts (without the mod API yet) and stops at reload_resource_paths. 901 functions taken over, boot path 204/615. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2928 lines
118 KiB
C++
2928 lines
118 KiB
C++
#include "classes.h"
|
|
|
|
// 00630560
|
|
void Menu_Stats::Render(int param_2)
|
|
{
|
|
char cVar1;
|
|
uint8_t isHasCollectible;
|
|
LayerState *pLVar2;
|
|
Entity_Familiar *otherFamiliar;
|
|
Entity *ownOrbitParent;
|
|
float orbitDistanceIndex;
|
|
uint32_t uVar3;
|
|
Entity *pEVar4;
|
|
int iVar5;
|
|
ItemConfig_Item *itemConfig;
|
|
uint64_t *allocCounter;
|
|
float orbitCount;
|
|
float fVar6;
|
|
uint32_t uVar7;
|
|
char orbitList [4];
|
|
uint32_t orbitListData;
|
|
uint32_t orbitListCapacity;
|
|
uint32_t orbitListSize;
|
|
EntityList_EL familiars;
|
|
float local_5c;
|
|
int familiarsData;
|
|
uint32_t local_54;
|
|
AnimationState *local_50;
|
|
uint32_t local_4c;
|
|
float local_48;
|
|
char isFastOrbit;
|
|
uint32_t color;
|
|
uint32_t uStack_3c;
|
|
uint32_t uStack_38;
|
|
uint32_t uStack_34;
|
|
uint32_t local_30;
|
|
uint32_t uStack_2c;
|
|
uint32_t uStack_28;
|
|
uint32_t uStack_24;
|
|
uint32_t local_20;
|
|
uint32_t local_1c;
|
|
uint32_t local_18;
|
|
uint32_t local_14;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
uint64_t allocatedBytes;
|
|
AnimationState *childSlot;
|
|
uint32_t *flagsHigh;
|
|
Menu_Stats *listEntity;
|
|
int *oldChild;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af6e25;
|
|
local_10 = ExceptionList;
|
|
local_14 = __security_cookie ^ GHIDRA_UINT((orbitList + 0x78));
|
|
ExceptionList = &local_10;
|
|
this->_IconIDtoUseForAchievementID[0xa7] = *GHIDRA_CAST<int *>((param_2 + 0x2c));
|
|
this->_IconIDtoUseForAchievementID[0xa8] = 4;
|
|
this->_IconIDtoUseForAchievementID[0xa9] = 3;
|
|
this->_IconIDtoUseForAchievementID[0xaa] = 0x11;
|
|
this->_IconIDtoUseForAchievementID[10] = this->_IconIDtoUseForAchievementID[10] & 0xfffffffb;
|
|
this->_IconIDtoUseForAchievementID[0xb] = this->_IconIDtoUseForAchievementID[0xb];
|
|
*GHIDRA_CAST<uint32_t *>(((this->_achievementMiniSprite2)._filename._buf + 0xc)) =
|
|
*GHIDRA_CAST<uint32_t *>((param_2 + 0xc));
|
|
(this->_achievementMiniSprite2)._filename._size = *GHIDRA_CAST<uint32_t *>((param_2 + 0x10));
|
|
(this->_achievementMiniSprite2)._filename._capacity = *GHIDRA_CAST<uint32_t *>((param_2 + 0x14));
|
|
*GHIDRA_CAST<uint32_t *>((this->_achievementMiniSprite2)._animDefaultName._buf) =
|
|
*GHIDRA_CAST<uint32_t *>((param_2 + 0x18));
|
|
*GHIDRA_CAST<uint32_t *>(((this->_achievementMiniSprite2)._animDefaultName._buf + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((param_2 + 0x1c));
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((param_2 + 0x20));
|
|
(this->_achievementMiniSprite2)._animDefaultName._size = uVar7;
|
|
uVar3 = *GHIDRA_CAST<uint32_t *>((param_2 + 0x24));
|
|
(this->_achievementMiniSprite2)._animDefaultName._capacity = uVar3;
|
|
*GHIDRA_CAST<uint32_t *>(((this->_achievementMiniSprite2)._animDefaultName._buf + 8)) = uVar7;
|
|
*GHIDRA_CAST<uint32_t *>(((this->_achievementMiniSprite2)._animDefaultName._buf + 0xc)) = uVar3;
|
|
this->_IconIDtoUseForAchievementID[0x90] = *GHIDRA_CAST<int *>((param_2 + 0x28));
|
|
(this->_achievementMiniSprite2)._filename._buf[6] = *GHIDRA_CAST<char *>((param_2 + 0x30));
|
|
cVar1 = *GHIDRA_CAST<char *>((param_2 + 0x31));
|
|
(this->_achievementMiniSprite2)._filename._buf[7] = cVar1;
|
|
if (cVar1 != '\0') {
|
|
color = 0x3f800000;
|
|
uStack_3c = 0x3f800000;
|
|
uStack_38 = 0x3f800000;
|
|
uStack_34 = 0x3f800000;
|
|
local_30 = 0x3f800000;
|
|
uStack_2c = 0x3f800000;
|
|
uStack_28 = 0x3f800000;
|
|
uStack_24 = 0x3f800000;
|
|
local_20 = 0;
|
|
local_1c = 0;
|
|
local_18 = 0;
|
|
(**(code **)(this->_countTotalAchievements + 0x3c))(&color,0xffffffff,0xff,0,1,local_14);
|
|
}
|
|
if (((this->_StatsMenuSprite)._filename._size == 0xd8) &&
|
|
(0 < *GHIDRA_CAST<int *>((this->_achievementMiniSprite2)._animDefaultName._buf))) {
|
|
pLVar2 = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(&(this->_StatsMenuSprite)._animDefaultName._capacity),GHIDRA_CAST<uint8_t *>(0x0)
|
|
);
|
|
(pLVar2->_size).x = g_vectorZero.x;
|
|
(pLVar2->_size).y = g_vectorZero.y;
|
|
iVar5 = *GHIDRA_CAST<int *>((this->_achievementMiniSprite2)._filename._buf);
|
|
this->_IconIDtoUseForAchievementID[0x12] = 0;
|
|
this->_IconIDtoUseForAchievementID[7] = 0;
|
|
if (-1 < iVar5) {
|
|
(GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(this))))->Entity_Familiar::RecalculateOrbitOffset(iVar5,0);
|
|
(this->_achievementMiniSprite2)._filename._buf[0] = -1;
|
|
(this->_achievementMiniSprite2)._filename._buf[1] = -1;
|
|
(this->_achievementMiniSprite2)._filename._buf[2] = -1;
|
|
(this->_achievementMiniSprite2)._filename._buf[3] = -1;
|
|
}
|
|
}
|
|
if ((this->_StatsMenuSprite)._filename._size == 0xd3) {
|
|
if (*GHIDRA_CAST<int *>((this->_achievementMiniSprite2)._animDefaultName._buf) == 4) {
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this->_IconIDtoUseForAchievementID) + 0x31)) = 0;
|
|
ANM2::Play(GHIDRA_CAST<ANM2 *>(&(this->_StatsMenuSprite)._animDefaultName._capacity),GHIDRA_CAST<uint8_t *>("Death"),0);
|
|
if ((this->_StatsMenuSprite)._overlayAnimState._animFrame != 0.0) {
|
|
AnimationState::AdvancePosition
|
|
(GHIDRA_CAST<AnimationState *>(&(this->_StatsMenuSprite)._overlayAnimState._nullLayerFrames),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._overlayAnimState._animFrame) + 0x30)) + -1)
|
|
;
|
|
}
|
|
}
|
|
else if (0 < *GHIDRA_CAST<int *>(((this->_achievementMiniSprite2)._filename._buf + 0xc))) {
|
|
ANM2::PlayOverlay(GHIDRA_CAST<ANM2 *>(&(this->_StatsMenuSprite)._animDefaultName._capacity),
|
|
GHIDRA_CAST<uint8_t *>("Mantle"),0);
|
|
}
|
|
}
|
|
uVar7 = (this->_StatsMenuSprite)._filename._size;
|
|
if ((uVar7 == 0xce) || (uVar7 == 0xed)) {
|
|
if (*GHIDRA_CAST<int *>((param_2 + 0x1c)) < 0) {
|
|
fVar6 = *GHIDRA_CAST<float *>((this->_achievementMiniSprite2)._filename._buf);
|
|
local_5c = fVar6;
|
|
if (-1 < GHIDRA_INT(fVar6)) {
|
|
if ((this->_achievementMiniSprite2)._filename._buf[7] == '\0') {
|
|
if (((*GHIDRA_CAST<int *>(((this->_StatsMenuSprite)._filename._buf + 0xc)) == 3) && (uVar7 == 0xce)) &&
|
|
(((this->_StatsMenuSprite)._filename._capacity == 0x4d ||
|
|
((this->_StatsMenuSprite)._filename._capacity == 0x12a)))) {
|
|
isFastOrbit = '\x01';
|
|
}
|
|
else {
|
|
isFastOrbit = '\0';
|
|
}
|
|
EntityList::QuerySublist
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)),&familiars,3,-1,-1,0,0);
|
|
iVar5 = familiars._size;
|
|
local_8 = 0;
|
|
buffer_init(orbitList,familiars._size + 1);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
local_54 = 0;
|
|
familiarsData = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4)));
|
|
local_4c = orbitListData;
|
|
orbitCount = (float)orbitListSize;
|
|
if (iVar5 != 0) {
|
|
local_48 = (float)orbitListSize;
|
|
uVar7 = familiars._size;
|
|
do {
|
|
listEntity = *GHIDRA_CAST<Menu_Stats **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) + local_54 * 4));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(listEntity->_IconIDtoUseForAchievementID) + 0x32)) != '\0') {
|
|
if (listEntity != this) {
|
|
otherFamiliar =
|
|
(Entity_Familiar *)
|
|
__RTDynamicCast(listEntity,0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor,0
|
|
);
|
|
if ((float)otherFamiliar->_orbitLayer == fVar6) {
|
|
pEVar4 = (GHIDRA_CAST<Entity_Familiar *>((otherFamiliar)))->Entity_Familiar::get_orbit_parent();
|
|
ownOrbitParent = (GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(this))))->Entity_Familiar::get_orbit_parent();
|
|
fVar6 = local_48;
|
|
if (pEVar4 == ownOrbitParent) {
|
|
if (((otherFamiliar->_type == 3) && (otherFamiliar->_variant == 0xce)) &&
|
|
((otherFamiliar->_subtype == 0x4d || (otherFamiliar->_subtype == 0x12a))))
|
|
{
|
|
isFastOrbit = '\x01';
|
|
}
|
|
local_48 = (float)(GHIDRA_INT(local_48) + 1);
|
|
if (orbitListCapacity < GHIDRA_UINT(local_48)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EL: not enough space for push_back\n"));
|
|
}
|
|
*GHIDRA_CAST<Entity_Familiar **>((local_4c + GHIDRA_INT(fVar6) * 4)) = otherFamiliar;
|
|
fVar6 = local_5c;
|
|
orbitListSize = GHIDRA_UINT(local_48);
|
|
}
|
|
else {
|
|
fVar6 = local_5c;
|
|
}
|
|
}
|
|
uVar7 = familiars._size;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x4))) = familiarsData;
|
|
orbitCount = local_48;
|
|
}
|
|
}
|
|
local_54 = local_54 + 1;
|
|
} while (local_54 < uVar7);
|
|
}
|
|
local_48 = 1.0;
|
|
if (isFastOrbit != '\0') {
|
|
local_48 = 2.0;
|
|
}
|
|
isHasCollectible =
|
|
Entity_Player::HasCollectible
|
|
(GHIDRA_CAST<Entity_Player *>(this->_IconIDtoUseForAchievementID[0xb4]),0x117,0);
|
|
if (isHasCollectible != 0) {
|
|
local_48 = 0.33333334;
|
|
}
|
|
if (GHIDRA_INT(fVar6) < 1) {
|
|
fVar6 = 0.0;
|
|
}
|
|
orbitDistanceIndex = 1.4013e-44;
|
|
if (GHIDRA_INT(fVar6) < 10) {
|
|
orbitDistanceIndex = fVar6;
|
|
}
|
|
uVar7 = 0;
|
|
local_54 = GHIDRA_INT(orbitDistanceIndex) * 0x14;
|
|
if (orbitCount != 0.0) {
|
|
local_5c = (float)((double)GHIDRA_INT(orbitCount) +
|
|
__uint_to_double_fixup[-(GHIDRA_INT(orbitCount) >> 0x1f)]);
|
|
do {
|
|
local_50 = (AnimationState *)
|
|
__RTDynamicCast(*GHIDRA_CAST<uint32_t *>((local_4c + uVar7 * 4)),0,
|
|
&IsaacRepentancePlus::Entity::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::Entity_Familiar::RTTI_Type_Descriptor
|
|
,0);
|
|
local_50[0x6b]._animation = (void *)(((float)GHIDRA_INT(uVar7) * 6.2831855) / local_5c);
|
|
isHasCollectible =
|
|
Entity_Player::HasCollectible
|
|
(GHIDRA_CAST<Entity_Player *>(this->_IconIDtoUseForAchievementID[0xb4]),0x70,0);
|
|
if (isHasCollectible == 0) {
|
|
fVar6 = *GHIDRA_CAST<float *>((&DAT_00c34138 + local_54));
|
|
}
|
|
else {
|
|
fVar6 = *GHIDRA_CAST<float *>((&DAT_00c3413c + local_54)) * *GHIDRA_CAST<float *>((&DAT_00c34138 + local_54));
|
|
}
|
|
local_50[0x6b]._nullLayerFrames = (void *)(fVar6 * local_48);
|
|
if (local_50[1]._nullLayerFrames == &DAT_0000003c) {
|
|
local_50[0x6b]._nullLayerFrames = (void *)(fVar6 * local_48 * 3.0);
|
|
}
|
|
uVar7 = uVar7 + 1;
|
|
} while (uVar7 < GHIDRA_UINT(orbitCount));
|
|
}
|
|
if (orbitList[0] == '\0') {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
if (local_4c != 0) {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((local_4c - 4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar7;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar7));
|
|
free((void *)(local_4c - 4));
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if ((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(familiars)) + 0x0))) == '\0') {
|
|
allocCounter = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocCounter = &g_allocatedBytesNoHeap;
|
|
}
|
|
if (familiarsData != 0) {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((familiarsData + -4));
|
|
allocatedBytes = *allocCounter;
|
|
*GHIDRA_CAST<uint32_t *>(allocCounter) = GHIDRA_UINT(*allocCounter) - uVar7;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(allocatedBytes) < uVar7));
|
|
free((void *)(familiarsData + -4));
|
|
}
|
|
}
|
|
local_8 = 0xffffffff;
|
|
}
|
|
(this->_achievementMiniSprite2)._filename._buf[0] = -1;
|
|
(this->_achievementMiniSprite2)._filename._buf[1] = -1;
|
|
(this->_achievementMiniSprite2)._filename._buf[2] = -1;
|
|
(this->_achievementMiniSprite2)._filename._buf[3] = -1;
|
|
}
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(this))))->Entity_Familiar::AddToOrbit(*GHIDRA_CAST<int *>((param_2 + 0x1c)));
|
|
}
|
|
}
|
|
if ((((this->_StatsMenuSprite)._filename._size != 0xf1) ||
|
|
(this->_IconIDtoUseForAchievementID[0x90] = 0, *GHIDRA_CAST<float *>((param_2 + 0x28)) <= 0.0)) ||
|
|
(iVar5 = *GHIDRA_CAST<int *>((this->_achievementMiniSprite2)._animDefaultName._buf), iVar5 < 1))
|
|
goto LAB_00630bda;
|
|
uVar7 = 0;
|
|
local_4c = 0;
|
|
if (iVar5 == 1) {
|
|
local_4c = 0;
|
|
LAB_00630acd:
|
|
uVar7 = 0x322;
|
|
}
|
|
else if (iVar5 == 2) {
|
|
local_4c = 1;
|
|
goto LAB_00630acd;
|
|
}
|
|
oldChild = (this->_achievementMiniSprite2)._overlayAnimState._animation;
|
|
childSlot = &(this->_achievementMiniSprite2)._overlayAnimState;
|
|
if (oldChild != GHIDRA_CAST<int *>(0x0)) {
|
|
(**(code **)(*oldChild + 0x28))();
|
|
if (childSlot->_animation != (void *)0x0) {
|
|
local_50 = childSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_50);
|
|
}
|
|
childSlot->_animation = (void *)0x0;
|
|
}
|
|
if (uVar7 != 0) {
|
|
uVar3 = Random();
|
|
pEVar4 = (GHIDRA_CAST<Game *>((g_game)))->Game::SpawnEx(uVar7,local_4c,
|
|
GHIDRA_CAST<Vector *>((this->_IconIDtoUseForAchievementID + 0x7f)),&g_vectorZero,
|
|
GHIDRA_CAST<Entity *>(this->_IconIDtoUseForAchievementID[0xb4]),0,uVar3,0);
|
|
if (pEVar4->_parent != 0) {
|
|
local_50 = GHIDRA_CAST<AnimationState *>(&pEVar4->_parent);
|
|
msvc::multiset<unsigned_int>::erase(&local_50);
|
|
}
|
|
pEVar4->_parent = this;
|
|
msvc::multiset<unsigned_int>::insert(&pEVar4->_parent);
|
|
pEVar4->Update();
|
|
(pEVar4->_sprite)._flipX = (uint8_t)this->_IconIDtoUseForAchievementID[2];
|
|
fVar6 = *GHIDRA_CAST<float *>((param_2 + 0x28));
|
|
flagsHigh = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(&pEVar4->_flags) + 4));
|
|
*flagsHigh = *flagsHigh | 0x80;
|
|
pEVar4->_health = fVar6;
|
|
*GHIDRA_CAST<int *>(&pEVar4->_flags) = GHIDRA_INT(pEVar4->_flags);
|
|
(GHIDRA_CAST<EntityList *>((GHIDRA_CAST<EntityList *>((GHIDRA_INT(g_game->_room) + 0x1218)))))->EntityList::AddPersistentEntity(pEVar4);
|
|
if (childSlot->_animation != (void *)0x0) {
|
|
local_50 = childSlot;
|
|
msvc::multiset<unsigned_int>::erase(&local_50);
|
|
}
|
|
childSlot->_animation = pEVar4;
|
|
msvc::multiset<unsigned_int>::insert(childSlot);
|
|
}
|
|
LAB_00630bda:
|
|
uVar7 = (this->_StatsMenuSprite)._filename._size;
|
|
if (uVar7 == 0xec) {
|
|
this->_IconIDtoUseForAchievementID[0x90] =
|
|
*GHIDRA_CAST<int *>((this->_IconIDtoUseForAchievementID[0x7c] + 0x50));
|
|
(this->_achievementMiniSprite1)._bitflags = *GHIDRA_CAST<int *>((param_2 + 0x28));
|
|
}
|
|
else if (uVar7 == 0xe7) {
|
|
iVar5 = __RTDynamicCast((this->_achievementMiniSprite3)._overlayAnimState._nullLayerFrames,0,
|
|
&IsaacRepentancePlus::Entity_Familiar::ExtraData::RTTI_Type_Descriptor,
|
|
&IsaacRepentancePlus::AbyssLocustData::RTTI_Type_Descriptor,0);
|
|
Entity_Familiar::set_locust_config_index
|
|
(GHIDRA_CAST<Entity_Familiar *>(this),
|
|
*GHIDRA_CAST<uint32_t *>(((this->_achievementMiniSprite2)._filename._buf + 0xc)));
|
|
itemConfig = ItemConfig::GetCollectible
|
|
(&g_manager->_itemConfig,(this->_StatsMenuSprite)._filename._capacity);
|
|
*GHIDRA_CAST<ItemConfig_Item **>(&(this->_achievementMiniSprite3)._overlayAnimState._isPlaying) = itemConfig;
|
|
*GHIDRA_CAST<uint8_t *>((iVar5 + 0x50)) = *GHIDRA_CAST<uint8_t *>((param_2 + 0x1c));
|
|
(GHIDRA_CAST<Entity_Familiar *>((GHIDRA_CAST<Entity_Familiar *>(this))))->Entity_Familiar::load_config_graphics();
|
|
}
|
|
(**(code **)(this->_countTotalAchievements + 0xc))();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009ec1d0
|
|
Menu_Stats::~Menu_Stats()
|
|
{
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00af0b40;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
_eh_vector_destructor_iterator_(this->_achievementOverlayEntries,0x34,0x282,FUN_00420b00);
|
|
_eh_vector_destructor_iterator_(&this->_achievementMiniSprite1,0x114,0xb,ANM2::~ANM2);
|
|
local_8 = 0;
|
|
ANM2::Reset(&this->_achievementsSprite);
|
|
AnimationState::~AnimationState(&(this->_achievementsSprite)._overlayAnimState);
|
|
AnimationState::~AnimationState(&(this->_achievementsSprite)._animState);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_achievementsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_achievementsSprite))))->msvc::string::_Tidy_deallocate();
|
|
local_8 = 1;
|
|
ANM2::Reset(&this->_StatsMenuSprite);
|
|
AnimationState::~AnimationState(&(this->_StatsMenuSprite)._overlayAnimState);
|
|
AnimationState::~AnimationState(&(this->_StatsMenuSprite)._animState);
|
|
(GHIDRA_CAST<msvc::string *>(((this->_StatsMenuSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(&this->_StatsMenuSprite))))->msvc::string::_Tidy_deallocate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009ec600
|
|
void Menu_Stats::unload_graphics()
|
|
{
|
|
uint32_t *ptr;
|
|
uint32_t *fileNameChars;
|
|
std_string *animName;
|
|
int spritesLeft;
|
|
uint32_t *spriteFields;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
void *layerStates;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b05a30;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
ANM2::Reset(&this->_StatsMenuSprite);
|
|
ANM2::Reset(&this->_achievementsSprite);
|
|
spriteFields = &(this->_achievementMiniSprite1)._animDefaultName._size;
|
|
spritesLeft = 0xb;
|
|
do {
|
|
if (spriteFields[-6] != 0) {
|
|
AnmCache::RemoveRef(GHIDRA_CAST<std_string *>((spriteFields + -10)));
|
|
}
|
|
fileNameChars = spriteFields + -10;
|
|
if (0xf < spriteFields[-5]) {
|
|
fileNameChars = GHIDRA_CAST<uint32_t *>(*fileNameChars);
|
|
}
|
|
spriteFields[-6] = 0;
|
|
*GHIDRA_CAST<uint8_t *>(fileNameChars) = 0;
|
|
AnimationState::SetAnimationData(GHIDRA_CAST<AnimationState *>((spriteFields + 2)),(void *)0x0);
|
|
AnimationState::SetAnimationData(GHIDRA_CAST<AnimationState *>((spriteFields + 10)),(void *)0x0);
|
|
animName = GHIDRA_CAST<std_string *>((spriteFields + -4));
|
|
if (0xf < spriteFields[1]) {
|
|
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
|
|
}
|
|
*spriteFields = 0;
|
|
animName->_buf[0] = '\0';
|
|
layerStates = (void *)spriteFields[0x15];
|
|
spriteFields[0x13] = 0;
|
|
spriteFields[0x14] = 0;
|
|
if (layerStates != (void *)0x0) {
|
|
ptr = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(layerStates) + -4));
|
|
local_8 = 0;
|
|
_eh_vector_destructor_iterator_(layerStates,0xa0,*ptr,LayerState::~LayerState);
|
|
operator_delete(ptr,*ptr * 0xa0 + 4);
|
|
local_8 = 0xffffffff;
|
|
}
|
|
spriteFields[0x15] = 0;
|
|
spriteFields[0x16] = 0;
|
|
spriteFields[0x17] = 0;
|
|
spriteFields[0x18] = 0;
|
|
spriteFields[0x19] = 0;
|
|
spriteFields[0x1a] = 0;
|
|
spriteFields[0x1b] = GHIDRA_UINT(g_vectorZero.x);
|
|
spriteFields[0x1c] = GHIDRA_UINT(g_vectorZero.y);
|
|
spriteFields[0x1d] = GHIDRA_UINT(g_vectorOne.x);
|
|
spriteFields[0x1e] = GHIDRA_UINT(g_vectorOne.y);
|
|
spriteFields[0x1f] = 0;
|
|
spriteFields[0x20] = 0x3f800000;
|
|
spriteFields[0x21] = 0x3f800000;
|
|
spriteFields[0x22] = 0x3f800000;
|
|
spriteFields[0x23] = 0x3f800000;
|
|
spriteFields[0x24] = 0;
|
|
spriteFields[0x25] = 0;
|
|
spriteFields[0x26] = 0;
|
|
spriteFields[0x27] = 0;
|
|
spriteFields[0x28] = 0;
|
|
spriteFields[0x29] = 0;
|
|
spriteFields[0x2a] = 0;
|
|
spriteFields[0x2f] = 0;
|
|
spriteFields[0x30] = 0;
|
|
spriteFields[0x31] = 0;
|
|
spriteFields[0x32] = 0;
|
|
spriteFields[0x33] = 0;
|
|
spriteFields[0x34] = 0;
|
|
spriteFields[0x35] = 0;
|
|
spriteFields[0x2b] = 0x3f800000;
|
|
spriteFields[0x2c] = 0x3f800000;
|
|
spriteFields[0x2d] = 0x3f800000;
|
|
spriteFields[0x2e] = 0;
|
|
*GHIDRA_CAST<uint16_t *>((spriteFields + 0x36)) = 0;
|
|
spriteFields[0x37] = 0x3f800000;
|
|
*GHIDRA_CAST<uint16_t *>((spriteFields + 0x38)) = 0;
|
|
*GHIDRA_CAST<uint8_t *>((spriteFields + 0x12)) = 0;
|
|
spriteFields[0x39] = 0xffffffff;
|
|
spriteFields[0x3a] = 0;
|
|
spriteFields = spriteFields + 0x45;
|
|
spritesLeft = spritesLeft + -1;
|
|
} while (spritesLeft != 0);
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009ec880
|
|
void Menu_Stats::LoadGraphics()
|
|
{
|
|
uint8_t bVar1;
|
|
uint8_t *currentAnimName;
|
|
char *pcVar2;
|
|
uint32_t uVar3;
|
|
void **miniSpriteAnimData;
|
|
bool isLess;
|
|
int miniSpriteIndex;
|
|
std_string componentsPath;
|
|
std_string anmPath;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint8_t *currentAnim;
|
|
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(register0x00000010) + -4));
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0fd1d;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
|
ExceptionList = &local_1c;
|
|
anmPath._size = 0;
|
|
anmPath._capacity = 0xf;
|
|
anmPath._buf[0] = '\0';
|
|
anmPath._buf[1] = '\0';
|
|
anmPath._buf[2] = '\0';
|
|
anmPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anmPath._size = 0x1f;
|
|
anmPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0))),"gfx/ui/main menu/StatsMenu.anm2",0x20);
|
|
local_14 = 0;
|
|
ANM2::Load(&this->_StatsMenuSprite,&anmPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < anmPath._capacity) {
|
|
uVar3 = anmPath._capacity + 1;
|
|
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + -4));
|
|
uVar3 = anmPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
|
|
LAB_009ec971:
|
|
local_14 = 0xffffffff;
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar2,uVar3);
|
|
}
|
|
anmPath._size = 0;
|
|
anmPath._capacity = 0xf;
|
|
anmPath._buf[0] = '\0';
|
|
anmPath._buf[1] = '\0';
|
|
anmPath._buf[2] = '\0';
|
|
anmPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
anmPath._size = 0x24;
|
|
anmPath._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0))),"gfx/ui/achievement/achievements.anm2",0x25);
|
|
local_14 = 1;
|
|
ANM2::Load(&this->_achievementsSprite,&anmPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < anmPath._capacity) {
|
|
uVar3 = anmPath._capacity + 1;
|
|
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + -4));
|
|
uVar3 = anmPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar2,uVar3);
|
|
}
|
|
miniSpriteIndex = 0;
|
|
miniSpriteAnimData = &(this->_achievementMiniSprite1)._animState._animData;
|
|
do {
|
|
componentsPath._size = 0;
|
|
componentsPath._capacity = 0xf;
|
|
componentsPath._buf[0] = '\0';
|
|
componentsPath._buf[1] = '\0';
|
|
componentsPath._buf[2] = '\0';
|
|
componentsPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(componentsPath._buf)) + 0x0))) = msvc::_Allocate(0x30);
|
|
componentsPath._size = 0x2b;
|
|
componentsPath._capacity = 0x2f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(componentsPath._buf))) + 0x0))),"gfx/ui/main menu/SecretsMenuComponents.anm2",
|
|
0x2c);
|
|
local_14 = 2;
|
|
ANM2::Load(GHIDRA_CAST<ANM2 *>((miniSpriteAnimData + -0xd)),&componentsPath,1);
|
|
local_14 = 0xffffffff;
|
|
if (0xf < componentsPath._capacity) {
|
|
uVar3 = componentsPath._capacity + 1;
|
|
pcVar2 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(componentsPath._buf))) + 0x0)));
|
|
if (0xfff < uVar3) {
|
|
pcVar2 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(componentsPath._buf)) + 0x0))) + -4));
|
|
uVar3 = componentsPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(componentsPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar2)))))
|
|
goto LAB_009ec971;
|
|
}
|
|
operator_delete(pcVar2,uVar3);
|
|
}
|
|
componentsPath._size = 0;
|
|
componentsPath._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(componentsPath._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(componentsPath._buf)) + 0x0))) & 0xffffff00;
|
|
if (miniSpriteIndex < 9) {
|
|
currentAnim = *miniSpriteAnimData;
|
|
if (currentAnim != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
currentAnimName = currentAnim;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((currentAnim + 0x14))) {
|
|
currentAnimName = *GHIDRA_CAST<uint8_t **>(currentAnim);
|
|
}
|
|
pcVar2 = "Icon1Unlocked";
|
|
do {
|
|
bVar1 = *currentAnimName;
|
|
isLess = bVar1 < (uint8_t)*pcVar2;
|
|
if (bVar1 != *pcVar2) {
|
|
LAB_009ecb50:
|
|
uVar3 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009ecb55;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentAnimName[1];
|
|
isLess = bVar1 < (uint8_t)pcVar2[1];
|
|
if (bVar1 != pcVar2[1]) goto LAB_009ecb50;
|
|
currentAnimName = currentAnimName + 2;
|
|
pcVar2 = pcVar2 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar3 = 0;
|
|
LAB_009ecb55:
|
|
if ((uVar3 == 0) && ((currentAnim[0x34] == 0 || (*GHIDRA_CAST<uint8_t *>((miniSpriteAnimData + 4)) != 0))))
|
|
goto LAB_009ecb85;
|
|
}
|
|
bVar1 = ANM2::SetAnimation(GHIDRA_CAST<ANM2 *>((miniSpriteAnimData + -0xd)),GHIDRA_CAST<uint8_t *>("Icon1Unlocked"),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(GHIDRA_CAST<AnimationState *>((miniSpriteAnimData + -1)));
|
|
*GHIDRA_CAST<uint8_t *>((miniSpriteAnimData + 4)) = 1;
|
|
}
|
|
}
|
|
LAB_009ecb85:
|
|
miniSpriteIndex = miniSpriteIndex + 1;
|
|
miniSpriteAnimData = miniSpriteAnimData + 0x45;
|
|
if (10 < miniSpriteIndex) {
|
|
reset_state(this);
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 009ecbc0
|
|
void Menu_Stats::Update()
|
|
{
|
|
int layerId;
|
|
int iVar1;
|
|
uint32_t achievementId;
|
|
float targetFrame;
|
|
void *animPtr;
|
|
Game *game;
|
|
Manager *manager;
|
|
|
|
if (((g_manager->_framecount & 1) == 0) && ((this->_StatsMenuSprite)._loaded != 0)) {
|
|
AnimationState::Update(&(this->_StatsMenuSprite)._animState);
|
|
AnimationState::Update(&(this->_StatsMenuSprite)._overlayAnimState);
|
|
}
|
|
manager = g_manager;
|
|
this->_countItemsInCollection = 0;
|
|
iVar1 = 0;
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT((manager->_persistentGameData)._eventCounters) + iVar1 + 0x82c)) != '\0') {
|
|
this->_countItemsInCollection = this->_countItemsInCollection + 1;
|
|
}
|
|
game = g_game;
|
|
iVar1 = iVar1 + 1;
|
|
} while (iVar1 < 0x2dd);
|
|
achievementId = 0;
|
|
this->_countTotalAchievements = 0;
|
|
do {
|
|
if (((this->_achievementOverlayEntries[achievementId]._id == achievementId) &&
|
|
(achievementId < 0x282)) &&
|
|
(((achievementId == 0 || ((manager->_persistentGameData)._achievements[achievementId] != 0))
|
|
|| (((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>((manager)) + 0x8)))) == 2 && (game != GHIDRA_CAST<Game *>(0x0))) &&
|
|
(((game->_dailyChallenge)._id != 0 || (game->_isDebug != 0)))))))) {
|
|
this->_countTotalAchievements = this->_countTotalAchievements + 1;
|
|
}
|
|
achievementId = achievementId + 1;
|
|
} while (GHIDRA_INT(achievementId) < 0x282);
|
|
this->_countDeaths = (manager->_persistentGameData)._eventCounters[10];
|
|
this->_countMomKills = (manager->_persistentGameData)._eventCounters[1];
|
|
if ((this->_StatsMenuSprite)._animState._animData != (void *)0x0) {
|
|
animPtr = (this->_StatsMenuSprite)._animState._animation;
|
|
if (this->_countTotalAchievements < 1) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x80)) < 9) &&
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._animation) + 0x80)) < 9))
|
|
goto LAB_009ecd3e;
|
|
animPtr = (this->_StatsMenuSprite)._animState._animData;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x58));
|
|
if ((animPtr == (void *)0x0) || ((iVar1 < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x1c)) <= iVar1)))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
targetFrame = 1.0;
|
|
}
|
|
else {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x80)) < 9) &&
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._animation) + 0x80)) < 9))
|
|
goto LAB_009ecd3e;
|
|
animPtr = (this->_StatsMenuSprite)._animState._animData;
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x58));
|
|
if ((animPtr == (void *)0x0) || ((iVar1 < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x1c)) <= iVar1)))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
targetFrame = 0.0;
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._layerFrames) + iVar1 * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition(&(this->_StatsMenuSprite)._animState,iVar1,targetFrame);
|
|
}
|
|
LAB_009ecd3e:
|
|
if (this->_isAchievementScreenVisible == 0) {
|
|
update_stats_screen(this);
|
|
}
|
|
else {
|
|
update_achievements(this);
|
|
}
|
|
iVar1 = this->_statsMenuCurrentSelection;
|
|
if ((this->_StatsMenuSprite)._animState._animData != (void *)0x0) {
|
|
if ((*GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._animation) + 0x80)) < 5) &&
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._animation) + 0x80)) < 5)) {
|
|
return;
|
|
}
|
|
animPtr = (this->_StatsMenuSprite)._animState._animData;
|
|
layerId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x48));
|
|
if (((animPtr == (void *)0x0) || (layerId < 0)) || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animPtr) + 0x1c)) <= layerId)) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._layerFrames) + layerId * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition(&(this->_StatsMenuSprite)._animState,layerId,(float)iVar1);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// 009ecdd0
|
|
void Menu_Stats::Render()
|
|
{
|
|
Vector position;
|
|
Vector position_00;
|
|
Vector position_01;
|
|
Vector position_02;
|
|
Vector position_03;
|
|
Vector position_04;
|
|
Manager *pMVar1;
|
|
MenuManager *pMVar2;
|
|
float fVar3;
|
|
LayerState *hiddenLayer;
|
|
void *quad;
|
|
int iVar4;
|
|
AnimationState *secondAnimState;
|
|
AnimationState *animState;
|
|
float y;
|
|
uint8_t quadBuffer [112];
|
|
KColor color;
|
|
uint32_t fontParams;
|
|
uint32_t local_70;
|
|
uint32_t local_6c;
|
|
uint32_t local_68;
|
|
uint32_t local_64;
|
|
uint32_t local_60;
|
|
uint32_t local_5c;
|
|
Vector local_58;
|
|
Vector local_50;
|
|
float menuY;
|
|
Vector local_44;
|
|
float numberX;
|
|
float numberY;
|
|
uint8_t countText [16];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
|
|
puStack_20 = countText + 0x30;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0fd5d;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((countText + 0x24));
|
|
ExceptionList = &local_1c;
|
|
local_58.y = (g_menuManager->_ViewPosition).x + this->_PositionX;
|
|
local_50.y = (g_menuManager->_ViewPosition).y + this->_PositionY;
|
|
local_50.x = local_58.y;
|
|
menuY = local_50.y;
|
|
local_44.y = (float)this;
|
|
hiddenLayer = ANM2::GetLayer(&this->_StatsMenuSprite,&DAT_00000007);
|
|
hiddenLayer->_visible = 0;
|
|
if ((this->_StatsMenuSprite)._loaded != 0) {
|
|
if ((this->_StatsMenuSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(this->_StatsMenuSprite)._animState,&local_50,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render
|
|
(&(this->_StatsMenuSprite)._overlayAnimState,&local_50,&g_vectorZero,&g_vectorZero);
|
|
menuY = local_50.y;
|
|
local_58.y = local_50.x;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(this->_StatsMenuSprite)._overlayAnimState,&local_50,&g_vectorZero,&g_vectorZero);
|
|
AnimationState::Render
|
|
(&(this->_StatsMenuSprite)._animState,&local_50,&g_vectorZero,&g_vectorZero);
|
|
menuY = local_50.y;
|
|
local_58.y = local_50.x;
|
|
}
|
|
}
|
|
numberY = menuY + 5.0;
|
|
local_50.y = local_58.y + 40.0;
|
|
position.y = numberY;
|
|
position.x = local_50.y;
|
|
numberX = local_50.y;
|
|
render_number(this,this->_countDeaths,position);
|
|
numberY = menuY + 27.0;
|
|
numberX = local_50.y;
|
|
position_00.y = numberY;
|
|
position_00.x = local_50.y;
|
|
render_number(this,this->_countItemsInCollection,position_00);
|
|
numberY = menuY + 49.0;
|
|
numberX = local_50.y;
|
|
position_01.y = numberY;
|
|
position_01.x = local_50.y;
|
|
render_number(this,this->_countMomKills,position_01);
|
|
numberY = menuY + 71.0;
|
|
numberX = local_50.y;
|
|
position_02.y = numberY;
|
|
position_02.x = local_50.y;
|
|
render_number(this,this->_countTotalAchievements,position_02);
|
|
numberY = menuY + 93.0;
|
|
numberX = local_50.y;
|
|
position_03.y = numberY;
|
|
position_03.x = local_50.y;
|
|
render_number(this,(g_manager->_persistentGameData)._eventCounters[0x17],position_03);
|
|
numberY = menuY + 115.0;
|
|
numberX = local_50.y;
|
|
position_04.y = numberY;
|
|
position_04.x = local_50.y;
|
|
render_number(this,(g_manager->_persistentGameData)._eventCounters[0x1f2],position_04);
|
|
if (this->_isAchievementScreenVisible != 0) {
|
|
color._red = 0.0;
|
|
color._green = 0.0;
|
|
color._blue = 0.0;
|
|
color._alpha = 0.5;
|
|
color._unk = 0;
|
|
quad = render_quad_set_uniform_color(quadBuffer,0.0,0.0,g_screenWidth,g_screenHeight,&color);
|
|
render_color_shader_pass(quad);
|
|
local_58.x = local_58.y + 240.0;
|
|
local_58.y = menuY + 135.0;
|
|
if ((this->_achievementsSprite)._loaded != 0) {
|
|
if ((this->_achievementsSprite)._overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(this->_achievementsSprite)._animState,&local_58,&g_vectorZero,&g_vectorZero);
|
|
animState = &(this->_achievementsSprite)._overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(this->_achievementsSprite)._overlayAnimState,&local_58,&g_vectorZero,
|
|
&g_vectorZero);
|
|
animState = &(this->_achievementsSprite)._animState;
|
|
}
|
|
AnimationState::Render(animState,&local_58,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
sprintf_s(countText,0x10,GHIDRA_CAST<uint8_t *>("%d/%d"));
|
|
pMVar2 = g_menuManager;
|
|
pMVar1 = g_manager;
|
|
fontParams = 0;
|
|
local_70 = 0xffff;
|
|
local_6c = 0;
|
|
local_68 = 0x3f800000;
|
|
local_64 = 0xffffffff;
|
|
local_60 = 0;
|
|
local_5c = 0;
|
|
local_14 = 0;
|
|
color._unk = 0;
|
|
color._red = 0.8;
|
|
color._green = 0.8;
|
|
color._blue = 0.8;
|
|
color._alpha = 1.0;
|
|
y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_44.y) + 0x18)) + 30.0;
|
|
iVar4 = Font::get_string_width_n(&g_manager->_font1_TeamMeatEx10,countText,-1);
|
|
fVar3 = local_44.y;
|
|
Font::DrawString(&pMVar1->_font1_TeamMeatEx10,countText,&color,&fontParams,
|
|
((pMVar2->_ViewPosition).x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(local_44.y) + 0x14)) + 240.0) -
|
|
(float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * 0.5,y);
|
|
local_14 = 0xffffffff;
|
|
local_58.y = 0.0;
|
|
animState = &(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0xc5c)))->_animState;
|
|
do {
|
|
local_44.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x18)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x134));
|
|
local_44.x = (float)GHIDRA_INT(local_58.y) * 35.0 + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x138)) + 100.0 +
|
|
(g_menuManager->_ViewPosition).x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x14));
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&animState[6]._currentlyTriggeredEvents) + 1)) != '\0') {
|
|
if (*GHIDRA_CAST<char *>(&animState[2]._animation) == '\0') {
|
|
AnimationState::Render(animState,&local_44,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = animState + 1;
|
|
}
|
|
else {
|
|
AnimationState::Render(animState + 1,&local_44,&g_vectorZero,&g_vectorZero);
|
|
secondAnimState = animState;
|
|
}
|
|
AnimationState::Render(secondAnimState,&local_44,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
local_58.y = (float)(GHIDRA_INT(local_58.y) + 1);
|
|
animState = GHIDRA_CAST<AnimationState *>(&animState[8]._isPlaying);
|
|
} while (GHIDRA_INT(local_58.y) < 9);
|
|
local_44.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x14)) + 95.0;
|
|
local_44.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x18)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x134));
|
|
if ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1610)))->_loaded != 0) {
|
|
if ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1610)))->_overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1610)))->_animState,&local_44,&g_vectorZero,
|
|
&g_vectorZero);
|
|
animState = &(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1610)))->_overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1610)))->_overlayAnimState,&local_44,&g_vectorZero,
|
|
&g_vectorZero);
|
|
animState = &(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1610)))->_animState;
|
|
}
|
|
AnimationState::Render(animState,&local_44,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
local_44.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x14)) + 380.0;
|
|
local_44.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x18)) +
|
|
*GHIDRA_CAST<float *>((GHIDRA_CAST<char *>(fVar3) + 0x134));
|
|
if ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1724)))->_loaded != 0) {
|
|
if ((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1724)))->_overlayRenderFirst == 0) {
|
|
AnimationState::Render
|
|
(&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1724)))->_animState,&local_44,&g_vectorZero,
|
|
&g_vectorZero);
|
|
animState = &(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1724)))->_overlayAnimState;
|
|
}
|
|
else {
|
|
AnimationState::Render
|
|
(&(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1724)))->_overlayAnimState,&local_44,&g_vectorZero,
|
|
&g_vectorZero);
|
|
animState = &(GHIDRA_CAST<ANM2 *>((GHIDRA_INT(fVar3) + 0x1724)))->_animState;
|
|
}
|
|
AnimationState::Render(animState,&local_44,&g_vectorZero,&g_vectorZero);
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009ed3c0
|
|
void Menu_Stats::reset_state()
|
|
{
|
|
uint8_t bVar1;
|
|
uint8_t *currentAnimName;
|
|
uint32_t uVar2;
|
|
LayerState *achievementsLayer;
|
|
uint8_t *idleName;
|
|
char *cursorAnimName;
|
|
int iconsLeft;
|
|
int *iconId;
|
|
bool isLess;
|
|
uint8_t *animData;
|
|
|
|
animData = (this->_StatsMenuSprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_009ed415:
|
|
bVar1 = ANM2::SetAnimation(&this->_StatsMenuSprite,s_Idle,1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_StatsMenuSprite)._animState);
|
|
(this->_StatsMenuSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
currentAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
currentAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
idleName = s_Idle;
|
|
do {
|
|
bVar1 = *currentAnimName;
|
|
isLess = bVar1 < *idleName;
|
|
if (bVar1 != *idleName) {
|
|
LAB_009ed402:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009ed407;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentAnimName[1];
|
|
isLess = bVar1 < idleName[1];
|
|
if (bVar1 != idleName[1]) goto LAB_009ed402;
|
|
currentAnimName = currentAnimName + 2;
|
|
idleName = idleName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ed407:
|
|
if ((uVar2 != 0) ||
|
|
((animData[0x34] != 0 && ((this->_StatsMenuSprite)._animState._isPlaying == 0))))
|
|
goto LAB_009ed415;
|
|
}
|
|
achievementsLayer = ANM2::GetLayer(&this->_achievementsSprite,GHIDRA_CAST<uint8_t *>(0x0));
|
|
achievementsLayer->_visible = 0;
|
|
animData = (this->_cursorLeftSprite)._animState._animData;
|
|
if (animData == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_009ed496:
|
|
bVar1 = ANM2::SetAnimation(&this->_cursorLeftSprite,GHIDRA_CAST<uint8_t *>("CursorLeft"),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_cursorLeftSprite)._animState);
|
|
(this->_cursorLeftSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
currentAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
currentAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
cursorAnimName = "CursorLeft";
|
|
do {
|
|
bVar1 = *currentAnimName;
|
|
isLess = bVar1 < (uint8_t)*cursorAnimName;
|
|
if (bVar1 != *cursorAnimName) {
|
|
LAB_009ed480:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009ed485;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentAnimName[1];
|
|
isLess = bVar1 < (uint8_t)cursorAnimName[1];
|
|
if (bVar1 != cursorAnimName[1]) goto LAB_009ed480;
|
|
currentAnimName = currentAnimName + 2;
|
|
cursorAnimName = cursorAnimName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ed485:
|
|
if ((uVar2 != 0) ||
|
|
((animData[0x34] != 0 && ((this->_cursorLeftSprite)._animState._isPlaying == 0))))
|
|
goto LAB_009ed496;
|
|
}
|
|
animData = (this->_cursorRightSprite)._animState._animData;
|
|
if (animData != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
currentAnimName = animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((animData + 0x14))) {
|
|
currentAnimName = *GHIDRA_CAST<uint8_t **>(animData);
|
|
}
|
|
cursorAnimName = "CursorRight";
|
|
do {
|
|
bVar1 = *currentAnimName;
|
|
isLess = bVar1 < (uint8_t)*cursorAnimName;
|
|
if (bVar1 != *cursorAnimName) {
|
|
LAB_009ed4f7:
|
|
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
|
goto LAB_009ed4fc;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = currentAnimName[1];
|
|
isLess = bVar1 < (uint8_t)cursorAnimName[1];
|
|
if (bVar1 != cursorAnimName[1]) goto LAB_009ed4f7;
|
|
currentAnimName = currentAnimName + 2;
|
|
cursorAnimName = cursorAnimName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ed4fc:
|
|
if ((uVar2 == 0) &&
|
|
((animData[0x34] == 0 || ((this->_cursorRightSprite)._animState._isPlaying != 0))))
|
|
goto LAB_009ed535;
|
|
}
|
|
bVar1 = ANM2::SetAnimation(&this->_cursorRightSprite,GHIDRA_CAST<uint8_t *>("CursorRight"),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_cursorRightSprite)._animState);
|
|
(this->_cursorRightSprite)._animState._isPlaying = 1;
|
|
}
|
|
LAB_009ed535:
|
|
iconsLeft = 0x282;
|
|
iconId = this->_IconIDtoUseForAchievementID;
|
|
do {
|
|
uVar2 = Random();
|
|
*iconId = uVar2 % 3 + 1;
|
|
iconsLeft = iconsLeft + -1;
|
|
iconId = iconId + 1;
|
|
} while (iconsLeft != 0);
|
|
this->_countTotalAchievements = 0;
|
|
this->_countItemsInCollection = 0;
|
|
this->_countDeaths = 0;
|
|
this->_countMomKills = 0;
|
|
this->_statsMenuCurrentSelection = 0;
|
|
this->_isAchievementScreenVisible = 0;
|
|
this->_achievementScrollInPosition = 275.0;
|
|
this->_achievementScrollThruListPosition = 0.0;
|
|
load_achievements_xml(this);
|
|
this->_holdInputTimer = 0;
|
|
return;
|
|
}
|
|
|
|
// 009ed5a0
|
|
int Menu_Stats::render_number(uint32_t value, Vector position)
|
|
{
|
|
LayerState *digitLayer;
|
|
void *layerFrames;
|
|
int layerId;
|
|
uint32_t remainingValue;
|
|
void *animData;
|
|
ANM2 *animation;
|
|
|
|
digitLayer = ANM2::GetLayer(&this->_StatsMenuSprite,&DAT_00000007);
|
|
digitLayer->_visible = 1;
|
|
do {
|
|
remainingValue = value / 10;
|
|
if (((this->_StatsMenuSprite)._animState._animData != (void *)0x0) &&
|
|
((7 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._animation) + 0x80)) ||
|
|
(KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("LayerId out of bounds\n")),
|
|
7 < *GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._animation) + 0x80)))))) {
|
|
animData = (this->_StatsMenuSprite)._animState._animData;
|
|
layerId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x54));
|
|
if ((animData == (void *)0x0) ||
|
|
((layerId < 0 || (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x1c)) <= layerId)))) {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("id out of bounds\n"));
|
|
}
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._layerFrames) + layerId * 4)) = 0;
|
|
AnimationState::AdvanceLayerPosition
|
|
(&(this->_StatsMenuSprite)._animState,layerId,(float)(value % 10));
|
|
}
|
|
if ((this->_StatsMenuSprite)._loaded != 0) {
|
|
if ((this->_StatsMenuSprite)._overlayRenderFirst == 0) {
|
|
animData = (this->_StatsMenuSprite)._animState._animData;
|
|
if (((animData != (void *)0x0) &&
|
|
(animation = (this->_StatsMenuSprite)._animState._animation, 7 < animation->_layerCount)
|
|
) && (layerId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x54)), -1 < layerId)) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((layerId * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18)))),&position,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._animState._layerFrames) + layerId * 4)),
|
|
&g_vectorZero,&g_vectorZero,animation);
|
|
}
|
|
animData = (this->_StatsMenuSprite)._overlayAnimState._animData;
|
|
if (((animData != (void *)0x0) &&
|
|
(animation = (this->_StatsMenuSprite)._overlayAnimState._animation,
|
|
7 < animation->_layerCount)) && (layerId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x54)), -1 < layerId)
|
|
) {
|
|
layerFrames = (this->_StatsMenuSprite)._overlayAnimState._layerFrames;
|
|
goto LAB_009ed716;
|
|
}
|
|
}
|
|
else {
|
|
animData = (this->_StatsMenuSprite)._overlayAnimState._animData;
|
|
if (((animData != (void *)0x0) &&
|
|
(animation = (this->_StatsMenuSprite)._overlayAnimState._animation,
|
|
7 < animation->_layerCount)) && (layerId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x54)), -1 < layerId)
|
|
) {
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((layerId * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18)))),&position,
|
|
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_StatsMenuSprite)._overlayAnimState._layerFrames) +
|
|
layerId * 4)),&g_vectorZero,&g_vectorZero,animation);
|
|
}
|
|
animData = (this->_StatsMenuSprite)._animState._animData;
|
|
if (((animData != (void *)0x0) &&
|
|
(animation = (this->_StatsMenuSprite)._animState._animation, 7 < animation->_layerCount)
|
|
) && (layerId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x54)), -1 < layerId)) {
|
|
layerFrames = (this->_StatsMenuSprite)._animState._layerFrames;
|
|
LAB_009ed716:
|
|
AnimationLayer::RenderFrame
|
|
(GHIDRA_CAST<AnimationLayer *>((layerId * 0x10 + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(animData) + 0x18)))),&position,
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(layerFrames) + layerId * 4)),&g_vectorZero,&g_vectorZero,animation)
|
|
;
|
|
}
|
|
}
|
|
}
|
|
position.x = position.x - 11.0;
|
|
position.y = position.y - 1.5;
|
|
value = (remainingValue * 10) / 10;
|
|
if (value == 0) {
|
|
return remainingValue * 2;
|
|
}
|
|
} while( true );
|
|
}
|
|
|
|
// 009ed780
|
|
void Menu_Stats::load_achievements_xml()
|
|
{
|
|
uint64_t qVar1;
|
|
uint8_t *extraout_EAX;
|
|
int *file;
|
|
int iVar2;
|
|
uint8_t *fileText;
|
|
void *node;
|
|
void *gfxRootAttr;
|
|
std_string *left;
|
|
uint8_t *******pppppppbVar3;
|
|
uint8_t *pbVar4;
|
|
uint8_t *pbVar5;
|
|
std_string *psVar6;
|
|
uint32_t uVar7;
|
|
uint32_t uVar8;
|
|
uint64_t *allocatedBytes;
|
|
AchievementOverlay_Entry *entry;
|
|
uint32_t *attribute;
|
|
bool bVar9;
|
|
uint8_t *pbVar10;
|
|
uint8_t bVar11;
|
|
uint32_t achievementId;
|
|
uint8_t *******name [4];
|
|
uint32_t nameSize;
|
|
uint32_t nameCapacity;
|
|
uint8_t *******gfxPath;
|
|
char acStack_100b4 [4];
|
|
char acStack_100b0 [4];
|
|
char acStack_100ac [4];
|
|
uint32_t gfxPathSize;
|
|
uint32_t gfxPathCapacity;
|
|
uint8_t xmlDoc [48];
|
|
uint8_t auStack_10070 [65564];
|
|
std_string tmpString;
|
|
std_string gfxRoot;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Manager *manager;
|
|
|
|
manager = g_manager;
|
|
puStack_20 = auStack_10070 + 0x1006c;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0fdc3;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((auStack_10070 + 0x10060));
|
|
ExceptionList = &local_1c;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
tmpString._size = 0x10;
|
|
tmpString._capacity = 0x1f;
|
|
*(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint32_t *>(tmpString._buf))) + 0x0))) = 0x69686361;
|
|
*GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 4)) = 0x6d657665;
|
|
*GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 8)) = 0x73746e65;
|
|
*GHIDRA_CAST<uint32_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0xc)) = 0x6c6d782e;
|
|
*GHIDRA_CAST<uint8_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + 0x10)) = 0;
|
|
local_14 = 0;
|
|
ModManager::TryRedirectPath(GHIDRA_CAST<ModManager *>(&manager->_modManager),&gfxRoot,&tmpString);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 1;
|
|
pbVar10 = extraout_EAX;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((extraout_EAX + 0x14))) {
|
|
pbVar10 = *GHIDRA_CAST<uint8_t **>(extraout_EAX);
|
|
}
|
|
file = (GHIDRA_CAST<FileSystem *>((&PTR_vftable_00c37a10)))->FileSystem::Open(pbVar10,GHIDRA_CAST<int *>(0x0));
|
|
local_14 = (*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(GHIDRA_UINT(local_14))) + 0x1))) << 8;
|
|
if (0xf < gfxRoot._capacity) {
|
|
uVar7 = gfxRoot._capacity + 1;
|
|
psVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(gfxRoot._buf))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
psVar6 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gfxRoot._buf)) + 0x0))) + 0xffffffe8)))->_capacity);
|
|
uVar7 = gfxRoot._capacity + 0x24;
|
|
if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gfxRoot._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar6))))) goto LAB_009ed8ac;
|
|
}
|
|
operator_delete(psVar6,uVar7);
|
|
}
|
|
local_14 = -1;
|
|
gfxRoot._size = 0;
|
|
gfxRoot._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gfxRoot._buf)) + 0x0))) = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gfxRoot._buf)) + 0x0))) & 0xffffff00;
|
|
if (0xf < tmpString._capacity) {
|
|
uVar7 = tmpString._capacity + 1;
|
|
pppppppbVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *******>(tmpString._buf))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
pppppppbVar3 = *GHIDRA_CAST<uint8_t ********>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + -4));
|
|
uVar7 = tmpString._capacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pppppppbVar3))))) {
|
|
LAB_009ed8ac:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pppppppbVar3,uVar7);
|
|
}
|
|
if (file != GHIDRA_CAST<int *>(0x0)) {
|
|
iVar2 = (**(code **)(*file + 4))();
|
|
fileText = operator_new_tracked(iVar2 + 1);
|
|
(**(code **)(*file + 0x14))(fileText,1,iVar2);
|
|
fileText[iVar2] = 0;
|
|
(**(code **)*file)(1);
|
|
FUN_00413b90();
|
|
local_14 = 2;
|
|
pbVar10 = GHIDRA_CAST<uint8_t *>(0x9ed921);
|
|
pbVar4 = fileText;
|
|
(GHIDRA_CAST<rapidxml::xml_document *>((xmlDoc)))->rapidxml::xml_document::parse(fileText);
|
|
bVar11 = (uint8_t)pbVar4;
|
|
node = (GHIDRA_CAST<xml_node *>((xmlDoc)))->xml_node::first_node(GHIDRA_CAST<uint8_t *>("achievements"),GHIDRA_INT(pbVar10),bVar11);
|
|
gfxRoot._size = 0;
|
|
gfxRoot._capacity = 0xf;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gfxRoot._buf)) + 0x0))) = GHIDRA_CAST<std_string *>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
gfxRootAttr = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_attribute(&DAT_00b6987c,GHIDRA_UINT(pbVar10),bVar11);
|
|
if (gfxRootAttr != (void *)0x0) {
|
|
pbVar10 = &g_xmlNullStr;
|
|
if (*GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(gfxRootAttr) + 4)) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar10 = *GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(gfxRootAttr) + 4));
|
|
}
|
|
pbVar4 = pbVar10;
|
|
do {
|
|
bVar11 = *pbVar4;
|
|
pbVar4 = pbVar4 + 1;
|
|
} while (bVar11 != 0);
|
|
uVar7 = GHIDRA_INT(pbVar4) - GHIDRA_INT((pbVar10 + 1));
|
|
(GHIDRA_CAST<msvc::string *>((gfxRoot._buf)))->msvc::string::assign(pbVar10,uVar7);
|
|
bVar11 = (uint8_t)uVar7;
|
|
}
|
|
for (node = (GHIDRA_CAST<xml_node *>((node)))->xml_node::first_node(GHIDRA_CAST<uint8_t *>("achievement"),GHIDRA_INT(pbVar10),bVar11);
|
|
node != (void *)0x0; node = *(void **)(GHIDRA_CAST<char *>(node) + 0x2c)) {
|
|
achievementId = 0xffffffff;
|
|
nameSize = 0;
|
|
nameCapacity = 0xf;
|
|
name[0] = GHIDRA_CAST<uint8_t *******>(0x0);
|
|
gfxPathSize = 0;
|
|
gfxPathCapacity = 0xf;
|
|
gfxPath = GHIDRA_CAST<uint8_t *******>(0x0);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
|
|
attribute = *GHIDRA_CAST<uint32_t **>((GHIDRA_CAST<char *>(node) + 0x20));
|
|
if (attribute != GHIDRA_CAST<uint32_t *>(0x0)) {
|
|
do {
|
|
pbVar10 = GHIDRA_CAST<uint8_t *>(*attribute);
|
|
pbVar5 = s_id;
|
|
pbVar4 = &g_xmlNullStr;
|
|
if (pbVar10 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar4 = pbVar10;
|
|
}
|
|
do {
|
|
bVar11 = *pbVar4;
|
|
bVar9 = bVar11 < *pbVar5;
|
|
if (bVar11 != *pbVar5) {
|
|
LAB_009eda43:
|
|
uVar7 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_009eda48;
|
|
}
|
|
if (bVar11 == 0) break;
|
|
bVar11 = pbVar4[1];
|
|
bVar9 = bVar11 < pbVar5[1];
|
|
if (bVar11 != pbVar5[1]) goto LAB_009eda43;
|
|
pbVar4 = pbVar4 + 2;
|
|
pbVar5 = pbVar5 + 2;
|
|
} while (bVar11 != 0);
|
|
uVar7 = 0;
|
|
LAB_009eda48:
|
|
if (uVar7 == 0) {
|
|
pbVar10 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<uint8_t *>(attribute[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar10 = GHIDRA_CAST<uint8_t *>(attribute[1]);
|
|
}
|
|
achievementId = atoi(GHIDRA_CAST<char *>(pbVar10));
|
|
}
|
|
else {
|
|
pbVar5 = &DAT_00b6e37c;
|
|
pbVar4 = &g_xmlNullStr;
|
|
if (pbVar10 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar4 = pbVar10;
|
|
}
|
|
do {
|
|
bVar11 = *pbVar4;
|
|
bVar9 = bVar11 < *pbVar5;
|
|
if (bVar11 != *pbVar5) {
|
|
LAB_009edaa0:
|
|
uVar7 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_009edaa5;
|
|
}
|
|
if (bVar11 == 0) break;
|
|
bVar11 = pbVar4[1];
|
|
bVar9 = bVar11 < pbVar5[1];
|
|
if (bVar11 != pbVar5[1]) goto LAB_009edaa0;
|
|
pbVar4 = pbVar4 + 2;
|
|
pbVar5 = pbVar5 + 2;
|
|
} while (bVar11 != 0);
|
|
uVar7 = 0;
|
|
LAB_009edaa5:
|
|
if (uVar7 == 0) {
|
|
pbVar10 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<uint8_t *>(attribute[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar10 = GHIDRA_CAST<uint8_t *>(attribute[1]);
|
|
}
|
|
pbVar4 = pbVar10;
|
|
do {
|
|
bVar11 = *pbVar4;
|
|
pbVar4 = pbVar4 + 1;
|
|
} while (bVar11 != 0);
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(name))))->msvc::string::assign(pbVar10,GHIDRA_INT(pbVar4) - GHIDRA_INT((pbVar10 + 1)));
|
|
}
|
|
else {
|
|
pbVar5 = &DAT_00b66fec;
|
|
pbVar4 = &g_xmlNullStr;
|
|
if (pbVar10 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar4 = pbVar10;
|
|
}
|
|
do {
|
|
bVar11 = *pbVar4;
|
|
bVar9 = bVar11 < *pbVar5;
|
|
if (bVar11 != *pbVar5) {
|
|
LAB_009edb10:
|
|
uVar7 = -GHIDRA_UINT(bVar9) | 1;
|
|
goto LAB_009edb15;
|
|
}
|
|
if (bVar11 == 0) break;
|
|
bVar11 = pbVar4[1];
|
|
bVar9 = bVar11 < pbVar5[1];
|
|
if (bVar11 != pbVar5[1]) goto LAB_009edb10;
|
|
pbVar5 = pbVar5 + 2;
|
|
pbVar4 = pbVar4 + 2;
|
|
} while (bVar11 != 0);
|
|
uVar7 = 0;
|
|
LAB_009edb15:
|
|
if (uVar7 == 0) {
|
|
pbVar10 = &g_xmlNullStr;
|
|
if (GHIDRA_CAST<uint8_t *>(attribute[1]) != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar10 = GHIDRA_CAST<uint8_t *>(attribute[1]);
|
|
}
|
|
pbVar4 = pbVar10;
|
|
do {
|
|
bVar11 = *pbVar4;
|
|
pbVar4 = pbVar4 + 1;
|
|
} while (bVar11 != 0);
|
|
psVar6 = GHIDRA_CAST<std_string *>((pbVar4 + -GHIDRA_INT((pbVar10 + 1))));
|
|
if (GHIDRA_CAST<std_string *>((0x7fffffff - gfxRoot._size)) < psVar6) {
|
|
/* WARNING: Subroutine does not return */
|
|
msvc::string::_Xlen();
|
|
}
|
|
left = &gfxRoot;
|
|
if (0xf < gfxRoot._capacity) {
|
|
left = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(gfxRoot._buf))) + 0x0)));
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((tmpString._buf)))->msvc::string::concat(GHIDRA_INT(this),psVar6,GHIDRA_CAST<uint8_t *>(left),gfxRoot._size,
|
|
pbVar10,GHIDRA_UINT(psVar6));
|
|
if (0xf < gfxPathCapacity) {
|
|
uVar7 = gfxPathCapacity + 1;
|
|
pppppppbVar3 = gfxPath;
|
|
if (0xfff < uVar7) {
|
|
pppppppbVar3 = GHIDRA_CAST<uint8_t *******>(gfxPath[-1]);
|
|
uVar7 = gfxPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(gfxPath) + (-4 - GHIDRA_INT(pppppppbVar3)))))
|
|
goto LAB_009edddd;
|
|
}
|
|
operator_delete(pppppppbVar3,uVar7);
|
|
}
|
|
gfxPath = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<uint8_t *******>(tmpString._buf))) + 0x0)));
|
|
acStack_100b4[0] = tmpString._buf[4];
|
|
acStack_100b4[1] = tmpString._buf[5];
|
|
acStack_100b4[2] = tmpString._buf[6];
|
|
acStack_100b4[3] = tmpString._buf[7];
|
|
acStack_100b0[0] = tmpString._buf[8];
|
|
acStack_100b0[1] = tmpString._buf[9];
|
|
acStack_100b0[2] = tmpString._buf[10];
|
|
acStack_100b0[3] = tmpString._buf[0xb];
|
|
acStack_100ac[0] = tmpString._buf[0xc];
|
|
acStack_100ac[1] = tmpString._buf[0xd];
|
|
acStack_100ac[2] = tmpString._buf[0xe];
|
|
acStack_100ac[3] = tmpString._buf[0xf];
|
|
gfxPathSize = tmpString._size;
|
|
gfxPathCapacity = tmpString._capacity;
|
|
}
|
|
}
|
|
}
|
|
} while ((attribute[4] != 0) &&
|
|
(attribute = GHIDRA_CAST<uint32_t *>(attribute[6]), attribute != GHIDRA_CAST<uint32_t *>(0x0)));
|
|
if (achievementId < 0x282) {
|
|
psVar6 = &this->_achievementOverlayEntries[achievementId]._name;
|
|
this->_achievementOverlayEntries[achievementId]._id = achievementId;
|
|
if (psVar6 != GHIDRA_CAST<std_string *>(name)) {
|
|
pppppppbVar3 = GHIDRA_CAST<uint8_t *******>(name);
|
|
if (0xf < nameCapacity) {
|
|
pppppppbVar3 = name[0];
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((psVar6->_buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(pppppppbVar3),nameSize);
|
|
}
|
|
psVar6 = &this->_achievementOverlayEntries[achievementId]._gfx;
|
|
if (psVar6 != GHIDRA_CAST<std_string *>(&gfxPath)) {
|
|
pppppppbVar3 = GHIDRA_CAST<uint8_t *******>(&gfxPath);
|
|
if (0xf < gfxPathCapacity) {
|
|
pppppppbVar3 = gfxPath;
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((psVar6->_buf)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(pppppppbVar3),gfxPathSize);
|
|
}
|
|
}
|
|
}
|
|
uVar7 = nameCapacity;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 3;
|
|
if (0xf < gfxPathCapacity) {
|
|
uVar8 = gfxPathCapacity + 1;
|
|
pppppppbVar3 = gfxPath;
|
|
if (0xfff < uVar8) {
|
|
pppppppbVar3 = GHIDRA_CAST<uint8_t *******>(gfxPath[-1]);
|
|
uVar8 = gfxPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(gfxPath) + (-4 - GHIDRA_INT(pppppppbVar3))))) goto LAB_009edddd;
|
|
}
|
|
operator_delete(pppppppbVar3,uVar8);
|
|
}
|
|
if (0xf < uVar7) {
|
|
uVar8 = uVar7 + 1;
|
|
pppppppbVar3 = name[0];
|
|
if (0xfff < uVar8) {
|
|
pppppppbVar3 = GHIDRA_CAST<uint8_t *******>(name[0][-1]);
|
|
uVar8 = uVar7 + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>((GHIDRA_INT(name[0]) + (-4 - GHIDRA_INT(pppppppbVar3))))) goto LAB_009edddd;
|
|
}
|
|
operator_delete(pppppppbVar3,uVar8);
|
|
}
|
|
}
|
|
this->_maxAchievementID = 0;
|
|
entry = this->_achievementOverlayEntries + 1;
|
|
iVar2 = 2;
|
|
do {
|
|
if (entry[-1]._id == iVar2 + -2) {
|
|
this->_achievementIDList[this->_maxAchievementID] = iVar2 + -2;
|
|
this->_maxAchievementID = this->_maxAchievementID + 1;
|
|
}
|
|
if (entry->_id == iVar2 + -1) {
|
|
this->_achievementIDList[this->_maxAchievementID] = iVar2 + -1;
|
|
this->_maxAchievementID = this->_maxAchievementID + 1;
|
|
}
|
|
if (entry[1]._id == iVar2) {
|
|
this->_achievementIDList[this->_maxAchievementID] = iVar2;
|
|
this->_maxAchievementID = this->_maxAchievementID + 1;
|
|
}
|
|
if (entry[2]._id == iVar2 + 1) {
|
|
this->_achievementIDList[this->_maxAchievementID] = iVar2 + 1;
|
|
this->_maxAchievementID = this->_maxAchievementID + 1;
|
|
}
|
|
if (entry[3]._id == iVar2 + 2) {
|
|
this->_achievementIDList[this->_maxAchievementID] = iVar2 + 2;
|
|
this->_maxAchievementID = this->_maxAchievementID + 1;
|
|
}
|
|
if (entry[4]._id == iVar2 + 3) {
|
|
this->_achievementIDList[this->_maxAchievementID] = iVar2 + 3;
|
|
this->_maxAchievementID = this->_maxAchievementID + 1;
|
|
}
|
|
entry = entry + 6;
|
|
uVar7 = iVar2 + 4;
|
|
iVar2 = iVar2 + 6;
|
|
} while (uVar7 < 0x282);
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 2;
|
|
if (0xf < gfxRoot._capacity) {
|
|
uVar7 = gfxRoot._capacity + 1;
|
|
psVar6 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<std_string *>(gfxRoot._buf))) + 0x0)));
|
|
if (0xfff < uVar7) {
|
|
psVar6 = GHIDRA_CAST<std_string *>((GHIDRA_CAST<std_string *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gfxRoot._buf)) + 0x0))) + -0x18)))->_capacity);
|
|
uVar7 = gfxRoot._capacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < GHIDRA_CAST<uint8_t *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(gfxRoot._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar6))))) {
|
|
LAB_009edddd:
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(psVar6,uVar7);
|
|
}
|
|
local_14 = 5;
|
|
(GHIDRA_CAST<xml_memory_pool *>((auStack_10070)))->xml_memory_pool::clear();
|
|
if (g_mainHeap == (void *)0x0) {
|
|
allocatedBytes = &g_allocatedBytesNoHeap;
|
|
}
|
|
else {
|
|
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
|
}
|
|
if (fileText != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
uVar7 = *GHIDRA_CAST<uint32_t *>((fileText + -4));
|
|
qVar1 = *allocatedBytes;
|
|
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar7;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar1) < uVar7));
|
|
free(fileText + -4);
|
|
}
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009ede60
|
|
void Menu_Stats::update_stats_screen()
|
|
{
|
|
Menu_Stats *persistentData = this;
|
|
int iVar1;
|
|
char cVar2;
|
|
uint8_t bVar3;
|
|
uint8_t extraout_CL;
|
|
uint8_t extraout_CL_00;
|
|
uint8_t extraout_CL_01;
|
|
int unused;
|
|
PersistentGameData *persistentData;
|
|
PersistentGameData *extraout_ECX;
|
|
char *ptr;
|
|
int iVar4;
|
|
int extraout_EDX;
|
|
int extraout_EDX_00;
|
|
uint32_t uVar5;
|
|
uint32_t selectAction;
|
|
int local_58;
|
|
Menu_Stats *local_54;
|
|
uint8_t local_50 [24];
|
|
float fStack_38;
|
|
float fStack_34;
|
|
float local_30;
|
|
float local_2c;
|
|
float local_28;
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
Manager *manager;
|
|
|
|
puStack_20 = local_50 + 0x4c;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00af556d;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((local_50 + 0x40));
|
|
ExceptionList = &local_1c;
|
|
selectAction = 0xe;
|
|
local_54 = persistentData;
|
|
cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))
|
|
(0xffffffff,FUN_00a209e0,&selectAction,0,0,local_24);
|
|
if (cVar2 == '\0') {
|
|
local_54 = GHIDRA_CAST<Menu_Stats *>(0x16);
|
|
cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_54,0,0);
|
|
if (cVar2 == '\0') {
|
|
local_54 = GHIDRA_CAST<Menu_Stats *>(0x17);
|
|
cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_54,0,0);
|
|
if (cVar2 == '\0') {
|
|
local_58 = 0xf;
|
|
cVar2 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_58,0,0);
|
|
if (cVar2 != '\0') {
|
|
FUN_0098aec0();
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = persistentData->_statsMenuCurrentSelection;
|
|
iVar1 = iVar4 + 1;
|
|
persistentData->_statsMenuCurrentSelection = iVar1;
|
|
if (iVar1 < 5) {
|
|
if ((iVar4 == 1) && (persistentData->_countTotalAchievements == 0)) {
|
|
persistentData->_statsMenuCurrentSelection = 3;
|
|
}
|
|
}
|
|
else {
|
|
persistentData->_statsMenuCurrentSelection = 0;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
iVar4 = persistentData->_statsMenuCurrentSelection;
|
|
iVar1 = iVar4 + -1;
|
|
persistentData->_statsMenuCurrentSelection = iVar1;
|
|
if (iVar1 < 0) {
|
|
persistentData->_statsMenuCurrentSelection = 4;
|
|
}
|
|
else if ((iVar4 == 3) && (persistentData->_countTotalAchievements == 0)) {
|
|
persistentData->_statsMenuCurrentSelection = 1;
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
switch(persistentData->_statsMenuCurrentSelection) {
|
|
case 0:
|
|
MenuManager::push_menu(8,unused);
|
|
break;
|
|
case 1:
|
|
MenuManager::push_menu(0xd,unused);
|
|
break;
|
|
case 2:
|
|
iVar1 = persistentData->_maxAchievementID;
|
|
iVar4 = 0;
|
|
persistentData->_selectedAchievmentId = 0;
|
|
local_58 = persistentData->_achievementIDList[0];
|
|
if (0 < iVar1) {
|
|
persistentData = &g_manager->_persistentGameData;
|
|
do {
|
|
bVar3 = PersistentGameData::Unlocked(persistentData,local_58);
|
|
iVar4 = extraout_EDX;
|
|
if (bVar3 != 0) break;
|
|
persistentData->_selectedAchievmentId = persistentData->_selectedAchievmentId + 1;
|
|
iVar4 = persistentData->_selectedAchievmentId;
|
|
local_58 = persistentData->_achievementIDList[iVar4];
|
|
persistentData = extraout_ECX;
|
|
} while (iVar4 < iVar1);
|
|
}
|
|
manager = g_manager;
|
|
if (iVar4 < iVar1) {
|
|
uVar5 = 1;
|
|
do {
|
|
if ((manager->_persistentGameData)._achievements[uVar5] != 0) {
|
|
PersistentGameData::UnlockSteamAchievement(&manager->_persistentGameData,uVar5);
|
|
}
|
|
persistentData = local_54;
|
|
uVar5 = uVar5 + 1;
|
|
} while (uVar5 < 0x282);
|
|
local_54->_isAchievementScreenVisible = 1;
|
|
ANM2::Play(&local_54->_achievementsSprite,GHIDRA_CAST<uint8_t *>("Appear"),0);
|
|
bVar3 = PersistentGameData::Unlocked(&g_manager->_persistentGameData,local_58);
|
|
if (bVar3 == 0) {
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = msvc::_Allocate(0x30);
|
|
local_2c = 5.74532e-44;
|
|
local_28 = 6.5861e-44;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_50))) + 0x14))),"gfx/ui/achievement/Achievement_Locked.png",0x2a);
|
|
local_14 = 0;
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&persistentData->_achievementsSprite),3,GHIDRA_CAST<std_string *>((local_50 + 0x14)));
|
|
local_14 = 0xffffffff;
|
|
bVar3 = extraout_CL_00;
|
|
if (0xf < GHIDRA_UINT(local_28)) {
|
|
uVar5 = GHIDRA_INT(local_28) + 1;
|
|
ptr = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(local_50))) + 0x14)));
|
|
if (0xfff < uVar5) {
|
|
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + -4));
|
|
uVar5 = GHIDRA_INT(local_28) + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(ptr))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(ptr,uVar5);
|
|
bVar3 = extraout_CL_01;
|
|
}
|
|
}
|
|
else {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&persistentData->_achievementsSprite),3,
|
|
&persistentData->_achievementOverlayEntries[extraout_EDX_00]._gfx);
|
|
bVar3 = extraout_CL;
|
|
}
|
|
ANM2::LoadGraphics(&persistentData->_achievementsSprite,bVar3);
|
|
persistentData->_achievementScrollThruListPosition = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x10))) = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = 0.0;
|
|
fStack_38 = 0.0;
|
|
fStack_34 = 0.0;
|
|
local_30 = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0xc))) = 0.0;
|
|
local_2c = 0.0;
|
|
local_28 = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&persistentData->_achievementMiniSprite1))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_50));
|
|
local_30 = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x10))) = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = 0.0;
|
|
fStack_38 = 0.0;
|
|
fStack_34 = 0.0;
|
|
local_2c = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0xc))) = 0.0;
|
|
local_28 = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&persistentData->_achievementMiniSprite9))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_50));
|
|
local_30 = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x10))) = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = 0.0;
|
|
fStack_38 = 0.0;
|
|
fStack_34 = 0.0;
|
|
local_2c = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0xc))) = 1.0;
|
|
local_28 = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&persistentData->_achievementMiniSprite2))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_50));
|
|
local_30 = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x10))) = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x14))) = 0.0;
|
|
fStack_38 = 0.0;
|
|
fStack_34 = 0.0;
|
|
local_2c = 0.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x0))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x4))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0x8))) = 1.0;
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(local_50)) + 0xc))) = 1.0;
|
|
local_28 = 0.0;
|
|
(GHIDRA_CAST<Sprite *>((GHIDRA_CAST<Sprite *>(&persistentData->_achievementMiniSprite8))))->Sprite::SetColor(GHIDRA_CAST<ColorMod *>(local_50));
|
|
}
|
|
break;
|
|
case 3:
|
|
MenuManager::push_menu(0xe,unused);
|
|
break;
|
|
case 4:
|
|
MenuManager::push_menu(0x16,unused);
|
|
}
|
|
}
|
|
if ((persistentData->_statsMenuCurrentSelection == 2) && (persistentData->_countTotalAchievements == 0)) {
|
|
persistentData->_statsMenuCurrentSelection = 0;
|
|
}
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
|
|
// 009ee2a0
|
|
void Menu_Stats::update_achievements()
|
|
{
|
|
char isActionTriggered;
|
|
uint8_t bVar1;
|
|
uint32_t uVar2;
|
|
void **clampedSpeedPtr;
|
|
float *miniPlaybackSpeed;
|
|
uint8_t *pbVar3;
|
|
uint8_t *pbVar4;
|
|
int listIndex;
|
|
uint8_t extraout_CL;
|
|
int iVar5;
|
|
char *animName;
|
|
uint32_t extraout_ECX;
|
|
uint32_t extraout_ECX_00;
|
|
uint32_t extraout_ECX_01;
|
|
int rawListIndex;
|
|
uint8_t *pbVar6;
|
|
AnimationState *miniAnimState;
|
|
bool bVar7;
|
|
void *pvVar8;
|
|
float maxScrollStep;
|
|
float fVar9;
|
|
float scrollPosition;
|
|
ColorMod shownColor8;
|
|
ColorMod shownColor2;
|
|
ColorMod hiddenColor9;
|
|
ColorMod hiddenColor1;
|
|
ColorMod fadeColor8;
|
|
ColorMod fadeColor1;
|
|
ColorMod fadeColor9;
|
|
ColorMod fadeColor2;
|
|
uint32_t menuRightAction;
|
|
uint32_t menuLeftAction;
|
|
void *local_70;
|
|
void *local_6c;
|
|
uint8_t animNameChar;
|
|
uint8_t lockedAnimName [32];
|
|
uint8_t unlockedAnimName [8];
|
|
uint8_t *lockedGfxPath [4];
|
|
uint32_t lockedGfxPathSize;
|
|
uint32_t lockedGfxPathCapacity;
|
|
uint32_t stackCookie;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint8_t *local_14;
|
|
ColorMod *miniSpriteColor;
|
|
int *selectedIdPtr;
|
|
|
|
local_14 = GHIDRA_CAST<uint8_t *>(0xffffffff);
|
|
puStack_18 = &LAB_00b0fe05;
|
|
local_1c = ExceptionList;
|
|
puStack_20 = GHIDRA_CAST<uint8_t *>((lockedGfxPath + 0xe));
|
|
uVar2 = __security_cookie ^ GHIDRA_UINT((lockedGfxPath + 0xb));
|
|
stackCookie = uVar2;
|
|
ExceptionList = &local_1c;
|
|
if (((g_manager->_framecount & 1) == 0) || (0x3c < this->_holdInputTimer)) {
|
|
if ((this->_achievementsSprite)._loaded != 0) {
|
|
AnimationState::Update(&(this->_achievementsSprite)._animState);
|
|
AnimationState::Update(&(this->_achievementsSprite)._overlayAnimState);
|
|
}
|
|
miniAnimState = &(this->_achievementMiniSprite1)._animState;
|
|
local_6c = (void *)0xb;
|
|
do {
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_INT(&miniAnimState[6]._currentlyTriggeredEvents) + 1)) != '\0') {
|
|
AnimationState::Update(miniAnimState);
|
|
AnimationState::Update(miniAnimState + 1);
|
|
}
|
|
miniAnimState = GHIDRA_CAST<AnimationState *>(&miniAnimState[8]._isPlaying);
|
|
local_6c = (void *)(GHIDRA_INT(local_6c) + -1);
|
|
} while (local_6c != (void *)0x0);
|
|
pvVar8 = (void *)0x3f800000;
|
|
local_6c = (void *)0x0;
|
|
if (0xb4 < this->_holdInputTimer) {
|
|
local_70 = (void *)0x40800000;
|
|
local_6c = (void *)((float)(this->_holdInputTimer + -0xb4) / 30.0 + 1.0);
|
|
clampedSpeedPtr = &local_6c;
|
|
if (4.0 <= (float)local_6c) {
|
|
clampedSpeedPtr = &local_70;
|
|
}
|
|
pvVar8 = *clampedSpeedPtr;
|
|
}
|
|
(this->_achievementsSprite)._playbackSpeed = (float)pvVar8;
|
|
miniPlaybackSpeed = &(this->_achievementMiniSprite1)._playbackSpeed;
|
|
iVar5 = 0xb;
|
|
do {
|
|
*miniPlaybackSpeed = (float)pvVar8;
|
|
miniPlaybackSpeed = miniPlaybackSpeed + 0x45;
|
|
iVar5 = iVar5 + -1;
|
|
} while (iVar5 != 0);
|
|
if (0x3c < this->_holdInputTimer) {
|
|
pvVar8 = (void *)((float)pvVar8 + (float)pvVar8);
|
|
}
|
|
this->_scrollSpeed = (float)pvVar8;
|
|
}
|
|
local_70 = (void *)0xf;
|
|
isActionTriggered =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_70,0,0,uVar2);
|
|
if (isActionTriggered == '\0') {
|
|
menuLeftAction = 0x14;
|
|
isActionTriggered =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&menuLeftAction,0,0);
|
|
if (isActionTriggered == '\0') {
|
|
menuRightAction = 0x15;
|
|
isActionTriggered =
|
|
(**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a20940,&menuRightAction,0,0);
|
|
if (isActionTriggered == '\0') {
|
|
this->_holdInputTimer = 0;
|
|
}
|
|
else {
|
|
this->_holdInputTimer = this->_holdInputTimer + 1;
|
|
bVar7 = true;
|
|
if ((this->_achievementsSprite)._animState._animData == (void *)0x0) goto LAB_009ee6cd;
|
|
if ((this->_achievementsSprite)._animState._isPlaying != 0) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
pbVar3 = s_Idle;
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < *pbVar3;
|
|
if (bVar1 != *pbVar3) {
|
|
LAB_009ee632:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee637;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < pbVar3[1];
|
|
if (bVar1 != pbVar3[1]) goto LAB_009ee632;
|
|
pbVar4 = pbVar4 + 2;
|
|
pbVar3 = pbVar3 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee637:
|
|
if (uVar2 == 0) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Dissapear2";
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ee678:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee67d;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ee678;
|
|
pbVar3 = pbVar3 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee67d:
|
|
if ((uVar2 == 0) &&
|
|
((pbVar4[0x34] == 0 || ((this->_achievementsSprite)._animState._isPlaying != 0))))
|
|
goto LAB_009ee6c6;
|
|
}
|
|
animName = "Dissapear2";
|
|
goto LAB_009ee6a3;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_009ee6c6;
|
|
}
|
|
this->_holdInputTimer = this->_holdInputTimer + 1;
|
|
bVar7 = (this->_achievementsSprite)._animState._animData == (void *)0x0;
|
|
if (!bVar7) {
|
|
if ((this->_achievementsSprite)._animState._isPlaying != 0) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
pbVar3 = s_Idle;
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < *pbVar3;
|
|
if (bVar1 != *pbVar3) {
|
|
LAB_009ee528:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee52d;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < pbVar3[1];
|
|
if (bVar1 != pbVar3[1]) goto LAB_009ee528;
|
|
pbVar4 = pbVar4 + 2;
|
|
pbVar3 = pbVar3 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee52d:
|
|
if (uVar2 == 0) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Dissapear";
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ee570:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee575;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ee570;
|
|
pbVar3 = pbVar3 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee575:
|
|
if (uVar2 == 0) {
|
|
if ((pbVar4[0x34] == 0) || ((this->_achievementsSprite)._animState._isPlaying != 0))
|
|
goto LAB_009ee6c6;
|
|
animName = "Dissapear";
|
|
goto LAB_009ee6a3;
|
|
}
|
|
}
|
|
animName = "Dissapear";
|
|
LAB_009ee6a3:
|
|
bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST<uint8_t *>(animName),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_achievementsSprite)._animState);
|
|
(this->_achievementsSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
}
|
|
goto LAB_009ee6c6;
|
|
}
|
|
}
|
|
else {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_009ee474:
|
|
bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST<uint8_t *>("Dissapear"),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_achievementsSprite)._animState);
|
|
(this->_achievementsSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Dissapear";
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ee450:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee455;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ee450;
|
|
pbVar3 = pbVar3 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee455:
|
|
if ((uVar2 != 0) ||
|
|
((pbVar4[0x34] != 0 && ((this->_achievementsSprite)._animState._isPlaying == 0))))
|
|
goto LAB_009ee474;
|
|
}
|
|
this->_isAchievementScreenVisible = 0;
|
|
this->_achievementScrollInPosition = 275.0;
|
|
LAB_009ee6c6:
|
|
bVar7 = (this->_achievementsSprite)._animState._animData == (void *)0x0;
|
|
}
|
|
LAB_009ee6cd:
|
|
if ((!bVar7) && ((this->_achievementsSprite)._animState._isPlaying == 0)) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Dissapear";
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ee716:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee71b;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ee716;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee71b:
|
|
if (uVar2 == 0) {
|
|
if (this->_isAchievementScreenVisible == 0) goto LAB_009eeedc;
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Appear";
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ee764:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee769;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ee764;
|
|
pbVar3 = pbVar3 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee769:
|
|
if (((uVar2 != 0) || (pbVar4[0x34] != 0)) &&
|
|
(bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST<uint8_t *>("Appear"),1), bVar1 != 0)) {
|
|
AnimationState::Rewind(&(this->_achievementsSprite)._animState);
|
|
(this->_achievementsSprite)._animState._isPlaying = 1;
|
|
}
|
|
iVar5 = this->_selectedAchievmentId + -1;
|
|
if (iVar5 < 0) {
|
|
iVar5 = this->_maxAchievementID + -1;
|
|
}
|
|
uVar2 = this->_achievementIDList[iVar5];
|
|
if ((uVar2 == 0xfffffffe) ||
|
|
((-1 < GHIDRA_INT(uVar2) &&
|
|
((0x281 < uVar2 ||
|
|
(((uVar2 != 0 && ((g_manager->_persistentGameData)._achievements[uVar2] == 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)))))))))))) {
|
|
pbVar4 = msvc::_Allocate(0x30);
|
|
lockedGfxPathSize = 0x29;
|
|
lockedGfxPathCapacity = 0x2f;
|
|
pbVar4[0] = 'g';
|
|
pbVar4[1] = 'f';
|
|
pbVar4[2] = 'x';
|
|
pbVar4[3] = '/';
|
|
pbVar4[4] = 'u';
|
|
pbVar4[5] = 'i';
|
|
pbVar4[6] = '/';
|
|
pbVar4[7] = 'a';
|
|
pbVar4[8] = 'c';
|
|
pbVar4[9] = 'h';
|
|
pbVar4[10] = 'i';
|
|
pbVar4[0xb] = 'e';
|
|
pbVar4[0xc] = 'v';
|
|
pbVar4[0xd] = 'e';
|
|
pbVar4[0xe] = 'm';
|
|
pbVar4[0xf] = 'e';
|
|
pbVar4[0x10] = 'n';
|
|
pbVar4[0x11] = 't';
|
|
pbVar4[0x12] = '/';
|
|
pbVar4[0x13] = 'A';
|
|
pbVar4[0x14] = 'c';
|
|
pbVar4[0x15] = 'h';
|
|
pbVar4[0x16] = 'i';
|
|
pbVar4[0x17] = 'e';
|
|
pbVar4[0x18] = 'v';
|
|
pbVar4[0x19] = 'e';
|
|
pbVar4[0x1a] = 'm';
|
|
pbVar4[0x1b] = 'e';
|
|
pbVar4[0x1c] = 'n';
|
|
pbVar4[0x1d] = 't';
|
|
pbVar4[0x1e] = '_';
|
|
pbVar4[0x1f] = 'L';
|
|
pbVar4[0x20] = 0x6f;
|
|
pbVar4[0x21] = 99;
|
|
pbVar4[0x22] = 0x6b;
|
|
pbVar4[0x23] = 0x65;
|
|
pbVar4[0x24] = 100;
|
|
pbVar4[0x25] = 0x2e;
|
|
pbVar4[0x26] = 0x70;
|
|
pbVar4[0x27] = 0x6e;
|
|
pbVar4[0x28] = 0x67;
|
|
pbVar4[0x29] = 0;
|
|
local_14 = GHIDRA_CAST<uint8_t *>(0x0);
|
|
lockedGfxPath[0] = pbVar4;
|
|
if (3 < (this->_achievementsSprite)._layerCount) {
|
|
local_6c = (this->_achievementsSprite)._layerState;
|
|
pbVar3 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_6c) + 0x1e8));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_6c) + 0x1fc))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(local_6c) + 0x1e8));
|
|
}
|
|
bVar1 = str_eq(pbVar4,0x29,pbVar3,*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_6c) + 0x1f8)));
|
|
if (bVar1 == 0) {
|
|
pvVar8 = local_6c;
|
|
if (GHIDRA_CAST<uint8_t **>((GHIDRA_INT(local_6c) + 0x1e8)) != lockedGfxPath) {
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(local_6c) + 0x1e8)))))->msvc::string::assign(pbVar4,0x29);
|
|
pvVar8 = (this->_achievementsSprite)._layerState;
|
|
pbVar4 = lockedGfxPath[0];
|
|
}
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar8) + 0x210)) = 0;
|
|
}
|
|
}
|
|
local_14 = GHIDRA_CAST<uint8_t *>(0xffffffff);
|
|
uVar2 = lockedGfxPathCapacity;
|
|
if (0xf < lockedGfxPathCapacity) {
|
|
uVar2 = lockedGfxPathCapacity + 1;
|
|
pbVar3 = pbVar4;
|
|
if (0xfff < uVar2) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>((pbVar4 + -4));
|
|
uVar2 = lockedGfxPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < pbVar4 + (-4 - GHIDRA_INT(pbVar3))) goto LAB_009eeec0;
|
|
}
|
|
operator_delete(pbVar3,uVar2);
|
|
uVar2 = extraout_ECX;
|
|
}
|
|
bVar1 = (uint8_t)uVar2;
|
|
}
|
|
else {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&this->_achievementsSprite),3,
|
|
&this->_achievementOverlayEntries[uVar2]._gfx);
|
|
bVar1 = extraout_CL;
|
|
}
|
|
}
|
|
else {
|
|
if ((this->_achievementsSprite)._animState._isPlaying != 0) goto LAB_009eeedc;
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar4 = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Dissapear2";
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ee975:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee97a;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ee975;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee97a:
|
|
if (uVar2 != 0) {
|
|
if ((this->_achievementsSprite)._animState._isPlaying != 0) goto LAB_009eeedc;
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar4 = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Appear";
|
|
do {
|
|
animNameChar = *pbVar4;
|
|
bVar7 = animNameChar < (uint8_t)*animName;
|
|
pbVar3 = (this->_achievementsSprite)._animState._animData;
|
|
if (animNameChar != *animName) {
|
|
LAB_009ee9e6:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ee9eb;
|
|
}
|
|
if (animNameChar == 0) break;
|
|
animNameChar = pbVar4[1];
|
|
bVar7 = animNameChar < (uint8_t)animName[1];
|
|
pbVar3 = (this->_achievementsSprite)._animState._animData;
|
|
if (animNameChar != animName[1]) goto LAB_009ee9e6;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (animNameChar != 0);
|
|
uVar2 = 0;
|
|
LAB_009ee9eb:
|
|
if (uVar2 != 0) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar4 = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Appear2";
|
|
do {
|
|
animNameChar = *pbVar4;
|
|
bVar7 = animNameChar < (uint8_t)*animName;
|
|
pbVar3 = (this->_achievementsSprite)._animState._animData;
|
|
if (animNameChar != *animName) {
|
|
LAB_009eea46:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009eea4b;
|
|
}
|
|
if (animNameChar == 0) break;
|
|
animNameChar = pbVar4[1];
|
|
bVar7 = animNameChar < (uint8_t)animName[1];
|
|
pbVar3 = (this->_achievementsSprite)._animState._animData;
|
|
if (animNameChar != animName[1]) goto LAB_009eea46;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (animNameChar != 0);
|
|
uVar2 = 0;
|
|
LAB_009eea4b:
|
|
if (uVar2 != 0) goto LAB_009eeedc;
|
|
}
|
|
if (this->_achievementScrollThruListPosition != 0.0) {
|
|
if (pbVar3 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar3 = &s_empty;
|
|
}
|
|
else if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar3 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar3);
|
|
}
|
|
animName = "Appear";
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009eeaa0:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009eeaa5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009eeaa0;
|
|
pbVar3 = pbVar3 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009eeaa5:
|
|
if (uVar2 == 0) {
|
|
selectedIdPtr = &this->_selectedAchievmentId;
|
|
*selectedIdPtr = *selectedIdPtr + -1;
|
|
if (*selectedIdPtr < 0) {
|
|
this->_selectedAchievmentId = this->_maxAchievementID + -1;
|
|
}
|
|
}
|
|
else {
|
|
this->_selectedAchievmentId = this->_selectedAchievmentId + 1;
|
|
iVar5 = this->_selectedAchievmentId;
|
|
if (this->_maxAchievementID <= iVar5) {
|
|
iVar5 = 0;
|
|
}
|
|
this->_selectedAchievmentId = iVar5;
|
|
}
|
|
}
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_009eeb44:
|
|
bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,s_Idle,1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_achievementsSprite)._animState);
|
|
(this->_achievementsSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
pbVar6 = s_Idle;
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < *pbVar6;
|
|
if (bVar1 != *pbVar6) {
|
|
LAB_009eeb20:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009eeb25;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < pbVar6[1];
|
|
if (bVar1 != pbVar6[1]) goto LAB_009eeb20;
|
|
pbVar3 = pbVar3 + 2;
|
|
pbVar6 = pbVar6 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009eeb25:
|
|
if ((uVar2 != 0) ||
|
|
((pbVar4[0x34] != 0 && ((this->_achievementsSprite)._animState._isPlaying == 0))))
|
|
goto LAB_009eeb44;
|
|
}
|
|
miniSpriteColor = &(this->_achievementMiniSprite1)._color;
|
|
this->_achievementScrollThruListPosition = 0.0;
|
|
hiddenColor1._offset[0] = 0.0;
|
|
hiddenColor1._offset[1] = 0.0;
|
|
hiddenColor1._offset[2] = 0.0;
|
|
if (miniSpriteColor != &hiddenColor1) {
|
|
(this->_achievementMiniSprite1)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._colorize[3] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._offset[1] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite1)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite1)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite1)._color._tint[3] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._offset[2] = 0.0;
|
|
}
|
|
miniSpriteColor = &(this->_achievementMiniSprite9)._color;
|
|
hiddenColor9._offset[0] = 0.0;
|
|
hiddenColor9._offset[1] = 0.0;
|
|
hiddenColor9._offset[2] = 0.0;
|
|
if (miniSpriteColor != &hiddenColor9) {
|
|
(this->_achievementMiniSprite9)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._colorize[3] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._offset[1] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite9)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite9)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite9)._color._tint[3] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._offset[2] = 0.0;
|
|
}
|
|
miniSpriteColor = &(this->_achievementMiniSprite2)._color;
|
|
shownColor2._offset[0] = 0.0;
|
|
shownColor2._offset[1] = 0.0;
|
|
shownColor2._offset[2] = 0.0;
|
|
if (miniSpriteColor != &shownColor2) {
|
|
(this->_achievementMiniSprite2)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._colorize[3] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._offset[1] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite2)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite2)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite2)._color._tint[3] = 1.0;
|
|
(this->_achievementMiniSprite2)._color._offset[2] = 0.0;
|
|
}
|
|
miniSpriteColor = &(this->_achievementMiniSprite8)._color;
|
|
shownColor8._offset[0] = 0.0;
|
|
shownColor8._offset[1] = 0.0;
|
|
shownColor8._offset[2] = 0.0;
|
|
if (miniSpriteColor != &shownColor8) {
|
|
(this->_achievementMiniSprite8)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._colorize[3] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._offset[1] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite8)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite8)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite8)._color._tint[3] = 1.0;
|
|
(this->_achievementMiniSprite8)._color._offset[2] = 0.0;
|
|
}
|
|
goto LAB_009eeedc;
|
|
}
|
|
if (this->_isAchievementScreenVisible == 0) goto LAB_009eeedc;
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (pbVar4 == GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
LAB_009eed44:
|
|
bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST<uint8_t *>("Appear2"),1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_achievementsSprite)._animState);
|
|
(this->_achievementsSprite)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Appear2";
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009eed20:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009eed25;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009eed20;
|
|
pbVar3 = pbVar3 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009eed25:
|
|
if ((uVar2 != 0) ||
|
|
((pbVar4[0x34] != 0 && ((this->_achievementsSprite)._animState._isPlaying == 0))))
|
|
goto LAB_009eed44;
|
|
}
|
|
rawListIndex = this->_selectedAchievmentId + 1;
|
|
iVar5 = 0;
|
|
if (rawListIndex < this->_maxAchievementID) {
|
|
iVar5 = rawListIndex;
|
|
}
|
|
uVar2 = this->_achievementIDList[iVar5];
|
|
if ((uVar2 == 0xfffffffe) ||
|
|
((-1 < GHIDRA_INT(uVar2) &&
|
|
((0x281 < uVar2 ||
|
|
(((uVar2 != 0 && ((g_manager->_persistentGameData)._achievements[uVar2] == 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)))))))))))) {
|
|
pbVar4 = msvc::_Allocate(0x30);
|
|
lockedGfxPathSize = 0x29;
|
|
lockedGfxPathCapacity = 0x2f;
|
|
pbVar4[0] = 'g';
|
|
pbVar4[1] = 'f';
|
|
pbVar4[2] = 'x';
|
|
pbVar4[3] = '/';
|
|
pbVar4[4] = 'u';
|
|
pbVar4[5] = 'i';
|
|
pbVar4[6] = '/';
|
|
pbVar4[7] = 'a';
|
|
pbVar4[8] = 'c';
|
|
pbVar4[9] = 'h';
|
|
pbVar4[10] = 'i';
|
|
pbVar4[0xb] = 'e';
|
|
pbVar4[0xc] = 'v';
|
|
pbVar4[0xd] = 'e';
|
|
pbVar4[0xe] = 'm';
|
|
pbVar4[0xf] = 'e';
|
|
pbVar4[0x10] = 'n';
|
|
pbVar4[0x11] = 't';
|
|
pbVar4[0x12] = '/';
|
|
pbVar4[0x13] = 'A';
|
|
pbVar4[0x14] = 'c';
|
|
pbVar4[0x15] = 'h';
|
|
pbVar4[0x16] = 'i';
|
|
pbVar4[0x17] = 'e';
|
|
pbVar4[0x18] = 'v';
|
|
pbVar4[0x19] = 'e';
|
|
pbVar4[0x1a] = 'm';
|
|
pbVar4[0x1b] = 'e';
|
|
pbVar4[0x1c] = 'n';
|
|
pbVar4[0x1d] = 't';
|
|
pbVar4[0x1e] = '_';
|
|
pbVar4[0x1f] = 'L';
|
|
pbVar4[0x20] = 0x6f;
|
|
pbVar4[0x21] = 99;
|
|
pbVar4[0x22] = 0x6b;
|
|
pbVar4[0x23] = 0x65;
|
|
pbVar4[0x24] = 100;
|
|
pbVar4[0x25] = 0x2e;
|
|
pbVar4[0x26] = 0x70;
|
|
pbVar4[0x27] = 0x6e;
|
|
pbVar4[0x28] = 0x67;
|
|
pbVar4[0x29] = 0;
|
|
local_14 = GHIDRA_CAST<uint8_t *>(0x1);
|
|
lockedGfxPath[0] = pbVar4;
|
|
if (3 < (this->_achievementsSprite)._layerCount) {
|
|
local_6c = (this->_achievementsSprite)._layerState;
|
|
pbVar3 = GHIDRA_CAST<uint8_t *>((GHIDRA_INT(local_6c) + 0x1e8));
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_6c) + 0x1fc))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>((GHIDRA_CAST<char *>(local_6c) + 0x1e8));
|
|
}
|
|
bVar1 = str_eq(pbVar4,0x29,pbVar3,*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(local_6c) + 0x1f8)));
|
|
if (bVar1 == 0) {
|
|
pvVar8 = local_6c;
|
|
if (GHIDRA_CAST<uint8_t **>((GHIDRA_INT(local_6c) + 0x1e8)) != lockedGfxPath) {
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>((GHIDRA_INT(local_6c) + 0x1e8)))))->msvc::string::assign(pbVar4,0x29);
|
|
pvVar8 = (this->_achievementsSprite)._layerState;
|
|
pbVar4 = lockedGfxPath[0];
|
|
}
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(pvVar8) + 0x210)) = 0;
|
|
}
|
|
}
|
|
local_14 = GHIDRA_CAST<uint8_t *>(0xffffffff);
|
|
uVar2 = lockedGfxPathCapacity;
|
|
if (0xf < lockedGfxPathCapacity) {
|
|
uVar2 = lockedGfxPathCapacity + 1;
|
|
pbVar3 = pbVar4;
|
|
if (0xfff < uVar2) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>((pbVar4 + -4));
|
|
uVar2 = lockedGfxPathCapacity + 0x24;
|
|
if (GHIDRA_CAST<uint8_t *>(0x1f) < pbVar4 + (-4 - GHIDRA_INT(pbVar3))) {
|
|
LAB_009eeec0:
|
|
local_14 = GHIDRA_CAST<uint8_t *>(0xffffffff);
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pbVar3,uVar2);
|
|
uVar2 = extraout_ECX_01;
|
|
}
|
|
}
|
|
else {
|
|
Sprite::ReplaceSpritesheet
|
|
(GHIDRA_CAST<Sprite *>(&this->_achievementsSprite),3,
|
|
&this->_achievementOverlayEntries[uVar2]._gfx);
|
|
uVar2 = extraout_ECX_00;
|
|
}
|
|
bVar1 = (uint8_t)uVar2;
|
|
}
|
|
ANM2::LoadGraphics(&this->_achievementsSprite,bVar1);
|
|
}
|
|
LAB_009eeedc:
|
|
if (240.0 < this->_achievementScrollInPosition) {
|
|
this->_achievementScrollInPosition = this->_achievementScrollInPosition - 2.0;
|
|
goto LAB_009ef2cd;
|
|
}
|
|
if (((this->_achievementsSprite)._animState._animData != (void *)0x0) &&
|
|
((this->_achievementsSprite)._animState._isPlaying != 0)) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Dissapear2";
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009eef64:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009eef69;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009eef64;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009eef69:
|
|
if (uVar2 != 0) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Appear2";
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009eefa0:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009eefa5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009eefa0;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009eefa5:
|
|
if (uVar2 != 0) goto LAB_009ef0f9;
|
|
}
|
|
scrollPosition = this->_achievementScrollThruListPosition;
|
|
if (-35.0 < scrollPosition) {
|
|
miniSpriteColor = &(this->_achievementMiniSprite2)._color;
|
|
fadeColor2._tint[0] = 1.0;
|
|
fadeColor2._tint[1] = 1.0;
|
|
maxScrollStep = this->_scrollSpeed + this->_scrollSpeed;
|
|
fadeColor2._tint[2] = 1.0;
|
|
fadeColor2._offset[0] = 0.0;
|
|
fadeColor2._offset[1] = 0.0;
|
|
fadeColor2._offset[2] = 0.0;
|
|
fVar9 = scrollPosition + 35.0;
|
|
if (maxScrollStep <= scrollPosition + 35.0) {
|
|
fVar9 = maxScrollStep;
|
|
}
|
|
scrollPosition = scrollPosition - fVar9;
|
|
this->_achievementScrollThruListPosition = scrollPosition;
|
|
fadeColor2._tint[3] = scrollPosition / 35.0 + 1.0;
|
|
if (miniSpriteColor != &fadeColor2) {
|
|
(this->_achievementMiniSprite2)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._colorize[3] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite2)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite2)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite2)._color._tint[3] = fadeColor2._tint[3];
|
|
(this->_achievementMiniSprite2)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._offset[1] = 0.0;
|
|
(this->_achievementMiniSprite2)._color._offset[2] = 0.0;
|
|
scrollPosition = this->_achievementScrollThruListPosition;
|
|
}
|
|
miniSpriteColor = &(this->_achievementMiniSprite9)._color;
|
|
fadeColor9._tint[3] = -scrollPosition / 35.0;
|
|
fadeColor9._tint[0] = 1.0;
|
|
fadeColor9._tint[1] = 1.0;
|
|
fadeColor9._tint[2] = 1.0;
|
|
fadeColor9._offset[0] = 0.0;
|
|
fadeColor9._offset[1] = 0.0;
|
|
fadeColor9._offset[2] = 0.0;
|
|
if (miniSpriteColor != &fadeColor9) {
|
|
(this->_achievementMiniSprite9)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._colorize[3] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite9)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite9)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite9)._color._tint[3] = fadeColor9._tint[3];
|
|
(this->_achievementMiniSprite9)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._offset[1] = 0.0;
|
|
(this->_achievementMiniSprite9)._color._offset[2] = 0.0;
|
|
}
|
|
}
|
|
}
|
|
LAB_009ef0f9:
|
|
if (((this->_achievementsSprite)._animState._animData != (void *)0x0) &&
|
|
((this->_achievementsSprite)._animState._isPlaying != 0)) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Dissapear";
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ef146:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ef14b;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ef146;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ef14b:
|
|
if (uVar2 != 0) {
|
|
pbVar4 = (this->_achievementsSprite)._animState._animData;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar4 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
animName = "Appear";
|
|
do {
|
|
bVar1 = *pbVar4;
|
|
bVar7 = bVar1 < (uint8_t)*animName;
|
|
if (bVar1 != *animName) {
|
|
LAB_009ef182:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ef187;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar4[1];
|
|
bVar7 = bVar1 < (uint8_t)animName[1];
|
|
if (bVar1 != animName[1]) goto LAB_009ef182;
|
|
pbVar4 = pbVar4 + 2;
|
|
animName = animName + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ef187:
|
|
if (uVar2 != 0) goto LAB_009ef2cd;
|
|
}
|
|
scrollPosition = this->_achievementScrollThruListPosition;
|
|
if (scrollPosition < 35.0) {
|
|
miniSpriteColor = &(this->_achievementMiniSprite1)._color;
|
|
fadeColor1._tint[0] = 1.0;
|
|
fadeColor1._tint[1] = 1.0;
|
|
maxScrollStep = this->_scrollSpeed + this->_scrollSpeed;
|
|
fadeColor1._tint[2] = 1.0;
|
|
fadeColor1._offset[0] = 0.0;
|
|
fadeColor1._offset[1] = 0.0;
|
|
fadeColor1._offset[2] = 0.0;
|
|
fVar9 = 35.0 - scrollPosition;
|
|
if (maxScrollStep <= 35.0 - scrollPosition) {
|
|
fVar9 = maxScrollStep;
|
|
}
|
|
fVar9 = fVar9 + scrollPosition;
|
|
this->_achievementScrollThruListPosition = fVar9;
|
|
fadeColor1._tint[3] = fVar9 / 35.0;
|
|
if (miniSpriteColor != &fadeColor1) {
|
|
(this->_achievementMiniSprite1)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._colorize[3] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite1)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite1)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite1)._color._tint[3] = fadeColor1._tint[3];
|
|
(this->_achievementMiniSprite1)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._offset[1] = 0.0;
|
|
(this->_achievementMiniSprite1)._color._offset[2] = 0.0;
|
|
fVar9 = this->_achievementScrollThruListPosition;
|
|
}
|
|
miniSpriteColor = &(this->_achievementMiniSprite8)._color;
|
|
fadeColor8._tint[0] = 1.0;
|
|
fadeColor8._tint[1] = 1.0;
|
|
fadeColor8._tint[2] = 1.0;
|
|
fadeColor8._offset[0] = 0.0;
|
|
fadeColor8._offset[1] = 0.0;
|
|
fadeColor8._offset[2] = 0.0;
|
|
fadeColor8._tint[3] = 1.0 - fVar9 / 35.0;
|
|
if (miniSpriteColor != &fadeColor8) {
|
|
(this->_achievementMiniSprite8)._color._colorize[0] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._colorize[1] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._colorize[2] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._colorize[3] = 0.0;
|
|
miniSpriteColor->_tint[0] = 1.0;
|
|
(this->_achievementMiniSprite8)._color._tint[1] = 1.0;
|
|
(this->_achievementMiniSprite8)._color._tint[2] = 1.0;
|
|
(this->_achievementMiniSprite8)._color._tint[3] = fadeColor8._tint[3];
|
|
(this->_achievementMiniSprite8)._color._offset[0] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._offset[1] = 0.0;
|
|
(this->_achievementMiniSprite8)._color._offset[2] = 0.0;
|
|
}
|
|
}
|
|
}
|
|
LAB_009ef2cd:
|
|
local_6c = (void *)0x0;
|
|
do {
|
|
pvVar8 = local_6c;
|
|
iVar5 = this->_maxAchievementID;
|
|
rawListIndex = GHIDRA_INT(local_6c) + this->_selectedAchievmentId + -4;
|
|
if (rawListIndex < 0) {
|
|
rawListIndex = rawListIndex + iVar5;
|
|
}
|
|
listIndex = rawListIndex - iVar5;
|
|
if (rawListIndex < iVar5) {
|
|
listIndex = rawListIndex;
|
|
}
|
|
uVar2 = this->_achievementIDList[listIndex];
|
|
if (uVar2 == 0xfffffffe) {
|
|
bVar7 = false;
|
|
}
|
|
else if (GHIDRA_INT(uVar2) < 0) {
|
|
LAB_009ef353:
|
|
bVar7 = true;
|
|
}
|
|
else if (uVar2 < 0x282) {
|
|
if (((uVar2 == 0) || ((g_manager->_persistentGameData)._achievements[uVar2] != 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)))))) goto LAB_009ef353;
|
|
bVar7 = false;
|
|
}
|
|
else {
|
|
bVar7 = false;
|
|
}
|
|
if (bVar7) {
|
|
if ((this->_achievementScrollThruListPosition == 0.0) && (local_6c == (void *)0x4)) {
|
|
sprintf(unlockedAnimName,GHIDRA_CAST<uint8_t *>("Icon%dUnlockedSelected"));
|
|
pbVar4 = (this->_achievementMiniSprite5)._animState._animData;
|
|
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
pbVar6 = unlockedAnimName;
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < *pbVar6;
|
|
if (bVar1 != *pbVar6) {
|
|
LAB_009ef3d0:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ef3d5;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < pbVar6[1];
|
|
if (bVar1 != pbVar6[1]) goto LAB_009ef3d0;
|
|
pbVar3 = pbVar3 + 2;
|
|
pbVar6 = pbVar6 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ef3d5:
|
|
if (uVar2 == 0) {
|
|
if ((pbVar4[0x34] == 0) || ((this->_achievementMiniSprite5)._animState._isPlaying != 0))
|
|
goto LAB_009ef521;
|
|
pbVar4 = unlockedAnimName;
|
|
goto LAB_009ef4bb;
|
|
}
|
|
}
|
|
pbVar4 = unlockedAnimName;
|
|
goto LAB_009ef4bb;
|
|
}
|
|
sprintf(unlockedAnimName,GHIDRA_CAST<uint8_t *>("Icon%dUnlocked"));
|
|
pbVar4 = unlockedAnimName;
|
|
LAB_009ef4ef:
|
|
bVar1 = ANM2::SetAnimation(&this->_achievementMiniSprite1 + GHIDRA_INT(pvVar8),pbVar4,1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(&this->_achievementMiniSprite1)[GHIDRA_INT(pvVar8)]._animState);
|
|
(&this->_achievementMiniSprite1)[GHIDRA_INT(pvVar8)]._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
else {
|
|
if ((this->_achievementScrollThruListPosition != 0.0) || (local_6c != (void *)0x4)) {
|
|
sprintf(lockedAnimName,GHIDRA_CAST<uint8_t *>("Icon%dLocked"));
|
|
pbVar4 = lockedAnimName;
|
|
goto LAB_009ef4ef;
|
|
}
|
|
sprintf(lockedAnimName,GHIDRA_CAST<uint8_t *>("Icon%dLockedSelected"));
|
|
pbVar4 = (this->_achievementMiniSprite5)._animState._animData;
|
|
if (pbVar4 != GHIDRA_CAST<uint8_t *>(0x0)) {
|
|
pbVar3 = pbVar4;
|
|
if (0xf < *GHIDRA_CAST<uint32_t *>((pbVar4 + 0x14))) {
|
|
pbVar3 = *GHIDRA_CAST<uint8_t **>(pbVar4);
|
|
}
|
|
pbVar6 = lockedAnimName;
|
|
do {
|
|
bVar1 = *pbVar3;
|
|
bVar7 = bVar1 < *pbVar6;
|
|
if (bVar1 != *pbVar6) {
|
|
LAB_009ef490:
|
|
uVar2 = -GHIDRA_UINT(bVar7) | 1;
|
|
goto LAB_009ef495;
|
|
}
|
|
if (bVar1 == 0) break;
|
|
bVar1 = pbVar3[1];
|
|
bVar7 = bVar1 < pbVar6[1];
|
|
if (bVar1 != pbVar6[1]) goto LAB_009ef490;
|
|
pbVar3 = pbVar3 + 2;
|
|
pbVar6 = pbVar6 + 2;
|
|
} while (bVar1 != 0);
|
|
uVar2 = 0;
|
|
LAB_009ef495:
|
|
if ((uVar2 == 0) &&
|
|
((pbVar4[0x34] == 0 || ((this->_achievementMiniSprite5)._animState._isPlaying != 0))))
|
|
goto LAB_009ef521;
|
|
}
|
|
pbVar4 = lockedAnimName;
|
|
LAB_009ef4bb:
|
|
bVar1 = ANM2::SetAnimation(&this->_achievementMiniSprite5,pbVar4,1);
|
|
if (bVar1 != 0) {
|
|
AnimationState::Rewind(&(this->_achievementMiniSprite5)._animState);
|
|
(this->_achievementMiniSprite5)._animState._isPlaying = 1;
|
|
}
|
|
}
|
|
LAB_009ef521:
|
|
local_6c = (void *)(GHIDRA_INT(local_6c) + 1);
|
|
if (8 < GHIDRA_INT(local_6c)) {
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|
|
} while( true );
|
|
}
|