Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ff2d5d87f
commit
3ce74c6e2d
331 files changed
+485
-7835
No files matched your search
@@ -0,0 +1,495 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 008378e0
|
||||
void GenericPrompt::Initialize(byte SmallPrompt)
|
||||
{
|
||||
char *ptr;
|
||||
uint size;
|
||||
std_string anm2Path;
|
||||
std_string smallAnm2Path;
|
||||
uint local_24;
|
||||
undefined1 *puStack_20;
|
||||
void *local_1c;
|
||||
undefined1 *puStack_18;
|
||||
undefined4 local_14;
|
||||
|
||||
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
||||
local_14 = 0xffffffff;
|
||||
puStack_18 = &LAB_00b02515;
|
||||
local_1c = ExceptionList;
|
||||
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
||||
ExceptionList = &local_1c;
|
||||
if (SmallPrompt == 0) {
|
||||
anm2Path._size = 0;
|
||||
anm2Path._capacity = 0xf;
|
||||
anm2Path._buf[0] = '\0';
|
||||
anm2Path._buf[1] = '\0';
|
||||
anm2Path._buf[2] = '\0';
|
||||
anm2Path._buf[3] = '\0';
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
|
||||
anm2Path._size = 0x18;
|
||||
anm2Path._capacity = 0x1f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/Prompt_YesNo.anm2",0x19);
|
||||
local_14 = 1;
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&anm2Path,1);
|
||||
if (anm2Path._capacity < 0x10) goto LAB_00837a6d;
|
||||
size = anm2Path._capacity + 1;
|
||||
ptr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
||||
if (0xfff < size) {
|
||||
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
||||
size = anm2Path._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
smallAnm2Path._size = 0;
|
||||
smallAnm2Path._capacity = 0xf;
|
||||
smallAnm2Path._buf[0] = '\0';
|
||||
smallAnm2Path._buf[1] = '\0';
|
||||
smallAnm2Path._buf[2] = '\0';
|
||||
smallAnm2Path._buf[3] = '\0';
|
||||
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(smallAnm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
|
||||
smallAnm2Path._size = 0x1e;
|
||||
smallAnm2Path._capacity = 0x1f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(smallAnm2Path._buf))) + 0x0))),"gfx/ui/Prompt_YesNo_Small.anm2",0x1f);
|
||||
local_14 = 0;
|
||||
(GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::Load(&smallAnm2Path,1);
|
||||
if (smallAnm2Path._capacity < 0x10) goto LAB_00837a6d;
|
||||
size = smallAnm2Path._capacity + 1;
|
||||
ptr = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(smallAnm2Path._buf))) + 0x0)));
|
||||
if (0xfff < size) {
|
||||
ptr = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(smallAnm2Path._buf)) + 0x0))) + -4));
|
||||
size = smallAnm2Path._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(smallAnm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(ptr))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
}
|
||||
operator_delete(ptr,size);
|
||||
LAB_00837a6d:
|
||||
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x12c)))) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x128)))) = 0;
|
||||
this->_isOnlineVote = 0;
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00837ab0
|
||||
void GenericPrompt::Update(byte processInput)
|
||||
{
|
||||
int layerId;
|
||||
byte bVar1;
|
||||
byte *currentAnimChar;
|
||||
uint compareResult;
|
||||
char *appearChar;
|
||||
byte *idleChar;
|
||||
bool isLess;
|
||||
byte *animData;
|
||||
void *currentAnimData;
|
||||
int selectedOption;
|
||||
|
||||
if (processInput != 0) {
|
||||
handle_input(this);
|
||||
}
|
||||
if ((this->_sprite)._loaded != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Update();
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._overlayAnimState)))->AnimationState::Update();
|
||||
}
|
||||
animData = (this->_sprite)._animState._animData;
|
||||
if ((animData != GHIDRA_CAST<byte *>(0x0)) && ((this->_sprite)._animState._isPlaying == 0)) {
|
||||
currentAnimChar = animData;
|
||||
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
||||
currentAnimChar = *GHIDRA_CAST<byte **>(animData);
|
||||
}
|
||||
appearChar = "Appear";
|
||||
do {
|
||||
bVar1 = *currentAnimChar;
|
||||
isLess = bVar1 < (byte)*appearChar;
|
||||
if (bVar1 != *appearChar) {
|
||||
LAB_00837b22:
|
||||
compareResult = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_00837b27;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = currentAnimChar[1];
|
||||
isLess = bVar1 < (byte)appearChar[1];
|
||||
if (bVar1 != appearChar[1]) goto LAB_00837b22;
|
||||
currentAnimChar = currentAnimChar + 2;
|
||||
appearChar = appearChar + 2;
|
||||
} while (bVar1 != 0);
|
||||
compareResult = 0;
|
||||
LAB_00837b27:
|
||||
if (compareResult == 0) {
|
||||
currentAnimChar = animData;
|
||||
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
||||
currentAnimChar = *GHIDRA_CAST<byte **>(animData);
|
||||
}
|
||||
idleChar = s_Idle;
|
||||
do {
|
||||
bVar1 = *currentAnimChar;
|
||||
isLess = bVar1 < *idleChar;
|
||||
if (bVar1 != *idleChar) {
|
||||
LAB_00837b60:
|
||||
compareResult = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_00837b65;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = currentAnimChar[1];
|
||||
isLess = bVar1 < idleChar[1];
|
||||
if (bVar1 != idleChar[1]) goto LAB_00837b60;
|
||||
currentAnimChar = currentAnimChar + 2;
|
||||
idleChar = idleChar + 2;
|
||||
} while (bVar1 != 0);
|
||||
compareResult = 0;
|
||||
LAB_00837b65:
|
||||
if (((compareResult != 0) || (animData[0x34] != 0)) &&
|
||||
(bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1), bVar1 != 0)) {
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
||||
(this->_sprite)._animState._isPlaying = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
selectedOption = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x128))));
|
||||
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
||||
if ((*GHIDRA_CAST<int *>((GHIDRA_INT((this->_sprite)._animState._animation) + 0x80)) < 2) &&
|
||||
(KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("LayerId out of bounds\n")),
|
||||
*GHIDRA_CAST<int *>((GHIDRA_INT((this->_sprite)._animState._animation) + 0x80)) < 2)) {
|
||||
return;
|
||||
}
|
||||
currentAnimData = (this->_sprite)._animState._animData;
|
||||
layerId = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(currentAnimData) + 0x3c));
|
||||
if (((currentAnimData == (void *)0x0) || (layerId < 0)) ||
|
||||
(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(currentAnimData) + 0x1c)) <= layerId)) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<byte *>("id out of bounds\n"));
|
||||
}
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_INT((this->_sprite)._animState._layerFrames) + layerId * 4)) = 0;
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::AdvanceLayerPosition(layerId,(float)selectedOption);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 00837c10
|
||||
void GenericPrompt::Render()
|
||||
{
|
||||
KColor color;
|
||||
float *textTopFrame;
|
||||
int iVar1;
|
||||
int bodyLineWidth;
|
||||
void *glyphRun;
|
||||
AnimationState *secondAnimState;
|
||||
undefined4 *lineText;
|
||||
float fVar2;
|
||||
float fVar3;
|
||||
float textScaleY;
|
||||
float fVar4;
|
||||
float fVar5;
|
||||
float fVar6;
|
||||
undefined4 fontSettings;
|
||||
undefined4 local_78;
|
||||
undefined4 local_74;
|
||||
undefined4 local_70;
|
||||
undefined4 local_6c;
|
||||
undefined4 local_68;
|
||||
undefined4 local_64;
|
||||
KColor textColor;
|
||||
undefined1 glyphRunBuf [16];
|
||||
Vector layoutScale;
|
||||
Vector screenCenter;
|
||||
float bodyLineX;
|
||||
GenericPrompt *local_28;
|
||||
float textX;
|
||||
float local_20;
|
||||
float lineY;
|
||||
Font *local_18;
|
||||
Font *bodyFont;
|
||||
void *local_10;
|
||||
undefined1 *puStack_c;
|
||||
undefined4 local_8;
|
||||
Font *titleFont;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00b0255d;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
if (((this->_sprite)._animState._animData != (void *)0x0) &&
|
||||
((this->_sprite)._animState._isPlaying != 0)) {
|
||||
screenCenter.x = g_screenWidth * 0.5;
|
||||
local_18 = &g_manager->_font3_TeamMeatEx16;
|
||||
bodyFont = &g_manager->_font2_TeamMeatEx12;
|
||||
screenCenter.y = g_screenHeight * 0.5;
|
||||
local_28 = this;
|
||||
if ((this->_sprite)._loaded != 0) {
|
||||
if ((this->_sprite)._overlayRenderFirst == 0) {
|
||||
AnimationState::Render
|
||||
(&(this->_sprite)._animState,&screenCenter,&g_vectorZero,&g_vectorZero);
|
||||
secondAnimState = &(this->_sprite)._overlayAnimState;
|
||||
}
|
||||
else {
|
||||
AnimationState::Render
|
||||
(&(this->_sprite)._overlayAnimState,&screenCenter,&g_vectorZero,&g_vectorZero);
|
||||
secondAnimState = &(this->_sprite)._animState;
|
||||
}
|
||||
AnimationState::Render(secondAnimState,&screenCenter,&g_vectorZero,&g_vectorZero);
|
||||
}
|
||||
if ((this->_sprite)._animState._animData != (void *)0x0) {
|
||||
textTopFrame = (GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("TextTop"));
|
||||
if (textTopFrame != GHIDRA_CAST<float *>(0x0)) {
|
||||
(GHIDRA_CAST<KColor *>((&textColor)))->KColor::SetFromARGB(0xff362f2d);
|
||||
titleFont = local_18;
|
||||
fVar6 = *textTopFrame;
|
||||
lineText = GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x114))));
|
||||
fVar3 = textTopFrame[1];
|
||||
local_20 = 2.8026e-45;
|
||||
textX = fVar6;
|
||||
lineY = fVar3;
|
||||
do {
|
||||
if (GHIDRA_CAST<short *>(*lineText) == GHIDRA_CAST<short *>(0x0)) {
|
||||
textScaleY = textTopFrame[5];
|
||||
}
|
||||
else {
|
||||
fontSettings = 0;
|
||||
local_78 = 0xffff;
|
||||
local_74 = 0;
|
||||
local_70 = 0x3f800000;
|
||||
local_6c = 0xffffffff;
|
||||
local_68 = 0;
|
||||
local_64 = 0;
|
||||
local_8 = 0;
|
||||
fVar5 = 0.5;
|
||||
fVar2 = textTopFrame[5];
|
||||
fVar4 = textTopFrame[4];
|
||||
fVar3 = g_screenHeight * 0.5 + fVar3;
|
||||
iVar1 = (GHIDRA_CAST<Font *>((titleFont)))->Font::get_string_width_utf16(GHIDRA_CAST<short *>(*lineText),-1);
|
||||
Font::draw_string_wide
|
||||
(titleFont,GHIDRA_CAST<short *>(*lineText),
|
||||
(g_screenWidth * fVar5 + fVar6) -
|
||||
(float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]) * fVar5 *
|
||||
textTopFrame[4],fVar3,fVar4,fVar2,&textColor,&fontSettings);
|
||||
textScaleY = textTopFrame[5];
|
||||
fVar3 = lineY + textScaleY * 17.0;
|
||||
fVar6 = textX;
|
||||
lineY = fVar3;
|
||||
}
|
||||
lineText = lineText + 1;
|
||||
local_20 = (float)(GHIDRA_INT(local_20) + -1);
|
||||
local_18 = GHIDRA_CAST<Font *>(textScaleY);
|
||||
} while (local_20 != 0.0);
|
||||
lineText = GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((local_28)) + 0x11c))));
|
||||
iVar1 = 3;
|
||||
fVar3 = textScaleY * 12.0 + fVar3;
|
||||
local_20 = fVar3;
|
||||
do {
|
||||
if (GHIDRA_CAST<short *>(*lineText) != GHIDRA_CAST<short *>(0x0)) {
|
||||
fontSettings = 0;
|
||||
local_78 = 0xffff;
|
||||
local_74 = 0;
|
||||
local_70 = 0x3f800000;
|
||||
local_6c = 0xffffffff;
|
||||
local_68 = 0;
|
||||
local_64 = 0;
|
||||
local_8 = 1;
|
||||
fVar4 = 0.5;
|
||||
fVar2 = textTopFrame[4];
|
||||
lineY = g_screenHeight * 0.5 + fVar3;
|
||||
local_28 = GHIDRA_CAST<GenericPrompt *>(fVar2);
|
||||
bodyLineWidth = (GHIDRA_CAST<Font *>((bodyFont)))->Font::get_string_width_utf16(GHIDRA_CAST<short *>(*lineText),-1);
|
||||
bodyLineX = (g_screenWidth * fVar4 + fVar6) -
|
||||
(float)((double)bodyLineWidth +
|
||||
__uint_to_double_fixup[-(bodyLineWidth >> 0x1f)]) * fVar4 *
|
||||
textTopFrame[4];
|
||||
layoutScale.x = fVar2;
|
||||
layoutScale.y = textScaleY;
|
||||
glyphRun = (GHIDRA_CAST<Font *>((bodyFont)))->Font::layout_glyphs(glyphRunBuf,GHIDRA_CAST<byte *>(*lineText),&fontSettings,
|
||||
&layoutScale);
|
||||
local_8 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),2);
|
||||
color._green = textColor._green;
|
||||
color._red = textColor._red;
|
||||
color._blue = textColor._blue;
|
||||
color._alpha = textColor._alpha;
|
||||
color._unk = textColor._unk;
|
||||
Font::draw_glyph_run
|
||||
(bodyFont,bodyLineX,lineY,glyphRun,(float)local_28,(float)local_18,color,
|
||||
&fontSettings);
|
||||
std::vector<12byte>::clear();
|
||||
std::vector<12byte>::_Tidy();
|
||||
textScaleY = textTopFrame[5];
|
||||
fVar3 = local_20 + textScaleY * 13.0;
|
||||
local_20 = fVar3;
|
||||
local_18 = GHIDRA_CAST<Font *>(textScaleY);
|
||||
}
|
||||
lineText = lineText + 1;
|
||||
iVar1 = iVar1 + -1;
|
||||
fVar6 = textX;
|
||||
} while (iVar1 != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00837fe0
|
||||
void GenericPrompt::handle_input()
|
||||
{
|
||||
byte bVar1;
|
||||
int localEntry;
|
||||
byte *animName;
|
||||
uint uVar2;
|
||||
byte *idleCursor;
|
||||
int controllerId;
|
||||
bool isLess;
|
||||
|
||||
controllerId = -1;
|
||||
if (g_manager->_netplayManager != *GHIDRA_CAST<NetplayManager *>((g_manager + 1))) {
|
||||
localEntry = FUN_0090b070();
|
||||
if ((localEntry != 0) && (*GHIDRA_CAST<int *>((localEntry + 0x378)) != 0)) {
|
||||
controllerId = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((localEntry + 0x378)) + 0xc));
|
||||
}
|
||||
}
|
||||
bVar1 = input_is_action_triggered(g_manager,0x14,controllerId,GHIDRA_CAST<Entity *>(0x0),0);
|
||||
if (bVar1 == 0) {
|
||||
bVar1 = input_is_action_triggered(g_manager,0x15,controllerId,GHIDRA_CAST<Entity *>(0x0),0);
|
||||
if (bVar1 == 0) goto LAB_0083804d;
|
||||
}
|
||||
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x128)))) = *GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x128)))) - 1U & 1;
|
||||
LAB_0083804d:
|
||||
bVar1 = input_is_action_triggered(g_manager,0xe,controllerId,GHIDRA_CAST<Entity *>(0x0),0);
|
||||
if (((bVar1 != 0) && (animName = (this->_sprite)._animState._animData, animName != GHIDRA_CAST<byte *>(0x0)))
|
||||
&& ((this->_sprite)._animState._isPlaying != 0)) {
|
||||
if (0xf < *GHIDRA_CAST<uint *>((animName + 0x14))) {
|
||||
animName = *GHIDRA_CAST<byte **>(animName);
|
||||
}
|
||||
idleCursor = s_Idle;
|
||||
do {
|
||||
bVar1 = *animName;
|
||||
isLess = bVar1 < *idleCursor;
|
||||
if (bVar1 != *idleCursor) {
|
||||
LAB_008380a0:
|
||||
uVar2 = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_008380a5;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = animName[1];
|
||||
isLess = bVar1 < idleCursor[1];
|
||||
if (bVar1 != idleCursor[1]) goto LAB_008380a0;
|
||||
animName = animName + 2;
|
||||
idleCursor = idleCursor + 2;
|
||||
} while (bVar1 != 0);
|
||||
uVar2 = 0;
|
||||
LAB_008380a5:
|
||||
if (uVar2 == 0) {
|
||||
*GHIDRA_CAST<uint *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x12c)))) = 2 - GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x128)))) != 0));
|
||||
if (this->_isOnlineVote != 0) {
|
||||
online_vote_send(GHIDRA_UINT((*GHIDRA_CAST<int *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x128)))) == 0)));
|
||||
return;
|
||||
}
|
||||
Disappear(&this->_sprite);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 008380f0
|
||||
void GenericPrompt::Show(byte UNK)
|
||||
{
|
||||
byte bVar1;
|
||||
byte *animName;
|
||||
uint cmpResult;
|
||||
char *appearName;
|
||||
bool isLess;
|
||||
byte *animData;
|
||||
|
||||
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x12c)))) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>(&(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>((this)) + 0x128)))) = 0;
|
||||
animData = (this->_sprite)._animState._animData;
|
||||
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
||||
animName = animData;
|
||||
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
||||
animName = *GHIDRA_CAST<byte **>(animData);
|
||||
}
|
||||
appearName = "Appear";
|
||||
do {
|
||||
bVar1 = *animName;
|
||||
isLess = bVar1 < (byte)*appearName;
|
||||
if (bVar1 != *appearName) {
|
||||
LAB_00838142:
|
||||
cmpResult = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_00838147;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = animName[1];
|
||||
isLess = bVar1 < (byte)appearName[1];
|
||||
if (bVar1 != appearName[1]) goto LAB_00838142;
|
||||
animName = animName + 2;
|
||||
appearName = appearName + 2;
|
||||
} while (bVar1 != 0);
|
||||
cmpResult = 0;
|
||||
LAB_00838147:
|
||||
if ((cmpResult == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0))))
|
||||
goto LAB_00838173;
|
||||
}
|
||||
bVar1 = (GHIDRA_CAST<ANM2 *>((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Appear"),1);
|
||||
if (bVar1 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((&(this->_sprite)._animState)))->AnimationState::Rewind();
|
||||
(this->_sprite)._animState._isPlaying = 1;
|
||||
}
|
||||
LAB_00838173:
|
||||
this->_isOnlineVote = UNK;
|
||||
return;
|
||||
}
|
||||
|
||||
// 00838190
|
||||
void GenericPrompt::Disappear(ANM2 *anm2)
|
||||
{
|
||||
byte bVar1;
|
||||
byte *animName;
|
||||
uint compareResult;
|
||||
char *targetName;
|
||||
bool isLess;
|
||||
byte *animData;
|
||||
|
||||
animData = (anm2->_animState)._animData;
|
||||
if (animData != GHIDRA_CAST<byte *>(0x0)) {
|
||||
animName = animData;
|
||||
if (0xf < *GHIDRA_CAST<uint *>((animData + 0x14))) {
|
||||
animName = *GHIDRA_CAST<byte **>(animData);
|
||||
}
|
||||
targetName = "Dissappear";
|
||||
do {
|
||||
bVar1 = *animName;
|
||||
isLess = bVar1 < (byte)*targetName;
|
||||
if (bVar1 != *targetName) {
|
||||
LAB_008381d0:
|
||||
compareResult = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_008381d5;
|
||||
}
|
||||
if (bVar1 == 0) break;
|
||||
bVar1 = animName[1];
|
||||
isLess = bVar1 < (byte)targetName[1];
|
||||
if (bVar1 != targetName[1]) goto LAB_008381d0;
|
||||
animName = animName + 2;
|
||||
targetName = targetName + 2;
|
||||
} while (bVar1 != 0);
|
||||
compareResult = 0;
|
||||
LAB_008381d5:
|
||||
if (compareResult == 0) {
|
||||
if (animData[0x34] == 0) {
|
||||
return;
|
||||
}
|
||||
if ((anm2->_animState)._isPlaying != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
bVar1 = (GHIDRA_CAST<ANM2 *>((anm2)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Dissappear"),1);
|
||||
if (bVar1 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((&anm2->_animState)))->AnimationState::Rewind();
|
||||
(anm2->_animState)._isPlaying = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user