diff --git a/generated-src/achievement_overlay.cpp b/generated-src/achievement_overlay.cpp index 93bc9e4..ac24b01 100644 --- a/generated-src/achievement_overlay.cpp +++ b/generated-src/achievement_overlay.cpp @@ -13,9 +13,9 @@ AchievementOverlay::~AchievementOverlay() ExceptionList = &local_10; _eh_vector_destructor_iterator_(this->_entries,0x34,0x282,FUN_00420b00); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_sprite); + AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_sprite)._animState); (GHIDRA_CAST(((this->_sprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->msvc::string::_Tidy_deallocate(); msvc::deque<4byte>::~deque(); @@ -52,7 +52,7 @@ void AchievementOverlay::load_graphics() anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/achievement/Achievements.anm2",0x25); local_14 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_sprite,&anm2Path,1); if (0xf < anm2Path._capacity) { size = anm2Path._capacity + 1; ptr = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))); @@ -404,8 +404,8 @@ void AchievementOverlay::Update() local_c[0] = this; if ((((iVar2 != 0) && (this->_isPopupBlocked == 0)) && ((g_manager->_framecount & 1) == 0)) && ((this->_sprite)._loaded != 0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); iVar2 = this->_state; } if (iVar2 == 1) { @@ -413,7 +413,7 @@ void AchievementOverlay::Update() ((this->_sprite)._animState._isPlaying == 0)) { this->_frame = 0; this->_state = 2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); manager = g_manager; local_c[0] = GHIDRA_CAST(&DAT_00000008); seed_fart_sound_override(GHIDRA_CAST(local_c)); @@ -425,7 +425,7 @@ void AchievementOverlay::Update() this->_frame = iVar2 + 1; if ((0x5a < iVar2) || (bVar1 = input_is_action_pressed(0xe,-1,GHIDRA_CAST(0x0),iVar2), bVar1 != 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Dissapear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Dissapear"),0); this->_state = 3; } } @@ -460,21 +460,21 @@ void AchievementOverlay::Update() } (this->_sprite)._scale.x = spriteScale; (this->_sprite)._scale.y = spriteScale; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_visible = bVar1; pngFilename = &this->_entries[this->_currentEntry]._gfx; if (pngFilename->_size == 0) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x3)); layer->_visible = 0; KAGE_LogMessage(8,GHIDRA_CAST("No sprite for achievement %d (%s)\n")); } else { (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::ReplaceSpritesheet(3,pngFilename); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(unk); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + ANM2::LoadGraphics(&this->_sprite,unk); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x3)); layer->_visible = 1; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); } return; } diff --git a/generated-src/animation_data.cpp b/generated-src/animation_data.cpp deleted file mode 100644 index 02d1789..0000000 --- a/generated-src/animation_data.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "classes.h" - -// 0040b520 -int AnimationData::find_null_index(uint8_t *name) -{ - int iVar1; - uint8_t *nameChars; - uint32_t cmpResult; - uint8_t *queryChars; - uint8_t *nullName; - int nullIndex; - bool isLess; - uint8_t ch; - - iVar1 = *GHIDRA_CAST((GHIDRA_INT(&this[2]._layerCount) + 2)); - nullIndex = 0; - if (0 < iVar1) { - nullName = *GHIDRA_CAST((GHIDRA_INT(&this[2]._animLayers) + 2)); - do { - nameChars = nullName; - if (0xf < *GHIDRA_CAST((nullName + 0x14))) { - nameChars = *GHIDRA_CAST(nullName); - } - queryChars = name; - do { - ch = *nameChars; - isLess = ch < *queryChars; - if (ch != *queryChars) { -LAB_0040b565: - cmpResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040b56a; - } - if (ch == 0) break; - ch = nameChars[1]; - isLess = ch < queryChars[1]; - if (ch != queryChars[1]) goto LAB_0040b565; - nameChars = nameChars + 2; - queryChars = queryChars + 2; - } while (ch != 0); - cmpResult = 0; -LAB_0040b56a: - if (cmpResult == 0) { - return nullIndex; - } - nullIndex = nullIndex + 1; - nullName = nullName + 0x18; - } while (nullIndex < iVar1); - } - return -1; -} diff --git a/generated-src/animation_layer.cpp b/generated-src/animation_layer.cpp deleted file mode 100644 index dc810da..0000000 --- a/generated-src/animation_layer.cpp +++ /dev/null @@ -1,461 +0,0 @@ -#include "classes.h" - -// 008e3db0 -void AnimationLayer::RenderFrame() -{ - code *pcVar1; - Vector pos; - uint8_t bVar2; - uint8_t *pbVar3; - uint32_t uVar4; - float *widgetButtonFrame; - void *glyphs; - uint8_t *pbVar5; - char *cmpName; - AnimationState *overlayAnim; - int iVar6; - int modCount; - int *modIter; - bool bVar7; - float viewY; - uint8_t glyphBuffer [20]; - uint64_t rngShifts; - uint32_t local_198; - uint32_t local_194; - uint32_t local_190; - uint32_t local_18c; - uint32_t local_188; - uint32_t local_184; - uint32_t local_180; - uint32_t local_17c; - uint32_t local_178; - uint32_t local_174; - uint32_t local_170; - uint32_t local_16c; - uint32_t local_168; - uint32_t local_164; - uint32_t local_160; - uint32_t uStack_15c; - uint32_t uStack_158; - uint32_t uStack_154; - Vector textScale; - uint32_t local_148; - uint32_t uStack_144; - Vector VStack_140; - uint8_t *local_134; - AnimationLayer *menu; - Manager *gameManager; - Vector iconPos; - Vector origin; - Vector local_118; - float local_110; - Vector local_10c; - float local_104; - float originY; - float originX; - char baseLabel [72]; - char baseLabelEnabled [72]; - uint8_t textBuffer [68]; - uint32_t local_24; - uint8_t *puStack_20; - void *local_1c; - uint8_t *puStack_18; - uint32_t local_14; - KColor disabledModColor; - Manager *manager; - MenuManager *menuManager; - uint8_t *menuSprite; - KColor modColor; - int scrollRow; - - puStack_20 = textBuffer + 100; - local_14 = 0xffffffff; - puStack_18 = &LAB_00b06981; - local_1c = ExceptionList; - local_24 = __security_cookie ^ GHIDRA_UINT((textBuffer + 0x58)); - ExceptionList = &local_1c; - local_134 = &(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1))); - pbVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))); - origin.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))) + 200.0; - origin.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST((this + 4)) + 0.0; - menu = this; - originY = origin.y; - originX = origin.x; - if (pbVar3 == GHIDRA_CAST(0x0)) { -LAB_008e3e98: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(local_134))))->ANM2::SetAnimation(&DAT_00b6767c,1); - pbVar3 = puStack_20; - if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); - *GHIDRA_CAST((this + 0x1c)) = 1; - pbVar3 = puStack_20; - } - } - else { - if (0xf < *GHIDRA_CAST((pbVar3 + 0x14))) { - pbVar3 = *GHIDRA_CAST(pbVar3); - } - pbVar5 = &DAT_00b6767c; - do { - bVar2 = *pbVar3; - bVar7 = bVar2 < *pbVar5; - if (bVar2 != *pbVar5) { -LAB_008e3e80: - uVar4 = -GHIDRA_UINT(bVar7) | 1; - goto LAB_008e3e85; - } - if (bVar2 == 0) break; - bVar2 = pbVar3[1]; - bVar7 = bVar2 < pbVar5[1]; - if (bVar2 != pbVar5[1]) goto LAB_008e3e80; - pbVar3 = pbVar3 + 2; - pbVar5 = pbVar5 + 2; - } while (bVar2 != 0); - uVar4 = 0; -LAB_008e3e85: - if ((uVar4 != 0) || - ((pbVar3 = textBuffer + 100, *GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))) + 0x34)) != '\0' && - (pbVar3 = textBuffer + 100, *GHIDRA_CAST((this + 0x1c)) == '\0')))) goto LAB_008e3e98; - } - puStack_20 = pbVar3; - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5d])) + 0x2))) != '\0') { - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) == '\0') { - AnimationState::Render - (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))),&origin,&g_vectorZero,&g_vectorZero); - AnimationState::Render(GHIDRA_CAST((this + 0x20)),&origin,&g_vectorZero,&g_vectorZero); - originY = origin.y; - originX = origin.x; - } - else { - AnimationState::Render(GHIDRA_CAST((this + 0x20)),&origin,&g_vectorZero,&g_vectorZero); - AnimationState::Render - (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))),&origin,&g_vectorZero,&g_vectorZero); - originY = origin.y; - originX = origin.x; - } - } - if (((g_menuControllerIndex != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))) != 0)) && - (widgetButtonFrame = - AnimationState::GetNullFrame - (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))),GHIDRA_CAST("WidgetButton")), - widgetButtonFrame != GHIDRA_CAST(0x0))) { - iconPos.y = widgetButtonFrame[1] + originY; - iconPos.x = *widgetButtonFrame + originX; - pos.y = iconPos.y; - pos.x = iconPos.x; - render_input_button_icon - (g_menuControllerIndex,0x1c,0,1, - (ColorMod)ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))),pos - ); - } - local_10c.y = 9.80909e-45; - gameManager = g_manager; - local_118.y = 1.7299e-41; - rngShifts = 0x900000005; - local_110 = 0.0; - local_104 = (float)((GHIDRA_UINT(((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((g_manager)) + 0x2a6c4)))) - g_manager->_modManager >> 2) * - 0x19)) >> 5) + 1); - if (local_104 != 0.0) { - do { - if (local_118.y == 0.0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("RNG Seed is zero!\n")); - pcVar1 = (code *)swi(3); - (*pcVar1)(); - return; - } - uVar4 = GHIDRA_UINT(local_118.y) >> ((uint8_t)rngShifts & 0x1f) ^ GHIDRA_UINT(local_118.y); - uVar4 = uVar4 << ((uint8_t)((uint64_t)rngShifts >> 0x20) & 0x1f) ^ uVar4; - local_118.y = (float)(uVar4 >> (SUB41(local_10c.y,0) & 0x1f) ^ uVar4); - sprintf_s(textBuffer,0x40,GHIDRA_CAST("Piece%d")); - pbVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))); - if (pbVar3 == GHIDRA_CAST(0x0)) { -LAB_008e414c: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))))))->ANM2::SetAnimation(textBuffer,1); - if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); - *GHIDRA_CAST((this + 0x1c)) = 1; - } - } - else { - if (0xf < *GHIDRA_CAST((pbVar3 + 0x14))) { - pbVar3 = *GHIDRA_CAST(pbVar3); - } - pbVar5 = textBuffer; - do { - bVar2 = *pbVar3; - bVar7 = bVar2 < *pbVar5; - if (bVar2 != *pbVar5) { -LAB_008e4134: - uVar4 = -GHIDRA_UINT(bVar7) | 1; - goto LAB_008e4139; - } - if (bVar2 == 0) break; - bVar2 = pbVar3[1]; - bVar7 = bVar2 < pbVar5[1]; - if (bVar2 != pbVar5[1]) goto LAB_008e4134; - pbVar3 = pbVar3 + 2; - pbVar5 = pbVar5 + 2; - } while (bVar2 != 0); - uVar4 = 0; -LAB_008e4139: - if ((uVar4 != 0) || - ((*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))) + 0x34)) != '\0' && - (*GHIDRA_CAST((this + 0x1c)) == '\0')))) goto LAB_008e414c; - } - local_110 = (float)(GHIDRA_INT(local_110) + 1); - VStack_140.x = originX + 0.0; - VStack_140.y = (float)GHIDRA_INT(local_110) * 32.0 + originY; - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5d])) + 0x2))) != '\0') { - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) == '\0') { - AnimationState::Render - (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))),&VStack_140,&g_vectorZero,&g_vectorZero - ); - overlayAnim = GHIDRA_CAST((this + 0x20)); - } - else { - AnimationState::Render - (GHIDRA_CAST((this + 0x20)),&VStack_140,&g_vectorZero,&g_vectorZero); - overlayAnim = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))); - } - AnimationState::Render(overlayAnim,&VStack_140,&g_vectorZero,&g_vectorZero); - } - } while (GHIDRA_INT(local_110) < GHIDRA_INT(local_104)); - } - pbVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))); - if (pbVar3 != GHIDRA_CAST(0x0)) { - if (0xf < *GHIDRA_CAST((pbVar3 + 0x14))) { - pbVar3 = *GHIDRA_CAST(pbVar3); - } - cmpName = "Bottom"; - do { - bVar2 = *pbVar3; - bVar7 = bVar2 < (uint8_t)*cmpName; - if (bVar2 != *cmpName) { -LAB_008e4255: - uVar4 = -GHIDRA_UINT(bVar7) | 1; - goto LAB_008e425a; - } - if (bVar2 == 0) break; - bVar2 = pbVar3[1]; - bVar7 = bVar2 < (uint8_t)cmpName[1]; - if (bVar2 != cmpName[1]) goto LAB_008e4255; - pbVar3 = pbVar3 + 2; - cmpName = cmpName + 2; - } while (bVar2 != 0); - uVar4 = 0; -LAB_008e425a: - if ((uVar4 == 0) && - ((*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))) + 0x34)) == '\0' || (*GHIDRA_CAST((this + 0x1c)) != '\0') - ))) goto LAB_008e428b; - } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))))))->ANM2::SetAnimation(GHIDRA_CAST("Bottom"),1); - if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); - *GHIDRA_CAST((this + 0x1c)) = 1; - } -LAB_008e428b: - local_10c.x = originX + 0.0; - local_10c.y = (float)GHIDRA_INT(local_104) * 32.0 + originY; - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5d])) + 0x2))) != '\0') { - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) == '\0') { - AnimationState::Render - (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))),&local_10c,&g_vectorZero,&g_vectorZero); - overlayAnim = GHIDRA_CAST((this + 0x20)); - } - else { - AnimationState::Render(GHIDRA_CAST((this + 0x20)),&local_10c,&g_vectorZero,&g_vectorZero) - ; - overlayAnim = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))); - } - AnimationState::Render(overlayAnim,&local_10c,&g_vectorZero,&g_vectorZero); - } - modIter = GHIDRA_CAST(gameManager->_modManager); - modCount = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameManager)) + 0x2a6c4)))) - GHIDRA_INT(modIter) >> 2; - if ((g_manager->_optionsConfig)._enableMods == 0) { - local_104 = 0.0; - if (modCount != 0) { - originX = originX - 90.0; - local_118.x = 0.8; - local_118.y = 1.0; - do { - local_10c.y = (float)(GHIDRA_INT(local_104) + 1); - sprintf_s(textBuffer,0x40,GHIDRA_CAST("%d.%s")); - local_160 = 0x3f008081; - uStack_15c = 0x3f008081; - uStack_158 = 0x3f008081; - uStack_154 = 0x3f800000; - if (*GHIDRA_CAST((*modIter + 0xfe)) != '\0') { - local_160 = 0x3f800000; - uStack_15c = 0x3f000000; - uStack_158 = 0x3f000000; - uStack_154 = 0x3f800000; - strncpy(baseLabel,GHIDRA_CAST(textBuffer),0x40); - sprintf_s(textBuffer,0x40,GHIDRA_CAST("%s[Old]")); - } - manager = g_manager; - local_198 = 0; - local_194 = 0xffff; - local_190 = 0; - local_18c = 0x3f800000; - local_188 = 0xffffffff; - local_184 = 0; - local_180 = 0; - local_14 = 2; - local_134 = (uint8_t *) - ((float)((double)GHIDRA_INT(local_104) + - __uint_to_double_fixup[-(GHIDRA_INT(local_104) >> 0x1f)]) * 25.0 + originY); - glyphs = Font::measure_string - (&g_manager->_font2_TeamMeatEx12,glyphBuffer,textBuffer,&local_198, - &local_118); - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),3); - disabledModColor._green = (float)uStack_15c; - disabledModColor._red = (float)local_160; - disabledModColor._blue = (float)uStack_158; - disabledModColor._alpha = (float)uStack_154; - disabledModColor._unk = 0; - Font::render_glyph_quads - (&manager->_font2_TeamMeatEx12,glyphs,originX,(float)local_134,0.8,1.0, - disabledModColor,&local_198); - msvc::vector<12byte>::clear(); - msvc::vector<12byte>::_Tidy(); - modIter = modIter + 1; - local_14 = 0xffffffff; - local_104 = local_10c.y; - } while (GHIDRA_UINT(local_10c.y) < - GHIDRA_UINT((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameManager)) + 0x2a6c4)))) - gameManager->_modManager >> 2))); - this = menu; - } - } - else { - local_118.y = 0.0; - if (modCount != 0) { - textScale.x = 0.8; - local_110 = originX - 90.0; - textScale.y = 1.0; - do { - local_104 = (float)(GHIDRA_INT(local_118.y) + 1); - sprintf_s(textBuffer,0x40,GHIDRA_CAST("%d.%s")); - local_148 = 0; - uStack_144 = 0; - VStack_140.x = 0.0; - if (*GHIDRA_CAST((*modIter + 0xfc)) == '\0') { - local_148 = 0x3f008081; - uStack_144 = 0x3f008081; - VStack_140.x = 0.5019608; - } - VStack_140.y = 1.0; - if (*GHIDRA_CAST((*modIter + 0xfe)) != '\0') { - local_148 = 0x3f800000; - uStack_144 = 0; - VStack_140.x = 0.0; - VStack_140.y = 1.0; - strncpy(baseLabelEnabled,GHIDRA_CAST(textBuffer),0x40); - sprintf_s(textBuffer,0x40,GHIDRA_CAST("%s[Old]")); - } - manager = g_manager; - local_17c = 0; - local_178 = 0xffff; - local_174 = 0; - local_170 = 0x3f800000; - local_16c = 0xffffffff; - local_168 = 0; - local_164 = 0; - local_14 = 0; - local_10c.y = (float)((double)GHIDRA_INT(local_118.y) + - __uint_to_double_fixup[-(GHIDRA_INT(local_118.y) >> 0x1f)]) * 25.0 + originY; - glyphs = Font::measure_string - (&g_manager->_font2_TeamMeatEx12,&local_160,textBuffer,&local_17c, - &textScale); - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),1); - modColor._green = (float)uStack_144; - modColor._red = (float)local_148; - modColor._blue = VStack_140.x; - modColor._alpha = VStack_140.y; - modColor._unk = 0; - Font::render_glyph_quads - (&manager->_font2_TeamMeatEx12,glyphs,local_110,local_10c.y,0.8,1.0,modColor, - &local_17c); - msvc::vector<12byte>::clear(); - msvc::vector<12byte>::_Tidy(); - this = menu; - local_14 = 0xffffffff; - if (*GHIDRA_CAST(menu) == local_118.y) { - local_10c.y = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(menu[0x16])) + 0x2)))); - if (GHIDRA_CAST(local_10c.y) == GHIDRA_CAST(0x0)) { -LAB_008e45d3: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(menu[5])) + 0x1)))))))->ANM2::SetAnimation(GHIDRA_CAST("Cursor"),1); - menuSprite = local_134; - if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((local_134 + 0x30)))))->AnimationState::Rewind(); - menuSprite[0x44] = 1; - this = menu; - } - } - else { - pbVar3 = GHIDRA_CAST(local_10c.y); - if (0xf < *GHIDRA_CAST((GHIDRA_CAST(local_10c.y) + 0x14))) { - pbVar3 = *GHIDRA_CAST(local_10c.y); - } - cmpName = "Cursor"; - do { - bVar2 = *pbVar3; - bVar7 = bVar2 < (uint8_t)*cmpName; - if (bVar2 != *cmpName) { -LAB_008e45b0: - uVar4 = -GHIDRA_UINT(bVar7) | 1; - goto LAB_008e45b5; - } - if (bVar2 == 0) break; - bVar2 = pbVar3[1]; - bVar7 = bVar2 < (uint8_t)cmpName[1]; - if (bVar2 != cmpName[1]) goto LAB_008e45b0; - pbVar3 = pbVar3 + 2; - cmpName = cmpName + 2; - } while (bVar2 != 0); - uVar4 = 0; -LAB_008e45b5: - if ((uVar4 != 0) || - ((*GHIDRA_CAST((GHIDRA_CAST(local_10c.y) + 0x34)) != 0 && (*GHIDRA_CAST((menu + 0x1c)) == '\0')))) - goto LAB_008e45d3; - } - iconPos.x = originX - 93.0; - iconPos.y = ((float)((double)GHIDRA_INT(local_104) + - __uint_to_double_fixup[-(GHIDRA_INT(local_104) >> 0x1f)]) * 25.0 - 16.0) + - originY; - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5d])) + 0x2))) != '\0') { - if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) == '\0') { - AnimationState::Render - (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))),&iconPos,&g_vectorZero, - &g_vectorZero); - overlayAnim = GHIDRA_CAST((this + 0x20)); - } - else { - AnimationState::Render - (GHIDRA_CAST((this + 0x20)),&iconPos,&g_vectorZero,&g_vectorZero); - overlayAnim = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))); - } - AnimationState::Render(overlayAnim,&iconPos,&g_vectorZero,&g_vectorZero); - } - } - modIter = modIter + 1; - local_118.y = local_104; - } while (GHIDRA_UINT(local_104) < - GHIDRA_UINT((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameManager)) + 0x2a6c4)))) - gameManager->_modManager >> 2))); - } - } - menuManager = g_menuManager; - modCount = *GHIDRA_CAST(this); - viewY = -216.0; - iVar6 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((g_manager)) + 0x2a6c4)))) - g_manager->_modManager >> 2; - if (4 < modCount) { - scrollRow = iVar6 + -7; - if (modCount < iVar6 + -3) { - scrollRow = modCount + -4; - } - viewY = -216.0 - (float)(scrollRow * 0x19); - } - g_menuManager->_viewPositionSet[0x10].y = viewY; - menuManager->_state = 1; - ExceptionList = local_1c; - return; -} diff --git a/generated-src/animation_state.cpp b/generated-src/animation_state.cpp deleted file mode 100644 index 581ec4c..0000000 --- a/generated-src/animation_state.cpp +++ /dev/null @@ -1,464 +0,0 @@ -#include "classes.h" - -// 004073b0 -uint8_t AnimationState::IsLoopingAnimation() -{ - if (this->_animData == (void *)0x0) { - return 0; - } - return *GHIDRA_CAST((GHIDRA_CAST(this->_animData) + 0x34)); -} - -// 004086e0 -AnimationState::AnimationState(void *owner, AnimationState *other) -{ - void *animData; - int64_t allocBytes; - - this->_animation = owner; - animData = other->_animData; - this->_animData = animData; - if ((animData == (void *)0x0) || (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x1c)) == 0)) { - this->_layerFrames = (void *)0x0; - } - else { - allocBytes = (uint64_t)*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x1c)) * 4; - animData = operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT(((uint64_t)allocBytes >> 0x20)) != 0)) | GHIDRA_UINT(allocBytes)); - this->_layerFrames = animData; - memcpy(animData,other->_layerFrames,*GHIDRA_CAST((GHIDRA_CAST(this->_animData) + 0x1c)) << 2); - animData = this->_animData; - } - if ((animData == (void *)0x0) || (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24)) == 0)) { - this->_nullLayerFrames = (void *)0x0; - } - else { - allocBytes = (uint64_t)*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24)) * 4; - animData = operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT(((uint64_t)allocBytes >> 0x20)) != 0)) | GHIDRA_UINT(allocBytes)); - this->_nullLayerFrames = animData; - memcpy(animData,other->_nullLayerFrames,*GHIDRA_CAST((GHIDRA_CAST(this->_animData) + 0x24)) << 2); - } - this->_animFrame = other->_animFrame; - this->_isPlaying = other->_isPlaying; - this->_currentlyTriggeredEvents = other->_currentlyTriggeredEvents; - this->_previouslyTriggeredEvents = other->_previouslyTriggeredEvents; - return; -} - -// 00408ef0 -void AnimationState::SetLayerFrame(int layerID, int frame) -{ - void *animData; - int dataLayerId; - - if (((layerID < 0) || (*GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x80)) <= layerID)) && - (KAGE_LogMessage(0x10,GHIDRA_CAST("LayerId out of bounds\n")), layerID < 0)) { - return; - } - if (layerID < *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x80))) { - animData = this->_animData; - dataLayerId = *GHIDRA_CAST((GHIDRA_CAST(animData) + layerID * 4 + 0x38)); - if (((animData == (void *)0x0) || (dataLayerId < 0)) || - (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x1c)) <= dataLayerId)) { - KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); - } - *GHIDRA_CAST((GHIDRA_CAST(this->_layerFrames) + dataLayerId * 4)) = 0; - AdvanceLayerPosition(this,dataLayerId,(float)frame); - } - return; -} - -// 00408f70 -int AnimationState::GetLayerFrameIdx(int layerId) -{ - if (((layerId < 0) || (*GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x80)) <= layerId)) && - (KAGE_LogMessage(0x10,GHIDRA_CAST("LayerId out of bounds\n")), layerId < 0)) { - return 0; - } - if (layerId < *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x80))) { - return *GHIDRA_CAST((GHIDRA_INT(this->_layerFrames) + - *GHIDRA_CAST((GHIDRA_CAST(this->_animData) + layerId * 4 + 0x38)) * 4)); - } - return 0; -} - -// 00408fc0 -void AnimationState::SetNullLayerFrame(int nullLayerId, int frame) -{ - if ((nullLayerId < 0) || (*GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x88)) <= nullLayerId)) { - KAGE_LogMessage(0x10,GHIDRA_CAST("layerId out of bounds\n")); - } - if (((this->_animData == (void *)0x0) || (nullLayerId < 0)) || - (*GHIDRA_CAST((GHIDRA_CAST(this->_animData) + 0x24)) <= nullLayerId)) { - KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); - } - *GHIDRA_CAST((GHIDRA_CAST(this->_nullLayerFrames) + nullLayerId * 4)) = 0; - AdvanceNullLayerPosition(this,nullLayerId,(float)frame); - return; -} - -// 0040ac70 -void * AnimationState::GetNullFrameById(int nullLayerId) -{ - void *animData; - int *nullLayer; - uint32_t layerIdx; - int *layerFrameIt; - int frameIndex; - - animData = this->_animData; - if (animData == (void *)0x0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("AnimationData is NULL\n")); - animData = this->_animData; - } - layerIdx = 0; - if (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24)) != 0) { - layerFrameIt = this->_nullLayerFrames; - nullLayer = *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x20)); - do { - if (((*nullLayer == nullLayerId) && (frameIndex = *layerFrameIt, -1 < frameIndex)) && - (frameIndex < nullLayer[3])) { - return (void *)(frameIndex * 0x54 + nullLayer[2]); - } - layerIdx = layerIdx + 1; - nullLayer = nullLayer + 4; - layerFrameIt = layerFrameIt + 1; - } while (layerIdx < *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24))); - } - return (void *)0x0; -} - -// 0040ace0 -void * AnimationState::GetNullFrame(uint8_t *nullLayerName) -{ - uint8_t *layerNameCursor; - uint32_t cmpResult; - void *animData; - uint32_t *nullTrack; - uint8_t *nameCursor; - uint32_t uVar1; - uint32_t nullLayerIdx; - uint8_t *nullLayerEntry; - int *frameIdxPtr; - bool isLess; - uint8_t ch; - int frameIdx; - - if (this->_animData == (void *)0x0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("AnimationData is NULL\n")); - } - nullLayerIdx = 0; - uVar1 = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x88)); - if (uVar1 != 0) { - nullLayerEntry = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x84)); - do { - layerNameCursor = nullLayerEntry; - if (0xf < *GHIDRA_CAST((nullLayerEntry + 0x14))) { - layerNameCursor = *GHIDRA_CAST(nullLayerEntry); - } - nameCursor = nullLayerName; - do { - ch = *layerNameCursor; - isLess = ch < *nameCursor; - if (ch != *nameCursor) { -LAB_0040ad50: - cmpResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040ad55; - } - if (ch == 0) break; - ch = layerNameCursor[1]; - isLess = ch < nameCursor[1]; - if (ch != nameCursor[1]) goto LAB_0040ad50; - layerNameCursor = layerNameCursor + 2; - nameCursor = nameCursor + 2; - } while (ch != 0); - cmpResult = 0; -LAB_0040ad55: - if (cmpResult == 0) { - animData = this->_animData; - if (animData == (void *)0x0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("AnimationData is NULL\n")); - animData = this->_animData; - } - uVar1 = 0; - if (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24)) != 0) { - nullTrack = *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x20)); - frameIdxPtr = this->_nullLayerFrames; - do { - if (((*nullTrack == nullLayerIdx) && (frameIdx = *frameIdxPtr, -1 < frameIdx)) && - (frameIdx < GHIDRA_INT(nullTrack[3]))) { - return (void *)(frameIdx * 0x54 + nullTrack[2]); - } - uVar1 = uVar1 + 1; - nullTrack = nullTrack + 4; - frameIdxPtr = frameIdxPtr + 1; - } while (uVar1 < *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24))); - } - return (void *)0x0; - } - nullLayerIdx = nullLayerIdx + 1; - nullLayerEntry = nullLayerEntry + 0x18; - } while (nullLayerIdx < uVar1); - } - return (void *)0x0; -} - -// 0040add0 -uint8_t AnimationState::IsEventTriggered(uint8_t *eventName) -{ - uint8_t *eventNameChar; - uint32_t compareResult; - uint8_t *queryChar; - uint8_t *eventEntry; - uint32_t eventIndex; - bool isLess; - uint8_t ch; - uint32_t eventCount; - - if (this->_animData == (void *)0x0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("AnimationData is NULL\n")); - } - eventIndex = 0; - eventCount = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x90)); - if (eventCount != 0) { - eventEntry = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x8c)); - do { - eventNameChar = eventEntry; - if (0xf < *GHIDRA_CAST((eventEntry + 0x14))) { - eventNameChar = *GHIDRA_CAST(eventEntry); - } - queryChar = eventName; - do { - ch = *eventNameChar; - isLess = ch < *queryChar; - if (ch != *queryChar) { -LAB_0040ae32: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040ae37; - } - if (ch == 0) break; - ch = eventNameChar[1]; - isLess = ch < queryChar[1]; - if (ch != queryChar[1]) goto LAB_0040ae32; - eventNameChar = eventNameChar + 2; - queryChar = queryChar + 2; - } while (ch != 0); - compareResult = 0; -LAB_0040ae37: - if (compareResult == 0) { - if (GHIDRA_INT(eventIndex) < 0) { - return 0; - } - return (this->_currentlyTriggeredEvents & 1 << ((uint8_t)eventIndex & 0x1f)) != 0; - } - eventIndex = eventIndex + 1; - eventEntry = eventEntry + 0x18; - } while (eventIndex < eventCount); - } - return 0; -} - -// 0040ae70 -uint8_t AnimationState::WasEventTriggered(uint8_t *eventName) -{ - uint8_t *entryNameCursor; - uint32_t compareResult; - uint8_t *wantedName; - uint8_t *eventEntry; - uint32_t eventIdx; - bool isLess; - uint32_t eventCount; - uint8_t nameChar; - - if (this->_animData == (void *)0x0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("AnimationData is NULL\n")); - } - eventIdx = 0; - eventCount = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x90)); - if (eventCount != 0) { - eventEntry = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x8c)); - do { - entryNameCursor = eventEntry; - if (0xf < *GHIDRA_CAST((eventEntry + 0x14))) { - entryNameCursor = *GHIDRA_CAST(eventEntry); - } - wantedName = eventName; - do { - nameChar = *entryNameCursor; - isLess = nameChar < *wantedName; - if (nameChar != *wantedName) { -LAB_0040aed2: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040aed7; - } - if (nameChar == 0) break; - nameChar = entryNameCursor[1]; - isLess = nameChar < wantedName[1]; - if (nameChar != wantedName[1]) goto LAB_0040aed2; - entryNameCursor = entryNameCursor + 2; - wantedName = wantedName + 2; - } while (nameChar != 0); - compareResult = 0; -LAB_0040aed7: - if (compareResult == 0) { - if (GHIDRA_INT(eventIdx) < 0) { - return 0; - } - return (this->_previouslyTriggeredEvents & 1 << ((uint8_t)eventIdx & 0x1f)) != 0; - } - eventIdx = eventIdx + 1; - eventEntry = eventEntry + 0x18; - } while (eventIdx < eventCount); - } - return 0; -} - -// 0040af10 -int AnimationState::NextEventTrigger(uint8_t *eventName) -{ - uint8_t *triggerName; - uint32_t compareResult; - uint8_t *wantedName; - uint32_t uVar1; - int framesUntil; - uint32_t eventIndex; - uint8_t *eventNameEntry; - int nearestDelta; - int nextFrame; - bool isLess; - int bestFrame; - void *animData; - uint8_t ch; - int eventFrame; - - if (this->_animData == (void *)0x0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("AnimationData is NULL\n")); - } - eventIndex = 0; - uVar1 = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x90)); - if (uVar1 != 0) { - eventNameEntry = *GHIDRA_CAST((GHIDRA_CAST(this->_animation) + 0x8c)); - do { - triggerName = eventNameEntry; - if (0xf < *GHIDRA_CAST((eventNameEntry + 0x14))) { - triggerName = *GHIDRA_CAST(eventNameEntry); - } - wantedName = eventName; - do { - ch = *triggerName; - isLess = ch < *wantedName; - if (ch != *wantedName) { -LAB_0040af74: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040af79; - } - if (ch == 0) break; - ch = triggerName[1]; - isLess = ch < wantedName[1]; - if (ch != wantedName[1]) goto LAB_0040af74; - triggerName = triggerName + 2; - wantedName = wantedName + 2; - } while (ch != 0); - compareResult = 0; -LAB_0040af79: - if (compareResult == 0) { - if (GHIDRA_INT(eventIndex) < 0) { - return -1; - } - nextFrame = -1; - uVar1 = 0; - bestFrame = -1; - nearestDelta = -1; - animData = this->_animData; - if (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x2c)) != 0) { - do { - if (*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x28)) + uVar1 * 8)) == eventIndex) { - eventFrame = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x28)) + 4 + uVar1 * 8)); - framesUntil = eventFrame - GHIDRA_INT(this->_animFrame); - nextFrame = bestFrame; - if ((0 < framesUntil) && ((nearestDelta < 0 || (framesUntil < nearestDelta)))) { - nearestDelta = framesUntil; - nextFrame = eventFrame; - bestFrame = eventFrame; - } - } - uVar1 = uVar1 + 1; - } while (uVar1 < *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x2c))); - } - return nextFrame; - } - eventIndex = eventIndex + 1; - eventNameEntry = eventNameEntry + 0x18; - } while (eventIndex < uVar1); - } - return -1; -} - -// 0040bbf0 -AnimationState * AnimationState::copy_assign(AnimationState *other) -{ - void *pvVar1; - int iVar2; - int iVar3; - void *pvVar4; - void *pvVar5; - undefined3 uVar6; - uint8_t isPlaying; - - pvVar1 = other->_animData; - this->_animation = other->_animation; - this->_animData = pvVar1; - pvVar1 = other->_nullLayerFrames; - this->_layerFrames = other->_layerFrames; - this->_nullLayerFrames = pvVar1; - isPlaying = other->_isPlaying; - uVar6 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((other)) + 0x15)))); - this->_animFrame = other->_animFrame; - this->_isPlaying = isPlaying; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x15)))) = uVar6; - iVar2 = other->_previouslyTriggeredEvents; - this->_currentlyTriggeredEvents = other->_currentlyTriggeredEvents; - this->_previouslyTriggeredEvents = iVar2; - pvVar1 = other[1]._animData; - this[1]._animation = other[1]._animation; - this[1]._animData = pvVar1; - this[1]._layerFrames = other[1]._layerFrames; - *GHIDRA_CAST(&this[1]._nullLayerFrames) = *GHIDRA_CAST(&other[1]._nullLayerFrames); - isPlaying = other[1]._isPlaying; - uVar6 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(other[1])) + 0x15)))); - iVar2 = other[1]._currentlyTriggeredEvents; - iVar3 = other[1]._previouslyTriggeredEvents; - this[1]._animFrame = other[1]._animFrame; - this[1]._isPlaying = isPlaying; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x15)))) = uVar6; - this[1]._currentlyTriggeredEvents = iVar2; - this[1]._previouslyTriggeredEvents = iVar3; - pvVar1 = other[2]._animData; - pvVar4 = other[2]._layerFrames; - pvVar5 = other[2]._nullLayerFrames; - this[2]._animation = other[2]._animation; - this[2]._animData = pvVar1; - this[2]._layerFrames = pvVar4; - this[2]._nullLayerFrames = pvVar5; - isPlaying = other[2]._isPlaying; - uVar6 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(other[2])) + 0x15)))); - this[2]._animFrame = other[2]._animFrame; - this[2]._isPlaying = isPlaying; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x15)))) = uVar6; - this[2]._currentlyTriggeredEvents = other[2]._currentlyTriggeredEvents; - this[2]._previouslyTriggeredEvents = other[2]._previouslyTriggeredEvents; - *GHIDRA_CAST(&this[3]._animation) = *GHIDRA_CAST(&other[3]._animation); - this[3]._animData = other[3]._animData; - this[3]._layerFrames = other[3]._layerFrames; - return this; -} - -// 00440e30 -int AnimationState::GetAnimationLength() -{ - if (this->_animData == (void *)0x0) { - return 0; - } - return *GHIDRA_CAST((GHIDRA_CAST(this->_animData) + 0x30)); -} diff --git a/generated-src/anm2.cpp b/generated-src/anm2.cpp deleted file mode 100644 index e5344a3..0000000 --- a/generated-src/anm2.cpp +++ /dev/null @@ -1,1477 +0,0 @@ -#include "classes.h" - -// 00407690 -ANM2::ANM2(ANM2 *other) -{ - float fVar1; - float fVar2; - float fVar3; - char isLastRef; - std_string *text; - void *textureRef; - uint32_t allocSize; - LayerState *srcLayer; - uint32_t *dstLayer; - uint8_t tmpTexture [4]; - uint32_t *local_34; - uint32_t layerCount; - ANM2 *self; - uint32_t *local_28; - uint32_t local_24; - uint8_t *puStack_20; - void *local_1c; - uint8_t *puStack_18; - uint32_t local_14; - uint8_t isLoaded; - - puStack_20 = tmpTexture + 0x34; - local_14 = 0xffffffff; - puStack_18 = &LAB_00af09d3; - local_1c = ExceptionList; - ExceptionList = &local_1c; - self = this; - (GHIDRA_CAST((GHIDRA_CAST(this))))->msvc::string::string(other); - local_14 = 0; - (GHIDRA_CAST(((this->_animDefaultName)._buf)))->msvc::string::string(&other->_animDefaultName); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; - (GHIDRA_CAST((&this->_animState)))->AnimationState::AnimationState(this,&other->_animState); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::AnimationState(this,&other->_overlayAnimState); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; - this->_overlayRenderFirst = other->_overlayRenderFirst; - this->_animData = other->_animData; - this->_animCount = other->_animCount; - this->_layerState = (void *)0x0; - this->_layerCount = other->_layerCount; - this->_nullLayerNames = other->_nullLayerNames; - this->_numNullLayers = other->_numNullLayers; - this->_eventNames = other->_eventNames; - this->_numEvents = other->_numEvents; - (this->_offset).y = 0.0; - (this->_offset).x = 0.0; - fVar1 = (other->_scale).y; - (this->_scale).x = (other->_scale).x; - (this->_scale).y = fVar1; - this->_rotation = other->_rotation; - fVar1 = (other->_color)._tint[1]; - fVar2 = (other->_color)._tint[2]; - fVar3 = (other->_color)._tint[3]; - (this->_color)._tint[0] = (other->_color)._tint[0]; - (this->_color)._tint[1] = fVar1; - (this->_color)._tint[2] = fVar2; - (this->_color)._tint[3] = fVar3; - fVar1 = (other->_color)._colorize[1]; - fVar2 = (other->_color)._colorize[2]; - fVar3 = (other->_color)._colorize[3]; - (this->_color)._colorize[0] = (other->_color)._colorize[0]; - (this->_color)._colorize[1] = fVar1; - (this->_color)._colorize[2] = fVar2; - (this->_color)._colorize[3] = fVar3; - *GHIDRA_CAST((this->_color)._offset) = *GHIDRA_CAST((other->_color)._offset); - (this->_color)._offset[2] = (other->_color)._offset[2]; - fVar1 = (other->_championColor)._tint[1]; - fVar2 = (other->_championColor)._tint[2]; - fVar3 = (other->_championColor)._tint[3]; - (this->_championColor)._tint[0] = (other->_championColor)._tint[0]; - (this->_championColor)._tint[1] = fVar1; - (this->_championColor)._tint[2] = fVar2; - (this->_championColor)._tint[3] = fVar3; - fVar1 = (other->_championColor)._colorize[1]; - fVar2 = (other->_championColor)._colorize[2]; - fVar3 = (other->_championColor)._colorize[3]; - (this->_championColor)._colorize[0] = (other->_championColor)._colorize[0]; - (this->_championColor)._colorize[1] = fVar1; - (this->_championColor)._colorize[2] = fVar2; - (this->_championColor)._colorize[3] = fVar3; - fVar1 = (other->_championColor)._offset[1]; - (this->_championColor)._offset[0] = (other->_championColor)._offset[0]; - (this->_championColor)._offset[1] = fVar1; - (this->_championColor)._offset[2] = (other->_championColor)._offset[2]; - this->_flipX = other->_flipX; - this->_flipY = other->_flipY; - this->_playbackSpeed = other->_playbackSpeed; - (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x108))) = (*GHIDRA_CAST((GHIDRA_CAST((other)) + 0x108))); - isLoaded = other->_loaded; - this->_loaded = isLoaded; - this->_shadowLayerIndex = other->_shadowLayerIndex; - this->_bitflags = 0; - if (isLoaded != 0) { - AnmCache::AddRef(&this->_filename); - } - layerCount = other->_layerCount; - local_28 = GHIDRA_CAST(0x0); - allocSize = -GHIDRA_UINT((GHIDRA_INT(((uint64_t)layerCount * 0xa0 >> 0x20)) != 0)) | - GHIDRA_UINT(((uint64_t)layerCount * 0xa0)); - local_24 = layerCount; - local_34 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < allocSize)) | allocSize + 4); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 4; - if (local_34 == GHIDRA_CAST(0x0)) { - local_28 = GHIDRA_CAST(0x0); - } - else { - *local_34 = local_24; - local_28 = local_34 + 1; - _eh_vector_constructor_iterator_ - (local_28,0xa0,local_24,LayerState::LayerState,LayerState::~LayerState); - } - this->_layerState = local_28; - local_24 = 0; - if (other->_layerCount != 0) { - local_28 = GHIDRA_CAST(0x0); - do { - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; - srcLayer = GHIDRA_CAST((GHIDRA_INT(other->_layerState) + GHIDRA_INT(local_28))); - dstLayer = GHIDRA_CAST((GHIDRA_INT(this->_layerState) + GHIDRA_INT(local_28))); - *dstLayer = srcLayer->_layerData; - text = &srcLayer->_spriteSheetPath; - if (GHIDRA_CAST((dstLayer + 2)) != text) { - if (0xf < (srcLayer->_spriteSheetPath)._capacity) { - text = *GHIDRA_CAST(text->_buf); - } - (GHIDRA_CAST((GHIDRA_CAST((dstLayer + 2)))))->msvc::string::assign(GHIDRA_CAST(text),(srcLayer->_spriteSheetPath)._size); - } - textureRef = (GHIDRA_CAST((srcLayer)))->LayerState::GetTexture(tmpTexture); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 5; - (GHIDRA_CAST((dstLayer + 0x26)))->KAGE::SmartPointer::operator_assign(textureRef); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - if (local_34 != GHIDRA_CAST(0x0)) { - isLastRef = (**(code **)(*local_34 + 0xc))(); - if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(tmpTexture); - } - } - *GHIDRA_CAST((dstLayer + 0xc)) = srcLayer->_spriteSheetLoaded; - *GHIDRA_CAST((GHIDRA_CAST(dstLayer) + 0x31)) = (*GHIDRA_CAST((GHIDRA_CAST((srcLayer)) + 0x31))); - *GHIDRA_CAST((GHIDRA_CAST(dstLayer) + 0x32)) = srcLayer->_flipX; - *GHIDRA_CAST((GHIDRA_CAST(dstLayer) + 0x33)) = srcLayer->_flipY; - dstLayer[0xd] = (srcLayer->_size).x; - dstLayer[0xe] = (srcLayer->_size).y; - dstLayer[0xf] = srcLayer->_rotation; - dstLayer[0x10] = (srcLayer->_pos).x; - dstLayer[0x11] = (srcLayer->_pos).y; - if (GHIDRA_CAST((dstLayer + 0x12)) != &srcLayer->_color) { - fVar1 = (srcLayer->_color)._tint[1]; - fVar2 = (srcLayer->_color)._tint[2]; - fVar3 = (srcLayer->_color)._tint[3]; - dstLayer[0x12] = (srcLayer->_color)._tint[0]; - dstLayer[0x13] = fVar1; - dstLayer[0x14] = fVar2; - dstLayer[0x15] = fVar3; - fVar1 = (srcLayer->_color)._colorize[1]; - fVar2 = (srcLayer->_color)._colorize[2]; - fVar3 = (srcLayer->_color)._colorize[3]; - dstLayer[0x16] = (srcLayer->_color)._colorize[0]; - dstLayer[0x17] = fVar1; - dstLayer[0x18] = fVar2; - dstLayer[0x19] = fVar3; - fVar1 = (srcLayer->_color)._offset[1]; - dstLayer[0x1a] = (srcLayer->_color)._offset[0]; - dstLayer[0x1b] = fVar1; - dstLayer[0x1c] = (srcLayer->_color)._offset[2]; - } - *GHIDRA_CAST((dstLayer + 0x1d)) = srcLayer->_visible; - dstLayer[0x1e] = srcLayer->_blendMode[0]; - dstLayer[0x1f] = srcLayer->_blendMode[1]; - local_24 = local_24 + 1; - dstLayer[0x20] = srcLayer->_blendMode[2]; - dstLayer[0x21] = srcLayer->_blendMode[3]; - dstLayer[0x22] = srcLayer->_blendMode[4]; - dstLayer[0x23] = srcLayer->_bitflags; - dstLayer[0x24] = (srcLayer->_cropOffset).x; - dstLayer[0x25] = (srcLayer->_cropOffset).y; - *GHIDRA_CAST((GHIDRA_CAST(local_28) + 4 + GHIDRA_INT(self->_layerState))) = self; - local_28 = GHIDRA_CAST((GHIDRA_INT(local_28) + 0xa0)); - this = self; - } while (local_24 < GHIDRA_UINT(other->_layerCount)); - } - ExceptionList = local_1c; - return this; -} - -// 00407e90 -ANM2 * ANM2::operator_assign(ANM2 other) -{ - ANM2 *this_00; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00af0a10; - local_10 = ExceptionList; - ExceptionList = &local_10; - Isaac::SwapANM2(this,&other); - local_8 = 0; - Reset(this_00); - (GHIDRA_CAST((&other._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&other._animState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((other._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((GHIDRA_CAST(&other))))->msvc::string::_Tidy_deallocate(); - ExceptionList = local_10; - return this; -} - -// 00408170 -ANM2::~ANM2() -{ - void *local_10; - uint8_t *puStack_c; - uint32_t uStack_8; - - uStack_8 = 0xffffffff; - puStack_c = &LAB_00af0a50; - local_10 = ExceptionList; - ExceptionList = &local_10; - Reset(this); - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&this->_animState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST(((this->_animDefaultName)._buf)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((GHIDRA_CAST(this))))->msvc::string::_Tidy_deallocate(); - ExceptionList = local_10; - return; -} - -// 00409100 -void ANM2::Update() -{ - if (this->_loaded == 0) { - return; - } - (GHIDRA_CAST((&this->_animState)))->AnimationState::Update(); - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::Update(); - return; -} - -// 0040a0d0 -void ANM2::Render(Vector *position, Vector *topleftclamp, Vector *bottomrightclamp) -{ - if (this->_loaded != 0) { - if (this->_overlayRenderFirst != 0) { - AnimationState::Render(&this->_overlayAnimState,position,topleftclamp,bottomrightclamp); - AnimationState::Render(&this->_animState,position,topleftclamp,bottomrightclamp); - return; - } - AnimationState::Render(&this->_animState,position,topleftclamp,bottomrightclamp); - AnimationState::Render(&this->_overlayAnimState,position,topleftclamp,bottomrightclamp); - } - return; -} - -// 0040a4d0 -uint8_t ANM2::IsPlaying(uint8_t *name) -{ - uint8_t *animName; - uint32_t compareResult; - bool isLess; - uint8_t nameChar; - - animName = (this->_animState)._animData; - if ((animName == GHIDRA_CAST(0x0)) || ((this->_animState)._isPlaying == 0)) { - return 0; - } - if (*name != 0) { - if (0xf < *GHIDRA_CAST((animName + 0x14))) { - animName = *GHIDRA_CAST(animName); - } - do { - nameChar = *animName; - isLess = nameChar < *name; - if (nameChar != *name) { -LAB_0040a510: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040a515; - } - if (nameChar == 0) break; - nameChar = animName[1]; - isLess = nameChar < name[1]; - if (nameChar != name[1]) goto LAB_0040a510; - animName = animName + 2; - name = name + 2; - } while (nameChar != 0); - compareResult = 0; -LAB_0040a515: - if (compareResult != 0) { - return 0; - } - } - return 1; -} - -// 0040a550 -uint8_t ANM2::IsFinishedImpl(uint8_t *animName) -{ - uint8_t *currentAnimName; - uint32_t compareResult; - bool nameChar; - uint8_t nameChar; - - currentAnimName = (this->_animState)._animData; - if (currentAnimName == GHIDRA_CAST(0x0)) { - nameChar = *animName == 0; - } - else { - if ((this->_animState)._isPlaying != 0) { - return 0; - } - if (*animName == 0) { - return 1; - } - if (0xf < *GHIDRA_CAST((currentAnimName + 0x14))) { - currentAnimName = *GHIDRA_CAST(currentAnimName); - } - do { - nameChar = *currentAnimName; - nameChar = nameChar < *animName; - if (nameChar != *animName) { -LAB_0040a598: - compareResult = -GHIDRA_UINT(nameChar) | 1; - goto LAB_0040a59d; - } - if (nameChar == 0) break; - nameChar = currentAnimName[1]; - nameChar = nameChar < animName[1]; - if (nameChar != animName[1]) goto LAB_0040a598; - currentAnimName = currentAnimName + 2; - animName = animName + 2; - } while (nameChar != 0); - compareResult = 0; -LAB_0040a59d: - nameChar = compareResult == 0; - } - if (nameChar) { - return 1; - } - return 0; -} - -// 0040a690 -void ANM2::SetFrame(std_string *anim, int frame) -{ - uint8_t isAnimationSet; - - if (0xf < anim->_capacity) { - anim = *GHIDRA_CAST(anim->_buf); - } - isAnimationSet = SetAnimation(this,GHIDRA_CAST(anim),1); - if ((isAnimationSet != 0) && ((this->_animState)._animData != (void *)0x0)) { - (GHIDRA_CAST((&this->_animState)))->AnimationState::SetFrameFloat((float)frame); - if ((this->_animState)._animData != (void *)0x0) { - (this->_animState)._isPlaying = 0; - } - } - return; -} - -// 0040a780 -int ANM2::GetFrame() -{ - double frame; - - if ((this->_animState)._animData == (void *)0x0) { - return -1; - } - frame = floor((double)(this->_animState)._animFrame); - return GHIDRA_INT(frame); -} - -// 0040a7e0 -void ANM2::SetLayerFrame(int layerid, int frame) -{ - int layerId; - void *animData; - AnimationState *animState; - - if ((this->_animState)._animData != (void *)0x0) { - animState = &this->_animState; - if (((layerid < 0) || (*GHIDRA_CAST((GHIDRA_CAST(animState->_animation) + 0x80)) <= layerid)) && - (KAGE_LogMessage(0x10,GHIDRA_CAST("LayerId out of bounds\n")), layerid < 0)) { - return; - } - if (layerid < *GHIDRA_CAST((GHIDRA_CAST(animState->_animation) + 0x80))) { - animData = (this->_animState)._animData; - layerId = *GHIDRA_CAST((GHIDRA_CAST(animData) + layerid * 4 + 0x38)); - if (((animData == (void *)0x0) || (layerId < 0)) || - (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x1c)) <= layerId)) { - KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); - } - *GHIDRA_CAST((GHIDRA_INT((this->_animState)._layerFrames) + layerId * 4)) = 0; - (GHIDRA_CAST((animState)))->AnimationState::AdvanceLayerPosition(layerId,(float)frame); - } - } - return; -} - -// 0040abf0 -void ANM2::SetOverlayFrame(uint8_t *anim, int frame) -{ - uint8_t isAnimationSet; - - isAnimationSet = SetOverlayAnimation(this,anim,1); - if ((isAnimationSet != 0) && ((this->_overlayAnimState)._animData != (void *)0x0)) { - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::SetFrameFloat((float)frame); - } - return; -} - -// 0040ac30 -void ANM2::SetOverlayFrame(int frame) -{ - if ((this->_overlayAnimState)._animData != (void *)0x0) { - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::SetFrameFloat((float)frame); - } - return; -} - -// 0040b090 -uint8_t ANM2::WasEventTriggered(uint8_t *eventName) -{ - uint8_t isTriggered; - - if ((this->_animState)._animData == (void *)0x0) { - return 0; - } - isTriggered = (GHIDRA_CAST((&this->_animState)))->AnimationState::WasEventTriggered(eventName); - return isTriggered; -} - -// 0040b0c0 -void * ANM2::GetNullFrame(uint8_t *animName, uint8_t *nullLayerName, int frame) -{ - void *animData; - uint8_t *layerNameChar; - uint32_t nullLayerIdx; - uint8_t *nullNameChar; - uint32_t compareResult; - uint32_t *nullAnim; - uint32_t foundIdx; - uint32_t i; - bool isLess; - uint8_t currentChar; - - animData = GetAnimationData(this,animName); - if (animData != (void *)0x0) { - i = 0; - if (this->_numNullLayers != 0) { - foundIdx = 0xffffffff; - do { - layerNameChar = GHIDRA_CAST((GHIDRA_INT(this->_nullLayerNames) + i * 0x18)); - if (0xf < *GHIDRA_CAST((GHIDRA_CAST(this->_nullLayerNames) + i * 0x18 + 0x14))) { - layerNameChar = *GHIDRA_CAST(layerNameChar); - } - nullNameChar = nullLayerName; - do { - currentChar = *layerNameChar; - isLess = currentChar < *nullNameChar; - if (currentChar != *nullNameChar) { -LAB_0040b132: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040b137; - } - if (currentChar == 0) break; - currentChar = layerNameChar[1]; - isLess = currentChar < nullNameChar[1]; - if (currentChar != nullNameChar[1]) goto LAB_0040b132; - layerNameChar = layerNameChar + 2; - nullNameChar = nullNameChar + 2; - } while (currentChar != 0); - compareResult = 0; -LAB_0040b137: - nullLayerIdx = i; - if (compareResult != 0) { - nullLayerIdx = foundIdx; - } - i = i + 1; - foundIdx = nullLayerIdx; - } while (i < GHIDRA_UINT(this->_numNullLayers)); - if (-1 < GHIDRA_INT(nullLayerIdx)) { - i = 0; - if (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24)) != 0) { - nullAnim = *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x20)); - do { - if (((*nullAnim == nullLayerIdx) && (-1 < frame)) && (frame < GHIDRA_INT(nullAnim[3]))) { - return (void *)(frame * 0x54 + nullAnim[2]); - } - i = i + 1; - nullAnim = nullAnim + 4; - } while (i < *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x24))); - } - KAGE_LogMessage(1,GHIDRA_CAST("[warn] ANM2::GetNullFrame frame number %d out of bounds.\n")); - } - } - } - return (void *)0x0; -} - -// 0040b1a0 -void * ANM2::GetLayerFrame(int nullLayerId) -{ - void *nullFrame; - - if ((this->_animState)._animData == (void *)0x0) { - return (void *)0x0; - } - nullFrame = (GHIDRA_CAST((&this->_animState)))->AnimationState::GetNullFrameById(nullLayerId); - return nullFrame; -} - -// 0040b220 -LayerState * ANM2::GetLayer(uint8_t *layerName) -{ - uint32_t stackCookie; - void *local_10; - uint8_t *puStack_c; - uint32_t uStack_8; - - uStack_8 = 0xffffffff; - puStack_c = &LAB_00af0c31; - local_10 = ExceptionList; - stackCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; - ExceptionList = &local_10; - if (((-1 < GHIDRA_INT(layerName)) && (GHIDRA_INT(layerName) < this->_layerCount)) || - ((KAGE_LogMessage(0x10,GHIDRA_CAST("%s: No layer with Id %d\n")), -1 < GHIDRA_INT(layerName) && - (GHIDRA_INT(layerName) < this->_layerCount)))) { - ExceptionList = local_10; - return GHIDRA_CAST((GHIDRA_INT(layerName) * 0xa0 + GHIDRA_INT(this->_layerState))); - } - if ((*GHIDRA_CAST((*GHIDRA_CAST(ThreadLocalStoragePointer) + 0xc)) < _DAT_00c7f628) && - (_Init_thread_header(&DAT_00c7f628,stackCookie), _DAT_00c7f628 == -1)) { - uStack_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(0xc7f630))))->LayerState::LayerState(); - _atexit(FUN_00b15190); - _Init_thread_footer(&DAT_00c7f628); - } - ExceptionList = local_10; - return GHIDRA_CAST(0xc7f630); -} - -// 0040b310 -LayerState * ANM2::get_layer_by_string(std_string *name) -{ - uint8_t isMatch; - std_string *wantedText; - uint8_t ****ppppbVar1; - uint32_t layerIdx; - uint32_t size; - int layerOffset; - uint8_t ****layerName [4]; - uint32_t layerNameSize; - uint32_t layerNameCapacity; - uint32_t local_c; - uint8_t auStack_8 [4]; - int layerData; - uint8_t ****layerNameBuffer; - uint32_t savedCapacity; - - local_c = __security_cookie ^ GHIDRA_UINT((auStack_8 + 4)); - layerIdx = 0; - if (this->_layerCount != 0) { - layerOffset = 0; - do { - layerData = *GHIDRA_CAST((layerOffset + GHIDRA_INT(this->_layerState))); - if (layerData == 0) { - layerName[0] = GHIDRA_CAST(0x0); - layerNameCapacity = 0xf; - layerNameSize = 0; - } - else { - (GHIDRA_CAST((GHIDRA_CAST(layerName))))->msvc::string::string((void *)(layerData + 8)); - } - savedCapacity = layerNameCapacity; - layerNameBuffer = layerName[0]; - wantedText = name; - if (0xf < name->_capacity) { - wantedText = *GHIDRA_CAST(name->_buf); - } - ppppbVar1 = GHIDRA_CAST(layerName); - if (0xf < layerNameCapacity) { - ppppbVar1 = layerName[0]; - } - isMatch = str_eq(GHIDRA_CAST(ppppbVar1),layerNameSize,GHIDRA_CAST(wantedText),name->_size); - if (0xf < savedCapacity) { - size = savedCapacity + 1; - ppppbVar1 = layerNameBuffer; - if (0xfff < size) { - ppppbVar1 = GHIDRA_CAST(layerNameBuffer[-1]); - size = savedCapacity + 0x24; - if (GHIDRA_CAST(0x1f) < GHIDRA_CAST((GHIDRA_INT(layerNameBuffer) + (-4 - GHIDRA_INT(ppppbVar1))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(ppppbVar1,size); - } - if (isMatch != 0) { - return GHIDRA_CAST((layerIdx * 0xa0 + GHIDRA_INT(this->_layerState))); - } - layerIdx = layerIdx + 1; - layerOffset = layerOffset + 0xa0; - } while (layerIdx < GHIDRA_UINT(this->_layerCount)); - } - return GHIDRA_CAST(0x0); -} - -// 0040b600 -KColor * ANM2::GetTexel(AnimationState *anim, KColor *outColor, int layerId, Vector samplePos, Vector renderPos, float alphaThreshold) -{ - uint8_t *layerName; - AnimationState *pAVar1; - char isLastRef; - LayerState *layerState; - float *textureRef; - uint32_t *sampleTextureRef; - void *extraout_ECX; - void *extraout_ECX_00; - void *pvVar2; - KColor *extraout_ECX_01; - float fVar3; - float scaleY; - float spriteScaleY; - float fVar4; - float scaleX; - Color layerColor; - uint32_t uStack_1bc; - SourceQuad screenQuad; - float local_120; - float local_11c; - SourceQuad sourceQuad; - KColor texel; - uint8_t sampleTexture [4]; - int *sampleTextureRefCount; - uint8_t texture [4]; - int *textureRefCount; - float quadMaxX; - float local_cc; - float local_c8; - float local_c4; - float local_c0; - KColor *outColorLocal; - uint32_t layerIdx; - float alphaThresholdLocal; - int layerOffset; - float local_a8; - AnimationState *animState; - float local_a0; - float local_9c; - AnimationFrame frame; - uint32_t stackCookie; - uint8_t *puStack_20; - void *savedExceptionList; - uint8_t *puStack_18; - uint32_t ehState; - int layerAnim; - - puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); - ehState = 0xffffffff; - puStack_18 = &LAB_00af0c80; - savedExceptionList = ExceptionList; - stackCookie = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U; - ExceptionList = &savedExceptionList; - outColorLocal = outColor; - alphaThresholdLocal = alphaThreshold; - animState = anim; - (GHIDRA_CAST((&texel)))->KColor::SetFromARGB(0); - pvVar2 = animState->_animData; - if ((pvVar2 != (void *)0x0) && (layerIdx = 0, *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x1c)) != 0)) { - layerOffset = 0; - do { - layerAnim = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x18)) + 4 + layerOffset)); - if ((layerAnim != 0) && - ((layerName = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x18)) + layerOffset)), layerId < 0 || - (layerName == GHIDRA_CAST(layerId))))) { - AnimationState::copy_assign - (GHIDRA_CAST(&frame), - (AnimationState *) - (*GHIDRA_CAST((GHIDRA_CAST(animState->_layerFrames) + layerIdx * 4)) * 0x6c + layerAnim)); - pAVar1 = animState; - layerState = GetLayer(animState->_animation,layerName); - if ((frame.visible != 0) && (layerState->_visible != 0)) { - textureRef = (GHIDRA_CAST((layerState)))->LayerState::GetTexture(texture); - local_a8 = *textureRef; - ehState = 0; - pvVar2 = (void *)0x0; - if (textureRefCount != GHIDRA_CAST(0x0)) { - isLastRef = (**(code **)(*textureRefCount + 0xc))(); - pvVar2 = extraout_ECX; - if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(); - pvVar2 = extraout_ECX_00; - } - } - ehState = 0xffffffff; - if (local_a8 != 0.0) { - uStack_1bc = 0x40b768; - AnimationLayer::GetSourceQuad - (&sourceQuad,pvVar2,&frame,layerState,&g_vectorZero,&g_vectorZero, - pAVar1->_animation); - uStack_1bc = 0x40b78c; - render_build_sprite_quad - (&screenQuad,&renderPos,&frame,layerState,&g_vectorZero,&g_vectorZero, - pAVar1->_animation); - pvVar2 = pAVar1->_animation; - fVar3 = frame.rotation + layerState->_rotation; - fVar4 = *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0xa4)); - if ((fVar4 != 0.0) || (fVar3 != 0.0)) { - scaleX = frame.scale.x * (layerState->_size).x; - spriteScaleY = *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0xa0)); - scaleY = frame.scale.y * (layerState->_size).y; - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x9c)) < 0.0 != scaleX < 0.0) { - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x9c)) < 0.0) { - fVar3 = -fVar3; - fVar4 = -fVar4; - } - if (scaleX < 0.0) { - fVar3 = -fVar3; - } - } - if (layerState->_flipY != 0) { - scaleY = -scaleY; - } - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x101)) != '\0') { - spriteScaleY = -spriteScaleY; - } - if (spriteScaleY < 0.0 != scaleY < 0.0) { - if (spriteScaleY < 0.0) { - fVar3 = -fVar3; - fVar4 = -fVar4; - } - if (scaleY < 0.0) { - fVar3 = -fVar3; - } - } - local_a0 = -(fVar3 + fVar4) * 0.017453292; - (GHIDRA_CAST((&screenQuad)))->Quad::rotate(&g_vectorZero,local_a0); - local_9c = cos(local_a0); - fVar4 = sin(local_a0); - fVar3 = fVar4 * samplePos.x; - samplePos.x = local_9c * samplePos.x - fVar4 * samplePos.y; - samplePos.y = local_9c * samplePos.y + fVar3; - } - local_a0 = samplePos.x; - local_9c = samplePos.y; - if ((((screenQuad._topLeft.x < samplePos.x) && - (quadMaxX = screenQuad._bottomRight.x, samplePos.x < screenQuad._bottomRight.x)) && - (screenQuad._topLeft.y < samplePos.y)) && - (local_a8 = screenQuad._bottomRight.y, samplePos.y < screenQuad._bottomRight.y)) { - if (screenQuad._topLeft.x == screenQuad._bottomRight.x) { - KAGE_LogMessage(0x10,GHIDRA_CAST("Start and End parameters cannot be the same!")); - local_9c = samplePos.y; - } - fVar4 = (local_a0 - screenQuad._topLeft.x) / (quadMaxX - screenQuad._topLeft.x); - if (fVar4 <= 0.0) { - fVar4 = 0.0; - } - if (1.0 <= fVar4) { - fVar4 = 1.0; - } - samplePos.x = (sourceQuad._bottomRight.x - sourceQuad._topLeft.x) * fVar4 + - sourceQuad._topLeft.x; - if (screenQuad._topLeft.y == local_a8) { - KAGE_LogMessage(0x10,GHIDRA_CAST("Start and End parameters cannot be the same!")); - } - fVar4 = (local_9c - screenQuad._topLeft.y) / (local_a8 - screenQuad._topLeft.y); - if (fVar4 <= 0.0) { - fVar4 = 0.0; - } - if (1.0 <= fVar4) { - fVar4 = 1.0; - } - samplePos.y = (sourceQuad._bottomRight.y - sourceQuad._topLeft.y) * fVar4 + - sourceQuad._topLeft.y; - sampleTextureRef = (GHIDRA_CAST((layerState)))->LayerState::GetTexture(sampleTexture); - ehState = 1; - (**(code **)(*GHIDRA_CAST(*sampleTextureRef) + 0x2c))(); - ehState = 2; - if (((sampleTextureRefCount != GHIDRA_CAST(0x0)) && - (isLastRef = (**(code **)(*sampleTextureRefCount + 0xc))(), isLastRef != '\0')) && - (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(); - } - ehState = 0xffffffff; - if (alphaThresholdLocal <= local_c0) { - (GHIDRA_CAST((&layerColor)))->Color::operator_assign(GHIDRA_CAST((GHIDRA_INT(animState->_animation) + 0xa8))); - FUN_004072e0(); - layerColor._offset[2] = 5.944584e-39; - FUN_004072e0(); - local_cc = local_120 * local_cc + sourceQuad._bottomRight.x; - local_c8 = local_11c * local_c8 + sourceQuad._bottomRight.y; - local_c4 = sourceQuad._topLeft.x * local_c4 + (float)sourceQuad._coordinateSpace; - local_c0 = sourceQuad._topLeft.y * local_c0; - FUN_00a0f720(); - ExceptionList = savedExceptionList; - return extraout_ECX_01; - } - } - } - } - } - layerOffset = layerOffset + 0x10; - layerIdx = layerIdx + 1; - pvVar2 = animState->_animData; - } while (layerIdx < *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x1c))); - outColor = outColorLocal; - } - outColor->_unk = texel._unk; - outColor->_red = texel._red; - outColor->_green = texel._green; - outColor->_blue = texel._blue; - outColor->_alpha = texel._alpha; - ExceptionList = savedExceptionList; - return outColor; -} - -// 0040bea0 -void ANM2::Reload() -{ - uint8_t unk; - - if ((this->_filename)._size != 0) { - AnmCache::Load(this,this); - AnmCache::AddRef(&this->_filename); - LoadGraphics(this,unk); - } - return; -} - -// 0040c000 -void ANM2::LoadGraphics(uint8_t unk) -{ - char cVar1; - uint8_t *pbVar2; - int layerOffset; - uint8_t auStackY_dc [128]; - uint32_t **outImage; - uint32_t *texture; - void *pvVar3; - int *piVar4; - int oldTexture; - int *oldTextureRefCount; - uint32_t *image; - int *imageRefCount; - LayerState *layerState; - uint32_t *imageCopy; - int *imageRefCountCopy; - ANM2 *savedThis; - uint32_t layerIdx; - uint8_t isLoaded; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - void *layerStates; - - puStack_c = &LAB_00af0cc5; - local_10 = ExceptionList; - ExceptionList = &local_10; - layerIdx = 0; - if (this->_layerCount != 0) { - layerOffset = 0; - savedThis = this; - do { - local_8 = 0xffffffff; - if (*GHIDRA_CAST((layerOffset + 0x30 + GHIDRA_INT(this->_layerState))) == '\0') { - pbVar2 = GHIDRA_CAST((GHIDRA_INT(this->_layerState) + layerOffset + 8)); - if (0xf < *GHIDRA_CAST((pbVar2 + 0x14))) { - pbVar2 = *GHIDRA_CAST(pbVar2); - } - outImage = ℑ - Manager::LoadImage(outImage,pbVar2); - local_8 = 0; - if (image == GHIDRA_CAST(0x0)) { -LAB_0040c096: - isLoaded = 0; - } - else { - pvVar3 = (void *)0x40c079; - cVar1 = (**(code **)*image)(); - if (cVar1 == '\0') goto LAB_0040c096; - isLoaded = 1; - (GHIDRA_CAST((auStackY_dc + 0x84)))->KAGE::SmartPointer::operator_assign(&image); - TextureCache::Add(outImage,pvVar3); - } - piVar4 = &oldTexture; - pvVar3 = (void *)0x40c0a8; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this->_layerState) + layerOffset)))))->LayerState::GetTexture(piVar4); - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); - if (oldTexture != 0) { - layerStates = this->_layerState; - pbVar2 = *GHIDRA_CAST((oldTexture + 0x44)); - (GHIDRA_CAST((auStackY_dc + 0x84)))->KAGE::SmartPointer::SmartPointer((void *)0x0); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(layerStates) + layerOffset)))))->LayerState::SetTexture(pvVar3,piVar4); - TextureCache::Release(pbVar2); - this = savedThis; - } - layerState = GHIDRA_CAST((GHIDRA_INT(this->_layerState) + layerOffset)); - texture = GHIDRA_CAST(0x0); - piVar4 = GHIDRA_CAST(0x0); - imageRefCountCopy = imageRefCount; - imageCopy = image; - if (imageRefCount != GHIDRA_CAST(0x0)) { - cVar1 = (**(code **)(*imageRefCount + 4))(); - if (cVar1 != '\0') { - if (((piVar4 != GHIDRA_CAST(0x0)) && (cVar1 = (**(code **)(*piVar4 + 0xc))(), cVar1 != '\0')) - && (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(auStackY_dc + 0x84); - } - texture = imageCopy; - piVar4 = imageRefCountCopy; - } - } - (GHIDRA_CAST((layerState)))->LayerState::SetTexture(texture,piVar4); - *GHIDRA_CAST((layerOffset + 0x30 + GHIDRA_INT(this->_layerState))) = isLoaded; - *GHIDRA_CAST((layerOffset + 0x31 + GHIDRA_INT(this->_layerState))) = 0; - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),2); - if (((oldTextureRefCount != GHIDRA_CAST(0x0)) && - (cVar1 = (**(code **)(*oldTextureRefCount + 0xc))(), cVar1 != '\0')) && - (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(); - } - local_8 = 3; - if (((imageRefCount != GHIDRA_CAST(0x0)) && - (cVar1 = (**(code **)(*imageRefCount + 0xc))(), cVar1 != '\0')) && - (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(); - } - } - layerIdx = layerIdx + 1; - layerOffset = layerOffset + 0xa0; - } while (layerIdx < GHIDRA_UINT(this->_layerCount)); - } - ExceptionList = local_10; - return; -} - -// 00452bf0 -std_string * ANM2::GetAnimation(std_string *outName) -{ - void *animData; - - animData = *(void **)((this->_filename)._buf + 4); - if (animData == (void *)0x0) { - outName->_buf[0] = '\0'; - outName->_buf[1] = '\0'; - outName->_buf[2] = '\0'; - outName->_buf[3] = '\0'; - outName->_size = 0; - outName->_capacity = 0xf; - outName->_buf[0] = '\0'; - outName->_size = 0; - outName->_buf[0] = '\0'; - return outName; - } - (GHIDRA_CAST((outName->_buf)))->msvc::string::string(animData); - return outName; -} - -// 004a5d10 -void ANM2::LoadDeliriumForm(ANM2 *sprite, int type, int variant, uint8_t isReloadAnm2) -{ - char *_Dst; - uint32_t uVar1; - uint32_t uVar2; - uint8_t *puVar3; - EntityConfig_Entity *entityConfig; - LayerState *pLVar4; - int iVar5; - std_string *psVar6; - uint8_t *pbVar7; - uint8_t extraout_CL; - uint8_t extraout_CL_00; - uint8_t extraout_CL_01; - uint8_t extraout_CL_02; - uint8_t extraout_CL_03; - uint8_t extraout_CL_04; - ANM2 *extraout_ECX; - ANM2 *extraout_ECX_00; - ANM2 *pAVar8; - uint32_t uVar9; - char *_Src; - uint32_t uVar10; - size_t tailLen; - std_string *ptr; - uint32_t uVar11; - uint32_t replacedLen; - uint32_t newCapacity; - uint8_t bVar12; - uint8_t *layerIdx; - std_string sheetPath; - uint32_t local_24; - uint8_t *puStack_20; - void *local_1c; - uint8_t *puStack_18; - uint32_t local_14; - - puStack_20 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); - local_14 = 0xffffffff; - puStack_18 = &LAB_00af305d; - local_1c = ExceptionList; - local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U; - ExceptionList = &local_1c; - pAVar8 = sprite; - puVar3 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); - if (isReloadAnm2 != 0) { - entityConfig = (GHIDRA_CAST((&g_manager->_entityConfig)))->EntityConfig::GetEntity(type,variant,0); - pAVar8 = extraout_ECX; - puVar3 = puStack_20; - if (entityConfig != GHIDRA_CAST(0x0)) { - Load(sprite,&entityConfig->anm2Path,0); - pAVar8 = extraout_ECX_00; - puVar3 = puStack_20; - } - } - puStack_20 = puVar3; - bVar12 = (uint8_t)pAVar8; - layerIdx = GHIDRA_CAST(0x0); - if (sprite->_layerCount != 0) { - do { - pLVar4 = GetLayer(sprite,layerIdx); - sheetPath._buf[0] = '\0'; - sheetPath._buf[1] = '\0'; - sheetPath._buf[2] = '\0'; - sheetPath._buf[3] = '\0'; - sheetPath._size = 0; - sheetPath._capacity = 0; - psVar6 = &pLVar4->_spriteSheetPath; - uVar11 = (pLVar4->_spriteSheetPath)._size; - if (0xf < (pLVar4->_spriteSheetPath)._capacity) { - psVar6 = *GHIDRA_CAST(psVar6->_buf); - } - if (uVar11 < 0x10) { - (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))) = *GHIDRA_CAST(psVar6->_buf); - (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x4))) = *GHIDRA_CAST((psVar6->_buf + 4)); - (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x8))) = *GHIDRA_CAST((psVar6->_buf + 8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0xc))) = *GHIDRA_CAST((psVar6->_buf + 0xc)); - uVar10 = 0xf; - bVar12 = extraout_CL; - } - else { - uVar10 = uVar11 | 0xf; - if (0x7fffffff < uVar10) { - uVar10 = 0x7fffffff; - } - (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))) = msvc::_Allocate(uVar10 + 1); - memcpy((*GHIDRA_CAST((GHIDRA_CAST(&((void *)sheetPath._buf)) + 0x0))),psVar6,uVar11 + 1); - bVar12 = extraout_CL_00; - } - local_14 = 0; - sheetPath._size = uVar11; - sheetPath._capacity = uVar10; - if (type != 0x19c) { - psVar6 = &sheetPath; - if (0xf < uVar10) { - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - } - iVar5 = _strnicmp(psVar6->_buf + 4,"bosses",6); - uVar10 = sheetPath._capacity; - uVar11 = sheetPath._size; - if (iVar5 == 0) { - if (sheetPath._size < 4) { - /* WARNING: Subroutine does not return */ - FUN_00499950(); - } - replacedLen = 6; - if (sheetPath._size - 4 < 6) { - replacedLen = sheetPath._size - 4; - } - if (replacedLen == 0x23) { - psVar6 = &sheetPath; - if (0xf < sheetPath._capacity) { - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - } - memmove(psVar6->_buf + 4,"Bosses/AfterbirthPlus/DeliriumForms",0x23); -LAB_004a609a: - } - else { - tailLen = (sheetPath._size - replacedLen) - 3; - if (0x23 < replacedLen) { - sheetPath._size = (sheetPath._size - replacedLen) + 0x23; - psVar6 = &sheetPath; - if (0xf < sheetPath._capacity) { - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - } - memmove(psVar6->_buf + 4,"Bosses/AfterbirthPlus/DeliriumForms",0x23); - memmove(psVar6[1]._buf + 0xf,psVar6->_buf + 4 + replacedLen,tailLen); - goto LAB_004a609a; - } - uVar9 = -replacedLen + 0x23; - if (uVar9 <= sheetPath._capacity - sheetPath._size) { - psVar6 = &sheetPath; - if (0xf < sheetPath._capacity) { - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - } - _Src = psVar6->_buf + replacedLen + 4; - _Dst = psVar6->_buf + 4; - if ((GHIDRA_CAST(0xb1e25e) < _Dst) || - (psVar6->_buf + sheetPath._size < "Bosses/AfterbirthPlus/DeliriumForms")) { - pbVar7 = &DAT_00000023; - } - else if ("Bosses/AfterbirthPlus/DeliriumForms" < _Src) { - pbVar7 = GHIDRA_CAST((_Src + -0xb1e23c)); - } - else { - pbVar7 = GHIDRA_CAST(0x0); - } - sheetPath._size = sheetPath._size + uVar9; - memmove(_Src + uVar9,_Src,tailLen); - memmove(_Dst,"Bosses/AfterbirthPlus/DeliriumForms",(size_t)pbVar7); - memcpy(pbVar7 + GHIDRA_INT(_Dst), - pbVar7 + GHIDRA_INT(("Bosses/AfterbirthPlus/DeliriumForms" + -replacedLen + 0x23)), - 0x23 - GHIDRA_INT(pbVar7)); - goto LAB_004a609a; - } - if (0x7fffffff - sheetPath._size < uVar9) { - /* WARNING: Subroutine does not return */ - msvc::string::_Xlen(); - } - uVar9 = uVar9 + sheetPath._size; - newCapacity = uVar9 | 0xf; - if (newCapacity < 0x80000000) { - if (0x7fffffff - (sheetPath._capacity >> 1) < sheetPath._capacity) { - newCapacity = 0x7fffffff; - } - else { - uVar1 = sheetPath._capacity + (sheetPath._capacity >> 1); - if (newCapacity < uVar1) { - newCapacity = uVar1; - } - } - } - else { - newCapacity = 0x7fffffff; - } - psVar6 = msvc::_Allocate(newCapacity + 1); - uVar2 = (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))); - tailLen = (uVar11 - replacedLen) - 3; - sheetPath._size = uVar9; - sheetPath._capacity = newCapacity; - if (uVar10 < 0x10) { - *GHIDRA_CAST(psVar6->_buf) = (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))); - psVar6->_buf[4] = 'B'; - psVar6->_buf[5] = 'o'; - psVar6->_buf[6] = 's'; - psVar6->_buf[7] = 's'; - psVar6->_buf[8] = 'e'; - psVar6->_buf[9] = 's'; - psVar6->_buf[10] = '/'; - psVar6->_buf[0xb] = 'A'; - psVar6->_buf[0xc] = 'f'; - psVar6->_buf[0xd] = 't'; - psVar6->_buf[0xe] = 'e'; - psVar6->_buf[0xf] = 'r'; - psVar6->_size = 0x74726962; - psVar6->_capacity = 0x756c5068; - builtin_strncpy(psVar6[1]._buf,"s/DeliriumForms",0xf); - memcpy(psVar6[1]._buf + 0xf,sheetPath._buf + replacedLen + 4,tailLen); - (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))) = psVar6; - goto LAB_004a609a; - } - *GHIDRA_CAST(psVar6->_buf) = *(*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(GHIDRA_CAST(sheetPath._buf)))) + 0x0))); - psVar6->_buf[4] = 'B'; - psVar6->_buf[5] = 'o'; - psVar6->_buf[6] = 's'; - psVar6->_buf[7] = 's'; - psVar6->_buf[8] = 'e'; - psVar6->_buf[9] = 's'; - psVar6->_buf[10] = '/'; - psVar6->_buf[0xb] = 'A'; - psVar6->_buf[0xc] = 'f'; - psVar6->_buf[0xd] = 't'; - psVar6->_buf[0xe] = 'e'; - psVar6->_buf[0xf] = 'r'; - psVar6->_size = 0x74726962; - psVar6->_capacity = 0x756c5068; - builtin_strncpy(psVar6[1]._buf,"s/DeliriumForms",0xf); - memcpy(psVar6[1]._buf + 0xf,(*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))) + replacedLen + 4,tailLen); - uVar11 = uVar10 + 1; - ptr = GHIDRA_CAST(uVar2); - if (0xfff < uVar11) { - ptr = GHIDRA_CAST((GHIDRA_CAST((uVar2 + -0x18)))->_capacity); - uVar11 = uVar10 + 0x24; - if (GHIDRA_CAST(0x1f) < GHIDRA_CAST((uVar2 + (-4 - GHIDRA_INT(ptr))))) goto LAB_004a622d; - } - operator_delete(ptr,uVar11); - (*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))) = psVar6; - } - psVar6 = &sheetPath; - if (0xf < sheetPath._capacity) { - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - } - pbVar7 = FileSystem::ResolvePath(GHIDRA_CAST(psVar6)); - bVar12 = pbVar7 != GHIDRA_CAST(0x0); - if (pbVar7 != GHIDRA_CAST(0x0)) { - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; - tracked_alloc(1,pbVar7,0); - local_14 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8; - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::ReplaceSpritesheet(GHIDRA_INT(layerIdx),&sheetPath); - bVar12 = extraout_CL_01; - } - } - else { - psVar6 = &sheetPath; - if (0xf < sheetPath._capacity) { - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - } - iVar5 = _strnicmp(psVar6->_buf + 4,"monsters",8); - bVar12 = extraout_CL_02; - if (iVar5 == 0) { - msvc::string::replace - (sheetPath._buf,4,8,GHIDRA_CAST("Bosses/AfterbirthPlus/DeliriumForms"),0x23); - psVar6 = &sheetPath; - if (0xf < sheetPath._capacity) { - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - } - pbVar7 = FileSystem::ResolvePath(GHIDRA_CAST(psVar6)); - bVar12 = pbVar7 != GHIDRA_CAST(0x0); - if (pbVar7 != GHIDRA_CAST(0x0)) { - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; - tracked_alloc(1,pbVar7,0); - local_14 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8; - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::ReplaceSpritesheet(GHIDRA_INT(layerIdx),&sheetPath); - bVar12 = extraout_CL_03; - } - } - } - } - local_14 = 0xffffffff; - if (0xf < sheetPath._capacity) { - uVar11 = sheetPath._capacity + 1; - psVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(sheetPath._buf))) + 0x0))); - if (0xfff < uVar11) { - psVar6 = GHIDRA_CAST((GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))) + -0x18)))->_capacity); - uVar11 = sheetPath._capacity + 0x24; - if (GHIDRA_CAST(0x1f) < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(sheetPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(psVar6))))) { -LAB_004a622d: - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(psVar6,uVar11); - bVar12 = extraout_CL_04; - } - layerIdx = layerIdx + 1; - } while (layerIdx < GHIDRA_CAST(sprite->_layerCount)); - } - LoadGraphics(sprite,bVar12); - psVar6 = &sprite->_animDefaultName; - if (0xf < (sprite->_animDefaultName)._capacity) { - psVar6 = *GHIDRA_CAST(psVar6->_buf); - } - bVar12 = SetAnimation(sprite,GHIDRA_CAST(psVar6),1); - if (((bVar12 != 0) && ((sprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&sprite->_animState)))->AnimationState::SetFrameFloat(0.0), - (sprite->_animState)._animData != (void *)0x0)) { - (sprite->_animState)._isPlaying = 0; - } - ExceptionList = local_1c; - return; -} - -// 0078b3b0 -void ANM2::copy_animation_to(ANM2 *source, ANM2 *dest) -{ - uint8_t isAnimSet; - std_string *animName; - int frame; - void *allocBlock; - uint32_t allocSize; - void *overlayNameBuf [5]; - uint32_t overlayNameCapacity; - void *animNameBuf [5]; - uint32_t animNameCapacity; - uint32_t local_14; - void *local_10; - uint8_t *puStack_c; - void *local_8; - float overlayFrame; - - local_8 = (void *)0xffffffff; - puStack_c = &LAB_00aff585; - local_10 = ExceptionList; - local_14 = __security_cookie ^ GHIDRA_UINT((animNameBuf + 10)); - ExceptionList = &local_10; - if ((source->_loaded != 0) && (dest->_loaded != 0)) { - if (((source->_animState)._animData == (void *)0x0) || ((source->_animState)._isPlaying == 0)) { - frame = GetFrame(source); - animName = GetAnimation(GHIDRA_CAST(&source->_animState),GHIDRA_CAST(animNameBuf)); - local_8 = (void *)0x1; - SetFrame(dest,animName,frame); - local_8 = (void *)0xffffffff; - if (0xf < animNameCapacity) { - allocSize = animNameCapacity + 1; - allocBlock = animNameBuf[0]; - if (0xfff < allocSize) { - allocBlock = *(void **)(GHIDRA_INT(animNameBuf[0]) + -4); - allocSize = animNameCapacity + 0x24; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(animNameBuf[0]) + (-4 - GHIDRA_INT(allocBlock))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(allocBlock,allocSize); - } - } - else { - animName = GetAnimation(GHIDRA_CAST(&source->_animState),GHIDRA_CAST(animNameBuf)); - local_8 = (void *)0x0; - if (0xf < animName->_capacity) { - animName = *GHIDRA_CAST(animName->_buf); - } - isAnimSet = SetAnimation(dest,GHIDRA_CAST(animName),1); - if (isAnimSet != 0) { - (GHIDRA_CAST((&dest->_animState)))->AnimationState::Rewind(); - (dest->_animState)._isPlaying = 1; - } - local_8 = (void *)0xffffffff; - if (0xf < animNameCapacity) { - allocSize = animNameCapacity + 1; - allocBlock = animNameBuf[0]; - if (0xfff < allocSize) { - allocBlock = *(void **)(GHIDRA_INT(animNameBuf[0]) + -4); - allocSize = animNameCapacity + 0x24; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(animNameBuf[0]) + (-4 - GHIDRA_INT(allocBlock))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(allocBlock,allocSize); - } - frame = GetFrame(source); - if ((dest->_animState)._animData != (void *)0x0) { - (GHIDRA_CAST((&dest->_animState)))->AnimationState::SetFrameFloat((float)frame); - } - } - if ((source->_overlayAnimState)._animData == (void *)0x0) { - if ((dest->_overlayAnimState)._animData != (void *)0x0) { - (GHIDRA_CAST((&dest->_overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - } - } - else if ((source->_overlayAnimState)._isPlaying == 0) { - overlayFrame = (source->_overlayAnimState)._animFrame; - animName = GetAnimation(GHIDRA_CAST(&source->_overlayAnimState),GHIDRA_CAST(overlayNameBuf)); - local_8 = (void *)0x3; - (GHIDRA_CAST((GHIDRA_CAST(dest))))->Sprite::SetOverlayFrame(animName,GHIDRA_INT(overlayFrame)); - if (0xf < overlayNameCapacity) { - allocSize = overlayNameCapacity + 1; - allocBlock = overlayNameBuf[0]; - if (0xfff < allocSize) { - allocBlock = *(void **)(GHIDRA_INT(overlayNameBuf[0]) + -4); - allocSize = overlayNameCapacity + 0x24; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(overlayNameBuf[0]) + (-4 - GHIDRA_INT(allocBlock))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(allocBlock,allocSize); - } - } - else { - animName = GetAnimation(GHIDRA_CAST(&source->_overlayAnimState),GHIDRA_CAST(animNameBuf)); - local_8 = (void *)0x2; - if (0xf < animName->_capacity) { - animName = *GHIDRA_CAST(animName->_buf); - } - isAnimSet = SetOverlayAnimation(dest,GHIDRA_CAST(animName),1); - if (isAnimSet != 0) { - (GHIDRA_CAST((&dest->_overlayAnimState)))->AnimationState::Rewind(); - (dest->_overlayAnimState)._isPlaying = 1; - } - local_8 = (void *)0xffffffff; - if (0xf < animNameCapacity) { - allocSize = animNameCapacity + 1; - allocBlock = animNameBuf[0]; - if (0xfff < allocSize) { - allocBlock = *(void **)(GHIDRA_INT(animNameBuf[0]) + -4); - allocSize = animNameCapacity + 0x24; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(animNameBuf[0]) + (-4 - GHIDRA_INT(allocBlock))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(allocBlock,allocSize); - } - if ((source->_overlayAnimState)._animData == (void *)0x0) { - frame = -1; - } - else { - frame = GHIDRA_INT((source->_overlayAnimState)._animFrame); - } - if ((dest->_overlayAnimState)._animData != (void *)0x0) { - (GHIDRA_CAST((&dest->_overlayAnimState)))->AnimationState::SetFrameFloat((float)frame); - } - } - } - ExceptionList = local_10; - return; -} - -// 00837210 -void ANM2::update_appear_then_idle() -{ - uint8_t nameChar; - uint8_t *animName; - uint32_t compareResult; - char *appearName; - uint8_t *idleName; - bool isLess; - uint8_t *animData; - - if (this->_loaded != 0) { - (GHIDRA_CAST((&this->_animState)))->AnimationState::Update(); - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::Update(); - } - animData = (this->_animState)._animData; - if ((animData != GHIDRA_CAST(0x0)) && ((this->_animState)._isPlaying == 0)) { - animName = animData; - if (0xf < *GHIDRA_CAST((animData + 0x14))) { - animName = *GHIDRA_CAST(animData); - } - appearName = "Appear"; - do { - nameChar = *animName; - isLess = nameChar < (uint8_t)*appearName; - if (nameChar != *appearName) { -LAB_00837272: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_00837277; - } - if (nameChar == 0) break; - nameChar = animName[1]; - isLess = nameChar < (uint8_t)appearName[1]; - if (nameChar != appearName[1]) goto LAB_00837272; - animName = animName + 2; - appearName = appearName + 2; - } while (nameChar != 0); - compareResult = 0; -LAB_00837277: - if (compareResult == 0) { - animName = animData; - if (0xf < *GHIDRA_CAST((animData + 0x14))) { - animName = *GHIDRA_CAST(animData); - } - idleName = s_Idle; - do { - nameChar = *animName; - isLess = nameChar < *idleName; - if (nameChar != *idleName) { -LAB_008372b0: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_008372b5; - } - if (nameChar == 0) break; - nameChar = animName[1]; - isLess = nameChar < idleName[1]; - if (nameChar != idleName[1]) goto LAB_008372b0; - animName = animName + 2; - idleName = idleName + 2; - } while (nameChar != 0); - compareResult = 0; -LAB_008372b5: - if ((compareResult != 0) || (animData[0x34] != 0)) { - nameChar = SetAnimation(this,s_Idle,1); - if (nameChar != 0) { - (GHIDRA_CAST((&this->_animState)))->AnimationState::Rewind(); - (this->_animState)._isPlaying = 1; - } - } - } - } - return; -} diff --git a/generated-src/anm_cache.cpp b/generated-src/anm_cache.cpp deleted file mode 100644 index e6156f5..0000000 --- a/generated-src/anm_cache.cpp +++ /dev/null @@ -1,5197 +0,0 @@ -#include "classes.h" - -// 0040d240 -AnmCache::~AnmCache() -{ - void *sprite = this; - char isLastRef; - uint32_t uVar1; - ANM2 **spritesEnd; - uint64_t *allocCounter; - ANM2 **spriteCursor; - int *piVar2; - int *local_14; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - uint32_t blockSize; - void *frameBuffer; - int *imageMap; - int *imageNode; - uint64_t prevAllocated; - ANM2 *sprite; - - local_8 = 0xffffffff; - puStack_c = &LAB_00af0dd0; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; - ExceptionList = &local_10; - spritesEnd = DAT_00c78da8; - spriteCursor = g_staticSprites; - local_14 = sprite; - if (g_staticSprites != DAT_00c78da8) { - do { - sprite = *spriteCursor; - if (sprite != GHIDRA_CAST(0x0)) { - local_8 = 0; - (GHIDRA_CAST((sprite)))->ANM2::Reset(); - frameBuffer = (sprite->_overlayAnimState)._layerFrames; - if (frameBuffer != (void *)0x0) { - if (g_mainHeap == (void *)0x0) { - allocCounter = &g_allocatedBytesNoHeap; - } - else { - allocCounter = GHIDRA_CAST((GHIDRA_INT(g_mainHeap) + 0x30)); - } - blockSize = *GHIDRA_CAST((GHIDRA_CAST(frameBuffer) + -4)); - prevAllocated = *allocCounter; - *GHIDRA_CAST(allocCounter) = GHIDRA_UINT(*allocCounter) - blockSize; - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) = - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocated) < blockSize)); - free((void *)(GHIDRA_INT(frameBuffer) + -4)); - (sprite->_overlayAnimState)._layerFrames = (void *)0x0; - } - frameBuffer = (sprite->_overlayAnimState)._nullLayerFrames; - if (frameBuffer != (void *)0x0) { - if (g_mainHeap == (void *)0x0) { - allocCounter = &g_allocatedBytesNoHeap; - } - else { - allocCounter = GHIDRA_CAST((GHIDRA_INT(g_mainHeap) + 0x30)); - } - blockSize = *GHIDRA_CAST((GHIDRA_CAST(frameBuffer) + -4)); - prevAllocated = *allocCounter; - *GHIDRA_CAST(allocCounter) = GHIDRA_UINT(*allocCounter) - blockSize; - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) = - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocated) < blockSize)); - free((void *)(GHIDRA_INT(frameBuffer) + -4)); - (sprite->_overlayAnimState)._nullLayerFrames = (void *)0x0; - } - frameBuffer = (sprite->_animState)._layerFrames; - if (frameBuffer != (void *)0x0) { - if (g_mainHeap == (void *)0x0) { - allocCounter = &g_allocatedBytesNoHeap; - } - else { - allocCounter = GHIDRA_CAST((GHIDRA_INT(g_mainHeap) + 0x30)); - } - blockSize = *GHIDRA_CAST((GHIDRA_CAST(frameBuffer) + -4)); - prevAllocated = *allocCounter; - *GHIDRA_CAST(allocCounter) = GHIDRA_UINT(*allocCounter) - blockSize; - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) = - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocated) < blockSize)); - free((void *)(GHIDRA_INT(frameBuffer) + -4)); - (sprite->_animState)._layerFrames = (void *)0x0; - } - frameBuffer = (sprite->_animState)._nullLayerFrames; - if (frameBuffer != (void *)0x0) { - if (g_mainHeap == (void *)0x0) { - allocCounter = &g_allocatedBytesNoHeap; - } - else { - allocCounter = GHIDRA_CAST((GHIDRA_INT(g_mainHeap) + 0x30)); - } - blockSize = *GHIDRA_CAST((GHIDRA_CAST(frameBuffer) + -4)); - prevAllocated = *allocCounter; - *GHIDRA_CAST(allocCounter) = GHIDRA_UINT(*allocCounter) - blockSize; - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) = - *GHIDRA_CAST((GHIDRA_CAST(allocCounter) + 4)) - GHIDRA_UINT((GHIDRA_UINT(prevAllocated) < blockSize)); - free((void *)(GHIDRA_INT(frameBuffer) + -4)); - (sprite->_animState)._nullLayerFrames = (void *)0x0; - } - (GHIDRA_CAST(((sprite->_animDefaultName)._buf)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->msvc::string::_Tidy_deallocate(); - local_8 = 0xffffffff; - operator_delete(sprite,0x114); - spritesEnd = DAT_00c78da8; - } - spriteCursor = spriteCursor + 1; - } while (spriteCursor != spritesEnd); - sprite = local_14; - } - piVar2 = *GHIDRA_CAST(sprite); - local_14 = GHIDRA_CAST(*piVar2); - DAT_00c78da8 = g_staticSprites; - if (local_14 != piVar2) { - do { - (GHIDRA_CAST((local_14 + 5)))->AnmFileData::Clear(); - msvc:: - _Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - ::operator++((_Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - *)&local_14); - piVar2 = *GHIDRA_CAST(sprite); - } while (local_14 != piVar2); - } - FUN_00415ae0(sprite,piVar2[1]); - piVar2[1] = GHIDRA_INT(piVar2); - imageMap = GHIDRA_CAST((GHIDRA_INT(sprite) + 8)); - *piVar2 = GHIDRA_INT(piVar2); - piVar2[2] = GHIDRA_INT(piVar2); - *GHIDRA_CAST((GHIDRA_CAST(sprite) + 4)) = 0; - piVar2 = GHIDRA_CAST(*imageMap); - local_14 = GHIDRA_CAST(*piVar2); - if (local_14 != piVar2) { - do { - imageNode = local_14; - piVar2 = local_14 + 5; - if (((GHIDRA_CAST(local_14[6]) != GHIDRA_CAST(0x0)) && - (isLastRef = (**(code **)(*GHIDRA_CAST(local_14[6]) + 0xc))(uVar1), isLastRef != '\0')) && - (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(piVar2); - } - imageNode[6] = 0; - *piVar2 = 0; - msvc:: - _Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - ::operator++((_Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - *)&local_14); - piVar2 = GHIDRA_CAST(*imageMap); - } while (local_14 != piVar2); - } - msvc::map::_Erase_tree(imageMap,piVar2[1]); - piVar2[1] = GHIDRA_INT(piVar2); - *piVar2 = GHIDRA_INT(piVar2); - piVar2[2] = GHIDRA_INT(piVar2); - *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0xc)) = 0; - ExceptionList = local_10; - return; -} - -// 0040d4c0 -void AnmCache::LogMemoryUsage() -{ - uint32_t *puVar1; - int *piVar2; - uint32_t count; - uint32_t uVar4; - uint32_t uVar5; - int iVar6; - int iVar7; - int iVar8; - uint32_t i; - uint8_t auVar9 [16]; - uint8_t auVar10 [16]; - uint8_t auVar11 [16]; - uint8_t auVar12 [16]; - uint8_t auVar13 [16]; - uint8_t auVar14 [16]; - uint8_t auVar15 [16]; - uint8_t auVar16 [16]; - void *nodeIter; - int entryCount; - int animsLeft; - int local_1c; - int frameBytes; - int frameBytesOdd; - int animCursor; - void *node; - int *animLayers; - uint32_t count; - - iVar7 = 0; - node = *(void **)g_anmCacheMap; - entryCount = 0; - if (node != g_anmCacheMap) { - do { - animsLeft = *GHIDRA_CAST((GHIDRA_CAST(node) + 0x24)); - if (animsLeft != 0) { - iVar7 = *GHIDRA_CAST((GHIDRA_CAST(node) + 0x20)); - animCursor = iVar7 + 0x24; - animLayers = GHIDRA_CAST((iVar7 + 0x18)); - do { - i = 0; - count = animLayers[1]; - if (((count != 0) && (7 < count)) && (1 < __isa_available)) { - iVar6 = *animLayers; - iVar8 = 0; - do { - puVar1 = GHIDRA_CAST((iVar6 + 0x38 + iVar8)); - iVar8 = iVar8 + 0x80; - count = *GHIDRA_CAST((iVar6 + -0x58 + iVar8)); - i = i + 8; - uVar4 = *GHIDRA_CAST((iVar6 + -0x78 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar10)) + 0x4))) = count; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar10)) + 0x0))) = uVar4; - uVar5 = *GHIDRA_CAST((iVar6 + -0x18 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar10)) + 0x8))) = count; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar10)) + 0xc))) = *puVar1; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar9)) + 0x8))) = (*GHIDRA_CAST((GHIDRA_CAST(&(auVar10)) + 0x8))); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar9)) + 0x4))) = *GHIDRA_CAST((iVar6 + -0x68 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar9)) + 0x0))) = uVar4; - pmulld(auVar9,_DAT_00bab780); - count = *GHIDRA_CAST((iVar6 + -0x38 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar12)) + 0x4))) = uVar5; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar12)) + 0x0))) = count; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar12)) + 0x8))) = uVar5; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar12)) + 0xc))) = *GHIDRA_CAST((iVar6 + -8 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar11)) + 0x8))) = (*GHIDRA_CAST((GHIDRA_CAST(&(auVar12)) + 0x8))); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar11)) + 0x4))) = *GHIDRA_CAST((iVar6 + -0x28 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar11)) + 0x0))) = count; - pmulld(auVar11,_DAT_00bab780); - } while (i < (count & 0xfffffff8)); - } - if ((i < count) && (local_1c = *animLayers, 1 < count - i)) { - iVar8 = ((count - i) - 2 >> 1) + 1; - do { - iVar8 = iVar8 + -1; - } while (iVar8 != 0); - } - count = animLayers[3]; - i = 0; - if (((count != 0) && (7 < count)) && (1 < __isa_available)) { - local_1c = animLayers[2]; - iVar8 = 0; - do { - puVar1 = GHIDRA_CAST((local_1c + 0x3c + iVar8)); - iVar8 = iVar8 + 0x80; - count = *GHIDRA_CAST((local_1c + -0x54 + iVar8)); - i = i + 8; - uVar4 = *GHIDRA_CAST((local_1c + -0x74 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar14)) + 0x4))) = count; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar14)) + 0x0))) = uVar4; - uVar5 = *GHIDRA_CAST((local_1c + -0x14 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar14)) + 0x8))) = count; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar14)) + 0xc))) = *puVar1; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar13)) + 0x8))) = (*GHIDRA_CAST((GHIDRA_CAST(&(auVar14)) + 0x8))); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar13)) + 0x4))) = *GHIDRA_CAST((local_1c + -100 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar13)) + 0x0))) = uVar4; - pmulld(auVar13,_DAT_00bab760); - count = *GHIDRA_CAST((local_1c + -0x34 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar16)) + 0x4))) = uVar5; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar16)) + 0x0))) = count; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar16)) + 0x8))) = uVar5; - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar16)) + 0xc))) = *GHIDRA_CAST((local_1c + -4 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar15)) + 0x8))) = (*GHIDRA_CAST((GHIDRA_CAST(&(auVar16)) + 0x8))); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar15)) + 0x4))) = *GHIDRA_CAST((local_1c + -0x24 + iVar8)); - (*GHIDRA_CAST((GHIDRA_CAST(&(auVar15)) + 0x0))) = count; - pmulld(auVar15,_DAT_00bab760); - } while (i < (count & 0xfffffff8)); - } - frameBytes = 0; - frameBytesOdd = 0; - if ((i < count) && (1 < count - i)) { - local_1c = *GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(node) + 0x20)) - iVar7) + animCursor + -4)); - iVar8 = i << 4; - iVar6 = ((animLayers[3] - i) - 2 >> 1) + 1; - do { - piVar2 = GHIDRA_CAST((local_1c + 0xc + iVar8)); - iVar8 = iVar8 + 0x20; - frameBytes = frameBytes + *piVar2 * 0x54; - frameBytesOdd = frameBytesOdd + *GHIDRA_CAST((local_1c + -4 + iVar8)) * 0x54; - iVar6 = iVar6 + -1; - } while (iVar6 != 0); - } - animLayers = animLayers + 0x4f; - animCursor = animCursor + 0x13c; - animsLeft = animsLeft + -1; - } while (animsLeft != 0); - animsLeft = 0; - iVar7 = entryCount; - } - iVar7 = iVar7 + 1; - nodeIter = node; - entryCount = iVar7; - msvc:: - _Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - ::operator++((_Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - *)&nodeIter); - node = nodeIter; - } while (nodeIter != g_anmCacheMap); - } - nodeIter = node; - KAGE_LogMessage(1,GHIDRA_CAST("AnmCache memory usage: %u bytes in %u entries.\n")); - return; -} - -// 0040db90 -void AnmCache::Load(std_string *param_1, std_string *param_2) -{ - int64_t lVar1; - int64_t lVar2; - uint64_t qVar3; - uint8_t ***mountPrefixes; - std_string *psVar4; - uint8_t *pbVar5; - uint32_t uVar6; - uint32_t uVar7; - uint32_t uVar8; - uint64_t *allocatedBytes; - uint8_t *pbVar9; - std_string *psVar10; - uint8_t **mountPrefix; - bool bVar11; - uint64_t startTimeNs; - uint64_t uVar12; - uint8_t local_160 [8]; - void *local_158; - uint32_t startMsLow; - uint32_t local_150 [2]; - uint8_t *local_148; - uint32_t startMsHigh; - uint32_t local_138; - uint32_t *local_134; - std_string *local_130; - std_string *local_12c; - uint8_t fullPath [260]; - uint32_t local_24; - uint8_t *puStack_20; - void *local_1c; - uint8_t *puStack_18; - uint32_t local_14; - uint32_t *oldLayerBlock; - void *oldLayerStates; - - puStack_20 = fullPath + 0x124; - local_14 = 0xffffffff; - puStack_18 = &LAB_00af0e48; - local_1c = ExceptionList; - local_24 = __security_cookie ^ GHIDRA_UINT((fullPath + 0x118)); - ExceptionList = &local_1c; - local_130 = param_1; - local_12c = param_2; - if (param_1->_size != 0) { - startTimeNs = GetTimeNs(); - pbVar9 = g_anmCacheMap; - uVar7 = GHIDRA_UINT((startTimeNs >> 0x20)); - uVar12 = (startTimeNs & 0xffffffff) * 0xd7b634db; - local_150[0] = (uint32_t)uVar12; - lVar1 = (startTimeNs & 0xffffffff) * 0x431bde82; - local_148 = GHIDRA_CAST(((uint64_t)lVar1 >> 0x20)); - uVar12 = (uint64_t)uVar7 * 0xd7b634db + (uVar12 >> 0x20); - uVar8 = GHIDRA_UINT((uVar12 >> 0x20)); - lVar1 = lVar1 + (uVar12 & 0xffffffff); - local_138 = (uint32_t)lVar1; - uVar6 = GHIDRA_UINT(((uint64_t)lVar1 >> 0x20)); - local_134 = GHIDRA_CAST(0x0); - lVar1 = (uint64_t)uVar7 * 0x431bde82 + (uint64_t)CONCAT14(CARRY4(uVar8,uVar6),uVar8 + uVar6); - startMsHigh = GHIDRA_UINT(((uint64_t)lVar1 >> 0x20)); - startMsLow = GHIDRA_UINT(lVar1) >> 0x12 | startMsHigh * 0x4000; - startMsHigh = startMsHigh >> 0x12; - if (GHIDRA_UINT((GHIDRA_INT(g_mountPrefixesEnd) - GHIDRA_INT(g_mountPrefixes))) < 4) { - mountPrefixes = FileSystem::GetMountPrefixes(local_150); - if (mountPrefixes != &g_mountPrefixes) { - FID_conflict__Tidy(&g_mountPrefixes); - g_mountPrefixes = *mountPrefixes; - g_mountPrefixesEnd = mountPrefixes[1]; - _DAT_00c798c0 = mountPrefixes[2]; - *mountPrefixes = GHIDRA_CAST(0x0); - mountPrefixes[1] = GHIDRA_CAST(0x0); - mountPrefixes[2] = GHIDRA_CAST(0x0); - } - FID_conflict__Tidy(local_150); - } - mountPrefix = g_mountPrefixes; - if (g_mountPrefixes != g_mountPrefixesEnd) { - do { - strncpy_s(GHIDRA_CAST(fullPath),0x100,GHIDRA_CAST(*mountPrefix),0x100); - psVar4 = local_130; - if (0xf < local_130->_capacity) { - psVar4 = *GHIDRA_CAST(local_130->_buf); - } - strcat_s(GHIDRA_CAST(fullPath),0x100,psVar4->_buf); - local_134 = GHIDRA_CAST(KAGE_Filesys_FileManager)::GetPrimaryFilePathHash(fullPath); - AnmCache::lower_bound_find(local_150,&local_134); - if ((*GHIDRA_CAST((GHIDRA_CAST(local_148) + 0xd)) != '\0') || - (pbVar9 = local_148, local_134 < *GHIDRA_CAST((GHIDRA_CAST(local_148) + 0x10)))) { - pbVar9 = g_anmCacheMap; - } - } while ((pbVar9 == g_anmCacheMap) && - (mountPrefix = mountPrefix + 1, mountPrefix != g_mountPrefixesEnd)); - } - psVar10 = local_130; - psVar4 = local_130; - if (0xf < local_130->_capacity) { - psVar4 = *GHIDRA_CAST(local_130->_buf); - } - local_148 = FileSystem::ResolvePath(GHIDRA_CAST(psVar4)); - if ((pbVar9 == g_anmCacheMap) || - ((*GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x14)) != '\0' && (local_148 != GHIDRA_CAST(0x0))))) { - ParseFile(psVar10,GHIDRA_UINT(local_134)); - AnmCache::lower_bound_find(local_160,&local_134); - if ((*GHIDRA_CAST((GHIDRA_CAST(local_158) + 0xd)) != '\0') || - (pbVar9 = local_158, local_134 < *GHIDRA_CAST((GHIDRA_CAST(local_158) + 0x10)))) { - pbVar9 = g_anmCacheMap; - } - } - if (g_mainHeap == (void *)0x0) { - allocatedBytes = &g_allocatedBytesNoHeap; - } - else { - allocatedBytes = GHIDRA_CAST((GHIDRA_INT(g_mainHeap) + 0x30)); - } - if (local_148 != GHIDRA_CAST(0x0)) { - uVar6 = *GHIDRA_CAST((local_148 + -4)); - qVar3 = *allocatedBytes; - *GHIDRA_CAST(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar6; - *GHIDRA_CAST((GHIDRA_CAST(allocatedBytes) + 4)) = - *GHIDRA_CAST((GHIDRA_CAST(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(qVar3) < uVar6)); - free(local_148 + -4); - } - local_14 = 0xffffffff; - if (pbVar9 == g_anmCacheMap) { - KAGE_LogMessage(1,GHIDRA_CAST("AnmCache failed to load %s\n")); - } - else { - oldLayerStates = *(void **)(local_12c[5]._buf + 4); - psVar4 = local_12c; - if (oldLayerStates != (void *)0x0) { - oldLayerBlock = GHIDRA_CAST((GHIDRA_INT(oldLayerStates) + -4)); - local_14 = 1; - _eh_vector_destructor_iterator_(oldLayerStates,0xa0,*oldLayerBlock,LayerState::~LayerState); - operator_delete(oldLayerBlock,*oldLayerBlock * 0xa0 + 4); - psVar4 = local_12c; - } - local_14 = 0xffffffff; - local_12c = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x1c)); - psVar10 = GHIDRA_CAST(0x0); - if (local_12c != GHIDRA_CAST(0x0)) { - local_148 = GHIDRA_CAST(0x0); - uVar6 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(local_12c) * 0xa0 >> 0x20)) != 0)) | - GHIDRA_UINT((ZEXT48(local_12c) * 0xa0)); - local_130 = local_12c; - local_134 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar6)) | uVar6 + 4); - local_14 = 3; - if (local_134 == GHIDRA_CAST(0x0)) { - pbVar5 = GHIDRA_CAST(0x0); - } - else { - *local_134 = local_12c; - local_148 = GHIDRA_CAST((local_134 + 1)); - _eh_vector_constructor_iterator_ - (local_148,0xa0,GHIDRA_UINT(local_12c),LayerState::LayerState,LayerState::~LayerState); - pbVar5 = local_148; - } - local_14 = 0xffffffff; - *GHIDRA_CAST((psVar4[5]._buf + 4)) = pbVar5; - local_12c = GHIDRA_CAST(0x0); - psVar10 = GHIDRA_CAST(0x0); - if (*GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x1c)) != 0) { - local_130 = GHIDRA_CAST(0x0); - local_134 = GHIDRA_CAST(0x0); - do { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_130) + *GHIDRA_CAST((psVar4[5]._buf + 4)))))))->LayerState::Init(*GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x18)) + GHIDRA_INT(local_134)); - local_134 = local_134 + 0xe; - *GHIDRA_CAST((GHIDRA_CAST(local_130) + 4 + *GHIDRA_CAST((psVar4[5]._buf + 4)))) = psVar4; - local_130 = GHIDRA_CAST((GHIDRA_INT(local_130) + 0xa0)); - psVar10 = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x1c)); - local_12c = GHIDRA_CAST((local_12c->_buf + 1)); - } while (local_12c < psVar10); - } - } - *GHIDRA_CAST((psVar4[5]._buf + 8)) = psVar10; - psVar4[4]._capacity = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x20)); - *GHIDRA_CAST(psVar4[5]._buf) = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x24)); - *GHIDRA_CAST((psVar4[5]._buf + 0xc)) = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x28)); - psVar4[5]._size = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x2c)); - psVar4[5]._capacity = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x30)); - psVar10 = GHIDRA_CAST((GHIDRA_INT(pbVar9) + 0x38)); - *GHIDRA_CAST(psVar4[6]._buf) = *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x34)); - if (psVar4 + 1 != psVar10) { - if (0xf < *GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x4c))) { - psVar10 = *GHIDRA_CAST(psVar10->_buf); - } - (GHIDRA_CAST((psVar4[1]._buf)))->msvc::string::assign(GHIDRA_CAST(psVar10),*GHIDRA_CAST((GHIDRA_CAST(pbVar9) + 0x48))); - } - } - uVar12 = GetTimeNs(); - uVar7 = GHIDRA_UINT((uVar12 >> 0x20)); - lVar1 = (uVar12 & 0xffffffff) * 0x431bde82; - lVar2 = (uint64_t)uVar7 * 0xd7b634db + ((uVar12 & 0xffffffff) * 0xd7b634db >> 0x20); - uVar8 = GHIDRA_UINT(((uint64_t)lVar2 >> 0x20)); - uVar6 = GHIDRA_INT(((uint64_t)lVar1 >> 0x20)) + GHIDRA_UINT(CARRY4(GHIDRA_UINT(lVar1),GHIDRA_UINT(lVar2))); - lVar1 = (uint64_t)uVar7 * 0x431bde82 + (uint64_t)CONCAT14(CARRY4(uVar8,uVar6),uVar8 + uVar6); - uVar8 = GHIDRA_UINT(((uint64_t)lVar1 >> 0x20)); - uVar6 = GHIDRA_UINT(lVar1) >> 0x12 | uVar8 * 0x4000; - uVar7 = uVar6 - startMsLow; - bVar11 = CARRY4(_DAT_00c79c40,uVar7); - _DAT_00c79c40 = _DAT_00c79c40 + uVar7; - _DAT_00c79c44 = - _DAT_00c79c44 + (((uVar8 >> 0x12) - startMsHigh) - GHIDRA_UINT((uVar6 < startMsLow))) + - GHIDRA_UINT(bVar11); - } - ExceptionList = local_1c; - return; -} - -// 0040e110 -void AnmCache::AddRef(std_string *path) -{ - uint8_t ***mountPrefixes; - std_string *pathText; - void *cacheEntry; - uint8_t **prefix; - uint8_t local_12c [8]; - void *foundNode; - std_string *pathLocal; - uint32_t pathHash; - uint8_t fullPath [260]; - uint32_t local_14; - - cacheEntry = g_anmCacheMap; - local_14 = __security_cookie ^ GHIDRA_UINT((fullPath + 0x108)); - pathLocal = path; - if ((GHIDRA_INT(g_mountPrefixesEnd) - GHIDRA_INT(g_mountPrefixes) & 0xfffffffcU) == 0) { - mountPrefixes = FileSystem::GetMountPrefixes(local_12c); - if (mountPrefixes != &g_mountPrefixes) { - FID_conflict__Tidy(&g_mountPrefixes); - g_mountPrefixes = *mountPrefixes; - g_mountPrefixesEnd = mountPrefixes[1]; - _DAT_00c798c0 = mountPrefixes[2]; - *mountPrefixes = GHIDRA_CAST(0x0); - mountPrefixes[1] = GHIDRA_CAST(0x0); - mountPrefixes[2] = GHIDRA_CAST(0x0); - } - FID_conflict__Tidy(local_12c); - } - prefix = g_mountPrefixes; - if (g_mountPrefixes != g_mountPrefixesEnd) { - do { - strncpy_s(GHIDRA_CAST(fullPath),0x100,GHIDRA_CAST(*prefix),0x100); - pathText = pathLocal; - if (0xf < pathLocal->_capacity) { - pathText = *GHIDRA_CAST(pathLocal->_buf); - } - strcat_s(GHIDRA_CAST(fullPath),0x100,pathText->_buf); - pathHash = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(fullPath); - AnmCache::lower_bound_find(local_12c,&pathHash); - if ((*GHIDRA_CAST((GHIDRA_CAST(foundNode) + 0xd)) != '\0') || - (cacheEntry = foundNode, pathHash < *GHIDRA_CAST((GHIDRA_CAST(foundNode) + 0x10)))) { - cacheEntry = g_anmCacheMap; - } - if (cacheEntry != g_anmCacheMap) goto LAB_0040e26e; - prefix = prefix + 1; - } while (prefix != g_mountPrefixesEnd); - } - if (cacheEntry == g_anmCacheMap) { - KAGE_LogMessage(1,GHIDRA_CAST("[warn] AnmCache: cannot add reference to %s\n")); - } - else { -LAB_0040e26e: - *GHIDRA_CAST((GHIDRA_CAST(cacheEntry) + 0x50)) = *GHIDRA_CAST((GHIDRA_CAST(cacheEntry) + 0x50)) + 1; - } - return; -} - -// 0040e2b0 -void AnmCache::RemoveRef(std_string *path) -{ - uint8_t ***prefixes; - std_string *pathText; - void *entry; - uint8_t **prefixCursor; - uint8_t local_12c [8]; - void *lowerBound; - std_string *savedPath; - uint32_t pathHash; - uint8_t fullPath [260]; - uint32_t local_14; - int refCount; - - entry = g_anmCacheMap; - local_14 = __security_cookie ^ GHIDRA_UINT((fullPath + 0x108)); - savedPath = path; - if ((GHIDRA_INT(g_mountPrefixesEnd) - GHIDRA_INT(g_mountPrefixes) & 0xfffffffcU) == 0) { - prefixes = FileSystem::GetMountPrefixes(local_12c); - if (prefixes != &g_mountPrefixes) { - FID_conflict__Tidy(&g_mountPrefixes); - g_mountPrefixes = *prefixes; - g_mountPrefixesEnd = prefixes[1]; - _DAT_00c798c0 = prefixes[2]; - *prefixes = GHIDRA_CAST(0x0); - prefixes[1] = GHIDRA_CAST(0x0); - prefixes[2] = GHIDRA_CAST(0x0); - } - FID_conflict__Tidy(local_12c); - } - prefixCursor = g_mountPrefixes; - if (g_mountPrefixes != g_mountPrefixesEnd) { - do { - strncpy_s(GHIDRA_CAST(fullPath),0x100,GHIDRA_CAST(*prefixCursor),0x100); - pathText = savedPath; - if (0xf < savedPath->_capacity) { - pathText = *GHIDRA_CAST(savedPath->_buf); - } - strcat_s(GHIDRA_CAST(fullPath),0x100,pathText->_buf); - pathHash = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(fullPath); - AnmCache::lower_bound_find(local_12c,&pathHash); - if ((*GHIDRA_CAST((GHIDRA_CAST(lowerBound) + 0xd)) != '\0') || - (entry = lowerBound, pathHash < *GHIDRA_CAST((GHIDRA_CAST(lowerBound) + 0x10)))) { - entry = g_anmCacheMap; - } - if (entry != g_anmCacheMap) goto LAB_0040e40e; - prefixCursor = prefixCursor + 1; - } while (prefixCursor != g_mountPrefixesEnd); - } - if (entry == g_anmCacheMap) { - KAGE_LogMessage(1,GHIDRA_CAST("[warn] AnmCache: cannot remove reference to %s\n")); - } - else { -LAB_0040e40e: - refCount = *GHIDRA_CAST((GHIDRA_CAST(entry) + 0x50)); - if (refCount == 0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("cannot remove reference at RefCount 0\n")); - refCount = *GHIDRA_CAST((GHIDRA_CAST(entry) + 0x50)); - if (refCount == 0) { - return; - } - } - *GHIDRA_CAST((GHIDRA_CAST(entry) + 0x50)) = refCount + -1; - } - return; -} - -// 0040e470 -void AnmCache::Clear() -{ - void *node; - void *pvVar1; - void *it; - - it = *(void **)g_anmCacheMap; - pvVar1 = g_anmCacheMap; - if (it != g_anmCacheMap) { - do { - node = it; - if (*GHIDRA_CAST((GHIDRA_CAST(it) + 0x50)) == 0) { - KAGE_LogMessage(1,GHIDRA_CAST("AnmCache: Clear %u.\n")); - (GHIDRA_CAST(((void *)(GHIDRA_INT(node) + 0x14))))->AnmFileData::Clear(); - it = node; - msvc:: - _Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - ::operator++((_Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - *)&it); - pvVar1 = std_tree_extract(&g_anmCacheMap,node); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar1) + 0x38)))))->msvc::string::_Tidy_deallocate(); - operator_delete(pvVar1,0x54); - pvVar1 = g_anmCacheMap; - } - else { - msvc:: - _Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - ::operator++((_Tree_unchecked_const_iterator_>,msvc::_Iterator_base0> - *)&it); - } - } while (it != pvVar1); - } - return; -} - -// 0040ea50 -void AnmCache::Preload(uint8_t *path) -{ - uint8_t isCached; - uint8_t ***mountPrefixes; - uint8_t *pbVar1; - uint8_t *puVar2; - uint8_t **prefix; - void *pvVar3; - void *imageRefCount; - uint8_t auStack_15a [2]; - uint32_t spritesheetIndex; - int spritesheetOffset; - uint32_t pathHash; - std_string pathLocal; - uint8_t fullPath [260]; - uint32_t local_24; - uint8_t *puStack_20; - void *local_1c; - uint8_t *puStack_18; - uint32_t local_14; - - puVar2 = g_anmCacheMap; - puStack_20 = fullPath + 0x124; - local_14 = 0xffffffff; - puStack_18 = &LAB_00af0ee0; - local_1c = ExceptionList; - local_24 = __security_cookie ^ GHIDRA_UINT((fullPath + 0x118)); - ExceptionList = &local_1c; - if (*path != 0) { - pathHash = 0; - pbVar1 = fullPath + 0x124; - if (GHIDRA_UINT((GHIDRA_INT(g_mountPrefixesEnd) - GHIDRA_INT(g_mountPrefixes))) < 4) { - mountPrefixes = FileSystem::GetMountPrefixes(GHIDRA_CAST((GHIDRA_INT(&pathLocal) + 0xc))); - if (mountPrefixes != &g_mountPrefixes) { - FID_conflict__Tidy(&g_mountPrefixes); - g_mountPrefixes = *mountPrefixes; - g_mountPrefixesEnd = mountPrefixes[1]; - _DAT_00c798c0 = mountPrefixes[2]; - *mountPrefixes = GHIDRA_CAST(0x0); - mountPrefixes[1] = GHIDRA_CAST(0x0); - mountPrefixes[2] = GHIDRA_CAST(0x0); - } - FID_conflict__Tidy(GHIDRA_CAST((GHIDRA_INT(&pathLocal) + 0xc))); - pbVar1 = puStack_20; - } - puStack_20 = pbVar1; - prefix = g_mountPrefixes; - if (g_mountPrefixes != g_mountPrefixesEnd) { - do { - strncpy_s(GHIDRA_CAST(fullPath),0x100,GHIDRA_CAST(*prefix),0x100); - strcat_s(GHIDRA_CAST(fullPath),0x100,GHIDRA_CAST(path)); - pathHash = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(fullPath); - AnmCache::lower_bound_find(); - if ((*GHIDRA_CAST((pathLocal._capacity + 0xd)) != '\0') || - (puVar2 = GHIDRA_CAST(pathLocal._capacity), - pathHash < *GHIDRA_CAST((pathLocal._capacity + 0x10)))) { - puVar2 = g_anmCacheMap; - } - if (puVar2 != g_anmCacheMap) goto LAB_0040ecbd; - prefix = prefix + 1; - } while (prefix != g_mountPrefixesEnd); - } - if (puVar2 == g_anmCacheMap) { - pathLocal._size = 0; - pathLocal._capacity = GHIDRA_UINT(&DAT_0000000f); - (*GHIDRA_CAST((GHIDRA_CAST(&(pathLocal._buf)) + 0x0))) = (void *)0x0; - pbVar1 = path; - do { - isCached = *pbVar1; - pbVar1 = pbVar1 + 1; - } while (isCached != 0); - (GHIDRA_CAST((pathLocal._buf)))->msvc::string::assign(path,GHIDRA_INT(pbVar1) - GHIDRA_INT((path + 1))); - local_14 = 0; - ParseFile(&pathLocal,pathHash); - local_14 = 0xffffffff; - if (&DAT_0000000f < pathLocal._capacity) { - puVar2 = GHIDRA_CAST((pathLocal._capacity + 1)); - pvVar3 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)pathLocal._buf)) + 0x0))); - if (GHIDRA_CAST(0xfff) < puVar2) { - pvVar3 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(pathLocal._buf)) + 0x0))) + -4); - puVar2 = GHIDRA_CAST((pathLocal._capacity + 0x24)); - if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST((GHIDRA_CAST(&(pathLocal._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar3))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pvVar3,GHIDRA_UINT(puVar2)); - } - AnmCache::lower_bound_find(); - if ((*GHIDRA_CAST((pathLocal._capacity + 0xd)) != '\0') || - (puVar2 = GHIDRA_CAST(pathLocal._capacity), - pathHash < *GHIDRA_CAST((pathLocal._capacity + 0x10)))) { - puVar2 = g_anmCacheMap; - } - if (puVar2 == g_anmCacheMap) { - ExceptionList = local_1c; - return; - } - } -LAB_0040ecbd: - spritesheetIndex = 0; - if (*GHIDRA_CAST((puVar2 + 0x1c)) != 0) { - spritesheetOffset = 0; - do { - pbVar1 = GHIDRA_CAST((spritesheetOffset + 0x20 + *GHIDRA_CAST((puVar2 + 0x18)))); - if (0xf < *GHIDRA_CAST((pbVar1 + 0x14))) { - pbVar1 = *GHIDRA_CAST(pbVar1); - } - pvVar3 = (void *)0x40ece9; - isCached = TextureCache::Has(pbVar1); - if (isCached == 0) { - imageRefCount = (void *)0x40ecf8; - (GHIDRA_CAST((g_game)))->Game::IsPaused(); - Manager::LoadImage(auStack_15a + -10,pbVar1); - TextureCache::Add(pvVar3,imageRefCount); - } - spritesheetIndex = spritesheetIndex + 1; - spritesheetOffset = spritesheetOffset + 0x38; - } while (spritesheetIndex < *GHIDRA_CAST((puVar2 + 0x1c))); - } - } - ExceptionList = local_1c; - return; -} - -// 0040ed50 -void AnmCache::ParseFile(std_string *path, uint32_t pathHash) -{ - uint64_t uVar1; - float rootScaleY; - float rootPosY; - float fVar4; - float fVar5; - float fVar6; - float fVar7; - uint8_t parsedBool; - uint8_t bVar8; - int *piVar9; - uint8_t *puVar10; - int iVar11; - void *pvVar12; - uint8_t *pbVar13; - uint32_t uVar14; - std_string *text; - uint32_t *srcChars; - uint32_t *puVar15; - char *keyName; - std_string *psVar16; - uint8_t *pbVar17; - uint8_t *pbVar18; - float *pfVar19; - int iVar20; - int extraout_EDX; - int extraout_EDX_00; - int extraout_EDX_01; - int extraout_EDX_02; - int extraout_EDX_03; - int extraout_EDX_04; - float *pfVar21; - float *extraout_EDX_05; - int extraout_EDX_06; - int extraout_EDX_07; - float *extraout_EDX_08; - int extraout_EDX_09; - int extraout_EDX_10; - char *pcVar22; - float fVar23; - uint32_t *srcLayer; - float *pfVar24; - float *pfVar25; - float *pfVar26; - bool isLess; - double dVar27; - code *pcVar28; - float tmpAnimation; - float fStack_26804; - float fStack_26800; - float fStack_267fc; - uint64_t uStack_267f8; - float fStack_267f0; - float fStack_267ec; - float fStack_267e8; - float fStack_267e4; - float fStack_267e0; - float fStack_267dc; - float fStack_267d8; - uint8_t uStack_267d4; - float afStack_267d0 [64]; - float fStack_266d0; - uint32_t *puStack_266c4; - float *pfStack_266c0; - uint8_t *fileBuffer; - float *animIndex; - std_string *curAnimation; - uint8_t *anmFile; - void *pvStack_266ac; - void *rootFrames; - float *pfStack_266a4; - float *pfStack_266a0; - float *pfStack_2669c; - uint8_t isLoop; - std_string *filePath; - uint32_t uStack_26690; - float *pfStack_2668c; - float *pfStack_26688; - float *pfStack_26684; - float *pfStack_26680; - float *pfStack_2667c; - float *pfStack_26678; - float *pfStack_26674; - float *pfStack_26670; - float *pfStack_2666c; - float *pfStack_26668; - float *pfStack_26664; - float *pfStack_26660; - float *pfStack_2665c; - float *pfStack_26658; - float *pfStack_26654; - float *pfStack_26650; - float *pfStack_2664c; - uint8_t xmlDocument [48]; - uint8_t auStack_26618 [65560]; - std_string redirectedPath; - std_string animName; - std_string nullFrameInterpolatedText; - std_string nullFrameVisibleText; - std_string layerName; - std_string nullName; - std_string eventName; - std_string layerFrameInterpolatedText; - std_string rootVisibleText; - std_string nullAnimVisibleText; - std_string layerFrameVisibleText; - std_string layerAnimVisibleText; - std_string rootInterpolatedText; - std_string loopText; - uint8_t animations [28]; - float afStack_16494 [6]; - uint8_t auStack_1647c [212]; - float afStack_163a8 [12]; - uint32_t auStack_16378 [20146]; - float local_28b0 [256]; - uint32_t local_24b0 [2]; - std_string local_24a8; - uint8_t local_2490 [3552]; - uint8_t spritesheetPaths [16]; - uint32_t auStack_16a0 [380]; - std_string nullNames [64]; - float layerAnimations [3]; - uint8_t auStack_aa4 [1012]; - float nullAnimations; - float local_6ac [255]; - std_string eventNames [16]; - uint8_t resolvedPath [268]; - uint32_t stackCookie; - uint8_t *puStack_20; - void *local_1c; - uint8_t *puStack_18; - uint32_t local_14; - Color *frameColor; - float rootPosY; - float rootScaleY; - uint32_t textCapacity; - - puStack_20 = resolvedPath + 300; - local_14 = 0xffffffff; - puStack_18 = &LAB_00af118f; - local_1c = ExceptionList; - stackCookie = __security_cookie ^ GHIDRA_UINT((resolvedPath + 0x120)); - ExceptionList = &local_1c; - filePath = path; - (GHIDRA_CAST((GHIDRA_CAST(&g_manager->_modManager))))->ModManager::TryRedirectPath(&redirectedPath,path); - local_14 = 0; - psVar16 = &redirectedPath; - if (0xf < redirectedPath._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(redirectedPath._buf))) + 0x0))); - } - piVar9 = (GHIDRA_CAST((&PTR_vftable_00c37a10)))->FileSystem::Open(GHIDRA_CAST(psVar16),GHIDRA_CAST(0x0)); - if (piVar9 == GHIDRA_CAST(0x0)) { - KAGE_LogMessage(1,GHIDRA_CAST("ERROR Could not open %s\n")); - goto LAB_00413b0f; - } - if (pathHash == 0) { - if (0xf < path->_capacity) { - path = *GHIDRA_CAST(path->_buf); - } - pathHash = KAGE_Filesys_FileManager::GetPrimaryFilePathHash(GHIDRA_CAST(path)); - } - puVar10 = GHIDRA_CAST(AnmCache)::entry_get(&pathHash); - anmFile = puVar10; - (GHIDRA_CAST((puVar10)))->AnmFileData::Clear(); - *puVar10 = 0; - iVar11 = (**(code **)(*piVar9 + 4))(); - fileBuffer = operator_new_tracked(iVar11 + 1); - (**(code **)(*piVar9 + 0x14))(fileBuffer,1,iVar11); - fileBuffer[iVar11] = 0; - (**(code **)*piVar9)(1); - FUN_00413b90(); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; - iVar11 = 0x40ee8f; - pbVar18 = fileBuffer; - (GHIDRA_CAST((xmlDocument)))->rapidxml::xml_document::parse(fileBuffer); - bVar8 = (uint8_t)pbVar18; - pfStack_2664c = (GHIDRA_CAST((xmlDocument)))->xml_node::first_node(GHIDRA_CAST("AnimatedActor"),iVar11,bVar8); - pvStack_266ac = (GHIDRA_CAST((pfStack_2664c)))->xml_node::first_node(GHIDRA_CAST("Content"),iVar11,bVar8); - pvVar12 = (GHIDRA_CAST((pvStack_266ac)))->xml_node::first_node(GHIDRA_CAST("Spritesheets"),iVar11,bVar8); - _eh_vector_constructor_iterator_ - (spritesheetPaths,0x18,0x40,FUN_0040c380,msvc::string::_Tidy_deallocate); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; - pfStack_26678 = *GHIDRA_CAST((GHIDRA_CAST(pvVar12) + 0x18)); - pfStack_266a4 = GHIDRA_CAST(0x0); - while (pfStack_26678 != GHIDRA_CAST(0x0)) { - puVar15 = *GHIDRA_CAST((GHIDRA_CAST(pfStack_26678) + 0x20)); - pfStack_2669c = GHIDRA_CAST(0x40); - if (puVar15 == GHIDRA_CAST(0x0)) { -LAB_0040efb3: - pfVar26 = pfStack_266a4; - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: invalid spritesheet id %d\n")); - } - else { - do { - pbVar18 = GHIDRA_CAST(*puVar15); - pbVar17 = &DAT_00b1b31c; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040ef57: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040ef5c; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040ef57; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040ef5c: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - psVar16 = filePath; - if (0xf < filePath->_capacity) { - psVar16 = *GHIDRA_CAST(filePath->_buf); - } - ResolveRelativePath(GHIDRA_CAST(psVar16),pbVar18,resolvedPath); - } - else { - pbVar17 = &DAT_00b1b324; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040f120: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f125; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040f120; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f125: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pfStack_2669c = GHIDRA_CAST(atoi(GHIDRA_CAST(pbVar18))); - } - } - } while ((puVar15[4] != 0) && - (puVar15 = GHIDRA_CAST(puVar15[6]), puVar15 != GHIDRA_CAST(0x0))); - if ((0x3f < GHIDRA_INT(pfStack_2669c)) || (pfVar26 = pfStack_266a4, pfStack_2669c != pfStack_266a4)) - goto LAB_0040efb3; - } - pbVar18 = resolvedPath; - do { - bVar8 = *pbVar18; - pbVar18 = pbVar18 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((GHIDRA_CAST((spritesheetPaths + GHIDRA_INT(pfStack_2669c) * 0x18)))))->msvc::string::assign(resolvedPath, - GHIDRA_INT(pbVar18) - GHIDRA_INT((resolvedPath + 1))); - pfStack_266a4 = GHIDRA_CAST((GHIDRA_INT(pfVar26) + 1)); - pfStack_26678 = *GHIDRA_CAST((GHIDRA_CAST(pfStack_26678) + 0x2c)); - } - bVar8 = 0x70; - puVar10 = &LAB_0040d140; - _eh_vector_constructor_iterator_ - (local_24b0,0x38,0x40,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040d140),LayerData::~LayerData); - pfVar26 = GHIDRA_CAST(0x0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; - pfStack_2668c = GHIDRA_CAST(0x0); - pvVar12 = (GHIDRA_CAST((pvStack_266ac)))->xml_node::first_node(GHIDRA_CAST("Layers"),GHIDRA_INT(puVar10),bVar8); - pfStack_26678 = *GHIDRA_CAST((GHIDRA_CAST(pvVar12) + 0x18)); - if (pfStack_26678 == GHIDRA_CAST(0x0)) { -LAB_0040f3b5: - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: no layers\n")); - } - else { - do { - pfStack_2669c = GHIDRA_CAST(0x40); - layerName._size = 0; - layerName._capacity = 0xf; - layerName._buf[0] = '\0'; - layerName._buf[1] = '\0'; - layerName._buf[2] = '\0'; - layerName._buf[3] = '\0'; - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),4); - puVar15 = GHIDRA_CAST(pfStack_26678[8]); - pfStack_26680 = GHIDRA_CAST(0xffffffff); - if (puVar15 == GHIDRA_CAST(0x0)) { -LAB_0040f26a: - pfVar26 = pfStack_2669c; - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: invalid layer id %d\n")); - } - else { - do { - pbVar18 = GHIDRA_CAST(*puVar15); - pbVar17 = &DAT_00b1b350; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040f151: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f156; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040f151; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f156: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((layerName._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - } - else { - pbVar17 = &DAT_00b1b324; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040f1c0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f1c5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040f1c0; - pbVar17 = pbVar17 + 2; - pbVar13 = pbVar13 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f1c5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pfStack_2669c = GHIDRA_CAST(atoi(GHIDRA_CAST(pbVar18))); - } - else { - keyName = "SpritesheetId"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_0040f220: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f225; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_0040f220; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f225: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pfStack_26680 = GHIDRA_CAST(atoi(GHIDRA_CAST(pbVar18))); - } - } - } - } while ((puVar15[4] != 0) && - (puVar15 = GHIDRA_CAST(puVar15[6]), puVar15 != GHIDRA_CAST(0x0))); - if ((0x3f < GHIDRA_INT(pfStack_2669c)) || (pfVar26 = pfStack_2669c, pfStack_2669c != pfStack_2668c) - ) goto LAB_0040f26a; - } - pfVar19 = pfStack_26680; - if ((GHIDRA_INT(pfStack_26680) < 0) || (GHIDRA_INT(pfStack_266a4) <= GHIDRA_INT(pfStack_26680))) { - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: invalid spritesheet id %d\n")); - } - pbVar18 = spritesheetPaths + GHIDRA_INT(pfVar19) * 0x18; - if (local_2490 + GHIDRA_INT(pfVar26) * 0x38 != pbVar18) { - if (0xf < auStack_16a0[GHIDRA_INT(pfVar19) * 6 + 1]) { - pbVar18 = *GHIDRA_CAST(pbVar18); - } - (GHIDRA_CAST((GHIDRA_CAST((local_2490 + GHIDRA_INT(pfVar26) * 0x38)))))->msvc::string::assign(pbVar18, - auStack_16a0[GHIDRA_INT(pfVar19) * 6]); - } - local_24b0[GHIDRA_INT(pfVar26) * 0xe] = pfVar26; - psVar16 = GHIDRA_CAST((GHIDRA_INT(&local_24a8) + GHIDRA_INT(pfVar26) * 0x38)); - local_24b0[GHIDRA_INT(pfVar26) * 0xe + 1] = pfStack_26680; - if (psVar16 != &layerName) { - text = &layerName; - if (0xf < layerName._capacity) { - text = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerName._buf))) + 0x0))); - } - (GHIDRA_CAST((GHIDRA_CAST(psVar16))))->msvc::string::assign(GHIDRA_CAST(text),layerName._size); - } - pfVar26 = GHIDRA_CAST((GHIDRA_INT(pfStack_2668c) + 1)); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; - pfStack_2668c = pfVar26; - if (0xf < layerName._capacity) { - uVar14 = layerName._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)layerName._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(layerName._buf)) + 0x0))) + -4); - uVar14 = layerName._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(layerName._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - layerName._size = 0; - layerName._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(layerName._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(layerName._buf)) + 0x0))) & 0xffffff00; - pfStack_26678 = GHIDRA_CAST(pfStack_26678[0xb]); - } while (pfStack_26678 != GHIDRA_CAST(0x0)); - if (pfVar26 == GHIDRA_CAST(0x0)) goto LAB_0040f3b5; - } - pfStack_26678 = GHIDRA_CAST(0x0); - uVar14 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfVar26) * 0x38 >> 0x20)) != 0)) | GHIDRA_UINT((ZEXT48(pfVar26) * 0x38)); - pfStack_26654 = pfVar26; - pfStack_26678 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar14)) | uVar14 + 4); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 5; - if (pfStack_26678 == GHIDRA_CAST(0x0)) { - pfVar19 = GHIDRA_CAST(0x0); - pfStack_26680 = GHIDRA_CAST(0x0); - } - else { - pfVar19 = pfStack_26678 + 1; - *pfStack_26678 = (float)pfVar26; - pfStack_26680 = pfVar19; - _eh_vector_constructor_iterator_ - (pfVar19,0x38,GHIDRA_UINT(pfVar26),GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040d140),LayerData::~LayerData); - } - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; - pfVar25 = GHIDRA_CAST(0x0); - if (pfVar26 != GHIDRA_CAST(0x0)) { - pfVar19 = pfVar19 + 8; - srcLayer = &local_24a8._capacity; - pfStack_26678 = pfStack_2668c; - pfVar26 = GHIDRA_CAST((GHIDRA_INT(pfStack_26680) - GHIDRA_INT(srcLayer))); - pfStack_26654 = pfVar26; - do { - *GHIDRA_CAST((GHIDRA_CAST(pfVar26) + GHIDRA_INT(srcLayer))) = srcLayer[-7]; - if (pfVar19 != GHIDRA_CAST((srcLayer + 1))) { - psVar16 = GHIDRA_CAST((srcLayer + -5)); - if (0xf < *srcLayer) { - psVar16 = *GHIDRA_CAST(psVar16->_buf); - } - (GHIDRA_CAST((GHIDRA_CAST((pfVar19 + -6)))))->msvc::string::assign(GHIDRA_CAST(psVar16),srcLayer[-1]); - srcChars = srcLayer + 1; - if (0xf < srcLayer[6]) { - srcChars = GHIDRA_CAST(*srcChars); - } - (GHIDRA_CAST((GHIDRA_CAST(pfVar19))))->msvc::string::assign(GHIDRA_CAST(srcChars),srcLayer[5]); - pfVar26 = pfStack_26654; - } - pfVar25 = GHIDRA_CAST((srcLayer + -6)); - srcLayer = srcLayer + 0xe; - pfVar19[-7] = *pfVar25; - pfVar19 = pfVar19 + 0xe; - pfStack_26678 = GHIDRA_CAST((GHIDRA_INT(pfStack_26678) + -1)); - } while (pfStack_26678 != GHIDRA_CAST(0x0)); - pfVar25 = pfStack_2668c; - } - bVar8 = 0x20; - pcVar28 = FUN_0040c380; - *GHIDRA_CAST((anmFile + 4)) = pfStack_26680; - *GHIDRA_CAST((anmFile + 8)) = pfVar25; - _eh_vector_constructor_iterator_(nullNames,0x18,0x40,FUN_0040c380,msvc::string::_Tidy_deallocate); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - pfStack_26684 = GHIDRA_CAST(0x0); - pvVar12 = (GHIDRA_CAST((pvStack_266ac)))->xml_node::first_node(GHIDRA_CAST("Nulls"),GHIDRA_INT(pcVar28),bVar8); - pfStack_26678 = *GHIDRA_CAST((GHIDRA_CAST(pvVar12) + 0x18)); - pfVar26 = GHIDRA_CAST(0x0); - pfVar19 = pfStack_26678; - if (pfStack_26678 != GHIDRA_CAST(0x0)) { - do { - pfStack_26680 = GHIDRA_CAST(0x40); - nullName._size = 0; - nullName._capacity = 0xf; - nullName._buf[0] = '\0'; - nullName._buf[1] = '\0'; - nullName._buf[2] = '\0'; - nullName._buf[3] = '\0'; - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),7); - puVar15 = GHIDRA_CAST(pfStack_26678[8]); - if (puVar15 == GHIDRA_CAST(0x0)) { -LAB_0040f664: - pfVar19 = pfStack_26680; - pfVar26 = pfStack_26684; - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: invalid Null ID %d\n")); - } - else { - do { - pbVar18 = GHIDRA_CAST(*puVar15); - pbVar17 = &DAT_00b1b324; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040f5a1: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f5a6; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040f5a1; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f5a6: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pfStack_26680 = GHIDRA_CAST(atoi(GHIDRA_CAST(pbVar18))); - } - else { - pbVar17 = &DAT_00b1b350; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040f600: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f605; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040f600; - pbVar17 = pbVar17 + 2; - pbVar13 = pbVar13 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f605: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((nullName._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - } - } - } while ((puVar15[4] != 0) && - (puVar15 = GHIDRA_CAST(puVar15[6]), puVar15 != GHIDRA_CAST(0x0))); - if (0x3f < GHIDRA_INT(pfStack_26680)) goto LAB_0040f664; - pfVar26 = pfStack_26684; - pfVar19 = pfStack_26680; - if (pfStack_26680 != pfStack_26684) goto LAB_0040f664; - } - if (nullNames + GHIDRA_INT(pfVar19) != &nullName) { - psVar16 = &nullName; - if (0xf < nullName._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(nullName._buf))) + 0x0))); - } - (GHIDRA_CAST((nullNames[GHIDRA_INT(pfVar19)]._buf)))->msvc::string::assign(GHIDRA_CAST(psVar16),nullName._size); - } - pfVar26 = GHIDRA_CAST((GHIDRA_INT(pfVar26) + 1)); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - pfStack_26684 = pfVar26; - if (0xf < nullName._capacity) { - uVar14 = nullName._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)nullName._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(nullName._buf)) + 0x0))) + -4); - uVar14 = nullName._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(nullName._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - nullName._size = 0; - nullName._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(nullName._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(nullName._buf)) + 0x0))) & 0xffffff00; - pfStack_26678 = GHIDRA_CAST(pfStack_26678[0xb]); - } while (pfStack_26678 != GHIDRA_CAST(0x0)); - pfVar19 = GHIDRA_CAST(0x0); - if (pfVar26 != GHIDRA_CAST(0x0)) { - uVar14 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfVar26) * 0x18 >> 0x20)) != 0)) | GHIDRA_UINT((ZEXT48(pfVar26) * 0x18)); - puVar15 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar14)) | uVar14 + 4); - if (puVar15 == GHIDRA_CAST(0x0)) { - pfStack_26680 = GHIDRA_CAST(0x0); - } - else { - *puVar15 = pfVar26; - pfStack_26680 = GHIDRA_CAST((puVar15 + 1)); - _eh_vector_constructor_iterator_ - (pfStack_26680,0x18,GHIDRA_UINT(pfVar26),FUN_0040c380,msvc::string::_Tidy_deallocate); - } - pfStack_26678 = pfStack_26684; - iVar11 = -GHIDRA_INT(pfStack_26680); - pfVar26 = GHIDRA_CAST((GHIDRA_INT(nullNames) - GHIDRA_INT(pfStack_26680))); - pfStack_26654 = pfVar26; - pfVar19 = pfStack_26680; - do { - pfVar25 = GHIDRA_CAST((GHIDRA_INT(pfVar26) + GHIDRA_INT(pfVar19))); - if (pfVar19 != pfVar25) { - if (0xf < *GHIDRA_CAST((GHIDRA_CAST(nullNames) + iVar11 + 0x14 + GHIDRA_INT(pfVar19)))) { - pfVar25 = GHIDRA_CAST(*pfVar25); - } - (GHIDRA_CAST((GHIDRA_CAST(pfVar19))))->msvc::string::assign(GHIDRA_CAST(pfVar25), - *GHIDRA_CAST((GHIDRA_CAST(nullNames) + iVar11 + 0x10 + GHIDRA_INT(pfVar19)))); - pfVar26 = pfStack_26654; - } - pfVar19 = pfVar19 + 6; - pfStack_26678 = GHIDRA_CAST((GHIDRA_INT(pfStack_26678) + -1)); - } while (pfStack_26678 != GHIDRA_CAST(0x0)); - *GHIDRA_CAST((anmFile + 0x14)) = pfStack_26680; - pfVar26 = pfStack_26684; - pfVar19 = pfStack_26678; - } - } - pfStack_26678 = pfVar19; - bVar8 = 0x20; - pcVar28 = FUN_0040c380; - *GHIDRA_CAST((anmFile + 0x18)) = pfVar26; - _eh_vector_constructor_iterator_(eventNames,0x18,0x10,FUN_0040c380,msvc::string::_Tidy_deallocate); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 8; - pfStack_26684 = GHIDRA_CAST(0x0); - pvVar12 = (GHIDRA_CAST((pvStack_266ac)))->xml_node::first_node(GHIDRA_CAST("Events"),GHIDRA_INT(pcVar28),bVar8); - pfStack_26678 = *GHIDRA_CAST((GHIDRA_CAST(pvVar12) + 0x18)); - pfVar26 = GHIDRA_CAST(0x0); - pfVar19 = pfStack_26678; - if (pfStack_26678 != GHIDRA_CAST(0x0)) { - do { - pfStack_26680 = GHIDRA_CAST(0x10); - eventName._size = 0; - eventName._capacity = 0xf; - eventName._buf[0] = '\0'; - eventName._buf[1] = '\0'; - eventName._buf[2] = '\0'; - eventName._buf[3] = '\0'; - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),9); - puVar15 = GHIDRA_CAST(pfStack_26678[8]); - if (puVar15 == GHIDRA_CAST(0x0)) { -LAB_0040f994: - pfVar19 = pfStack_26680; - pfVar26 = pfStack_26684; - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: invalid Event ID %d\n")); - } - else { - do { - pbVar18 = GHIDRA_CAST(*puVar15); - pbVar17 = &DAT_00b1b324; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040f8d1: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f8d6; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040f8d1; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f8d6: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pfStack_26680 = GHIDRA_CAST(atoi(GHIDRA_CAST(pbVar18))); - } - else { - pbVar17 = &DAT_00b1b350; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040f930: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040f935; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040f930; - pbVar17 = pbVar17 + 2; - pbVar13 = pbVar13 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040f935: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((eventName._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - } - } - } while ((puVar15[4] != 0) && - (puVar15 = GHIDRA_CAST(puVar15[6]), puVar15 != GHIDRA_CAST(0x0))); - if (0xf < GHIDRA_INT(pfStack_26680)) goto LAB_0040f994; - pfVar26 = pfStack_26684; - pfVar19 = pfStack_26680; - if (pfStack_26680 != pfStack_26684) goto LAB_0040f994; - } - if (eventNames + GHIDRA_INT(pfVar19) != &eventName) { - psVar16 = &eventName; - if (0xf < eventName._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(eventName._buf))) + 0x0))); - } - (GHIDRA_CAST((eventNames[GHIDRA_INT(pfVar19)]._buf)))->msvc::string::assign(GHIDRA_CAST(psVar16),eventName._size); - } - pfVar26 = GHIDRA_CAST((GHIDRA_INT(pfVar26) + 1)); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 8; - pfStack_26684 = pfVar26; - if (0xf < eventName._capacity) { - uVar14 = eventName._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)eventName._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(eventName._buf)) + 0x0))) + -4); - uVar14 = eventName._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(eventName._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) { -LAB_00413762: - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pvVar12,uVar14); - } - eventName._size = 0; - eventName._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(eventName._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(eventName._buf)) + 0x0))) & 0xffffff00; - pfStack_26678 = GHIDRA_CAST(pfStack_26678[0xb]); - } while (pfStack_26678 != GHIDRA_CAST(0x0)); - pfVar19 = GHIDRA_CAST(0x0); - if (pfVar26 != GHIDRA_CAST(0x0)) { - uVar14 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfVar26) * 0x18 >> 0x20)) != 0)) | GHIDRA_UINT((ZEXT48(pfVar26) * 0x18)); - puVar15 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar14)) | uVar14 + 4); - if (puVar15 == GHIDRA_CAST(0x0)) { - pfStack_26680 = GHIDRA_CAST(0x0); - } - else { - *puVar15 = pfVar26; - pfStack_26680 = GHIDRA_CAST((puVar15 + 1)); - _eh_vector_constructor_iterator_ - (pfStack_26680,0x18,GHIDRA_UINT(pfVar26),FUN_0040c380,msvc::string::_Tidy_deallocate); - } - pfStack_26678 = pfStack_26684; - iVar11 = -GHIDRA_INT(pfStack_26680); - pfVar26 = GHIDRA_CAST((GHIDRA_INT(eventNames) - GHIDRA_INT(pfStack_26680))); - pfStack_26654 = pfVar26; - pfVar19 = pfStack_26680; - do { - pfVar25 = GHIDRA_CAST((GHIDRA_INT(pfVar26) + GHIDRA_INT(pfVar19))); - if (pfVar19 != pfVar25) { - if (0xf < *GHIDRA_CAST((GHIDRA_CAST(eventNames) + iVar11 + 0x14 + GHIDRA_INT(pfVar19)))) { - pfVar25 = GHIDRA_CAST(*pfVar25); - } - (GHIDRA_CAST((GHIDRA_CAST(pfVar19))))->msvc::string::assign(GHIDRA_CAST(pfVar25), - *GHIDRA_CAST((GHIDRA_CAST(eventNames) + iVar11 + 0x10 + GHIDRA_INT(pfVar19)))); - pfVar26 = pfStack_26654; - } - pfVar19 = pfVar19 + 6; - pfStack_26678 = GHIDRA_CAST((GHIDRA_INT(pfStack_26678) + -1)); - } while (pfStack_26678 != GHIDRA_CAST(0x0)); - *GHIDRA_CAST((anmFile + 0x1c)) = pfStack_26680; - pfVar26 = pfStack_26684; - pfVar19 = pfStack_26678; - } - } - pfStack_26678 = pfVar19; - pcVar28 = msvc::string::_Tidy_deallocate; - pbVar18 = &LAB_0040bec0; - *GHIDRA_CAST((anmFile + 0x20)) = pfVar26; - _eh_vector_constructor_iterator_ - (animations,0x13c,0x100,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040bec0), - msvc::string::_Tidy_deallocate); - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10); - animIndex = GHIDRA_CAST(0x0); - pfStack_26678 = - (GHIDRA_CAST((pfStack_2664c)))->xml_node::first_node(GHIDRA_CAST("Animations"),GHIDRA_INT(pbVar18),(uint8_t)pcVar28); - for (puVar15 = (GHIDRA_CAST((pfStack_26678)))->xml_node::first_attribute(GHIDRA_CAST(0x0),GHIDRA_UINT(pbVar18),(uint8_t)pcVar28); - bVar8 = (uint8_t)pcVar28, puVar15 != GHIDRA_CAST(0x0); puVar15 = GHIDRA_CAST(puVar15[6])) { - keyName = "DefaultAnimation"; - pbVar13 = &g_xmlNullStr; - if (GHIDRA_CAST(*puVar15) != GHIDRA_CAST(0x0)) { - pbVar13 = GHIDRA_CAST(*puVar15); - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_0040fbc2: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040fbc7; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_0040fbc2; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040fbc7: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - pcVar28 = (code *)(pbVar13 + -GHIDRA_INT((pbVar18 + 1))); - (GHIDRA_CAST((anmFile + 0x24)))->msvc::string::assign(pbVar18,GHIDRA_UINT(pcVar28)); - } - bVar8 = (uint8_t)pcVar28; - if (puVar15[4] == 0) break; - } - pfStack_26684 = (GHIDRA_CAST((pfStack_26678)))->xml_node::first_node(GHIDRA_CAST("Animation"),GHIDRA_INT(pbVar18),bVar8); - pfStack_26678 = operator_new_tracked(420000); - if (pfStack_26678 == (void *)0x0) { - rootFrames = (void *)0x0; - } - else { - iVar11 = 5000; - puVar15 = GHIDRA_CAST((GHIDRA_INT(pfStack_26678) + 4)); - rootFrames = pfStack_26678; - do { - *puVar15 = 0; - puVar15[-1] = 0; - puVar15[4] = 0; - puVar15[3] = 0; - (GHIDRA_CAST((GHIDRA_CAST((puVar15 + 5)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX + 0x44)) = 0; - puVar15 = GHIDRA_CAST((extraout_EDX + 0x54)); - iVar11 = iVar11 + -1; - } while (iVar11 != 0); - } - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10); - pfStack_26654 = operator_new_tracked(420000); - if (pfStack_26654 == GHIDRA_CAST(0x0)) { - pfStack_26678 = GHIDRA_CAST(0x0); - } - else { - iVar11 = 5000; - pfVar26 = pfStack_26654 + 1; - pfStack_26678 = pfStack_26654; - do { - *pfVar26 = 0.0; - pfVar26[-1] = 0.0; - pfVar26[4] = 0.0; - pfVar26[3] = 0.0; - (GHIDRA_CAST((GHIDRA_CAST((pfVar26 + 5)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX_00 + 0x44)) = 0; - pfVar26 = GHIDRA_CAST((extraout_EDX_00 + 0x54)); - iVar11 = iVar11 + -1; - } while (iVar11 != 0); - } - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10); - pfStack_26654 = operator_new_tracked(420000); - if (pfStack_26654 == (void *)0x0) { - pvStack_266ac = (void *)0x0; - } - else { - iVar11 = 5000; - puVar15 = GHIDRA_CAST((GHIDRA_INT(pfStack_26654) + 4)); - pvStack_266ac = pfStack_26654; - do { - *puVar15 = 0; - puVar15[-1] = 0; - puVar15[4] = 0; - puVar15[3] = 0; - (GHIDRA_CAST((GHIDRA_CAST((puVar15 + 5)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX_01 + 0x44)) = 0; - puVar15 = GHIDRA_CAST((extraout_EDX_01 + 0x54)); - iVar11 = iVar11 + -1; - } while (iVar11 != 0); - } - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10); - pfStack_26654 = operator_new_tracked(420000); - if (pfStack_26654 == GHIDRA_CAST(0x0)) { - pfStack_266a4 = GHIDRA_CAST(0x0); - } - else { - iVar11 = 5000; - pfVar26 = pfStack_26654 + 1; - pfStack_266a4 = pfStack_26654; - do { - *pfVar26 = 0.0; - pfVar26[-1] = 0.0; - pfVar26[4] = 0.0; - pfVar26[3] = 0.0; - (GHIDRA_CAST((GHIDRA_CAST((pfVar26 + 5)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX_02 + 0x44)) = 0; - pfVar26 = GHIDRA_CAST((extraout_EDX_02 + 0x54)); - iVar11 = iVar11 + -1; - } while (iVar11 != 0); - } - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10); - pfStack_26654 = operator_new_tracked(540000); - if (pfStack_26654 == GHIDRA_CAST(0x0)) { - pfStack_26680 = GHIDRA_CAST(0x0); - } - else { - iVar11 = 5000; - pfVar26 = pfStack_26654 + 5; - pfStack_26680 = pfStack_26654; - do { - pfVar26[-4] = 0.0; - pfVar26[-5] = 0.0; - pfVar26[-2] = 0.0; - pfVar26[-3] = 0.0; - *pfVar26 = 0.0; - pfVar26[-1] = 0.0; - pfVar26[2] = 0.0; - pfVar26[1] = 0.0; - pfVar26[4] = 0.0; - pfVar26[3] = 0.0; - (GHIDRA_CAST((GHIDRA_CAST((pfVar26 + 7)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX_03 + 0x4c)) = 0; - pfVar26 = GHIDRA_CAST((extraout_EDX_03 + 0x6c)); - iVar11 = iVar11 + -1; - } while (iVar11 != 0); - } - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10); - pfStack_2669c = operator_new_tracked(540000); - if (pfStack_2669c == GHIDRA_CAST(0x0)) { - pfStack_2669c = GHIDRA_CAST(0x0); - } - else { - iVar11 = 5000; - pfVar26 = pfStack_2669c + 5; - pfStack_26654 = pfStack_2669c; - do { - pfVar26[-4] = 0.0; - pfVar26[-5] = 0.0; - pfVar26[-2] = 0.0; - pfVar26[-3] = 0.0; - *pfVar26 = 0.0; - pfVar26[-1] = 0.0; - pfVar26[2] = 0.0; - pfVar26[1] = 0.0; - pfVar26[4] = 0.0; - pfVar26[3] = 0.0; - (GHIDRA_CAST((GHIDRA_CAST((pfVar26 + 7)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX_04 + 0x4c)) = 0; - pfVar26 = GHIDRA_CAST((extraout_EDX_04 + 0x6c)); - iVar11 = iVar11 + -1; - } while (iVar11 != 0); - } - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 10; - pfVar19 = animIndex; - pfVar26 = pfStack_26684; - while (animIndex = pfVar19, pfVar26 != GHIDRA_CAST(0x0)) { - animName._size = 0; - animName._capacity = 0xf; - animName._buf[0] = '\0'; - animName._buf[1] = '\0'; - animName._buf[2] = '\0'; - animName._buf[3] = '\0'; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x11; - pfVar26 = GHIDRA_CAST(pfVar26[8]); - pfStack_2667c = GHIDRA_CAST(0x0); - isLoop = 0; - for (; pfStack_26654 = pfVar26, pfVar26 != GHIDRA_CAST(0x0); pfVar26 = GHIDRA_CAST(pfVar26[6])) { - pbVar18 = GHIDRA_CAST(*pfVar26); - pbVar17 = &DAT_00b1b350; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_0040ff91: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040ff96; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_0040ff91; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0040ff96: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfVar26[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfVar26[1]); - } - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((animName._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - } - else { - keyName = "FrameNum"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410000: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410005; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410000; - keyName = keyName + 2; - pbVar13 = pbVar13 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410005: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfVar26[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfVar26[1]); - } - pfStack_2667c = GHIDRA_CAST(atoi(GHIDRA_CAST(pbVar18))); - } - else { - pbVar17 = &DAT_00b1b410; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_00410060: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410065; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_00410060; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410065: - if (uVar14 == 0) { - loopText._buf[0] = '\0'; - loopText._buf[1] = '\0'; - loopText._buf[2] = '\0'; - loopText._buf[3] = '\0'; - loopText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfVar26[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfVar26[1]); - } - loopText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((loopText._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - if (loopText._size == 0) { -LAB_0041018f: - isLoop = 0; - } - else { - psVar16 = &loopText; - if (0xf < loopText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(loopText._buf))) + 0x0))); - } - if (loopText._size == 4) { - if ((*GHIDRA_CAST(psVar16->_buf) == 0x65757274) || - ((((bVar8 = (uint8_t)*GHIDRA_CAST(psVar16->_buf), isLess = bVar8 < 0x74, bVar8 == 0x74 && - (isLess = (uint8_t)psVar16->_buf[1] < 0x72, psVar16->_buf[1] == 0x72)) && - (isLess = (uint8_t)psVar16->_buf[2] < 0x75, psVar16->_buf[2] == 0x75)) && - (isLess = (uint8_t)psVar16->_buf[3] < 0x65, psVar16->_buf[3] == 0x65)))) { - uVar14 = 0; - } - else { - uVar14 = -GHIDRA_UINT(isLess) | 1; - } - if (uVar14 != 0) goto LAB_0041011b; - } - else { -LAB_0041011b: - psVar16 = &loopText; - if (0xf < loopText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(loopText._buf))) + 0x0))); - } - if (loopText._size == 4) { - if ((*GHIDRA_CAST(psVar16->_buf) == 0x65757254) || - (((bVar8 = (uint8_t)*GHIDRA_CAST(psVar16->_buf), isLess = bVar8 < 0x54, bVar8 == 0x54 && - (isLess = (uint8_t)psVar16->_buf[1] < 0x72, psVar16->_buf[1] == 0x72)) && - ((isLess = (uint8_t)psVar16->_buf[2] < 0x75, psVar16->_buf[2] == 0x75 && - (isLess = (uint8_t)psVar16->_buf[3] < 0x65, psVar16->_buf[3] == 0x65)))))) { - uVar14 = 0; - } - else { - uVar14 = -GHIDRA_UINT(isLess) | 1; - } - if (uVar14 == 0) goto LAB_00410186; - } - psVar16 = &loopText; - if (0xf < loopText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(loopText._buf))) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_0041018f; - } -LAB_00410186: - isLoop = 1; - } - if (0xf < loopText._capacity) { - uVar14 = loopText._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)loopText._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(loopText._buf)) + 0x0))) + -4); - uVar14 = loopText._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(loopText._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - loopText._size = 0; - loopText._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(loopText._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(loopText._buf)) + 0x0))) & 0xffffff00; - pfVar26 = pfStack_26654; - } - } - } - if (pfVar26[4] == 0.0) break; - } - pfVar19 = pfStack_2667c; - pfVar26 = animIndex; - iVar11 = GHIDRA_INT(animIndex) * 0x13c; - curAnimation = GHIDRA_CAST((animations + iVar11)); - auStack_16378[GHIDRA_INT(animIndex) * 0x4f] = animIndex; - animIndex = GHIDRA_CAST((GHIDRA_INT(animIndex) + 1)); - if (curAnimation != &animName) { - psVar16 = &animName; - if (0xf < animName._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(animName._buf))) + 0x0))); - } - (GHIDRA_CAST((GHIDRA_CAST(curAnimation))))->msvc::string::assign(GHIDRA_CAST(psVar16),animName._size); - } - afStack_16494[GHIDRA_INT(pfVar26) * 0x4f + 5] = (float)pfVar19; - auStack_1647c[iVar11] = isLoop; - keyName = "RootAnimation"; - do { - pcVar22 = keyName; - keyName = pcVar22 + 1; - } while (*keyName != '\0'); - for (puVar15 = GHIDRA_CAST(pfStack_26684[6]); puVar15 != GHIDRA_CAST(0x0); - puVar15 = GHIDRA_CAST(puVar15[0xb])) { - pbVar18 = GHIDRA_CAST(*puVar15); - if (pbVar18 == GHIDRA_CAST(0x0)) { - keyName = GHIDRA_CAST(0x0); - pbVar18 = &g_xmlNullStr; - } - else { - keyName = GHIDRA_CAST(puVar15[2]); - } - if (keyName == pcVar22 + -0xb1b417) { - pbVar13 = pbVar18 + GHIDRA_INT(keyName); - if (pbVar13 <= pbVar18) goto LAB_004102d1; - iVar11 = GHIDRA_INT("RootAnimation") - GHIDRA_INT(pbVar18); - while (*pbVar18 == pbVar18[iVar11]) { - pbVar18 = pbVar18 + 1; - if (pbVar13 <= pbVar18) goto LAB_004102d1; - } - } - } - puVar15 = GHIDRA_CAST(0x0); -LAB_004102d1: - pfVar26 = GHIDRA_CAST(puVar15[6]); - pfStack_2667c = GHIDRA_CAST(0x0); - uStack_26690 = 0; - uVar14 = uStack_26690; - while( true ) { - pfStack_26654 = pfVar26; - uStack_26690 = uVar14; - if (pfVar26 == GHIDRA_CAST(0x0)) break; - if (4999 < uVar14) { - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: too many root frames\n")); - } - pfStack_26688 = GHIDRA_CAST(pfVar26[8]); - uStack_26690 = uVar14 + 1; - pfStack_2665c = GHIDRA_CAST(0x3f800000); - pfStack_26660 = GHIDRA_CAST(0x3f800000); - pfStack_26668 = GHIDRA_CAST(0x3f800000); - pfStack_26650 = GHIDRA_CAST((uVar14 * 0x54 + GHIDRA_INT(rootFrames))); - pfStack_2666c = GHIDRA_CAST(0x3f800000); - pfStack_26670 = GHIDRA_CAST(0x0); - pfStack_26674 = GHIDRA_CAST(0x0); - pfStack_26664 = GHIDRA_CAST(0x0); - if (pfStack_26688 != GHIDRA_CAST(0x0)) { -LAB_004103a0: - pfVar26 = pfStack_26688; - pbVar18 = GHIDRA_CAST(*pfStack_26688); - keyName = "XPosition"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004103d1: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004103d6; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004103d1; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004103d6: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - *pfStack_26650 = (float)dVar27; - } - else { - keyName = "YPosition"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410430: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410435; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410430; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410435: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26650[1] = (float)dVar27; - } - else { - keyName = "Delay"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410490: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410495; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410490; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410495: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - rootScaleY = (float)atoi(GHIDRA_CAST(pbVar18)); - pfStack_26650[2] = rootScaleY; - } - else { - keyName = "Visible"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004104f0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004104f5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004104f0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004104f5: - if (uVar14 == 0) { - rootVisibleText._buf[0] = '\0'; - rootVisibleText._buf[1] = '\0'; - rootVisibleText._buf[2] = '\0'; - rootVisibleText._buf[3] = '\0'; - rootVisibleText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - rootVisibleText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((rootVisibleText._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - textCapacity = rootVisibleText._capacity; - uVar14 = rootVisibleText._size; - if (rootVisibleText._size == 0) { -LAB_004105ca: - parsedBool = 0; - } - else { - psVar16 = &rootVisibleText; - if (0xf < rootVisibleText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(rootVisibleText._buf))) + 0x0))); - } - if ((rootVisibleText._size != 4) || - (iVar11 = memcmp_eq(psVar16,&DAT_00b64fe8,4), iVar11 != 0)) { - psVar16 = &rootVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(rootVisibleText._buf))) + 0x0))); - } - if ((uVar14 != 4) || (iVar11 = memcmp_eq(psVar16,&DAT_00b64ff0,4), iVar11 != 0)) - { - psVar16 = &rootVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(rootVisibleText._buf))) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_004105ca; - } - } - parsedBool = 1; - } - *GHIDRA_CAST((pfStack_26650 + 3)) = parsedBool; - if (0xf < rootVisibleText._capacity) { - uVar14 = rootVisibleText._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)rootVisibleText._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(rootVisibleText._buf)) + 0x0))) + -4); - uVar14 = rootVisibleText._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(rootVisibleText._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - rootVisibleText._size = 0; - rootVisibleText._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(rootVisibleText._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(rootVisibleText._buf)) + 0x0))) & 0xffffff00; - } - else { - keyName = "XScale"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410660: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410665; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410660; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410665: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2664c = GHIDRA_CAST((float)dVar27); - pfStack_26650[4] = (float)pfStack_2664c / 100.0; - goto LAB_00410d5e; - } - keyName = "YScale"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004106d0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004106d5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004106d0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004106d5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2664c = GHIDRA_CAST((float)dVar27); - pfStack_26650[5] = (float)pfStack_2664c / 100.0; - goto LAB_00410d5e; - } - keyName = "RedTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410740: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410745; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410740; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410745: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2665c = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_2665c; - goto LAB_00410d5e; - } - keyName = "GreenTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004107c2: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004107c7; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004107c2; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004107c7: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26660 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26660; - goto LAB_00410d5e; - } - keyName = "BlueTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410850: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410855; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410850; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410855: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26668 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26668; - goto LAB_00410d5e; - } - keyName = "AlphaTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004108e2: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004108e7; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004108e2; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004108e7: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2666c = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_2666c; - goto LAB_00410d5e; - } - keyName = "RedOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410980: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410985; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410980; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410985: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26670 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26670; - goto LAB_00410d5e; - } - keyName = "GreenOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410a22: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410a27; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410a22; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410a27: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26674 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26674; - goto LAB_00410d5e; - } - keyName = "BlueOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410ad0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410ad5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410ad0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410ad5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26664; - goto LAB_00410d5e; - } - keyName = "Rotation"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410b82: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410b87; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410b82; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410b87: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26650[0x11] = (float)dVar27; - goto LAB_00410d5e; - } - keyName = "Interpolated"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410be0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410be5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410be0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410be5: - if (uVar14 == 0) { - rootInterpolatedText._buf[0] = '\0'; - rootInterpolatedText._buf[1] = '\0'; - rootInterpolatedText._buf[2] = '\0'; - rootInterpolatedText._buf[3] = '\0'; - rootInterpolatedText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26688[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26688[1]); - } - rootInterpolatedText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((rootInterpolatedText._buf)))->msvc::string::assign(pbVar18, - GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - textCapacity = rootInterpolatedText._capacity; - uVar14 = rootInterpolatedText._size; - if (rootInterpolatedText._size == 0) { -LAB_00410cba: - parsedBool = 0; - } - else { - psVar16 = &rootInterpolatedText; - if (0xf < rootInterpolatedText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(rootInterpolatedText._buf))) + 0x0))); - } - if ((rootInterpolatedText._size != 4) || - (iVar11 = memcmp_eq(psVar16,&DAT_00b64fe8,4), iVar11 != 0)) { - psVar16 = &rootInterpolatedText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(rootInterpolatedText._buf))) + 0x0))); - } - if ((uVar14 != 4) || - (iVar11 = memcmp_eq(psVar16,&DAT_00b64ff0,4), iVar11 != 0)) { - psVar16 = &rootInterpolatedText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(rootInterpolatedText._buf))) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_00410cba; - } - } - parsedBool = 1; - } - *GHIDRA_CAST((pfStack_26650 + 0x12)) = parsedBool; - if (0xf < rootInterpolatedText._capacity) { - uVar14 = rootInterpolatedText._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)rootInterpolatedText._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(rootInterpolatedText._buf)) + 0x0))) + -4); - uVar14 = rootInterpolatedText._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(rootInterpolatedText._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) - goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - rootInterpolatedText._size = 0; - rootInterpolatedText._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(rootInterpolatedText._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(rootInterpolatedText._buf)) + 0x0))) & 0xffffff00; - } - } - pfVar26 = pfStack_26688; - } - } - } -LAB_00410d5e: - if ((pfVar26[4] == 0.0) || - (pfStack_26688 = GHIDRA_CAST(pfVar26[6]), pfStack_26688 == GHIDRA_CAST(0x0))) goto LAB_00410d81; - goto LAB_004103a0; - } -LAB_00410d81: - pfStack_26650[6] = (float)pfStack_2665c; - pfStack_26650[7] = (float)pfStack_26660; - pfStack_26650[8] = (float)pfStack_26668; - pfStack_26650[9] = (float)pfStack_2666c; - pfStack_26650[0xe] = (float)pfStack_26670; - pfStack_26650[0xf] = (float)pfStack_26674; - pfStack_26650[0x10] = (float)pfStack_26664; - pfStack_26650[0x13] = (float)pfStack_2667c; - pfStack_2667c = GHIDRA_CAST((GHIDRA_INT(pfStack_2667c) + GHIDRA_INT(pfStack_26650[2]))); - pfStack_26650[0x14] = (float)pfStack_2667c; - pfVar26 = GHIDRA_CAST(pfStack_26654[0xb]); - uVar14 = uStack_26690; - } - InterpolateNullFrames(rootFrames,&uStack_26690,pfStack_26678); - _eh_vector_constructor_iterator_ - (layerAnimations,0x10,0x40,LayerAnimation::LayerAnimation,guard_check_icall); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x12; - pfStack_2668c = GHIDRA_CAST(0x0); - keyName = "LayerAnimations"; - do { - pcVar22 = keyName; - keyName = pcVar22 + 1; - } while (*keyName != '\0'); - pfStack_26654 = GHIDRA_CAST((pcVar22 + -0xb1b4e7)); - for (puVar15 = GHIDRA_CAST(pfStack_26684[6]); puVar15 != GHIDRA_CAST(0x0); - puVar15 = GHIDRA_CAST(puVar15[0xb])) { - pbVar18 = GHIDRA_CAST(*puVar15); - if (pbVar18 == GHIDRA_CAST(0x0)) { - pfVar26 = GHIDRA_CAST(0x0); - pbVar18 = &g_xmlNullStr; - } - else { - pfVar26 = GHIDRA_CAST(puVar15[2]); - } - if (pfVar26 == pfStack_26654) { - pbVar13 = GHIDRA_CAST((GHIDRA_INT(pfVar26) + GHIDRA_INT(pbVar18))); - if (pbVar13 <= pbVar18) goto LAB_00410e71; - iVar11 = GHIDRA_INT("LayerAnimations") - GHIDRA_INT(pbVar18); - while (*pbVar18 == pbVar18[iVar11]) { - pbVar18 = pbVar18 + 1; - if (pbVar13 <= pbVar18) goto LAB_00410e71; - } - } - } - puVar15 = GHIDRA_CAST(0x0); -LAB_00410e71: - pfStack_2664c = GHIDRA_CAST(puVar15[6]); - if (pfStack_2664c == GHIDRA_CAST(0x0)) { -LAB_004122bc: - pfStack_2664c = GHIDRA_CAST(0x0); - *GHIDRA_CAST((curAnimation[1]._buf + 4)) = pfStack_2668c; - } - else { - do { - pfVar19 = pfStack_2664c; - pfVar26 = pfStack_2668c; - if (&DAT_0000003f < pfStack_2668c) { - (GHIDRA_CAST((filePath->_buf)))->msvc::string::c_str(); - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: too many animation layers\n")); - } - pfStack_2668c = GHIDRA_CAST((GHIDRA_INT(pfVar26) + 1)); - pfStack_26688 = GHIDRA_CAST((GHIDRA_INT(pfVar26) << 4)); - pfVar26 = GHIDRA_CAST(pfVar19[8]); - while (pfVar26 != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(*pfVar26); - keyName = "LayerId"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410f01: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410f06; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410f01; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410f06: - pfStack_26654 = pfVar26; - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfVar26[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfVar26[1]); - } - iVar11 = atoi(GHIDRA_CAST(pbVar18)); - *GHIDRA_CAST((GHIDRA_CAST(layerAnimations) + GHIDRA_INT(pfStack_26688))) = iVar11; - pfStack_26654 = pfVar26; - } - else { - keyName = "Visible"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00410f62: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00410f67; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00410f62; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00410f67: - if (uVar14 == 0) { - layerAnimVisibleText._buf[0] = '\0'; - layerAnimVisibleText._buf[1] = '\0'; - layerAnimVisibleText._buf[2] = '\0'; - layerAnimVisibleText._buf[3] = '\0'; - layerAnimVisibleText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfVar26[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfVar26[1]); - } - layerAnimVisibleText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((layerAnimVisibleText._buf)))->msvc::string::assign(pbVar18, - GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - textCapacity = layerAnimVisibleText._capacity; - uVar14 = layerAnimVisibleText._size; - if (layerAnimVisibleText._size == 0) { -LAB_0041103a: - parsedBool = 0; - } - else { - psVar16 = &layerAnimVisibleText; - if (0xf < layerAnimVisibleText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerAnimVisibleText._buf))) + 0x0))); - } - if ((layerAnimVisibleText._size != 4) || - (iVar11 = memcmp_eq(psVar16,&DAT_00b64fe8,4), iVar11 != 0)) { - psVar16 = &layerAnimVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerAnimVisibleText._buf))) + 0x0))); - } - if ((uVar14 != 4) || (iVar11 = memcmp_eq(psVar16,&DAT_00b64ff0,4), iVar11 != 0)) { - psVar16 = &layerAnimVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerAnimVisibleText._buf))) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_0041103a; - } - } - parsedBool = 1; - } - auStack_aa4[GHIDRA_INT(pfStack_26688)] = parsedBool; - if (0xf < layerAnimVisibleText._capacity) { - uVar14 = layerAnimVisibleText._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)layerAnimVisibleText._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(layerAnimVisibleText._buf)) + 0x0))) + -4); - uVar14 = layerAnimVisibleText._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(layerAnimVisibleText._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) - goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - layerAnimVisibleText._size = 0; - layerAnimVisibleText._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(layerAnimVisibleText._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(layerAnimVisibleText._buf)) + 0x0))) & 0xffffff00; - } - } - if (pfStack_26654[4] == 0.0) break; - pfVar26 = GHIDRA_CAST(pfStack_26654[6]); - } - pfStack_266a0 = GHIDRA_CAST(0x0); - pfStack_2667c = GHIDRA_CAST(0x0); - pfVar26 = GHIDRA_CAST(pfStack_2664c[6]); - pfVar19 = pfStack_2667c; - pfVar25 = pfStack_26680; - while( true ) { - pfStack_26654 = pfVar26; - pfStack_26680 = pfVar25; - pfStack_2667c = pfVar19; - if (pfVar26 == GHIDRA_CAST(0x0)) break; - if (GHIDRA_CAST(0x1387) < pfVar19) { - (GHIDRA_CAST((filePath->_buf)))->msvc::string::c_str(); - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: too many animation frames\n")); - } - pfStack_26658 = GHIDRA_CAST(pfVar26[8]); - pfStack_2667c = GHIDRA_CAST((GHIDRA_INT(pfVar19) + 1)); - pfStack_26674 = GHIDRA_CAST(0x3f800000); - pfStack_26670 = GHIDRA_CAST(0x3f800000); - pfStack_2666c = GHIDRA_CAST(0x3f800000); - pfStack_26664 = pfStack_26680 + GHIDRA_INT(pfVar19) * 0x1b; - pfStack_26668 = GHIDRA_CAST(0x3f800000); - pfStack_26660 = GHIDRA_CAST(0x0); - pfStack_2665c = GHIDRA_CAST(0x0); - pfStack_26650 = GHIDRA_CAST(0x0); - if (pfStack_26658 != GHIDRA_CAST(0x0)) { -LAB_00411184: - pfVar26 = pfStack_26658; - pbVar18 = GHIDRA_CAST(*pfStack_26658); - keyName = "XPosition"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004111b5: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004111ba; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004111b5; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004111ba: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[4] = (float)dVar27; - } - else { - keyName = "YPosition"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411212: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411217; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411212; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411217: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[5] = (float)dVar27; - } - else { - pbVar17 = &DAT_00b1b540; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_00411270: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411275; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_00411270; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411275: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[8] = (float)dVar27; - } - else { - pbVar17 = &DAT_00b1b548; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_004112d0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004112d5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_004112d0; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004112d5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[9] = (float)dVar27; - } - else { - keyName = "Width"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411330: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411335; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411330; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411335: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[2] = (float)dVar27; - } - else { - keyName = "Height"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411390: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411395; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411390; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411395: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[3] = (float)dVar27; - } - else { - keyName = "XScale"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004113f0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004113f5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004113f0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004113f5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26658 = GHIDRA_CAST((float)dVar27); - pfStack_26664[6] = (float)pfStack_26658 / 100.0; - } - else { - keyName = "YScale"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411460: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411465; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411460; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411465: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26658 = GHIDRA_CAST((float)dVar27); - pfStack_26664[7] = (float)pfStack_26658 / 100.0; - } - else { - keyName = "Delay"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004114d0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004114d5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004114d0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004114d5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - rootScaleY = (float)atoi(GHIDRA_CAST(pbVar18)); - pfStack_26664[10] = rootScaleY; - } - else { - keyName = "Visible"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411530: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411535; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411530; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411535: - if (uVar14 == 0) { - layerFrameVisibleText._buf[0] = '\0'; - layerFrameVisibleText._buf[1] = '\0'; - layerFrameVisibleText._buf[2] = '\0'; - layerFrameVisibleText._buf[3] = '\0'; - layerFrameVisibleText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - layerFrameVisibleText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((layerFrameVisibleText._buf)))->msvc::string::assign(pbVar18, - GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - textCapacity = layerFrameVisibleText._capacity; - uVar14 = layerFrameVisibleText._size; - if (layerFrameVisibleText._size == 0) { -LAB_00411602: - parsedBool = 0; - } - else { - psVar16 = &layerFrameVisibleText; - if (0xf < layerFrameVisibleText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerFrameVisibleText._buf))) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),layerFrameVisibleText._size, - &DAT_00b64fe8,4); - if (bVar8 == 0) { - psVar16 = &layerFrameVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerFrameVisibleText._buf))) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),uVar14,&DAT_00b64ff0,4); - if (bVar8 == 0) { - psVar16 = &layerFrameVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerFrameVisibleText._buf))) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_00411602; - } - } - parsedBool = 1; - } - *GHIDRA_CAST((pfStack_26664 + 0xb)) = parsedBool; - if (0xf < layerFrameVisibleText._capacity) { - uVar14 = layerFrameVisibleText._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)layerFrameVisibleText._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameVisibleText._buf)) + 0x0))) + -4); - uVar14 = layerFrameVisibleText._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameVisibleText._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - - 4U) goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - layerFrameVisibleText._size = 0; - layerFrameVisibleText._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameVisibleText._buf)) + 0x0))) = - (*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameVisibleText._buf)) + 0x0))) & 0xffffff00; - } - else { - keyName = "XCrop"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411696: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_0041169b; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411696; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_0041169b: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - *pfStack_26664 = (float)dVar27; - goto LAB_00411d66; - } - pbVar17 = &DAT_00b1b568; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < *pbVar17; - if (bVar8 != *pbVar17) { -LAB_004116f2: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004116f7; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < pbVar17[1]; - if (bVar8 != pbVar17[1]) goto LAB_004116f2; - pbVar13 = pbVar13 + 2; - pbVar17 = pbVar17 + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004116f7: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[1] = (float)dVar27; - goto LAB_00411d66; - } - keyName = "RedTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411750: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411755; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411750; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411755: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26674 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_26658 = pfStack_26674; - goto LAB_00411d66; - } - keyName = "GreenTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004117d2: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004117d7; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004117d2; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004117d7: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26670 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_26658 = pfStack_26670; - goto LAB_00411d66; - } - keyName = "BlueTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411860: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411865; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411860; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411865: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2666c = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_26658 = pfStack_2666c; - goto LAB_00411d66; - } - keyName = "AlphaTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004118f2: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004118f7; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004118f2; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004118f7: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26668 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_26658 = pfStack_26668; - goto LAB_00411d66; - } - keyName = "RedOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411990: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411995; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411990; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411995: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26660 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_26658 = pfStack_26660; - goto LAB_00411d66; - } - keyName = "GreenOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411a32: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411a37; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411a32; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411a37: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2665c = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_26658 = pfStack_2665c; - goto LAB_00411d66; - } - keyName = "BlueOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411ae0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411ae5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411ae0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411ae5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26658 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_26650 = pfStack_26658; - goto LAB_00411d66; - } - keyName = "Rotation"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411b92: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411b97; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411b92; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411b97: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664[0x17] = (float)dVar27; - goto LAB_00411d66; - } - keyName = "Interpolated"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00411bf0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00411bf5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00411bf0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00411bf5: - if (uVar14 == 0) { - layerFrameInterpolatedText._buf[0] = '\0'; - layerFrameInterpolatedText._buf[1] = '\0'; - layerFrameInterpolatedText._buf[2] = '\0'; - layerFrameInterpolatedText._buf[3] = '\0'; - layerFrameInterpolatedText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_26658[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_26658[1]); - } - layerFrameInterpolatedText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((layerFrameInterpolatedText._buf)))->msvc::string::assign(pbVar18, - GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - textCapacity = layerFrameInterpolatedText._capacity; - uVar14 = layerFrameInterpolatedText._size; - if (layerFrameInterpolatedText._size == 0) { -LAB_00411cc2: - parsedBool = 0; - } - else { - psVar16 = &layerFrameInterpolatedText; - if (0xf < layerFrameInterpolatedText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(layerFrameInterpolatedText._buf))) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),layerFrameInterpolatedText._size, - &DAT_00b64fe8,4); - if (bVar8 == 0) { - psVar16 = &layerFrameInterpolatedText; - if (0xf < textCapacity) { - psVar16 = (std_string *) - (*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameInterpolatedText._buf)) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),uVar14,&DAT_00b64ff0,4); - if (bVar8 == 0) { - psVar16 = &layerFrameInterpolatedText; - if (0xf < textCapacity) { - psVar16 = (std_string *) - (*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameInterpolatedText._buf)) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_00411cc2; - } - } - parsedBool = 1; - } - *GHIDRA_CAST((pfStack_26664 + 0x18)) = parsedBool; - if (0xf < layerFrameInterpolatedText._capacity) { - uVar14 = layerFrameInterpolatedText._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)layerFrameInterpolatedText._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameInterpolatedText._buf)) + 0x0))) + - -4); - uVar14 = layerFrameInterpolatedText._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameInterpolatedText._buf)) + 0x0))) - - GHIDRA_INT(pvVar12)) - 4U) goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - layerFrameInterpolatedText._size = 0; - layerFrameInterpolatedText._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameInterpolatedText._buf)) + 0x0))) = - (*GHIDRA_CAST((GHIDRA_CAST(&(layerFrameInterpolatedText._buf)) + 0x0))) & 0xffffff00; - } - } - pfVar26 = pfStack_26658; - } - } - } - } - } - } - } - } - } -LAB_00411d66: - if ((pfVar26[4] == 0.0) || - (pfStack_26658 = GHIDRA_CAST(pfVar26[6]), pfStack_26658 == GHIDRA_CAST(0x0))) - goto LAB_00411d89; - goto LAB_00411184; - } -LAB_00411d89: - pfStack_26664[0xc] = (float)pfStack_26674; - pfStack_26664[0xd] = (float)pfStack_26670; - pfStack_26664[0xe] = (float)pfStack_2666c; - pfStack_26664[0xf] = (float)pfStack_26668; - pfStack_26664[0x14] = (float)pfStack_26660; - pfStack_26664[0x15] = (float)pfStack_2665c; - pfStack_26664[0x16] = (float)pfStack_26650; - pfStack_26664[0x19] = (float)pfStack_266a0; - pfStack_266a0 = GHIDRA_CAST((GHIDRA_INT(pfStack_266a0) + GHIDRA_INT(pfStack_26664[10]))); - pfStack_26664[0x1a] = (float)pfStack_266a0; - pfVar26 = GHIDRA_CAST(pfStack_26654[0xb]); - pfVar19 = pfStack_2667c; - pfVar25 = pfStack_26680; - } - InterpolateLayerFrames(pfVar25,GHIDRA_CAST(&pfStack_2667c),pfStack_2669c); - pfVar19 = GHIDRA_CAST(0x0); - pfStack_26650 = GHIDRA_CAST(0x0); - pfVar21 = GHIDRA_CAST(0x0); - pfStack_26660 = pfStack_2667c; - pfVar24 = GHIDRA_CAST(0x0); - pfVar26 = pfVar19; - if (pfStack_2667c != GHIDRA_CAST(0x0)) { - pfStack_2667c = pfVar25 + 5; - do { - pfStack_2667c[0x14] = (float)pfVar21; - rootScaleY = pfStack_2667c[5]; - pfStack_26658 = GHIDRA_CAST(0x0); - if (0 < GHIDRA_INT(rootScaleY)) { - pfStack_266a0 = pfStack_2669c + GHIDRA_INT(pfVar19) * 0x1b; - pfStack_2665c = pfVar21; - pfVar26 = pfVar24; - do { - pfStack_2665c = GHIDRA_CAST((GHIDRA_INT(pfStack_2665c) + 1)); - iVar11 = GHIDRA_INT(pfVar26) + 1; - pfVar24 = pfVar26; - if (iVar11 < GHIDRA_INT(uStack_26690)) { - piVar9 = GHIDRA_CAST((GHIDRA_INT(rootFrames) + GHIDRA_INT(pfVar26) * 0x54 + 0x50)); - do { - if (GHIDRA_INT(pfStack_2665c) < *piVar9) break; - iVar11 = iVar11 + 1; - pfVar24 = GHIDRA_CAST((GHIDRA_INT(pfVar24) + 1)); - piVar9 = piVar9 + 0x15; - } while (iVar11 < GHIDRA_INT(uStack_26690)); - if (GHIDRA_INT(pfVar24) <= GHIDRA_INT(pfVar26)) goto LAB_00411e9b; -LAB_00411eb2: - pfStack_26654 = GHIDRA_CAST((GHIDRA_INT(pfVar26) * 0x54 + GHIDRA_INT(rootFrames))); - if (GHIDRA_CAST(0x1387) < pfStack_26650) { - (GHIDRA_CAST((filePath->_buf)))->msvc::string::c_str(); - KAGE_LogMessage(0x10,(uint8_t *) - "%s: too many frames after interpolation/root frame adjustment\n" - ); - } - pfVar26 = pfStack_266a0; - pfStack_26650 = GHIDRA_CAST((GHIDRA_INT(pfStack_26650) + 1)); - *pfStack_266a0 = pfStack_2667c[-5]; - pfStack_266a0[1] = pfStack_2667c[-4]; - pfStack_266a0[2] = pfStack_2667c[-3]; - pfStack_266a0[3] = pfStack_2667c[-2]; - pfStack_266a0[4] = pfStack_2667c[-1]; - pfStack_266a0[5] = *pfStack_2667c; - pfStack_266a0[6] = pfStack_2667c[1]; - pfStack_266a0[7] = pfStack_2667c[2]; - pfStack_266a0[8] = pfStack_2667c[3]; - pfStack_266a0[9] = pfStack_2667c[4]; - pfStack_266a0[10] = pfStack_2667c[5]; - *GHIDRA_CAST((pfStack_266a0 + 0xb)) = *GHIDRA_CAST((pfStack_2667c + 6)); - frameColor = GHIDRA_CAST((pfStack_266a0 + 0xc)); - pfStack_266a0 = pfStack_266a0 + 0x1b; - (GHIDRA_CAST((frameColor)))->Color::operator_assign(GHIDRA_CAST((pfStack_2667c + 7))); - pfVar26[0x17] = pfStack_2667c[0x12]; - *GHIDRA_CAST((pfVar26 + 0x18)) = *GHIDRA_CAST((pfStack_2667c + 0x13)); - pfVar26[0x19] = pfStack_2667c[0x14]; - pfVar26[0x1a] = pfStack_2667c[0x15]; - rootScaleY = extraout_EDX_05[5]; - rootPosY = extraout_EDX_05[1]; - pfVar26[4] = pfVar26[4] * extraout_EDX_05[4] + *extraout_EDX_05; - pfVar26[5] = rootScaleY * pfVar26[5] + rootPosY; - if ((*GHIDRA_CAST((pfVar26 + 0xb)) == '\0') || (*GHIDRA_CAST((extraout_EDX_05 + 3)) == '\0') - ) { - parsedBool = 0; - } - else { - parsedBool = 1; - } - *GHIDRA_CAST((pfVar26 + 0xb)) = parsedBool; - pfVar26[6] = pfVar26[6] * extraout_EDX_05[4]; - pfVar26[7] = extraout_EDX_05[5] * pfVar26[7]; - (GHIDRA_CAST((GHIDRA_CAST((pfVar26 + 0xc)))))->Color::__mul(GHIDRA_CAST((extraout_EDX_05 + 6))); - pfVar26[0x17] = pfStack_26654[0x11] + pfVar26[0x17]; - pfVar26[0x1a] = (float)pfStack_2665c; - pfStack_2667c[0x14] = (float)pfStack_2665c; - } - else { -LAB_00411e9b: - if (pfStack_26658 == GHIDRA_CAST((GHIDRA_INT(rootScaleY) + -1))) goto LAB_00411eb2; - pfStack_26654 = pfVar26; - } - rootScaleY = pfStack_2667c[5]; - pfStack_26658 = GHIDRA_CAST((GHIDRA_INT(pfStack_26658) + 1)); - pfVar26 = pfVar24; - } while (GHIDRA_INT(pfStack_26658) < GHIDRA_INT(rootScaleY)); - pfVar19 = pfStack_26650; - pfVar21 = pfStack_2665c; - } - pfVar25 = pfStack_26650; - pfStack_2667c = pfStack_2667c + 0x1b; - pfStack_26660 = GHIDRA_CAST((GHIDRA_INT(pfStack_26660) + -1)); - } while (pfStack_26660 != GHIDRA_CAST(0x0)); - pfVar26 = GHIDRA_CAST(0x0); - if (pfVar19 != GHIDRA_CAST(0x0)) { - pfStack_26654 = pfVar19; - pfVar26 = operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfStack_26650) * 0x6c >> 0x20)) != 0)) | - GHIDRA_UINT((ZEXT48(pfStack_26650) * 0x6c))); - if (pfVar26 == GHIDRA_CAST(0x0)) { - pfVar26 = GHIDRA_CAST(0x0); - pfStack_26654 = GHIDRA_CAST(0x0); - } - else { - pfVar19 = pfVar26 + 5; - pfStack_26658 = pfVar26; - pfStack_26654 = pfVar26; - do { - pfVar19[-4] = 0.0; - pfVar19[-5] = 0.0; - pfVar19[-2] = 0.0; - pfVar19[-3] = 0.0; - *pfVar19 = 0.0; - pfVar19[-1] = 0.0; - pfVar19[2] = 0.0; - pfVar19[1] = 0.0; - pfVar19[4] = 0.0; - pfVar19[3] = 0.0; - (GHIDRA_CAST((GHIDRA_CAST((pfVar19 + 7)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX_06 + 0x4c)) = 0; - pfVar19 = GHIDRA_CAST((extraout_EDX_06 + 0x6c)); - pfVar25 = GHIDRA_CAST((GHIDRA_INT(pfVar25) + -1)); - } while (pfVar25 != GHIDRA_CAST(0x0)); - } - pfVar19 = pfVar26 + 3; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x12; - pfStack_26658 = GHIDRA_CAST((GHIDRA_INT(pfStack_2669c) - GHIDRA_INT(pfVar26))); - pfVar26 = pfStack_2669c + 7; - pfVar25 = pfStack_26650; - do { - pfVar19[-3] = pfVar26[-7]; - pfVar19[-2] = pfVar26[-6]; - pfVar19[-1] = pfVar26[-5]; - *pfVar19 = *GHIDRA_CAST((GHIDRA_CAST(pfStack_26658) + GHIDRA_INT(pfVar19))); - pfVar19[1] = pfVar26[-3]; - pfVar19[2] = pfVar26[-2]; - pfVar19[3] = pfVar26[-1]; - pfVar19[4] = *pfVar26; - pfVar19[5] = pfVar26[1]; - pfVar19[6] = pfVar26[2]; - pfVar19[7] = pfVar26[3]; - *GHIDRA_CAST((pfVar19 + 8)) = *GHIDRA_CAST((pfVar26 + 4)); - (GHIDRA_CAST((GHIDRA_CAST((pfVar19 + 9)))))->Color::operator_assign(GHIDRA_CAST((pfVar26 + 5))); - pfVar19 = GHIDRA_CAST((extraout_EDX_07 + 0x6c)); - *GHIDRA_CAST((extraout_EDX_07 + 0x50)) = pfVar26[0x10]; - *GHIDRA_CAST((extraout_EDX_07 + 0x54)) = *GHIDRA_CAST((pfVar26 + 0x11)); - *GHIDRA_CAST((extraout_EDX_07 + 0x58)) = pfVar26[0x12]; - *GHIDRA_CAST((extraout_EDX_07 + 0x5c)) = pfVar26[0x13]; - pfVar25 = GHIDRA_CAST((GHIDRA_INT(pfVar25) + -1)); - pfVar26 = pfVar26 + 0x1b; - } while (pfVar25 != GHIDRA_CAST(0x0)); - *GHIDRA_CAST((GHIDRA_CAST((layerAnimations + 1)) + GHIDRA_INT(pfStack_26688))) = pfStack_26654; - pfVar26 = pfStack_26650; - } - } - pfVar19 = pfStack_2668c; - *GHIDRA_CAST((GHIDRA_CAST((layerAnimations + 2)) + GHIDRA_INT(pfStack_26688))) = pfVar26; - pfStack_2664c = GHIDRA_CAST(pfStack_2664c[0xb]); - } while (pfStack_2664c != GHIDRA_CAST(0x0)); - if (pfStack_2668c == GHIDRA_CAST(0x0)) goto LAB_004122bc; - pfStack_2664c = pfStack_2668c; - pfStack_26654 = GHIDRA_CAST(0x0); - uVar14 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfStack_2668c) * 0x10 >> 0x20)) != 0)) | - GHIDRA_UINT((ZEXT48(pfStack_2668c) * 0x10)); - puStack_266c4 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar14)) | uVar14 + 4); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x14; - if (puStack_266c4 == GHIDRA_CAST(0x0)) { - pfVar26 = GHIDRA_CAST(0x0); - pfStack_26654 = GHIDRA_CAST(0x0); - } - else { - pfVar26 = GHIDRA_CAST((puStack_266c4 + 1)); - *puStack_266c4 = pfVar19; - pfStack_26654 = pfVar26; - _eh_vector_constructor_iterator_ - (pfVar26,0x10,GHIDRA_UINT(pfVar19),LayerAnimation::LayerAnimation,guard_check_icall); - } - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x12; - pfVar19 = pfVar26 + 3; - pfVar25 = layerAnimations + 2; - pfVar21 = pfStack_2668c; - do { - pfVar19[-3] = pfVar25[-2]; - *GHIDRA_CAST(pfVar19) = - *GHIDRA_CAST((GHIDRA_CAST(nullNames) + (0x5f0 - GHIDRA_INT(pfVar26)) + GHIDRA_INT((pfVar19 + 4)))); - pfVar19[-2] = pfVar25[-1]; - pfVar19[-1] = *pfVar25; - pfVar21 = GHIDRA_CAST((GHIDRA_INT(pfVar21) + -1)); - pfVar19 = pfVar19 + 4; - pfVar25 = pfVar25 + 4; - } while (pfVar21 != GHIDRA_CAST(0x0)); - iVar11 = 0; - uVar14 = 0; - *GHIDRA_CAST(curAnimation[1]._buf) = pfStack_26654; - *GHIDRA_CAST((curAnimation[1]._buf + 4)) = pfStack_2668c; - do { - iVar11 = iVar11 + 0x10; - *GHIDRA_CAST((curAnimation[2]._buf + - *GHIDRA_CAST((*GHIDRA_CAST(curAnimation[1]._buf) + -0x10 + iVar11)) * 4 + 8)) = uVar14; - uVar14 = uVar14 + 1; - } while (uVar14 < *GHIDRA_CAST((curAnimation[1]._buf + 4))); - } - _eh_vector_constructor_iterator_ - (&nullAnimations,0x10,0x40,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040c210),guard_check_icall); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x15; - pfStack_2668c = GHIDRA_CAST(0x0); - keyName = "NullAnimations"; - do { - pcVar22 = keyName; - keyName = pcVar22 + 1; - } while (*keyName != '\0'); - for (puVar15 = GHIDRA_CAST(pfStack_26684[6]); puVar15 != GHIDRA_CAST(0x0); - puVar15 = GHIDRA_CAST(puVar15[0xb])) { - pbVar18 = GHIDRA_CAST(*puVar15); - if (pbVar18 == GHIDRA_CAST(0x0)) { - keyName = GHIDRA_CAST(0x0); - pbVar18 = &g_xmlNullStr; - } - else { - keyName = GHIDRA_CAST(puVar15[2]); - } - if (keyName == pcVar22 + -0xb1b5af) { - pbVar13 = pbVar18 + GHIDRA_INT(keyName); - if (pbVar13 <= pbVar18) goto LAB_00412352; - iVar11 = GHIDRA_INT("NullAnimations") - GHIDRA_INT(pbVar18); - while (*pbVar18 == pbVar18[iVar11]) { - pbVar18 = pbVar18 + 1; - if (pbVar13 <= pbVar18) goto LAB_00412352; - } - } - } - puVar15 = GHIDRA_CAST(0x0); -LAB_00412352: - pfStack_26654 = GHIDRA_CAST(puVar15[6]); - if (pfStack_26654 == GHIDRA_CAST(0x0)) { -LAB_00413466: - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x15; - } - else { - do { - pfVar19 = pfStack_26654; - pfVar26 = pfStack_2668c; - if (&DAT_0000003f < pfStack_2668c) { - (GHIDRA_CAST((filePath->_buf)))->msvc::string::c_str(); - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: too many null layers\n")); - } - pfStack_2668c = GHIDRA_CAST((GHIDRA_INT(pfVar26) + 1)); - pfStack_266a0 = GHIDRA_CAST((GHIDRA_INT(pfVar26) << 4)); - for (pfVar26 = GHIDRA_CAST(pfVar19[8]); pfStack_2664c = pfVar26, pfVar26 != GHIDRA_CAST(0x0); - pfVar26 = GHIDRA_CAST(pfVar26[6])) { - pbVar18 = GHIDRA_CAST(*pfVar26); - keyName = "NullId"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004123e1: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004123e6; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004123e1; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004123e6: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfVar26[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfVar26[1]); - } - iVar11 = atoi(GHIDRA_CAST(pbVar18)); - *GHIDRA_CAST((GHIDRA_INT(&nullAnimations) + GHIDRA_INT(pfStack_266a0))) = iVar11; - } - else { - keyName = "Visible"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412442: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412447; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412442; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412447: - if (uVar14 == 0) { - nullAnimVisibleText._buf[0] = '\0'; - nullAnimVisibleText._buf[1] = '\0'; - nullAnimVisibleText._buf[2] = '\0'; - nullAnimVisibleText._buf[3] = '\0'; - nullAnimVisibleText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfVar26[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfVar26[1]); - } - nullAnimVisibleText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((nullAnimVisibleText._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - textCapacity = nullAnimVisibleText._capacity; - uVar14 = nullAnimVisibleText._size; - if (nullAnimVisibleText._size == 0) { -LAB_00412512: - parsedBool = 0; - } - else { - psVar16 = &nullAnimVisibleText; - if (0xf < nullAnimVisibleText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(nullAnimVisibleText._buf))) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),nullAnimVisibleText._size,&DAT_00b64fe8,4); - if (bVar8 == 0) { - psVar16 = &nullAnimVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(nullAnimVisibleText._buf))) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),uVar14,&DAT_00b64ff0,4); - if (bVar8 == 0) { - psVar16 = &nullAnimVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(nullAnimVisibleText._buf))) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_00412512; - } - } - parsedBool = 1; - } - *GHIDRA_CAST((GHIDRA_CAST(local_6ac) + GHIDRA_INT(pfStack_266a0))) = parsedBool; - if (0xf < nullAnimVisibleText._capacity) { - uVar14 = nullAnimVisibleText._capacity + 1; - pvVar12 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)nullAnimVisibleText._buf)) + 0x0))); - if (0xfff < uVar14) { - pvVar12 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(nullAnimVisibleText._buf)) + 0x0))) + -4); - uVar14 = nullAnimVisibleText._capacity + 0x24; - if (0x1f < ((*GHIDRA_CAST((GHIDRA_CAST(&(nullAnimVisibleText._buf)) + 0x0))) - GHIDRA_INT(pvVar12)) - 4U) - goto LAB_00413762; - } - operator_delete(pvVar12,uVar14); - } - nullAnimVisibleText._size = 0; - nullAnimVisibleText._capacity = 0xf; - (*GHIDRA_CAST((GHIDRA_CAST(&(nullAnimVisibleText._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(nullAnimVisibleText._buf)) + 0x0))) & 0xffffff00; - pfVar26 = pfStack_2664c; - } - } - if (pfVar26[4] == 0.0) break; - } - pfStack_26658 = GHIDRA_CAST(0x0); - pfStack_26688 = GHIDRA_CAST(0x0); - pfVar26 = GHIDRA_CAST(pfStack_26654[6]); - pfVar19 = pfStack_26688; - pvVar12 = pvStack_266ac; - while( true ) { - pvStack_266ac = pvVar12; - pfStack_26688 = pfVar19; - pfStack_2667c = pfVar26; - if (pfVar26 == GHIDRA_CAST(0x0)) break; - if (GHIDRA_CAST(0x1387) < pfVar19) { - (GHIDRA_CAST((filePath->_buf)))->msvc::string::c_str(); - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: too many null frames\n")); - } - pfStack_2664c = GHIDRA_CAST(pfVar26[8]); - pfStack_26688 = GHIDRA_CAST((GHIDRA_INT(pfVar19) + 1)); - pfStack_2665c = GHIDRA_CAST(0x3f800000); - pfStack_26660 = GHIDRA_CAST(0x3f800000); - pfStack_26668 = GHIDRA_CAST(0x3f800000); - pfStack_26650 = GHIDRA_CAST((GHIDRA_INT(pfVar19) * 0x54 + GHIDRA_INT(pvStack_266ac))); - pfStack_2666c = GHIDRA_CAST(0x3f800000); - pfStack_26670 = GHIDRA_CAST(0x0); - pfStack_26674 = GHIDRA_CAST(0x0); - pfStack_26664 = GHIDRA_CAST(0x0); - if (pfStack_2664c != GHIDRA_CAST(0x0)) { - do { - pfVar26 = pfStack_2664c; - pbVar18 = GHIDRA_CAST(*pfStack_2664c); - keyName = "XPosition"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412693: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412698; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412693; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412698: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - *pfStack_26650 = (float)dVar27; - } - else { - keyName = "YPosition"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004126f0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004126f5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004126f0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004126f5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26650[1] = (float)dVar27; - } - else { - keyName = "Delay"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412750: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412755; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412750; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412755: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - rootScaleY = (float)atoi(GHIDRA_CAST(pbVar18)); - pfStack_26650[2] = rootScaleY; - } - else { - keyName = "Visible"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004127b0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004127b5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004127b0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004127b5: - if (uVar14 == 0) { - nullFrameVisibleText._buf[0] = '\0'; - nullFrameVisibleText._buf[1] = '\0'; - nullFrameVisibleText._buf[2] = '\0'; - nullFrameVisibleText._buf[3] = '\0'; - nullFrameVisibleText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - nullFrameVisibleText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((nullFrameVisibleText._buf)))->msvc::string::assign(pbVar18, - GHIDRA_INT(pbVar13) - GHIDRA_INT((pbVar18 + 1))); - textCapacity = nullFrameVisibleText._capacity; - uVar14 = nullFrameVisibleText._size; - if (nullFrameVisibleText._size == 0) { -LAB_00412898: - *GHIDRA_CAST((pfStack_26650 + 3)) = 0; - psVar16 = &nullFrameVisibleText; - } - else { - psVar16 = &nullFrameVisibleText; - if (0xf < nullFrameVisibleText._capacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(nullFrameVisibleText._buf))) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),nullFrameVisibleText._size,&DAT_00b64fe8,4); - if (bVar8 == 0) { - psVar16 = &nullFrameVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(nullFrameVisibleText._buf))) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),uVar14,&DAT_00b64ff0,4); - if (bVar8 == 0) { - psVar16 = &nullFrameVisibleText; - if (0xf < textCapacity) { - psVar16 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(nullFrameVisibleText._buf))) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_00412898; - } - } - *GHIDRA_CAST((pfStack_26650 + 3)) = 1; - psVar16 = &nullFrameVisibleText; - } -LAB_00412f43: - (GHIDRA_CAST((psVar16->_buf)))->msvc::string::_Tidy_deallocate(); - pfVar26 = pfStack_2664c; - } - else { - keyName = "XScale"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004128e0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004128e5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004128e0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004128e5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2664c = GHIDRA_CAST((float)dVar27); - pfStack_26650[4] = (float)pfStack_2664c / 100.0; - } - else { - keyName = "YScale"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412950: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412955; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412950; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412955: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2664c = GHIDRA_CAST((float)dVar27); - pfStack_26650[5] = (float)pfStack_2664c / 100.0; - } - else { - keyName = "RedTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004129c0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004129c5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004129c0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004129c5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2665c = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_2665c; - } - else { - keyName = "GreenTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412a42: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412a47; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412a42; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412a47: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26660 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26660; - } - else { - keyName = "BlueTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412ad0: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412ad5; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412ad0; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412ad5: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26668 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26668; - } - else { - keyName = "AlphaTint"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412b62: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412b67; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412b62; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412b67: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_2666c = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_2666c; - } - else { - keyName = "RedOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412c00: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412c05; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412c00; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412c05: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26670 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26670; - } - else { - keyName = "GreenOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412ca2: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412ca7; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412ca2; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412ca7: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26674 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26674; - } - else { - keyName = "BlueOffset"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412d50: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412d55; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412d50; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412d55: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26664 = GHIDRA_CAST(((float)dVar27 / 255.0)); - pfStack_2664c = pfStack_26664; - } - else { - keyName = "Rotation"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412e02: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412e07; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412e02; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412e07: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - dVar27 = atof(GHIDRA_CAST(pbVar18)); - pfStack_26650[0x11] = (float)dVar27; - } - else { - keyName = "Interpolated"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00412e60: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00412e65; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00412e60; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00412e65: - if (uVar14 == 0) { - nullFrameInterpolatedText._buf[0] = '\0'; - nullFrameInterpolatedText._buf[1] = '\0'; - nullFrameInterpolatedText._buf[2] = '\0'; - nullFrameInterpolatedText._buf[3] = '\0'; - nullFrameInterpolatedText._size = 0; - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(pfStack_2664c[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(pfStack_2664c[1]); - } - nullFrameInterpolatedText._capacity = 0xf; - pbVar13 = pbVar18; - do { - bVar8 = *pbVar13; - pbVar13 = pbVar13 + 1; - } while (bVar8 != 0); - (GHIDRA_CAST((nullFrameInterpolatedText._buf)))->msvc::string::assign(pbVar18,GHIDRA_INT(pbVar13) - - GHIDRA_INT((pbVar18 + 1))); - textCapacity = nullFrameInterpolatedText._capacity; - uVar14 = nullFrameInterpolatedText._size; - if (nullFrameInterpolatedText._size == 0) { -LAB_00412f32: - parsedBool = 0; - } - else { - psVar16 = &nullFrameInterpolatedText; - if (0xf < nullFrameInterpolatedText._capacity) { - psVar16 = (std_string *) - (*GHIDRA_CAST((GHIDRA_CAST(&(nullFrameInterpolatedText._buf)) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16), - nullFrameInterpolatedText._size, - &DAT_00b64fe8,4); - if (bVar8 == 0) { - psVar16 = &nullFrameInterpolatedText; - if (0xf < textCapacity) { - psVar16 = (std_string *) - (*GHIDRA_CAST((GHIDRA_CAST(&(nullFrameInterpolatedText._buf)) + 0x0))); - } - bVar8 = str_eq(GHIDRA_CAST(psVar16),uVar14,&DAT_00b64ff0, - 4); - if (bVar8 == 0) { - psVar16 = &nullFrameInterpolatedText; - if (0xf < textCapacity) { - psVar16 = (std_string *) - (*GHIDRA_CAST((GHIDRA_CAST(&(nullFrameInterpolatedText._buf)) + 0x0))); - } - iVar11 = atoi(psVar16->_buf); - if (iVar11 == 0) goto LAB_00412f32; - } - } - parsedBool = 1; - } - *GHIDRA_CAST((pfStack_26650 + 0x12)) = parsedBool; - psVar16 = &nullFrameInterpolatedText; - goto LAB_00412f43; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } while ((pfVar26[4] != 0.0) && - (pfStack_2664c = GHIDRA_CAST(pfVar26[6]), pfStack_2664c != GHIDRA_CAST(0x0))); - } - pfStack_26650[6] = (float)pfStack_2665c; - pfStack_26650[7] = (float)pfStack_26660; - pfStack_26650[8] = (float)pfStack_26668; - pfStack_26650[9] = (float)pfStack_2666c; - pfStack_26650[0xe] = (float)pfStack_26670; - pfStack_26650[0xf] = (float)pfStack_26674; - pfStack_26650[0x10] = (float)pfStack_26664; - pfStack_26650[0x13] = (float)pfStack_26658; - pfStack_26658 = GHIDRA_CAST((GHIDRA_INT(pfStack_26658) + GHIDRA_INT(pfStack_26650[2]))); - pfStack_26650[0x14] = (float)pfStack_26658; - pfVar26 = GHIDRA_CAST(pfStack_2667c[0xb]); - pfVar19 = pfStack_26688; - pvVar12 = pvStack_266ac; - } - InterpolateNullFrames(pvVar12,GHIDRA_CAST(&pfStack_26688),pfStack_266a4); - pfVar19 = GHIDRA_CAST(0x0); - pfStack_26650 = GHIDRA_CAST(0x0); - pfVar25 = GHIDRA_CAST(0x0); - pfStack_2665c = pfStack_26688; - pfVar21 = GHIDRA_CAST(0x0); - pfVar26 = pfVar19; - if (pfStack_26688 != GHIDRA_CAST(0x0)) { - pfStack_2667c = GHIDRA_CAST((GHIDRA_INT(pvVar12) + 4)); - do { - pfStack_2667c[0x12] = (float)pfVar25; - rootScaleY = pfStack_2667c[1]; - pfStack_2664c = GHIDRA_CAST(0x0); - pfVar26 = pfStack_2667c; - if (0 < GHIDRA_INT(rootScaleY)) { - pfStack_26688 = pfStack_266a4 + GHIDRA_INT(pfVar19) * 0x15; - pfStack_26660 = pfVar25; - pfVar19 = pfVar21; - do { - pfStack_26660 = GHIDRA_CAST((GHIDRA_INT(pfStack_26660) + 1)); - iVar11 = GHIDRA_INT(pfVar19) + 1; - pfVar21 = pfVar19; - if (iVar11 < GHIDRA_INT(uStack_26690)) { - piVar9 = GHIDRA_CAST((GHIDRA_INT(rootFrames) + GHIDRA_INT(pfVar19) * 0x54 + 0x50)); - do { - if (GHIDRA_INT(pfStack_26660) < *piVar9) break; - iVar11 = iVar11 + 1; - pfVar21 = GHIDRA_CAST((GHIDRA_INT(pfVar21) + 1)); - piVar9 = piVar9 + 0x15; - } while (iVar11 < GHIDRA_INT(uStack_26690)); - if (GHIDRA_INT(pfVar21) <= GHIDRA_INT(pfVar19)) { - rootScaleY = pfStack_2667c[1]; - pfVar26 = pfStack_2667c; - goto LAB_004130be; - } -LAB_004130d3: - pfStack_26658 = GHIDRA_CAST((GHIDRA_INT(pfVar19) * 0x54 + GHIDRA_INT(rootFrames))); - if (GHIDRA_CAST(0x1387) < pfStack_26650) { - (GHIDRA_CAST((filePath->_buf)))->msvc::string::c_str(); - KAGE_LogMessage(0x10,(uint8_t *) - "%s: too many frames after interpolation/root frame adjustment\n" - ); - } - pfVar26 = pfStack_26688; - pfStack_26650 = GHIDRA_CAST((GHIDRA_INT(pfStack_26650) + 1)); - *pfStack_26688 = pfStack_2667c[-1]; - pfStack_26688[1] = *pfStack_2667c; - pfStack_26688[2] = pfStack_2667c[1]; - *GHIDRA_CAST((pfStack_26688 + 3)) = *GHIDRA_CAST((pfStack_2667c + 2)); - pfStack_26688[4] = pfStack_2667c[3]; - pfStack_26688[5] = pfStack_2667c[4]; - frameColor = GHIDRA_CAST((pfStack_26688 + 6)); - pfStack_26688 = pfStack_26688 + 0x15; - (GHIDRA_CAST((frameColor)))->Color::operator_assign(GHIDRA_CAST((pfStack_2667c + 5))); - pfVar26[0x11] = pfStack_2667c[0x10]; - *GHIDRA_CAST((pfVar26 + 0x12)) = *GHIDRA_CAST((pfStack_2667c + 0x11)); - pfVar26[0x13] = pfStack_2667c[0x12]; - pfVar26[0x14] = pfStack_2667c[0x13]; - rootScaleY = extraout_EDX_08[5]; - rootPosY = extraout_EDX_08[1]; - *pfVar26 = *pfVar26 * extraout_EDX_08[4] + *extraout_EDX_08; - pfVar26[1] = rootScaleY * pfVar26[1] + rootPosY; - if ((*GHIDRA_CAST((pfVar26 + 3)) == '\0') || (*GHIDRA_CAST((extraout_EDX_08 + 3)) == '\0')) - { - parsedBool = 0; - } - else { - parsedBool = 1; - } - *GHIDRA_CAST((pfVar26 + 3)) = parsedBool; - pfVar26[4] = extraout_EDX_08[4] * pfVar26[4]; - pfVar26[5] = extraout_EDX_08[5] * pfVar26[5]; - (GHIDRA_CAST((GHIDRA_CAST((pfVar26 + 6)))))->Color::__mul(GHIDRA_CAST((extraout_EDX_08 + 6))); - pfVar26[0x11] = pfStack_26658[0x11] + pfVar26[0x11]; - pfVar26[0x14] = (float)pfStack_26660; - pfStack_2667c[0x12] = (float)pfStack_26660; - pfVar26 = pfStack_2667c; - } - else { -LAB_004130be: - pfStack_26658 = pfVar19; - if (pfStack_2664c == GHIDRA_CAST((GHIDRA_INT(rootScaleY) + -1))) goto LAB_004130d3; - } - rootScaleY = pfVar26[1]; - pfStack_2664c = GHIDRA_CAST((GHIDRA_INT(pfStack_2664c) + 1)); - pfVar19 = pfVar21; - } while (GHIDRA_INT(pfStack_2664c) < GHIDRA_INT(rootScaleY)); - pfVar19 = pfStack_26650; - pfVar25 = pfStack_26660; - } - pfVar24 = pfStack_26650; - pfStack_2667c = pfVar26 + 0x15; - pfStack_2665c = GHIDRA_CAST((GHIDRA_INT(pfStack_2665c) + -1)); - } while (pfStack_2665c != GHIDRA_CAST(0x0)); - pfVar26 = GHIDRA_CAST(0x0); - if (pfVar19 != GHIDRA_CAST(0x0)) { - pfStack_2664c = pfVar19; - pfVar26 = operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfStack_26650) * 0x54 >> 0x20)) != 0)) | - GHIDRA_UINT((ZEXT48(pfStack_26650) * 0x54))); - if (pfVar26 == GHIDRA_CAST(0x0)) { - pfVar26 = GHIDRA_CAST(0x0); - pfStack_2664c = GHIDRA_CAST(0x0); - } - else { - pfVar19 = pfVar26 + 1; - pfStack_26658 = pfVar26; - pfStack_2664c = pfVar26; - do { - *pfVar19 = 0.0; - pfVar19[-1] = 0.0; - pfVar19[4] = 0.0; - pfVar19[3] = 0.0; - (GHIDRA_CAST((GHIDRA_CAST((pfVar19 + 5)))))->Color::Color(); - *GHIDRA_CAST((extraout_EDX_09 + 0x44)) = 0; - pfVar19 = GHIDRA_CAST((extraout_EDX_09 + 0x54)); - pfVar24 = GHIDRA_CAST((GHIDRA_INT(pfVar24) + -1)); - } while (pfVar24 != GHIDRA_CAST(0x0)); - } - pfVar19 = pfVar26 + 5; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x15; - pfStack_26658 = GHIDRA_CAST((GHIDRA_INT(pfStack_266a4) - GHIDRA_INT(pfVar26))); - pfVar26 = pfStack_266a4 + 2; - pfVar25 = pfStack_26650; - do { - pfVar19[-5] = pfVar26[-2]; - pfVar19[-4] = pfVar26[-1]; - pfVar19[-3] = *pfVar26; - *GHIDRA_CAST((pfVar19 + -2)) = *GHIDRA_CAST((pfVar26 + 1)); - pfVar19[-1] = pfVar26[2]; - *pfVar19 = *GHIDRA_CAST((GHIDRA_CAST(pfStack_26658) + GHIDRA_INT(pfVar19))); - (GHIDRA_CAST((GHIDRA_CAST((pfVar19 + 1)))))->Color::operator_assign(GHIDRA_CAST((pfVar26 + 4))); - pfVar19 = GHIDRA_CAST((extraout_EDX_10 + 0x54)); - *GHIDRA_CAST((extraout_EDX_10 + 0x30)) = pfVar26[0xf]; - *GHIDRA_CAST((extraout_EDX_10 + 0x34)) = *GHIDRA_CAST((pfVar26 + 0x10)); - *GHIDRA_CAST((extraout_EDX_10 + 0x38)) = pfVar26[0x11]; - *GHIDRA_CAST((extraout_EDX_10 + 0x3c)) = pfVar26[0x12]; - pfVar25 = GHIDRA_CAST((GHIDRA_INT(pfVar25) + -1)); - pfVar26 = pfVar26 + 0x15; - } while (pfVar25 != GHIDRA_CAST(0x0)); - *GHIDRA_CAST((GHIDRA_CAST((local_6ac + 1)) + GHIDRA_INT(pfStack_266a0))) = pfStack_2664c; - pfVar26 = pfStack_26650; - } - } - pfVar19 = pfStack_2668c; - *GHIDRA_CAST((GHIDRA_CAST((local_6ac + 2)) + GHIDRA_INT(pfStack_266a0))) = pfVar26; - pfStack_26654 = GHIDRA_CAST(pfStack_26654[0xb]); - } while (pfStack_26654 != GHIDRA_CAST(0x0)); - if (pfStack_2668c != GHIDRA_CAST(0x0)) { - pfStack_2664c = pfStack_2668c; - pfStack_26654 = GHIDRA_CAST(0x0); - uVar14 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfStack_2668c) * 0x10 >> 0x20)) != 0)) | - GHIDRA_UINT((ZEXT48(pfStack_2668c) * 0x10)); - pfStack_266c0 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar14)) | uVar14 + 4); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x17; - if (pfStack_266c0 == GHIDRA_CAST(0x0)) { - pfVar26 = GHIDRA_CAST(0x0); - pfStack_26654 = GHIDRA_CAST(0x0); - } - else { - pfVar26 = pfStack_266c0 + 1; - *pfStack_266c0 = (float)pfVar19; - pfStack_26654 = pfVar26; - _eh_vector_constructor_iterator_ - (pfVar26,0x10,GHIDRA_UINT(pfVar19),GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040c210), - guard_check_icall); - } - pfVar25 = &nullAnimations; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x15; - pfStack_2664c = GHIDRA_CAST((GHIDRA_INT(pfVar25) + -GHIDRA_INT(pfVar26))); - pfStack_26658 = GHIDRA_CAST((GHIDRA_INT(local_6ac) + -GHIDRA_INT(pfVar26))); - pfStack_26688 = GHIDRA_CAST((GHIDRA_INT(local_6ac) + -GHIDRA_INT(pfVar26) + 4)); - pfVar21 = pfVar26 + 1; - do { - rootScaleY = *pfVar25; - pfVar25 = pfVar25 + 4; - pfVar21[-1] = rootScaleY; - pfVar24 = pfVar21 + 4; - *GHIDRA_CAST(pfVar21) = (auStack_aa4 + -GHIDRA_INT(pfVar26) + 0x3e4)[GHIDRA_INT(pfVar24)]; - pfVar21[1] = *GHIDRA_CAST((auStack_aa4 + -GHIDRA_INT(pfVar26) + 1000 + GHIDRA_INT(pfVar24))); - pfVar21[2] = *GHIDRA_CAST((auStack_aa4 + -GHIDRA_INT(pfVar26) + 0x3ec + GHIDRA_INT(pfVar24))); - pfVar19 = GHIDRA_CAST((GHIDRA_INT(pfVar19) + -1)); - pfVar21 = pfVar24; - } while (pfVar19 != GHIDRA_CAST(0x0)); - *GHIDRA_CAST((curAnimation[1]._buf + 8)) = pfStack_26654; - goto LAB_00413466; - } - } - *GHIDRA_CAST((curAnimation[1]._buf + 0xc)) = pfStack_2668c; - uStack_26690 = 0; - keyName = "Triggers"; - do { - pcVar22 = keyName; - keyName = pcVar22 + 1; - } while (*keyName != '\0'); - pfStack_26654 = GHIDRA_CAST((pcVar22 + -0xb1b5ff)); - for (puVar15 = GHIDRA_CAST(pfStack_26684[6]); puVar15 != GHIDRA_CAST(0x0); - puVar15 = GHIDRA_CAST(puVar15[0xb])) { - pbVar18 = GHIDRA_CAST(*puVar15); - if (pbVar18 == GHIDRA_CAST(0x0)) { - pfVar26 = GHIDRA_CAST(0x0); - pbVar18 = &g_xmlNullStr; - } - else { - pfVar26 = GHIDRA_CAST(puVar15[2]); - } - if (pfVar26 == pfStack_26654) { - pbVar13 = GHIDRA_CAST((GHIDRA_INT(pfVar26) + GHIDRA_INT(pbVar18))); - if (pbVar13 <= pbVar18) goto LAB_004134e1; - iVar11 = GHIDRA_INT("Triggers") - GHIDRA_INT(pbVar18); - while (*pbVar18 == pbVar18[iVar11]) { - pbVar18 = pbVar18 + 1; - if (pbVar13 <= pbVar18) goto LAB_004134e1; - } - } - } - puVar15 = GHIDRA_CAST(0x0); -LAB_004134e1: - pfStack_2664c = GHIDRA_CAST(puVar15[6]); - if (pfStack_2664c != GHIDRA_CAST(0x0)) { - pfVar26 = local_28b0; - do { - pfVar19 = pfStack_2664c; - if (0x7f < uStack_26690) { - (GHIDRA_CAST((filePath->_buf)))->msvc::string::c_str(); - KAGE_LogMessage(0x10,GHIDRA_CAST("%s: too many triggers\n")); - } - puVar15 = GHIDRA_CAST(pfVar19[8]); - uStack_26690 = uStack_26690 + 1; - pfStack_26658 = pfVar26 + 2; - pfStack_26654 = pfVar26; - if (puVar15 != GHIDRA_CAST(0x0)) { - do { - pbVar18 = GHIDRA_CAST(*puVar15); - keyName = "EventId"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_00413581: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00413586; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_00413581; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_00413586: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - rootScaleY = (float)atoi(GHIDRA_CAST(pbVar18)); - *pfStack_26654 = rootScaleY; - } - else { - keyName = "AtFrame"; - pbVar13 = &g_xmlNullStr; - if (pbVar18 != GHIDRA_CAST(0x0)) { - pbVar13 = pbVar18; - } - do { - bVar8 = *pbVar13; - isLess = bVar8 < (uint8_t)*keyName; - if (bVar8 != *keyName) { -LAB_004135d7: - uVar14 = -GHIDRA_UINT(isLess) | 1; - goto LAB_004135dc; - } - if (bVar8 == 0) break; - bVar8 = pbVar13[1]; - isLess = bVar8 < (uint8_t)keyName[1]; - if (bVar8 != keyName[1]) goto LAB_004135d7; - pbVar13 = pbVar13 + 2; - keyName = keyName + 2; - } while (bVar8 != 0); - uVar14 = 0; -LAB_004135dc: - if (uVar14 == 0) { - pbVar18 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar15[1]) != GHIDRA_CAST(0x0)) { - pbVar18 = GHIDRA_CAST(puVar15[1]); - } - rootScaleY = (float)atoi(GHIDRA_CAST(pbVar18)); - pfStack_26654[1] = rootScaleY; - } - } - } while ((puVar15[4] != 0) && - (puVar15 = GHIDRA_CAST(puVar15[6]), puVar15 != GHIDRA_CAST(0x0))); - } - pfStack_2664c = GHIDRA_CAST(pfStack_2664c[0xb]); - pfVar26 = pfStack_26658; - } while (pfStack_2664c != GHIDRA_CAST(0x0)); - if (uStack_26690 != 0) { - pfStack_26654 = - operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT(((uint64_t)uStack_26690 * 8 >> 0x20)) != 0)) | - GHIDRA_UINT(((uint64_t)uStack_26690 * 8))); - uVar14 = uStack_26690; - pfVar26 = pfStack_26654; - do { - rootScaleY = *GHIDRA_CAST((GHIDRA_CAST(auStack_16378) + -GHIDRA_INT(pfStack_26654) + 0x13ac4 + - GHIDRA_INT((pfVar26 + 2)))); - *pfVar26 = *GHIDRA_CAST((GHIDRA_CAST(local_28b0) + -GHIDRA_INT(pfStack_26654) + GHIDRA_INT(pfVar26))); - pfVar26[1] = rootScaleY; - uVar14 = uVar14 - 1; - pfVar26 = pfVar26 + 2; - } while (uVar14 != 0); - curAnimation[1]._size = GHIDRA_UINT(pfStack_26654); - } - } - curAnimation[1]._capacity = uStack_26690; - pfVar26 = GHIDRA_CAST(pfStack_26684[0xb]); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x12; - pfStack_26684 = pfVar26; - _eh_vector_destructor_iterator_(&nullAnimations,0x10,0x40,guard_check_icall); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x11; - _eh_vector_destructor_iterator_(layerAnimations,0x10,0x40,guard_check_icall); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 10; - (GHIDRA_CAST((animName._buf)))->msvc::string::_Tidy_deallocate(); - pfVar19 = animIndex; - } - pfStack_26654 = GHIDRA_CAST(0x0); - uVar14 = -GHIDRA_UINT((GHIDRA_INT((ZEXT48(pfVar19) * 0x13c >> 0x20)) != 0)) | GHIDRA_UINT((ZEXT48(pfVar19) * 0x13c)); - pfStack_266c0 = pfVar19; - puStack_266c4 = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar14)) | uVar14 + 4); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x18; - if (puStack_266c4 == GHIDRA_CAST(0x0)) { - pfStack_2664c = GHIDRA_CAST(0x0); - } - else { - *puStack_266c4 = pfVar19; - pfStack_2664c = GHIDRA_CAST((puStack_266c4 + 1)); - _eh_vector_constructor_iterator_ - (pfStack_2664c,0x13c,GHIDRA_UINT(pfVar19),GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040bec0), - msvc::string::_Tidy_deallocate); - } - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 10; - if (pfVar19 != GHIDRA_CAST(0x0)) { - pfStack_266a0 = GHIDRA_CAST((animations + -GHIDRA_INT(pfStack_2664c))); - pfStack_26658 = pfStack_2664c + 0xc; - pfStack_2667c = GHIDRA_CAST((animations + (4 - GHIDRA_INT(pfStack_2664c)))); - pfStack_26654 = afStack_16494; - iVar11 = GHIDRA_INT(afStack_267d0) + (-0x38 - GHIDRA_INT(pfStack_2664c)); - pfStack_2668c = GHIDRA_CAST((GHIDRA_INT(afStack_163a8) - GHIDRA_INT(pfStack_2664c))); - pfStack_26688 = animIndex; - do { - pfVar19 = pfStack_26658; - (GHIDRA_CAST((GHIDRA_CAST(&tmpAnimation))))->msvc::string::string(pfStack_26654 + -7); - pfVar26 = GHIDRA_CAST(pfStack_26654[-1]); - rootScaleY = *pfStack_26654; - rootPosY = pfStack_26654[1]; - rootScaleY = pfStack_26654[2]; - rootPosY = pfStack_26654[3]; - fVar4 = pfStack_26654[4]; - fVar23 = 0.0; - fStack_267d8 = *GHIDRA_CAST((GHIDRA_CAST(pfStack_266a0) + GHIDRA_INT(pfVar19))); - uStack_267d4 = *GHIDRA_CAST((GHIDRA_CAST(pfStack_2667c) + GHIDRA_INT(pfVar19))); - fStack_266d0 = *GHIDRA_CAST((GHIDRA_CAST(pfStack_2668c) + GHIDRA_INT(pfVar19))); - pfStack_26684 = pfVar26; - if (rootScaleY != 0.0) { - iVar20 = 0; - do { - piVar9 = GHIDRA_CAST((iVar20 + GHIDRA_INT(pfVar26))); - iVar20 = iVar20 + 0x10; - afStack_267d0[*piVar9] = fVar23; - fVar23 = (float)(GHIDRA_INT(fVar23) + 1); - } while (GHIDRA_UINT(fVar23) < GHIDRA_UINT(rootScaleY)); - } - fVar23 = pfVar19[-0xc]; - fVar5 = pfVar19[-0xb]; - fVar6 = pfVar19[-10]; - fVar7 = pfVar19[-9]; - pfVar25 = pfVar19 + 2; - uVar1 = *GHIDRA_CAST((pfVar19 + -8)); - pfVar19[-0xc] = tmpAnimation; - pfVar19[-0xb] = fStack_26804; - pfVar19[-10] = fStack_26800; - pfVar19[-9] = fStack_267fc; - *GHIDRA_CAST((pfVar19 + -8)) = uStack_267f8; - tmpAnimation = fVar23; - fStack_26804 = fVar5; - fStack_26800 = fVar6; - fStack_267fc = fVar7; - uStack_267f8 = uVar1; - fStack_267f0 = pfVar19[-6]; - pfVar19[-6] = (float)pfVar26; - fStack_267ec = pfVar19[-5]; - pfVar19[-5] = rootScaleY; - fStack_267e8 = pfVar19[-4]; - pfVar19[-4] = rootPosY; - fStack_267e4 = pfVar19[-3]; - pfVar19[-3] = rootScaleY; - fStack_267e0 = pfVar19[-2]; - pfVar19[-2] = rootPosY; - fStack_267dc = pfVar19[-1]; - pfVar19[-1] = fVar4; - if (pfVar25 != afStack_267d0) { - pfVar26 = pfVar19 + 0x42; - pfStack_26684 = pfVar26; - if (pfVar25 != pfVar26) { - do { - rootScaleY = *pfVar25; - *pfVar25 = *GHIDRA_CAST((GHIDRA_CAST(pfVar25) + iVar11)); - *GHIDRA_CAST((GHIDRA_CAST(pfVar25) + iVar11)) = rootScaleY; - pfVar25 = pfVar25 + 1; - } while (pfVar25 != pfVar26); - pfVar19 = pfStack_26658; - } - } - rootScaleY = *pfVar19; - *pfVar19 = fStack_267d8; - parsedBool = *GHIDRA_CAST((pfVar19 + 1)); - *GHIDRA_CAST((pfVar19 + 1)) = uStack_267d4; - rootPosY = pfVar19[0x42]; - pfVar19[0x42] = fStack_266d0; - fStack_267d8 = rootScaleY; - uStack_267d4 = parsedBool; - fStack_266d0 = rootPosY; - (GHIDRA_CAST((GHIDRA_CAST(&tmpAnimation))))->msvc::string::_Tidy_deallocate(); - pfStack_26658 = pfVar19 + 0x4f; - pfStack_26654 = pfStack_26654 + 0x4f; - iVar11 = iVar11 + -0x13c; - pfStack_26688 = GHIDRA_CAST((GHIDRA_INT(pfStack_26688) + -1)); - } while (pfStack_26688 != GHIDRA_CAST(0x0)); - pfStack_26688 = GHIDRA_CAST(0x0); - pfVar19 = animIndex; - } - *GHIDRA_CAST((anmFile + 0xc)) = pfStack_2664c; - *GHIDRA_CAST((anmFile + 0x10)) = pfVar19; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x19; - tracked_alloc(1,rootFrames,0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1a; - tracked_alloc(1,pfStack_26678,0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1b; - tracked_alloc(1,pvStack_266ac,0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1c; - tracked_alloc(1,pfStack_266a4,0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1d; - tracked_alloc(1,pfStack_26680,0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1e; - tracked_alloc(1,pfStack_2669c,0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 8; - _eh_vector_destructor_iterator_(animations,0x13c,0x100,msvc::string::_Tidy_deallocate); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - _eh_vector_destructor_iterator_(eventNames,0x18,0x10,msvc::string::_Tidy_deallocate); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; - _eh_vector_destructor_iterator_(nullNames,0x18,0x40,msvc::string::_Tidy_deallocate); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; - _eh_vector_destructor_iterator_(local_24b0,0x38,0x40,LayerData::~LayerData); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; - _eh_vector_destructor_iterator_(spritesheetPaths,0x18,0x40,msvc::string::_Tidy_deallocate); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1f; - (GHIDRA_CAST((auStack_26618)))->xml_memory_pool::clear(); - local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),0x20); - tracked_alloc(1,fileBuffer,0); -LAB_00413b0f: - (GHIDRA_CAST((redirectedPath._buf)))->msvc::string::_Tidy_deallocate(); - ExceptionList = local_1c; - return; -} - -// 00414500 -int AnmCache::entry_get(uint32_t param_1) -{ - int *piVar1; - uint8_t local_10 [12]; - - piVar1 = GHIDRA_CAST(std)::map::_Try_emplace(local_10,param_1); - return *piVar1 + 0x14; -} - -// 00416490 -int * AnmCache::lower_bound_find(int *param_1, uint32_t *param_2) -{ - uint32_t uVar1; - uint32_t uVar2; - void *pvVar3; - uint32_t *puVar4; - - pvVar3 = g_anmCacheMap; - puVar4 = *GHIDRA_CAST((GHIDRA_CAST(g_anmCacheMap) + 4)); - *param_1 = GHIDRA_INT(puVar4); - param_1[1] = 0; - param_1[2] = GHIDRA_INT(pvVar3); - if (*GHIDRA_CAST((GHIDRA_CAST(puVar4) + 0xd)) == '\0') { - uVar1 = *param_2; - do { - *param_1 = GHIDRA_INT(puVar4); - uVar2 = puVar4[4]; - if (uVar1 <= uVar2) { - param_1[2] = GHIDRA_INT(puVar4); - puVar4 = GHIDRA_CAST(*puVar4); - } - else { - puVar4 = GHIDRA_CAST(puVar4[2]); - } - param_1[1] = GHIDRA_UINT((uVar1 <= uVar2)); - } while (*GHIDRA_CAST((GHIDRA_CAST(puVar4) + 0xd)) == '\0'); - } - return param_1; -} diff --git a/generated-src/backdrop.cpp b/generated-src/backdrop.cpp index c5f58cd..44d281f 100644 --- a/generated-src/backdrop.cpp +++ b/generated-src/backdrop.cpp @@ -52,7 +52,7 @@ void Backdrop::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x11])) + 0x1)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x12])) + 0x2)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 6; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((this + 0x14))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 7; _eh_vector_constructor_iterator_ (&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x71])) + 0x1))),0x13c,0x3f,BackdropConfig::constructor, @@ -65,11 +65,11 @@ void Backdrop::constructor() *GHIDRA_CAST((this + 0x1a64)) = 0x900000005; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a62])) + 0x2)))) = 0xaa17414f; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a66])) + 0x2)))) = 7; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 9; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 10; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xb; (GHIDRA_CAST((&clearColorValue)))->KColor::SetFromARGB(0); renderTarget = KAGE_Graphics::create_render_target @@ -154,29 +154,29 @@ void Backdrop::destructor() KAGE::SmartPointer::reset(extraout_ECX_00); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xe])) + 0x2))))))->KAGE::SmartPointer::reset((void *)0x0); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x1b3c)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b31])) + 0x1)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0x1b3c))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b31])) + 0x1))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b29])) + 0x1))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1))))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x1ae0)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ad5])) + 0x1)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0x1ae0))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ad5])) + 0x1))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1acd])) + 0x1))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1))))))->msvc::string::_Tidy_deallocate(); local_8 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x1a84)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a79])) + 0x1)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0x1a84))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a79])) + 0x1))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a71])) + 0x1))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1))))))->msvc::string::_Tidy_deallocate(); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x71])) + 0x1))),0x13c,0x3f,BackdropConfig::~BackdropConfig); local_8 = 3; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2e])) + 0x2)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x24)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((this + 0x14))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2e])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0x24))); (GHIDRA_CAST((GHIDRA_CAST((this + 0x1c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->msvc::string::_Tidy_deallocate(); local_8 = 4; @@ -2058,7 +2058,7 @@ void Backdrop::PreRenderControls() playerType = *GHIDRA_CAST((glyphCount + 0x13c0)); } if (playerType < 0x29) { - isAnimChanged = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Controls"),1); + isAnimChanged = ANM2::SetAnimation(sprite,GHIDRA_CAST("Controls"),1); if ((isAnimChanged != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ad6])) + 0x2)))) != 0)) { frame = (float)playerType; goto LAB_0093493f; @@ -2076,9 +2076,9 @@ void Backdrop::PreRenderControls() if (0xf < anim->_capacity) { anim = *GHIDRA_CAST(anim->_buf); } - isAnimChanged = (GHIDRA_CAST((this_00)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + isAnimChanged = ANM2::SetAnimation(this_00,GHIDRA_CAST(anim),1); if (((isAnimChanged != 0) && ((this_00->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&this_00->_animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&this_00->_animState,0.0), (this_00->_animState)._animData != (void *)0x0)) { (this_00->_animState)._isPlaying = 0; } @@ -2107,12 +2107,12 @@ LAB_009348c4: } } sprite = &(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1))); - isAnimChanged = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Controls"),1); + isAnimChanged = ANM2::SetAnimation(sprite,GHIDRA_CAST("Controls"),1); if ((isAnimChanged != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ad6])) + 0x2)))) != 0)) { frame = 0.0; LAB_0093493f: sprite = &(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1))); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ad5])) + 0x1)))))))->AnimationState::SetFrameFloat(frame); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ad5])) + 0x1)))),frame); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ad6])) + 0x2)))) != 0) { *GHIDRA_CAST((this + 0x1adc)) = 0; } @@ -2177,9 +2177,9 @@ LAB_00934952: if (g_manager->_netplayManager == *GHIDRA_CAST((g_manager + 1))) { LAB_00934aa5: if (controllerIndex == 0) { - isAnimChanged = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))))))->ANM2::SetAnimation(GHIDRA_CAST("Keyboard"),1); + isAnimChanged = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))),GHIDRA_CAST("Keyboard"),1); if (((isAnimChanged != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b32])) + 0x2)))) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b31])) + 0x1)))))))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b31])) + 0x1)))),0.0), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b32])) + 0x2)))) != 0)) { *GHIDRA_CAST((this + 0x1b38)) = 0; } @@ -2221,9 +2221,9 @@ LAB_00934aa5: ExceptionList = local_1c; return; } - isAnimChanged = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))))))->ANM2::SetAnimation(&DAT_00b7b76c,1); + isAnimChanged = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))),&DAT_00b7b76c,1); if (((isAnimChanged != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b32])) + 0x2)))) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b31])) + 0x1)))))))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b31])) + 0x1)))),0.0), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b32])) + 0x2)))) != 0)) { *GHIDRA_CAST((this + 0x1b38)) = 0; } @@ -2251,7 +2251,7 @@ LAB_00934be2: do { uVar4 = rowOffset; if (*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x34)) != 0) { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(sprite) + 0x30)))))->AnimationState::GetNullFrameById(row); + nullFrame = AnimationState::GetNullFrameById(GHIDRA_CAST((GHIDRA_INT(sprite) + 0x30)),row); if ((nullFrame != GHIDRA_CAST(0x0)) && (*GHIDRA_CAST((nullFrame + 3)) != '\0')) { framesBegin = (void *)0x0; framesEnd = 0; @@ -4325,8 +4325,8 @@ void Backdrop::load_details() stackCookie = __security_cookie ^ GHIDRA_UINT((imageRef + 100)); ExceptionList = &local_1c; (*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x2))) = 0; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((this + 0x14))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1))))); if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b1d])) + 0x2))) == '\0') { tmpString._size = 0; tmpString._capacity = 0xf; @@ -4339,7 +4339,7 @@ void Backdrop::load_details() tmpString._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/backdrop/controls.anm2",0x1b); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1)))))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ac5])) + 0x1)))),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4367,7 +4367,7 @@ void Backdrop::load_details() tmpString._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/backdrop/controls_buttons.anm2",0x23); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b21])) + 0x1)))),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4410,7 +4410,7 @@ void Backdrop::load_details() } while (strChar != 0); (GHIDRA_CAST((tmpString._buf)))->msvc::string::assign(pbVar3,GHIDRA_INT(pbVar4) - GHIDRA_INT((pbVar3 + 1))); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST((this + 0x14)),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4466,9 +4466,9 @@ void Backdrop::load_details() g_graphicsManager_blendMode[2] = iVar2; if (pbVar3 == GHIDRA_CAST(0x0)) { LAB_0093e5fc: - strChar = (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::SetAnimation(s_Idle2,1); + strChar = ANM2::SetAnimation(GHIDRA_CAST((this + 0x14)),s_Idle2,1); if (strChar != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x24)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x24))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) = 1; } } @@ -4501,7 +4501,7 @@ LAB_0093e5e9: g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; local_80.y = DAT_00c35e74 + *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a5e])) + 0x2)))); local_80.x = DAT_00c35e70 + *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a5d])) + 0x1)))); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Render(&local_80,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((this + 0x14)),&local_80,&g_vectorZero,&g_vectorZero); g_graphicsManager_flags = g_graphicsManager_flags | 2; (*GHIDRA_CAST((GHIDRA_CAST(&(g_graphicsManager_blendMode[0])) + 0x0))) = tmpString._buf[4]; (*GHIDRA_CAST((GHIDRA_CAST(&(g_graphicsManager_blendMode[0])) + 0x1))) = tmpString._buf[5]; @@ -4545,9 +4545,9 @@ LAB_0093e6e7: if ((uVar6 == 0) && ((pbVar3[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) != '\0')))) goto LAB_0093e713; } - strChar = (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::SetAnimation(&DAT_00b601c4,1); + strChar = ANM2::SetAnimation(GHIDRA_CAST((this + 0x14)),&DAT_00b601c4,1); if (strChar != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x24)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x24))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) = 1; } goto LAB_0093e713; @@ -4559,7 +4559,7 @@ LAB_0093e6e7: } (GHIDRA_CAST((tmpString._buf)))->msvc::string::string_from_cstr(pbVar3); local_14 = 3; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST((this + 0x14)),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4574,9 +4574,9 @@ LAB_0093e6e7: } operator_delete(freeBlock,uVar6); } - strChar = (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::SetAnimation(s_Idle,1); + strChar = ANM2::SetAnimation(GHIDRA_CAST((this + 0x14)),s_Idle,1); if (((strChar != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x25])) + 0x1)))) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST((this + 0x24)))))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(GHIDRA_CAST((this + 0x24)),0.0), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x25])) + 0x1)))) != 0)) { (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x2))) = 0; } @@ -4592,7 +4592,7 @@ LAB_0093e6e7: do { pbVar4 = pbVar3 + 1; isLayerVisible = pbVar4 == local_70; - layer = (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::GetLayer(pbVar3); + layer = ANM2::GetLayer(GHIDRA_CAST((this + 0x14)),pbVar3); layer->_visible = isLayerVisible; pbVar3 = pbVar4; } while (pbVar4 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x3e])) + 0x2))))); @@ -4606,7 +4606,7 @@ LAB_0093e6e7: } (GHIDRA_CAST((tmpString._buf)))->msvc::string::string_from_cstr(pbVar3); local_14 = 4; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST((this + 0x14)),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4624,7 +4624,7 @@ LAB_0093e6e7: (*GHIDRA_CAST((GHIDRA_CAST(&(tmpString._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(tmpString._buf)) + 0x0))) & 0xffffff00; iVar7 = *GHIDRA_CAST((*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 4)) + 0x10)) + 0x10)) + -10; LAB_0093ddb8: - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::SetFrame(GHIDRA_CAST(s_Idle),iVar7); + ANM2::SetFrame(GHIDRA_CAST((this + 0x14)),GHIDRA_CAST(s_Idle),iVar7); g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffffd; render_ashpit_ash(); g_graphicsManager_flags = g_graphicsManager_flags | 2; @@ -4637,7 +4637,7 @@ LAB_0093ddb8: } (GHIDRA_CAST((tmpString._buf)))->msvc::string::string_from_cstr(pbVar3); local_14 = 5; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST((this + 0x14)),&tmpString,1); local_14 = 0xffffffff; if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4725,7 +4725,7 @@ LAB_0093df32: tmpString._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/backdrop/01x_downpour_pipes.anm2",0x25); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xb; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))),&tmpString,1); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),6); if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4796,7 +4796,7 @@ LAB_0093e065: (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xc; } tmpString._capacity = 0x2f; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))),&tmpString,1); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),6); if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4842,7 +4842,7 @@ LAB_0093e16c: case 0x2a: (GHIDRA_CAST((tmpString._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/backdrop/05x_mausoleum_chains.anm2")); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),0x10); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))),&tmpString,1); detailsPath = &tmpString; goto LAB_0093e391; case 0x2e: @@ -4850,7 +4850,7 @@ LAB_0093e16c: if (((*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(game->_room) + 4)) + 0x44)) >> 9 & 1) == 0) && (iVar7 != 0x3b)) { (GHIDRA_CAST((tmpString._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/backdrop/04x_ashpit_details.anm2")); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xf; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))),&tmpString,1); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),6); (GHIDRA_CAST((tmpString._buf)))->msvc::string::_Tidy_deallocate(); } @@ -4867,7 +4867,7 @@ LAB_0093e16c: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/backdrop/04x_ashpit_details_dark.anm2",0x2a) ; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xe; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))),&tmpString,1); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),6); if (0xf < tmpString._capacity) { uVar6 = tmpString._capacity + 1; @@ -4885,7 +4885,7 @@ LAB_0093e16c: case 0x2f: (GHIDRA_CAST((gehennaPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/backdrop/06x_gehenna_details.anm2")); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),0x11); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::Load(&gehennaPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))),&gehennaPath,1); detailsPath = &gehennaPath; LAB_0093e391: local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),6); @@ -4894,9 +4894,9 @@ LAB_0093e3a0: (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->Sprite::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a71])) + 0x1)))),0); goto switchD_0093df66_caseD_21; } - strChar = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))))))->ANM2::SetAnimation(local_70,1); + strChar = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a69])) + 0x1)))),local_70,1); if (strChar != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a79])) + 0x1)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a79])) + 0x1))))); *GHIDRA_CAST((this + 0x1a80)) = 1; } switchD_0093df66_caseD_21: @@ -5124,7 +5124,7 @@ void Backdrop::RenderFloor(Vector *param_1, ColorMod param_2) if (backdropType != 0x12) { if (backdropType == 0x23) { DAT_00c33910 = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xf)))))->ANM2::Render(param_1,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((in_ECX + 0xf)),param_1,&g_vectorZero,&g_vectorZero); DAT_00c33910 = 1; unused = extraout_ECX_02; } @@ -5207,7 +5207,7 @@ LAB_0093eca7: } local_134.x = param_1->x + (float)in_ECX[0x13c6] + DAT_00c35e70; local_134.y = param_1->y + (float)in_ECX[0x13c7] + DAT_00c35e74; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xf)))))->ANM2::Render(&local_134,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((in_ECX + 0xf)),&local_134,&g_vectorZero,&g_vectorZero); unused = extraout_ECX_01; } DAT_00c33910 = 1; @@ -5427,7 +5427,7 @@ void Backdrop::RenderWalls(Vector *renderOffset, ColorMod color) } if (iVar3 == 0x23) { DAT_00c33910 = 0; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x14)))))->ANM2::Render(renderOffset,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((this + 0x14)),renderOffset,&g_vectorZero,&g_vectorZero); DAT_00c33910 = 1; return; } diff --git a/generated-src/beam_renderer.cpp b/generated-src/beam_renderer.cpp index aa6d84c..b43b005 100644 --- a/generated-src/beam_renderer.cpp +++ b/generated-src/beam_renderer.cpp @@ -187,8 +187,8 @@ void BeamRenderer::End() local_1c = ExceptionList; stackCookie = __security_cookie ^ GHIDRA_UINT((coloredQuad + 0x88)); ExceptionList = &local_1c; - layer = (GHIDRA_CAST((DAT_00c78ef0)))->ANM2::GetLayer(DAT_00c78ef4); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(&texture); + layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); + LayerState::GetTexture(layer,&texture); local_14 = 0; if ((texture != GHIDRA_CAST(0x0)) && (1 < GHIDRA_UINT(((GHIDRA_INT(g_beamRendererPointsEnd) - GHIDRA_INT(g_beamRendererPoints)) / 0x44)))) { @@ -198,7 +198,7 @@ void BeamRenderer::End() else { animState = &DAT_00c78ef0->_overlayAnimState; } - pfVar2 = (GHIDRA_CAST((animState)))->AnimationState::GetLayerFrame(GHIDRA_INT(DAT_00c78ef4)); + pfVar2 = AnimationState::GetLayerFrame(animState,GHIDRA_INT(DAT_00c78ef4)); layerFrame = pfVar2; if (pfVar2 != GHIDRA_CAST(0x0)) { iVar4 = *GHIDRA_CAST(ThreadLocalStoragePointer); @@ -212,7 +212,7 @@ void BeamRenderer::End() } DAT_00c7f6d8 = DAT_00c7f6d4; DAT_00c7f6e8 = DAT_00c7f6e4; - layer = (GHIDRA_CAST((DAT_00c78ef0)))->ANM2::GetLayer(DAT_00c78ef4); + layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); isPerVertexColor = '\0'; layerFlipX = layer->_flipX; spriteFlipX = DAT_00c78ef0->_flipX; @@ -375,14 +375,14 @@ LAB_0041ef71: iVar4 = (GHIDRA_INT(DAT_00c7f6d8) - GHIDRA_INT(DAT_00c7f6d4)) / 0x24; local_168.y = (float)g_graphicsManager_blendMode[4]; local_b4 = (float)iVar4; - layer = (GHIDRA_CAST((DAT_00c78ef0)))->ANM2::GetLayer(DAT_00c78ef4); + layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); g_graphicsManager_blendMode[0] = layer->_blendMode[0]; g_graphicsManager_blendMode[1] = layer->_blendMode[1]; g_graphicsManager_blendMode[2] = layer->_blendMode[2]; g_graphicsManager_blendMode[3] = layer->_blendMode[3]; g_graphicsManager_blendMode[4] = layer->_blendMode[4]; local_a0 = GHIDRA_CAST(GHIDRA_UINT((isPerVertexColor != '\0'))); - layer = (GHIDRA_CAST((DAT_00c78ef0)))->ANM2::GetLayer(DAT_00c78ef4); + layer = ANM2::GetLayer(DAT_00c78ef0,DAT_00c78ef4); if (((DAT_00c78ef0->_bitflags | layer->_bitflags) & 0x20U) != 0) { if (isPerVertexColor != '\0') { KAGE_LogMessage(8,(uint8_t *) diff --git a/generated-src/beast_arena.cpp b/generated-src/beast_arena.cpp index 130c705..f15d07e 100644 --- a/generated-src/beast_arena.cpp +++ b/generated-src/beast_arena.cpp @@ -53,7 +53,7 @@ void BeastArena::init() anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/backdrop/hell/background.anm2",0x22); uStack_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::Load(&anm2Path,0); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 4)),&anm2Path,0); uStack_14 = 0xffffffff; bVar1 = extraout_CL; if (0xf < anm2Path._capacity) { @@ -71,15 +71,15 @@ void BeastArena::init() bVar1 = extraout_CL_00; } *GHIDRA_CAST((GHIDRA_CAST(this) + 0x114)) = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x114)) | 0x200; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(GHIDRA_CAST((GHIDRA_INT(this) + 4)),bVar1); pbVar4 = GHIDRA_CAST((GHIDRA_INT(this) + 0x1c)); if (0xf < *GHIDRA_CAST((GHIDRA_CAST(this) + 0x30))) { pbVar4 = *GHIDRA_CAST(pbVar4); } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::SetAnimation(pbVar4,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 4)),pbVar4,1); iVar2 = iStack_20; if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x34)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x34))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x48)) = 1; iVar2 = iStack_20; } @@ -88,63 +88,63 @@ void BeastArena::init() pbVar4 = GHIDRA_CAST(0x0); if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x84)) != 0) { do { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::GetLayer(pbVar4); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 4)),pbVar4); pbVar4 = pbVar4 + 1; layer->_wrapSMode = 0; layer->_wrapTMode = 1; } while (pbVar4 < *GHIDRA_CAST((GHIDRA_CAST(this) + 0x84))); } pAVar5 = GHIDRA_CAST((GHIDRA_INT(this) + 4)); - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(pAVar5,GHIDRA_CAST(0x0)); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(pAVar5,GHIDRA_CAST(0x1)); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(pAVar5,GHIDRA_CAST(0x2)); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(pAVar5,GHIDRA_CAST(0x3)); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(pAVar5,&DAT_00000004); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(pAVar5,&DAT_00000005); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(&DAT_00000006); + layer = ANM2::GetLayer(pAVar5,&DAT_00000006); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(&DAT_00000007); + layer = ANM2::GetLayer(pAVar5,&DAT_00000007); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; uVar3 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(&DAT_00000008); + layer = ANM2::GetLayer(pAVar5,&DAT_00000008); layer13SrcBlend = 1; iVar2 = 1; if ((uVar3 & 4) == 0) { @@ -156,32 +156,32 @@ void BeastArena::init() layer->_blendMode[3] = 1; layer->_blendMode[4] = 7; pAVar5 = GHIDRA_CAST((GHIDRA_INT(this) + 4)); - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(&DAT_00000009); + layer = ANM2::GetLayer(pAVar5,&DAT_00000009); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(GHIDRA_CAST(0xa)); + layer = ANM2::GetLayer(pAVar5,GHIDRA_CAST(0xa)); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(&DAT_0000000b); + layer = ANM2::GetLayer(pAVar5,&DAT_0000000b); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; - layer = (GHIDRA_CAST((pAVar5)))->ANM2::GetLayer(GHIDRA_CAST(0xc)); + layer = ANM2::GetLayer(pAVar5,GHIDRA_CAST(0xc)); layer->_blendMode[0] = 0; layer->_blendMode[1] = 1; layer->_blendMode[2] = 0; layer->_blendMode[3] = 1; layer->_blendMode[4] = 0; uVar3 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 4)),&DAT_0000000d); if ((uVar3 & 4) == 0) { layer13SrcBlend = 6; } @@ -190,7 +190,7 @@ void BeastArena::init() layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 4)),&DAT_0000000e); layer->_blendMode[0] = 0; layer->_blendMode[1] = 0; layer->_blendMode[2] = 2; @@ -215,8 +215,8 @@ void BeastArena::update() if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x118)) != '\0') { if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x10d)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x34)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x54)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(this) + 0x34))); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(this) + 0x54))); } i = 0; shiftX = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x120)) + *GHIDRA_CAST((GHIDRA_CAST(this) + 0x124)); @@ -296,8 +296,8 @@ void BeastArena::render_light() sourcePos.y = (((*GHIDRA_CAST((room + 0x6aec)) - *GHIDRA_CAST((room + 0x6ae4))) + 52.0) - 270.0) * 0.5 + *GHIDRA_CAST((room + 0x1200)) + *GHIDRA_CAST((room + 0x1208)) + (g_game->_screenShakeOffset).y + 26.0; - this = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 1)))))->ANM2::GetLayer(GHIDRA_CAST(0x10)); - this->LayerState::GetTexture(&texture); + this = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 1)),GHIDRA_CAST(0x10)); + LayerState::GetTexture(this,&texture); local_8 = 0; if (texture != GHIDRA_CAST(0x0)) { (GHIDRA_CAST((&white)))->KColor::SetFromARGB(0xffffffff); diff --git a/generated-src/boss_overlay.cpp b/generated-src/boss_overlay.cpp index 99bd196..7965a8a 100644 --- a/generated-src/boss_overlay.cpp +++ b/generated-src/boss_overlay.cpp @@ -17,13 +17,13 @@ void BossOverlay::update() *in_ECX = 0; } if (*GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x111)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xe)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x16)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0xe))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x16))); } if (in_ECX[1] == 3) { if (in_ECX[0xf] != 0) { isEndTriggered = - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xe)))))->AnimationState::IsEventTriggered(&DAT_00b1c00c); + AnimationState::IsEventTriggered(GHIDRA_CAST((in_ECX + 0xe)),&DAT_00b1c00c); manager = g_manager; if (isEndTriggered != 0) { sfxManager = &g_manager->_sfxManager; @@ -78,11 +78,11 @@ void BossOverlay::play(int overlayType) return; } sprite = GHIDRA_CAST((GHIDRA_INT(sprite) + 8)); - (GHIDRA_CAST((sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(sprite) + overlayType * 0x38 + 0x120)),1); - (GHIDRA_CAST((sprite)))->ANM2::LoadGraphics(unk); + ANM2::Load(sprite,GHIDRA_CAST((GHIDRA_INT(sprite) + overlayType * 0x38 + 0x120)),1); + ANM2::LoadGraphics(sprite,unk); *GHIDRA_CAST((GHIDRA_CAST(sprite) + 4)) = overlayType; if ((overlayType == 2) || (overlayType == 3)) { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(sprite,&DAT_00000004); layer->_bitflags = layer->_bitflags | 0x20; } anim = GHIDRA_CAST((GHIDRA_INT(sprite) + overlayType * 0x38 + 0x138)); @@ -116,9 +116,9 @@ LAB_0042155a: if ((compareResult == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x4c)) != '\0')))) goto LAB_00421582; } - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(anim,1); + bVar1 = ANM2::SetAnimation(sprite,anim,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(sprite) + 0x38)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(sprite) + 0x38))); *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x4c)) = 1; } LAB_00421582: diff --git a/generated-src/camera.cpp b/generated-src/camera.cpp index 5027f60..76f628d 100644 --- a/generated-src/camera.cpp +++ b/generated-src/camera.cpp @@ -1745,8 +1745,8 @@ void Camera::Update(uint8_t isSnap) do { *GHIDRA_CAST((fxSprite + -5)) = local_2c; if (*fxSprite != 0) { - (GHIDRA_CAST((GHIDRA_CAST((fxSprite + -0xd9)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((fxSprite + -0xb9)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((fxSprite + -0xd9))); + AnimationState::Update(GHIDRA_CAST((fxSprite + -0xb9))); } fxSprite = fxSprite + 0x114; local_1c = GHIDRA_CAST((GHIDRA_INT(local_1c) + -1)); diff --git a/generated-src/challenge_params.cpp b/generated-src/challenge_params.cpp deleted file mode 100644 index 8886bee..0000000 --- a/generated-src/challenge_params.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include "classes.h" - -// 009584b0 -void ChallengeParams::operator_assign_move(char *param_1) -{ - int *tree; - char *pcVar1; - int treeHead; - uint32_t uVar3; - uint32_t uVar4; - uint32_t uVar5; - char *in_ECX; - char *pcVar6; - - if (in_ECX != param_1) { - (GHIDRA_CAST((in_ECX)))->msvc::string::_Tidy_deallocate(); - uVar3 = *GHIDRA_CAST((param_1 + 4)); - uVar4 = *GHIDRA_CAST((param_1 + 8)); - uVar5 = *GHIDRA_CAST((param_1 + 0xc)); - *GHIDRA_CAST(in_ECX) = *GHIDRA_CAST(param_1); - *GHIDRA_CAST((in_ECX + 4)) = uVar3; - *GHIDRA_CAST((in_ECX + 8)) = uVar4; - *GHIDRA_CAST((in_ECX + 0xc)) = uVar5; - *GHIDRA_CAST((in_ECX + 0x10)) = *GHIDRA_CAST((param_1 + 0x10)); - param_1[0x10] = '\0'; - param_1[0x11] = '\0'; - param_1[0x12] = '\0'; - param_1[0x13] = '\0'; - param_1[0x14] = '\x0f'; - param_1[0x15] = '\0'; - param_1[0x16] = '\0'; - param_1[0x17] = '\0'; - *param_1 = '\0'; - } - tree = GHIDRA_CAST((in_ECX + 0x18)); - if (tree != GHIDRA_CAST((param_1 + 0x18))) { - treeHead = *tree; - FID_conflict__Erase_tree_>_> - (tree,(fuzzer_allocator_> *)tree, - *(_Tree_node **)(treeHead + 4)); - *GHIDRA_CAST((treeHead + 4)) = treeHead; - *GHIDRA_CAST(treeHead) = treeHead; - *GHIDRA_CAST((treeHead + 8)) = treeHead; - in_ECX[0x1c] = '\0'; - in_ECX[0x1d] = '\0'; - in_ECX[0x1e] = '\0'; - in_ECX[0x1f] = '\0'; - uVar3 = *GHIDRA_CAST((in_ECX + 0x18)); - *GHIDRA_CAST((in_ECX + 0x18)) = *GHIDRA_CAST((param_1 + 0x18)); - *GHIDRA_CAST((param_1 + 0x18)) = uVar3; - uVar3 = *GHIDRA_CAST((in_ECX + 0x1c)); - *GHIDRA_CAST((in_ECX + 0x1c)) = *GHIDRA_CAST((param_1 + 0x1c)); - *GHIDRA_CAST((param_1 + 0x1c)) = uVar3; - } - pcVar1 = param_1 + 0x20; - if (in_ECX + 0x20 != pcVar1) { - FID_conflict__Tidy(in_ECX + 0x20); - *GHIDRA_CAST((in_ECX + 0x20)) = *GHIDRA_CAST(pcVar1); - *GHIDRA_CAST((in_ECX + 0x24)) = *GHIDRA_CAST((param_1 + 0x24)); - *GHIDRA_CAST((in_ECX + 0x28)) = *GHIDRA_CAST((param_1 + 0x28)); - pcVar1[0] = '\0'; - pcVar1[1] = '\0'; - pcVar1[2] = '\0'; - pcVar1[3] = '\0'; - param_1[0x24] = '\0'; - param_1[0x25] = '\0'; - param_1[0x26] = '\0'; - param_1[0x27] = '\0'; - param_1[0x28] = '\0'; - param_1[0x29] = '\0'; - param_1[0x2a] = '\0'; - param_1[0x2b] = '\0'; - } - pcVar1 = param_1 + 0x2c; - if (in_ECX + 0x2c != pcVar1) { - FID_conflict__Tidy(in_ECX + 0x2c); - *GHIDRA_CAST((in_ECX + 0x2c)) = *GHIDRA_CAST(pcVar1); - *GHIDRA_CAST((in_ECX + 0x30)) = *GHIDRA_CAST((param_1 + 0x30)); - *GHIDRA_CAST((in_ECX + 0x34)) = *GHIDRA_CAST((param_1 + 0x34)); - pcVar1[0] = '\0'; - pcVar1[1] = '\0'; - pcVar1[2] = '\0'; - pcVar1[3] = '\0'; - param_1[0x30] = '\0'; - param_1[0x31] = '\0'; - param_1[0x32] = '\0'; - param_1[0x33] = '\0'; - param_1[0x34] = '\0'; - param_1[0x35] = '\0'; - param_1[0x36] = '\0'; - param_1[0x37] = '\0'; - } - pcVar1 = param_1 + 0x48; - *GHIDRA_CAST((in_ECX + 0x38)) = *GHIDRA_CAST((param_1 + 0x38)); - *GHIDRA_CAST((in_ECX + 0x3c)) = *GHIDRA_CAST((param_1 + 0x3c)); - *GHIDRA_CAST((in_ECX + 0x40)) = *GHIDRA_CAST((param_1 + 0x40)); - *GHIDRA_CAST((in_ECX + 0x44)) = *GHIDRA_CAST((param_1 + 0x44)); - if (in_ECX + 0x48 != pcVar1) { - FID_conflict__Tidy(in_ECX + 0x48); - *GHIDRA_CAST((in_ECX + 0x48)) = *GHIDRA_CAST(pcVar1); - *GHIDRA_CAST((in_ECX + 0x4c)) = *GHIDRA_CAST((param_1 + 0x4c)); - *GHIDRA_CAST((in_ECX + 0x50)) = *GHIDRA_CAST((param_1 + 0x50)); - pcVar1[0] = '\0'; - pcVar1[1] = '\0'; - pcVar1[2] = '\0'; - pcVar1[3] = '\0'; - param_1[0x4c] = '\0'; - param_1[0x4d] = '\0'; - param_1[0x4e] = '\0'; - param_1[0x4f] = '\0'; - param_1[0x50] = '\0'; - param_1[0x51] = '\0'; - param_1[0x52] = '\0'; - param_1[0x53] = '\0'; - } - pcVar1 = param_1 + 0x8c; - *GHIDRA_CAST((in_ECX + 0x54)) = *GHIDRA_CAST((param_1 + 0x54)); - *GHIDRA_CAST((in_ECX + 0x58)) = *GHIDRA_CAST((param_1 + 0x58)); - *GHIDRA_CAST((in_ECX + 0x5c)) = *GHIDRA_CAST((param_1 + 0x5c)); - *GHIDRA_CAST((in_ECX + 0x60)) = *GHIDRA_CAST((param_1 + 0x60)); - *GHIDRA_CAST((in_ECX + 100)) = *GHIDRA_CAST((param_1 + 100)); - *GHIDRA_CAST((in_ECX + 0x68)) = *GHIDRA_CAST((param_1 + 0x68)); - in_ECX[0x6c] = param_1[0x6c]; - *GHIDRA_CAST((in_ECX + 0x70)) = *GHIDRA_CAST((param_1 + 0x70)); - in_ECX[0x74] = param_1[0x74]; - *GHIDRA_CAST((in_ECX + 0x78)) = *GHIDRA_CAST((param_1 + 0x78)); - in_ECX[0x7c] = param_1[0x7c]; - in_ECX[0x7d] = param_1[0x7d]; - in_ECX[0x7e] = param_1[0x7e]; - in_ECX[0x7f] = param_1[0x7f]; - *GHIDRA_CAST((in_ECX + 0x80)) = *GHIDRA_CAST((param_1 + 0x80)); - *GHIDRA_CAST((in_ECX + 0x84)) = *GHIDRA_CAST((param_1 + 0x84)); - *GHIDRA_CAST((in_ECX + 0x88)) = *GHIDRA_CAST((param_1 + 0x88)); - if (in_ECX + 0x8c != pcVar1) { - FID_conflict__Tidy(in_ECX + 0x8c); - *GHIDRA_CAST((in_ECX + 0x8c)) = *GHIDRA_CAST(pcVar1); - *GHIDRA_CAST((in_ECX + 0x90)) = *GHIDRA_CAST((param_1 + 0x90)); - *GHIDRA_CAST((in_ECX + 0x94)) = *GHIDRA_CAST((param_1 + 0x94)); - pcVar1[0] = '\0'; - pcVar1[1] = '\0'; - pcVar1[2] = '\0'; - pcVar1[3] = '\0'; - param_1[0x90] = '\0'; - param_1[0x91] = '\0'; - param_1[0x92] = '\0'; - param_1[0x93] = '\0'; - param_1[0x94] = '\0'; - param_1[0x95] = '\0'; - param_1[0x96] = '\0'; - param_1[0x97] = '\0'; - } - pcVar6 = param_1 + 0x98; - pcVar1 = in_ECX + 0x98; - if (pcVar1 != pcVar6) { - FID_conflict__Tidy(pcVar1); - *GHIDRA_CAST(pcVar1) = *GHIDRA_CAST(pcVar6); - *GHIDRA_CAST((in_ECX + 0x9c)) = *GHIDRA_CAST((param_1 + 0x9c)); - *GHIDRA_CAST((in_ECX + 0xa0)) = *GHIDRA_CAST((param_1 + 0xa0)); - pcVar6[0] = '\0'; - pcVar6[1] = '\0'; - pcVar6[2] = '\0'; - pcVar6[3] = '\0'; - param_1[0x9c] = '\0'; - param_1[0x9d] = '\0'; - param_1[0x9e] = '\0'; - param_1[0x9f] = '\0'; - param_1[0xa0] = '\0'; - param_1[0xa1] = '\0'; - param_1[0xa2] = '\0'; - param_1[0xa3] = '\0'; - } - return; -} diff --git a/generated-src/classes.h b/generated-src/classes.h index 0d37e6f..dd39b29 100644 --- a/generated-src/classes.h +++ b/generated-src/classes.h @@ -115,6 +115,7 @@ extern double __uint_to_double_fixup[2]; // MSVC CRT: +2^32 for a uint32_t who #pragma pack(push, 1) #endif struct ANM2; +struct ANM2Base; struct AbyssLocustData; struct AchievementOverlay; struct AchievementOverlay_Entry; @@ -226,6 +227,8 @@ struct FileSymbolInfo; struct FileSystem; struct Font; struct FontCharBlock; +struct FontGlyph; +struct FontKerning; struct FontSettings; struct FormattedText; struct FormattedTextLine; @@ -244,6 +247,8 @@ struct Gl; struct GlitchedCollectibleGfx; struct GlitchedItemSet; struct GlowingHourglassState; +struct GlyphDraw; +struct GlyphQuad; struct GraphicsWindow; struct GridEntity; struct GridEntityDesc; @@ -289,6 +294,7 @@ struct InfoDisplayConfig; struct InfoDisplayEntry; struct InfoDisplayItem; struct InfoDisplayText; +struct InputBindings; struct InputDeviceBase; struct InputManager; struct InviteFriendsMenu; @@ -403,6 +409,7 @@ struct PersistentGameDataWriter; struct PersistentGameData_Bestiary; struct PickupGhostData; struct PillEffect; +struct Platform; struct PlayerCostumeMap; struct PlayerHUD; struct PlayerHUDActiveItem; @@ -431,6 +438,7 @@ struct RebirthSaveData; struct RedirectedPath; struct ReferenceCountBase; struct RenderBatch; +struct RenderConfig; struct RenderTarget; struct RevivePlayerMenu; struct RichText; @@ -459,6 +467,7 @@ struct SharedPtr; struct SharedPtrPair; struct ShockwaveParams; struct SimpleString; +struct Size; struct SoundEffect; struct SoundEffects; struct SoundInstance; @@ -467,6 +476,7 @@ struct SourceQuad; struct Spawn; struct SpecialSeed; struct Sprite; +struct SpriteDraw; struct SpriteTrailData; struct StageTransition; struct StatHUD; @@ -477,6 +487,7 @@ struct StringTableCategory; struct TearParams; struct TemporaryEffect; struct TemporaryEffects; +struct TextMeasure; struct TexturePtr; struct Thread; struct TypeDescriptor; @@ -744,6 +755,35 @@ typedef void * _onexit_t; typedef int errno_t; typedef size_t rsize_t; +struct EntityPtr { + static uint32_t Ref(); // 0040c3a0 + void Set(Entity *entity); // 004cf1d0 + static void SetReference(EntityPtr *ptr, Entity *entity); // 006b5b50 + void SetReference(Entity *entity); // 00872050 + EntityPtr * clear(); // 00a0fe80 + + GHIDRA_POINTER_LIKE(EntityPtr) +}; + + +struct RNG { + static void Shuffle(RNG *rng, int *begin, int *end); // 005cc070 + void game_constructor(uint32_t seed, uint32_t shiftidx); // 007e8f90 + void SetSeed(uint32_t Seed, uint32_t ShiftIdx); // 007e8fe0 + uint32_t RandomInt(uint32_t max); // 007e9020 + float RandomFloat(); // 007e9080 + uint32_t Next(); // 007e90f0 + + uint32_t _seed; + uint32_t _shift1; + uint32_t _shift2; + uint32_t _shift3; +}; +LAYOUT32(offsetof(RNG, _seed) == 0x0); +LAYOUT32(offsetof(RNG, _shift1) == 0x4); +LAYOUT32(offsetof(RNG, _shift2) == 0x8); +LAYOUT32(offsetof(RNG, _shift3) == 0xc); + struct Vector { static Vector * operator_mul(Vector *outResult, float *scalar, Vector *vector); // 004171d0 static Vector * ToCardinal(Vector *outResult, Vector *vec); // 0067f170 @@ -788,61 +828,6 @@ struct Vector { LAYOUT32(offsetof(Vector, x) == 0x0); LAYOUT32(offsetof(Vector, y) == 0x4); -struct std_string { - char _buf[16]; - uint32_t _size; - uint32_t _capacity; -}; -LAYOUT32(offsetof(std_string, _buf) == 0x0); -LAYOUT32(offsetof(std_string, _size) == 0x10); -LAYOUT32(offsetof(std_string, _capacity) == 0x14); -LAYOUT32(sizeof(std_string) == 0x18); - -struct AnimationState { - uint8_t IsLoopingAnimation(); // 004073b0 - AnimationState(void *owner, AnimationState *other); // 004086e0 - ~AnimationState(); // 004087a0 - void SetAnimationData(void *animData); // 00408830 - void ChangeAnimationKeepFrame(void *animData); // 00408970 - void AdvanceLayerPosition(int layerId, float targetFrame); // 00408b90 - void AdvanceNullLayerPosition(int nullLayerID, float targetFrame); // 00408c10 - void FireTriggersAtCurrentFrame(); // 00408c90 - void AdvancePosition(int targetFrame); // 00408d00 - void SetFrameFloat(float frame); // 00408e00 - void SetLayerFrame(int layerID, int frame); // 00408ef0 - int GetLayerFrameIdx(int layerId); // 00408f70 - void SetNullLayerFrame(int nullLayerId, int frame); // 00408fc0 - void Update(); // 00409030 - void Rewind(); // 0040a1b0 - void * GetLayerFrame(int layerId); // 0040a220 - void * GetNullFrameById(int nullLayerId); // 0040ac70 - void * GetNullFrame(uint8_t *nullLayerName); // 0040ace0 - uint8_t IsEventTriggered(uint8_t *eventName); // 0040add0 - uint8_t WasEventTriggered(uint8_t *eventName); // 0040ae70 - int NextEventTrigger(uint8_t *eventName); // 0040af10 - AnimationState * copy_assign(AnimationState *other); // 0040bbf0 - int GetAnimationLength(); // 00440e30 - AnimationState() = default; - - ANM2* _animation; - AnimationData* _animData; - int* _layerFrames; - int* _nullLayerFrames; - float _animFrame; - bool _isPlaying; - uint8_t _pad_0x15[0x3]; - int _currentlyTriggeredEvents; - int _previouslyTriggeredEvents; -}; -LAYOUT32(offsetof(AnimationState, _animation) == 0x0); -LAYOUT32(offsetof(AnimationState, _animData) == 0x4); -LAYOUT32(offsetof(AnimationState, _layerFrames) == 0x8); -LAYOUT32(offsetof(AnimationState, _nullLayerFrames) == 0xc); -LAYOUT32(offsetof(AnimationState, _animFrame) == 0x10); -LAYOUT32(offsetof(AnimationState, _isPlaying) == 0x14); -LAYOUT32(offsetof(AnimationState, _currentlyTriggeredEvents) == 0x18); -LAYOUT32(offsetof(AnimationState, _previouslyTriggeredEvents) == 0x1c); - struct ColorMod { float _tint[4]; float _colorize[4]; @@ -853,125 +838,6 @@ LAYOUT32(offsetof(ColorMod, _colorize) == 0x10); LAYOUT32(offsetof(ColorMod, _offset) == 0x20); LAYOUT32(sizeof(ColorMod) == 0x2c); -struct ANM2 { - void constructor(); // 004074c0 - ANM2(ANM2 *other); // 00407690 - ANM2 * operator_assign(ANM2 other); // 00407e90 - void Reset(); // 00407f10 - ~ANM2(); // 00408170 - void Update(); // 00409100 - void Render(Vector *position, Vector *topleftclamp, Vector *bottomrightclamp); // 0040a0d0 - void Play(uint8_t *anim, uint8_t reset); // 0040a380 - uint8_t IsPlaying(uint8_t *name); // 0040a4d0 - uint8_t IsFinishedImpl(uint8_t *animName); // 0040a550 - uint8_t SetAnimation(uint8_t *anim, uint8_t reset); // 0040a5d0 - void SetFrame(std_string *anim, int frame); // 0040a690 - int GetFrame(); // 0040a780 - void SetLayerFrame(int layerid, int frame); // 0040a7e0 - void PlayOverlay(uint8_t *animName, uint8_t isForce); // 0040a940 - uint8_t SetOverlayAnimation(uint8_t *anim, uint8_t reset); // 0040aaf0 - void SetOverlayFrame(uint8_t *anim, int frame); // 0040abf0 - void SetOverlayFrame(int frame); // 0040ac30 - uint8_t WasEventTriggered(uint8_t *eventName); // 0040b090 - void * GetNullFrame(uint8_t *animName, uint8_t *nullLayerName, int frame); // 0040b0c0 - void * GetLayerFrame(int nullLayerId); // 0040b1a0 - LayerState * GetLayer(uint8_t *layerName); // 0040b220 - LayerState * get_layer_by_string(std_string *name); // 0040b310 - static KColor * GetTexel(AnimationState *anim, KColor *outColor, int layerId, Vector samplePos, Vector renderPos, float alphaThreshold); // 0040b600 - void * GetAnimationData(uint8_t *name); // 0040bcd0 - void Load(std_string *ANM2Path, uint8_t loadgraphics); // 0040bd50 - void Reload(); // 0040bea0 - void LoadGraphics(uint8_t unk); // 0040c000 - std_string * GetAnimation(std_string *outName); // 00452bf0 - static void LoadDeliriumForm(ANM2 *sprite, int type, int variant, uint8_t isReloadAnm2); // 004a5d10 - static void copy_animation_to(ANM2 *source, ANM2 *dest); // 0078b3b0 - void update_appear_then_idle(); // 00837210 - ANM2() = default; - - std_string _filename; - std_string _animDefaultName; - AnimationState _animState; - AnimationState _overlayAnimState; - bool _overlayRenderFirst; - uint8_t _pad_0x71[0x3]; - AnimationData* _animData; - int _animCount; - LayerState* _layerState; - unsigned int _layerCount; - struct std_string* _nullLayerNames; - unsigned int _numNullLayers; - struct std_string* _eventNames; - unsigned int _numEvents; - Vector _offset; - Vector _scale; - float _rotation; - ColorMod _color; - ColorMod _championColor; - bool _flipX; - bool _flipY; - uint8_t _pad_0x102[0x2]; - float _playbackSpeed; - bool _isUnknown108; - bool _loaded; - uint8_t _pad_0x10a[0x2]; - int _shadowLayerIndex; - unsigned int _bitflags; -}; -LAYOUT32(offsetof(ANM2, _filename) == 0x0); -LAYOUT32(offsetof(ANM2, _animDefaultName) == 0x18); -LAYOUT32(offsetof(ANM2, _animState) == 0x30); -LAYOUT32(offsetof(ANM2, _overlayAnimState) == 0x50); -LAYOUT32(offsetof(ANM2, _overlayRenderFirst) == 0x70); -LAYOUT32(offsetof(ANM2, _animData) == 0x74); -LAYOUT32(offsetof(ANM2, _animCount) == 0x78); -LAYOUT32(offsetof(ANM2, _layerState) == 0x7c); -LAYOUT32(offsetof(ANM2, _layerCount) == 0x80); -LAYOUT32(offsetof(ANM2, _nullLayerNames) == 0x84); -LAYOUT32(offsetof(ANM2, _numNullLayers) == 0x88); -LAYOUT32(offsetof(ANM2, _eventNames) == 0x8c); -LAYOUT32(offsetof(ANM2, _numEvents) == 0x90); -LAYOUT32(offsetof(ANM2, _offset) == 0x94); -LAYOUT32(offsetof(ANM2, _scale) == 0x9c); -LAYOUT32(offsetof(ANM2, _rotation) == 0xa4); -LAYOUT32(offsetof(ANM2, _color) == 0xa8); -LAYOUT32(offsetof(ANM2, _championColor) == 0xd4); -LAYOUT32(offsetof(ANM2, _flipX) == 0x100); -LAYOUT32(offsetof(ANM2, _flipY) == 0x101); -LAYOUT32(offsetof(ANM2, _playbackSpeed) == 0x104); -LAYOUT32(offsetof(ANM2, _isUnknown108) == 0x108); -LAYOUT32(offsetof(ANM2, _loaded) == 0x109); -LAYOUT32(offsetof(ANM2, _shadowLayerIndex) == 0x10c); -LAYOUT32(offsetof(ANM2, _bitflags) == 0x110); - -struct EntityPtr { - static uint32_t Ref(); // 0040c3a0 - void Set(Entity *entity); // 004cf1d0 - static void SetReference(EntityPtr *ptr, Entity *entity); // 006b5b50 - void SetReference(Entity *entity); // 00872050 - EntityPtr * clear(); // 00a0fe80 - - GHIDRA_POINTER_LIKE(EntityPtr) -}; - - -struct RNG { - static void Shuffle(RNG *rng, int *begin, int *end); // 005cc070 - void game_constructor(uint32_t seed, uint32_t shiftidx); // 007e8f90 - void SetSeed(uint32_t Seed, uint32_t ShiftIdx); // 007e8fe0 - uint32_t RandomInt(uint32_t max); // 007e9020 - float RandomFloat(); // 007e9080 - uint32_t Next(); // 007e90f0 - - uint32_t _seed; - uint32_t _shift1; - uint32_t _shift2; - uint32_t _shift3; -}; -LAYOUT32(offsetof(RNG, _seed) == 0x0); -LAYOUT32(offsetof(RNG, _shift1) == 0x4); -LAYOUT32(offsetof(RNG, _shift2) == 0x8); -LAYOUT32(offsetof(RNG, _shift3) == 0xc); - struct std_vector { void * _begin; void * _end; @@ -1636,7 +1502,7 @@ struct Entity_Familiar : Entity { Weapon* _weapon; bool _isLilDelirium; uint8_t _pad_0xdc9[0x3]; - ANM2 _chargeBarSprite; + uint8_t _chargeBarSprite[0x114]; // ANM2 void* _extraData; uint8_t _pad_0xee4[0x4]; ItemConfig_Item* _item; @@ -1715,6 +1581,16 @@ LAYOUT32(offsetof(std_deque, _offset) == 0xc); LAYOUT32(offsetof(std_deque, _size) == 0x10); LAYOUT32(sizeof(std_deque) == 0x14); +struct std_string { + char _buf[16]; + uint32_t _size; + uint32_t _capacity; +}; +LAYOUT32(offsetof(std_string, _buf) == 0x0); +LAYOUT32(offsetof(std_string, _size) == 0x10); +LAYOUT32(offsetof(std_string, _capacity) == 0x14); +LAYOUT32(sizeof(std_string) == 0x18); + struct AchievementOverlay_Entry { int _id; std_string _name; @@ -1734,7 +1610,7 @@ struct AchievementOverlay { int _currentEntry; int _frame; int _state; - ANM2 _sprite; + uint8_t _sprite[0x114]; // ANM2 AchievementOverlay_Entry _entries[642]; uint8_t _pad_0x5174[0x3228]; bool _isPopupBlocked; @@ -1791,138 +1667,6 @@ LAYOUT32(offsetof(Ambush, _maxWaves) == 0x18); LAYOUT32(offsetof(Ambush, _isActive) == 0x20); LAYOUT32(offsetof(Ambush, _currentWave) == 0x24); -struct AnimationData { - int find_null_index(uint8_t *name); // 0040b520 - - std_string _name; - AnimationLayer* _animLayers; - int _layerCount; - AnimationNullLayer* _nullLayers; - int _nullLayerCount; - AnimationData_EventTrigger* _eventTriggers; - int _eventTriggerCount; - int _length; - bool _loop; - uint8_t _pad_0x35[0x3]; - int _layerMap[64]; - uint8_t _pad_0x138[0x4]; -}; -LAYOUT32(offsetof(AnimationData, _name) == 0x0); -LAYOUT32(offsetof(AnimationData, _animLayers) == 0x18); -LAYOUT32(offsetof(AnimationData, _layerCount) == 0x1c); -LAYOUT32(offsetof(AnimationData, _nullLayers) == 0x20); -LAYOUT32(offsetof(AnimationData, _nullLayerCount) == 0x24); -LAYOUT32(offsetof(AnimationData, _eventTriggers) == 0x28); -LAYOUT32(offsetof(AnimationData, _eventTriggerCount) == 0x2c); -LAYOUT32(offsetof(AnimationData, _length) == 0x30); -LAYOUT32(offsetof(AnimationData, _loop) == 0x34); -LAYOUT32(offsetof(AnimationData, _layerMap) == 0x38); -LAYOUT32(sizeof(AnimationData) == 0x13c); - -struct AnimationData_EventTrigger { - uint32_t _eventId; - int _animationFrame; -}; -LAYOUT32(offsetof(AnimationData_EventTrigger, _eventId) == 0x0); -LAYOUT32(offsetof(AnimationData_EventTrigger, _animationFrame) == 0x4); - -struct AnimationFrame { - Vector crop; - float width; - float height; - Vector pos; - Vector scale; - Vector pivot; - int duration; - uint8_t visible; - uint8_t _pad_0x2d[0x2f]; - float rotation; - uint8_t interpolated; - uint8_t _pad_0x61[0x3]; - int startFrame; - int endFrame; -}; -LAYOUT32(offsetof(AnimationFrame, crop) == 0x0); -LAYOUT32(offsetof(AnimationFrame, width) == 0x8); -LAYOUT32(offsetof(AnimationFrame, height) == 0xc); -LAYOUT32(offsetof(AnimationFrame, pos) == 0x10); -LAYOUT32(offsetof(AnimationFrame, scale) == 0x18); -LAYOUT32(offsetof(AnimationFrame, pivot) == 0x20); -LAYOUT32(offsetof(AnimationFrame, duration) == 0x28); -LAYOUT32(offsetof(AnimationFrame, visible) == 0x2c); -LAYOUT32(offsetof(AnimationFrame, rotation) == 0x5c); -LAYOUT32(offsetof(AnimationFrame, interpolated) == 0x60); -LAYOUT32(offsetof(AnimationFrame, startFrame) == 0x64); -LAYOUT32(offsetof(AnimationFrame, endFrame) == 0x68); -LAYOUT32(sizeof(AnimationFrame) == 0x6c); - -struct AnimationLayer { - void RenderFrame(); // 008e3db0 - - int _layerID; - AnimationFrame* _animFrames; - int _numFrames; - bool _visible; - uint8_t _pad_0xd[0x3]; -}; -LAYOUT32(offsetof(AnimationLayer, _layerID) == 0x0); -LAYOUT32(offsetof(AnimationLayer, _animFrames) == 0x4); -LAYOUT32(offsetof(AnimationLayer, _numFrames) == 0x8); -LAYOUT32(offsetof(AnimationLayer, _visible) == 0xc); -LAYOUT32(sizeof(AnimationLayer) == 0x10); - -struct AnimationNullLayer { - int _nullLayerId; - bool _visible; - uint8_t _pad_0x5[0x3]; - NullFrame* _nullFrames; - int _numFrames; -}; -LAYOUT32(offsetof(AnimationNullLayer, _nullLayerId) == 0x0); -LAYOUT32(offsetof(AnimationNullLayer, _visible) == 0x4); -LAYOUT32(offsetof(AnimationNullLayer, _nullFrames) == 0x8); -LAYOUT32(offsetof(AnimationNullLayer, _numFrames) == 0xc); -LAYOUT32(sizeof(AnimationNullLayer) == 0x10); - -struct AnmCache { - ~AnmCache(); // 0040d240 - static void LogMemoryUsage(); // 0040d4c0 - static void Load(std_string *param_1, std_string *param_2); // 0040db90 - static void AddRef(std_string *path); // 0040e110 - static void RemoveRef(std_string *path); // 0040e2b0 - static void Clear(); // 0040e470 - static void Preload(uint8_t *path); // 0040ea50 - static void ParseFile(std_string *path, uint32_t pathHash); // 0040ed50 - static int entry_get(uint32_t param_1); // 00414500 - static int * lower_bound_find(int *param_1, uint32_t *param_2); // 00416490 -}; - - -struct AnmFileData { - void Clear(); // 0040d850 - - uint8_t _pad_0x0[0x4]; - LayerData* _layers; - unsigned int _layerCount; - AnimationData* _animations; - unsigned int _animationCount; - struct std_string* _nullLayerNames; - unsigned int _nullLayerCount; - struct std_string* _eventNames; - unsigned int _eventCount; - std_string _defaultAnimation; -}; -LAYOUT32(offsetof(AnmFileData, _layers) == 0x4); -LAYOUT32(offsetof(AnmFileData, _layerCount) == 0x8); -LAYOUT32(offsetof(AnmFileData, _animations) == 0xc); -LAYOUT32(offsetof(AnmFileData, _animationCount) == 0x10); -LAYOUT32(offsetof(AnmFileData, _nullLayerNames) == 0x14); -LAYOUT32(offsetof(AnmFileData, _nullLayerCount) == 0x18); -LAYOUT32(offsetof(AnmFileData, _eventNames) == 0x1c); -LAYOUT32(offsetof(AnmFileData, _eventCount) == 0x20); -LAYOUT32(offsetof(AnmFileData, _defaultAnimation) == 0x24); -LAYOUT32(sizeof(AnmFileData) == 0x3c); - struct Backdrop { void * render_grid_rect(void *outQuad, int x, int y, int width, int height); // 00932120 void constructor(); // 009321c0 @@ -2076,8 +1820,7 @@ struct BeamRenderer { static void Add(Vector *point, ColorMod *color, float spritesheetCoordinate, float width); // 0041e720 static void End(); // 0041e960 - ANM2 _anm2; - uint8_t _pad_0x114[0x4]; + uint8_t _anm2[0x118]; // ANM2 int _layer; uint8_t _useOverlayData; uint8_t _unkBool; @@ -2232,70 +1975,6 @@ struct CellSpace { }; -struct ChallengeParam { - void Reset(); // 00424440 - - std_string _name; - std_set _roomset; - std_vector _collectibleList; - std_vector _trinketList; - int _startingPill; - int _startingCard; - int _endStage; - int _playerType; - std_vector _achievementList; - int _soulHearts; - int _blackHearts; - int _hearts; - int _maxHearts; - int _coins; - float _addDamage; - bool _canShoot; - uint8_t _pad_0x6d[0x3]; - int _difficulty; - bool _isMegaSatan; - uint8_t _pad_0x75[0x3]; - float _minFireRate; - bool _maxDamage; - bool _minShotSpeed; - bool _bigRange; - bool _isPathTypeSet; - int _pathType; - unsigned int _getCurse; - unsigned int _curseFilter; - std_vector _collectibleTwinList; - std_vector _seedEffects; -}; -LAYOUT32(offsetof(ChallengeParam, _name) == 0x0); -LAYOUT32(offsetof(ChallengeParam, _roomset) == 0x18); -LAYOUT32(offsetof(ChallengeParam, _collectibleList) == 0x20); -LAYOUT32(offsetof(ChallengeParam, _trinketList) == 0x2c); -LAYOUT32(offsetof(ChallengeParam, _startingPill) == 0x38); -LAYOUT32(offsetof(ChallengeParam, _startingCard) == 0x3c); -LAYOUT32(offsetof(ChallengeParam, _endStage) == 0x40); -LAYOUT32(offsetof(ChallengeParam, _playerType) == 0x44); -LAYOUT32(offsetof(ChallengeParam, _achievementList) == 0x48); -LAYOUT32(offsetof(ChallengeParam, _soulHearts) == 0x54); -LAYOUT32(offsetof(ChallengeParam, _blackHearts) == 0x58); -LAYOUT32(offsetof(ChallengeParam, _hearts) == 0x5c); -LAYOUT32(offsetof(ChallengeParam, _maxHearts) == 0x60); -LAYOUT32(offsetof(ChallengeParam, _coins) == 0x64); -LAYOUT32(offsetof(ChallengeParam, _addDamage) == 0x68); -LAYOUT32(offsetof(ChallengeParam, _canShoot) == 0x6c); -LAYOUT32(offsetof(ChallengeParam, _difficulty) == 0x70); -LAYOUT32(offsetof(ChallengeParam, _isMegaSatan) == 0x74); -LAYOUT32(offsetof(ChallengeParam, _minFireRate) == 0x78); -LAYOUT32(offsetof(ChallengeParam, _maxDamage) == 0x7c); -LAYOUT32(offsetof(ChallengeParam, _minShotSpeed) == 0x7d); -LAYOUT32(offsetof(ChallengeParam, _bigRange) == 0x7e); -LAYOUT32(offsetof(ChallengeParam, _isPathTypeSet) == 0x7f); -LAYOUT32(offsetof(ChallengeParam, _pathType) == 0x80); -LAYOUT32(offsetof(ChallengeParam, _getCurse) == 0x84); -LAYOUT32(offsetof(ChallengeParam, _curseFilter) == 0x88); -LAYOUT32(offsetof(ChallengeParam, _collectibleTwinList) == 0x8c); -LAYOUT32(offsetof(ChallengeParam, _seedEffects) == 0x98); -LAYOUT32(sizeof(ChallengeParam) == 0xa4); - struct ChallengeParams { ChallengeParams(); // 00424310 static void operator_assign_move(char *param_1); // 009584b0 @@ -3116,7 +2795,7 @@ struct Entity_Bomb : Entity { bool _isSkipNextUpdate; bool _hasCostumes; bool _loadCostumes; - ANM2 _bombCostumesSprites[5]; + uint8_t _bombCostumesSprites[0x564]; // ANM2[5] std_vector _hitList; uint8_t _pad_0x9d4[0x4]; }; @@ -3689,8 +3368,8 @@ struct Entity_NPC : Entity { int _groupIdx; ColorMod _floorColor; ColorMod _dirtColor; - ANM2 _statusEffectSprite; - ANM2 _chargeBarSprite; + uint8_t _statusEffectSprite[0x114]; // ANM2 + uint8_t _chargeBarSprite[0x114]; // ANM2 std_vector _hitList; std_vector _secondaryHitList; uint32_t _aiCallFlags; @@ -3833,7 +3512,7 @@ struct Entity_Pickup : Entity { static void RestoreState(Room *room, Entity_Pickup *entity, void *saveState); // 007ef420 int Wait(); // 0085e440 - ANM2 _priceANM2; + uint8_t _priceANM2[0x114]; // ANM2 int _charge; int _optionsPickupIndex; bool _isTouched; @@ -3862,8 +3541,7 @@ struct Entity_Pickup : Entity { unsigned int _cycleCollectibleCount; int _invisibleFrames; uint8_t _flipSaveState[0x8]; // KAGE_SmartPointer_EntitySaveState - ANM2 _altPedestalANM2; - uint8_t _pad_0x6e4[0xc]; + uint8_t _altPedestalANM2[0x120]; // ANM2 }; LAYOUT32(offsetof(Entity_Pickup, _priceANM2) == 0x410); LAYOUT32(offsetof(Entity_Pickup, _charge) == 0x524); @@ -4415,13 +4093,13 @@ struct Entity_Player : Entity { uint8_t _pad_0x411[0x3]; int _controlsCooldown; int _fireBlockCooldown; - ANM2 _bodySprite; - ANM2 _crownOfLightSprite; - ANM2 _darkPrincesCrownSprite; - ANM2 _chargeBarSprites[7]; - ANM2 _bloodGushSprite; - ANM2 _heldSprite; - ANM2 _statusEffectSprite; + uint8_t _bodySprite[0x114]; // ANM2 + uint8_t _crownOfLightSprite[0x114]; // ANM2 + uint8_t _darkPrincesCrownSprite[0x114]; // ANM2 + uint8_t _chargeBarSprites[0x78c]; // ANM2[7] + uint8_t _bloodGushSprite[0x114]; // ANM2 + uint8_t _heldSprite[0x114]; // ANM2 + uint8_t _statusEffectSprite[0x114]; // ANM2 std_vector _costumeSpriteDescs; PlayerCostumeMap _playerCostumeMap[15]; uint8_t _pad_0x12ef[0x31]; @@ -5224,9 +4902,9 @@ struct Entity_Tear : Entity { uint8_t _linkPrev[0x4]; // EntityPtr uint8_t _linkNext[0x4]; // EntityPtr uint8_t _attachedEffect[0x10]; // EntityPtr - ANM2 _tearHaloANM2; - ANM2 _tearEffectANM2; - ANM2 _deadEyeANM2; + uint8_t _tearHaloANM2[0x114]; // ANM2 + uint8_t _tearEffectANM2[0x114]; // ANM2 + uint8_t _deadEyeANM2[0x114]; // ANM2 bool _canTriggerStreakEnd; bool _isHovering; bool _isFireSoundMuted; @@ -5399,104 +5077,6 @@ struct FileSystem { }; -struct Font { - void SetLineHeightModifier(float modifier); // 00407280 - void EnableAutoWrap(uint16_t param_2); // 0085e450 - void Load(uint8_t *path); // 0085e470 - Vector * measure_rich_text(Vector *outSize, uint8_t *text, int maxWidth, float scale); // 009f0140 - static void SetAlignment(uint32_t param_1); // 00a1a5c0 - static void SetMaxCharacters(uint16_t param_1); // 00a1a5d0 - short GetMaxCharacters(); // 00a1a5e0 - uint8_t IsAutoWrapEnabled(); // 00a1a5f0 - static void EnableTruncation(uint16_t param_1); // 00a1a600 - static bool IsTruncationEnabled(); // 00a1a620 - void SetMissingCharacterOverride(uint32_t param_2); // 00a1a630 - Font(); // 00a1a640 - void Load(uint8_t *path, uint8_t unusedIsLoading); // 00a1a730 - void Unload(); // 00a1ad90 - static void GetCharacterWidth(); // 00a1ae70 - int GetStringWidth(uint8_t *str); // 00a1ae80 - short GetLineHeight(); // 00a1aea0 - short GetBaselineHeight(); // 00a1aeb0 - void DrawStringScaled(uint8_t *text, Vector *pos, KColor *color, void *settings); // 00a1aec0 - void DrawString(uint8_t *text, KColor *color, void *settings, float x, float y); // 00a1af90 - void DrawString(uint8_t *str, Vector *position, Vector *scale, KColor *color, void *settings); // 00a1b050 - void DrawString(uint8_t *str, Vector pos, Vector scale, KColor *color, FontSettings *settings); // 00a1b140 - void draw_string_wide_unscaled(short *text, float x, float y, KColor *color, void *settings); // 00a1b210 - void SetMissingCharacter(uint32_t character); // 00a1b3b0 - static uint32_t get_glyph_index(uint32_t param_1, uint32_t param_2); // 00a1b410 - int get_kerning(uint32_t second, uint32_t first); // 00a1b4a0 - void render_glyph(uint32_t ch, uint8_t unknown, uint32_t *prevChar, float x, float y, float scaleX, float scaleY, KColor color, void *glyphContext); // 00a1b580 - int get_string_width_n(uint8_t *str, int length); // 00a1b8e0 - int get_string_width_utf16(short *text, int length); // 00a1ba10 - void * measure_string(void *outLayout, uint8_t *text, void *settings, Vector *scale); // 00a1bb10 - void * layout_glyphs(void *outRun, uint8_t *text, void *settings, Vector *boxSize); // 00a1c480 - - bool _isLoaded; - uint8_t _pad_0x1[0x3]; - int16_t _fontSize; - uint8_t _infoBitField; - uint8_t _charSet; - uint16_t _stretchH; - uint8_t _aa; - uint8_t _paddingUp; - uint8_t _paddingRight; - uint8_t _paddingDown; - uint8_t _paddingLeft; - uint8_t _spacingHoriz; - uint8_t _spacingVert; - uint8_t _outline; - uint8_t _pad_0x12[0x2]; - uint16_t _lineHeight; - uint16_t _base; - uint16_t _scaleW; - uint16_t _scaleH; - uint16_t _pages; - uint8_t _commonBitField; - uint8_t _alphaChannel; - uint8_t _redChannel; - uint8_t _greenChannel; - uint8_t _blueChannel; - uint8_t _pad_0x23[0x1]; - uint32_t _numChars; - FontCharBlock* _chars; - std_vector _kerningPairs; - uint32_t _numPages; - TexturePtr* _pageTextures; - std_map _charsBlock; - int _missingCharacter; -}; -LAYOUT32(offsetof(Font, _isLoaded) == 0x0); -LAYOUT32(offsetof(Font, _fontSize) == 0x4); -LAYOUT32(offsetof(Font, _infoBitField) == 0x6); -LAYOUT32(offsetof(Font, _charSet) == 0x7); -LAYOUT32(offsetof(Font, _stretchH) == 0x8); -LAYOUT32(offsetof(Font, _aa) == 0xa); -LAYOUT32(offsetof(Font, _paddingUp) == 0xb); -LAYOUT32(offsetof(Font, _paddingRight) == 0xc); -LAYOUT32(offsetof(Font, _paddingDown) == 0xd); -LAYOUT32(offsetof(Font, _paddingLeft) == 0xe); -LAYOUT32(offsetof(Font, _spacingHoriz) == 0xf); -LAYOUT32(offsetof(Font, _spacingVert) == 0x10); -LAYOUT32(offsetof(Font, _outline) == 0x11); -LAYOUT32(offsetof(Font, _lineHeight) == 0x14); -LAYOUT32(offsetof(Font, _base) == 0x16); -LAYOUT32(offsetof(Font, _scaleW) == 0x18); -LAYOUT32(offsetof(Font, _scaleH) == 0x1a); -LAYOUT32(offsetof(Font, _pages) == 0x1c); -LAYOUT32(offsetof(Font, _commonBitField) == 0x1e); -LAYOUT32(offsetof(Font, _alphaChannel) == 0x1f); -LAYOUT32(offsetof(Font, _redChannel) == 0x20); -LAYOUT32(offsetof(Font, _greenChannel) == 0x21); -LAYOUT32(offsetof(Font, _blueChannel) == 0x22); -LAYOUT32(offsetof(Font, _numChars) == 0x24); -LAYOUT32(offsetof(Font, _chars) == 0x28); -LAYOUT32(offsetof(Font, _kerningPairs) == 0x2c); -LAYOUT32(offsetof(Font, _numPages) == 0x38); -LAYOUT32(offsetof(Font, _pageTextures) == 0x3c); -LAYOUT32(offsetof(Font, _charsBlock) == 0x40); -LAYOUT32(offsetof(Font, _missingCharacter) == 0x48); - struct FontCharBlock { uint32_t _id; uint16_t _x; @@ -5521,28 +5101,6 @@ LAYOUT32(offsetof(FontCharBlock, _page) == 0x12); LAYOUT32(offsetof(FontCharBlock, _channel) == 0x13); LAYOUT32(sizeof(FontCharBlock) == 0x14); -struct FontSettings { - void constructor(); // 00a1a540 -}; - - -struct FormattedText { - FormattedText(uint8_t *param_1); // 00a55b70 - void set(uint8_t *text, void *measureContext, int maxLength, float scale, uint8_t isCopySegments); // 00a55c40 - void * operator_assign(void *other); // 00a55e20 - static void split_lines(uint8_t *text, void *lines); // 00a55ef0 - static void split_lines_utf16(short *text, void *outLines); // 00a56060 - static void parse(uint8_t *text, uint32_t maxWidth, void *outLines, void *measureFn, void *userData); // 00a56350 - FormattedText() = default; - - uint8_t _flags; - uint8_t _pad_0x1[0x3]; - std_vector _lines; -}; -LAYOUT32(offsetof(FormattedText, _flags) == 0x0); -LAYOUT32(offsetof(FormattedText, _lines) == 0x4); -LAYOUT32(sizeof(FormattedText) == 0x10); - struct FormattedTextLine { uint8_t _flags; uint8_t _pad_0x1[0x3]; @@ -5722,8 +5280,7 @@ struct ItemOverlay { int _state; int _overlayID; - ANM2 _sprite; - uint8_t _pad_0x11c[0x1080]; + uint8_t _sprite[0x1194]; // ANM2 int _delay; uint8_t _player[0x4]; // EntityPtr uint8_t _megaMushPlayerSprite[0x4]; // ANM2 @@ -5791,20 +5348,18 @@ struct HUD { static void mark_all_slots_dirty(HUD *hud, uint8_t isRebuildIcons, uint8_t isClearTextCache); // 009a8970 uint8_t _playerHUD[14048]; - Font _font; - Font _fontKR; - ANM2 _chargeBarSprite; - ANM2 _chargeBarSmallSprite; - ANM2 _heartsSprite; - ANM2 _pickupHUDSprite; - ANM2 _cardsPillsSprite; + uint8_t _font[0x4c]; // Font + uint8_t _fontKR[0x4c]; // Font + uint8_t _chargeBarSprite[0x114]; // ANM2 + uint8_t _chargeBarSmallSprite[0x114]; // ANM2 + uint8_t _heartsSprite[0x114]; // ANM2 + uint8_t _pickupHUDSprite[0x114]; // ANM2 + uint8_t _cardsPillsSprite[0x114]; // ANM2 uint8_t _messageMain[0x1f4]; // HUD_Message uint8_t _messageStack[0xbb8]; // HUD_Message[6] uint8_t _messagePlayerHUD[0x7d0]; // HUD_Message[4] - ANM2 _fortuneSprite; - uint8_t _pad_0x536c[0x8]; - ANM2 _statsSprite; - uint8_t _pad_0x5488[0x8]; + uint8_t _fortuneSprite[0x11c]; // ANM2 + uint8_t _statsSprite[0x11c]; // ANM2 float _bossHPBarFill; int _bossHPBarDamageFlash; int _bossHPBarHealFlash; @@ -5816,11 +5371,10 @@ struct HUD { bool _isRefreshTick; uint8_t _pad_0x54d5[0x3]; int _hudRefreshCountdown; - ANM2 _coopMenuSprite; - ANM2 _inventorySprite; - ANM2 _craftingTableSprite; - ANM2 _poopSpellsSprite; - uint8_t _pad_0x592c[0x78]; + uint8_t _coopMenuSprite[0x114]; // ANM2 + uint8_t _inventorySprite[0x114]; // ANM2 + uint8_t _craftingTableSprite[0x114]; // ANM2 + uint8_t _poopSpellsSprite[0x18c]; // ANM2 uint8_t _statHUD[0x2b0]; // StatHUD uint8_t _historyHUD[0x4]; // HistoryHUD }; @@ -5907,8 +5461,7 @@ struct GenericPrompt { void Show(uint8_t UNK); // 008380f0 static void Disappear(ANM2 *anm2); // 00838190 - ANM2 _sprite; - uint8_t _pad_0x114[0x1c]; + uint8_t _sprite[0x130]; // ANM2 bool _isOnlineVote; }; LAYOUT32(offsetof(GenericPrompt, _sprite) == 0x0); @@ -5956,8 +5509,7 @@ struct RevivePlayerMenu { struct MinimapConfig { - ANM2 _mapSprite; - uint8_t _pad_0x114[0x8]; + uint8_t _mapSprite[0x11c]; // ANM2 Vector _vec1; Vector _borderPadding; float _posOffsetX; @@ -6001,10 +5553,9 @@ struct Minimap { uint8_t _pad_0x10[0x8]; MinimapConfig _config[2]; uint8_t _pad_0x2d0[0x8]; - ANM2 _itemIconsSprite; - ANM2 _hudPickupSprite; - ANM2 _iconsSprite; - uint8_t _pad_0x614[0x8]; + uint8_t _itemIconsSprite[0x114]; // ANM2 + uint8_t _hudPickupSprite[0x114]; // ANM2 + uint8_t _iconsSprite[0x11c]; // ANM2 int _shakeDuration; uint8_t _shakeOffset[0x4]; // Vector }; @@ -6115,8 +5666,7 @@ struct RoomTransition { uint8_t _pad_0x20[0x4]; uint32_t _flags; uint8_t _pad_0x28[0x10]; - ANM2 _versusScreenSprite; - uint8_t _pad_0x14c[0xd8]; + uint8_t _versusScreenSprite[0x1ec]; // ANM2 std_map _sprites; Vector _slideOffset; uint8_t _minecart[0x4]; // EntityPtr @@ -6508,7 +6058,7 @@ struct Game { int _victoryLap; GenericPrompt _genericPrompt; uint8_t _pad_0x268a9[0x3]; - ANM2 _completionWidgetSprite; + uint8_t _completionWidgetSprite[0x114]; // ANM2 int _lastLevelWithoutHalfHp; int _stageNameNumeral; uint32_t _difficulty; @@ -6801,7 +6351,7 @@ struct GridEntity { unsigned int _spawnFrame; RNG _rng; int _collisionClass; - ANM2 _sprite; + uint8_t _sprite[0x114]; // ANM2 }; LAYOUT32(offsetof(GridEntity, _desc) == 0x4); LAYOUT32(offsetof(GridEntity, _varData) == 0x18); @@ -6856,8 +6406,8 @@ struct GridEntity_Door : GridEntity { int _currentRoomType; int _targetRoomType; int _direction; - ANM2 _sparkleSprite; - ANM2 _extraSprite; + uint8_t _sparkleSprite[0x114]; // ANM2 + uint8_t _extraSprite[0x114]; // ANM2 bool _isExtraVisible; bool _isBusted; bool _isUnlockedByPlayer; @@ -6977,7 +6527,7 @@ struct GridEntity_PressurePlate : GridEntity { void update_greed_button(); // 009839f0 void Reward(); // 00984550 - ANM2 _timerPlate; + uint8_t _timerPlate[0x114]; // ANM2 char* _nextGreedAnimation; RNG _greedModeRNG; }; @@ -9111,72 +8661,6 @@ struct LayerAnimation { }; -struct LayerData { - ~LayerData(); // 0040db70 - - int _id; - int _spriteSheetId; - std_string _name; - std_string _spriteSheetPath; -}; -LAYOUT32(offsetof(LayerData, _id) == 0x0); -LAYOUT32(offsetof(LayerData, _spriteSheetId) == 0x4); -LAYOUT32(offsetof(LayerData, _name) == 0x8); -LAYOUT32(offsetof(LayerData, _spriteSheetPath) == 0x20); -LAYOUT32(sizeof(LayerData) == 0x38); - -struct LayerState { - ~LayerState(); // 00407a60 - LayerState(); // 004081d0 - void Init(void *param_2); // 00408310 - void * GetTexture(void *outTexture); // 00408590 - void SetTexture(void *texture, void *textureRefCount); // 00408640 - - LayerData* _layerData; - ANM2* _animation; - std_string _spriteSheetPath; - unsigned int _minFilterMode; - unsigned int _magFilterMode; - unsigned int _wrapSMode; - unsigned int _wrapTMode; - bool _spriteSheetLoaded; - bool _isUnknown31; - bool _flipX; - bool _flipY; - Vector _size; - float _rotation; - Vector _pos; - ColorMod _color; - bool _visible; - uint8_t _pad_0x75[0x3]; - int _blendMode[5]; - unsigned int _bitflags; - Vector _cropOffset; - KAGE::Graphics::ImageBase* _spriteSheet; - ReferenceCountBase* _spriteSheetRefCount; -}; -LAYOUT32(offsetof(LayerState, _layerData) == 0x0); -LAYOUT32(offsetof(LayerState, _animation) == 0x4); -LAYOUT32(offsetof(LayerState, _spriteSheetPath) == 0x8); -LAYOUT32(offsetof(LayerState, _minFilterMode) == 0x20); -LAYOUT32(offsetof(LayerState, _magFilterMode) == 0x24); -LAYOUT32(offsetof(LayerState, _wrapSMode) == 0x28); -LAYOUT32(offsetof(LayerState, _wrapTMode) == 0x2c); -LAYOUT32(offsetof(LayerState, _spriteSheetLoaded) == 0x30); -LAYOUT32(offsetof(LayerState, _isUnknown31) == 0x31); -LAYOUT32(offsetof(LayerState, _flipX) == 0x32); -LAYOUT32(offsetof(LayerState, _flipY) == 0x33); -LAYOUT32(offsetof(LayerState, _size) == 0x34); -LAYOUT32(offsetof(LayerState, _rotation) == 0x3c); -LAYOUT32(offsetof(LayerState, _pos) == 0x40); -LAYOUT32(offsetof(LayerState, _color) == 0x48); -LAYOUT32(offsetof(LayerState, _visible) == 0x74); -LAYOUT32(offsetof(LayerState, _blendMode) == 0x78); -LAYOUT32(offsetof(LayerState, _bitflags) == 0x8c); -LAYOUT32(offsetof(LayerState, _cropOffset) == 0x90); -LAYOUT32(offsetof(LayerState, _spriteSheet) == 0x98); -LAYOUT32(offsetof(LayerState, _spriteSheetRefCount) == 0x9c); - struct Level { void * GetCurrentRoom(); // 00407480 void SetStateFlag(int flag, uint8_t isSet); // 00428a80 @@ -9626,161 +9110,6 @@ LAYOUT32(offsetof(SoundEffects, _sounds) == 0x0); LAYOUT32(offsetof(SoundEffects, _volumeModifier) == 0x10); LAYOUT32(offsetof(SoundEffects, _volumeModifierStep) == 0x14); -struct OptionsConfig { - uint8_t read_bool(uint8_t *key, uint8_t isDefault); // 006841d0 - void reset_defaults(); // 00924000 - void load_config_ini(); // 00924180 - void Load(uint8_t *path); // 00924440 - void Save(); // 00924d10 - void SetMusicVolume(float volume); // 00925c00 - void set_fullscreen(uint8_t isFullscreen); // 00925c60 - void set_vsync(uint32_t param_2); // 00925ce0 - - std_string _optionsIniFilePath; - float _musicVolume; - float _sfxVolume; - float _mapOpacity; - bool _isFullscreen; - bool _filterEnabled; - uint8_t _pad_0x26[0x2]; - float _gamma; - float _exposure; - float _brightness; - float _contrast; - bool _controlHotplugEnabled; - uint8_t _pad_0x39[0x3]; - int _popupsMode; - bool _enableFoundHUD; - uint8_t _pad_0x41[0x3]; - int _cameraStyle; - int _historyHudMode; - float _hudOffset; - bool _tryImportSave; - bool _enableMods; - bool _enableRumble; - bool _enableChargeBars; - bool _enableBulletVisibility; - bool _enableAimLock; - uint8_t _pad_0x56[0x2]; - int _touchMode; - bool _enableDebugConsole; - uint8_t _pad_0x5d[0x3]; - int _consoleFont; - bool _enableFadedConsoleDisplay; - bool _enableSaveCommandHistory; - bool _isExclusiveFullscreen; - bool _enableVSync; - bool _enableSteamCloud; - bool _enablePauseOnFocusLost; - bool _enableMouseControl; - uint8_t _pad_0x6b[0x1]; - int _maxScale; - int _maxRenderScale; - int _windowWidth; - int _windowHeight; - int _windowPosX; - int _windowPosY; - bool _enableInterpolation; - bool _enableEpicOverlay; - bool _enableColorCorrection; - bool _enableLighting; - bool _enableShockwave; - bool _enableCaustics; - bool _enableFilter; - bool _enablePixelation; - bool _enableBloom; - bool _enableWaterSurface; - bool _getsSetToEnableWaterSurface; - bool _enableColorModifier; - bool _bossHpOnBottom; - uint8_t _pad_0x91[0x3]; - int _announcerVoiceMode; - int _jacobEsauControls; - bool _ascentVoiceover; - uint8_t _pad_0x9d[0x3]; - int _onlineHud; - bool _streamerMode; - uint8_t _pad_0xa5[0x3]; - int _onlinePlayerVolume; - int _onlinePlayerOpacity; - bool _onlineChatEnabled; - bool _onlineFilterEnabled; - uint8_t _pad_0xb2[0x2]; - int _onlineColorSet; - int _onlineInputDelay; - bool _itemInfoDisplayEnabled; - uint8_t _pad_0xbd[0x3]; - int _eosCrossplay; - bool _acceptedPublicBeta_VERSION; - bool _acceptedDataCollectionDisclaimer; -}; -LAYOUT32(offsetof(OptionsConfig, _optionsIniFilePath) == 0x0); -LAYOUT32(offsetof(OptionsConfig, _musicVolume) == 0x18); -LAYOUT32(offsetof(OptionsConfig, _sfxVolume) == 0x1c); -LAYOUT32(offsetof(OptionsConfig, _mapOpacity) == 0x20); -LAYOUT32(offsetof(OptionsConfig, _isFullscreen) == 0x24); -LAYOUT32(offsetof(OptionsConfig, _filterEnabled) == 0x25); -LAYOUT32(offsetof(OptionsConfig, _gamma) == 0x28); -LAYOUT32(offsetof(OptionsConfig, _exposure) == 0x2c); -LAYOUT32(offsetof(OptionsConfig, _brightness) == 0x30); -LAYOUT32(offsetof(OptionsConfig, _contrast) == 0x34); -LAYOUT32(offsetof(OptionsConfig, _controlHotplugEnabled) == 0x38); -LAYOUT32(offsetof(OptionsConfig, _popupsMode) == 0x3c); -LAYOUT32(offsetof(OptionsConfig, _enableFoundHUD) == 0x40); -LAYOUT32(offsetof(OptionsConfig, _cameraStyle) == 0x44); -LAYOUT32(offsetof(OptionsConfig, _historyHudMode) == 0x48); -LAYOUT32(offsetof(OptionsConfig, _hudOffset) == 0x4c); -LAYOUT32(offsetof(OptionsConfig, _tryImportSave) == 0x50); -LAYOUT32(offsetof(OptionsConfig, _enableMods) == 0x51); -LAYOUT32(offsetof(OptionsConfig, _enableRumble) == 0x52); -LAYOUT32(offsetof(OptionsConfig, _enableChargeBars) == 0x53); -LAYOUT32(offsetof(OptionsConfig, _enableBulletVisibility) == 0x54); -LAYOUT32(offsetof(OptionsConfig, _enableAimLock) == 0x55); -LAYOUT32(offsetof(OptionsConfig, _touchMode) == 0x58); -LAYOUT32(offsetof(OptionsConfig, _enableDebugConsole) == 0x5c); -LAYOUT32(offsetof(OptionsConfig, _consoleFont) == 0x60); -LAYOUT32(offsetof(OptionsConfig, _enableFadedConsoleDisplay) == 0x64); -LAYOUT32(offsetof(OptionsConfig, _enableSaveCommandHistory) == 0x65); -LAYOUT32(offsetof(OptionsConfig, _isExclusiveFullscreen) == 0x66); -LAYOUT32(offsetof(OptionsConfig, _enableVSync) == 0x67); -LAYOUT32(offsetof(OptionsConfig, _enableSteamCloud) == 0x68); -LAYOUT32(offsetof(OptionsConfig, _enablePauseOnFocusLost) == 0x69); -LAYOUT32(offsetof(OptionsConfig, _enableMouseControl) == 0x6a); -LAYOUT32(offsetof(OptionsConfig, _maxScale) == 0x6c); -LAYOUT32(offsetof(OptionsConfig, _maxRenderScale) == 0x70); -LAYOUT32(offsetof(OptionsConfig, _windowWidth) == 0x74); -LAYOUT32(offsetof(OptionsConfig, _windowHeight) == 0x78); -LAYOUT32(offsetof(OptionsConfig, _windowPosX) == 0x7c); -LAYOUT32(offsetof(OptionsConfig, _windowPosY) == 0x80); -LAYOUT32(offsetof(OptionsConfig, _enableInterpolation) == 0x84); -LAYOUT32(offsetof(OptionsConfig, _enableEpicOverlay) == 0x85); -LAYOUT32(offsetof(OptionsConfig, _enableColorCorrection) == 0x86); -LAYOUT32(offsetof(OptionsConfig, _enableLighting) == 0x87); -LAYOUT32(offsetof(OptionsConfig, _enableShockwave) == 0x88); -LAYOUT32(offsetof(OptionsConfig, _enableCaustics) == 0x89); -LAYOUT32(offsetof(OptionsConfig, _enableFilter) == 0x8a); -LAYOUT32(offsetof(OptionsConfig, _enablePixelation) == 0x8b); -LAYOUT32(offsetof(OptionsConfig, _enableBloom) == 0x8c); -LAYOUT32(offsetof(OptionsConfig, _enableWaterSurface) == 0x8d); -LAYOUT32(offsetof(OptionsConfig, _getsSetToEnableWaterSurface) == 0x8e); -LAYOUT32(offsetof(OptionsConfig, _enableColorModifier) == 0x8f); -LAYOUT32(offsetof(OptionsConfig, _bossHpOnBottom) == 0x90); -LAYOUT32(offsetof(OptionsConfig, _announcerVoiceMode) == 0x94); -LAYOUT32(offsetof(OptionsConfig, _jacobEsauControls) == 0x98); -LAYOUT32(offsetof(OptionsConfig, _ascentVoiceover) == 0x9c); -LAYOUT32(offsetof(OptionsConfig, _onlineHud) == 0xa0); -LAYOUT32(offsetof(OptionsConfig, _streamerMode) == 0xa4); -LAYOUT32(offsetof(OptionsConfig, _onlinePlayerVolume) == 0xa8); -LAYOUT32(offsetof(OptionsConfig, _onlinePlayerOpacity) == 0xac); -LAYOUT32(offsetof(OptionsConfig, _onlineChatEnabled) == 0xb0); -LAYOUT32(offsetof(OptionsConfig, _onlineFilterEnabled) == 0xb1); -LAYOUT32(offsetof(OptionsConfig, _onlineColorSet) == 0xb4); -LAYOUT32(offsetof(OptionsConfig, _onlineInputDelay) == 0xb8); -LAYOUT32(offsetof(OptionsConfig, _itemInfoDisplayEnabled) == 0xbc); -LAYOUT32(offsetof(OptionsConfig, _eosCrossplay) == 0xc0); -LAYOUT32(offsetof(OptionsConfig, _acceptedPublicBeta_VERSION) == 0xc4); -LAYOUT32(offsetof(OptionsConfig, _acceptedDataCollectionDisclaimer) == 0xc5); - struct ModManager { ~ModManager(); // 008f2ff0 void LoadModContent(); // 008f30d0 @@ -9803,7 +9132,7 @@ struct ModManager { std_vector _mods; RedirectedPath* _redirectedPathsMap[32768]; uint8_t _pad_0x2000c[0x13c]; - ANM2 _modDefaultsSprite; + uint8_t _modDefaultsSprite[0x114]; // ANM2 int _modBanStatus; }; LAYOUT32(offsetof(ModManager, _mods) == 0x0); @@ -9812,27 +9141,6 @@ LAYOUT32(offsetof(ModManager, _modDefaultsSprite) == 0x20148); LAYOUT32(offsetof(ModManager, _modBanStatus) == 0x2025c); LAYOUT32(sizeof(ModManager) == 0x20260); -struct StringTable { - static void constructor(); // 00a26710 - uint8_t Load(uint8_t *fileName); // 00a26810 - void clear(); // 00a26920 - uint8_t * translate(uint8_t *key); // 00a26a30 - uint8_t * get_string(uint8_t *category, int language, uint8_t *key, uint8_t *outIsMissing); // 00a26af0 - uint8_t * get_string_by_index(uint8_t *category, int language, uint32_t keyIndex); // 00a26d30 - static uint32_t load_file(uint8_t *param_1); // 00a26f20 - static uint32_t load_xml(); // 00a27038 - - int _language; - std_map _languages; - std_map _categories; - char* _defaultCategory; -}; -LAYOUT32(offsetof(StringTable, _language) == 0x0); -LAYOUT32(offsetof(StringTable, _languages) == 0x4); -LAYOUT32(offsetof(StringTable, _categories) == 0xc); -LAYOUT32(offsetof(StringTable, _defaultCategory) == 0x14); -LAYOUT32(sizeof(StringTable) == 0x18); - struct NetplayManager { uint8_t process_consolidated_messages(); // 008fd530 ~NetplayManager(); // 00906a90 @@ -9875,7 +9183,7 @@ struct NetplayManager { struct PopupButton { - ANM2 _sprite; + uint8_t _sprite[0x114]; // ANM2 float _slideOffset; float _targetSlideOffset; int _textFrame; @@ -9968,8 +9276,7 @@ struct Manager { MusicManager _musicManager; uint8_t _pad_0x2a2e5[0x3f]; SoundEffects _sfxManager; - OptionsConfig _optionsConfig; - uint8_t _pad_0x2a402[0x2]; + uint8_t _optionsConfig[0xc8]; // OptionsConfig ItemConfig _itemConfig; InfoDisplay _infoDisplay; uint8_t _pad_0x2a554[0x110]; @@ -9977,8 +9284,8 @@ struct Manager { EntityConfig _entityConfig; uint8_t _pad_0x2a6a0[0x20]; ModManager _modManager; - StringTable _stringTable; - StringTable _stringTablePc; + uint8_t _stringTable[0x18]; // StringTable + uint8_t _stringTablePc[0x18]; // StringTable PopupButtons _popupButtons; unsigned int _framecount; int _consecutiveResetCount; @@ -9989,21 +9296,21 @@ struct Manager { uint8_t _pad_0x4abd2[0x2]; int _activeControllerIndex; uint8_t _pad_0x4abd8[0xc]; - ANM2 _buttonsSprite; - ANM2 _platformIconsSprite; - uint8_t _pad_0x4ae0c[0x1c]; - Font _font1_TeamMeatEx10; - Font _font2_TeamMeatEx12; - Font _font3_TeamMeatEx16; - Font _font4_terminus; - Font _font5_terminus8; - Font _font6_PFTempestaSevenCondensed; - Font _font7_Upheaval; - Font _font8_LuaMiniOutlined; - Font _font9_PFTempestaSevenCondensedAgain; + uint8_t _buttonsSprite[0x114]; // ANM2 + uint8_t _platformIconsSprite[0x130]; // ANM2 + uint8_t _font1_TeamMeatEx10[0x4c]; // Font + uint8_t _font2_TeamMeatEx12[0x4c]; // Font + uint8_t _font3_TeamMeatEx16[0x4c]; // Font + uint8_t _font4_terminus[0x4c]; // Font + uint8_t _font5_terminus8[0x4c]; // Font + uint8_t _font6_PFTempestaSevenCondensed[0x4c]; // Font + uint8_t _font7_Upheaval[0x4c]; // Font + uint8_t _font8_LuaMiniOutlined[0x4c]; // Font + uint8_t _font9_PFTempestaSevenCondensedAgain[0x4c]; // Font int _selectedDifficulty; LobbySettings _lobbySettings; - uint8_t _pad_0x4b10c[0x24]; + uint8_t _pad_0x4b10c[0x20]; + int _framesPerSecond; bool _starting; bool _rerunAvailable; bool _startingFromRerun; @@ -10027,7 +9334,7 @@ struct Manager { KColor _pendingMenuFadeColor; bool _isNightmarePending; uint8_t _pad_0x4b2a5[0x3]; - ANM2 _cursorSprite; + uint8_t _cursorSprite[0x114]; // ANM2 Vector _lastMousePosition; int _cursorVisibleTimer; uint8_t _pad_0x4b3c8[0x1]; @@ -10078,6 +9385,7 @@ LAYOUT32(offsetof(Manager, _font8_LuaMiniOutlined) == 0x4b03c); LAYOUT32(offsetof(Manager, _font9_PFTempestaSevenCondensedAgain) == 0x4b088); LAYOUT32(offsetof(Manager, _selectedDifficulty) == 0x4b0d4); LAYOUT32(offsetof(Manager, _lobbySettings) == 0x4b0d8); +LAYOUT32(offsetof(Manager, _framesPerSecond) == 0x4b12c); LAYOUT32(offsetof(Manager, _starting) == 0x4b130); LAYOUT32(offsetof(Manager, _rerunAvailable) == 0x4b131); LAYOUT32(offsetof(Manager, _startingFromRerun) == 0x4b132); @@ -10176,7 +9484,7 @@ struct Menu_Title { float PositionX; float PositionY; - ANM2 TitleScreenSprite; + uint8_t TitleScreenSprite[0x114]; // ANM2 }; LAYOUT32(offsetof(Menu_Title, PositionX) == 0x0); LAYOUT32(offsetof(Menu_Title, PositionY) == 0x4); @@ -10211,8 +9519,8 @@ struct Menu_Game { int SelectedElement; float PositionX; float PositionY; - ANM2 GameMenuSprite; - ANM2 ContinueWidgetSprite; + uint8_t GameMenuSprite[0x114]; // ANM2 + uint8_t ContinueWidgetSprite[0x114]; // ANM2 }; LAYOUT32(offsetof(Menu_Game, KeyDownTimer) == 0x0); LAYOUT32(offsetof(Menu_Game, SelectedElement) == 0x4); @@ -10267,30 +9575,30 @@ struct Menu_Character { float _greedDecoAlpha; float _PositionX; float _PositionY; - ANM2 _BigCharPageSprite; - ANM2 _DifficultyOverlaySprite; - ANM2 _GreedDecoOverlaySprite; - ANM2 _CharacterMenuBGSprite; + uint8_t _BigCharPageSprite[0x114]; // ANM2 + uint8_t _DifficultyOverlaySprite[0x114]; // ANM2 + uint8_t _GreedDecoOverlaySprite[0x114]; // ANM2 + uint8_t _CharacterMenuBGSprite[0x114]; // ANM2 uint8_t _completionWidget[0x11c]; // CompletionWidget - ANM2 _DifficultyPageSprite; - ANM2 _SeedPageSprite; - ANM2 _WinStreakPageSprite; - ANM2 _EastereggPageSprite; + uint8_t _DifficultyPageSprite[0x114]; // ANM2 + uint8_t _SeedPageSprite[0x114]; // ANM2 + uint8_t _WinStreakPageSprite[0x114]; // ANM2 + uint8_t _EastereggPageSprite[0x114]; // ANM2 Vector _eastereggPagePosition; - ANM2 _SeedUnlockPageSprite; + uint8_t _SeedUnlockPageSprite[0x114]; // ANM2 int _numCharacters; int _numCharacters_MINUS_SelectedEntry; - ANM2 _CharacterPortraitsSprite; + uint8_t _CharacterPortraitsSprite[0x114]; // ANM2 float _horizontalScrollPosition; std_vector _portraitPositions; std_vector _portraitScales; - ANM2 _SeedEntrySprite; + uint8_t _SeedEntrySprite[0x114]; // ANM2 std_string _seedText; int _seedUnlockPageState; int _seedUnlockPageTimer; uint8_t _pad_0xd84[0x30]; int _characterMenuShown; - ANM2 _PageSwapWidgetSprite; + uint8_t _PageSwapWidgetSprite[0x114]; // ANM2 uint8_t _TaintedMenuBGDecoSprite[0x4]; // ANM2 }; LAYOUT32(offsetof(Menu_Character, Status) == 0x0); @@ -10343,7 +9651,7 @@ struct Menu_SpecialSeeds { float PositionX; float PositionY; uint8_t _pad_0x14[0x8]; - ANM2 SpecialSeedsSprite; + uint8_t SpecialSeedsSprite[0x114]; // ANM2 }; LAYOUT32(offsetof(Menu_SpecialSeeds, State) == 0x0); LAYOUT32(offsetof(Menu_SpecialSeeds, SelectedElement) == 0x4); @@ -10365,7 +9673,7 @@ struct Menu_Challenge { int HoldInputTimer; float PositionX; float PositionY; - ANM2 ChallengeMenuSprite; + uint8_t ChallengeMenuSprite[0x114]; // ANM2 }; LAYOUT32(offsetof(Menu_Challenge, SelectedChallengeID) == 0x4); LAYOUT32(offsetof(Menu_Challenge, HoldInputTimer) == 0x8); @@ -10386,9 +9694,8 @@ struct Menu_Collection { float PositionX; float PositionY; int SelectedElement; - ANM2 CollectionMenuSprite; - ANM2 DeathScreenSprite; - uint8_t _pad_0x23c[0xc]; + uint8_t CollectionMenuSprite[0x114]; // ANM2 + uint8_t DeathScreenSprite[0x120]; // ANM2 float MoveXAxisDirection; float MoveYAxisDirection; uint8_t _pad_0x250[0xc]; @@ -10426,25 +9733,25 @@ struct Menu_Stats { int _statsMenuCurrentSelection; float _PositionX; float _PositionY; - ANM2 _StatsMenuSprite; + uint8_t _StatsMenuSprite[0x114]; // ANM2 bool _isAchievementScreenVisible; uint8_t _pad_0x131[0x3]; float _achievementScrollInPosition; float _achievementScrollThruListPosition; int _selectedAchievmentId; int _IconIDtoUseForAchievementID[642]; - ANM2 _achievementsSprite; - ANM2 _achievementMiniSprite1; - ANM2 _achievementMiniSprite2; - ANM2 _achievementMiniSprite3; - ANM2 _achievementMiniSprite4; - ANM2 _achievementMiniSprite5; - ANM2 _achievementMiniSprite6; - ANM2 _achievementMiniSprite7; - ANM2 _achievementMiniSprite8; - ANM2 _achievementMiniSprite9; - ANM2 _cursorLeftSprite; - ANM2 _cursorRightSprite; + uint8_t _achievementsSprite[0x114]; // ANM2 + uint8_t _achievementMiniSprite1[0x114]; // ANM2 + uint8_t _achievementMiniSprite2[0x114]; // ANM2 + uint8_t _achievementMiniSprite3[0x114]; // ANM2 + uint8_t _achievementMiniSprite4[0x114]; // ANM2 + uint8_t _achievementMiniSprite5[0x114]; // ANM2 + uint8_t _achievementMiniSprite6[0x114]; // ANM2 + uint8_t _achievementMiniSprite7[0x114]; // ANM2 + uint8_t _achievementMiniSprite8[0x114]; // ANM2 + uint8_t _achievementMiniSprite9[0x114]; // ANM2 + uint8_t _cursorLeftSprite[0x114]; // ANM2 + uint8_t _cursorRightSprite[0x114]; // ANM2 AchievementOverlay_Entry _achievementOverlayEntries[642]; uint8_t _pad_0x6878[0x3228]; int _achievementIDList[642]; @@ -10501,8 +9808,8 @@ struct Menu_Options { float PositionX; float PositionY; uint8_t _pad_0x1c[0x8]; - ANM2 OptionsSprite; - ANM2 GammaMenuSprite; + uint8_t OptionsSprite[0x114]; // ANM2 + uint8_t GammaMenuSprite[0x114]; // ANM2 int HoldLeftCounter; int HoldRightCounter; int HoldUpDownCounter; @@ -10527,7 +9834,7 @@ struct Menu_ControllerSelect { int SelectedElement; float PositionX; float PositionY; - ANM2 ControllerSelectSprite; + uint8_t ControllerSelectSprite[0x114]; // ANM2 }; LAYOUT32(offsetof(Menu_ControllerSelect, HoldInputTimer) == 0x0); LAYOUT32(offsetof(Menu_ControllerSelect, SelectedElement) == 0x4); @@ -10547,7 +9854,7 @@ struct Menu_KeyConfig { int SelectedColumn; float PositionX; float PositionY; - ANM2 KeyConfigSprite; + uint8_t KeyConfigSprite[0x114]; // ANM2 }; LAYOUT32(offsetof(Menu_KeyConfig, State) == 0x0); LAYOUT32(offsetof(Menu_KeyConfig, SelectedElement) == 0x4); @@ -10565,7 +9872,7 @@ struct Menu_Cutscenes { int SelectedElement; float PositionX; float PositionY; - ANM2 CutscenesMenuSprite; + uint8_t CutscenesMenuSprite[0x114]; // ANM2 }; LAYOUT32(offsetof(Menu_Cutscenes, HoldInputTimer) == 0x0); LAYOUT32(offsetof(Menu_Cutscenes, SelectedElement) == 0x4); @@ -10606,8 +9913,7 @@ struct Menu_Online { static void render_descriptions(); // 008e6a80 uint8_t _pad_0x0[0x4]; - ANM2 _anm2; - uint8_t _pad_0x118[0x114]; + uint8_t _anm2[0x228]; // ANM2 int _prevState; int _state; }; @@ -10642,8 +9948,7 @@ struct MenuManager { uint8_t _pad_0x38[0x8]; int _selectedMenuID; Vector _ViewPosition; - ANM2 _MenuShadowSprite; - uint8_t _pad_0x160[0x18]; + uint8_t _MenuShadowSprite[0x12c]; // ANM2 Seeds _seedsObject; Menu_Title _menuTitle; uint8_t _pad_0x2f0[0x4]; @@ -10669,10 +9974,8 @@ struct MenuManager { uint8_t _menuCustomChallenge[0x124]; // Menu_CustomChallenge uint8_t _menuMods[0x12c]; // Menu_Mods uint8_t _menuOnline[0x4]; // Menu_Online - ANM2 _onlineMenuSprite; - uint8_t _pad_0xdbb0[0x1a1c]; - ANM2 _onlineStatsMenuSprite; - uint8_t _pad_0xf6e0[0x24]; + uint8_t _onlineMenuSprite[0x1b30]; // ANM2 + uint8_t _onlineStatsMenuSprite[0x138]; // ANM2 Vector _viewPositionSet[23]; bool _shouldLerpColorModState; uint8_t _pad_0xf7bd[0x3]; @@ -10839,7 +10142,7 @@ struct ModEntry { bool _loaded; bool _isOutdated; uint8_t _pad_0xff[0x1]; - ANM2 _contentSprites[13]; + uint8_t _contentSprites[0xe04]; // ANM2[13] }; LAYOUT32(offsetof(ModEntry, _directory) == 0x0); LAYOUT32(offsetof(ModEntry, _name) == 0x18); @@ -11063,30 +10366,6 @@ struct NpcHelper { }; -struct NullFrame { - Vector _pos; - int _duration; - bool _visible; - uint8_t _pad_0xd[0x3]; - Vector _scale; - ColorMod _color; - float _rotation; - bool _interpolated; - uint8_t _pad_0x49[0x3]; - int _startFrame; - int _endFrame; -}; -LAYOUT32(offsetof(NullFrame, _pos) == 0x0); -LAYOUT32(offsetof(NullFrame, _duration) == 0x8); -LAYOUT32(offsetof(NullFrame, _visible) == 0xc); -LAYOUT32(offsetof(NullFrame, _scale) == 0x10); -LAYOUT32(offsetof(NullFrame, _color) == 0x18); -LAYOUT32(offsetof(NullFrame, _rotation) == 0x44); -LAYOUT32(offsetof(NullFrame, _interpolated) == 0x48); -LAYOUT32(offsetof(NullFrame, _startFrame) == 0x4c); -LAYOUT32(offsetof(NullFrame, _endFrame) == 0x50); -LAYOUT32(sizeof(NullFrame) == 0x54); - struct OnlineChat { void render(Vector *position, uint8_t isInputLine, uint8_t isCursorVisible, float alpha); // 0091d2b0 static void destructor(); // 0091db20 @@ -11364,7 +10643,7 @@ struct RailManager { void * _room; uint8_t _pad_0x4[0x1c0]; - ANM2 _sprite; + uint8_t _sprite[0x114]; // ANM2 }; LAYOUT32(offsetof(RailManager, _room) == 0x0); LAYOUT32(offsetof(RailManager, _sprite) == 0x1c4); @@ -11412,35 +10691,6 @@ struct RenderTarget { }; -struct RichText { - ~RichText(); // 009efa10 - void load_font(std_string *fontPath); // 009efb60 - - std_string _fontPath; - Font _font; - RichTextIcon* _icons; -}; -LAYOUT32(offsetof(RichText, _fontPath) == 0x0); -LAYOUT32(offsetof(RichText, _font) == 0x18); -LAYOUT32(offsetof(RichText, _icons) == 0x64); - -struct RichTextIcon : ANM2 { - void render(Vector *pos, int iconType, int iconId, float alpha); // 009f24b0 - Vector * get_size(Vector *outSize); // 009f28b0 - static std_string * get_animation_name(std_string *outName, int iconType); // 009f2b10 - static void set_icon(int param_1, int param_2); // 009f2c10 - - float _maxHeight; - int _iconType; - int _iconId; - std_map _images; -}; -LAYOUT32(offsetof(RichTextIcon, _maxHeight) == 0x114); -LAYOUT32(offsetof(RichTextIcon, _iconType) == 0x118); -LAYOUT32(offsetof(RichTextIcon, _iconId) == 0x11c); -LAYOUT32(offsetof(RichTextIcon, _images) == 0x120); -LAYOUT32(sizeof(RichTextIcon) == 0x128); - struct RichTextSpan { uint8_t try_merge(void *other); // 009ef9a0 static void move_construct(void *dest, void *source); // 009f1ef0 @@ -11689,8 +10939,7 @@ struct Room { uint8_t _backdrop[0x150]; // Backdrop int _backdropType; uint8_t _pad_0x1d1c[0x5124]; - ANM2 _lightSprite; - uint8_t _pad_0x6f54[0x114]; + uint8_t _lightSprite[0x228]; // ANM2 int _shopLevel; int _shopRestockTimer; std_deque _shopItemDeque; @@ -12027,8 +11276,8 @@ struct Sprite { std_string _filename; std_string _animDefaultName; - AnimationState _animState; - AnimationState _overlayAnimState; + uint8_t _animState[0x20]; // AnimationState + uint8_t _overlayAnimState[0x20]; // AnimationState uint8_t _overlayRenderFirst; uint8_t _pad_0x71[0x3]; void * _animData; @@ -12114,14 +11363,6 @@ struct SteamCloudFile : KAGE::Filesys::FileStream { }; LAYOUT32(sizeof(SteamCloudFile) == 0x24); -struct StringTableCategory { - std_map _strings; - std_vector _keys; -}; -LAYOUT32(offsetof(StringTableCategory, _strings) == 0x0); -LAYOUT32(offsetof(StringTableCategory, _keys) == 0x8); -LAYOUT32(sizeof(StringTableCategory) == 0x14); - struct TearParams { void constructor(); // 005cd690 TearParams * operator_(TearParams *other); // 006075a0 diff --git a/generated-src/completion_widget.cpp b/generated-src/completion_widget.cpp index 610ecab..3402817 100644 --- a/generated-src/completion_widget.cpp +++ b/generated-src/completion_widget.cpp @@ -60,7 +60,7 @@ void CompletionWidget::Load() menuPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuPath._buf))) + 0x0))),"gfx/ui/DeedsMenu.anm2",0x16); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))))))->ANM2::Load(&menuPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))),&menuPath,1); local_14 = 0xffffffff; if (0xf < menuPath._capacity) { uVar3 = menuPath._capacity + 1; @@ -104,15 +104,15 @@ LAB_008ca3e5: if ((uVar3 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((this + 0x18)) != '\0')))) goto LAB_008ca419; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x11])) + 0x1)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x11])) + 0x1))))); *GHIDRA_CAST((this + 0x18)) = 1; } LAB_008ca419: if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x59])) + 0x2))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x11])) + 0x1)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x1c)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x11])) + 0x1))))); + AnimationState::Update(GHIDRA_CAST((this + 0x1c))); } characterIndex = 0; characterAnimData = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x6e])) + 0x2)))); @@ -128,7 +128,7 @@ LAB_008ca419: characterPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(characterPath._buf))) + 0x0))),"gfx/ui/DeedsMenu.anm2",0x16); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((characterAnimData + -0xd)))))->ANM2::Load(&characterPath,1); + ANM2::Load(GHIDRA_CAST((characterAnimData + -0xd)),&characterPath,1); local_14 = 0xffffffff; if (0xf < characterPath._capacity) { uVar3 = characterPath._capacity + 1; @@ -147,9 +147,9 @@ LAB_008ca419: (*GHIDRA_CAST((GHIDRA_CAST(&(characterPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(characterPath._buf)) + 0x0))) & 0xffffff00; if (animData == GHIDRA_CAST(0x0)) { LAB_008ca543: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((characterAnimData + -0xd)))))->ANM2::SetAnimation(GHIDRA_CAST("PlayerCharacter"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((characterAnimData + -0xd)),GHIDRA_CAST("PlayerCharacter"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((characterAnimData + -1)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((characterAnimData + -1))); *GHIDRA_CAST((characterAnimData + 4)) = 1; } } @@ -180,8 +180,8 @@ LAB_008ca535: goto LAB_008ca543; } if (*GHIDRA_CAST((GHIDRA_CAST(characterAnimData) + 0xd5)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((characterAnimData + -1)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((characterAnimData + 7)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((characterAnimData + -1))); + AnimationState::Update(GHIDRA_CAST((characterAnimData + 7))); } characterAnimData = characterAnimData + 0x45; characterIndex = characterIndex + 1; diff --git a/generated-src/console.cpp b/generated-src/console.cpp index 364e907..4b78ef2 100644 --- a/generated-src/console.cpp +++ b/generated-src/console.cpp @@ -2726,7 +2726,7 @@ LAB_00689e10: pcVar4 = GHIDRA_CAST(FUN_00694120(uVar16)); cleanupFlags = cleanupFlags | 2; pbVar10 = (GHIDRA_CAST((pcVar4)))->msvc::string::c_str(); - iVar3 = (GHIDRA_CAST((font)))->Font::GetStringWidth(pbVar10); + iVar3 = Font::GetStringWidth(font,pbVar10); local_1bd = '\x01'; if (g_screenWidth - 20.0 < (float)iVar3) goto LAB_00689e7f; } @@ -3559,7 +3559,7 @@ LAB_0068be32: lineEnd = *GHIDRA_CAST(lineEnd); } local_28._alpha = (float)local_3c; - (GHIDRA_CAST((font)))->Font::DrawString(lineEnd,&local_28,&fontSettings,textX,textY); + Font::DrawString(font,lineEnd,&local_28,&fontSettings,textX,textY); textY = textY - unk; local_8 = 0xffffffff; pvVar6 = extraout_EAX_00; @@ -3763,7 +3763,7 @@ LAB_0068c393: if (0xf < *GHIDRA_CAST((pbVar7 + 0x14))) { pbVar2 = *GHIDRA_CAST(pbVar7); } - pvVar1 = (GHIDRA_CAST((local_80)))->Font::measure_string(&quadColor._green,pbVar2,&local_40,&g_vectorOne); + pvVar1 = Font::measure_string(local_80,&quadColor._green,pbVar2,&local_40,&g_vectorOne); local_14 = GHIDRA_CAST(CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),1)); color._blue = 0.8862745; color._red = 0.5411765; @@ -3838,7 +3838,7 @@ LAB_0068c393: if (0xf < local_28) { ppppbVar4 = local_3c; } - iVar8 = (GHIDRA_CAST((local_80)))->Font::get_string_width_n(GHIDRA_CAST(ppppbVar4),-1); + iVar8 = Font::get_string_width_n(local_80,GHIDRA_CAST(ppppbVar4),-1); cursorX = ((float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]) + 10.0) - 1.0; if (0xf < local_28) { uVar6 = local_28 + 1; @@ -3886,7 +3886,7 @@ LAB_0068c393: if (0xf < local_28) { ppppbVar4 = local_3c; } - iVar8 = (GHIDRA_CAST((local_80)))->Font::get_string_width_n(GHIDRA_CAST(ppppbVar4),-1); + iVar8 = Font::get_string_width_n(local_80,GHIDRA_CAST(ppppbVar4),-1); cursorX = ((float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)]) + 10.0) - 1.0; if (0xf < local_28) { uVar6 = local_28 + 1; @@ -3926,7 +3926,7 @@ LAB_0068c99b: if (0xf < lineTextCapacity) { ppppbVar4 = lineText[0]; } - pvVar1 = (GHIDRA_CAST((local_80)))->Font::measure_string(&quadColor._green,GHIDRA_CAST(ppppbVar4),&local_40,&g_vectorOne) + pvVar1 = Font::measure_string(local_80,&quadColor._green,GHIDRA_CAST(ppppbVar4),&local_40,&g_vectorOne) ; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 7; color_01._blue = 0.18431373; @@ -6993,7 +6993,7 @@ LAB_006926e9: } if (cursor == GHIDRA_CAST((param_1[4] + GHIDRA_INT(lineText)))) break; charText[0] = *cursor; - iVar4 = (GHIDRA_CAST((local_18)))->Font::get_string_width_n(charText,-1); + iVar4 = Font::get_string_width_n(local_18,charText,-1); lineWidth = lineWidth + iVar4; if (g_screenWidth - 20.0 < (float)((double)lineWidth + __uint_to_double_fixup[-(lineWidth >> 0x1f)])) { diff --git a/generated-src/cutscene.cpp b/generated-src/cutscene.cpp index 4a9712c..448a7ce 100644 --- a/generated-src/cutscene.cpp +++ b/generated-src/cutscene.cpp @@ -268,7 +268,7 @@ LAB_0095d16d: pbStack_10114[0x7e] = 0; pbStack_10114[0x7f] = 0; part = pbStack_10114; - (GHIDRA_CAST((GHIDRA_CAST((pbStack_10114 + 0x80)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((pbStack_10114 + 0x80))); part[0x194] = 0; part[0x195] = 0; part[0x196] = 0; @@ -1038,9 +1038,9 @@ LAB_0095dcb6: pbVar14[0x37] = 0x3f; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 8; *GHIDRA_CAST(pbVar14) = IsaacRepentancePlus::Cutscene::TemporaryPart::vftable; - (GHIDRA_CAST((GHIDRA_CAST((pbVar14 + 0x40)))))->Font::Font(); + Font::Font(GHIDRA_CAST((pbVar14 + 0x40))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 9; - (GHIDRA_CAST((GHIDRA_CAST((pbVar14 + 0x8c)))))->Font::Font(); + Font::Font(GHIDRA_CAST((pbVar14 + 0x8c))); local_14 = GHIDRA_CAST(CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10)); (GHIDRA_CAST((GHIDRA_CAST((pbVar14 + 0xd8)))))->msvc::string::string(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8))) + iVar6); pbVar14[0xf0] = 0; @@ -1423,15 +1423,15 @@ void Cutscene::Show(int cutsceneid) uVar2 = uVar2 << (sbyte)((uint64_t)rngShifts >> 0x20) ^ uVar2; uVar2 = uVar2 >> (sbyte)cutsceneid ^ uVar2; if ((uVar2 & 1) == 0) { - layer = (GHIDRA_CAST((partSprite)))->ANM2::GetLayer(*GHIDRA_CAST((&UNK_00b7c970 + layerOffset))); + layer = ANM2::GetLayer(partSprite,*GHIDRA_CAST((&UNK_00b7c970 + layerOffset))); shownLayerName = *GHIDRA_CAST((&UNK_00b7c930 + layerOffset)); } else { - layer = (GHIDRA_CAST((partSprite)))->ANM2::GetLayer(*GHIDRA_CAST((&UNK_00b7c930 + layerOffset))); + layer = ANM2::GetLayer(partSprite,*GHIDRA_CAST((&UNK_00b7c930 + layerOffset))); shownLayerName = *GHIDRA_CAST((&UNK_00b7c970 + layerOffset)); } layer->_visible = 0; - layer = (GHIDRA_CAST((partSprite)))->ANM2::GetLayer(shownLayerName); + layer = ANM2::GetLayer(partSprite,shownLayerName); layerOffset = layerOffset + 4; layer->_visible = 1; } while (layerOffset < 0x3c); diff --git a/generated-src/cutscene/anm2_part.cpp b/generated-src/cutscene/anm2_part.cpp index 48a0f66..464fd98 100644 --- a/generated-src/cutscene/anm2_part.cpp +++ b/generated-src/cutscene/anm2_part.cpp @@ -25,9 +25,9 @@ void Cutscene::ANM2Part::vfunc_3() if (0xf < *GHIDRA_CAST((GHIDRA_CAST(musicManager) + 0x6c))) { anim = *GHIDRA_CAST(anim); } - isAnimSet = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(musicManager) + 0x80)))))->ANM2::SetAnimation(anim,1); + isAnimSet = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(musicManager) + 0x80)),anim,1); if (isAnimSet != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(musicManager) + 0xb0)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(musicManager) + 0xb0))); *GHIDRA_CAST((GHIDRA_CAST(musicManager) + 0xc4)) = 1; } manager = g_manager; @@ -123,15 +123,15 @@ void Cutscene::ANM2Part::vfunc_4() diffSign = GHIDRA_INT((currentFrame - uVar3)) >> 0x1f; if ((GHIDRA_INT(((currentFrame - uVar3 ^ diffSign) - diffSign)) < 3) || (animFrameCount <= GHIDRA_INT(uVar3))) { if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x189)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0xb0)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0xd0)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(this) + 0xb0))); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(this) + 0xd0))); } } else { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x80)))))->ANM2::GetFrame(); + ANM2::GetFrame(GHIDRA_CAST((GHIDRA_INT(this) + 0x80))); KAGE_LogMessage(1,GHIDRA_CAST("Cutscene: correct anm2 timing: f%d -> f%d\n")); if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0xb4)) == 0) goto LAB_0095f882; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0xb0)))))->AnimationState::SetFrameFloat((float)uVar3); + AnimationState::SetFrameFloat(GHIDRA_CAST((GHIDRA_INT(this) + 0xb0)),(float)uVar3); } if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0xb4)) != 0) { floor((double)*GHIDRA_CAST((GHIDRA_CAST(this) + 0xc0))); diff --git a/generated-src/cutscene/temporary_part.cpp b/generated-src/cutscene/temporary_part.cpp index 53d5f47..3dc0b28 100644 --- a/generated-src/cutscene/temporary_part.cpp +++ b/generated-src/cutscene/temporary_part.cpp @@ -43,7 +43,7 @@ void Cutscene::TemporaryPart::vfunc_1() if (0xf < *GHIDRA_CAST((extraout_EAX + 0x14))) { fontPath = *GHIDRA_CAST(extraout_EAX); } - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x40)))))->Font::Load(fontPath,0); + Font::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x40)),fontPath,0); local_8 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_8))) + 0x1))) << 8)); if (0xf < redirectedPathCapacity) { uVar2 = redirectedPathCapacity + 1; @@ -86,7 +86,7 @@ LAB_0095fe96: if (0xf < *GHIDRA_CAST((extraout_EAX_00 + 0x14))) { fontPath = *GHIDRA_CAST(extraout_EAX_00); } - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x8c)))))->Font::Load(fontPath,0); + Font::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x8c)),fontPath,0); if (0xf < pathTextCapacity) { uVar2 = pathTextCapacity + 1; pcVar1 = pathText[0]; diff --git a/generated-src/cutscene_part.cpp b/generated-src/cutscene_part.cpp index cd71bcc..55e1dce 100644 --- a/generated-src/cutscene_part.cpp +++ b/generated-src/cutscene_part.cpp @@ -266,7 +266,7 @@ void CutscenePart::render_subtitles() local_14 = g_screenHeight - (float)(iVar2 + 1) * 12.0 * textScale; do { fVar5 = textScale; - iVar2 = (GHIDRA_CAST((font)))->Font::get_string_width_utf16(GHIDRA_CAST(*lineText),-1); + iVar2 = Font::get_string_width_utf16(font,GHIDRA_CAST(*lineText),-1); halfLineWidth = (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * fVar5 * 0.5; dVar6 = floor((double)halfLineWidth); diff --git a/generated-src/daily_challenge.cpp b/generated-src/daily_challenge.cpp index 7516e11..4012954 100644 --- a/generated-src/daily_challenge.cpp +++ b/generated-src/daily_challenge.cpp @@ -21,7 +21,7 @@ void DailyChallenge::Init(uint32_t dailyDate) this->_seed = 0; this->_specialDailyId = 0; this->_isPractice = 0; - (GHIDRA_CAST((&this->_params)))->ChallengeParam::Reset(); + ChallengeParam::Reset(&this->_params); (this->_params)._isPathTypeSet = 1; iVar2 = holiday_get_current(dailyDate); this->_specialDailyId = iVar2; diff --git a/generated-src/debug_renderer.cpp b/generated-src/debug_renderer.cpp index 6926790..6727fe4 100644 --- a/generated-src/debug_renderer.cpp +++ b/generated-src/debug_renderer.cpp @@ -116,7 +116,7 @@ void DebugRenderer::Render() if (0xf < *GHIDRA_CAST((local_28 + 0x14))) { textChars = *GHIDRA_CAST(local_28); } - (GHIDRA_CAST((&g_manager->_font8_LuaMiniOutlined)))->Font::DrawString(textChars,&color,&fontParams, + Font::DrawString(&g_manager->_font8_LuaMiniOutlined,textChars,&color,&fontParams, roomOffsetX + local_2c,roomOffsetY + local_44 / local_24); local_14 = 0xffffffff; break; diff --git a/generated-src/entity.cpp b/generated-src/entity.cpp index dd0c6fa..4a61c54 100644 --- a/generated-src/entity.cpp +++ b/generated-src/entity.cpp @@ -750,7 +750,7 @@ void Entity::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x40)))) = 0xffffffff; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x44)))) = 0xffffffff; - (GHIDRA_CAST((&this->_sprite)))->ANM2::constructor(); + ANM2::constructor(&this->_sprite); (this->_shadowOffset).y = 0.0; (this->_shadowOffset).x = 0.0; this->_valid = 0; @@ -923,9 +923,9 @@ void Entity::destructor() vector_0x3c_tidy(); msvc::vector::_Tidy(); local_8 = 2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_sprite); + AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_sprite)._animState); (GHIDRA_CAST(((this->_sprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->msvc::string::_Tidy_deallocate(); FUN_0041c7d0(); @@ -3447,7 +3447,7 @@ void Entity::ClearReferences() (this->_colorParams)._end = (this->_colorParams)._begin; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); (this->_collisionPoints)._end = (this->_collisionPoints)._begin; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Reset(); + ANM2::Reset(&this->_sprite); } return; } @@ -4819,8 +4819,8 @@ void Entity::Update() local_310 = GHIDRA_CAST((this->_sprite)._playbackSpeed); (this->_sprite)._playbackSpeed = (float)local_310 * this->_speedMultiplier; if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); local_320 = *GHIDRA_CAST(&this->_flags); uVar13 = *GHIDRA_CAST((GHIDRA_INT(&this->_flags) + 4)); } @@ -6108,7 +6108,7 @@ void Entity::Render(Vector *offset) offsetY = offset->y; (this->_renderPosition).x = (float)dVar1 / pixelScale + offset->x; (this->_renderPosition).y = (float)dVar2 / pixelScale + offsetY; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); } return; } @@ -6411,7 +6411,7 @@ uint8_t Entity::RenderShadowLayer(Vector *offset) if (layerName == GHIDRA_CAST(0xffffffff)) { return 0; } - shadowLayer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerName); + shadowLayer = ANM2::GetLayer(&this->_sprite,layerName); spriteColor = &(this->_sprite)._color; shadowLayer->_visible = 1; savedTint = spriteColor->_tint[0]; @@ -7137,10 +7137,10 @@ LAB_006b4a6a: (pEVar6->_posOffset).x = 0.0; (pEVar6->_posOffset).y = -10.0; if ((pEVar6->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(pEVar6->_sprite)._animState)))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(&(pEVar6->_sprite)._animState,1.0); } uVar5 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&pEStack_90->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&pEStack_90->_sprite,GHIDRA_CAST(0x0)); iVar7 = 1; if ((uVar5 & 4) == 0) { iVar7 = 6; @@ -7679,7 +7679,7 @@ Vector * Entity::GetNullOffset(Vector *outOffset, uint8_t *nullLayerName) Vector offset; if ((this->_sprite)._animState._animData != (void *)0x0) { - nullFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetNullFrame(nullLayerName); + nullFrame = AnimationState::GetNullFrame(&(this->_sprite)._animState,nullLayerName); if ((nullFrame != GHIDRA_CAST(0x0)) && (*GHIDRA_CAST((nullFrame + 3)) != '\0')) { offset.x = (*nullFrame / 0.65) * (this->_sprite)._scale.x; offset.y = (nullFrame[1] / 0.65) * (this->_sprite)._scale.y; @@ -7722,7 +7722,7 @@ Capsule * Entity::GetNullCapsule(Capsule *outCapsule, uint8_t *nullLayerName) Vector capsuleSize; if ((this->_sprite)._animState._animData != (void *)0x0) { - nullFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetNullFrame(nullLayerName); + nullFrame = AnimationState::GetNullFrame(&(this->_sprite)._animState,nullLayerName); if ((nullFrame != GHIDRA_CAST(0x0)) && (*GHIDRA_CAST((nullFrame + 3)) != '\0')) { capsuleSize.x = (this->_sprite)._scale.x; offsetX = (*nullFrame / 0.65) * capsuleSize.x; @@ -8798,12 +8798,12 @@ void Entity::DestroyRockGridAt(Vector *position, GridEntityDesc *desc, Entity *s local_5c = pEVar2; if (isNormalRock != '\0') { if (source != GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((&sourceSprite)))->ANM2::ANM2(&source->_sprite); + ANM2::ANM2(&sourceSprite,&source->_sprite); Isaac::SwapANM2(&pEVar2->_sprite,&sourceSprite); local_8 = 0.0; - this->ANM2::Reset(); - (GHIDRA_CAST((&sourceSprite._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&sourceSprite._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(this); + AnimationState::~AnimationState(&sourceSprite._overlayAnimState); + AnimationState::~AnimationState(&sourceSprite._animState); (GHIDRA_CAST((sourceSprite._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&sourceSprite))))->msvc::string::_Tidy_deallocate(); local_8 = -NAN; @@ -8811,7 +8811,7 @@ void Entity::DestroyRockGridAt(Vector *position, GridEntityDesc *desc, Entity *s if ((GridEntityType == 6) || (name = "rubble", GridEntityType == 0x1a)) { name = "rubble_alt"; } - anim = (GHIDRA_CAST((&pEVar2->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST(name)); + anim = ANM2::GetAnimationData(&pEVar2->_sprite,GHIDRA_CAST(name)); if (anim != GHIDRA_CAST(0x0)) { local_60 = *GHIDRA_CAST((anim + 0x30)); if (local_60 == 0.0) { @@ -8824,9 +8824,9 @@ void Entity::DestroyRockGridAt(Vector *position, GridEntityDesc *desc, Entity *s if (0xf < *GHIDRA_CAST((anim + 0x14))) { anim = *GHIDRA_CAST(anim); } - isAnimSet = (GHIDRA_CAST((&pEVar2->_sprite)))->ANM2::SetAnimation(anim,1); + isAnimSet = ANM2::SetAnimation(&pEVar2->_sprite,anim,1); if (((isAnimSet != 0) && ((pEVar2->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar2->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_4c)), + (AnimationState::SetFrameFloat(&(pEVar2->_sprite)._animState,(float)GHIDRA_INT(local_4c)), (pEVar2->_sprite)._animState._animData != (void *)0x0)) { (pEVar2->_sprite)._animState._isPlaying = 0; } @@ -8932,9 +8932,9 @@ void Entity::SetSpriteFrame(std_string *animName, int frame) if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - isAnimationSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + isAnimationSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if ((isAnimationSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)frame); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)frame); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } @@ -8950,9 +8950,9 @@ void Entity::SetSpriteOverlayFrame(std_string *anim, int frame) if (0xf < anim->_capacity) { anim = *GHIDRA_CAST(anim->_buf); } - isAnimationSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST(anim),1); + isAnimationSet = ANM2::SetOverlayAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if ((isAnimationSet != 0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)frame); + AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)frame); } return; } diff --git a/generated-src/entity_bomb.cpp b/generated-src/entity_bomb.cpp index d2859ae..74a2faf 100644 --- a/generated-src/entity_bomb.cpp +++ b/generated-src/entity_bomb.cpp @@ -117,7 +117,7 @@ void Entity_Bomb::Init(int type, int variant, int subType, uint32_t initSeed) this->_radiusMultiplier = 1.0; this->_stickyTarget = 0; if (this->_config != (void *)0x0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); } (this->_hitList)._end = (this->_hitList)._begin; variantLocal = this->_variant; @@ -156,9 +156,9 @@ LAB_006a2265: else if (((variantLocal == 4) || (variantLocal == 3)) || ((variantLocal == 8 || ((variantLocal == 0x11 || (variantLocal == 0x12)))))) { if (this->_subtype == 1) { - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("BombReturn"),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("BombReturn"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } (GHIDRA_CAST((g_game->_room)))->Room::GetFloorColorAt(&floorColor,&this->_pos,this->_size); @@ -172,7 +172,7 @@ LAB_006a2265: floorTint._tint[2] = floorColor._blue * 2.0; if ((this->_sprite)._layerCount != 0) { do { - pLVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerIndex); + pLVar4 = ANM2::GetLayer(&this->_sprite,layerIndex); if (pLVar4->_layerData == (void *)0x0) { layerName._buf[0] = '\0'; layerName._buf[1] = '\0'; @@ -227,9 +227,9 @@ LAB_006a2265: else { pbVar5 = GHIDRA_CAST("Pulse"); } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(pbVar5,1); + bVar2 = ANM2::SetAnimation(&this->_sprite,pbVar5,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_006a2468: @@ -390,14 +390,14 @@ void Entity_Bomb::Update() } fVar9 = -3.0; if ((this->_flags & 0x20) != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST(s_Idle),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST(s_Idle),0); if (this->_hasCostumes != 0) { costumeLoaded = &this->_bombCostumesSprites[0]._loaded; local_84 = &DAT_00000005; do { if (*costumeLoaded != 0) { - (GHIDRA_CAST((GHIDRA_CAST((costumeLoaded + -0xd9)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((costumeLoaded + -0xb9)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((costumeLoaded + -0xd9))); + AnimationState::Update(GHIDRA_CAST((costumeLoaded + -0xb9))); } costumeLoaded = costumeLoaded + 0x114; local_84 = local_84 + -1; @@ -514,28 +514,28 @@ LAB_006a2829: goto LAB_006a2a0d; } (this->_sprite)._rotation = 0.0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); this->_rocketSpeed = 0.0; } else { LAB_006a2a0d: if (((this->_sprite)._animState._animData != (void *)0x0) && ((this->_sprite)._animState._isPlaying != 0)) { - bVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsLoopingAnimation(); + bVar4 = AnimationState::IsLoopingAnimation(&(this->_sprite)._animState); stickyTarget = extraout_EDX; if (bVar4 == 0) goto LAB_006a2a4a; } if ((stickyTarget != 2) && (this->_pitfallState == 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Pulse"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Pulse"),0); } } LAB_006a2a4a: - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Pulse")); + bVar4 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("Pulse")); if ((bVar4 != 0) && (bVar4 = IsRocket(this), bVar4 == 0)) { if ((this->_isFetus == 0) && (((this->_spawnerType == 1 && (pEVar8 != GHIDRA_CAST(0x0))) && (bVar4 = (GHIDRA_CAST((pEVar8)))->Entity_Player::HasCollectible(0x89,0), bVar4 != 0)))) { - stickyTarget = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + stickyTarget = ANM2::GetFrame(&this->_sprite); if (0xe < stickyTarget) { stickyTarget = 0; goto LAB_006a2afe; @@ -543,12 +543,12 @@ LAB_006a2a4a: } else { local_80 = GHIDRA_CAST(0x0); - stickyTarget = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetAnimationLength(); + stickyTarget = AnimationState::GetAnimationLength(&(this->_sprite)._animState); stickyTarget = (stickyTarget - *extraout_EDX_00) + -1; if (stickyTarget < 0) { stickyTarget = stickyTarget + (stickyTarget / 0xf) * -0xf + 0xf; } - iVar7 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + iVar7 = ANM2::GetFrame(&this->_sprite); if (stickyTarget != iVar7) { LAB_006a2afe: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(stickyTarget); @@ -1252,7 +1252,7 @@ LAB_006a4412: } this->_dead = 1; if (this->_pitfallState == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Explode"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Explode"),0); } if (this->_isFetus == 0) { pBVar5 = BitSet128::operator_and(&local_110,&this->_tearFlags,&g_tearFlagSticky); @@ -1416,13 +1416,13 @@ LAB_006a4412: this->_dead = 0; uVar6 = (GHIDRA_CAST((&this->_dropRNG)))->RNG::RandomInt(0x1e); this->_explosionCountdown1 = uVar6 + 0x3c; - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Appear"),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(8.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,8.0); } uVar6 = (GHIDRA_CAST((&this->_dropRNG)))->RNG::Next(); tmpVecPtr = RandomVector(&local_e0,uVar6); @@ -1549,7 +1549,7 @@ LAB_006a4412: this->_friction = this->_friction * 0.8; } if ((this->_sprite)._animState._animData != (void *)0x0) { - bVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b670d0); + bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b670d0); manager = g_manager; if (bVar4 != 0) { local_80 = GHIDRA_CAST(0xab); @@ -1581,7 +1581,7 @@ LAB_006a4412: this->_collisionCooldown = 4; } if (((this->_sprite)._animState._animData != (void *)0x0) && - (bVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("DropSound")), + (bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("DropSound")), bVar4 != 0)) { if (this->_variant == 0x11) { (GHIDRA_CAST((&g_manager->_sfxManager)))->SoundEffects::Play(0x28,1.0,4,0,0.8,0.0); @@ -1610,8 +1610,8 @@ LAB_006a4412: local_80 = GHIDRA_CAST(&DAT_00000005); do { if (*costumeLoaded != 0) { - (GHIDRA_CAST((GHIDRA_CAST((costumeLoaded + -0xd9)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((costumeLoaded + -0xb9)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((costumeLoaded + -0xd9))); + AnimationState::Update(GHIDRA_CAST((costumeLoaded + -0xb9))); } costumeLoaded = costumeLoaded + 0x114; local_80 = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(local_80[-1])) + 0x2eff)))); @@ -1723,7 +1723,7 @@ void Entity_Bomb::Render(Vector *offset) position->x = (float)dVar7 / fVar6 + offset->x; (this->_renderPosition).y = (float)dVar8 / fVar6 + fVar1; if (this->_hasCostumes != 0) { - layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0); + layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); fVar1 = (this->_sprite)._scale.x; fVar3 = (*GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 0x10)) + (this->_sprite)._offset.x) * fVar1; fVar6 = (this->_sprite)._scale.y; @@ -1809,7 +1809,7 @@ void Entity_Bomb::Render(Vector *offset) FUN_00862060(this,offset); return; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,position,&g_vectorZero,&g_vectorZero); FUN_00862060(this,offset); } return; @@ -1916,7 +1916,7 @@ void Entity_Bomb::update_sparks() bomb = this; do { if (costumeSprite->_loaded != 0) { - (GHIDRA_CAST((costumeSprite)))->ANM2::Reset(); + ANM2::Reset(costumeSprite); } manager = g_manager; costumeSprite = costumeSprite + 1; @@ -2329,13 +2329,13 @@ LAB_006a794a: } } if (spritePathSize != 0) { - (GHIDRA_CAST((local_1c4)))->ANM2::Load(GHIDRA_CAST(&spritePath),0); + ANM2::Load(local_1c4,GHIDRA_CAST(&spritePath),0); pEVar9 = bomb; layerIdx = GHIDRA_CAST(0x0); bVar3 = extraout_CL; if ((bomb->_sprite)._layerCount != 0) { do { - layer = (GHIDRA_CAST((&pEVar9->_sprite)))->ANM2::GetLayer(layerIdx); + layer = ANM2::GetLayer(&pEVar9->_sprite,layerIdx); if (layer->_layerData == (void *)0x0) { tmpString._size = 0; tmpString._capacity = 0xf; @@ -2365,8 +2365,8 @@ LAB_006a794a: bVar3 = extraout_CL_00; } while (layerIdx < GHIDRA_CAST((pEVar9->_sprite)._layerCount)); } - (GHIDRA_CAST((local_1c4)))->ANM2::LoadGraphics(bVar3); - layer = (GHIDRA_CAST((local_1c4)))->ANM2::GetLayer(GHIDRA_CAST("sparks")); + ANM2::LoadGraphics(local_1c4,bVar3); + layer = ANM2::GetLayer(local_1c4,GHIDRA_CAST("sparks")); if (layer != GHIDRA_CAST(0x0)) { layer->_bitflags = layer->_bitflags | 1; } @@ -2377,14 +2377,14 @@ LAB_006a794a: psVar8 = local_1bc; costumeSprite = costumeIter; if (local_1bc->_size != 0) { - (GHIDRA_CAST((costumeIter)))->ANM2::Load(local_1bc,0); + ANM2::Load(costumeIter,local_1bc,0); layerIdx = GHIDRA_CAST(0x0); pEVar9 = bomb; pEVar11 = extraout_ECX; if (bomb->_bombCostumesSprites[0]._layerCount != 0) { do { local_1cc = GHIDRA_CAST(pEVar9->_bombCostumesSprites); - layer = (GHIDRA_CAST((GHIDRA_CAST(local_1cc))))->ANM2::GetLayer(layerIdx); + layer = ANM2::GetLayer(GHIDRA_CAST(local_1cc),layerIdx); if (layer->_layerData == (void *)0x0) { tmpString._size = 0; tmpString._capacity = 0xf; @@ -2417,14 +2417,14 @@ LAB_006a794a: psVar8 = local_1bc; } costumeSprite = costumeIter; - (GHIDRA_CAST((costumeIter)))->ANM2::LoadGraphics((uint8_t)pEVar11); + ANM2::LoadGraphics(costumeIter,(uint8_t)pEVar11); psVar10 = &costumeSprite->_animDefaultName; if (0xf < (costumeSprite->_animDefaultName)._capacity) { psVar10 = *GHIDRA_CAST(psVar10->_buf); } - bVar3 = (GHIDRA_CAST((costumeSprite)))->ANM2::SetAnimation(GHIDRA_CAST(psVar10),1); + bVar3 = ANM2::SetAnimation(costumeSprite,GHIDRA_CAST(psVar10),1); if (bVar3 != 0) { - (GHIDRA_CAST((&costumeSprite->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&costumeSprite->_animState); (costumeSprite->_animState)._isPlaying = 1; } bomb->_hasCostumes = 1; @@ -2440,9 +2440,9 @@ LAB_006a794a: if (0xf < savedAnimNameCapacity) { ppppppbVar6 = savedAnimName[0]; } - bVar3 = (GHIDRA_CAST((&bomb->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(ppppppbVar6),1); + bVar3 = ANM2::SetAnimation(&bomb->_sprite,GHIDRA_CAST(ppppppbVar6),1); if (((bVar3 != 0) && ((pEVar9->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar9->_sprite)._animState)))->AnimationState::SetFrameFloat(local_1c0), + (AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,local_1c0), (pEVar9->_sprite)._animState._animData != (void *)0x0)) { (pEVar9->_sprite)._animState._isPlaying = 0; } @@ -2452,13 +2452,13 @@ LAB_006a794a: if (0xf < savedAnimNameCapacity) { ppppppbVar6 = savedAnimName[0]; } - bVar3 = (GHIDRA_CAST((&bomb->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(ppppppbVar6),1); + bVar3 = ANM2::SetAnimation(&bomb->_sprite,GHIDRA_CAST(ppppppbVar6),1); if (bVar3 != 0) { - (GHIDRA_CAST((&(pEVar9->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pEVar9->_sprite)._animState); (pEVar9->_sprite)._animState._isPlaying = 1; } if ((pEVar9->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(pEVar9->_sprite)._animState)))->AnimationState::SetFrameFloat(local_1c0); + AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,local_1c0); } } } diff --git a/generated-src/entity_config.cpp b/generated-src/entity_config.cpp index 92ed816..e9a566b 100644 --- a/generated-src/entity_config.cpp +++ b/generated-src/entity_config.cpp @@ -5741,7 +5741,7 @@ LAB_0069abfa: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX; if (pvVar3 == (void *)0x0) goto LAB_0069abfa; @@ -5772,7 +5772,7 @@ LAB_0069aca5: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_01; if (pvVar3 == (void *)0x0) goto LAB_0069aca5; @@ -5803,7 +5803,7 @@ LAB_0069ad50: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_03; if (pvVar3 == (void *)0x0) goto LAB_0069ad50; @@ -5834,7 +5834,7 @@ LAB_0069adfb: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_05; if (pvVar3 == (void *)0x0) goto LAB_0069adfb; @@ -5865,7 +5865,7 @@ LAB_0069aea6: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_07; if (pvVar3 == (void *)0x0) goto LAB_0069aea6; @@ -5894,7 +5894,7 @@ LAB_0069aea6: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_09; if (pvVar3 == (void *)0x0) goto LAB_0069af5a; @@ -5926,7 +5926,7 @@ LAB_0069af5a: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_11; if (pvVar3 == (void *)0x0) goto LAB_0069b00e; @@ -5951,7 +5951,7 @@ LAB_0069b00e: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_13; if (pvVar3 == (void *)0x0) goto LAB_0069b099; @@ -5976,7 +5976,7 @@ LAB_0069b099: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_15; if (pvVar3 == (void *)0x0) goto LAB_0069b126; @@ -6001,7 +6001,7 @@ LAB_0069b126: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - pvVar3 = (GHIDRA_CAST((menuAnm2)))->ANM2::GetAnimationData(GHIDRA_CAST(psVar9)); + pvVar3 = ANM2::GetAnimationData(menuAnm2,GHIDRA_CAST(psVar9)); isAnimFound = '\x01'; pvVar14 = extraout_ECX_17; if (pvVar3 == (void *)0x0) goto LAB_0069b1b6; @@ -6026,16 +6026,16 @@ LAB_0069b1b6: if (0xf < psVar9->_capacity) { psVar9 = *GHIDRA_CAST(psVar9->_buf); } - bVar1 = (GHIDRA_CAST((playerEntry._moddedMenuBackgroundANM2)))->ANM2::SetAnimation(GHIDRA_CAST(psVar9),1); + bVar1 = ANM2::SetAnimation(playerEntry._moddedMenuBackgroundANM2,GHIDRA_CAST(psVar9),1); if (((bVar1 != 0) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar14) + 0x34)) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar14) + 0x30)))))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(GHIDRA_CAST((GHIDRA_INT(pvVar14) + 0x30)),0.0), *GHIDRA_CAST((GHIDRA_CAST(pvVar14) + 0x34)) != 0)) { *GHIDRA_CAST((GHIDRA_CAST(pvVar14) + 0x44)) = 0; } (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 4; (GHIDRA_CAST((tmpString._buf)))->msvc::string::_Tidy_deallocate(); pvVar14 = playerEntry._moddedMenuBackgroundANM2; - backgroundLayer = (GHIDRA_CAST((playerEntry._moddedMenuBackgroundANM2)))->ANM2::GetLayer(GHIDRA_CAST("Background")); + backgroundLayer = ANM2::GetLayer(playerEntry._moddedMenuBackgroundANM2,GHIDRA_CAST("Background")); if (backgroundLayer != GHIDRA_CAST(0x0)) { if (backgroundLayer->_layerData == GHIDRA_CAST(0x0)) { iVar5 = -1; @@ -6043,7 +6043,7 @@ LAB_0069b1b6: else { iVar5 = *GHIDRA_CAST(backgroundLayer->_layerData); } - pvVar14 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar14) + 0x30)))))->AnimationState::GetLayerFrame(iVar5); + pvVar14 = AnimationState::GetLayerFrame(GHIDRA_CAST((GHIDRA_INT(pvVar14) + 0x30)),iVar5); if (pvVar14 != (void *)0x0) { if (*GHIDRA_CAST((GHIDRA_CAST(pvVar14) + 0x2c)) != '\0') { playerEntry._renderCustomBackground = 1; diff --git a/generated-src/entity_dummy.cpp b/generated-src/entity_dummy.cpp index b7c405f..db34b03 100644 --- a/generated-src/entity_dummy.cpp +++ b/generated-src/entity_dummy.cpp @@ -44,7 +44,7 @@ void Entity_Dummy::Render(Vector *offset) this->Entity::Render(offset); sprintf_s(text,0x100,GHIDRA_CAST("e%d.%d")); pMVar1 = g_manager; - iVar2 = (GHIDRA_CAST((&g_manager->_font2_TeamMeatEx12)))->Font::get_string_width_n(text,-1); + iVar2 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,text,-1); fontSettings = 0; local_12c = 0xffff; local_128 = 0; @@ -58,7 +58,7 @@ void Entity_Dummy::Render(Vector *offset) textColor._blue = 1.0; textColor._alpha = 1.0; textColor._unk = 0; - (GHIDRA_CAST((&pMVar1->_font2_TeamMeatEx12)))->Font::DrawString(text,&textColor,&fontSettings, + Font::DrawString(&pMVar1->_font2_TeamMeatEx12,text,&textColor,&fontSettings, *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1a4)) - (float)iVar2 * 0.5, *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1a8)) - 8.0); ExceptionList = local_10; diff --git a/generated-src/entity_effect.cpp b/generated-src/entity_effect.cpp index 264fc48..1f4235e 100644 --- a/generated-src/entity_effect.cpp +++ b/generated-src/entity_effect.cpp @@ -314,9 +314,9 @@ void Entity_Effect::Init(int type, int variant, int subType, uint32_t initSeed) (GHIDRA_CAST((&this->_hitList)))->msvc::vector::clear(1); this->_maxHitPoints = 0.0; if (this->_config != (void *)0x0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),0); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),0); pbVar2 = (GHIDRA_CAST(((this->_sprite)._animDefaultName._buf)))->msvc::string::c_str(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(pbVar2,0); + ANM2::Play(&this->_sprite,pbVar2,0); } this->_state = 0; this->_timeout = -1; @@ -420,7 +420,7 @@ void Entity_Effect::Init(int type, int variant, int subType, uint32_t initSeed) pvVar10 = (this->_sprite)._animState._animData; } if (pvVar10 != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar13)); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(uVar13)); } (GHIDRA_CAST((&faintColor)))->Color::Reset(); (GHIDRA_CAST((&faintColor)))->Color::SetTint(1.0,1.0,1.0,0.3); @@ -431,8 +431,8 @@ void Entity_Effect::Init(int type, int variant, int subType, uint32_t initSeed) } else { if (iVar3 != 100) goto LAB_005ce02f; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Final"),0); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Final"),0); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = 0; layer->_blendMode[1] = 4; layer->_blendMode[2] = 7; @@ -519,17 +519,17 @@ LAB_005ce0c2: 2.3283064e-10 * 10.0; if ((iVar3 == 0x1b) || (iVar3 == 0xa3)) { uVar4 = Random(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST((&PTR_DAT_00b63bc8)[uVar4 & 3]),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST((&PTR_DAT_00b63bc8)[uVar4 & 3]),0); } else if ((((iVar3 == 0x23) || (iVar3 == 0x55)) || (iVar3 == 0x56)) || ((iVar3 == 0x5f || (iVar3 == 0x62)))) { uVar4 = Random(); uVar13 = Random(); if ((uVar13 % 3 == 0) && (this->_variant != 0x55)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST((&PTR_s_Gib01_00b63ba8)[uVar4 & 3]),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST((&PTR_s_Gib01_00b63ba8)[uVar4 & 3]),0); } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST((&PTR_s_Gib01_00b63ba8)[uVar4 & 3]),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST((&PTR_s_Gib01_00b63ba8)[uVar4 & 3]),0); } } goto LAB_005d03cf; @@ -541,10 +541,10 @@ LAB_005ce0c2: local_2b8 = (LayerState *) ((float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10 * 360.0); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_rotation = (float)local_2b8; uVar4 = Random(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Gib01_00b63b94)[uVar4 % 5],0); + ANM2::Play(&this->_sprite,(&PTR_s_Gib01_00b63b94)[uVar4 % 5],0); uVar4 = Random(); this->_fallingSpeed = 5.0 - (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * @@ -558,7 +558,7 @@ LAB_005ce0c2: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,&local_b4); local_8 = 0xffffffff; (GHIDRA_CAST((local_b4._buf)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(0); + ANM2::LoadGraphics(&this->_sprite,0); } uVar4 = Random(); (this->_sprite)._flipX = ((uint8_t)uVar4 ^ 0xff) & 1; @@ -592,7 +592,7 @@ LAB_005ce0c2: goto LAB_005d03dd; } if (iVar3 == 0x1f) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Falling"),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Falling"),0); goto LAB_005d03cf; } if (iVar3 == 0x37) { @@ -608,7 +608,7 @@ LAB_005ce40c: pcVar6 = "SummonWombDisabled"; if (iVar3 < 2) goto LAB_005ce40c; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(pcVar6),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(pcVar6),0); goto LAB_005d03cf; } if (variant == 0x15) { @@ -635,20 +635,20 @@ LAB_005d03c8: if (variant == 0x21) { uVar4 = RoomConfig::GetStageID(g_game->_stage,g_game->_stageType,-1); if (uVar4 == 0xf) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("White"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("White"),0); } goto LAB_005d0198; } if (variant == 0x44) goto LAB_005d0198; if (variant == 2) { if (this->_subtype - 1U < 5) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Poof_Large_00b63b48)[this->_subtype],0); + ANM2::Play(&this->_sprite,(&PTR_s_Poof_Large_00b63b48)[this->_subtype],0); } goto LAB_005d03c8; } if (variant == 0xf) { if (this->_subtype - 1U < 3) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Poof2_00b63b3c)[this->_subtype],0); + ANM2::Play(&this->_sprite,(&PTR_s_Poof2_00b63b3c)[this->_subtype],0); } this->_renderZOffset = 8000; goto LAB_005d03cf; @@ -659,11 +659,11 @@ LAB_005d03c8: if (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)) != 0x10) { this->_sortingLayer = 0; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b1d534,0); + ANM2::Play(&this->_sprite,&DAT_00b1d534,0); } else if (((iVar3 == 2) || (iVar3 == 4)) || (iVar3 == 5)) { this->_renderZOffset = 8000; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b1d534,0); + ANM2::Play(&this->_sprite,&DAT_00b1d534,0); } else { if (iVar3 == 0x42) { @@ -673,12 +673,12 @@ LAB_005d03c8: local_18 = 6; local_8 = 1; (GHIDRA_CAST((GHIDRA_CAST((local_28 + 4)))))->RNG::Next(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Poof0_00b63b34)[(*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_28))) + 0x4))) % 3],0); + ANM2::Play(&this->_sprite,(&PTR_s_Poof0_00b63b34)[(*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_28))) + 0x4))) % 3],0); local_8 = 0xffffffff; } else { if (iVar3 != 0x43) goto LAB_005d03cf; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("PoofLarge"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("PoofLarge"),0); } (this->_sprite)._flipX = ~(uint8_t)this->_initSeed & 1; } @@ -689,14 +689,14 @@ LAB_005d03c8: if (this->_subtype != 0) { pcVar6 = "Effect2"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(pcVar6),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(pcVar6),0); if (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)) != 0x10) { this->_sortingLayer = 0; } goto LAB_005d03d7; } if (variant == 0x3b) { - pcVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("Clouds")); + pcVar6 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST("Clouds")); if (pcVar6 != GHIDRA_CAST(0x0)) { local_2b8 = *GHIDRA_CAST((pcVar6 + 0x30)); if (local_2b8 == GHIDRA_CAST(0x0)) { @@ -707,7 +707,7 @@ LAB_005d03c8: local_2b4 = GHIDRA_CAST((uVar4 % GHIDRA_UINT(local_2b8))); } psVar7 = GHIDRA_CAST((GHIDRA_CAST((pcVar6)))->std)::string::c_str(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(psVar7,GHIDRA_INT(local_2b4)); + ANM2::SetFrame(&this->_sprite,psVar7,GHIDRA_INT(local_2b4)); uVar4 = Random(); (this->_sprite)._flipX = ((uint8_t)uVar4 ^ 0xff) & 1; uVar4 = Random(); @@ -730,7 +730,7 @@ LAB_005d03c8: } if (iVar3 == 0x3c) { this->_entityGridCollisionClass = 3; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Rotate"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Rotate"),0); (this->_posOffset).x = 0.0; manager = g_manager; (this->_posOffset).y = -20.0; @@ -776,7 +776,7 @@ LAB_005ceb44: uVar4 = Random(); this->_state = uVar4 % 3; if (uVar4 % 3 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("LargeDrop"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("LargeDrop"),0); uVar4 = Random(); scale = (float)((double)GHIDRA_INT(uVar4) + __uint_to_double_fixup[-(GHIDRA_INT(uVar4) >> 0x1f)]) * 2.3283064e-10 * 0.5 + 0.5; @@ -785,7 +785,7 @@ LAB_005ceb44: (this->_sprite)._scale.x = fVar16; } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("SmallDrop"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("SmallDrop"),0); } this->_height = -10.0; uVar4 = Random(); @@ -806,7 +806,7 @@ LAB_005cdc8a: if (iVar3 == 0) { pcVar6 = "WormHori"; LAB_005ceeab: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(pcVar6),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(pcVar6),0); } else { if (iVar3 == 1) { @@ -829,7 +829,7 @@ LAB_005ceeab: goto LAB_005d03cf; } if (iVar3 == 0x40) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("WalkHori"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("WalkHori"),0); fVar16 = random_float(); local_2b8 = GHIDRA_CAST(normalize_angle_degrees(fVar16 * 360.0)); this->_rotation = (float)local_2b8; @@ -841,7 +841,7 @@ LAB_005ceeab: if (iVar3 != 0x45) { if (iVar3 == 0x46) { iVar3 = Isaac::Random(3); - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Droplets"),iVar3); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Droplets"),iVar3); this->_fallingAcceleration = 1.3; fVar16 = random_float(); this->_shadowSize = 0.04; @@ -854,7 +854,7 @@ LAB_005ceeab: layer = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x1)); layer->_magFilterMode = 1; if (this->_variant == 0x6e) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("IdleQuick"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("IdleQuick"),0); } } else if (iVar3 == 0x7e) { @@ -915,12 +915,12 @@ LAB_005cf680: this->_timeout = 0x32; this->_fallingAcceleration = 1.3; this->_fallingSpeed = 0.5; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b634bc,0); + ANM2::Play(&this->_sprite,&DAT_00b634bc,0); } else if (iVar3 == 0x4c) { local_2e4 = GHIDRA_CAST(&DAT_00000005); clampedSubtype = std_min_ptr(GHIDRA_CAST(&local_2e4),GHIDRA_CAST(&this->_subtype)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_DAT_00b63b70)[*clampedSubtype],0); + ANM2::Play(&this->_sprite,(&PTR_DAT_00b63b70)[*clampedSubtype],0); LAB_005cf2a4: this->_sortingLayer = 0; } @@ -959,7 +959,7 @@ LAB_005cf2a4: } this->_sortingLayer = 0; this->_state = 0; - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("Closed"),0); + ANM2::Play(sprite,GHIDRA_CAST("Closed"),0); Config::GetCollectibles(); layer = GHIDRA_CAST(FUN_00436120(this->_subtype - 1U & 1)); local_2b8 = layer; @@ -976,7 +976,7 @@ LAB_005cf2a4: if (!isOpened) { pcVar6 = "Closed"; } - (GHIDRA_CAST((GHIDRA_CAST(local_2b4))))->ANM2::Play(GHIDRA_CAST(pcVar6),0); + ANM2::Play(GHIDRA_CAST(local_2b4),GHIDRA_CAST(pcVar6),0); Config::GetCollectibles(); this = effect; iVar3 = FUN_00436120(effect->_subtype); @@ -1036,7 +1036,7 @@ LAB_005cf2a4: } else { if (iVar3 == 0x5b) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("JumpDown"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("JumpDown"),0); iVar3 = 2; goto LAB_005cf680; } @@ -1048,7 +1048,7 @@ LAB_005cf2a4: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST((iVar3 + 0x74))); spriteColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); fVar16 = random_float(); - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(fVar16 * 0.15 + 0.05); + Font::SetLineHeightModifier(spriteColor,fVar16 * 0.15 + 0.05); iVar3 = Isaac::Random(2); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::set_flip_x(iVar3 == 0); fVar16 = random_float(); @@ -1075,7 +1075,7 @@ LAB_005cf2a4: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST((iVar3 + 0x74))); spriteColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); fVar16 = random_float(); - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(fVar16 * 0.3 + 0.1); + Font::SetLineHeightModifier(spriteColor,fVar16 * 0.3 + 0.1); } } else if (iVar3 == 0x53) { @@ -1098,7 +1098,7 @@ LAB_005cf2a4: this->_visible = 0; } else if (uVar4 == 1) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Projectile"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Projectile"),0); fVar16 = random_float(); this->_height = -(fVar16 * 4.0 + 12.0); local_2e4 = GHIDRA_CAST(random_float()); @@ -1119,7 +1119,7 @@ LAB_005cf2a4: iVar3 = Isaac::Random(4); pcVar6 = (&PTR_s_Particle1_00b63b60)[iVar3]; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(pcVar6),bVar1); + ANM2::Play(&this->_sprite,GHIDRA_CAST(pcVar6),bVar1); } LAB_005cf9dd: if (this->_subtype != 1) { @@ -1132,11 +1132,11 @@ LAB_005cf9dd: copy_20_bytes(layer->_blendMode,pvVar10); } else if (iVar3 == 0x69) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("PoofStart"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("PoofStart"),0); this->_renderZOffset = 1000; } else if (iVar3 == 0x6a) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); this->_renderZOffset = 1000; (this->_posOffset).y = -20.0; } @@ -1206,10 +1206,10 @@ LAB_005cfc0c: else if (iVar3 == 0x6b) { if (this->_subtype == 0) { (this->_posOffset).y = -32.0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Throw"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Throw"),0); } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } } else { @@ -1230,29 +1230,29 @@ LAB_005cfc0c: } if (iVar3 == 0x6d) { LAB_005d00d8: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); } else if (iVar3 == 0x6f) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b1d534,0); + ANM2::Play(&this->_sprite,&DAT_00b1d534,0); } else if (iVar3 == 0x70) { (GHIDRA_CAST((local_b4._buf + 4)))->BlendMode::SetMode(2,0); pvVar10 = extraout_EAX_08; layer = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x0)); copy_20_bytes(layer->_blendMode,pvVar10); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); this->_state = -1; } else { if (iVar3 == 0x71) goto LAB_005d00d8; if (iVar3 == 0x73) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); this->_renderZOffset = 10000; this->_state = 0; (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::AddEntityFlags(0x200000); } else if (iVar3 == 0x74) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); this->_sortingLayer = 0; this->_state = 0; this->_damageSource = 0; @@ -1278,7 +1278,7 @@ LAB_005d00d8: _Init_thread_footer(&DAT_00c7fb40); } (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST(&DAT_00c7fb44)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("LostDeath"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("LostDeath"),0); this->_state = 0; } else if (iVar3 == 0x77) { @@ -1297,26 +1297,26 @@ LAB_005d00d8: } else if (iVar3 == 0x31) { if (GHIDRA_UINT(this->_subtype) < 6) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Heart_00b63af4)[this->_subtype],0); + ANM2::Play(&this->_sprite,(&PTR_s_Heart_00b63af4)[this->_subtype],0); } } else if (iVar3 == 0x79) { (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::AddEntityFlags(0x200000); this->_scale = 0.0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Default"),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Default"),0); } else if (iVar3 == 0x7c) { bVar1 = 0; iVar3 = Isaac::Random(3); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Bubble1_00b63ae4)[iVar3],bVar1); + ANM2::Play(&this->_sprite,(&PTR_s_Bubble1_00b63ae4)[iVar3],bVar1); iVar3 = Isaac::Random(2); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::set_flip_x(iVar3 == 0); } else if (iVar3 == 0x7d) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("SmallHoleOpen"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("SmallHoleOpen"),0); this->_state = 0; this->_renderDepthOffset = -5.0; - local_2b8 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(&DAT_00b1d57c); + local_2b8 = ANM2::GetLayer(&this->_sprite,&DAT_00b1d57c); if (local_2b8 != GHIDRA_CAST(0x0)) { uVar4 = Random(); vecResult = &this->_pos; @@ -1345,10 +1345,10 @@ LAB_005d00d8: copy_20_bytes(layer->_blendMode,pvVar10); bVar1 = 0; iVar3 = Isaac::Random(5); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Bling1_00b63ad0)[iVar3],bVar1); + ANM2::Play(&this->_sprite,(&PTR_s_Bling1_00b63ad0)[iVar3],bVar1); } else if (iVar3 == 0xcb) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Summon"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Summon"),0); pRVar8 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level)::GetCurrentRoom(); (GHIDRA_CAST((pRVar8)))->Room::SetClear(0); } @@ -1357,9 +1357,9 @@ LAB_005d00d8: } goto LAB_005d03cf; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar3 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + iVar3 = AnimationState::GetAnimationLength(animState); iVar3 = Isaac::Random(iVar3); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(iVar3); fVar16 = random_float(); @@ -1383,7 +1383,7 @@ LAB_005d00d8: case 0x1e: case 0x21: case 0x22: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("White"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("White"),0); (GHIDRA_CAST((&workColor)))->Color::Reset(); (GHIDRA_CAST((&workColor)))->Color::SetTint(1.0,0.8,0.0,1.0); (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._color))))->Color::operator_assign(GHIDRA_CAST(&workColor)); @@ -1392,11 +1392,11 @@ LAB_005d00d8: tmpColor = GHIDRA_CAST(&workColor); goto code_r0x005ceddb; default: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b634c0,0); + ANM2::Play(&this->_sprite,&DAT_00b634c0,0); break; case 0x10: case 0x1f: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b633c4,0); + ANM2::Play(&this->_sprite,&DAT_00b633c4,0); (GHIDRA_CAST((&splatTint)))->Color::Reset(); (GHIDRA_CAST((&splatTint)))->Color::SetTint(1.0,0.5,0.5,1.0); if (&this->_splatColor != GHIDRA_CAST(&splatTint)) { @@ -1413,7 +1413,7 @@ LAB_005d00d8: } goto code_r0x005cede7; case 0x20: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("White"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("White"),0); (GHIDRA_CAST((&workColor)))->Color::Color(1.0,0.02,0.0,1.0); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(color); } @@ -1525,7 +1525,7 @@ LAB_005ceaae: local_8 = 0xffffffff; (GHIDRA_CAST((psVar7->_buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&this->_dropRNG)))->RNG::Next(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_WombBreak1_00b63b88)[GHIDRA_UINT((this->_dropRNG)._seed) % 3],0); + ANM2::Play(&this->_sprite,(&PTR_s_WombBreak1_00b63b88)[GHIDRA_UINT((this->_dropRNG)._seed) % 3],0); break; case 0x2e: msvc::string::string_from_cstr @@ -1564,7 +1564,7 @@ LAB_005d03dd: break; case 0x80: (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::AddEntityFlags(0x200000); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); break; case 0x82: game = GHIDRA_CAST(Config)::GetCollectibles(); @@ -1600,18 +1600,18 @@ LAB_005d03dd: pRVar8 = GHIDRA_CAST((fVar16 * 0.8)); local_2c0.y = (float)pRVar8; LAB_005d130c: - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier((float)pRVar8); + Font::SetLineHeightModifier(spriteColor,(float)pRVar8); break; case 0x87: bVar1 = 0; sprite = &this->_sprite; iVar3 = Isaac::Random(4); - (GHIDRA_CAST((sprite)))->ANM2::Play((&PTR_s_Drop01_00b63b24)[iVar3],bVar1); + ANM2::Play(sprite,(&PTR_s_Drop01_00b63b24)[iVar3],bVar1); pRVar8 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level)::GetCurrentRoom(); iVar3 = (GHIDRA_CAST((pRVar8)))->Room::GetFrameCount(); if (iVar3 == 0) { animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar3 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + iVar3 = AnimationState::GetAnimationLength(animState); iVar3 = Isaac::Random(iVar3); (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::SetFrame_1(iVar3); } @@ -1629,7 +1629,7 @@ LAB_005d130c: goto LAB_005d11c7; case 0x89: local_2b4 = GHIDRA_CAST(&this->_sprite); - (GHIDRA_CAST((GHIDRA_CAST(local_2b4))))->ANM2::Play(s_Open,0); + ANM2::Play(GHIDRA_CAST(local_2b4),s_Open,0); if (this->_subtype == 0) { this->_sortingLayer = 1; LAB_005d05aa: @@ -1686,11 +1686,11 @@ LAB_005d05aa: tmpColor = GHIDRA_CAST((GHIDRA_CAST((0x3f800000)))->Color)::Color(0,0,0,0,0,0x3e99999a,0); (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::SetColor(tmpColor); layer = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Font::SetLineHeightModifier(0.5); + Font::SetLineHeightModifier(GHIDRA_CAST(&layer->_color),0.5); } } spriteColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite)::Color(); - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(0.0); + Font::SetLineHeightModifier(spriteColor,0.0); rng = &this->_dropRNG; fVar16 = (GHIDRA_CAST((rng)))->RNG::RandomFloat(); local_2c0.y = fVar16 * 0.4 + 1.0; @@ -1701,9 +1701,9 @@ LAB_005d05aa: (GHIDRA_CAST((GHIDRA_CAST(subSprite))))->Sprite::set_offset(vecResult); uVar4 = (GHIDRA_CAST((rng)))->RNG::RandomInt(2); (GHIDRA_CAST((GHIDRA_CAST(subSprite))))->Sprite::set_flip_x(uVar4 != 0); - (GHIDRA_CAST((GHIDRA_CAST(subSprite))))->ANM2::Play(s_Idle,0); + ANM2::Play(GHIDRA_CAST(subSprite),s_Idle,0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar4 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar4 = AnimationState::GetAnimationLength(animState); uVar4 = (GHIDRA_CAST((rng)))->RNG::RandomInt(uVar4); (GHIDRA_CAST((GHIDRA_CAST(subSprite))))->Sprite::SetFrame_1(uVar4); break; @@ -1712,7 +1712,7 @@ LAB_005d05aa: this->_sortingLayer = 0; (GHIDRA_CAST((&this->_dropRNG)))->RNG::RandomInt(4); sprintf_s(local_28 + 4,0x10,GHIDRA_CAST("Idle%d")); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(local_28 + 4,0); + ANM2::Play(&this->_sprite,local_28 + 4,0); (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::GetCurrentRoom(); FUN_00440ec0(); iVar3 = FUN_005cd620(); @@ -1739,7 +1739,7 @@ LAB_005d05aa: bVar1 = 0; if (this->_subtype == 0) { uVar4 = (GHIDRA_CAST((&this->_dropRNG)))->RNG::RandomInt(4); - (GHIDRA_CAST((sprite)))->ANM2::Play((&PTR_DAT_00b63b14)[uVar4],bVar1); + ANM2::Play(sprite,(&PTR_DAT_00b63b14)[uVar4],bVar1); game = g_game; this->_entityGridCollisionClass = 3; vecResult = &this->_pos; @@ -1750,7 +1750,7 @@ LAB_005d05aa: } } else { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("Explosion"),0); + ANM2::Play(sprite,GHIDRA_CAST("Explosion"),0); this->_renderDepthOffset = 100.0; if (this->_subtype == 2) { tmpColor = (ColorMod *) @@ -1775,7 +1775,7 @@ LAB_005d05aa: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::set_flip_x(uVar4 != 0); this->_lifespan = 0x1e; this->_timeout = 0x1e; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); if (this->_subtype == 0) { pRVar8 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level)::GetCurrentRoom(); (GHIDRA_CAST((pRVar8)))->Room::GetFloorColorAt(&local_2d8,&this->_pos,this->_size); @@ -1834,7 +1834,7 @@ LAB_005d05aa: case 0x9d: goto LAB_005d11e7; case 0x9e: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); fVar16 = random_float(); fVar16 = normalize_angle_degrees(fVar16 * 360.0); this->_rotation = fVar16; @@ -1849,7 +1849,7 @@ LAB_005d05aa: fVar16 = random_float(); fVar16 = normalize_angle_degrees(fVar16 * 360.0); this->_rotation = fVar16; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); fVar16 = (GHIDRA_CAST((&this->_dropRNG)))->RNG::RandomFloat(); local_2c0.y = fVar16 * 0.2 + 1.0; vecResult = Vector::operator_mul(&scratchVec,&local_2c0.y,&g_vectorOne); @@ -1872,7 +1872,7 @@ LAB_005d05aa: spriteColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); fVar16 = (GHIDRA_CAST((&this->_dropRNG)))->RNG::RandomFloat(); local_2c0.y = fVar16 * 0.3 + 0.3; - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(local_2c0.y); + Font::SetLineHeightModifier(spriteColor,local_2c0.y); this->_isInitFlag176 = 1; break; case 0xa1: @@ -1907,9 +1907,9 @@ LAB_005d10c7: } this->_sortingLayer = 0; this->_state = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Opened"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Opened"),0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar4 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar4 = AnimationState::GetAnimationLength(animState); uVar4 = (GHIDRA_CAST((&this->_dropRNG)))->RNG::RandomInt(uVar4); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(uVar4); break; @@ -1918,7 +1918,7 @@ LAB_005d10c7: case 0xa4: this->_renderDepthOffset = 80.0; spriteColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(0.6); + Font::SetLineHeightModifier(spriteColor,0.6); goto LAB_005d0669; case 0xa5: (GHIDRA_CAST((&local_2d8)))->BlendMode::SetMode(2,0); @@ -1966,15 +1966,15 @@ LAB_005d10c7: case 0xaa: this->_sortingLayer = 0; sprite = &this->_sprite; - (GHIDRA_CAST((sprite)))->ANM2::PlayOverlay(GHIDRA_CAST("Float"),0); + ANM2::PlayOverlay(sprite,GHIDRA_CAST("Float"),0); rng = &effect->_dropRNG; animState = GHIDRA_CAST(FUN_0041e470()); - uVar4 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar4 = AnimationState::GetAnimationLength(animState); uVar4 = (GHIDRA_CAST((rng)))->RNG::RandomInt(uVar4); - (GHIDRA_CAST((sprite)))->ANM2::SetOverlayFrame(uVar4); - (GHIDRA_CAST((sprite)))->ANM2::SetFrame(GHIDRA_CAST(s_Idle),0); + ANM2::SetOverlayFrame(sprite,uVar4); + ANM2::SetFrame(sprite,GHIDRA_CAST(s_Idle),0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar4 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar4 = AnimationState::GetAnimationLength(animState); uVar4 = (GHIDRA_CAST((rng)))->RNG::RandomInt(uVar4); (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::SetFrame_1(uVar4); uVar4 = (GHIDRA_CAST((rng)))->RNG::RandomInt(2); @@ -1983,7 +1983,7 @@ LAB_005d10c7: break; case 0xab: if (this->_subtype == 2) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Swirl"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Swirl"),0); local_2c0.y = 3.0; vecResult = (GHIDRA_CAST((&g_vectorOne)))->Vector::__mul(&scratchVec,&local_2c0.y); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetScale(vecResult); @@ -1995,7 +1995,7 @@ LAB_005d130a: goto LAB_005d130c; } if (this->_subtype == 1) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Trail"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Trail"),0); fVar16 = random_float(); local_2c0.y = fVar16 * 0.5 + 0.5; fVar16 = random_float(); @@ -2007,13 +2007,13 @@ LAB_005d130a: else { (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::AddEntityFlags(0x200000); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Entity::AddFlagsLow(0x20); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("IdleClosed"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("IdleClosed"),0); this->_timeout = 0x2d; } break; case 0xac: if (this->_subtype == 2) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Swirl"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Swirl"),0); local_2c0.y = 0.7; vecResult = (GHIDRA_CAST((&g_vectorOne)))->Vector::__mul(&scratchVec,&local_2c0.y); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetScale(vecResult); @@ -2030,11 +2030,11 @@ LAB_005d130a: blendMode = &local_2d8; layer = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x2)); copy_20_bytes(layer->_blendMode,blendMode); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Open,0); + ANM2::Play(&this->_sprite,s_Open,0); this->_minRadius = 0.0; break; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST(&DAT_00b635b8),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST(&DAT_00b635b8),0); layer = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x1)); layer->_visible = 0; (GHIDRA_CAST((&local_2d8)))->BlendMode::SetMode(2,0); @@ -2051,7 +2051,7 @@ LAB_005d130a: break; case 0xae: (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::AddEntityFlags(0x200000); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); game = g_game; this->_renderDepthOffset = -100.0; pRVar8 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(game))))->Level)::GetCurrentRoom(); @@ -2141,7 +2141,7 @@ LAB_005d0681: layer = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x1)); copy_20_bytes(layer->_blendMode,pvVar10); this->_renderDepthOffset = -10.0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); break; case 0xba: if (this->_subtype == 1) { @@ -2151,7 +2151,7 @@ LAB_005d0681: local_8 = 0xffffffff; (GHIDRA_CAST((sheetPath._buf)))->msvc::string::_Tidy_deallocate(); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); break; case 0xbc: this->_visible = 0; @@ -2173,7 +2173,7 @@ LAB_005d0681: pvVar10 = (void *)FUN_00a11590(0,2,0); layer = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x1)); copy_20_bytes(layer->_blendMode,pvVar10); - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(sprite,GHIDRA_CAST("Appear"),0); local_8 = 0xffffffff; effect->_sortingLayer = 0; guard_check_icall(); @@ -2218,7 +2218,7 @@ LAB_005d0681: goto LAB_005d1317; case 0xc1: this->_state = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); if (this->_subtype == 0) { this->_visible = 0; layer = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x1)); @@ -2231,13 +2231,13 @@ LAB_005d0681: break; case 0xc2: this->_state = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Shadow"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Shadow"),0); goto LAB_005d1bff; case 0xc5: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Flying"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Flying"),0); break; case 199: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b602e8,0); + ANM2::Play(&this->_sprite,&DAT_00b602e8,0); break; case 200: LAB_005d049c: @@ -2292,7 +2292,7 @@ LAB_005d1317: } else if (iVar3 == 0xaf) { (GHIDRA_CAST((GHIDRA_CAST(effect))))->Entity::AddEntityFlags(0x200000); - (GHIDRA_CAST((sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(sprite,s_Idle,0); (GHIDRA_CAST((&local_2d8)))->BlendMode::SetMode(2,0); blendMode = &local_2d8; layer = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::GetLayer(GHIDRA_CAST(0x0)); @@ -2356,7 +2356,7 @@ LAB_005d1bff: this->_sortingLayer = 0; goto LAB_005d1311; LAB_005d11e7: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); goto LAB_005d1311; LAB_005d0f6b: (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::AddEntityFlags(0x200000); @@ -2468,7 +2468,7 @@ LAB_005d2702: scratchVec.x = (this_00->_pos).x - (this->_pos).x; fVar1 = (this_00->_pos).y - (this->_pos).y; fVar2 = atan2f(fVar1,scratchVec.x); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_rotation = fVar2 * 57.295776; fVar1 = sqrtf(fVar1 * fVar1 + scratchVec.x * scratchVec.x); this->_scale = fVar1; @@ -2595,7 +2595,7 @@ void Entity_Effect::update_mr_me() moveY = g_vectorZero.y; if (iVar14 == 0) { if (this->_parent == (EntityPtr)0x0) goto LAB_005d3f7c; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Float"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Float"),0); fVar26 = *GHIDRA_CAST((GHIDRA_CAST(this->_parent) + 0x340)) - (this->_pos).y; fVar24 = *GHIDRA_CAST((GHIDRA_CAST(this->_parent) + 0x33c)) - (this->_pos).x; bestDistSq = 0.0; @@ -2965,11 +2965,11 @@ LAB_005d33d8: if (*GHIDRA_CAST((mrMeData + 0x128)) != '\0') { pickup->_cycleCollectibleCount = 0; } - (GHIDRA_CAST((GHIDRA_CAST(pickupSpriteCopy))))->ANM2::ANM2(&pickup->_sprite); - (GHIDRA_CAST(()))->ANM2::operator_assign(); + ANM2::ANM2(GHIDRA_CAST(pickupSpriteCopy),&pickup->_sprite); + ANM2::operator_assign(); if (pickup->_variant == 100) { - (GHIDRA_CAST((GHIDRA_CAST((mrMeData + 8)))))->ANM2::Play(GHIDRA_CAST("ShopIdle"),1); - (GHIDRA_CAST((GHIDRA_CAST((mrMeData + 0x58)))))->AnimationState::SetAnimationData(); + ANM2::Play(GHIDRA_CAST((mrMeData + 8)),GHIDRA_CAST("ShopIdle"),1); + AnimationState::SetAnimationData(GHIDRA_CAST((mrMeData + 0x58))); fVar24 = g_vectorOne.y * 0.8; *GHIDRA_CAST((mrMeData + 0xa4)) = g_vectorOne.x * 0.8; *GHIDRA_CAST((mrMeData + 0xa8)) = fVar24; @@ -3081,7 +3081,7 @@ LAB_005d33d8: goto LAB_005d3f7c; } if (iVar14 != 2) goto LAB_005d3f7c; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Carry"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Carry"),0); EVar22 = this->_parent; if (((EVar22 != (EntityPtr)0x0) && (this->_child != (EntityPtr)0x0)) && (*GHIDRA_CAST((GHIDRA_CAST(this->_child) + 0x172)) != '\0')) { @@ -3106,14 +3106,14 @@ LAB_005d33d8: } *GHIDRA_CAST((GHIDRA_CAST(EVar22) + 0x171)) = 1; *GHIDRA_CAST((GHIDRA_CAST(this->_child) + 0x188)) = *GHIDRA_CAST((mrMeData + 0x11c)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Float"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Float"),0); } } this->_state = 3; LAB_005d3f7c: if (*GHIDRA_CAST((mrMeData + 0x111)) != '\0') { - (GHIDRA_CAST(()))->AnimationState::Update(); - (GHIDRA_CAST(()))->AnimationState::Update(); + AnimationState::Update(); + AnimationState::Update(); } (this->_velocity).x = (this->_velocity).x * 0.9 + moveX * 0.1; (this->_velocity).y = (this->_velocity).y * 0.9 + moveY * 0.1; @@ -3351,7 +3351,7 @@ void Entity_Effect::Render(Vector *offset) local_154 = GHIDRA_CAST(this->_parent); if (local_154 == GHIDRA_CAST(0x0)) goto LAB_0060ab8d; layerSprite = GHIDRA_CAST((local_154 + 0x12)); - layer = (GHIDRA_CAST((layerSprite)))->ANM2::GetLayer(GHIDRA_CAST(this->_state)); + layer = ANM2::GetLayer(layerSprite,GHIDRA_CAST(this->_state)); fVar10 = g_displayPixelRatio; layer->_visible = 1; local_17c = GHIDRA_CAST((fVar10 * g_screenPointScale)); @@ -3388,20 +3388,20 @@ void Entity_Effect::Render(Vector *offset) local_154 = GHIDRA_CAST((float)dVar13); local_164.x = local_1b4.y + renderOffset->x; local_164.y = (float)local_154 / local_15c + renderOffset->y; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(&local_164,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,&local_164,&g_vectorZero,&g_vectorZero); goto LAB_0060ab8d; } } else if (iVar1 == 0x27) { if ((this->_subtype == 1) && (iVar1 = this->_parent, iVar1 != 0)) { if (*GHIDRA_CAST((iVar1 + 200)) < 3) goto LAB_0060ab8d; - layer = (GHIDRA_CAST((GHIDRA_CAST((iVar1 + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(GHIDRA_CAST((iVar1 + 0x48)),GHIDRA_CAST(0x2)); layer->_visible = 1; (GHIDRA_CAST((GHIDRA_CAST((this->_parent + 0x48)))))->Sprite::RenderLayer(2,pVVar3,&g_vectorZero,&g_vectorZero); layerSprite = GHIDRA_CAST((this->_parent + 0x48)); layerName = GHIDRA_CAST(0x2); LAB_0060ab84: - layer = (GHIDRA_CAST((layerSprite)))->ANM2::GetLayer(layerName); + layer = ANM2::GetLayer(layerSprite,layerName); layer->_visible = 0; goto LAB_0060ab8d; } @@ -3413,7 +3413,7 @@ LAB_0060ab84: (iVar1 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + uVar4 * 4 + 0x24)), iVar1 == 0)) || ((*GHIDRA_CAST((iVar1 + 4)) != 0x11 || (*GHIDRA_CAST((iVar1 + 0xc0)) < 2)))) goto LAB_0060ab8d; layerSprite = GHIDRA_CAST((iVar1 + 0x40)); - layer = (GHIDRA_CAST((layerSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(layerSprite,GHIDRA_CAST(0x1)); layer->_visible = 1; (GHIDRA_CAST((GHIDRA_CAST(layerSprite))))->Sprite::RenderLayer(1,&this->_renderPosition,&g_vectorZero,&g_vectorZero); layerName = GHIDRA_CAST(0x1); @@ -3587,7 +3587,7 @@ LAB_00607b21: fVar10 = local_170 * g_vectorOne.y; (this->_sprite)._scale.x = local_170 * g_vectorOne.x; (this->_sprite)._scale.y = fVar10; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(pVVar3,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,pVVar3,&g_vectorZero,&g_vectorZero); if (this->_parent != 0) { (GHIDRA_CAST((GHIDRA_CAST(&beamColor))))->Color::operator_assign(&(this->_sprite)._color); local_18c = this->_updateTime / 15.0; @@ -3693,7 +3693,7 @@ LAB_00607b21: } (GHIDRA_CAST((&scratchColor)))->Color::Color(); pCVar2 = Color::Lerp(&beamColor,GHIDRA_CAST(&DAT_00c5c8f8),to,fVar10 + fVar12); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::operator_assign(pCVar2); iVar1 = this->_target; if (iVar1 == 0) { @@ -3709,7 +3709,7 @@ LAB_00607b21: fVar12 = renderPos->x; (this->_renderPosition).y = renderPos->y + renderOffset->y; pVVar3->x = fVar10 + fVar12; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(pVVar3,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,pVVar3,&g_vectorZero,&g_vectorZero); } else { local_164.x = (this->_targetPosition).x; @@ -3953,7 +3953,7 @@ LAB_00607b21: } pvVar6 = (void *)0x0; if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)iVar1); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)iVar1); pvVar6 = (this->_sprite)._animState._animData; } local_164.x = parentColor._tint[GHIDRA_INT(local_158) * 2 + 1] + (this->_renderPosition).x; @@ -3979,7 +3979,7 @@ LAB_00607b21: } pvVar6 = (void *)0x0; if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)iVar1); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)iVar1); pvVar6 = (this->_sprite)._animState._animData; } local_164.x = (this->_renderPosition).x + parentColor._tint[GHIDRA_INT(local_158) * 2 + 1]; @@ -4019,7 +4019,7 @@ LAB_00607b21: (this->_renderPosition).y = fVar10 + fVar12; } else { - local_154 = (GHIDRA_CAST((GHIDRA_CAST((iVar1 + 0x78)))))->AnimationState::GetLayerFrame(0); + local_154 = AnimationState::GetLayerFrame(GHIDRA_CAST((iVar1 + 0x78)),0); if ((local_154 == GHIDRA_CAST(0x0)) || (*GHIDRA_CAST((local_154 + 0xb)) == '\0')) { iVar1 = this->_parent; isParentFrameVisible = '\0'; @@ -4034,12 +4034,12 @@ LAB_00607b21: local_15c = *GHIDRA_CAST((iVar1 + 0xe8)); LAB_00609482: if ((*GHIDRA_CAST((iVar1 + 0x28)) == 5) && (*GHIDRA_CAST((iVar1 + 0x2c)) == 0x45)) { - layer = (GHIDRA_CAST((GHIDRA_CAST((iVar1 + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((iVar1 + 0x48)),GHIDRA_CAST(0x0)); iVar1 = this->_parent; local_158 = GHIDRA_CAST(((float)local_158 + (layer->_pos).x + local_154[4])); local_18c = local_18c + (layer->_pos).y + local_154[5]; } - layer = (GHIDRA_CAST((GHIDRA_CAST((iVar1 + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((iVar1 + 0x48)),GHIDRA_CAST(0x0)); iVar1 = this->_parent; local_170 = local_170 * (layer->_size).x * local_154[6]; local_15c = local_15c * (layer->_size).y * local_154[7]; @@ -4067,7 +4067,7 @@ LAB_00609482: *pfVar5 = local_178.y; local_184.x = local_170 * *local_17c * 0.65 + pVVar3->x; local_184.y = local_15c * local_17c[1] * 0.65 + (this->_renderPosition).y; - (GHIDRA_CAST((GHIDRA_CAST((pfVar5 + -0x28)))))->ANM2::Render(&local_184,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((pfVar5 + -0x28)),&local_184,&g_vectorZero,&g_vectorZero); pfVar5 = pfVar5 + 0x45; local_154 = GHIDRA_CAST((GHIDRA_INT(local_154) + 1)); local_17c = local_17c + 2; @@ -4095,25 +4095,25 @@ LAB_00609482: (this->_sprite)._color._tint[3] = (float)local_154 * (this->_sprite)._color._tint[3]; if (*GHIDRA_CAST((GHIDRA_CAST(game->_room) + 0x12bc)) == 5) { (this->_sprite)._flipY = (this->_sprite)._flipY == 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); (this->_sprite)._flipY = (this->_sprite)._flipY == 0; (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST(&scratchColor)); } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST(&scratchColor)); } goto LAB_0060ab8d; } } } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(pVVar3,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,pVVar3,&g_vectorZero,&g_vectorZero); iVar1 = this->_variant; if (((iVar1 == 0x1e) || (iVar1 == 0x99)) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { - overlayFrame = (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::GetLayerFrame(1); + overlayFrame = AnimationState::GetLayerFrame(&(this->_sprite)._overlayAnimState,1); if (overlayFrame != GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((&overlayFrameCopy)))->AnimationState::copy_assign(overlayFrame); + AnimationState::copy_assign(&overlayFrameCopy,overlayFrame); (GHIDRA_CAST((&overlayLayer)))->LayerAnimation::LayerAnimation(); overlayFrameCopy._layerFrames = (void *)(this->_scale * 0.65); local_168 = &overlayFrameCopy; @@ -4352,7 +4352,7 @@ LAB_0060a8e9: fVar10 = *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x1c)) - *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x14)); } local_154 = GHIDRA_CAST((fVar10 * 0.8)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); (GHIDRA_CAST((GHIDRA_CAST(auStack_1f0))))->Color::operator_assign(&(this->_sprite)._color); FUN_004072e0(); (GHIDRA_CAST((&scratchColor)))->Color::operator_assign(&beamColor); @@ -4425,7 +4425,7 @@ LAB_0060a8e9: pfVar5 != GHIDRA_CAST(0x0))))) { local_178.x = *pfVar5 + (this->_renderPosition).x; local_178.y = (this->_renderPosition).y + pfVar5[1]; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_164.y) + 8)))))->ANM2::Render(&local_178,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((GHIDRA_INT(local_164.y) + 8)),&local_178,&g_vectorZero,&g_vectorZero); } } LAB_0060ab8d: @@ -4718,7 +4718,7 @@ LAB_0060b56c: if (0xf < local_28) { pppppppbVar4 = pppppppbVar9; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(pppppppbVar4),0); + ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(pppppppbVar4),0); pppppppbVar9 = joinedAnimName[0]; } local_14 = GHIDRA_CAST(0xffffffff); @@ -4748,9 +4748,9 @@ LAB_0060b56c: pbVar8 = (this->_sprite)._animState._animData; if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_0060b64b: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(fullAnimName,1); + bVar2 = ANM2::SetAnimation(&this->_sprite,fullAnimName,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -4816,7 +4816,7 @@ switchD_0060b3c2_default: iVar3 = this->_state; if (iVar3 == 1) { if (((this->_sprite)._animState._animData != (void *)0x0) && - (bVar2 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Shoot")), + (bVar2 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("Shoot")), bVar2 != 0)) { this->_state = 2; } @@ -4952,7 +4952,7 @@ void Entity_Effect::setup_loot_preview(void *lootQueue) iVar8 = 4; do { if (pAVar10->_loaded != 0) { - (GHIDRA_CAST((pAVar10)))->ANM2::Reset(); + ANM2::Reset(pAVar10); } iVar9 = ghostData; pAVar10 = pAVar10 + 1; @@ -5117,8 +5117,8 @@ LAB_0060bd7e: *GHIDRA_CAST((ghostData + 0x454)) = *GHIDRA_CAST((ghostData + 0x454)) + 1; pAVar10 = GHIDRA_CAST((ghostData + 4 + iVar8 * 0x114)); local_60 = pAVar10; - (GHIDRA_CAST((pAVar10)))->ANM2::Load(&entityConfig->anm2Path,0); - layer = (GHIDRA_CAST((pAVar10)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + ANM2::Load(pAVar10,&entityConfig->anm2Path,0); + layer = ANM2::GetLayer(pAVar10,GHIDRA_CAST(0x0)); (layer->_pos).x = 0.0; (layer->_pos).y = -4.0; if (local_68 == &DAT_00000005) { @@ -5201,7 +5201,7 @@ LAB_0060c216: } } else if (local_64 == 100) { - layer = (GHIDRA_CAST((pAVar10)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(pAVar10,GHIDRA_CAST(0x1)); (layer->_pos).x = 0.0; (layer->_pos).y = 4.0; if (local_58 != GHIDRA_CAST(0x0)) { @@ -5329,18 +5329,18 @@ LAB_0060c2e6: } } } - layer = (GHIDRA_CAST((pAVar10)))->ANM2::GetLayer(GHIDRA_CAST("shadow")); + layer = ANM2::GetLayer(pAVar10,GHIDRA_CAST("shadow")); if (layer != GHIDRA_CAST(0x0)) { layer->_visible = 0; } - (GHIDRA_CAST((pAVar10)))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(pAVar10,unk); stringPtr = &pAVar10->_animDefaultName; if (0xf < (pAVar10->_animDefaultName)._capacity) { stringPtr = *GHIDRA_CAST(stringPtr->_buf); } - isPicked = (GHIDRA_CAST((pAVar10)))->ANM2::SetAnimation(GHIDRA_CAST(stringPtr),1); + isPicked = ANM2::SetAnimation(pAVar10,GHIDRA_CAST(stringPtr),1); if (((isPicked != 0) && ((pAVar10->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&pAVar10->_animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&pAVar10->_animState,0.0), (pAVar10->_animState)._animData != (void *)0x0)) { (pAVar10->_animState)._isPlaying = 0; } @@ -5425,9 +5425,9 @@ LAB_0060c3c5: } } } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } diff --git a/generated-src/entity_familiar.cpp b/generated-src/entity_familiar.cpp index 8814fd2..0673d61 100644 --- a/generated-src/entity_familiar.cpp +++ b/generated-src/entity_familiar.cpp @@ -143,7 +143,7 @@ void Entity_Familiar::ai_umbilical_baby(uint8_t isInterpolated) *puVar1 = listHead; *listHead = puVar1; ehState = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x1))),2); - (GHIDRA_CAST((GHIDRA_CAST((puVar3 + 6)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((puVar3 + 6))); puVar3[0x4c] = 0; puVar3[0x4d] = 0; puVar3[0x4e] = 0; @@ -156,7 +156,7 @@ void Entity_Familiar::ai_umbilical_baby(uint8_t isInterpolated) set_extra_data(&sprite->_extraData,puVar3); (GHIDRA_CAST((anm2Path._buf)))->msvc::string::string(&sprite->_sprite); ehState = 3; - (GHIDRA_CAST((GHIDRA_CAST((puVar3 + 6)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((puVar3 + 6)),&anm2Path,1); ehState = -1; if (0xf < anm2Path._capacity) { uVar9 = anm2Path._capacity + 1; @@ -171,9 +171,9 @@ void Entity_Familiar::ai_umbilical_baby(uint8_t isInterpolated) } operator_delete(pvVar7,uVar9); } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((puVar3 + 6)))))->ANM2::SetAnimation(&DAT_00b1d20c,1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((puVar3 + 6)),&DAT_00b1d20c,1); if (((bVar2 != 0) && (puVar3[0x13] != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST((puVar3 + 0x12)))))->AnimationState::SetFrameFloat(0.0), puVar3[0x13] != 0)) { + (AnimationState::SetFrameFloat(GHIDRA_CAST((puVar3 + 0x12)),0.0), puVar3[0x13] != 0)) { *GHIDRA_CAST((puVar3 + 0x17)) = 0; } Entity_Player::GetTearHitParams(sprite->_player,&tearHitParams,10,1.0,1,GHIDRA_CAST(sprite->_player)); @@ -330,7 +330,7 @@ LAB_00431f23: animName = (&PTR_s_BodySide_00b1d240)[GHIDRA_INT(local_cc)]; local_c8 = &sprite->_sprite; (sprite->_sprite)._overlayRenderFirst = local_cc != GHIDRA_CAST(&DAT_00000006); - (GHIDRA_CAST((local_c8)))->ANM2::PlayOverlay(animName,0); + ANM2::PlayOverlay(local_c8,animName,0); if (((local_cc == GHIDRA_CAST(0x0)) || (local_cc == GHIDRA_CAST(0x1))) || (local_cc == GHIDRA_CAST(&DAT_00000007))) { local_b9 = 1; @@ -339,33 +339,33 @@ LAB_00431f23: local_b9 = 0; } local_b9 = (sprite->_sprite)._flipX ^ local_b9; - layer = (GHIDRA_CAST((&sprite->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&sprite->_sprite,GHIDRA_CAST(0x1)); layer->_flipX = local_b9; - local_114 = (GHIDRA_CAST((&(sprite->_sprite)._overlayAnimState)))->AnimationState::GetNullFrameById(0); + local_114 = AnimationState::GetNullFrameById(&(sprite->_sprite)._overlayAnimState,0); if (local_114 != GHIDRA_CAST(0x0)) { local_cc = GHIDRA_CAST((*local_114 + 0.0 + (float)local_fc * 6.0)); local_fc = GHIDRA_CAST(((local_114[1] - 8.0) + (float)local_d4 * 6.0)); - layer = (GHIDRA_CAST((&sprite->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&sprite->_sprite,GHIDRA_CAST(0x0)); (layer->_pos).x = (float)local_cc; (layer->_pos).y = (float)local_fc; if ((sprite->_sprite)._flipX != 0) { - layer = (GHIDRA_CAST((local_c8)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(local_c8,GHIDRA_CAST(0x0)); local_cc = GHIDRA_CAST((GHIDRA_UINT((layer->_pos).x) ^ 0x80000000)); - layer = (GHIDRA_CAST((local_c8)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(local_c8,GHIDRA_CAST(0x0)); (layer->_pos).x = (float)local_cc; } sprite = local_c8; - layer = (GHIDRA_CAST((local_c8)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(local_c8,GHIDRA_CAST(0x0)); local_c0 = GHIDRA_CAST(0x0); (layer->_size).x = local_114[4]; (layer->_size).y = local_114[5]; do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - copyLayer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(*GHIDRA_CAST((GHIDRA_CAST(local_c0) + 0xb1d238))); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); + copyLayer = ANM2::GetLayer(sprite,*GHIDRA_CAST((GHIDRA_CAST(local_c0) + 0xb1d238))); (copyLayer->_pos).x = (layer->_pos).x; (copyLayer->_pos).y = (layer->_pos).y; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - copyLayer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(*GHIDRA_CAST((GHIDRA_CAST(local_c0) + 0xb1d238))); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); + copyLayer = ANM2::GetLayer(sprite,*GHIDRA_CAST((GHIDRA_CAST(local_c0) + 0xb1d238))); (copyLayer->_size).x = (layer->_size).x; (copyLayer->_size).y = (layer->_size).y; local_c0 = GHIDRA_CAST((GHIDRA_INT(local_c0) + 4)); @@ -1625,10 +1625,10 @@ switchD_00436422_caseD_67: (GHIDRA_CAST((GHIDRA_CAST(this_00))))->Sprite::ReplaceSpritesheet(1,GHIDRA_CAST((local_58 + 0x57))); this_00 = extraout_ECX; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)this_00); + ANM2::LoadGraphics(&this->_sprite,(uint8_t)this_00); LAB_0043680d: local_54 = local_58 + 0x36; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); if (&layer->_color != GHIDRA_CAST(local_54)) { fVar5 = local_54[1]; fVar6 = local_54[2]; @@ -1648,7 +1648,7 @@ LAB_0043680d: (layer->_color)._offset[2] = local_54[10]; } local_54 = local_58 + 0x2b; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); if (&layer->_color != GHIDRA_CAST(local_54)) { fVar5 = local_54[1]; fVar6 = local_54[2]; @@ -1677,7 +1677,7 @@ LAB_0043680d: wispColor._offset[0] = -2.0078433; wispColor._offset[1] = -2.0078433; wispColor._offset[2] = -2.0078433; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); if (&layer->_color != &wispColor) { (layer->_color)._tint[0] = (float)0x40323232; (layer->_color)._tint[1] = (float)0x40323232; @@ -1694,7 +1694,7 @@ LAB_0043680d: wispColor._offset[0] = 0.0; wispColor._offset[1] = 0.0; wispColor._offset[2] = 0.0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layerColor = &layer->_color; if (layerColor != &wispColor) { fVar5 = 0.078431375; @@ -1754,7 +1754,7 @@ LAB_0043680d: wispColor._offset[2] = 0.0; wispColor._tint[3] = 1.0; wispColor._tint[2] = local_90._blue * 2.0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); if (&layer->_color != &wispColor) { (layer->_color)._tint[0] = wispColor._tint[0]; (layer->_color)._tint[1] = wispColor._tint[1]; @@ -1812,7 +1812,7 @@ LAB_0043680d: wispColor._tint[0] = rgbColor->_red * 2.0; wispColor._tint[1] = rgbColor->_green * 2.0; wispColor._tint[2] = rgbColor->_blue * 2.0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layerColor = &layer->_color; if (layerColor != &wispColor) { fVar5 = wispColor._tint[0]; @@ -2483,7 +2483,7 @@ LAB_004372a0: } else { ::(GHIDRA_CAST((&layer1Color)))->Color::Color(); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer1Color._colorize[0] = (layer->_color)._tint[0]; layer1Color._colorize[1] = (layer->_color)._tint[1]; layer1Color._colorize[2] = (layer->_color)._tint[2]; @@ -2528,7 +2528,7 @@ LAB_00438335: } else { ::(GHIDRA_CAST((&layer0Color)))->Color::Color(); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer0Color._colorize[0] = (layer->_color)._tint[0]; layer0Color._colorize[1] = (layer->_color)._tint[1]; layer0Color._colorize[2] = (layer->_color)._tint[2]; @@ -3000,11 +3000,11 @@ LAB_00438842: break; case 0x4d: switchD_00438fa0_caseD_4d: - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); scratchVec.y = (layer->_color)._tint[0] * 0.5; - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); local_b8.y = (layer->_color)._tint[1] * 0.5; - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; @@ -3020,11 +3020,11 @@ switchD_00438fa0_caseD_4d: (GHIDRA_CAST((&tearColor)))->Color::operator_assign(&tmpColor); break; case 0x66: - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); scratchVec.y = (layer->_color)._tint[0] * 0.5; - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); local_b8.y = (layer->_color)._tint[1] * 0.5; - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; @@ -3097,11 +3097,11 @@ switchD_00438fa0_caseD_4d: fVar8 = (GHIDRA_CAST((&local_e0)))->RNG::RandomFloat(); fallingAccel = 0.0; local_d0.y = fVar8 * 0.4 - 0.2; - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); scratchVec.y = (layer->_color)._tint[0] * 0.5; - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); local_b8.y = (layer->_color)._tint[1] * 0.5; - layer = (GHIDRA_CAST((&dropRng->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&dropRng->_sprite,GHIDRA_CAST(0x1)); tmpColor._offset[2] = (layer->_color)._tint[2] * 0.5; tmpColor._colorize[0] = 0.0; tmpColor._colorize[1] = 0.0; @@ -3689,14 +3689,14 @@ void Entity_Familiar::ai_wisp() this->_state = 0; this->_fireCooldown = 0; this->_entityGridCollisionClass = 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - piVar8 = (GHIDRA_CAST((layer)))->LayerState::GetTexture(texture); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + piVar8 = LayerState::GetTexture(layer,texture); ehState = 0.0; anim_00 = s_Idle2; if (*GHIDRA_CAST((*piVar8 + 0x10)) < 0x81) { anim_00 = s_Idle; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(anim_00,0); + ANM2::SetAnimation(&this->_sprite,anim_00,0); ehState = 1.4013e-45; if (((textureRefBlock != GHIDRA_CAST(0x0)) && (cVar5 = (**(code **)(*textureRefBlock + 0xc))(uVar7), cVar5 != '\0')) && @@ -3824,12 +3824,12 @@ LAB_0043ac23: local_1cc = sqrtf(local_1c4); local_1c0 = GHIDRA_CAST((local_1cc * g_vectorOne.x)); local_1cc = local_1cc * g_vectorOne.y; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (layer->_size).x = (float)local_1c0; (layer->_size).y = local_1cc; local_1c0 = GHIDRA_CAST((local_1c4 * g_vectorOne.x)); local_1c4 = local_1c4 * g_vectorOne.y; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); (layer->_size).x = (float)local_1c0; (layer->_size).y = local_1c4; player = this->_player; @@ -3871,7 +3871,7 @@ LAB_0043bfef: } hsv_to_rgb(&primaryHueColor,(float)local_1b4 * 360.0,(float)local_1c0,(float)local_1bc,1.0); ::(GHIDRA_CAST((&rainbowPrimaryColor)))->Color::Color(); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); if (&layer->_color != GHIDRA_CAST(extraout_EAX_02)) { fVar12 = extraout_EAX_02[1]; fVar16 = extraout_EAX_02[2]; @@ -3896,7 +3896,7 @@ LAB_0043bfef: } hsv_to_rgb(&secondaryHueColor,fVar12 * 360.0,(float)local_1c0,(float)local_1bc,1.0); ::(GHIDRA_CAST((&rainbowSecondaryColor)))->Color::Color(); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); if (&layer->_color != GHIDRA_CAST(extraout_EAX_03)) { fVar12 = extraout_EAX_03[1]; fVar16 = extraout_EAX_03[2]; @@ -4186,11 +4186,11 @@ code_r0x0043bfeb: 0xc33a98); ::(GHIDRA_CAST((&pillPrimaryColor)))->Color::Color(); pillLayerColor = extraout_EAX_00; - layer = (GHIDRA_CAST((GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 9)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 9)),GHIDRA_CAST(0x0)); ::(GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::operator_assign(pillLayerColor); ::(GHIDRA_CAST((&pillSecondaryColor)))->Color::Color(); pillLayerColor = extraout_EAX_01; - layer = (GHIDRA_CAST((GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 9)))))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 9)),GHIDRA_CAST(0x1)); ::(GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::operator_assign(pillLayerColor); } } @@ -4753,7 +4753,7 @@ LAB_0043ce03: if (0.0 < local_1cc) { anim = "SpecialUp"; } - (GHIDRA_CAST((GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 9)))))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 9)),GHIDRA_CAST(anim),0); pvVar2 = (GHIDRA_CAST(this))->_gridEntities[0xde]; (GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 0xcf)))->x = local_1c4 * 0.4 * (float)pvVar2 + (GHIDRA_CAST(((GHIDRA_CAST(this))->_gridEntities + 0xcf)))->x; @@ -5456,10 +5456,12 @@ void Entity_Familiar::ai_buddy_inbox() } if (headState != 1) { if (headState == 2) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(*GHIDRA_CAST((GHIDRA_INT(&PTR_s_HeadFrontWiggleOpen_00b62994) + backAnimOffset)),0); + ANM2::Play(&this->_sprite, + *GHIDRA_CAST((GHIDRA_INT(&PTR_s_HeadFrontWiggleOpen_00b62994) + backAnimOffset)),0); return; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(*GHIDRA_CAST((GHIDRA_INT(&PTR_s_HeadFrontWiggleClosed_00b6299c) + backAnimOffset)),0); + ANM2::Play(&this->_sprite, + *GHIDRA_CAST((GHIDRA_INT(&PTR_s_HeadFrontWiggleClosed_00b6299c) + backAnimOffset)),0); return; } VStack_c0.y = *GHIDRA_CAST((GHIDRA_INT(&PTR_s_HeadFrontWiggleTransition_00b6298c) + backAnimOffset)); @@ -5504,7 +5506,7 @@ LAB_005ae576: uVar3 = 0; LAB_005ae57b: if (uVar3 == 0) goto LAB_005ae57f; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(VStack_c0.y),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(VStack_c0.y),0); } else { pcVar7 = "HeadFrontWiggleTransition"; @@ -5534,9 +5536,9 @@ LAB_005ae57f: else { savedFrame = (this->_sprite)._animState._animFrame; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(VStack_c0.y),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(VStack_c0.y),0); if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(savedFrame); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,savedFrame); } } bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::IsEventTriggered("Shoot"); @@ -5559,22 +5561,22 @@ LAB_005ae57f: } break; case 1: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Body1Wiggle"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Body1Wiggle"),0); return; case 2: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Body2Wiggle"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Body2Wiggle"),0); return; case 3: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Body3Wiggle"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Body3Wiggle"),0); return; case 4: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Body4Wiggle"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Body4Wiggle"),0); return; case 5: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Body5Wiggle"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Body5Wiggle"),0); return; case 6: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Body6Wiggle"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Body6Wiggle"),0); headState = this->_parent; angle = atan2f(((*GHIDRA_CAST((headState + 0x340)) + *GHIDRA_CAST((headState + 0x350))) - (this->_pos).y ) - (this->_posOffset).y, @@ -5656,7 +5658,7 @@ void Entity_Familiar::Constructor() (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_chargeBarSprite); this->_extraData = (void *)0x0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xee4)))) = 0; this->_sirenHelper = 0; @@ -6404,7 +6406,7 @@ LAB_00611d87: this = local_12c; } if (this->_variant == 0xd8) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (layer->_size).x = g_vectorZero.x; (layer->_size).y = g_vectorZero.y; this->_state = 0x1c2; @@ -8016,19 +8018,19 @@ Vector * Entity_Familiar::GetOrbitPosition(Vector *outPosition, Vector *offset) 3.1415927 * 0.5,6.2831855); iVar2 = this->_variant; if (iVar2 == 0x23) { - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Rotation"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Rotation"),1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(6.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,6.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } scratchVec.x = (fVar3 * 180.0) / 3.1415927; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_rotation = scratchVec.x; iVar2 = this->_variant; } if (iVar2 == 0x7e) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_rotation = (fVar3 * 180.0) / 3.1415927; } iVar2 = this->_orbitLayer; @@ -8156,14 +8158,14 @@ void Entity_Familiar::PlayFloatAnim(int direction) } if (variant == 0xce) { ExceptionList = &local_10; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(textureRef); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + texture = LayerState::GetTexture(layer,textureRef); local_8 = 0; anim = s_Idle2; if (*GHIDRA_CAST((*texture + 0x10)) < 0x81) { anim = s_Idle; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(anim,0); + ANM2::SetAnimation(&this->_sprite,anim,0); local_8 = 1; if (textureImage == GHIDRA_CAST(0x0)) { ExceptionList = local_10; @@ -8184,7 +8186,7 @@ void Entity_Familiar::PlayFloatAnim(int direction) } if (variant == 0xed) { ExceptionList = &local_10; - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,0); + ANM2::SetAnimation(&this->_sprite,s_Idle,0); ExceptionList = local_10; return; } @@ -8249,7 +8251,7 @@ switchD_00613f56_caseD_3: switchD_00613f56_caseD_2: anim_00 = "FloatSide"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(anim_00),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(anim_00),0); switchD_00613f25_default: ExceptionList = local_10; return; @@ -8501,9 +8503,9 @@ void Entity_Familiar::PlayChargeAnim(int direction) default: goto switchD_006143f4_default; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)chargeFrame), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)chargeFrame), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -8558,14 +8560,14 @@ void Entity_Familiar::PlayShootAnim(int direction) variant = this->_variant; if (variant == 0xce) { ExceptionList = &local_10; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(textureRef); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + texture = LayerState::GetTexture(layer,textureRef); local_8 = 0; animName = "Shoot2"; if (*GHIDRA_CAST((*texture + 0x10)) < 0x81) { animName = "Shoot"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),0); + ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),0); local_8 = 1; if (textureImage == GHIDRA_CAST(0x0)) { ExceptionList = local_10; @@ -8586,7 +8588,7 @@ void Entity_Familiar::PlayShootAnim(int direction) } if (variant == 0xed) { ExceptionList = &local_10; - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Shoot"),0); + ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Shoot"),0); ExceptionList = local_10; return; } @@ -8615,9 +8617,9 @@ void Entity_Familiar::PlayShootAnim(int direction) } else { if (variant == 0x58) { - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Level3Shoot"),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Level3Shoot"),1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if (direction == 0) { @@ -8647,7 +8649,7 @@ switchD_00614663_caseD_3: goto switchD_00614663_default; } } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(animName),0); switchD_00614663_default: ExceptionList = local_10; return; @@ -8730,14 +8732,14 @@ void Entity_Familiar::Shoot() (iVar3 = this->_headFrameDelay + -1, this->_headFrameDelay = iVar3, iVar3 < 0)) && (iVar5 != 0x58)) { if (iVar5 == 0xce) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texturePtr = (GHIDRA_CAST((layer)))->LayerState::GetTexture(texture); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + texturePtr = LayerState::GetTexture(layer,texture); local_14 = 0; anim = s_Idle2; if (*GHIDRA_CAST((*texturePtr + 0x10)) < 0x81) { anim = s_Idle; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(anim,0); + ANM2::SetAnimation(&this->_sprite,anim,0); local_14 = 1; if (((local_30 != GHIDRA_CAST(0x0)) && (isLastRef = local_30->Update(uVar2), isLastRef != '\0')) && @@ -8749,7 +8751,7 @@ void Entity_Familiar::Shoot() } else { if (iVar5 == 0xed) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,0); + ANM2::SetAnimation(&this->_sprite,s_Idle,0); ExceptionList = local_1c; return; } @@ -8765,7 +8767,7 @@ void Entity_Familiar::Shoot() else { floatAnim = "StoppedDown"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(floatAnim),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(floatAnim),0); } } } @@ -9106,7 +9108,7 @@ void Entity_Familiar::ai_walker() ExceptionList = local_10; return; } - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); ExceptionList = local_10; return; } @@ -9214,9 +9216,9 @@ LAB_00617325: } animName = "WalkHori"; } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00617356: @@ -9328,9 +9330,9 @@ LAB_006173d7: } pbVar5 = local_18; LAB_0061748d: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(pbVar5,1); + bVar2 = ANM2::SetAnimation(&this->_sprite,pbVar5,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } ExceptionList = local_10; @@ -9418,7 +9420,7 @@ LAB_006189fb: iVar6 = 0; } this->_fireCooldown = iVar6; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); ExceptionList = local_10; return; } @@ -9469,7 +9471,7 @@ LAB_006189fb: chargeLevelPtr = collisionPoint; } fVar11 = *chargeLevelPtr; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_s_Charge0_00b648f0)[GHIDRA_INT(fVar11)],0); + ANM2::Play(&this->_sprite,(&PTR_s_Charge0_00b648f0)[GHIDRA_INT(fVar11)],0); fVar11 = (float)GHIDRA_INT(fVar11); this->SetCollisionDamage(fVar11 + fVar11 + 2.0); EntityList::QueryRadius @@ -9508,7 +9510,7 @@ LAB_006189fb: fVar12 = (this->_velocity).y; if (ABS(fVar12) < ABS(fVar11)) { if (((iVar6 == 3) || (iVar6 == 0x68)) || ((iVar6 == 0xdf && (this->_fireCooldown == -1)))) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("FloatShootSide"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("FloatShootSide"),0); fVar11 = (this->_velocity).x; } (this->_sprite)._flipX = fVar11 < 0.0; @@ -9521,7 +9523,7 @@ LAB_006189fb: animName = "FloatShootDown"; } } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(animName),0); LAB_006177c3: if (this->_variant == 0x82) { iVar6 = this->_target; @@ -9575,10 +9577,10 @@ LAB_00617925: currentAnimName = GHIDRA_CAST(puVar8[0x1f]); if (currentAnimName == GHIDRA_CAST(0x0)) { LAB_00617990: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((puVar8 + 0x12)))))->ANM2::SetAnimation(GHIDRA_CAST("Touched"),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((puVar8 + 0x12)),GHIDRA_CAST("Touched"),1); fVar11 = local_2c.y; if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_2c.y) + 0x30)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(local_2c.y) + 0x30))); *GHIDRA_CAST((GHIDRA_CAST(fVar11) + 0x44)) = 1; puVar8 = GHIDRA_CAST(local_1c.y); } @@ -9663,13 +9665,13 @@ LAB_006179e0: iVar6 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::get_velocity_direction(); sprite = &this->_sprite; if (iVar6 == 3) { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + ANM2::Play(sprite,GHIDRA_CAST("FloatDown"),0); } else if (iVar6 == 1) { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("FloatUp"),0); + ANM2::Play(sprite,GHIDRA_CAST("FloatUp"),0); } else { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("FloatSide"),0); + ANM2::Play(sprite,GHIDRA_CAST("FloatSide"),0); (this->_sprite)._flipX = iVar6 == 0; } } @@ -9834,7 +9836,7 @@ LAB_006179e0: bVar2 = (GHIDRA_CAST((&this->_gridCollisionNormal)))->Vector::operator_eq(&g_vectorZero); if (bVar2 == 0) { if (ABS((float)local_30) < ABS((float)local_24)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("HitSide"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("HitSide"),0); (this->_sprite)._flipX = (float)local_24 < 0.0; } else { @@ -9842,7 +9844,7 @@ LAB_006179e0: if ((float)local_30 < 0.0) { animName = "HitUp"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(animName),0); } manager = g_manager; (this->_targetPosition).x = (this->_pos).x; @@ -9906,15 +9908,15 @@ LAB_00618228: iVar6 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::get_velocity_direction(); sprite = &this->_sprite; if (iVar6 == 3) { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + ANM2::Play(sprite,GHIDRA_CAST("FloatDown"),0); } else { if (iVar6 != 1) { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("FloatSide"),0); + ANM2::Play(sprite,GHIDRA_CAST("FloatSide"),0); bVar10 = iVar6 == 0; goto LAB_006185e8; } - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("FloatUp"),0); + ANM2::Play(sprite,GHIDRA_CAST("FloatUp"),0); } } } @@ -9946,14 +9948,14 @@ LAB_00618228: if (GHIDRA_INT(*collisionPoint) < 4) { chargeLevelPtr = collisionPoint; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play((&PTR_DAT_00b648e0)[GHIDRA_INT(*chargeLevelPtr)],0); + ANM2::Play(&this->_sprite,(&PTR_DAT_00b648e0)[GHIDRA_INT(*chargeLevelPtr)],0); } } else { iVar6 = g_game->_currentRoomIdx; if ((((iVar6 != -0x14) && (iVar6 != -0x12)) && (iVar6 != -0xd)) && (((iVar6 != -4 && (iVar6 != -6)) && (iVar6 != -0x13)))) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Spawn,0); + ANM2::Play(&this->_sprite,s_Spawn,0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::IsEventTriggered("Shoot"); if (bVar2 != 0) { Room::FindFreePickupSpawnPosition(g_game->_room,&local_2c,&this->_pos,0.0,0,0,1); @@ -9994,7 +9996,7 @@ LAB_00618228: } } else if (((iVar6 == 0xd5) || (iVar6 == 0xd6)) || (iVar6 == 0xdf)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); fVar11 = (this->_velocity).x; FUN_0058e210(); if ((*GHIDRA_CAST((GHIDRA_CAST(&(in_XMM0)) + 0x0))) != 0.0) { @@ -10004,9 +10006,9 @@ LAB_006185e8: } } else { - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Float")); + bVar2 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("Float")); if (bVar2 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Float"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Float"),0); } } if (0 < this->_fireCooldown) { @@ -10279,14 +10281,14 @@ void Entity_Familiar::ai_auto_shooter() iVar4 = this->_variant; if (iVar4 != 0x58) { if (iVar4 == 0xce) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_24); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + texture = LayerState::GetTexture(layer,&local_24); local_8 = 2; anim = s_Idle2; if (*GHIDRA_CAST((*texture + 0x10)) < 0x81) { anim = s_Idle; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(anim,0); + ANM2::SetAnimation(&this->_sprite,anim,0); local_8 = 3; if (((GHIDRA_CAST(local_24.y) != GHIDRA_CAST(0x0)) && (isLastRef = (**(code **)(*GHIDRA_CAST(local_24.y) + 0xc))(), isLastRef != '\0')) && @@ -10298,7 +10300,7 @@ void Entity_Familiar::ai_auto_shooter() } else { if (iVar4 == 0xed) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,0); + ANM2::SetAnimation(&this->_sprite,s_Idle,0); ExceptionList = local_10; return; } @@ -10314,7 +10316,7 @@ void Entity_Familiar::ai_auto_shooter() else { anim_00 = "StoppedDown"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(anim_00),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(anim_00),0); } } } @@ -10514,8 +10516,8 @@ LAB_0061a861: uVar6 = 0; LAB_0061a866: if ((uVar6 == 0) && - (bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PreSpawn"),1), bVar4 != 0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + (bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("PreSpawn"),1), bVar4 != 0)) { + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -10690,8 +10692,8 @@ LAB_0061b860: uVar6 = 0; LAB_0061b865: if (((uVar6 != 0) || (curAnimName[0x34] != 0)) && - (bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("FloatDown"),1), bVar4 != 0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + (bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("FloatDown"),1), bVar4 != 0)) { + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -10722,9 +10724,9 @@ LAB_0061ab77: uVar6 = 0; LAB_0061ab7c: if (uVar6 != 0) goto LAB_0061b7e0; - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Spawn,1); + bVar4 = ANM2::SetAnimation(&this->_sprite,s_Spawn,1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } local_28[0] = 0.0; @@ -11315,7 +11317,7 @@ LAB_0061bb97: if (this->_target == 0) { animName = "Float"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(animName),0); (GHIDRA_CAST((&color)))->Color::operator_assign(&(this->_sprite)._color); if (this->_target == 0) { fVar4 = 0.5; @@ -11357,9 +11359,9 @@ LAB_0061bbfc: } animName = GHIDRA_CAST(s_Idle); } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0061bd0b: @@ -11438,7 +11440,7 @@ LAB_0061bee8: if ((rngResult & 1) == 0) { anim = "StompLeg"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(anim),(uint8_t)uVar3); + ANM2::Play(&this->_sprite,GHIDRA_CAST(anim),(uint8_t)uVar3); uVar3 = Random(); (this->_sprite)._flipX = ~(uint8_t)uVar3 & 1; } @@ -11488,9 +11490,9 @@ LAB_0061c025: if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0061c058; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -11502,7 +11504,7 @@ LAB_0061c058: dVar9 = floor((double)(this->_sprite)._animState._animFrame); if ((9 < GHIDRA_INT(dVar9)) && (GHIDRA_INT(dVar9) < 0x20)) { if ((*GHIDRA_CAST(&g_game->_deathmatchManager) < 2) || - (target = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(), target < 0x11)) { + (target = ANM2::GetFrame(&this->_sprite), target < 0x11)) { target = 3; } else { @@ -11644,7 +11646,7 @@ void Entity_Familiar::ai_key_full() if (this->_isFollower == 0) { AddToFollowers(this); } - pLVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar6 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); pLVar6->_rotation = 0.0; pbVar8 = (this->_sprite)._animState._animData; if (pbVar8 != GHIDRA_CAST(0x0)) { @@ -11673,9 +11675,9 @@ LAB_0061d9c2: if ((uVar5 == 0) && ((pbVar8[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0061d9f5; } - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Float"),1); + bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Float"),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0061d9f5: @@ -11704,9 +11706,9 @@ LAB_0061d7a9: ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) != '\0' && ((this->_sprite)._animState._isPlaying == 0)))) { LAB_0061d7bc: - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar4 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -11716,14 +11718,14 @@ LAB_0061d7bc: followTarget.x = local_18; followTarget.y = doorTargetY; FollowPosition(this,&followTarget); - pLVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar6 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); manager = g_manager; if (pLVar6->_rotation < 90.0) { local_18 = pLVar6->_rotation + 2.0; if (90.0 <= local_18) { local_18 = 90.0; } - pLVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar6 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); pLVar6->_rotation = local_18; return; } @@ -12035,13 +12037,13 @@ LAB_0061dc46: uVar4 = this->_variant; if (900 < uVar4) goto switchD_0061ddf2_caseD_12; if (uVar4 == 900) { - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { animName = "FlyingIdle"; if (this->_entityGridCollisionClass != 3) { animName = GHIDRA_CAST(s_Idle); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(animName),0); } room = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level)::GetCurrentRoom(); bVar1 = (GHIDRA_CAST((room)))->Room::is_type_16(); @@ -12177,7 +12179,7 @@ switchD_0061ddf2_caseD_2: case 0x11: case 0xcf: MoveDiagonally(this,1.0); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Float"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Float"),0); break; case 0x14: case 0x15: @@ -12188,10 +12190,10 @@ switchD_0061ddf2_caseD_2: case 0x5b: case 0x72: FollowParent(this); - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(s_Spawn); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,s_Spawn); if (bVar1 != 0) { if (this->_variant != 0x17) goto LAB_00623343; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Float"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Float"),0); } break; case 0x18: @@ -12214,7 +12216,7 @@ switchD_0061ddf2_caseD_2: animName = "Float%u"; } sprintf_s(animNameBuf,0x32,GHIDRA_CAST(animName)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(animNameBuf,0); + ANM2::Play(&this->_sprite,animNameBuf,0); scratchVec = (GHIDRA_CAST((this->_player)))->Entity::Position(&local_158); (GHIDRA_CAST((&this->_pos)))->Vector::__sub(&local_140,scratchVec); local_128.y = (GHIDRA_CAST((&local_140)))->Vector::LengthSquared(); @@ -12294,16 +12296,16 @@ LAB_0061f2a8: ai_orbital_variant_50(this); break; case 0x33: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&DAT_00b1d3b0); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&DAT_00b1d3b0); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); Entity_Player::UseActiveItem(this->_player,GHIDRA_CAST((GHIDRA_INT(&local_134) + 2)),0x23,1,-1,0); itemOverlay = GHIDRA_CAST((GHIDRA_CAST((g_game)))->Game)::GetItemOverlay(); (GHIDRA_CAST((itemOverlay)))->ItemOverlay::Show(1,0,GHIDRA_CAST(0x0)); } goto LAB_0061f886; case 0x34: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("FloatDown"),0); FollowParent(this); bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::IsFrame(4,0); if (bVar1 != 0) { @@ -12439,8 +12441,8 @@ LAB_0061dea4: } this->_friction = this->_friction * 0.8; if ((this->_fireCooldown < 1) && - (bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar1 != 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + (bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty), bVar1 != 0)) { + ANM2::Play(&this->_sprite,GHIDRA_CAST("FloatDown"),0); } local_130.y = (float)(GHIDRA_CAST((this->_player)))->Entity_Player::GetFireDirection(); (GHIDRA_CAST((GHIDRA_CAST(&local_160))))->EntityPtr::clear(); @@ -12454,10 +12456,10 @@ LAB_0061dea4: if (GHIDRA_CAST(local_130.y) == GHIDRA_CAST(0xffffffff)) { if (0 < iVar8) { if (iVar8 < 0x1e) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("FloatDown"),0); } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("ChargeAttack"),1); + ANM2::Play(&this->_sprite,GHIDRA_CAST("ChargeAttack"),1); this->_fireCooldown = 0; bVar1 = (GHIDRA_CAST((this->_player)))->Entity_Player::HasCollectible(0xf7,0); local_134 = GHIDRA_CAST(CONCAT13(bVar1,(undefined3)local_134)); @@ -12619,9 +12621,9 @@ LAB_0061dea4: } } else { - if ((iVar8 < 1) && (bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar1 == 0)) { + if ((iVar8 < 1) && (bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty), bVar1 == 0)) { animState = GHIDRA_CAST(Config)::GetPillEffects(); - bVar1 = (GHIDRA_CAST((animState)))->AnimationState::IsLoopingAnimation(); + bVar1 = AnimationState::IsLoopingAnimation(animState); if (bVar1 == 0) goto LAB_00620a2e; } local_11c = GHIDRA_CAST((this->_fireCooldown + 1)); @@ -12630,15 +12632,15 @@ LAB_0061dea4: iVar8 = *piVar11; this->_fireCooldown = iVar8; if (0x12 < iVar8) { - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("FloatDown")); + bVar1 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("FloatDown")); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("ChargeStart"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("ChargeStart"),0); goto LAB_00620a2e; } } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("ChargeLoop"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("ChargeLoop"),0); } } } @@ -12910,7 +12912,7 @@ LAB_0061e0e9: Room::FindFreePickupSpawnPosition(room,&local_140,&this->_pos,0.0,0,0,0); uVar4 = Random(); (GHIDRA_CAST((g_game)))->Game::Spawn(5,0x5a,&local_140,&g_vectorZero,GHIDRA_CAST(this),0,uVar4); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Spawn,1); + ANM2::Play(&this->_sprite,s_Spawn,1); iVar8 = 0x3f3; } else { @@ -12937,14 +12939,14 @@ LAB_0061e0e9: gridIndexCounts = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(local_130.y))))->EntityList)::Size(); } while (local_EAX_25497 < gridIndexCounts); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b63f60,1); + ANM2::Play(&this->_sprite,&DAT_00b63f60,1); SoundEffects::PlayWithFartOverride(0x3f5,1.0,2,0,1.0); } else if (uVar4 != 2) goto LAB_0061e295; goto switchD_0061ddf2_caseD_70; } Entity_Player::AddActiveCharge(this->_player,1,-1,0,0,0); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b63f60,1); + ANM2::Play(&this->_sprite,&DAT_00b63f60,1); iVar8 = 0x3f4; } SoundEffects::PlayWithFartOverride(iVar8,1.0,2,0,1.0); @@ -12962,9 +12964,9 @@ LAB_0061e295: case 0x70: switchD_0061ddf2_caseD_70: FollowParent(this); - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } break; case 0x57: @@ -13096,9 +13098,9 @@ LAB_0061e7b5: FamiliarAI::spider_mod(this); break; case 0x5f: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&DAT_00b1d3b0); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&DAT_00b1d3b0); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); iVar8 = Isaac::Random(3); if (iVar8 == 0) { (GHIDRA_CAST((GHIDRA_CAST(local_a8))))->Color::Color(); @@ -13213,9 +13215,9 @@ LAB_0061f886: this = self; } this->_friction = this->_friction * 0.5; - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); this->_visible = 0; (GHIDRA_CAST((GHIDRA_CAST(local_EAX_25497))))->Vector::operator_assign(&g_vectorZero); goto LAB_0061e4de; @@ -13422,13 +13424,13 @@ LAB_00620f26: if (1.0 <= local_128.y) { sprite = &this->_sprite; if (local_120 == GHIDRA_CAST(0x3)) { - (GHIDRA_CAST((sprite)))->ANM2::Play(*GHIDRA_CAST(local_130.y),0); + ANM2::Play(sprite,*GHIDRA_CAST(local_130.y),0); } else if (local_120 == GHIDRA_CAST(0x1)) { - (GHIDRA_CAST((sprite)))->ANM2::Play(*GHIDRA_CAST((GHIDRA_CAST(local_130.y) + 4)),0); + ANM2::Play(sprite,*GHIDRA_CAST((GHIDRA_CAST(local_130.y) + 4)),0); } else { - (GHIDRA_CAST((sprite)))->ANM2::Play(*GHIDRA_CAST((GHIDRA_CAST(local_130.y) + 8)),0); + ANM2::Play(sprite,*GHIDRA_CAST((GHIDRA_CAST(local_130.y) + 8)),0); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::set_flip_x(local_120 == GHIDRA_CAST(0x0)); } } @@ -13436,13 +13438,13 @@ LAB_00620f26: local_130.y = *GHIDRA_CAST(local_130.y); bVar1 = (GHIDRA_CAST((this->_player)))->Entity::IsFlying(); if (bVar1 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST(local_130.y),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST(local_130.y),0); } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(local_130.y),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(local_130.y),0); } } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(&s_empty); + bVar1 = ANM2::IsPlaying(&this->_sprite,&s_empty); if (bVar1 != 0) { fVar13 = (GHIDRA_CAST((&this->_velocity)))->Vector::Length(); local_118 = GHIDRA_CAST((fVar13 * 0.5)); @@ -13483,29 +13485,29 @@ LAB_00620f26: goto LAB_00624200; case 0x6b: if (this->_subtype == 0) { - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Phase2"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Phase2"),0); } MoveDiagonally(this,1.3); iVar8 = (GHIDRA_CAST((this->_player)))->Entity_Player::GetFireDirection(); if (iVar8 != -1) { this->_subtype = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("RevertToPhase1"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("RevertToPhase1"),0); this->_fireCooldown = 0x1e; } } else if (this->_subtype == 1) { sprite = &this->_sprite; local_128.y = (float)sprite; - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(sprite,&s_empty); if (bVar1 != 0) { - (GHIDRA_CAST((sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(sprite,s_Idle,0); } iVar8 = (GHIDRA_CAST((this->_player)))->Entity_Player::GetFireDirection(); if (iVar8 == -1) { this->_subtype = 0; - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("Phase2Start"),0); + ANM2::Play(sprite,GHIDRA_CAST("Phase2Start"),0); } game = g_game; this->_friction = this->_friction * 0.85; @@ -13524,7 +13526,7 @@ LAB_00620f26: FireProjectile(this,scratchVec,bVar1); iVar8 = iVar8 + 1; } while (iVar8 < 8); - (GHIDRA_CAST((GHIDRA_CAST(local_128.y))))->ANM2::Play(GHIDRA_CAST("RevertToPhase1"),0); + ANM2::Play(GHIDRA_CAST(local_128.y),GHIDRA_CAST("RevertToPhase1"),0); } } break; @@ -13630,9 +13632,9 @@ LAB_00620f26: if (bVar1 != 0) { (GHIDRA_CAST((&this->_targetPosition)))->Vector::operator_assign(&this->_pos); } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Fly,0); + ANM2::Play(&this->_sprite,s_Fly,0); } bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::IsFrame(0x1e,this->_index); if (bVar1 != 0) { @@ -13670,7 +13672,7 @@ LAB_00620f26: fVar13 = local_130.y; } while (sourceRef < gridIndexCounts); if (GHIDRA_CAST(local_130.y) != GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Attack"),1); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Attack"),1); scratchVec = (GHIDRA_CAST((GHIDRA_CAST(fVar13))))->Entity::Position(&local_158); fVar16 = (this->_pos).x; (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::set_flip_x(scratchVec->x <= fVar16 && fVar16 != scratchVec->x); @@ -14214,15 +14216,15 @@ LAB_006223ba: break; case 0x80: animState = GHIDRA_CAST(Config)::GetPillEffects(); - bVar1 = (GHIDRA_CAST((animState)))->AnimationState::IsLoopingAnimation(); + bVar1 = AnimationState::IsLoopingAnimation(animState); if (bVar1 == 0) { (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::MultiplyFriction(); - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { sprintf_s(idleAnimName,0x20,GHIDRA_CAST("Idle%d")); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(idleAnimName,0); + ANM2::Play(&this->_sprite,idleAnimName,0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar8 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + iVar8 = AnimationState::GetAnimationLength(animState); iVar8 = Isaac::Random(iVar8); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(iVar8); } @@ -14289,7 +14291,7 @@ LAB_0061e4de: } SoundEffects::PlayWithFartOverride(0x25,1.0,2,0,1.0); } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar1 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar1 != 0) { FUN_0044bf90(); } @@ -14329,12 +14331,12 @@ LAB_0061e4de: iVar8 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::FrameCount(); if (iVar8 == 0) { LAB_00623343: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("FloatDown"),0); } else { - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::IsPlaying(GHIDRA_CAST("FloatDown")); - if ((bVar1 == 0) && (bVar1 = (GHIDRA_CAST((sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar1 == 0)) { - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::IsPlaying(s_Spawn); + bVar1 = ANM2::IsPlaying(sprite,GHIDRA_CAST("FloatDown")); + if ((bVar1 == 0) && (bVar1 = ANM2::IsFinishedImpl(sprite,&s_empty), bVar1 == 0)) { + bVar1 = ANM2::IsPlaying(sprite,s_Spawn); if ((bVar1 != 0) && (bVar1 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::IsEventTriggered("Shoot"), bVar1 != 0) ) { SoundEffects::PlayWithFartOverride(0xb2,1.0,2,0,1.0); @@ -14405,7 +14407,7 @@ LAB_00623343: } } else { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + ANM2::Play(sprite,GHIDRA_CAST("FloatDown"),0); iVar8 = apply_forgotten_lullaby(this,4); bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::IsFrame(iVar8,0); if (bVar1 != 0) { @@ -14458,7 +14460,7 @@ LAB_00623343: } iVar8 = Isaac::Random(iVar8); if (iVar8 != 0) goto LAB_0061f2a8; - (GHIDRA_CAST((GHIDRA_CAST(local_148.y))))->ANM2::Play(s_Spawn,1); + ANM2::Play(GHIDRA_CAST(local_148.y),s_Spawn,1); gridIndexCounts = local_78; goto LAB_006241ee; } @@ -14505,13 +14507,13 @@ LAB_00623343: (GHIDRA_CAST((&this->_velocity)))->Vector::operator_assign(scratchVec); bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::HasEntityFlags(0x20000000000); if (bVar1 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); local_160.y = (float)(this->_chargeLevel + -1); local_128.y = 0.0; piVar11 = GHIDRA_CAST(std)::max(); } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b602e8,0); + ANM2::Play(&this->_sprite,&DAT_00b602e8,0); local_148.y = (float)(this->_chargeLevel + 1); local_150.y = 7.00649e-45; piVar11 = GHIDRA_CAST(std)::min(); @@ -14581,7 +14583,7 @@ LAB_00623343: break; case 0xea: animState = GHIDRA_CAST(Config)::GetPillEffects(); - bVar1 = (GHIDRA_CAST((animState)))->AnimationState::IsLoopingAnimation(); + bVar1 = AnimationState::IsLoopingAnimation(animState); if (bVar1 != 0) { fVar13 = assert_lerp_range(this->_updateTime,0.0,15.0,1.0,0.8,1); this->_friction = fVar13 * this->_friction; @@ -14903,7 +14905,7 @@ LAB_0062442e: } } (GHIDRA_CAST((GHIDRA_CAST(self))))->Entity::Update(); - (GHIDRA_CAST((&self->_chargeBarSprite)))->ANM2::Update(); + ANM2::Update(&self->_chargeBarSprite); if (self->_dead != 0) { self->Remove(); } @@ -15276,7 +15278,7 @@ LAB_00624ff9: local_d4 = (this->_sprite)._scale.x; iconPosX.y = (fVar7 * local_d0 * 0.125 + 0.0) / local_d4; local_d4 = ((-5.0 - fVar6 * fVar6 * 7.0) + fVar7 * local_e0 * 0.125) / local_d4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerId); + layer = ANM2::GetLayer(&this->_sprite,layerId); layerId = layerId + 1; (layer->_pos).x = iconPosX.y; (layer->_pos).y = local_d4; @@ -15317,7 +15319,7 @@ LAB_0062578c: iconPosX.y = ((fVar7 * local_d0) / 9.0 + 0.0) / local_d4; local_d4 = (iconScaleX.y * fVar6 * fVar6 + (float)local_d8 + (fVar7 * local_ec) / 9.0) / local_d4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerId); + layer = ANM2::GetLayer(&this->_sprite,layerId); layerId = layerId + 1; (layer->_pos).x = iconPosX.y; (layer->_pos).y = local_d4; @@ -15503,7 +15505,7 @@ LAB_0062578c: case 0xed: (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Render(offset); if (((this->_visible != 0) && - (pvVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0), + (pvVar4 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0), pvVar4 != (void *)0x0)) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x2c)) != '\0')) { uStack_12c = 1; if (((uint8_t)g_graphicsManager_flags & 4) == 0) { @@ -15515,7 +15517,7 @@ LAB_0062578c: iconRenderParams = 0; uStack_134 = 1; uStack_130 = 1; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); tmpColor._tint[0] = 1.0; tmpColor._tint[1] = 1.0; iconScaleX.x = (layer->_size).x * *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x18)); @@ -15929,9 +15931,9 @@ LAB_0062acdf: spawnRng._shift3 = 0xd; uVar4 = (GHIDRA_CAST((&spawnRng)))->RNG::Next(); (GHIDRA_CAST((g_game)))->Game::Spawn(5,pickupVariant,&local_c,&g_vectorZero,GHIDRA_CAST(this),pickupSubType,uVar4); - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Spawn,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,s_Spawn,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } manager = g_manager; @@ -16001,9 +16003,9 @@ void Entity_Familiar::level_start() animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_0062b3e6: - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar3 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -16279,14 +16281,14 @@ switchD_0062bba7_caseD_53: this->_roomClearCount = 0; } this->_visible = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); break; case 0x81: this->_state = 0; (this->_targetPosition).x = g_vectorZero.x; (this->_targetPosition).y = g_vectorZero.y; this->_visible = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("FloatDown"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("FloatDown"),0); break; case 0xce: if (this->_subtype == 0x20f) { @@ -16339,7 +16341,7 @@ switchD_0062bba7_caseD_53: bVar2 = (GHIDRA_CAST((this->_player)))->Entity_Player::HasCollectible(0xf7,0); if (bVar2 != 0) { this->_coins = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::PlayOverlay(GHIDRA_CAST("Mantle"),0); + ANM2::PlayOverlay(&this->_sprite,GHIDRA_CAST("Mantle"),0); } break; case 0xe0: @@ -16351,7 +16353,7 @@ switchD_0062bba7_caseD_53: (this->_pos).y = fVar7; (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Fly,0); + ANM2::Play(&this->_sprite,s_Fly,0); this->_state = 3; break; case 0xec: @@ -16696,9 +16698,9 @@ LAB_0062cbb5: if ((uVar6 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0062cbe8; } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Spawn,1); + bVar2 = ANM2::SetAnimation(&this->_sprite,s_Spawn,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0062cbe8: @@ -17113,7 +17115,7 @@ LAB_0062dbfb: entityConfig = (GHIDRA_CAST((&manager->_entityConfig)))->EntityConfig::GetEntity(this->_type,this->_variant,iVar6) ; this->_config = entityConfig; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&entityConfig->anm2Path,1); + ANM2::Load(&this->_sprite,&entityConfig->anm2Path,1); anim = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { anim = *GHIDRA_CAST(anim->_buf); @@ -17145,9 +17147,9 @@ LAB_0062dd07: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0062dd2f; } - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -17608,7 +17610,7 @@ void Entity_Familiar::ai_lil_gurdy() } else { if (chargeFrames == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("ChargeStart"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("ChargeStart"),0); chargeFrames = this->_fireCooldown; } this->_lastDirection = target; @@ -17617,7 +17619,7 @@ void Entity_Familiar::ai_lil_gurdy() ((this->_sprite)._animState._isPlaying != 0)) goto LAB_0062f0b9; anim = "Charging"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(anim),0); } LAB_0062f0b9: if (this->_state == 0) { @@ -17806,7 +17808,7 @@ LAB_0062f36f: if (local_38.x < 1.0) { this->_state = 0; this->_fireCooldown = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("DashStop"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("DashStop"),0); } fVar5 = 10.0 / local_38.x; if (fVar5 <= 2.0) { @@ -18332,7 +18334,7 @@ void Entity_Familiar::delirium_morph() if ((this->_sprite)._layerCount != 0) { local_54 = &this->_sprite; do { - layer = (GHIDRA_CAST((local_54)))->ANM2::GetLayer(local_50); + layer = ANM2::GetLayer(local_54,local_50); if (layer->_layerData == (void *)0x0) { sheetPath._capacity = 0xf; sheetPath._size = 0; @@ -18534,7 +18536,7 @@ LAB_006321d1: local_50 = resolvedPath + 1; } while (local_50 < GHIDRA_CAST((local_64->_sprite)._layerCount)); if (local_45 != '\0') { - (GHIDRA_CAST((&local_64->_sprite)))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(&local_64->_sprite,unk); } } uVar5 = Random(); @@ -18648,7 +18650,7 @@ void Entity_Familiar::init_lil_harbinger_sprite() layerId = layerId + 1; } while (layerId < GHIDRA_UINT((this->_sprite)._layerCount)); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)uVar3); + ANM2::LoadGraphics(&this->_sprite,(uint8_t)uVar3); pbVar1 = (this->_sprite)._animState._animData; if (pbVar1 != GHIDRA_CAST(0x0)) { pbVar5 = pbVar1; @@ -18676,9 +18678,9 @@ LAB_00632455: if ((uVar3 == 0) && ((pbVar1[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00632488; } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("FloatDown"),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("FloatDown"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00632488: @@ -18722,7 +18724,7 @@ LAB_0063263a: if ((this->_chargeBarSprite)._animState._animData != (void *)0x0) { anim = "Disappear"; LAB_00632650: - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(&this->_chargeBarSprite,GHIDRA_CAST(anim),0); goto LAB_00632655; } } @@ -18787,7 +18789,7 @@ LAB_006326d0: goto LAB_00632655; } LAB_0063270c: - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Play(GHIDRA_CAST("StartCharged"),0); + ANM2::Play(&this->_chargeBarSprite,GHIDRA_CAST("StartCharged"),0); if ((this->_chargeBarSprite)._animState._animData != (void *)0x0) { LAB_00632723: if ((this->_chargeBarSprite)._animState._isPlaying != 0) goto LAB_00632655; @@ -18795,9 +18797,9 @@ LAB_00632723: anim = "Charged"; goto LAB_00632650; } - bVar1 = (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Charging"),1); + bVar1 = ANM2::SetAnimation(&this->_chargeBarSprite,GHIDRA_CAST("Charging"),1); if (((bVar1 != 0) && ((this->_chargeBarSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_chargeBarSprite)._animState)))->AnimationState::SetFrameFloat((float)iVar2), + (AnimationState::SetFrameFloat(&(this->_chargeBarSprite)._animState,(float)iVar2), (this->_chargeBarSprite)._animState._animData != (void *)0x0)) { (this->_chargeBarSprite)._animState._isPlaying = 0; } @@ -18825,7 +18827,7 @@ LAB_00632689: *GHIDRA_CAST((rootSpawner + 0x1618))), bVar1 != 0)) { local_10.x = renderPos->x + 12.0; local_10.y = renderPos->y - 35.0; - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Render(&local_10,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_chargeBarSprite,&local_10,&g_vectorZero,&g_vectorZero); } return; } @@ -18904,9 +18906,9 @@ void Entity_Familiar::ai_lil_monstro() animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_006329dd: - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Attack"),1); + bVar3 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Attack"),1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -19005,9 +19007,9 @@ LAB_00632b4d: if ((uVar6 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00632b80; } - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Fly,1); + bVar3 = ANM2::SetAnimation(&this->_sprite,s_Fly,1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -19017,7 +19019,7 @@ LAB_00632b4d: } LAB_00632b80: if (((this->_sprite)._animState._animData != (void *)0x0) && - (bVar3 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Shoot")), + (bVar3 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("Shoot")), bVar3 != 0)) { local_90.x = (this->_targetPosition).x; iVar4 = this->_target; @@ -20060,7 +20062,7 @@ LAB_00634ca6: pvVar4 = extraout_ECX; } while (uVar6 < GHIDRA_UINT((this->_sprite)._layerCount)); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)pvVar4); + ANM2::LoadGraphics(&this->_sprite,(uint8_t)pvVar4); this->_subtype = 1; } rng._seed = this->_initSeed ^ g_game->_dungeonPlacementSeed; @@ -20080,9 +20082,9 @@ LAB_00634ca6: if (uVar6 == 0xffffffff) { if ((((-1 < this->_headFrameDelay) && (iVar3 = this->_headFrameDelay + -1, this->_headFrameDelay = iVar3, iVar3 < 0)) && - (bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1cddc,1), bVar2 != 0)) && + (bVar2 = ANM2::SetAnimation(&this->_sprite,&DAT_00b1cddc,1), bVar2 != 0)) && (((this->_sprite)._animState._animData != (void *)0x0 && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)))) { (this->_sprite)._animState._isPlaying = 0; } @@ -20240,18 +20242,18 @@ LAB_00634ca6: this->_headFrameDelay = 0x12; } else if (this->_headFrameDelay < 9) { - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation((&PTR_DAT_00b6297c)[uVar6],1); + bVar2 = ANM2::SetAnimation(&this->_sprite,(&PTR_DAT_00b6297c)[uVar6],1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } this->_headFrameDelay = 8; goto LAB_0063535f; } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation((&PTR_DAT_00b6297c)[local_40],1); + bVar2 = ANM2::SetAnimation(&this->_sprite,(&PTR_DAT_00b6297c)[local_40],1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(2.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,2.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -20513,9 +20515,9 @@ LAB_00637be3: local_5c = GHIDRA_CAST((GHIDRA_CAST((g_game)))->Game)::SpawnEx(3,0x2b,&this->_pos,&g_vectorZero,this->_player, this->_subtype + 1,uVar4,0); } - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PreSpawn"),1); + bVar3 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("PreSpawn"),1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } linkedEntitySlot = &this->_linkedEntity; @@ -20583,9 +20585,9 @@ LAB_006380e5: if ((uVar4 == 0) && ((pbVar8[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0063811c; } - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("FloatDown"),1); + bVar3 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("FloatDown"),1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -21640,9 +21642,9 @@ LAB_0063b407: if ((compareResult == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0063b43a; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(animName,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,animName,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0063b43a: @@ -22046,7 +22048,7 @@ void Entity_Familiar::ai_minisaac() } sprite = &this->_sprite; if (bVar16) { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST(dirAnims[iVar7]),0); + ANM2::Play(sprite,GHIDRA_CAST(dirAnims[iVar7]),0); if (fVar17 <= 0.5) { fVar17 = 0.5; } @@ -22058,10 +22060,10 @@ void Entity_Familiar::ai_minisaac() } else { if (fVar17 <= 0.01) { - (GHIDRA_CAST((sprite)))->ANM2::SetFrame(GHIDRA_CAST("WalkDown"),0); + ANM2::SetFrame(sprite,GHIDRA_CAST("WalkDown"),0); } else { - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST(dirAnims[iVar7 + 4]),0); + ANM2::Play(sprite,GHIDRA_CAST(dirAnims[iVar7 + 4]),0); if (fVar17 <= 0.5) { fVar17 = 0.5; } @@ -22077,9 +22079,9 @@ void Entity_Familiar::ai_minisaac() if (this->_shootDirection != -1) { iVar7 = this->_shootDirection; } - bVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST(dirAnims[iVar7 + 8]),1); + bVar5 = ANM2::SetOverlayAnimation(&this->_sprite,GHIDRA_CAST(dirAnims[iVar7 + 8]),1); if ((bVar5 != 0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_d0)); + AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)GHIDRA_INT(local_d0)); } FamiliarHelper::fly_head_pathfind_move(this); minisaac_find_target(); @@ -22092,7 +22094,7 @@ void Entity_Familiar::ai_minisaac() } else if (iVar7 == 1) { if ((this->_sprite)._animState._animData != (void *)0x0) { - bVar5 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(s_Land); + bVar5 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,s_Land); manager = g_manager; if (bVar5 != 0) { (this->_velocity).x = g_vectorZero.x; @@ -22102,7 +22104,7 @@ void Entity_Familiar::ai_minisaac() (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(landSound,0.8,2,0,1.0,0.0); } if (((this->_sprite)._animState._animData != (void *)0x0) && - (bVar5 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::WasEventTriggered(s_Land), + (bVar5 = AnimationState::WasEventTriggered(&(this->_sprite)._animState,s_Land), bVar5 != 0)) { this->_friction = this->_friction * 0.5; } @@ -22113,13 +22115,13 @@ void Entity_Familiar::ai_minisaac() if (!bVar16) { anim = "Transform"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(anim),0); this->_state = 2; } } else if (iVar7 == 2) { if ((this->_sprite)._animState._animData != (void *)0x0) { - bVar5 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(s_Land); + bVar5 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,s_Land); manager = g_manager; if (bVar5 != 0) { (this->_velocity).x = g_vectorZero.x; @@ -22144,7 +22146,7 @@ void Entity_Familiar::ai_minisaac() uVar8 = Random(); position = &this->_pos; pEVar9 = (GHIDRA_CAST((g_game)))->Game::SpawnEx(1000,2,position,&g_vectorZero,GHIDRA_CAST(0x0),1,uVar8,0); - (GHIDRA_CAST((&pEVar9->_sprite)))->ANM2::Play(GHIDRA_CAST("Poof_Small"),0); + ANM2::Play(&pEVar9->_sprite,GHIDRA_CAST("Poof_Small"),0); uVar8 = Random(); for (local_d0 = (uVar8 & 1) + 1; local_d0 != 0; local_d0 = local_d0 + -1) { uVar8 = Random(); @@ -22745,7 +22747,7 @@ void Entity_Familiar::ai_blood_oath() case 0: animState->_state = 3; case 3: - (GHIDRA_CAST((&animState->_sprite)))->ANM2::Play(GHIDRA_CAST((&local_2c.x)[iVar4]),0); + ANM2::Play(&animState->_sprite,GHIDRA_CAST((&local_2c.x)[iVar4]),0); fVar6 = (&local_1c.x)[iVar4]; if ((fVar6 != 0.0) && (uVar3 = Random(), uVar3 % GHIDRA_UINT(fVar6) == 0)) { uVar3 = Random(); @@ -22758,7 +22760,7 @@ void Entity_Familiar::ai_blood_oath() default: goto LAB_0064001c; case 4: - (GHIDRA_CAST((&animState->_sprite)))->ANM2::Play(&DAT_00b643e8,0); + ANM2::Play(&animState->_sprite,&DAT_00b643e8,0); animState = &(animState->_sprite)._animState; fVar6 = animState->_friction; playerY = *GHIDRA_CAST((GHIDRA_CAST(animState->_player) + 0x340)); @@ -22768,13 +22770,13 @@ void Entity_Familiar::ai_blood_oath() if ((animState->_sprite)._animState._animData == (void *)0x0) { return; } - bVar1 = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0); + bVar1 = AnimationState::IsEventTriggered(animState,&DAT_00b1d3b0); manager = g_manager; if (bVar1 == 0) { if ((animState->_sprite)._animState._animData == (void *)0x0) { return; } - bVar1 = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(&DAT_00b602f0); + bVar1 = AnimationState::IsEventTriggered(animState,&DAT_00b602f0); if (bVar1 == 0) { return; } @@ -23017,7 +23019,7 @@ void Entity_Familiar::ai_boiled_baby() goto LAB_00641000; } if (((iVar3 != 2) || - ((GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b1de1c,0), + (ANM2::Play(&this->_sprite,&DAT_00b1de1c,0), (this->_sprite)._animState._animData == (void *)0x0)) || ((this->_sprite)._animState._isPlaying != 0)) goto LAB_00640d9b; animNameChar = (this->_sprite)._animState._animData; @@ -23073,7 +23075,7 @@ LAB_00641020: LAB_00641025: if (((uVar5 == 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && ((this->_sprite)._animState._isPlaying != 0)) { - bVar1 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Shoot")); + bVar1 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("Shoot")); frictionPtr = GHIDRA_CAST(local_24.x); if (bVar1 != 0) { iVar3 = this->_target; @@ -23094,7 +23096,7 @@ LAB_00641025: } else { LAB_00641131: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } if ((this->_keys < 1) && (this->_target == 0)) { PickEnemyTarget(this,1000.0,1,9,&g_vectorZero,15.0); @@ -23117,7 +23119,7 @@ LAB_0064122e: } iVar3 = this->_keys; if ((iVar3 < 1) && (bVar6)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Shoot"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Shoot"),0); this->_hearts = this->_hearts + -1; this->_keys = 0xf; this->_coins = 0x14; @@ -23200,7 +23202,7 @@ LAB_00640d9b: (((this->_targetPosition).x != g_vectorZero.x || ((this->_targetPosition).y != g_vectorZero.y) ))) && ((iVar3 == 1 || (((iVar3 == 2 && ((this->_sprite)._animState._animData != (void *)0x0)) && - (bVar1 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::WasEventTriggered(s_Jump), + (bVar1 = AnimationState::WasEventTriggered(&(this->_sprite)._animState,s_Jump), bVar1 != 0)))))) { jumpProgress = this->_orbitSpeed + 0.02; this->_orbitSpeed = jumpProgress; @@ -23385,9 +23387,9 @@ void Entity_Familiar::zhl_misfit_006414c0() pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_00641d0e: - rainbowBlue = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1); + rainbowBlue = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (rainbowBlue != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -23511,9 +23513,9 @@ LAB_006420cf: pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_00641c4e: - rainbowBlue = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1d6fc,1); + rainbowBlue = ANM2::SetAnimation(&this->_sprite,&DAT_00b1d6fc,1); if (rainbowBlue != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -23555,9 +23557,9 @@ LAB_00641c35: pbVar5 = (this->_sprite)._animState._animData; if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_00641976: - rainbowBlue = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1d6fc,1); + rainbowBlue = ANM2::SetAnimation(&this->_sprite,&DAT_00b1d6fc,1); if (rainbowBlue != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -23803,9 +23805,9 @@ void Entity_Familiar::ai_bird_cage() fVar5 = *GHIDRA_CAST((target + 0x340)); (this->_targetPosition).x = *GHIDRA_CAST((target + 0x33c)); (this->_targetPosition).y = fVar5; - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b1e0e4,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b1e0e4,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_state = 1; @@ -23839,9 +23841,9 @@ LAB_006425d5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00642608; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Flying"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Flying"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00642608: @@ -23854,9 +23856,9 @@ LAB_00642608: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_00642686: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("JumpDown"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("JumpDown"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -23907,12 +23909,12 @@ LAB_00642675: LAB_00642bca: if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Flying"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Flying"),0); this->_state = 3; } } else { - bVar1 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0); + bVar1 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b1d3b0); manager = g_manager; if (bVar1 == 0) goto LAB_00642bca; local_18 = 7.28675e-44; @@ -24112,7 +24114,7 @@ LAB_00643235: return; } local_14[0] = targetRef; - bVar1 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Shoot")); + bVar1 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("Shoot")); if (bVar1 == 0) { return; } @@ -24264,9 +24266,9 @@ LAB_006436f5: ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00643729; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Fly,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,s_Fly,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00643729: @@ -24304,9 +24306,9 @@ LAB_0064376d: } } } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Attack"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Attack"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -24385,7 +24387,7 @@ LAB_0064423d: fVar5 = 1.4013e-42; fVar6 = 9.203692e-39; effect = (GHIDRA_CAST((g_game)))->Game::SpawnEx(1000,0xf,pos,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar3,0); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x18c)))))->ANM2::ANM2(&local_5c->_sprite); + ANM2::ANM2(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x18c)),&local_5c->_sprite); other._championColor._colorize[0] = in_stack_ffffff58; other._filename._buf[0] = in_stack_fffffe74[0]; other._filename._buf[1] = in_stack_fffffe74[1]; @@ -24484,8 +24486,8 @@ LAB_0064423d: (*GHIDRA_CAST((GHIDRA_CAST(&(other)) + 0x10a))) = SUB42(uVar11,2); other._shadowLayerIndex = uVar3; other._bitflags = iVar12; - (GHIDRA_CAST((&effect->_sprite)))->ANM2::operator_assign(other); - (GHIDRA_CAST((&effect->_sprite)))->ANM2::Play(GHIDRA_CAST("TeleportUp"),0); + ANM2::operator_assign(&effect->_sprite,other); + ANM2::Play(&effect->_sprite,GHIDRA_CAST("TeleportUp"),0); effect->Update(); this = local_5c; player = local_5c->_player; @@ -24580,7 +24582,7 @@ LAB_0064423d: CStack_38._tint[3] = 1.0; (GHIDRA_CAST((GHIDRA_CAST(&pEStack_64->_sprite))))->Sprite::SetColor(&CStack_38); uVar3 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&effect->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&effect->_sprite,GHIDRA_CAST(0x0)); iVar12 = 1; if ((uVar3 & 4) == 0) { iVar12 = 6; @@ -24714,9 +24716,9 @@ LAB_00643fdb: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_0064418e: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("TeleportDown"),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("TeleportDown"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -24752,9 +24754,9 @@ LAB_00644175: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_00644210: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("TeleportDown"),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("TeleportDown"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -24788,7 +24790,7 @@ LAB_006441f7: ((this->_sprite)._animState._isPlaying == 0)) goto LAB_0064423d; break; case 3: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } (GHIDRA_CAST((this->_player)))->Entity_Player::GetShootingJoystick(&local_58); fVar6 = (this->_velocity).x; @@ -25022,7 +25024,7 @@ void Entity_Familiar::ai_shadow_intruder_damocles(uint8_t isInterpolating) if (iVar9 == 0) { this->_state = 1; this->_fireCooldown = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); return; } if (iVar9 == 1) { @@ -25042,9 +25044,9 @@ void Entity_Familiar::ai_shadow_intruder_damocles(uint8_t isInterpolating) else { pbVar14 = &DAT_00b1d43c; } - bVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(pbVar14,1); + bVar5 = ANM2::SetAnimation(&this->_sprite,pbVar14,1); if (bVar5 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -25110,14 +25112,14 @@ LAB_00644f55: if ((uVar7 == 0) && ((pbVar14[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00644f81; } - bVar5 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(&DAT_00b1e7b0,1); + bVar5 = ANM2::SetAnimation(sprite,&DAT_00b1e7b0,1); if (bVar5 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00644f81: if ((this->_sprite)._animState._animData != (void *)0x0) { - bVar5 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0); + bVar5 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b1d3b0); manager = g_manager; if (bVar5 != 0) { soundId = 0x4d; @@ -25546,7 +25548,7 @@ LAB_006472d2: local_3c = 0; local_38 = 0xf; gfxRoot[0] = (void *)(GHIDRA_UINT(gfxRoot[0]) & 0xffffff00); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar2); + ANM2::LoadGraphics(&this->_sprite,bVar2); } bVar2 = 1; } @@ -25799,7 +25801,7 @@ void Entity_Familiar::load_config_graphics() local_24 = uVar2; wispEntry = ItemConfig::get_wisp_entry(collectibleId,iVar4); if (this->_config == (void *)0x0) goto LAB_0064aa74; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); defaultAnim = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { defaultAnim = *GHIDRA_CAST(defaultAnim->_buf); @@ -25807,9 +25809,9 @@ void Entity_Familiar::load_config_graphics() pbVar3 = (this->_sprite)._animState._animData; if (pbVar3 == GHIDRA_CAST(0x0)) { LAB_0064a90e: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(defaultAnim),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(defaultAnim),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -25895,7 +25897,7 @@ LAB_0064aa4a: basePathSize = 0; basePathCapacity = 0xf; basePath[0] = (void *)(GHIDRA_UINT(basePath[0]) & 0xffffff00); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(&this->_sprite,bVar1); } LAB_0064aa74: anm2_apply_gfx_overrides @@ -25932,7 +25934,7 @@ void Entity_Familiar::render_abyss_locust_sprite(ANM2 *param_2, float *param_3) fVar2 = fVar1; } if (fVar2 == 0.0) { - (GHIDRA_CAST((param_2)))->ANM2::Reset(); + ANM2::Reset(param_2); return; } } @@ -25952,8 +25954,8 @@ void Entity_Familiar::render_abyss_locust_sprite(ANM2 *param_2, float *param_3) (param_2->_scale).y = fVar2 * (this->_sizeMulti).y; (param_2->_scale).x = fVar2 * fVar1; if (param_2->_loaded != 0) { - (GHIDRA_CAST((¶m_2->_animState)))->AnimationState::Update(); - (GHIDRA_CAST((¶m_2->_overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(¶m_2->_animState); + AnimationState::Update(¶m_2->_overlayAnimState); } fVar1 = g_displayPixelRatio * g_screenPointScale; dVar3 = floor((double)(((((this->_pos).x + 0.0) - 60.0) * 0.65 + (g_screenWidth - 338.0) * 0.5 @@ -25963,7 +25965,7 @@ void Entity_Familiar::render_abyss_locust_sprite(ANM2 *param_2, float *param_3) (g_screenHeight - 182.0) * 0.5) * fVar1 + 0.5)); screenPos[0].x = screenPos[0].x + *param_3; screenPos[0].y = (float)dVar3 / fVar1 + param_3[1]; - (GHIDRA_CAST((param_2)))->ANM2::Render(screenPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(param_2,screenPos,&g_vectorZero,&g_vectorZero); } } return; @@ -26130,7 +26132,7 @@ void Entity_Familiar::UpdateDirtColor(uint8_t Immediate) } sprite = &this->_sprite; do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(sprite,layerIndex); cleanupFlags = cleanupFlags | 4; currentLayer = layer; if (layer->_layerData == (void *)0x0) { @@ -26531,13 +26533,13 @@ LAB_0064eea4: else { local_50 = (72.0 - (float)this->_shootDirection * fVar12) + (float)pEVar14; } - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (layer->_cropOffset).x = local_50; (layer->_cropOffset).y = (float)local_3c; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); (layer->_cropOffset).x = local_50; (layer->_cropOffset).y = (float)local_3c; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(local_40),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(local_40),0); pEVar6 = local_4c; if (((isMoving != 0) && (local_74[0] = local_4c, (this->_sprite)._animState._animData != (void *)0x0)) && @@ -26996,7 +26998,7 @@ switchD_0064e588_default: (local_38->_sprite)._scale.x = g_vectorOne.x * 2.0; (local_38->_sprite)._scale.y = fVar10; uVar4 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&local_38->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&local_38->_sprite,GHIDRA_CAST(0x0)); pEVar6 = local_38; oldParent = 1; if ((uVar4 & 4) == 0) { diff --git a/generated-src/entity_knife.cpp b/generated-src/entity_knife.cpp index 685a343..1530b0a 100644 --- a/generated-src/entity_knife.cpp +++ b/generated-src/entity_knife.cpp @@ -137,7 +137,7 @@ void Entity_Knife::Init(int type, int variant, int subType, uint32_t initSeed) local_34 = GHIDRA_CAST(0x0); } else { - (GHIDRA_CAST((local_34)))->ANM2::constructor(); + ANM2::constructor(local_34); local_34 = extraout_EAX; } local_8 = 0xffffffff; @@ -160,7 +160,7 @@ void Entity_Knife::Init(int type, int variant, int subType, uint32_t initSeed) anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/DeadEyeTearEffect.anm2",0x1b); local_8 = 1; - (GHIDRA_CAST((DAT_00c72214)))->ANM2::Load(&anm2Path,1); + ANM2::Load(DAT_00c72214,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar7 = anm2Path._capacity + 1; @@ -179,7 +179,7 @@ void Entity_Knife::Init(int type, int variant, int subType, uint32_t initSeed) anm2Path._size = 0; anm2Path._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) & 0xffffff00; - layer = (GHIDRA_CAST((DAT_00c72214)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(DAT_00c72214,GHIDRA_CAST(0x0)); pAVar6 = DAT_00c72214; iVar5 = 1; if ((uVar7 & 4) == 0) { @@ -218,16 +218,16 @@ LAB_00960df5: if ((uVar7 == 0) && ((animData[0x34] == 0 || ((pAVar6->_animState)._isPlaying != 0)))) goto LAB_00960e29; } - bVar4 = (GHIDRA_CAST((pAVar6)))->ANM2::SetAnimation(s_Idle,1); + bVar4 = ANM2::SetAnimation(pAVar6,s_Idle,1); if (bVar4 != 0) { - (GHIDRA_CAST((&pAVar6->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&pAVar6->_animState); (pAVar6->_animState)._isPlaying = 1; } } LAB_00960e29: (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Init(type,variant,subType,initSeed); if (this->_config != (void *)0x0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); local_34 = GHIDRA_CAST(&(this->_sprite)._animDefaultName); if (0xf < (this->_sprite)._animDefaultName._capacity) { local_34 = *GHIDRA_CAST((GHIDRA_CAST(local_34))->_buf); @@ -261,9 +261,9 @@ LAB_00960ea5: if ((uVar7 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00960eda; } - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_34),1); + bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -336,21 +336,21 @@ LAB_00960eda: case 8: case 9: isLayerVisible = this->_subtype != 4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_visible = isLayerVisible; isLayerVisible = this->_subtype == 4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); break; case 0xb: code_r0x00961110: isLayerVisible = this->_subtype != 4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_visible = isLayerVisible; isLayerVisible = this->_subtype == 4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_visible = isLayerVisible; isLayerVisible = this->_subtype == 4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); } layer->_visible = isLayerVisible; LAB_00961187: @@ -743,7 +743,7 @@ LAB_009652a6: ownerPlayer = GetPlayer(this); if ((ownerPlayer == GHIDRA_CAST(0x0)) || (bVar8 = (GHIDRA_CAST((ownerPlayer)))->Entity_Player::HasCollectible(0x3b,0), bVar8 == 0)) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (layer->_color)._offset[0] = 0.0; (layer->_color)._offset[1] = 0.0; (layer->_color)._offset[2] = 0.0; @@ -756,7 +756,7 @@ LAB_009652a6: local_e8.y = fVar19 * 0.1 + 0.1; fVar19 = sin(local_108.y + 0.0); local_108.y = fVar19 * 0.25 + 0.25; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (layer->_color)._offset[0] = local_120.y; (layer->_color)._offset[1] = local_e8.y; (layer->_color)._offset[2] = local_108.y; @@ -793,7 +793,8 @@ LAB_00961e18: if (((isSwingWeapon != '\0') || (isSword != '\0')) && (g_game->_frameCount - this->_spawnFrame < 2)) { local_120.y = (float)&this->_sprite; - local_108.y = (float)(GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 0x15)))))->ANM2::GetAnimation(GHIDRA_CAST(local_40)); + local_108.y = (float)ANM2::GetAnimation(GHIDRA_CAST((room->_gridEntities + 0x15)), + GHIDRA_CAST(local_40)); ehState = 0; if (0xf < GHIDRA_UINT(((GHIDRA_CAST(local_108.y))->_topLeftPos).x)) { local_108.y = *GHIDRA_CAST(local_108.y); @@ -801,9 +802,9 @@ LAB_00961e18: pbVar12 = ((void **)(GHIDRA_INT(local_120.y) + 0x24))[4]; if (pbVar12 == GHIDRA_CAST(0x0)) { LAB_00961f64: - bVar8 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_108.y),1); + bVar8 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_108.y),1); if (bVar8 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; room = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_170))) + 0xc))); } @@ -985,7 +986,7 @@ LAB_00961f49: else { pbVar12 = (&PTR_s_ChargedLeft_00b7cb28)[fadeFrames]; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(pbVar12,bVar8); + ANM2::Play(&this->_sprite,pbVar12,bVar8); } if (local_d9 == 0) { UpdateSwingHits(this); @@ -1105,7 +1106,7 @@ LAB_00961f49: (this->_posOffset).y = this->_basePosOffsetY; if (isSwingWeapon != '\0') { if (isSword == '\0') { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } LAB_009626f7: if (GHIDRA_CAST(this->_parent) == player) { @@ -1121,8 +1122,8 @@ LAB_00962723: if (this->_isFlying == 0) { if (isSword == '\0') { (this->_sprite)._rotation = 0.0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b602e8,0); - fadeFrames = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetAnimationLength(); + ANM2::Play(&this->_sprite,&DAT_00b602e8,0); + fadeFrames = AnimationState::GetAnimationLength(&(this->_sprite)._animState); fadeFrames = Isaac::Random(fadeFrames); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(fadeFrames); room = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_170))) + 0xc))); @@ -1491,7 +1492,7 @@ LAB_0096357e: fVar19 = normalize_angle_degrees(local_ec - 90.0); (this->_sprite)._rotation = fVar19; local_d9 = 0.0 < fVar19; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_flipX = local_d9; } else { @@ -1509,7 +1510,7 @@ LAB_00963b53: fVar19 = atan2f(local_12c - (local_15c->_pos).y,local_120.y - (local_15c->_pos).x); fVar19 = normalize_angle_degrees(fVar19 * 57.295776 - 90.0); (this->_sprite)._rotation = fVar19; - local_e8.y = (float)(GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayerFrame(0); + local_e8.y = (float)ANM2::GetLayerFrame(&this->_sprite,0); if (GHIDRA_CAST(local_e8.y) != GHIDRA_CAST(0x0)) { local_f4[0] = GHIDRA_CAST(((this->_sprite)._rotation * 0.017453292)); local_120.y = cos((float)local_f4[0]); @@ -1584,7 +1585,7 @@ LAB_00963c34: (this->_sprite)._rotation = fVar19; } local_d9 = 0.0 < fVar19; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_flipX = local_d9; pBVar11 = BitSet128::operator_and(GHIDRA_CAST(&local_158),tearFlagsTmp,&g_tearFlagContinuum) ; @@ -1819,9 +1820,9 @@ LAB_00963c34: fVar19 = sin((this->_sprite)._rotation * 0.017453292); (this->_sprite)._rotation = local_140.y * 57.295776 * fVar19 + (this->_sprite)._rotation; if ((float)local_f4[0] < 0.0) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); local_d9 = layer->_flipX == 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_flipX = local_d9; } } @@ -2040,7 +2041,7 @@ LAB_00964bdf: fVar19 = normalize_angle_degrees(fVar19 * 57.295776 - 90.0); (this->_sprite)._rotation = fVar19; local_d9 = 0.0 < fVar19; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_flipX = local_d9; this->_pathSegment = GHIDRA_INT(local_118.y); this->_pathProgress = local_108.y; @@ -2110,7 +2111,7 @@ LAB_00964bdf: fVar19 = normalize_angle_degrees(fVar19 * 57.295776 + 90.0); (this->_sprite)._rotation = fVar19; local_d9 = 0.0 < fVar19; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_flipX = local_d9; this->_friction = this->_friction * 0.7; } @@ -2130,7 +2131,7 @@ LAB_00964bdf: tearFlagsTmp = BitSet128::operator_and(&local_38,&this->_tearFlags,&g_tearFlagWait); bVar8 = (GHIDRA_CAST((tearFlagsTmp)))->BitSet128::IsNonZero(); if (bVar8 != 0) { - fadeFrames = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + fadeFrames = ANM2::GetFrame(&this->_sprite); if (fadeFrames < 5) { (this->_velocity).x = g_vectorZero.x; (this->_velocity).y = g_vectorZero.y; @@ -2168,7 +2169,7 @@ LAB_00964bdf: (this->_velocity).y = fVar19; this->_displayRotation = this->_rotation; (this->_sprite)._rotation = this->_rotation - 90.0; - pfVar14 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayerFrame(0); + pfVar14 = ANM2::GetLayerFrame(&this->_sprite,0); if (pfVar14 != GHIDRA_CAST(0x0)) { local_140.y = (this->_sprite)._rotation * 0.017453292; local_f4[0] = GHIDRA_CAST(cos(local_140.y)); @@ -2558,12 +2559,12 @@ void Entity_Knife::Render(Vector *offset) fVar2 = offset->y; (this->_renderPosition).x = local_d0 + offset->x; (this->_renderPosition).y = local_e4 / (float)local_e0 + fVar2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,&this->_renderPosition,&g_vectorZero,&g_vectorZero); iVar1 = GetBaseVariant(this); if ((iVar1 == 1) && (this->_subtype != 4)) { player = GetPlayer(this); if ((player != GHIDRA_CAST(0x0)) && (iVar1 = player->_deadEyeCharges, 0 < iVar1)) { - local_e0 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayerFrame(0); + local_e0 = ANM2::GetLayerFrame(&this->_sprite,0); deadEyeSprite = DAT_00c72214; deadEyeColor._tint[0] = 1.0; deadEyeColor._tint[1] = 1.0; @@ -2606,7 +2607,7 @@ void Entity_Knife::Render(Vector *offset) (deadEyeSprite->_scale).y = (this->_sprite)._scale.y; position = &this->_renderPosition; } - (GHIDRA_CAST((GHIDRA_CAST(deadEyeSprite))))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(deadEyeSprite),position,&g_vectorZero,&g_vectorZero); } } FUN_00861a50(this,offset); @@ -2754,9 +2755,9 @@ switchD_00966f89_caseD_2: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_009670ee: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b602e8,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b602e8,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -2796,7 +2797,7 @@ LAB_009670d5: curAnimData = (this->_sprite)._animState._animData; } if (curAnimData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(startFrame)); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(startFrame)); } switchD_00967064_caseD_5: UpdateHomingPath(this); @@ -3264,7 +3265,7 @@ void Entity_Knife::Interpolate() parentX = atan2f(y,x); parentX = normalize_angle_degrees(parentX * 57.295776 + 90.0); (this->_sprite)._rotation = parentX; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_flipX = 0.0 < parentX; return; } @@ -3337,7 +3338,7 @@ LAB_00968090: cmpResult = 0; LAB_00968095: if (cmpResult == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } } case 5: @@ -3405,9 +3406,9 @@ LAB_00968177: animName = "AttackLeft"; } } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0096829f; @@ -3433,9 +3434,9 @@ LAB_00968177: if (isAnimSet == 0) { animName = "Swing"; } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if (0xf < curAnimCapacity) { @@ -3532,13 +3533,13 @@ switchD_0096846e_caseD_b: anim = "SpinLeft"; } } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } if ((0 < startFrame) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)startFrame); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)startFrame); } local_c = 1.0 / ((this->_sprite)._scale.x * 0.5 + 0.5); rngResult = Random(); @@ -3801,7 +3802,7 @@ LAB_00968980: maskedFlags = BitSet128::operator_and(&hitTearFlags,&this->_tearFlags,&g_tearFlagWait); if (((GHIDRA_INT(maskedFlags->_l) == 0 && *GHIDRA_CAST((GHIDRA_INT(&maskedFlags->_l) + 4)) == 0) && (GHIDRA_INT(maskedFlags->_h) == 0 && *GHIDRA_CAST((GHIDRA_INT(&maskedFlags->_h) + 4)) == 0)) || - ((iVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(), iVar5 < 5 || + ((iVar5 = ANM2::GetFrame(&this->_sprite), iVar5 < 5 || (0x1d < g_game->_frameCount - this->_spawnFrame)))) { LAB_00968b38: if ((this->_sprite)._animState._animData == (void *)0x0) goto LAB_00968b3e; @@ -3814,7 +3815,7 @@ LAB_00968b38: } else { if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(4.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,4.0); goto LAB_00968b38; } LAB_00968b3e: @@ -4660,7 +4661,7 @@ LAB_0096a6af: ownerPlayer = local_d0; local_d4 = GHIDRA_INT(swingIndex) / 2 & 0xffffff01; if (baseVariant == 1) { - curAnimName = (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(local_68)) + curAnimName = ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState),GHIDRA_CAST(local_68)) ; local_e8 = 1.4013e-45; puVar1 = &curAnimName->_size; @@ -4762,7 +4763,7 @@ LAB_0096a80d: if ((char)local_d4 == '\0') { anim = "Swing2"; } - (GHIDRA_CAST((&pEVar10->_sprite)))->ANM2::Play(GHIDRA_CAST(anim),1); + ANM2::Play(&pEVar10->_sprite,GHIDRA_CAST(anim),1); SetAttackAnimation(pEVar10); } else if (baseVariant == 10) { @@ -4774,7 +4775,7 @@ LAB_0096a80d: SetAttackAnimation(pEVar10); } else { - iVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + iVar5 = ANM2::GetFrame(&this->_sprite); SpinAttack(pEVar10,1,iVar5); } (pEVar10->_sprite)._rotation = (this->_sprite)._rotation; @@ -4870,7 +4871,7 @@ LAB_0096ae0c: ((this->_sprite)._animState._isPlaying == 0)) || ((baseVariant == 10 && (((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x466))) != '\0' && - (bVar3 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST("SwingEnd")), + (bVar3 = AnimationState::WasEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("SwingEnd")), bVar3 != 0)))))) { this->_isSwinging = 0; } diff --git a/generated-src/entity_laser.cpp b/generated-src/entity_laser.cpp index 8ac52f7..ace24da 100644 --- a/generated-src/entity_laser.cpp +++ b/generated-src/entity_laser.cpp @@ -1393,7 +1393,7 @@ void Entity_Laser::Init(int type, int variant, int subType, uint32_t initSeed) (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Init(type,variant,subType,initSeed); if (this->_config != (void *)0x0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); defaultAnimName = &(this->_sprite)._animDefaultName; if (0xf < (this->_sprite)._animDefaultName._capacity) { defaultAnimName = *GHIDRA_CAST(defaultAnimName->_buf); @@ -1425,9 +1425,9 @@ LAB_0096f615: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0096f648; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(defaultAnimName),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(defaultAnimName),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -2574,8 +2574,8 @@ LAB_00973251: local_b8 = fVar13; } if (local_bc + 2.0 < local_b8) { - pvVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pvVar4 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); scratchColor._tint[0] = (this->_sprite)._color._tint[0]; scratchColor._tint[1] = (this->_sprite)._color._tint[1]; scratchColor._tint[2] = (this->_sprite)._color._tint[2]; @@ -3174,9 +3174,9 @@ LAB_009729ca: laserRef = laser; local_9c = pVVar7; if ((float)local_a8 + 2.0 < (float)local_b0) { - pvVar4 = (GHIDRA_CAST((&(laser->_sprite)._animState)))->AnimationState::GetLayerFrame(0); + pvVar4 = AnimationState::GetLayerFrame(&(laser->_sprite)._animState,0); local_a4 = GHIDRA_CAST((GHIDRA_INT(pvVar4) + 0x30)); - layer = (GHIDRA_CAST((&laser->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&laser->_sprite,GHIDRA_CAST(0x0)); local_ac = &(laser->_sprite)._color; scratchColor2._tint[0] = local_ac->_tint[0]; scratchColor2._tint[1] = (laser->_sprite)._color._tint[1]; @@ -3928,7 +3928,7 @@ LAB_00976cb2: local_10c.y = g_vectorZero.x; local_104.y = g_vectorZero.y; if ((1 < GHIDRA_UINT((this->_sprite)._layerCount)) && - (pvVar9 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0), + (pvVar9 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0), pvVar9 != (void *)0x0)) { fVar23 = *GHIDRA_CAST((GHIDRA_CAST(pvVar9) + 0x14)) + *GHIDRA_CAST((GHIDRA_CAST(pvVar9) + 0xc)); fVar20 = (this->_sprite)._scale.y; @@ -4919,7 +4919,8 @@ LAB_00975f41: this = GHIDRA_CAST(local_150.y); local_d4[0] = pEVar12; if (*GHIDRA_CAST((GHIDRA_CAST(local_150.y) + 0x3c0)) != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x3b8)))))->ANM2::ANM2(GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(local_150.y) + 0x3c0)) + 0x48))); + ANM2::ANM2(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x3b8)), + GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(local_150.y) + 0x3c0)) + 0x48))); other._championColor._colorize[0] = in_stack_fffffd2c; other._filename._buf[0] = in_stack_fffffc48[0]; other._filename._buf[1] = in_stack_fffffc48[1]; @@ -5018,9 +5019,9 @@ LAB_00975f41: (*GHIDRA_CAST((GHIDRA_CAST(&(other)) + 0x10a))) = SUB42(uVar29,2); other._shadowLayerIndex = iVar8; other._bitflags = GHIDRA_INT(spawnedLaser); - (GHIDRA_CAST((&pEVar12->_sprite)))->ANM2::operator_assign(other); + ANM2::operator_assign(&pEVar12->_sprite,other); iVar8 = Isaac::Random(3); - (GHIDRA_CAST((&pEVar12->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Droplets"),iVar8); + ANM2::SetFrame(&pEVar12->_sprite,GHIDRA_CAST("Droplets"),iVar8); } (pEVar12->_posOffset).x = (GHIDRA_CAST((GHIDRA_INT(this) + 0x34c)))->x; (pEVar12->_posOffset).y = (GHIDRA_CAST((GHIDRA_INT(this) + 0x34c)))->y; @@ -5060,14 +5061,14 @@ LAB_00975f41: if ((this->_dead != 0) || (this->_shrink != 0)) { iVar8 = this->_variant; if (iVar8 == 2) { - bVar6 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsLoopingAnimation(); + bVar6 = AnimationState::IsLoopingAnimation(&(this->_sprite)._animState); if (bVar6 != 0) { - (GHIDRA_CAST((this_03)))->ANM2::GetAnimation(GHIDRA_CAST(&fStack_44)); + ANM2::GetAnimation(this_03,GHIDRA_CAST(&fStack_44)); local_14 = 1; SimpleString::operator=(GHIDRA_CAST(&fStack_44),"Fade"); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::Play(GHIDRA_CAST(&fStack_44),0); if (this->_child != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this->_child + 0x48)))))->ANM2::Play(&DAT_00b1c00c,0); + ANM2::Play(GHIDRA_CAST((this->_child + 0x48)),&DAT_00b1c00c,0); } if ((this->_initSeed & 0x1000U) != 0) { (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(1); @@ -5075,7 +5076,7 @@ LAB_00975f41: local_14 = 0xffffffff; (GHIDRA_CAST((GHIDRA_CAST(&fStack_44))))->msvc::string::_Tidy_deallocate(); } - bVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar6 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar6 == 0) goto LAB_00976e53; } else if ((iVar8 != 10) && (iVar8 != 4)) { @@ -5757,7 +5758,7 @@ LAB_00978138: fStack_18 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_40))) + 0x14))),"gfx/007.001_Static Laser.anm2",0x1e); local_8 = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_40 + 0x14)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_40 + 0x14)),1); local_8 = 0xffffffff; if (0xf < GHIDRA_UINT(fStack_18)) { uVar11 = GHIDRA_INT(fStack_18) + 1; @@ -5779,9 +5780,9 @@ LAB_00978138: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_009784a4: - bVar8 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_44),1); + bVar8 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_44),1); if (bVar8 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -5827,7 +5828,7 @@ LAB_00978485: fStack_18 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_40))) + 0x14))),"gfx/007.006_CageVisLaser.anm2",0x1e); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_40 + 0x14)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_40 + 0x14)),1); local_8 = 0xffffffff; if (0xf < GHIDRA_UINT(fStack_18)) { uVar11 = GHIDRA_INT(fStack_18) + 1; @@ -5873,9 +5874,9 @@ LAB_00978319: if ((uVar11 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_009784c5; } - bVar8 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_44),1); + bVar8 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_44),1); if (bVar8 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; update_first_frame(this); this->_isFirstUpdate = 0; @@ -6054,8 +6055,8 @@ void Entity_Laser::Render(Vector *offset) } } this_00 = &this->_sprite; - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - pfVar3 = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_1b0); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); + pfVar3 = LayerState::GetTexture(layer,&local_1b0); local_120 = *pfVar3; local_8 = 0.0; if (((GHIDRA_CAST(local_1b0.y) != GHIDRA_CAST(0x0)) && @@ -6079,9 +6080,9 @@ void Entity_Laser::Render(Vector *offset) ((iVar6 != 5 && (iVar6 != 8)))))) { iVar6 = this->_variant; if (((iVar6 == 2) || (iVar6 == 10)) || (iVar6 == 7)) { - layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0); + layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); if (layerFrame == GHIDRA_CAST(0x0)) goto LAB_0097ab0f; - (GHIDRA_CAST((GHIDRA_CAST(frameCopy))))->AnimationState::copy_assign(layerFrame); + AnimationState::copy_assign(GHIDRA_CAST(frameCopy),layerFrame); local_208._offset[2] = (float)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_208._offset[2])) + 0x1))),1); local_208._colorize[3] = this->_laserLength * 0.65 + (*GHIDRA_CAST((GHIDRA_CAST(&((float)frameCopy)) + 0x4))); local_208._colorize[2] = (*GHIDRA_CAST((GHIDRA_CAST(&((float)frameCopy)) + 0x0))); @@ -6141,7 +6142,7 @@ void Entity_Laser::Render(Vector *offset) local_148.y = local_150 + offset->y + local_188.y * local_134 + renderPos->y; fStack_324 = 1.393063e-38; set_quad_corner_colors(quad,&local_148,&quadCorner2,&quadCorner1,&quadCorner3,&quadColor); - (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); fStack_324 = 1.3930686e-38; FUN_00a13560(); FUN_00682260(); @@ -6159,23 +6160,23 @@ void Entity_Laser::Render(Vector *offset) vertexColor._blue = shaderColor._tint[2]; vertexColor._alpha = shaderColor._tint[3] * alphaMultiplier; vertexColor._unk = 0; - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); layer->_wrapSMode = 0; - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); layer->_wrapTMode = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(uVar14)) + 0x0))) = 1.3930976e-38; (*GHIDRA_CAST((GHIDRA_CAST(&(uVar14)) + 0x4))) = 0.0; - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(auStack_30a + -10); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,auStack_30a + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar14,SUB84(uVar14,4)); - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_148); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); + texture = LayerState::GetTexture(layer,&local_148); local_8 = 8.40779e-45; goto LAB_0097b218; } (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Color::operator_assign(&(this->_sprite)._color); (this->_sprite)._color._tint[3] = tmpColor._tint[3] * alphaMultiplier; - (GHIDRA_CAST((this_00)))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero); + ANM2::Render(this_00,&this->_renderPosition,&g_vectorZero,&g_vectorZero); (this->_sprite)._color._tint[3] = tmpColor._tint[3]; iVar6 = extraout_ECX_00; } @@ -6191,8 +6192,8 @@ void Entity_Laser::Render(Vector *offset) (this->_sprite)._rotation = (float)local_124; iVar6 = extraout_ECX; if (15.0 < this->_laserLength) { - local_124 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0); - layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(1); + local_124 = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); + layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,1); if ((local_124 == GHIDRA_CAST(0x0)) || (layerFrame == GHIDRA_CAST(0x0))) { LAB_0097ab0f: warnMessage = "[warn] Laser::Render current frame is NULL\n"; @@ -6201,9 +6202,9 @@ LAB_0097ab0f: ExceptionList = local_10; return; } - (GHIDRA_CAST((GHIDRA_CAST(firstLayerFrame))))->AnimationState::copy_assign(local_124); - (GHIDRA_CAST((GHIDRA_CAST(frameCopy))))->AnimationState::copy_assign(layerFrame); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + AnimationState::copy_assign(GHIDRA_CAST(firstLayerFrame),local_124); + AnimationState::copy_assign(GHIDRA_CAST(frameCopy),layerFrame); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); local_208._offset[2] = (float)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_208._offset[2])) + 0x1))),1); local_120 = frameScaleX * (layer->_size).x * (this->_sprite)._scale.x; frameScaleY = frameScaleY * (layer->_size).y * (this->_sprite)._scale.y; @@ -6272,7 +6273,7 @@ LAB_0097ab0f: quadCorner2.y = local_140 + (float)local_124 / local_130; fStack_324 = 1.3928041e-38; set_quad_corner_colors(quad,&quadCorner2,&quadCorner1,&quadCorner3,&local_148,&quadColor); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); g_graphicsManager_blendMode[0] = layer->_blendMode[0]; g_graphicsManager_blendMode[1] = layer->_blendMode[1]; g_graphicsManager_blendMode[2] = layer->_blendMode[2]; @@ -6293,17 +6294,17 @@ LAB_0097ab0f: vertexColor._blue = shaderColor._tint[2]; vertexColor._alpha = shaderColor._tint[3] * alphaMultiplier; vertexColor._unk = 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_wrapSMode = 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_wrapTMode = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(uVar13)) + 0x0))) = 1.3928444e-38; (*GHIDRA_CAST((GHIDRA_CAST(&(uVar13)) + 0x4))) = 0.0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(auStack_30a + -10); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,auStack_30a + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar13,SUB84(uVar13,4)); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_148); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + texture = LayerState::GetTexture(layer,&local_148); local_8 = 7.00649e-45; LAB_0097b218: (**(code **)(*GHIDRA_CAST(*texture) + 0x14))(); @@ -6316,7 +6317,7 @@ LAB_0097b218: goto LAB_0097b24c; } local_164 = GHIDRA_CAST(GHIDRA_UINT((1 < uVar5))); - layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(GHIDRA_INT(local_164)); + layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,GHIDRA_INT(local_164)); if (layerFrame == GHIDRA_CAST(0x0)) { warnMessage = "[warn] Laser::Render current laser frame is NULL\n"; KAGE_LogMessage(1,GHIDRA_CAST("[warn] Laser::Render current laser frame is NULL\n")); @@ -6324,20 +6325,20 @@ LAB_0097b218: ExceptionList = local_10; return; } - (GHIDRA_CAST((GHIDRA_CAST(frameCopy))))->AnimationState::copy_assign(layerFrame); - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(local_164); + AnimationState::copy_assign(GHIDRA_CAST(frameCopy),layerFrame); + layer = ANM2::GetLayer(this_00,local_164); verticesBegin = GHIDRA_CAST(0x0); verticesEnd = GHIDRA_CAST(0x0); verticesCapacity = GHIDRA_CAST(0x0); local_130 = frameScaleX * (layer->_size).x * (this->_sprite)._scale.x; local_8 = 1.4013e-45; msvc::vector<8byte>::reserve(); - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); layer->_wrapSMode = 0; - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); layer->_wrapTMode = 0; - layer = (GHIDRA_CAST((this_00)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_1b0); + layer = ANM2::GetLayer(this_00,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,&local_1b0); local_8 = (float)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),2); scaledOffsetX = (this->_posOffset).x * 0.65; local_12c = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_homingLaser))) + 0x1c)))); @@ -6475,7 +6476,7 @@ LAB_00979179: local_190 = 0.0; } verticesEnd = local_138; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(local_164); + layer = ANM2::GetLayer(&this->_sprite,local_164); g_graphicsManager_blendMode[0] = layer->_blendMode[0]; g_graphicsManager_blendMode[1] = layer->_blendMode[1]; g_graphicsManager_blendMode[2] = layer->_blendMode[2]; @@ -6668,7 +6669,7 @@ LAB_00979179: pfVar3 = verticesBegin; } if ((1 < GHIDRA_UINT((this->_sprite)._layerCount)) && (this->_subtype == 0)) { - layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0); + layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); if (layerFrame == GHIDRA_CAST(0x0)) { warnMessage = "[warn] Laser::Render current frame is NULL\n"; KAGE_LogMessage(1,GHIDRA_CAST("[warn] Laser::Render current frame is NULL\n")); @@ -6691,8 +6692,8 @@ LAB_00979c35: if (GHIDRA_UINT((GHIDRA_INT(pfVar3) + (-4 - GHIDRA_INT(pfVar4)))) < 0x20) goto LAB_00979c35; goto LAB_0097a2b3; } - (GHIDRA_CAST((GHIDRA_CAST(frameCopy))))->AnimationState::copy_assign(layerFrame); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + AnimationState::copy_assign(GHIDRA_CAST(frameCopy),layerFrame); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); pfVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_homingLaser))) + 0x1c)))); frameScaleX = frameScaleX * (layer->_size).x * (this->_sprite)._scale.x; frameScaleY = frameScaleY * (layer->_size).y * (this->_sprite)._scale.y; @@ -6768,11 +6769,11 @@ LAB_00979c35: local_244 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(uVar12)) + 0x0))) = 1.3925265e-38; (*GHIDRA_CAST((GHIDRA_CAST(&(uVar12)) + 0x4))) = 0.0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(auStack_30a + -10); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,auStack_30a + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar12,SUB84(uVar12,4)); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_148); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + texture = LayerState::GetTexture(layer,&local_148); local_8 = (float)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),3); (**(code **)(*GHIDRA_CAST(*texture) + 0x14))(); TexturePtr::release(); @@ -7047,7 +7048,7 @@ LAB_0097c1bc: widthScale = (float)puVar9 * 0.2 + local_60; } else { - (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST((local_50 + 0x10))); + ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState),GHIDRA_CAST((local_50 + 0x10))); local_14 = 0; (GHIDRA_CAST((local_50 + 0x10)))->msvc::string::append(&DAT_00b61844,4); local_54 = local_50 + 0x10; @@ -7057,9 +7058,9 @@ LAB_0097c1bc: pbVar7 = (this->_sprite)._animState._animData; if (pbVar7 == GHIDRA_CAST(0x0)) { LAB_0097c25f: - bVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(local_54,1); + bVar5 = ANM2::SetAnimation(&this->_sprite,local_54,1); if (bVar5 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; this = savedLaser; } @@ -7608,8 +7609,8 @@ uint8_t Entity_Laser::RenderShadowLayer(Vector *offset) return 1; } laserSprite = &this->_sprite; - layer = (GHIDRA_CAST((laserSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - sheetTexture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_dc); + layer = ANM2::GetLayer(laserSprite,GHIDRA_CAST(0x0)); + sheetTexture = LayerState::GetTexture(layer,&local_dc); spawnerRoot = *sheetTexture; local_8 = 0.0; if (((local_d8 != GHIDRA_CAST(0x0)) && @@ -7624,26 +7625,26 @@ uint8_t Entity_Laser::RenderShadowLayer(Vector *offset) return 1; } layerName = GHIDRA_CAST(GHIDRA_UINT((1 < GHIDRA_UINT((this->_sprite)._layerCount)))); - layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(GHIDRA_INT(layerName)); + layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,GHIDRA_INT(layerName)); if (layerFrame == GHIDRA_CAST(0x0)) { KAGE_LogMessage(1,GHIDRA_CAST("[warn] Laser::Render current laser frame is NULL\n")); ExceptionList = local_10; return 1; } - (GHIDRA_CAST((GHIDRA_CAST(frameCopy))))->AnimationState::copy_assign(layerFrame); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerName); + AnimationState::copy_assign(GHIDRA_CAST(frameCopy),layerFrame); + layer = ANM2::GetLayer(&this->_sprite,layerName); points = GHIDRA_CAST(0x0); pointsEnd = GHIDRA_CAST(0x0); pointsCapacity = GHIDRA_CAST(0x0); local_c4 = local_94 * (this->_sprite)._scale.x * (layer->_size).x; local_8 = 1.4013e-45; msvc::vector<8byte>::reserve(); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_wrapSMode = 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); layer->_wrapTMode = 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(&shadowTexture); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,&shadowTexture); local_8 = (float)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),2); local_b4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_homingLaser))) + 0x1c)))); offsetX = (this->_posOffset).x * 0.65; @@ -7938,7 +7939,7 @@ LAB_0097e2ff: case 0xe: case 0xf: if (this->_subtype != 0) goto LAB_0097e2ff; - layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0); + layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0); if (layerFrame == GHIDRA_CAST(0x0)) { KAGE_LogMessage(1,GHIDRA_CAST("[warn] Laser::Render current frame is NULL\n")); TexturePtr::release(); @@ -7958,8 +7959,8 @@ LAB_0097e2ff: } goto code_r0x0097e364; } - (GHIDRA_CAST((GHIDRA_CAST(frameCopy))))->AnimationState::copy_assign(layerFrame); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + AnimationState::copy_assign(GHIDRA_CAST(frameCopy),layerFrame); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); pfVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_homingLaser))) + 0x1c)))); uvTopLeftY = (*GHIDRA_CAST((GHIDRA_CAST(&((float)frameCopy)) + 0x4))) + 0.01; uvBottomLeftY = (*GHIDRA_CAST((GHIDRA_CAST(&((float)frameCopy)) + 0xc))) + (*GHIDRA_CAST((GHIDRA_CAST(&((float)frameCopy)) + 0x4))); @@ -8016,11 +8017,11 @@ LAB_0097e2ff: shaderColor._offset[1] = 0.0; shaderColor._offset[2] = 0.0; uVar11 = 0x97e28d; - layer = (GHIDRA_CAST((laserSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(auStack_21e + -10); + layer = ANM2::GetLayer(laserSprite,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,auStack_21e + -10); apply_sprite_shader_params(&shaderColor,1,(void *)uVar11,(void *)((uint64_t)uVar11 >> 0x20)); - layer = (GHIDRA_CAST((laserSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - layerTexture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_11c); + layer = ANM2::GetLayer(laserSprite,GHIDRA_CAST(0x0)); + layerTexture = LayerState::GetTexture(layer,&local_11c); local_8 = (float)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),3); vertexColor._unk = 0; vertexColor._red = shaderColor._tint[0]; @@ -8740,7 +8741,7 @@ void Entity_Laser::spawn_impact_effect(int unused) anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/1000.050_brimstoneimpact_static.anm2",0x29); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((piVar7 + 0x12)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((piVar7 + 0x12)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar6 = anm2Path._capacity + 1; @@ -8765,10 +8766,10 @@ void Entity_Laser::spawn_impact_effect(int unused) curAnimName = GHIDRA_CAST(local_44[0xd]); if (curAnimName == GHIDRA_CAST(0x0)) { LAB_0097fb40: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST((piVar7 + 0x12)))))->ANM2::SetAnimation(defaultAnim,1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST((piVar7 + 0x12)),defaultAnim,1); piVar2 = local_44; if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((local_44 + 0xc)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((local_44 + 0xc))); *GHIDRA_CAST((piVar2 + 0x11)) = 1; piVar7 = impactEffect; } @@ -8915,9 +8916,9 @@ LAB_0097fd46: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0097fd78; } - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(animName,1); + bVar3 = ANM2::SetAnimation(&this->_sprite,animName,1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0097fd78: @@ -8946,7 +8947,7 @@ LAB_0097fd78: if (animData == (void *)0x0) { return; } - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(frame)); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(frame)); return; } diff --git a/generated-src/entity_npc.cpp b/generated-src/entity_npc.cpp index 3d3beef..128fdbe 100644 --- a/generated-src/entity_npc.cpp +++ b/generated-src/entity_npc.cpp @@ -147,9 +147,9 @@ void Entity_NPC::Hornfel_UpdateAI() flagsHigh = *GHIDRA_CAST((GHIDRA_INT(&this->_flags) + 4)); *GHIDRA_CAST(&this->_flags) = GHIDRA_UINT(this->_flags) & 0xfffffffb; *GHIDRA_CAST((GHIDRA_INT(&this->_flags) + 4)) = flagsHigh; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x3)); layer->_visible = 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004); layer->_visible = 0; this->_stateFrame = 0; *GHIDRA_CAST((GHIDRA_INT(&this->_projectileCooldown) + 2)) = 0; @@ -185,7 +185,7 @@ void Entity_NPC::Hornfel_UpdateAI() local_28 = GHIDRA_CAST(&DAT_0000002f); builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_50))) + 0x14))),"gfx/965.001_hornfel minecart.anm2",0x22); local_14 = 1; - (GHIDRA_CAST((&newMinecart->_sprite)))->ANM2::Load(GHIDRA_CAST((local_50 + 0x14)),1); + ANM2::Load(&newMinecart->_sprite,GHIDRA_CAST((local_50 + 0x14)),1); local_14 = 0xffffffff; if (GHIDRA_CAST(&DAT_0000000f) < local_28) { size = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((local_28)) + 0x1)))); @@ -221,7 +221,7 @@ void Entity_NPC::Hornfel_UpdateAI() if ((0 < timer) && (timer = timer + -1, *GHIDRA_CAST(&this->_projectileDelay) = timer, timer < 1)) { if (this->_state == 0xe) { if (*GHIDRA_CAST((GHIDRA_INT(&this->_projectileDelay) + 3)) != '\0') { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Taunt"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Taunt"),0); *GHIDRA_CAST((GHIDRA_INT(&this->_projectileCooldown) + 3)) = 0x96; puVar3 = puStack_20; } @@ -238,7 +238,7 @@ void Entity_NPC::Hornfel_UpdateAI() this->_friction = this->_friction * 0.8; if (ABS(absDirY) < ABS(fVar13)) { puStack_20 = local_50 + 0x4c; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("RunHori"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("RunHori"),0); bVar12 = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; } else { @@ -250,9 +250,9 @@ void Entity_NPC::Hornfel_UpdateAI() if (animName == GHIDRA_CAST(0x0)) { LAB_004ba3e5: puStack_20 = local_50 + 0x4c; - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_fc),1); + bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_fc),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; activeRoom = room; } @@ -572,7 +572,7 @@ LAB_004b9d9e: ((*GHIDRA_CAST((GHIDRA_INT(&this->_projectileCooldown) + 3)) == '\0' && (uVar5 = Random(), puVar3 = puStack_20, uVar5 % 10 == 0)))) && (0.5 < this->_health / this->_maxHitPoints)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Taunt"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Taunt"),0); *GHIDRA_CAST((GHIDRA_INT(&this->_projectileCooldown) + 3)) = 0x96; puVar3 = puStack_20; } @@ -715,7 +715,7 @@ LAB_004b9d9e: break; case 0xb: puStack_20 = local_50 + 0x4c; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("ChargeFinish"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("ChargeFinish"),0); bVar4 = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::IsEventTriggered("Shoot"); if (bVar4 != 0) { (GHIDRA_CAST((&projectileParams)))->ProjectileParams::ProjectileParams(); @@ -746,7 +746,7 @@ LAB_004b9d9e: projectile->_fallingAccel = projectile->_fallingAccel - 0.6; projectile->_fallingSpeed = projectile->_fallingSpeed * 0.7 - 3.0; } - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::WasEventTriggered(GHIDRA_CAST("Shoot")); + bVar4 = ANM2::WasEventTriggered(&this->_sprite,GHIDRA_CAST("Shoot")); absDirY = (local_12c->_v2).x; puVar3 = puStack_20; if (bVar4 == 0) { @@ -770,7 +770,7 @@ LAB_004b9d9e: break; case 0xc: puStack_20 = local_50 + 0x4c; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Detonate"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Detonate"),0); bVar4 = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::IsEventTriggered("Sound"); if (bVar4 != 0) { PlaySound(this,0xfc,1.0,2,0,1.0); @@ -796,7 +796,7 @@ LAB_004b9d9e: } break; case 0x10: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("DecoyIdle"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("DecoyIdle"),0); if (0.0 < this->_pendingDamage) { if ((this->_pendingDamageFlags & 4) == 0) { pfVar10 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); @@ -980,7 +980,7 @@ LAB_004baae3: } NpcHelper::minecart_break(local_12c); this->_state = 0xd; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b1cdf8,0); + ANM2::Play(&this->_sprite,&DAT_00b1cdf8,0); puVar1 = &this->_entityRef; this->_entityGridCollisionClass = 5; this->_dead = 0; @@ -1388,9 +1388,9 @@ void Entity_NPC::update_move_direction_anim() } anim = (&PTR_s_Move1_00b1ee78)[this->_i1]; if (this->_state == 0x10) { - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(anim,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,anim,1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; return; @@ -1430,9 +1430,9 @@ LAB_004ce865: } } } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(anim,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,anim,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -1898,7 +1898,7 @@ void Entity_NPC::render_overlay(Vector *offset, uint8_t isShadow) if ((this->_sprite)._animState._animData == (void *)0x0) { return; } - pvVar1 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("CordPos")); + pvVar1 = AnimationState::GetNullFrame(&(this->_sprite)._animState,GHIDRA_CAST("CordPos")); if (pvVar1 == (void *)0x0) { return; } @@ -2112,7 +2112,7 @@ void Entity_NPC::render_overlay(Vector *offset, uint8_t isShadow) do { if (totalLength <= *pfVar2) { if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar3)); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(uVar3)); } break; } @@ -2414,7 +2414,7 @@ void Entity_NPC::render_v1_layer_frames() fVar5 = 1.0; } *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._layerFrames) + layerId * 4)) = 0; - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::AdvanceLayerPosition(layerId,fVar5); + AnimationState::AdvanceLayerPosition(&(this->_sprite)._animState,layerId,fVar5); LAB_005657ec: fVar5 = (this->_posOffset).y; layer2Height = fVar5; @@ -2425,10 +2425,10 @@ LAB_005657ec: (segmentIndex >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4)) + 4 + (segmentIndex & 1) * 8)); fVar1 = (this->_v1).y; - pLVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar3 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); (pLVar3->_pos).x = 0.0; (pLVar3->_pos).y = (fVar4 - fVar1) * 0.65; - layer1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer1 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); (layer1->_pos).x = (pLVar3->_pos).x; (layer1->_pos).y = (pLVar3->_pos).y; segmentIndex = (this->_vectorDeque1)._offset + 1; @@ -2443,7 +2443,7 @@ LAB_005657ec: (segmentIndex >> 1 & (this->_vectorDeque1)._mapSize - 1) * 4)) + 4 + (segmentIndex & 1) * 8)); fVar1 = (this->_v1).y; - pLVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar3 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); (pLVar3->_pos).x = 0.0; (pLVar3->_pos).y = (fVar4 - fVar1) * 0.65; segment2Index = (this->_vectorDeque1)._offset; @@ -2457,13 +2457,13 @@ LAB_005657ec: 4 + (segmentIndex & 1) * 8)); fVar1 = *segment1Y; fVar2 = *segment1Y; - pLVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar3 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); pLVar3->_flipY = fVar2 <= fVar4 && fVar4 != fVar1; segmentIndex = (this->_vectorDeque1)._offset + 2; fVar4 = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_INT((this->_vectorDeque1)._map) + ((this->_vectorDeque1)._mapSize - 1 & segmentIndex >> 1) * 4)) + (segmentIndex & 1) * 8)); - pLVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar3 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); pLVar3->_flipX = 0.0 < fVar4; segmentIndex = (this->_vectorDeque1)._offset + 2; if (*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_INT((this->_vectorDeque1)._map) + @@ -2474,7 +2474,7 @@ LAB_005657ec: else { fVar4 = -3.0; } - pLVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar3 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); (pLVar3->_pos).x = fVar4; segmentIndex = (this->_vectorDeque1)._offset + 2; layer2Height = (*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_INT((this->_vectorDeque1)._map) + @@ -2484,7 +2484,7 @@ LAB_005657ec: } } sprite = &this->_sprite; - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar3 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); if (renderMode == 5) { fVar5 = (fVar5 - 2.0) / 78.0; if (fVar5 <= 0.0) { @@ -2494,7 +2494,7 @@ LAB_005657ec: fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar3 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x1)); fVar5 = (layer1Height - 2.0) / 78.0; if (fVar5 <= 0.0) { fVar5 = 0.0; @@ -2503,7 +2503,7 @@ LAB_005657ec: fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar3 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x2)); fVar5 = (layer2Height - 2.0) / 78.0; } else { @@ -2515,7 +2515,7 @@ LAB_005657ec: fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar3 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x1)); fVar5 = (layer1Height - -2.0) / 18.0; if (fVar5 <= 0.0) { fVar5 = 0.0; @@ -2524,7 +2524,7 @@ LAB_005657ec: fVar5 = 1.0; } (pLVar3->_color)._tint[3] = 1.0 - fVar5; - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar3 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x2)); fVar5 = (layer2Height - -2.0) / 18.0; } if (fVar5 <= 0.0) { @@ -2975,9 +2975,9 @@ void Entity_NPC::Constructor() (this->_dirtColor)._offset[0] = 0.0; (this->_dirtColor)._offset[1] = 0.0; (this->_dirtColor)._offset[2] = 0.0; - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_statusEffectSprite); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),7); - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_chargeBarSprite); (this->_hitList)._begin = (void *)0x0; (this->_hitList)._end = (void *)0x0; (this->_hitList)._capacity = (void *)0x0; @@ -3285,8 +3285,8 @@ LAB_006b8f98: msvc::deque::_Tidy(); msvc::deque::_Tidy(); msvc::deque::_Tidy(); - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_statusEffectSprite); + ANM2::Reset(&this->_chargeBarSprite); hitList = &this->_hitList; if (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(familiars)) + 0x4)))) != hitList) { oldData = hitList->_begin; @@ -3551,7 +3551,7 @@ LAB_006bafec: if (*GHIDRA_CAST((local_a8 + bossColorPathSize + 0x54)) == 0) goto LAB_006bafec; psVar4 = GHIDRA_CAST((local_a8 + bossColorPathSize + 0x44)); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(psVar4,0); + ANM2::Load(&this->_sprite,psVar4,0); local_ac = GHIDRA_CAST(&(g_game->_seedEffects)._seedEffects); local_a8 = GHIDRA_CAST(0x4f); msvc::set::find_node(local_54._buf + 0xc,&local_a8); @@ -3572,7 +3572,7 @@ LAB_006bafec: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_54._buf))) + 0x0))), "gfx/promo/gfuel/102.001_g baby (true final boss).anm2",0x36); local_14 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&local_54,1); + ANM2::Load(&this->_sprite,&local_54,1); local_14 = 0xffffffff; if (0xf < local_54._capacity) { uVar6 = local_54._capacity + 1; @@ -3696,7 +3696,7 @@ LAB_006bb6be: sprite = &this->_sprite; layerSprite = GHIDRA_CAST(sprite); do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(sprite,layerIndex); local_ac = layer; if (layer->_layerData == (void *)0x0) { layerString._size = 0; @@ -3873,7 +3873,7 @@ LAB_006bb394: spriteBitflags = &(this->_sprite)._bitflags; *spriteBitflags = *spriteBitflags & 0xffffffdf; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)championColor); + ANM2::LoadGraphics(&this->_sprite,(uint8_t)championColor); if (isDirtColorNeeded != '\0') { UpdateDirtColor(this,1); } @@ -3959,9 +3959,9 @@ void Entity_NPC::LoadEntityConfig() if (0xf < (this->_sprite)._animDefaultName._capacity) { anim = *GHIDRA_CAST((this->_sprite)._animDefaultName._buf); } - hasRoomConfigFlag = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + hasRoomConfigFlag = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if (((hasRoomConfigFlag != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -4089,7 +4089,7 @@ void Entity_NPC::LoadEntityConfig() } this->ResetColor(); load_graphics(this,1); - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(&(this->_sprite)._animDefaultName,0); + ANM2::SetFrame(&this->_sprite,&(this->_sprite)._animDefaultName,0); local_8 = 0xffffffff; (GHIDRA_CAST((local_34)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((local_4c)))->msvc::string::_Tidy_deallocate(); @@ -4550,7 +4550,7 @@ LAB_006c05af: } sprite = &this->_sprite; do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(sprite,layerIndex); stringDestructFlags = stringDestructFlags | 4; currentLayer = layer; if (layer->_layerData == (void *)0x0) { @@ -5078,7 +5078,7 @@ void Entity_NPC::ResetColor() isChampionLayer = '\0'; if ((this->_sprite)._layerCount != 0) { do { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerIdx); + layer = ANM2::GetLayer(&this->_sprite,layerIdx); if ((layer->_bitflags & 0x10) != 0) { isChampionLayer = '\x01'; goto LAB_006c115c; @@ -5851,16 +5851,16 @@ LAB_006c4f12: if ((this->_statusEffectSprite)._loaded == 0) { (GHIDRA_CAST((local_4c + 0x10)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/StatusEffects.anm2")); local_14 = 0; - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::Load(GHIDRA_CAST((local_4c + 0x10)),1); + ANM2::Load(&this->_statusEffectSprite,GHIDRA_CAST((local_4c + 0x10)),1); local_14 = 0xffffffff; (GHIDRA_CAST((local_4c + 0x10)))->msvc::string::_Tidy_deallocate(); } - bVar2 = (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::IsPlaying(&s_empty); + bVar2 = ANM2::IsPlaying(&this->_statusEffectSprite,&s_empty); if ((bVar2 != 0) && ((this->_statusEffectSprite)._loaded != 0)) { - (GHIDRA_CAST((&(this->_statusEffectSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_statusEffectSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_statusEffectSprite)._animState); + AnimationState::Update(&(this->_statusEffectSprite)._overlayAnimState); } - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::Play(GHIDRA_CAST(local_290),0); + ANM2::Play(&this->_statusEffectSprite,GHIDRA_CAST(local_290),0); (this->_statusEffectSprite)._bitflags = iVar16 << 0x1f; } iVar16 = this->_pauseTimer; @@ -6046,12 +6046,12 @@ LAB_006c5358: if (this->_type != 0x3e) { this->_visible = 1; } - pvVar8 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("Appear")); + pvVar8 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST("Appear")); if (pvVar8 != (void *)0x0) { if (this->_type != 0x10a) { (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::RemoveOverlay(); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),1); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),1); } } else { @@ -6060,15 +6060,15 @@ LAB_006c56aa: local_281 = 0; } else { - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST("Appear")); + bVar2 = ANM2::IsFinishedImpl(&this->_sprite,GHIDRA_CAST("Appear")); if ((bVar2 == 0) && - (pvVar8 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("Appear")), pvVar8 != (void *)0x0) + (pvVar8 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST("Appear")), pvVar8 != (void *)0x0) ) { (GHIDRA_CAST((local_64)))->msvc::string::string_from_cstr(GHIDRA_CAST("Appear")); local_14 = 3; local_2a4 = GHIDRA_CAST(&DAT_00000004); pAVar18 = GHIDRA_CAST(Config)::GetPillEffects(); - (GHIDRA_CAST((pAVar18)))->ANM2::GetAnimation(GHIDRA_CAST((local_4c + 0x10))); + ANM2::GetAnimation(pAVar18,GHIDRA_CAST((local_4c + 0x10))); local_28c = GHIDRA_CAST(0xc); cVar3 = FUN_0040c7c0(); if (cVar3 == '\0') goto LAB_006c56aa; @@ -6154,9 +6154,9 @@ LAB_006c58e9: || ((iVar16 == 0xed && (this->_variant == 2)))))) { pAVar18 = &this->_sprite; local_2a0 = pAVar18; - pvVar8 = (GHIDRA_CAST((pAVar18)))->ANM2::GetAnimationData(GHIDRA_CAST("Flush")); + pvVar8 = ANM2::GetAnimationData(pAVar18,GHIDRA_CAST("Flush")); if (pvVar8 != (void *)0x0) { - (GHIDRA_CAST((pAVar18)))->ANM2::Play(GHIDRA_CAST("Flush"),0); + ANM2::Play(pAVar18,GHIDRA_CAST("Flush"),0); iVar16 = this->_state; this->_renderZOffset = 5000; goto LAB_006c59c4; @@ -6171,7 +6171,7 @@ LAB_006c59c4: if (iVar16 == 0x12) { LAB_006c59d3: pAVar18 = &this->_sprite; - pvVar8 = (GHIDRA_CAST((pAVar18)))->ANM2::GetAnimationData(GHIDRA_CAST("Death")); + pvVar8 = ANM2::GetAnimationData(pAVar18,GHIDRA_CAST("Death")); iVar16 = this->_type; if (pvVar8 == (void *)0x0) { if (iVar16 == 0x1c) { @@ -6179,7 +6179,7 @@ LAB_006c59d3: if (iVar16 == 0) { deathAnim = "DeathHead"; LAB_006c5b7b: - (GHIDRA_CAST((pAVar18)))->ANM2::Play(GHIDRA_CAST(deathAnim),0); + ANM2::Play(pAVar18,GHIDRA_CAST(deathAnim),0); } else { if (iVar16 == 1) { @@ -6191,7 +6191,7 @@ LAB_006c5b7b: goto LAB_006c5b7b; } } - iVar16 = (GHIDRA_CAST((pAVar18)))->ANM2::GetFrame(); + iVar16 = ANM2::GetFrame(pAVar18); if (iVar16 == 3) { PlaySound(this,0x74,1.0,2,0,1.0); } @@ -6201,17 +6201,17 @@ LAB_006c5b7b: if (this->_parent == 0) { deathAnim = "DeathHead"; } - (GHIDRA_CAST((pAVar18)))->ANM2::Play(GHIDRA_CAST(deathAnim),0); + ANM2::Play(pAVar18,GHIDRA_CAST(deathAnim),0); } else if (iVar16 == 0x3e) { if (this->_parent == 0) { - (GHIDRA_CAST((pAVar18)))->ANM2::Play(GHIDRA_CAST("DeathHead"),0); + ANM2::Play(pAVar18,GHIDRA_CAST("DeathHead"),0); } else if (this->_child == 0) { this->Remove(); } else { - (GHIDRA_CAST((pAVar18)))->ANM2::Play(GHIDRA_CAST("DeathBody01"),0); + ANM2::Play(pAVar18,GHIDRA_CAST("DeathBody01"),0); } } else if (((iVar16 != 0x4a) && (iVar16 != 0x4b)) && (iVar16 != 0x4c)) { @@ -6221,43 +6221,43 @@ LAB_006c5b7b: } else if (iVar16 == 0x19b) { if (this->_variant == 1) { - local_288 = GHIDRA_CAST((GHIDRA_CAST((pAVar18)))->ANM2)::GetLayer(&DAT_00b6767c); + local_288 = GHIDRA_CAST(ANM2)::GetLayer(pAVar18,&DAT_00b6767c); if (local_288 == GHIDRA_CAST(0x0)) { local_2a0 = pAVar18; } else { animState = GHIDRA_CAST(Config)::GetPillEffects(); iVar16 = _ptr_deref_or_minus1(); - pvVar8 = (GHIDRA_CAST((animState)))->AnimationState::GetLayerFrame(iVar16); + pvVar8 = AnimationState::GetLayerFrame(animState,iVar16); if ((pvVar8 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar8) + 0x2c)) != '\0')) { - (GHIDRA_CAST((local_2a0)))->ANM2::Play(GHIDRA_CAST("HandDeath"),0); + ANM2::Play(local_2a0,GHIDRA_CAST("HandDeath"),0); goto LAB_006c5c3e; } } - (GHIDRA_CAST((local_2a0)))->ANM2::Play(GHIDRA_CAST("SmallHoleClose"),0); + ANM2::Play(local_2a0,GHIDRA_CAST("SmallHoleClose"),0); } else if (this->_variant == 2) { FUN_0044bf90(0); } else { pAVar12 = GHIDRA_CAST(Config)::GetPillEffects(); - psVar6 = (GHIDRA_CAST((pAVar12)))->ANM2::GetAnimation(GHIDRA_CAST((local_4c + 0x10))); + psVar6 = ANM2::GetAnimation(pAVar12,GHIDRA_CAST((local_4c + 0x10))); local_14 = 4; local_281 = str_ne(psVar6,GHIDRA_CAST("BigHoleClose")); local_14 = 0xffffffff; (GHIDRA_CAST((local_4c + 0x10)))->msvc::string::_Tidy_deallocate(); if (local_281 != 0) { - (GHIDRA_CAST((pAVar18)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(pAVar18,GHIDRA_CAST("Death"),0); } } } else { if (iVar16 == 0x195) { - local_29c = GHIDRA_CAST((GHIDRA_CAST((pAVar18)))->ANM2)::GetLayer(s_Head); + local_29c = GHIDRA_CAST(ANM2)::GetLayer(pAVar18,s_Head); if (local_29c != GHIDRA_CAST(0x0)) { animState = GHIDRA_CAST(Config)::GetPillEffects(); iVar16 = _ptr_deref_or_minus1(); - pvVar8 = (GHIDRA_CAST((animState)))->AnimationState::GetLayerFrame(iVar16); + pvVar8 = AnimationState::GetLayerFrame(animState,iVar16); if ((pvVar8 == (void *)0x0) || (*GHIDRA_CAST((GHIDRA_CAST(pvVar8) + 0x2c)) == '\0')) { bVar2 = 0; } @@ -6268,7 +6268,7 @@ LAB_006c5b7b: pAVar18 = local_2a0; } } - (GHIDRA_CAST((pAVar18)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(pAVar18,GHIDRA_CAST("Death"),0); } } } @@ -6291,7 +6291,7 @@ LAB_006c5c89: if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0x48,1.0,2,0,1.0); } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar2 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if ((bVar2 != 0) && (this->_dead != 0)) { (GHIDRA_CAST((&projectileParams)))->ProjectileParams::ProjectileParams(); pPVar31 = &projectileParams; @@ -6313,7 +6313,7 @@ LAB_006c5c89: } } else if (iVar16 == 0x393) { - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar2 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if ((bVar2 != 0) && (this->_dead != 0)) { (GHIDRA_CAST((GHIDRA_CAST(local_a0))))->Color::Color(); damageSource = 0; @@ -6345,8 +6345,8 @@ LAB_006c5c89: (**(code **)(*piVar14 + 0x3c))(&this->_splatColor,0xffffffff,0xff,0,1); SoundEffects::PlayWithFartOverride(0x1e,1.0,2,0,1.0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar16 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); - iVar15 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + iVar16 = AnimationState::GetAnimationLength(animState); + iVar15 = ANM2::GetFrame(&this->_sprite); if (iVar16 + -1 <= iVar15) { SoundEffects::PlayWithFartOverride(0x105,1.0,2,0,1.0); uVar4 = Random(); @@ -6413,7 +6413,7 @@ LAB_006c5c89: (((this->_initSeed & 1) == 0 || (bVar2 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::IsType(0x38c,-1,-1), bVar2 != 0)))) { animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar16 = (GHIDRA_CAST((animState)))->AnimationState::NextEventTrigger(GHIDRA_CAST("Explosion")); + iVar16 = AnimationState::NextEventTrigger(animState,GHIDRA_CAST("Explosion")); _empty_check_0x34(); if ((*GHIDRA_CAST((GHIDRA_CAST(&(auVar23)) + 0x0))) + 10.0 <= (float)iVar16) { fVar19 = (long double)(GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::PlaybackSpeed(); @@ -6427,7 +6427,7 @@ LAB_006c5c89: msvc::string::string_from_cstr (local_4c + 0x10,GHIDRA_CAST("gfx/promo/gfuel/effects/explosion_delayed.anm2")); local_14 = 5; - (GHIDRA_CAST((pAVar18)))->ANM2::Load(GHIDRA_CAST((local_4c + 0x10)),1); + ANM2::Load(pAVar18,GHIDRA_CAST((local_4c + 0x10)),1); local_14 = 0xffffffff; (GHIDRA_CAST((local_4c + 0x10)))->msvc::string::_Tidy_deallocate(); sprite = GHIDRA_CAST((GHIDRA_CAST((pEVar7)))->Entity)::GetSprite(); @@ -6577,7 +6577,7 @@ LAB_006c5c89: (GHIDRA_CAST((g_game)))->Game::ShakeScreen(0x1e); SoundEffects::PlayWithFartOverride(0x10a,1.0,2,0,1.0); } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::IsFinishedImpl(&s_empty); + bVar2 = ANM2::IsFinishedImpl(GHIDRA_CAST(sprite),&s_empty); if ((bVar2 != 0) && (this->_exists != 0)) { trigger_kill_item_effects(this); } @@ -6758,7 +6758,7 @@ LAB_006c6d40: } tmpColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); (GHIDRA_CAST((GHIDRA_CAST(local_a0))))->Color::operator_assign(tmpColor); - (GHIDRA_CAST((GHIDRA_CAST(local_a0))))->Font::SetLineHeightModifier(this->_flickerAlpha); + Font::SetLineHeightModifier(GHIDRA_CAST(local_a0),this->_flickerAlpha); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST(local_a0)); } iVar16 = this->_championColorIdx; @@ -6858,10 +6858,10 @@ LAB_006c7154: (GHIDRA_INT(this->_championRegenTimer) - GHIDRA_INT(local_288) < 5)) { (GHIDRA_CAST((local_4c + 0x10)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/024.000_Globin.anm2")); local_14 = 7; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_4c + 0x10)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_4c + 0x10)),1); local_14 = 0xffffffff; (GHIDRA_CAST((local_4c + 0x10)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("ReGenChamp"),1); + ANM2::Play(&this->_sprite,GHIDRA_CAST("ReGenChamp"),1); LAB_006c7308: this->ResetColor(); } @@ -7861,7 +7861,7 @@ LAB_006c930b: this = npc; tmpColor = &npc->_floorColor; (GHIDRA_CAST((GHIDRA_CAST(tmpColor))))->KColor::FromRGBA255(0,0,0,0xff); - (GHIDRA_CAST((GHIDRA_CAST(tmpColor))))->Font::SetLineHeightModifier(0.7); + Font::SetLineHeightModifier(GHIDRA_CAST(tmpColor),0.7); pEVar9 = GHIDRA_CAST((local_38._red * 0.9)); (GHIDRA_CAST((GHIDRA_CAST(tmpColor))))->Color::SetOffset((float)pEVar9,local_38._green * 0.9,local_38._blue * 0.9); sprite = GHIDRA_CAST(&this->_sprite); @@ -7882,7 +7882,7 @@ LAB_006c930b: FUN_0041c710(); local_298.y = (GHIDRA_CAST((GHIDRA_CAST(&this->_floorColor))))->Color::A(); fVar20 = Math::lerp(local_298.y,0.7,0.3,0); - (GHIDRA_CAST((GHIDRA_CAST(&this->_floorColor))))->Font::SetLineHeightModifier(fVar20); + Font::SetLineHeightModifier(GHIDRA_CAST(&this->_floorColor),fVar20); local_298.y = local_38._blue * 0.9; fVar19 = (long double)Color::BO(); local_2b8.y = (float)fVar19; @@ -7901,7 +7901,7 @@ LAB_006c930b: Color::Lerp(GHIDRA_CAST(local_cc),GHIDRA_CAST(local_a0),&this->_floorColor,0.1); spriteColor = GHIDRA_CAST((GHIDRA_CAST((sprite)))->Sprite)::Color(); fVar20 = (GHIDRA_CAST((spriteColor)))->Color::A(); - (GHIDRA_CAST((GHIDRA_CAST(local_cc))))->Font::SetLineHeightModifier(fVar20); + Font::SetLineHeightModifier(GHIDRA_CAST(local_cc),fVar20); (GHIDRA_CAST((GHIDRA_CAST(local_cc))))->Color::SetTint(0.02,0.02,0.02,1.0); (GHIDRA_CAST((sprite)))->Sprite::SetColor(GHIDRA_CAST(local_cc)); } @@ -8077,7 +8077,7 @@ LAB_006ca09e: if (bVar2 == 0) { if ((this->_type == 0x322) && (this->_state == 8)) { animState = GHIDRA_CAST(Config)::GetPillEffects(); - bVar2 = (GHIDRA_CAST((animState)))->AnimationState::IsLoopingAnimation(); + bVar2 = AnimationState::IsLoopingAnimation(animState); if ((bVar2 != 0) && (bVar2 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::IsFrame(3,this->_index), bVar2 != 0)) goto LAB_006ca297; } @@ -8181,7 +8181,7 @@ LAB_006ca2e9: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::Stop(); FUN_0040a9c0(); (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::RemoveStatusEffects(); - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_statusEffectSprite); this->SetCollisionDamage(0); this->_entityCollisionClass = 4; if ((this->_entityGridCollisionClass < 3) || (this->_entityGridCollisionClass == 7)) { @@ -8346,7 +8346,7 @@ LAB_006ca9aa: *GHIDRA_CAST((effect[1]._sprite._filename._buf + 8)) = damageEvent; (effect->_posOffset).x = (this->_posOffset).x; (effect->_posOffset).y = (this->_posOffset).y; - layer = (GHIDRA_CAST((&effect->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&effect->_sprite,GHIDRA_CAST(0x0)); if (&layer->_color != GHIDRA_CAST(&sourceRef)) { (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; @@ -8443,9 +8443,9 @@ void Entity_NPC::SetBossColorIdx(int bossColorIdx, int unused) if (0xf < (this->_sprite)._animDefaultName._capacity) { anim = *GHIDRA_CAST(anim->_buf); } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } @@ -9226,7 +9226,7 @@ LAB_006d301b: if (this->_type == 0x371) { NpcHelper::needle_render(this); LAB_006d3040: - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); isHidden = layer->_visible == 0; laterAnimState = extraout_ECX; } @@ -9241,7 +9241,7 @@ LAB_006d3040: } if ((statusTarget != GHIDRA_CAST(0x0)) && (this->_visible != 0)) { if ((statusTarget->_sprite)._animState._animData != (void *)0x0) { - pfVar5 = (GHIDRA_CAST((&(statusTarget->_sprite)._animState)))->AnimationState::GetNullFrameById(0); + pfVar5 = AnimationState::GetNullFrameById(&(statusTarget->_sprite)._animState,0); if (pfVar5 == GHIDRA_CAST(0x0)) { laterAnimState = extraout_ECX_00; statusTarget = minecart; @@ -9401,7 +9401,7 @@ LAB_006d3040: local_70 = (float)dVar11; local_84.x = baseOffset.x + local_88 / local_98; local_84.y = baseOffset.y + local_70 / local_98; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(&local_84,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_sprite,&local_84,&g_vectorZero,&g_vectorZero); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetColor(GHIDRA_CAST(&local_48)); iVar6 = this->_type; laterAnimState = extraout_ECX_05; @@ -9604,7 +9604,7 @@ LAB_006d3d39: if (((this->_type == 0x19b) || (this->_type == 0x330)) && ((this->_entityRef != 0 && ((((this->_sprite)._animState._animData != (void *)0x0 && - (pfVar5 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetNullFrame(&DAT_00b67800), + (pfVar5 = AnimationState::GetNullFrame(&(this->_sprite)._animState,&DAT_00b67800), pfVar5 != GHIDRA_CAST(0x0))) && (*GHIDRA_CAST((pfVar5 + 3)) != '\0')))))) { iVar6 = this->_entityRef; fVar9 = 0.0; @@ -9622,7 +9622,7 @@ LAB_006d3d39: fVar9 = pfVar5[5]; *GHIDRA_CAST((iVar6 + 0xe4)) = (float)local_90 * pfVar5[4]; *GHIDRA_CAST((iVar6 + 0xe8)) = local_88 * fVar9; - (GHIDRA_CAST((GHIDRA_CAST((this->_entityRef + 0x48)))))->ANM2::Render(&this->_renderPosition,&g_vectorZero, + ANM2::Render(GHIDRA_CAST((this->_entityRef + 0x48)),&this->_renderPosition,&g_vectorZero, &g_vectorZero); iVar6 = this->_entityRef; *GHIDRA_CAST((iVar6 + 0xdc)) = local_70; @@ -9655,7 +9655,7 @@ LAB_006d3d39: local_5c._green = 1.0; local_5c._blue = 1.0; local_5c._alpha = 1.0; - (GHIDRA_CAST((&g_manager->_font6_PFTempestaSevenCondensed)))->Font::DrawString(GHIDRA_CAST((local_48._tint + 3)), + Font::DrawString(&g_manager->_font6_PFTempestaSevenCondensed,GHIDRA_CAST((local_48._tint + 3)), &local_5c,local_ec._colorize,(this->_renderPosition).x, (this->_renderPosition).y - 28.0); ehState = 0xffffffff; @@ -9664,7 +9664,7 @@ LAB_006d3d39: ((this->_statusEffectSprite)._animState._animData != (void *)0x0)) && ((this->_statusEffectSprite)._animState._isPlaying != 0)) { local_68 = (float)(GHIDRA_UINT((this->_statusEffectSprite)._bitflags) >> 0x1f); - iVar6 = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->AnimationData::find_null_index(GHIDRA_CAST("OverlayEffect")); + iVar6 = AnimationData::find_null_index(GHIDRA_CAST(&this->_sprite),GHIDRA_CAST("OverlayEffect")); if (iVar6 < 0) { if (this->_config == GHIDRA_CAST(0x0)) { KAGE_LogMessage(1,GHIDRA_CAST("[warn] No OverlayEffect Null found for Entity (%d)\n")); @@ -9694,7 +9694,7 @@ LAB_006d3d39: } } else { - local_9c = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayerFrame(iVar6); + local_9c = ANM2::GetLayerFrame(&this->_sprite,iVar6); if (((local_9c != GHIDRA_CAST(0x0)) && (*GHIDRA_CAST((local_9c + 3)) != '\0')) && (((*GHIDRA_CAST((GHIDRA_CAST(&(local_68)) + 0x0))) == '\0' || ((this->_parent == 0 || @@ -9713,7 +9713,7 @@ LAB_006d3d39: local_68 = (float)dVar11; local_84.x = baseOffset.x + local_a0 + *local_9c; local_84.y = baseOffset.y + local_68 / local_7c + local_9c[1]; - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::Render(&local_84,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_statusEffectSprite,&local_84,&g_vectorZero,&g_vectorZero); } } } @@ -9760,7 +9760,7 @@ LAB_006d44a0: fVar9 = (this->_sprite)._scale.y; renderPos.y = (this->_renderPosition).y - fVar9 * 35.0; renderPos.x = fVar9 * 12.0 + (this->_renderPosition).x; - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_chargeBarSprite,&renderPos,&g_vectorZero,&g_vectorZero); } if (((this->_flags & 0x1000002000000000) != 0) && ((GHIDRA_UINT(g_game->_debugFlags) >> 6 & 1) != 0)) { sprintf(debugText,GHIDRA_CAST("%.02f")); @@ -9866,7 +9866,7 @@ uint8_t Entity_NPC::CanBeDamagedFromVelocity(Vector velocity) return 1; } ExceptionList = &local_10; - (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(&animName); + ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState),&animName); local_8 = 0; iVar2 = FUN_006da7d0(animName._size - 2,2,&DAT_00b1cde4); if (iVar2 == 0) { @@ -10076,7 +10076,7 @@ void Entity_NPC::PlayDeathEffects() splatOffset.y = g_vectorZero.y; if (((this->_sprite)._animState._animData != (void *)0x0) && (((this->_type != 0x38d || (this->_variant != 10)) && - (layerFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetLayerFrame(0), + (layerFrame = AnimationState::GetLayerFrame(&(this->_sprite)._animState,0), layerFrame != (void *)0x0)))) { splatOffset.x = (*GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 8)) * 0.5 - *GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 0x20))) + @@ -11144,7 +11144,7 @@ void Entity_NPC::update_blood_guide_gibs(float *nullFrame) return; } ExceptionList = &local_10; - nullFrame = (GHIDRA_CAST((&(bloodEffect->_sprite)._animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("BloodGuide")); + nullFrame = AnimationState::GetNullFrame(&(bloodEffect->_sprite)._animState,GHIDRA_CAST("BloodGuide")); ppvVar1 = ExceptionList; if (nullFrame == GHIDRA_CAST(0x0)) { ExceptionList = local_10; @@ -11154,12 +11154,12 @@ void Entity_NPC::update_blood_guide_gibs(float *nullFrame) ExceptionList = ppvVar1; animState = &(bloodEffect->_sprite)._animState; if ((bloodEffect->_sprite)._animState._animData == (void *)0x0) goto LAB_006d7c3e; - bVar2 = (GHIDRA_CAST((animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST("BloodStart")); + bVar2 = AnimationState::WasEventTriggered(animState,GHIDRA_CAST("BloodStart")); if ((bVar2 != 0) && (((bloodEffect->_sprite)._animState._animData == (void *)0x0 || - ((bVar2 = (GHIDRA_CAST((animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST("BloodStop")), bVar2 == 0 && + ((bVar2 = AnimationState::WasEventTriggered(animState,GHIDRA_CAST("BloodStop")), bVar2 == 0 && (((bloodEffect->_sprite)._animState._animData == (void *)0x0 || - (bVar2 = (GHIDRA_CAST((animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST("Explosion")), bVar2 == 0))))))) + (bVar2 = AnimationState::WasEventTriggered(animState,GHIDRA_CAST("Explosion")), bVar2 == 0))))))) ) { if (((bloodEffect->_type == 0x390) && (bloodEffect->_variant == 10)) || ((*GHIDRA_CAST((GHIDRA_CAST(bloodEffect->_config) + 0x60)) >> 0xd & 1) != 0)) { @@ -11285,7 +11285,7 @@ LAB_006d7a90: } } if ((((bloodEffect->_sprite)._animState._animData != (void *)0x0) && - (bVar2 = (GHIDRA_CAST((&(bloodEffect->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("BloodStart")), + (bVar2 = AnimationState::IsEventTriggered(&(bloodEffect->_sprite)._animState,GHIDRA_CAST("BloodStart")), bVar2 != 0)) && (bloodEffect->_type == 0x54)) { local_1c = GHIDRA_CAST(0x4); do { @@ -11331,9 +11331,9 @@ LAB_006d7a90: LAB_006d7c3e: animState = &(bloodEffect->_sprite)._animState; if (((bloodEffect->_sprite)._animState._animData != (void *)0x0) && - ((bVar2 = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("BloodStop")), bVar2 != 0 || + ((bVar2 = AnimationState::IsEventTriggered(animState,GHIDRA_CAST("BloodStop")), bVar2 != 0 || (((bloodEffect->_sprite)._animState._animData != (void *)0x0 && - (bVar2 = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Explosion")), bVar2 != 0)))))) { + (bVar2 = AnimationState::IsEventTriggered(animState,GHIDRA_CAST("Explosion")), bVar2 != 0)))))) { room = g_game->_room; iVar3 = *GHIDRA_CAST((GHIDRA_CAST(room) + 0x125c)); local_30.x = *GHIDRA_CAST((GHIDRA_CAST(room) + 0x1260)); @@ -11883,7 +11883,7 @@ void Entity_NPC::UpdateChargeBar(float start, float end, float value, uint8_t is anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/chargebar.anm2",0x13); local_14 = 0; - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_chargeBarSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { size = anm2Path._capacity + 1; @@ -11904,7 +11904,7 @@ void Entity_NPC::UpdateChargeBar(float start, float end, float value, uint8_t is puVar1 = puStack_20; } puStack_20 = puVar1; - barLayer = (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + barLayer = ANM2::GetLayer(&this->_chargeBarSprite,GHIDRA_CAST(0x2)); barLayer->_visible = 0; if (start == end) { KAGE_LogMessage(0x10,GHIDRA_CAST("Start and End parameters cannot be the same!")); @@ -11918,10 +11918,10 @@ void Entity_NPC::UpdateChargeBar(float start, float end, float value, uint8_t is } chargeFrame = GHIDRA_INT((chargeFraction * 100.0 + 0.0)); if ((isHideWhenFull == 0) || (chargeFrame < 100)) { - bVar2 = (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Charging"),1); + bVar2 = ANM2::SetAnimation(&this->_chargeBarSprite,GHIDRA_CAST("Charging"),1); if ((bVar2 != 0) && (((this->_chargeBarSprite)._animState._animData != (void *)0x0 && - ((GHIDRA_CAST((&(this->_chargeBarSprite)._animState)))->AnimationState::SetFrameFloat((float)chargeFrame), + (AnimationState::SetFrameFloat(&(this->_chargeBarSprite)._animState,(float)chargeFrame), (this->_chargeBarSprite)._animState._animData != (void *)0x0)))) { (this->_chargeBarSprite)._animState._isPlaying = 0; } @@ -12319,9 +12319,9 @@ LAB_006d9e96: curAnimData = (half->_sprite)._animState._animData; if (curAnimData == GHIDRA_CAST(0x0)) { LAB_006d9f46: - bVar3 = (GHIDRA_CAST((&half->_sprite)))->ANM2::SetAnimation(&DAT_00b1cdf8,1); + bVar3 = ANM2::SetAnimation(&half->_sprite,&DAT_00b1cdf8,1); if (bVar3 != 0) { - (GHIDRA_CAST((&(half->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(half->_sprite)._animState); (half->_sprite)._animState._isPlaying = 1; } } @@ -12389,9 +12389,9 @@ LAB_006d9f2d: } if (iVar6 == 0x44) { half->_i1 = this->_i1; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (GHIDRA_CAST((GHIDRA_CAST(&half->_sprite))))->Sprite::ReplaceSpritesheet(0,&layer->_spriteSheetPath); - (GHIDRA_CAST((&half->_sprite)))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(&half->_sprite,unk); EntityList::QuerySublist (GHIDRA_CAST((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST(peeps),0x44,-1,-1 ,0,0); @@ -12503,7 +12503,7 @@ LAB_006da2c0: else if (iVar6 == 0x40) { if (this->_i1 != 0) { half->_i1 = 1; - layer = (GHIDRA_CAST((&half->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&half->_sprite,GHIDRA_CAST(0x1)); layer->_visible = 0; } } diff --git a/generated-src/entity_pickup.cpp b/generated-src/entity_pickup.cpp index b989897..ca0dda9 100644 --- a/generated-src/entity_pickup.cpp +++ b/generated-src/entity_pickup.cpp @@ -367,12 +367,12 @@ void Entity_Pickup::GetLootList(Vector *renderOffset) g_graphicsManager_blendMode[3] = 1; g_graphicsManager_blendMode[4] = 7; g_graphicsManager_blendMode[1] = iVar3; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); layer->_wrapSMode = 0; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); layer->_wrapTMode = 0; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(&texture); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,&texture); local_14 = (float)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),3); if (texture != GHIDRA_CAST(0x0)) { shader = &g_shaders; @@ -529,7 +529,7 @@ void Entity_Pickup::Constructor() (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::constructor(); local_8 = 0; *GHIDRA_CAST(this) = IsaacRepentancePlus::Entity_Pickup::vftable; - (GHIDRA_CAST((&this->_priceANM2)))->ANM2::constructor(); + ANM2::constructor(&this->_priceANM2); (this->_colorMod)._tint[0] = 1.0; (this->_colorMod)._tint[1] = 1.0; (this->_colorMod)._tint[2] = 1.0; @@ -548,7 +548,7 @@ void Entity_Pickup::Constructor() this->_flipSaveState = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5cc)))) = 0; local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),6); - (GHIDRA_CAST((&this->_altPedestalANM2)))->ANM2::constructor(); + ANM2::constructor(&this->_altPedestalANM2); ExceptionList = local_10; return; } @@ -618,7 +618,7 @@ uint8_t Entity_Pickup::TryFlip(Entity_Player *unusedPlayer, uint32_t unusedSeed) local_8 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_8))) + 0x1))) << 8; } (GHIDRA_CAST((flipStateRef)))->EntitySaveStateRef::Set(state); - (GHIDRA_CAST((&this->_altPedestalANM2)))->ANM2::Reset(); + ANM2::Reset(&this->_altPedestalANM2); invoke_pending_callbacks(flippedState); ExceptionList = local_10; return 1; @@ -703,16 +703,16 @@ void Entity_Pickup::SetAlternatePedestal(int pedestalType) if ((((this->_variant == 100) && (-1 < pedestalType)) && (this->_price == 0)) && (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)) != 0x10)) { - isOverlaySet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST("Alternates"),1); + isOverlaySet = ANM2::SetOverlayAnimation(&this->_sprite,GHIDRA_CAST("Alternates"),1); if ((isOverlaySet != 0) && ((this->_sprite)._overlayAnimState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)pedestalType); + AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)pedestalType); } - nullFrameOffset = (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::GetNullFrameById(0); + nullFrameOffset = AnimationState::GetNullFrameById(&(this->_sprite)._overlayAnimState,0); pedestalOffset = &g_vectorZero; if (nullFrameOffset != GHIDRA_CAST(0x0)) { pedestalOffset = nullFrameOffset; } - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); (layer->_pos).x = pedestalOffset->x; (layer->_pos).y = pedestalOffset->y; manager = g_manager; @@ -1018,7 +1018,7 @@ LAB_006e22cc: } switchD_006e23e9_caseD_1: ppcStack_20 = ppcVar1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)iVar2); + ANM2::LoadGraphics(&this->_sprite,(uint8_t)iVar2); ExceptionList = local_1c; return; } @@ -1073,13 +1073,13 @@ void Entity_Pickup::update_price_sprite(int price) if (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)) == 0x10) { (this->_posOffset).y = 0.0; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); SetAlternatePedestal(this,0); } - (GHIDRA_CAST((&this->_priceANM2)))->ANM2::Reset(); + ANM2::Reset(&this->_priceANM2); } else { - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); if (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)) == 0x10) { (this->_posOffset).y = -20.0; } @@ -1095,7 +1095,7 @@ void Entity_Pickup::update_price_sprite(int price) priceConfig = (GHIDRA_CAST((&manager->_entityConfig)))->EntityConfig::GetEntity(5,0,0); } priceSprite = &this->_priceANM2; - (GHIDRA_CAST((priceSprite)))->ANM2::Load(&priceConfig->anm2Path,1); + ANM2::Load(priceSprite,&priceConfig->anm2Path,1); if ((this->_price < 0) && (this->_price != -1000)) { anim = "Hearts"; } @@ -1109,37 +1109,37 @@ void Entity_Pickup::update_price_sprite(int price) } pGVar5 = local_14; } - (GHIDRA_CAST((priceSprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + ANM2::SetAnimation(priceSprite,GHIDRA_CAST(anim),1); iVar4 = this->_price; if (iVar4 < 0) { if (iVar4 < -8) { if (iVar4 == -9) { if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(7.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,7.0); } } else if (iVar4 == -1000) { - layer = (GHIDRA_CAST((priceSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(priceSprite,GHIDRA_CAST(0x0)); layer->_visible = 0; - (GHIDRA_CAST((priceSprite)))->ANM2::SetLayerFrame(1,0); - (GHIDRA_CAST((priceSprite)))->ANM2::SetLayerFrame(2,10); + ANM2::SetLayerFrame(priceSprite,1,0); + ANM2::SetLayerFrame(priceSprite,2,10); } } else { switch(iVar4) { case -8: if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(6.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,6.0); } break; case -7: if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(5.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,5.0); } break; case -6: if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(4.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,4.0); } if (pGVar5 == GHIDRA_CAST(0xfffffff6)) { room = g_game->_room; @@ -1163,11 +1163,11 @@ void Entity_Pickup::update_price_sprite(int price) } break; case -5: - layer = (GHIDRA_CAST((priceSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(priceSprite,GHIDRA_CAST(0x0)); layer->_visible = 0; - layer = (GHIDRA_CAST((priceSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(priceSprite,GHIDRA_CAST(0x1)); layer->_visible = 0; - layer = (GHIDRA_CAST((priceSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(priceSprite,GHIDRA_CAST(0x2)); childSlot = &this->_child; layer->_visible = 0; if (*childSlot == 0) { @@ -1191,29 +1191,29 @@ void Entity_Pickup::update_price_sprite(int price) break; case -4: if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(3.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,3.0); } break; case -3: if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(2.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,2.0); } break; case -2: if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,1.0); } break; case -1: if ((this->_priceANM2)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_priceANM2)._animState,0.0); } } } } else { if (iVar4 < 10) { - layer = (GHIDRA_CAST((priceSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(priceSprite,GHIDRA_CAST(0x0)); layer->_visible = 0; } else { @@ -1228,7 +1228,7 @@ void Entity_Pickup::update_price_sprite(int price) KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->_priceANM2)._animState._layerFrames) + iVar4 * 4)) = 0; - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::AdvanceLayerPosition(iVar4,(float)price); + AnimationState::AdvanceLayerPosition(&(this->_priceANM2)._animState,iVar4,(float)price); } } price = this->_price % 10; @@ -1242,7 +1242,7 @@ void Entity_Pickup::update_price_sprite(int price) KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->_priceANM2)._animState._layerFrames) + iVar4 * 4)) = 0; - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::AdvanceLayerPosition(iVar4,(float)price); + AnimationState::AdvanceLayerPosition(&(this->_priceANM2)._animState,iVar4,(float)price); } if (((this->_priceANM2)._animState._animData != (void *)0x0) && ((2 < *GHIDRA_CAST((GHIDRA_INT((this->_priceANM2)._animState._animation) + 0x80)) || @@ -1254,14 +1254,14 @@ void Entity_Pickup::update_price_sprite(int price) KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->_priceANM2)._animState._layerFrames) + iVar4 * 4)) = 0; - (GHIDRA_CAST((&(this->_priceANM2)._animState)))->AnimationState::AdvanceLayerPosition(iVar4,10.0); + AnimationState::AdvanceLayerPosition(&(this->_priceANM2)._animState,iVar4,10.0); } } } if (this->_variant == 100) { - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ShopIdle"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("ShopIdle"),1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; this->_entityCollisionClass = 1; @@ -1270,7 +1270,7 @@ void Entity_Pickup::update_price_sprite(int price) } } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } this->_entityCollisionClass = 1; pGVar5 = local_14; @@ -1280,7 +1280,7 @@ LAB_006e2c1a: (**(code **)(*GHIDRA_CAST(this->_child) + 0x28))(uVar2); } if ((pGVar5 == GHIDRA_CAST(0xfffffff6)) && (this->_price == 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); SetAlternatePedestal(this,0); uVar2 = Random(); (GHIDRA_CAST((g_game)))->Game::SpawnEx(1000,0xf,&this->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar2,0); @@ -1339,7 +1339,7 @@ LAB_006e2c1a: if ((iVar4 != 0) && (*GHIDRA_CAST((iVar4 + 4)) == 0x1c)) { if (*GHIDRA_CAST((iVar4 + 0xc)) == 1) { *GHIDRA_CAST((iVar4 + 0xc)) = 0; - (GHIDRA_CAST((GHIDRA_CAST((iVar4 + 0x40)))))->ANM2::Play(GHIDRA_CAST("SummonPayment"),0); + ANM2::Play(GHIDRA_CAST((iVar4 + 0x40)),GHIDRA_CAST("SummonPayment"),0); ExceptionList = local_10; return; } @@ -1460,9 +1460,9 @@ LAB_006e3070: nameCompare = 0; LAB_006e3075: if (nameCompare == 0) { - frame = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + frame = ANM2::GetFrame(&this->_sprite); if (frame == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("AppearFast"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("AppearFast"),0); } } } @@ -1697,7 +1697,7 @@ void Entity_Pickup::Update() local_40 = GHIDRA_CAST(&DAT_0000002f); builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_68))) + 0x14))),"gfx/promo/gfuel/effects/explosion4.anm2",0x28); local_14 = 0; - (GHIDRA_CAST((explosionSprite)))->ANM2::Load(GHIDRA_CAST((local_68 + 0x14)),1); + ANM2::Load(explosionSprite,GHIDRA_CAST((local_68 + 0x14)),1); local_14 = 0xffffffff; if (GHIDRA_CAST(&DAT_0000000f) < local_40) { piVar13 = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((local_40)) + 0x1)))); @@ -1734,10 +1734,10 @@ void Entity_Pickup::Update() (*GHIDRA_CAST((GHIDRA_CAST(&(in_stack_fffffec0)) + 0x0))) = 0xab; (*GHIDRA_CAST((GHIDRA_CAST(&(in_stack_fffffec0)) + 0x1))) = 0x3d; (*GHIDRA_CAST((GHIDRA_CAST(&(in_stack_fffffec0)) + 0x2))) = 0x6e; - bVar4 = (GHIDRA_CAST((&local_cc->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(in_stack_fffffec4),1); + bVar4 = ANM2::SetAnimation(&local_cc->_sprite,GHIDRA_CAST(in_stack_fffffec4),1); pRVar20 = local_d0; if (bVar4 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((local_d0->_gridEntities + 3)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((local_d0->_gridEntities + 3))); *GHIDRA_CAST((pRVar20->_gridEntities + 8)) = 1; pEVar8 = local_cc; } @@ -1767,10 +1767,10 @@ LAB_006e3e26: } if (bVar4 != (this->_altPedestalANM2)._loaded) { if (bVar4 == 0) { - (GHIDRA_CAST((&this->_altPedestalANM2)))->ANM2::Reset(); + ANM2::Reset(&this->_altPedestalANM2); } else { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x248)))))->ANM2::ANM2(&this->_sprite); + ANM2::ANM2(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x248)),&this->_sprite); other._championColor._offset[0] = in_stack_fffffeac; other._filename._buf[0] = in_stack_fffffdb8[0]; other._filename._buf[1] = in_stack_fffffdb8[1]; @@ -1869,7 +1869,7 @@ LAB_006e3e26: (*GHIDRA_CAST((GHIDRA_CAST(&(other)) + 0x10a))) = SUB42(in_stack_fffffec0,2); other._shadowLayerIndex = GHIDRA_INT(in_stack_fffffec4); other._bitflags = iVar23; - (GHIDRA_CAST((&this->_altPedestalANM2)))->ANM2::operator_assign(other); + ANM2::operator_assign(&this->_altPedestalANM2,other); if ((g_game->_currentDimensionIdx == 2) || ((uVar7 = (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::GetCurses(), (uVar7 & 0x40) == 0 && (this->_isForceBlind == 0)))) { @@ -1881,15 +1881,16 @@ LAB_006e3e26: load_collectible_gfx (&this->_altPedestalANM2,1,*GHIDRA_CAST((this->_flipSaveState + 8)), *GHIDRA_CAST((this->_flipSaveState + 0x34)),bVar4); - (GHIDRA_CAST((&this->_altPedestalANM2)))->ANM2::LoadGraphics(bVar4); - animName = (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST((local_bc + 0x10))); + ANM2::LoadGraphics(&this->_altPedestalANM2,bVar4); + animName = ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState), + GHIDRA_CAST((local_bc + 0x10))); local_14 = 1; if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - bVar4 = (GHIDRA_CAST((&this->_altPedestalANM2)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar4 = ANM2::SetAnimation(&this->_altPedestalANM2,GHIDRA_CAST(animName),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_altPedestalANM2)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_altPedestalANM2)._animState); (this->_altPedestalANM2)._animState._isPlaying = 1; } local_14 = 0xffffffff; @@ -1912,8 +1913,8 @@ LAB_006e3e26: } } if ((this->_altPedestalANM2)._loaded != 0) { - (GHIDRA_CAST((&(this->_altPedestalANM2)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_altPedestalANM2)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_altPedestalANM2)._animState); + AnimationState::Update(&(this->_altPedestalANM2)._overlayAnimState); } } if ((this->_price == 0) && (this->_variant == 10)) { @@ -2108,7 +2109,7 @@ LAB_006e4390: uVar7 = 0; LAB_006e4395: if (uVar7 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); this->_entityCollisionClass = 4; } } @@ -2308,7 +2309,7 @@ LAB_006e4978: if (this->_entityCollisionClass != 0) { pcVar12 = "IdlePanic"; LAB_006e4bf6: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(pcVar12),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(pcVar12),0); } } local_14 = 0xffffffff; @@ -2449,18 +2450,18 @@ LAB_006e535b: } } if ((local_bd == 0) || (this->_subtype != 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); goto LAB_006e53e7; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Opened"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Opened"),0); } else { LAB_006e5393: - bVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("DropSound")); + bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("DropSound")); if (((bVar4 != 0) && (PlayDropSound(this), local_bd == 0)) && - ((bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Appear")), bVar4 != 0 || - ((bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("AppearFast")), bVar4 != 0 || - (bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Reappear")), bVar4 != 0)))))) { + ((bVar4 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("Appear")), bVar4 != 0 || + ((bVar4 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("AppearFast")), bVar4 != 0 || + (bVar4 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("Reappear")), bVar4 != 0)))))) { LAB_006e53e7: this->_entityCollisionClass = 4; if (this->_variant == 0x29) { @@ -2521,9 +2522,9 @@ LAB_006e4fc5: } else if (iVar6 < 6) { if (iVar6 == 5) { - iVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + iVar6 = ANM2::GetFrame(&this->_sprite); if (((this->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)(iVar6 + 2)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(iVar6 + 2)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -2540,7 +2541,7 @@ LAB_006e4fc5: uVar7 = Random(); if ((uVar7 & 7) == 0) { uVar7 = Random(); - iVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + iVar6 = ANM2::GetFrame(&this->_sprite); jitterFrame = iVar6 + -2 + uVar7 % 5; uVar7 = 6; if (6 < jitterFrame) { @@ -2565,14 +2566,15 @@ LAB_006e4fc5: puVar1 = GHIDRA_CAST((GHIDRA_INT(&this->_flags) + 4)); *puVar1 = *puVar1 & 0xfffffeff; *GHIDRA_CAST(&this->_flags) = GHIDRA_INT(flags); - animName = (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST((local_bc + 0x10))); + animName = ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState), + GHIDRA_CAST((local_bc + 0x10))); local_14 = 5; if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar4 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } local_14 = 0xffffffff; @@ -2654,7 +2656,7 @@ LAB_006e55e8: } } else { - local_bd = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("DropSound")); + local_bd = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("DropSound")); if (local_bd == 0) goto LAB_006e55e8; LAB_006e562c: uVar7 = Random(); @@ -2713,7 +2715,7 @@ LAB_006e562c: } if ((((this->_variant == 0x39) && (this->_subtype != 0)) && ((this->_sprite)._animState._animData != (void *)0x0)) && - (bVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(s_Open), bVar4 != 0)) { + (bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,s_Open), bVar4 != 0)) { if (this->_subtype == 1) { player = GHIDRA_CAST(this->_target); if ((player == GHIDRA_CAST(0x0)) || (player->_type != 1)) { @@ -2751,7 +2753,7 @@ LAB_006e562c: (iVar6 = this->_chestReCloseTimer + -1, this->_chestReCloseTimer = iVar6, iVar6 == 0)) && (this->_variant == 0x35)) { this->_subtype = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Close"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Close"),0); manager = g_manager; local_c8.y = 2.94273e-44; seed_fart_sound_override(GHIDRA_CAST(&local_c8.y)); @@ -2958,7 +2960,8 @@ LAB_006e42ba: } } if ((this->_variant == 0x14) && (this->_subtype == 6)) { - animName = (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST((local_bc + 0x10))); + animName = ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState), + GHIDRA_CAST((local_bc + 0x10))); puVar1 = &animName->_size; if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); @@ -2967,7 +2970,7 @@ LAB_006e42ba: (GHIDRA_CAST((local_bc + 0x10)))->msvc::string::_Tidy_deallocate(); if (local_bd != 0) { if ((this->_sprite)._animState._animData != (void *)0x0) { - bVar4 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("DropSound")); + bVar4 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("DropSound")); manager = g_manager; if (bVar4 != 0) { local_c8.y = 3.237e-43; @@ -2977,7 +2980,7 @@ LAB_006e42ba: } if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); } } } @@ -3044,7 +3047,7 @@ LAB_006e6515: local_e8._shift3 = GHIDRA_INT((GHIDRA_CAST((g_game)))->Game)::GetPlayer(0); } if (this->_state == 1) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Open,0); + ANM2::Play(&this->_sprite,s_Open,0); uVar7 = 0; playerManager = &g_game->_playerManager; game = g_game; @@ -3076,7 +3079,7 @@ LAB_006e6515: } } else if (this->_state == 2) { - iVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + iVar6 = ANM2::GetFrame(&this->_sprite); if ((iVar6 == 6) && (((iVar6 = get_stage_ending_id(0), iVar6 == 3 || (iVar6 == 4)) || ((iVar6 == 5 || ((iVar6 == 9 || (iVar6 == 0xc)))))))) { @@ -3127,7 +3130,7 @@ LAB_006e67da: else { local_c8.y = *GHIDRA_CAST((GHIDRA_CAST(pvVar11) + 0x30)); } - puVar14 = GHIDRA_CAST((GHIDRA_CAST((&player->_bodySprite)))->ANM2)::GetFrame(); + puVar14 = GHIDRA_CAST(ANM2)::GetFrame(&player->_bodySprite); if (puVar14 != &(*GHIDRA_CAST((GHIDRA_CAST(((GHIDRA_CAST((GHIDRA_INT(local_c8.y) + -0x7898))))) + 0x7897)))) goto LAB_006e67da; } game = g_game; @@ -3148,9 +3151,9 @@ LAB_006e686a: fVar19 = (this->_pos).x - (player->_pos).x, fVar17 = (this->_pos).y - (player->_pos).y, fVar17 * fVar17 + fVar19 * fVar19 < 2500.0)) { Morph(this,this->_type,0x34,this->_subtype,0,0,0); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(14.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,14.0); } this->_entityCollisionClass = 4; SoundEffects::PlayWithFartOverride(0xcd,1.0,2,0,1.0); @@ -3235,12 +3238,12 @@ void Entity_Pickup::Render(Vector *offset) &g_vectorZero); local_14 = 2.6; } - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_visible = 0; AnimationState::Render (&(this->_sprite)._overlayAnimState,position,&g_vectorZero,&g_vectorZero); AnimationState::Render(&(this->_sprite)._animState,position,&g_vectorZero,&g_vectorZero); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_visible = 1; if (this->_megaChestCollectible[1] == (void *)0x0) { scratchPos.x = local_14 + position->x; @@ -3262,7 +3265,7 @@ void Entity_Pickup::Render(Vector *offset) (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Render(offset); } if ((this->_priceANM2)._loaded != 0) { - (GHIDRA_CAST((&this->_priceANM2)))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_priceANM2,&this->_renderPosition,&g_vectorZero,&g_vectorZero); } FUN_008630c0(this,offset); } @@ -3352,9 +3355,9 @@ uint8_t Entity_Pickup::TryOpenChest(Entity_Player *player) bVar4 = 0; } else { - bVar4 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Open,1); + bVar4 = ANM2::SetAnimation(&this->_sprite,s_Open,1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } manager = g_manager; @@ -4291,7 +4294,7 @@ void Entity_Pickup::CollectTrinket(Entity_Player *param_2, uint32_t param_3) ExceptionList = &local_10; savedThis = this; if ((param_3 == 0) && (param_3 = this->_price, param_3 == 0)) goto LAB_006e89de; - (GHIDRA_CAST((&this->_priceANM2)))->ANM2::Reset(); + ANM2::Reset(&this->_priceANM2); if (0 < GHIDRA_INT(param_3)) { EntityList::QuerySublist (GHIDRA_CAST((GHIDRA_INT(g_game->_room) + 0x1218)),GHIDRA_CAST(entities),3,0xce,0x209,0, @@ -4521,9 +4524,9 @@ uint8_t Entity_Pickup::empty_pedestal() if (this->_subtype != 0) { this->_subtype = 0; if (this->_price == 0) { - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Empty"),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Empty"),1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } @@ -4536,14 +4539,14 @@ uint8_t Entity_Pickup::empty_pedestal() } update_price_sprite(this,0); SetAlternatePedestal(this,0); - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Empty"),0); - isAnimSet = (GHIDRA_CAST((&this->_altPedestalANM2)))->ANM2::SetAnimation(s_Idle,1); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Empty"),0); + isAnimSet = ANM2::SetAnimation(&this->_altPedestalANM2,s_Idle,1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(this->_altPedestalANM2)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_altPedestalANM2)._animState); (this->_altPedestalANM2)._animState._isPlaying = 1; } } - shadowLayer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("itemshadow")); + shadowLayer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("itemshadow")); if (shadowLayer != GHIDRA_CAST(0x0)) { shadowLayer->_visible = 0; } @@ -4900,7 +4903,7 @@ void Entity_Pickup::update_cycle_collectible(uint8_t isForce) } Morph(this,this->_type,this->_variant,this->_cycleCollectibleList[0],1,1,1); if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)animFrame); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)animFrame); } this->_wait = rotatedState[0]; this->_cycleCollectibleList[0] = rotatedState[1]; @@ -5392,7 +5395,7 @@ void Entity_Pickup::RestoreState(Room *room, Entity_Pickup *entity, void *saveSt } if (*GHIDRA_CAST((GHIDRA_CAST(saveState) + 0x6c)) != 0) { (GHIDRA_CAST((&entity->_flipSaveState)))->SharedPtr::assign(GHIDRA_CAST((GHIDRA_INT(saveState) + 0x6c))); - (GHIDRA_CAST((&entity->_altPedestalANM2)))->ANM2::Reset(); + ANM2::Reset(&entity->_altPedestalANM2); } UpdateLootPreview(entity); if (((g_game->_currentRoomIdx == -0xc) && (g_game->_isStartingFromState != 0)) && diff --git a/generated-src/entity_player.cpp b/generated-src/entity_player.cpp index 8000b03..dac2d6b 100644 --- a/generated-src/entity_player.cpp +++ b/generated-src/entity_player.cpp @@ -379,9 +379,9 @@ LAB_005b1e76: operator_delete(pcVar6,uVar7); bVar3 = extraout_CL_00; } - (GHIDRA_CAST((&(GHIDRA_CAST(entity))->_sprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&(GHIDRA_CAST(entity))->_sprite,bVar3); *GHIDRA_CAST((GHIDRA_CAST(entity) + 0x410)) = 0xf; - (GHIDRA_CAST((&(GHIDRA_CAST(entity))->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Bombed"),0); + ANM2::SetFrame(&(GHIDRA_CAST(entity))->_sprite,GHIDRA_CAST("Bombed"),0); uVar7 = Random(); local_30 = (Entity_Effect *) (GHIDRA_CAST((g_game)))->Game::Spawn(1000,0x88,&this->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0, @@ -398,7 +398,7 @@ LAB_005b1e76: local_18 = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c))) + 0x0))),"gfx/002.040_thrown tear.anm2",0x1d); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; - (GHIDRA_CAST((GHIDRA_CAST(local_38.y))))->ANM2::Load(GHIDRA_CAST(local_2c),1); + ANM2::Load(GHIDRA_CAST(local_38.y),GHIDRA_CAST(local_2c),1); local_8 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_8))) + 0x1))) << 8; if (0xf < local_18) { uVar7 = local_18 + 1; @@ -414,7 +414,7 @@ LAB_005b1e76: operator_delete(pcVar6,uVar7); } LAB_005b2124: - (GHIDRA_CAST((GHIDRA_CAST(local_38.y))))->ANM2::Play(GHIDRA_CAST("Rock1"),0); + ANM2::Play(GHIDRA_CAST(local_38.y),GHIDRA_CAST("Rock1"),0); heldEffect = local_30; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(((GHIDRA_CAST((GHIDRA_INT(local_30) + 0x410))))) + 0x10)))) = 2; (GHIDRA_CAST((GHIDRA_INT(local_30) + 0x410)))->_pendingDamage = 1.26117e-41; @@ -456,9 +456,9 @@ LAB_005b2184: operator_delete(pcVar6,uVar7); bVar3 = extraout_CL_02; } - (GHIDRA_CAST((&(GHIDRA_CAST(entity))->_sprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&(GHIDRA_CAST(entity))->_sprite,bVar3); *GHIDRA_CAST((GHIDRA_CAST(entity) + 0x410)) = 0xf; - (GHIDRA_CAST((&(GHIDRA_CAST(entity))->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Bombed"),0); + ANM2::SetFrame(&(GHIDRA_CAST(entity))->_sprite,GHIDRA_CAST("Bombed"),0); uVar13 = *GHIDRA_CAST((GHIDRA_INT(&(GHIDRA_CAST(entity))->_flags) + 4)); *GHIDRA_CAST(&(GHIDRA_CAST(entity))->_flags) = GHIDRA_UINT((GHIDRA_CAST(entity))->_flags) & 0xffffffef; *GHIDRA_CAST((GHIDRA_INT(&(GHIDRA_CAST(entity))->_flags) + 4)) = uVar13; @@ -478,7 +478,7 @@ LAB_005b2184: local_18 = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c))) + 0x0))),"gfx/002.040_thrown tear.anm2",0x1d); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 4; - (GHIDRA_CAST((GHIDRA_CAST(local_38.y))))->ANM2::Load(GHIDRA_CAST(local_2c),1); + ANM2::Load(GHIDRA_CAST(local_38.y),GHIDRA_CAST(local_2c),1); local_8 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_8))) + 0x1))) << 8; if (0xf < local_18) { uVar7 = local_18 + 1; @@ -512,7 +512,7 @@ LAB_005b2184: fVar8 = 8.36807e-39; local_30 = (Entity_Effect *) (GHIDRA_CAST((g_game)))->Game::Spawn(1000,0x88,pVVar4,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar7); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x284)))))->ANM2::ANM2(&(GHIDRA_CAST(entity))->_sprite); + ANM2::ANM2(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x284)),&(GHIDRA_CAST(entity))->_sprite); other._championColor._offset[0] = fVar8; other._filename._buf[0] = in_stack_fffffd7c[0]; other._filename._buf[1] = in_stack_fffffd7c[1]; @@ -611,7 +611,7 @@ LAB_005b2184: (*GHIDRA_CAST((GHIDRA_CAST(&(other)) + 0x10a))) = SUB42(uVar13,2); other._shadowLayerIndex = iVar5; other._bitflags = uVar7; - (GHIDRA_CAST((&local_30->_sprite)))->ANM2::operator_assign(other); + ANM2::operator_assign(&local_30->_sprite,other); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(((GHIDRA_CAST((GHIDRA_INT(local_30) + 0x410))))) + 0x10)))) = 0xc; (GHIDRA_CAST((GHIDRA_INT(local_30) + 0x410)))->_pendingDamage = 0.0; *GHIDRA_CAST(&(GHIDRA_CAST((GHIDRA_INT(local_30) + 0x410)))->_pendingDamageFlags) = 0; @@ -660,12 +660,12 @@ LAB_005b219a: local_30 = (Entity_Effect *) (GHIDRA_CAST((g_game)))->Game::Spawn(1000,0x88,&this->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar7) ; - (GHIDRA_CAST((&spriteCopy)))->ANM2::ANM2(GHIDRA_CAST((rockShot + 0x12))); + ANM2::ANM2(&spriteCopy,GHIDRA_CAST((rockShot + 0x12))); Isaac::SwapANM2(&local_30->_sprite,&spriteCopy); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 6; - (GHIDRA_CAST((room)))->ANM2::Reset(); - (GHIDRA_CAST((&spriteCopy._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&spriteCopy._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(room); + AnimationState::~AnimationState(&spriteCopy._overlayAnimState); + AnimationState::~AnimationState(&spriteCopy._animState); (GHIDRA_CAST((spriteCopy._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&spriteCopy))))->msvc::string::_Tidy_deallocate(); local_8 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_8))) + 0x1))) << 8; @@ -698,7 +698,7 @@ LAB_005b219a: } while (uVar7 < puStack_44); } PlayExtraAnimation(this,GHIDRA_CAST("LiftItem")); - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_heldSprite); FlushQueueItem(this); this->_itemState = 0x25c; this->_itemStateCooldown = 0; @@ -2036,7 +2036,7 @@ LAB_005c9f70: local_64 = (GHIDRA_CAST((g_game)))->Game::Spawn(1000,0x3b,&sparkPos,&sparkVelocity,GHIDRA_CAST(effectSprite),0,uVar3); uVar3 = g_graphicsManager_flags; effectSprite = &local_64->_sprite; - sparkLayer = (GHIDRA_CAST((effectSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + sparkLayer = ANM2::GetLayer(effectSprite,GHIDRA_CAST(0x0)); local_30 = 0.0; fStack_2c = 0.0; iVar5 = 1; @@ -2049,7 +2049,7 @@ LAB_005c9f70: sparkLayer->_blendMode[2] = 1; sparkLayer->_blendMode[3] = 1; sparkLayer->_blendMode[4] = 1; - sparkLayer = (GHIDRA_CAST((effectSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + sparkLayer = ANM2::GetLayer(effectSprite,GHIDRA_CAST(0x0)); if (&sparkLayer->_color != GHIDRA_CAST(local_50)) { (sparkLayer->_color)._tint[0] = 5.0; (sparkLayer->_color)._tint[1] = 0.5; @@ -2638,7 +2638,7 @@ LAB_005cb4e6: msvc::_Move_unchecked(pvVar6,uVar3); costumesEnd = (this->_costumeSpriteDescs)._end; local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(costumesEnd) + -0x130)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(costumesEnd) + -0x130))); iVar5 = *GHIDRA_CAST((GHIDRA_CAST(costumesEnd) + -0xd8)); if (iVar5 != 0) { if (g_mainHeap == (void *)0x0) { @@ -3316,19 +3316,19 @@ void Entity_Player::constructor() (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::constructor(); local_14 = 0; *GHIDRA_CAST(this) = IsaacRepentancePlus::Entity_Player::vftable; - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::constructor(); + ANM2::constructor(&this->_bodySprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; - (GHIDRA_CAST((&this->_crownOfLightSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_crownOfLightSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; - (GHIDRA_CAST((&this->_darkPrincesCrownSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_darkPrincesCrownSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; _eh_vector_constructor_iterator_(this->_chargeBarSprites,0x114,7,ANM2::constructor,ANM2::~ANM2); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 4; - (GHIDRA_CAST((&this->_bloodGushSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_bloodGushSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 5; - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_heldSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_statusEffectSprite); (this->_costumeSpriteDescs)._begin = (void *)0x0; (this->_costumeSpriteDescs)._end = (void *)0x0; (this->_costumeSpriteDescs)._capacity = (void *)0x0; @@ -5711,7 +5711,7 @@ LAB_0075c397: pbVar14 = GHIDRA_CAST(0x0); local_cc = costumeSprite; do { - layer = (GHIDRA_CAST((local_dc)))->ANM2::GetLayer(pbVar14); + layer = ANM2::GetLayer(local_dc,pbVar14); pvVar10 = layer->_layerData; if (pvVar10 == (void *)0x0) { pbVar7 = &s_empty; @@ -5722,7 +5722,7 @@ LAB_0075c397: pbVar7 = *GHIDRA_CAST(pbVar7); } } - local_e4 = (GHIDRA_CAST((costumeSprite)))->ANM2::GetLayer(pbVar7); + local_e4 = ANM2::GetLayer(costumeSprite,pbVar7); if (local_e4 == GHIDRA_CAST(0x0)) { LAB_0075c5f9: } @@ -5892,7 +5892,7 @@ LAB_0075cac5: local_a2 = 0; local_a1 = 0; local_dc = GHIDRA_CAST(local_b0->_playerType); - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar10) + iVar13)))))->ANM2::GetLayer(pbVar14); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(pvVar10) + iVar13)),pbVar14); if (layer->_layerData == (void *)0x0) { tmpPath._capacity = 0xf; tmpPath._size = 0; @@ -5923,7 +5923,7 @@ LAB_0075cac5: Sprite::ReplaceSpritesheet (GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)),GHIDRA_INT(pbVar14),&skinPath); if ((local_a1 == 0) && (local_a9 != '\0')) { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)),pbVar14); fVar3 = fRam00c5d09c; fVar2 = fRam00c5d098; fVar8 = fRam00c5d094; @@ -5949,7 +5949,7 @@ LAB_0075cac5: local_80 = 0; uStack_7c = 0; local_78 = 0.0; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)),pbVar14); layerColor = &layer->_color; if (layerColor != GHIDRA_CAST(local_a0)) { layerColor->_tint[0] = 1.0; @@ -6010,7 +6010,7 @@ LAB_0075c9d3: do { local_a2 = 0; local_dc = GHIDRA_CAST(local_b0->_playerType); - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar10) + iVar13)))))->ANM2::GetLayer(pbVar14); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(pvVar10) + iVar13)),pbVar14); if (layer->_layerData == (void *)0x0) { tmpPath._capacity = 0xf; tmpPath._size = 0; @@ -6039,7 +6039,7 @@ LAB_0075c9d3: Sprite::ReplaceSpritesheet (GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)),GHIDRA_INT(pbVar14),&skinPath); if ((local_a2 == 0) && (local_a9 != '\0')) { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)),pbVar14); fVar3 = fRam00c5d09c; fVar2 = fRam00c5d098; fVar8 = fRam00c5d094; @@ -6065,7 +6065,7 @@ LAB_0075c9d3: local_80 = 0; uStack_7c = 0; local_78 = 0.0; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)))))->ANM2::GetLayer(pbVar14); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(costumeDescs->_begin) + iVar13)),pbVar14); layerColor = &layer->_color; if (layerColor != GHIDRA_CAST(local_a0)) { layerColor->_tint[0] = 1.0; @@ -6102,14 +6102,14 @@ LAB_0075cd12: *GHIDRA_CAST((GHIDRA_CAST(costumeDescs->_begin) + iVar13 + 0x124)) = puVar9; *GHIDRA_CAST((GHIDRA_INT((local_b0->_costumeSpriteDescs)._begin) + iVar13 + 300)) = local_b0->_playerType; costumeSprite = GHIDRA_CAST((GHIDRA_INT((local_b0->_costumeSpriteDescs)._begin) + iVar13)); - (GHIDRA_CAST((costumeSprite)))->ANM2::LoadGraphics((uint8_t)costumeSprite); + ANM2::LoadGraphics(costumeSprite,(uint8_t)costumeSprite); if ((local_bc != GHIDRA_CAST(0x0)) && (*local_bc != 0)) { pvVar10 = (playerAlias->_costumeSpriteDescs)._begin; if (local_b1 == 0) { costumeSprite = GHIDRA_CAST((iVar13 + GHIDRA_INT(pvVar10))); - bVar4 = (GHIDRA_CAST((costumeSprite)))->ANM2::SetAnimation(local_bc,1); + bVar4 = ANM2::SetAnimation(costumeSprite,local_bc,1); if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&costumeSprite->_animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_e4)), + (AnimationState::SetFrameFloat(&costumeSprite->_animState,(float)GHIDRA_INT(local_e4)), (costumeSprite->_animState)._animData != (void *)0x0)) { (costumeSprite->_animState)._isPlaying = 0; } @@ -6119,9 +6119,9 @@ LAB_0075cd12: pbVar14 = (costumeSprite->_animState)._animData; if (pbVar14 == GHIDRA_CAST(0x0)) { LAB_0075cd95: - bVar4 = (GHIDRA_CAST((costumeSprite)))->ANM2::SetAnimation(local_bc,1); + bVar4 = ANM2::SetAnimation(costumeSprite,local_bc,1); if (bVar4 != 0) { - (GHIDRA_CAST((&costumeSprite->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&costumeSprite->_animState); (costumeSprite->_animState)._isPlaying = 1; } } @@ -6188,7 +6188,7 @@ code_r0x0075cdcb: } uVar6 = uVar6 + 1; } while (uVar6 < 0xf); - (GHIDRA_CAST((&playerAlias->_sprite)))->ANM2::LoadGraphics(bVar4); + ANM2::LoadGraphics(&playerAlias->_sprite,bVar4); playerAlias = local_b0; } else { @@ -6297,7 +6297,7 @@ LAB_0075d0d4: puVar12 = extraout_ECX_03; } } - (GHIDRA_CAST((&playerAlias->_sprite)))->ANM2::LoadGraphics((uint8_t)puVar12); + ANM2::LoadGraphics(&playerAlias->_sprite,(uint8_t)puVar12); } playerAlias->_headColor = GHIDRA_INT(headColor); playerAlias->_bodyColor = GHIDRA_INT(bodyColor); @@ -6315,15 +6315,15 @@ LAB_0075d0d4: else { pcVar15 = "WalkDown"; } - bVar4 = (GHIDRA_CAST((costumeSprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar15),1); + bVar4 = ANM2::SetAnimation(costumeSprite,GHIDRA_CAST(pcVar15),1); if (((bVar4 != 0) && ((costumeSprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&costumeSprite->_animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&costumeSprite->_animState,0.0), (costumeSprite->_animState)._animData != (void *)0x0)) { (costumeSprite->_animState)._isPlaying = 0; } - pvVar10 = (GHIDRA_CAST((costumeSprite)))->ANM2::GetAnimationData(GHIDRA_CAST("SubAnim")); + pvVar10 = ANM2::GetAnimationData(costumeSprite,GHIDRA_CAST("SubAnim")); if (pvVar10 != (void *)0x0) { - (GHIDRA_CAST((costumeSprite)))->ANM2::PlayOverlay(GHIDRA_CAST("SubAnim"),0); + ANM2::PlayOverlay(costumeSprite,GHIDRA_CAST("SubAnim"),0); } } pbVar14 = pbVar14 + 0x10; @@ -6469,7 +6469,7 @@ void Entity_Player::AddCostume(ItemConfig_Item *collectibleID, uint8_t itemState } } } - (GHIDRA_CAST((&newCostume)))->ANM2::constructor(); + ANM2::constructor(&newCostume); local_5c = 0; local_58 = 0; local_54 = 0; @@ -6488,9 +6488,9 @@ void Entity_Player::AddCostume(ItemConfig_Item *collectibleID, uint8_t itemState *ppvVar1 = (void *)(GHIDRA_INT(*ppvVar1) + 0x130); } local_8 = (void *)0x2; - (GHIDRA_CAST((&newCostume)))->ANM2::Reset(); - (GHIDRA_CAST((&newCostume._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&newCostume._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&newCostume); + AnimationState::~AnimationState(&newCostume._overlayAnimState); + AnimationState::~AnimationState(&newCostume._animState); (GHIDRA_CAST((newCostume._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&newCostume))))->msvc::string::_Tidy_deallocate(); local_8 = (void *)0xffffffff; @@ -6514,7 +6514,7 @@ void Entity_Player::AddCostume(ItemConfig_Item *collectibleID, uint8_t itemState *piVar4 = *piVar4 + 3; } local_180 = GHIDRA_CAST((GHIDRA_INT((this->_costumeSpriteDescs)._end) + -0x130)); - (GHIDRA_CAST((local_180)))->ANM2::Load(&(collectibleID->costume).anm2Path,0); + ANM2::Load(local_180,&(collectibleID->costume).anm2Path,0); manager = g_manager; bVar2 = extraout_CL; if ((collectibleID->type == 0) && @@ -6534,14 +6534,14 @@ void Entity_Player::AddCostume(ItemConfig_Item *collectibleID, uint8_t itemState bVar2 = extraout_CL_00; } costumeSprite = local_180; - (GHIDRA_CAST((local_180)))->ANM2::LoadGraphics(bVar2); + ANM2::LoadGraphics(local_180,bVar2); local_180 = &this->_sprite; isHasHeadLayer = '\0'; costumeMapEntry = &this->_playerCostumeMap[0]._isBodyLayer; isHasBodyLayer = '\0'; layerId = GHIDRA_CAST(0x0); do { - layer = (GHIDRA_CAST((local_180)))->ANM2::GetLayer(layerId); + layer = ANM2::GetLayer(local_180,layerId); pvVar5 = layer->_layerData; if (pvVar5 == (void *)0x0) { layerName = &s_empty; @@ -6552,7 +6552,7 @@ void Entity_Player::AddCostume(ItemConfig_Item *collectibleID, uint8_t itemState layerName = *GHIDRA_CAST(layerName); } } - layer = (GHIDRA_CAST((costumeSprite)))->ANM2::GetLayer(layerName); + layer = ANM2::GetLayer(costumeSprite,layerName); if (layer != GHIDRA_CAST(0x0)) { if (*costumeMapEntry == 0) { isHasHeadLayer = '\x01'; @@ -6714,7 +6714,7 @@ void Entity_Player::ClearQueueItem() isHoldingItem = IsHoldingItem(this); if (isHoldingItem != 0) { - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_heldSprite); } (this->_queuedItem)._item = (void *)0x0; (this->_queuedItem)._charge = 0; @@ -10300,8 +10300,8 @@ LAB_0076aac4: } bVar2 = IsHologram(pEVar33); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&pEVar33->_tearColor))))->Font::SetLineHeightModifier(0.2); - (GHIDRA_CAST((GHIDRA_CAST(&pEVar33->_laserColor))))->Font::SetLineHeightModifier(0.2); + Font::SetLineHeightModifier(GHIDRA_CAST(&pEVar33->_tearColor),0.2); + Font::SetLineHeightModifier(GHIDRA_CAST(&pEVar33->_laserColor),0.2); } (GHIDRA_CAST((g_luaEngine)))->LuaEngine::EvaluateItems(pEVar33,0x40); cVar3 = (char)pEVar33->_cacheFlags; @@ -14996,7 +14996,7 @@ void Entity_Player::update_shooting() } else if (isInputAllowed != '\0') { if ((((this->_isPlayingExtraAnimation == 0) && (this->_isPlayingItemAnimation == 0)) || - (bVar4 = (GHIDRA_CAST((&this->_bodySprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST("LiftItem")), bVar4 != 0)) && + (bVar4 = ANM2::IsFinishedImpl(&this->_bodySprite,GHIDRA_CAST("LiftItem")), bVar4 != 0)) && ((((this->_entityCollisionClass != 0 || (this->_suplexState == 2)) || ((this->_isCoopGhost != 0 || (((this->_flags & 0x200000000000000) != 0 || @@ -15976,7 +15976,7 @@ LAB_0077cde3: } entityColor = GHIDRA_CAST((GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1428)))))))->Entity)::GetColor(); (GHIDRA_CAST((GHIDRA_CAST(local_70))))->Color::operator_assign(entityColor); - (GHIDRA_CAST((GHIDRA_CAST(local_70))))->Font::SetLineHeightModifier(local_2bc.y); + Font::SetLineHeightModifier(GHIDRA_CAST(local_70),local_2bc.y); (**(code **)(**GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1428)))) + 0x3c))(local_70,0xffffffff,0xff,0,1); } } @@ -16364,7 +16364,7 @@ switchD_0077e14f_caseD_2a: local_2b0.y = (float)effect; fVar24 = (GHIDRA_CAST((GHIDRA_CAST(local_70))))->Color::A(); effect = GHIDRA_CAST(local_2b0.y); - (GHIDRA_CAST((GHIDRA_CAST(local_70))))->Font::SetLineHeightModifier(fVar24 * local_2b0.y); + Font::SetLineHeightModifier(GHIDRA_CAST(local_70),fVar24 * local_2b0.y); pEVar16->SetColor(local_70,0xffffffff,0xff,0,1); } pEVar16->Update(); @@ -16415,7 +16415,7 @@ LAB_0077e64e: local_2ec.y = (float)effect; fVar24 = (GHIDRA_CAST((GHIDRA_CAST(local_70))))->Color::A(); effect = GHIDRA_CAST(local_2ec.y); - (GHIDRA_CAST((GHIDRA_CAST(local_70))))->Font::SetLineHeightModifier(fVar24 * local_2ec.y); + Font::SetLineHeightModifier(GHIDRA_CAST(local_70),fVar24 * local_2ec.y); tmpEntity->SetColor(local_70,0xffffffff,0xff,0,1); } tmpEntity->Update(); @@ -16567,7 +16567,7 @@ switchD_0077e14f_caseD_1: SoundEffects::PlayWithFartOverride(0x344,1.0,2,0,1.0); this->_blinkTime = 0xf; DischargeActiveItem(this,0,0); - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_heldSprite); itemConfig = Isaac::GetItemConfig(); nullItem = (GHIDRA_CAST((itemConfig)))->Config::GetNullItem(0x1e); RemoveCostume(this,nullItem); @@ -16731,7 +16731,7 @@ LAB_0077f304: (this->_heldEntity != (void *)0x0)) { PlayExtraAnimation(this,GHIDRA_CAST("LiftItem")); (GHIDRA_CAST((GHIDRA_CAST(&this->_bodySprite))))->Sprite::SetLastFrame(); - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_heldSprite); } } else { @@ -16765,7 +16765,7 @@ LAB_0077f3b7: local_2b0.y = 1.2; (GHIDRA_CAST((&local_290)))->Vector::operator_mul_assign(&local_2b0.y); ThrowHeldEntity(this,&local_290); - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_heldSprite); this->_blinkTime = 1; this->_itemStateCooldown = 5; PlayExtraAnimation(this,GHIDRA_CAST("HideItem")); @@ -16776,7 +16776,7 @@ LAB_0077f3b7: } } if (this->_itemStateCooldown == 0) { - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_heldSprite); this->_itemStateCooldown = 5; goto LAB_0077ed7e; } @@ -17043,7 +17043,7 @@ LAB_0077ff13: (GHIDRA_CAST((local_70 + 0x14)))->msvc::string::_Tidy_deallocate(); } if (local_286 == '\0') { - (GHIDRA_CAST((GHIDRA_CAST(this_04))))->ANM2::SetFrame(&this->_headAnim,local_2dc); + ANM2::SetFrame(GHIDRA_CAST(this_04),&this->_headAnim,local_2dc); } else { animString = GHIDRA_CAST(FUN_00421620("_Idle")); @@ -17100,7 +17100,7 @@ LAB_0077ff13: ppvVar17 = ppvVar17 + 1; local_2f8 = ppvVar17; } while (uVar9 < 4); - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(&this->_headAnim,local_2dc); + ANM2::SetFrame(&this->_sprite,&this->_headAnim,local_2dc); } } LAB_007800b3: @@ -18428,7 +18428,7 @@ void Entity_Player::Update() iVar6 = EntityPtr::Ref(); *GHIDRA_CAST((iVar6 + 0x410)) = 1; iVar6 = EntityPtr::Ref(); - (GHIDRA_CAST((GHIDRA_CAST((iVar6 + 0x41c)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((iVar6 + 0x41c))); iVar6 = EntityPtr::Ref(); *GHIDRA_CAST((iVar6 + 0x139a)) = 0; iVar6 = EntityPtr::Ref(); @@ -18464,7 +18464,7 @@ void Entity_Player::Update() ExceptionList = local_10; return; } - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Update(); + ANM2::Update(&this->_bodySprite); ExceptionList = local_10; return; } @@ -18863,7 +18863,7 @@ joined_r0x00783ce0: (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Update(); bVar3 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::HasEntityFlags(0x4000); if (bVar3 == 0) { - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Update(); + ANM2::Update(&this->_bodySprite); bVar3 = (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::IsEventTriggered(&DAT_00b64ba4); if (bVar3 != 0) { uVar29 = Random(); @@ -18911,13 +18911,13 @@ joined_r0x00783ce0: } } if ((this->_isPlayingExtraAnimation != 0) && - (bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar3 != 0)) { + (bVar3 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty), bVar3 != 0)) { this->_isPlayingExtraAnimation = 0; } (GHIDRA_CAST((g_game)))->Game::GetField26614(); cVar4 = DeathmatchManager::is_active(); if ((cVar4 != '\0') && - (bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST("LightTravel")), bVar3 != 0)) { + (bVar3 = ANM2::IsFinishedImpl(&this->_sprite,GHIDRA_CAST("LightTravel")), bVar3 != 0)) { FUN_0044bf90(); } if ((this->_isHurtPending != 0) && (this->_isPlayingExtraAnimation == 0)) { @@ -19046,11 +19046,11 @@ LAB_0078439a: } LAB_007845eb: if (((this->_isPlayingItemAnimation != 0) && - (bVar3 = (GHIDRA_CAST((&this->_bodySprite)))->ANM2::IsFinishedImpl(&s_empty), bVar3 != 0)) && - (bVar3 = (GHIDRA_CAST((&this->_bodySprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST("LiftItem")), bVar3 == 0)) { + (bVar3 = ANM2::IsFinishedImpl(&this->_bodySprite,&s_empty), bVar3 != 0)) && + (bVar3 = ANM2::IsFinishedImpl(&this->_bodySprite,GHIDRA_CAST("LiftItem")), bVar3 == 0)) { this->_isPlayingItemAnimation = 0; - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_bodySprite); + ANM2::Reset(&this->_heldSprite); } update_pitfall(this); bVar3 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::HasEntityFlags(0x4000); @@ -19617,10 +19617,10 @@ LAB_00785915: bVar3 = (GHIDRA_CAST((this->_heldEntity)))->Entity::is_player(); if (bVar3 != 0) { pvVar15 = this->_heldEntity; - layerFrame = (GHIDRA_CAST((&this->_bodySprite)))->ANM2::GetLayerFrame(0); + layerFrame = ANM2::GetLayerFrame(&this->_bodySprite,0); if ((layerFrame != (void *)0x0) || ((1 < this->_suplexState && - (layerFrame = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayerFrame(0), layerFrame != (void *)0x0)))) { + (layerFrame = ANM2::GetLayerFrame(&this->_sprite,0), layerFrame != (void *)0x0)))) { FUN_0067f2e0(); *GHIDRA_CAST((GHIDRA_CAST(pvVar15) + 0x350)) = local_16c.y * (this->_playerSpriteScale).y; } @@ -19993,18 +19993,18 @@ LAB_00785d5e: } bVar3 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::HasEntityFlags(0x4000); if (bVar3 == 0) { - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Update(); - (GHIDRA_CAST((&this->_crownOfLightSprite)))->ANM2::Update(); - (GHIDRA_CAST((&this->_darkPrincesCrownSprite)))->ANM2::Update(); + ANM2::Update(&this->_heldSprite); + ANM2::Update(&this->_crownOfLightSprite); + ANM2::Update(&this->_darkPrincesCrownSprite); pAVar19 = this->_chargeBarSprites; iVar6 = 7; do { - (GHIDRA_CAST((pAVar19)))->ANM2::Update(); + ANM2::Update(pAVar19); this = player; pAVar19 = pAVar19 + 1; iVar6 = iVar6 + -1; } while (iVar6 != 0); - (GHIDRA_CAST((&player->_bloodGushSprite)))->ANM2::Update(); + ANM2::Update(&player->_bloodGushSprite); } local_120 = GHIDRA_CAST(&this->_sprite); vecResult = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(local_120))))->Sprite)::Scale(); @@ -20020,7 +20020,7 @@ LAB_00785d5e: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetScale(&this->_playerSpriteScale); cVar4 = (GHIDRA_CAST((GHIDRA_CAST(&this->_bodySprite))))->Sprite::IsLoaded(); if ((cVar4 != '\0') && - ((bVar3 = (GHIDRA_CAST((&this->_bodySprite)))->ANM2::IsPlaying(&s_empty), bVar3 != 0 && + ((bVar3 = ANM2::IsPlaying(&this->_bodySprite,&s_empty), bVar3 != 0 && (pvVar15 = (GHIDRA_CAST((GHIDRA_CAST(&this->_bodySprite))))->Sprite::GetNullFrame(GHIDRA_CAST("ItemWalk")), pvVar15 != (void *)0x0)))) { vecResult = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Scale(); @@ -20038,7 +20038,7 @@ LAB_00785d5e: cVar4 = FUN_004073a0(); if (cVar4 == '\0') { animState = GHIDRA_CAST(Config)::GetPillEffects(); - pvVar15 = (GHIDRA_CAST((animState)))->AnimationState::GetLayerFrame(this->_playerCostumeMap[4]._layerID); + pvVar15 = AnimationState::GetLayerFrame(animState,this->_playerCostumeMap[4]._layerID); if (pvVar15 != (void *)0x0) { spawnedEffect = *GHIDRA_CAST((GHIDRA_CAST(pvVar15) + 0x1c)); Math::abs(); @@ -20282,7 +20282,7 @@ LAB_00786ffb: if ((this->_isPlayingExtraAnimation == 0) && (this->_isPlayingItemAnimation == 0)) { cVar4 = FUN_0040aa70(); if (cVar4 != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(fVar30))))->ANM2::PlayOverlay(GHIDRA_CAST("Pulse"),1); + ANM2::PlayOverlay(GHIDRA_CAST(fVar30),GHIDRA_CAST("Pulse"),1); pBVar12 = GHIDRA_CAST(local_24); uVar28 = 0x7876a1; pBVar31 = GetBombFlags(this,pBVar12,0); @@ -20331,13 +20331,13 @@ LAB_00786ffb: } } else { - (GHIDRA_CAST((GHIDRA_CAST(local_144.y))))->ANM2::PlayOverlay(GHIDRA_CAST("Pulse"),0); + ANM2::PlayOverlay(GHIDRA_CAST(local_144.y),GHIDRA_CAST("Pulse"),0); } FUN_0041e470(); cVar4 = FUN_004073a0(); if (cVar4 == '\0') { animState = GHIDRA_CAST(FUN_0041e470()); - vecResult = (GHIDRA_CAST((animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("HeadAnim")); + vecResult = AnimationState::GetNullFrame(animState,GHIDRA_CAST("HeadAnim")); if (vecResult != GHIDRA_CAST(0x0)) { FUN_00a10570(); (GHIDRA_CAST((&local_174)))->Vector::operator_add_assign(vecResult); @@ -20373,9 +20373,9 @@ LAB_0078784d: FUN_00925df0(); local_150.y = (float)BVar25._l; fVar30 = ::(GHIDRA_CAST((GHIDRA_CAST(local_f0))))->Color::A(); - (GHIDRA_CAST((GHIDRA_CAST(local_f0))))->Font::SetLineHeightModifier(fVar30 * local_150.y); + Font::SetLineHeightModifier(GHIDRA_CAST(local_f0),fVar30 * local_150.y); fVar30 = ::(GHIDRA_CAST((GHIDRA_CAST(local_98))))->Color::A(); - (GHIDRA_CAST((GHIDRA_CAST(local_98))))->Font::SetLineHeightModifier(fVar30 * local_150.y); + Font::SetLineHeightModifier(GHIDRA_CAST(local_98),fVar30 * local_150.y); } if (this->_isPlayingExtraAnimation == 0) { LAB_00787961: @@ -20518,12 +20518,12 @@ LAB_00787c20: tmpEntity = GHIDRA_CAST(FUN_005cbd10()); local_13c.y = (float)tmpEntity; (GHIDRA_CAST((tmpEntity)))->Entity::AddFlagsLow(); - (GHIDRA_CAST((GHIDRA_CAST(tmpEntity))))->ANM2::Update(); + ANM2::Update(GHIDRA_CAST(tmpEntity)); FUN_0041e470(); cVar4 = FUN_004073a0(); if (cVar4 == '\0') { pAVar19 = GHIDRA_CAST(FUN_0041e470()); - (GHIDRA_CAST((pAVar19)))->ANM2::GetAnimation(GHIDRA_CAST((local_68 + 0x10))); + ANM2::GetAnimation(pAVar19,GHIDRA_CAST((local_68 + 0x10))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 8; local_15c = GHIDRA_CAST((GHIDRA_UINT(local_15c) | 1)); local_158.y = (float)local_15c; @@ -20550,7 +20550,7 @@ LAB_00787ec4: if (iVar6 != 0) { do { animState = GHIDRA_CAST(FUN_0041e470()); - tmpEntity = (GHIDRA_CAST((animState)))->AnimationState::GetLayerFrame(GHIDRA_INT(pbVar16)); + tmpEntity = AnimationState::GetLayerFrame(animState,GHIDRA_INT(pbVar16)); local_13c.y = (float)tmpEntity; if (tmpEntity != GHIDRA_CAST(0x0)) { layer = (GHIDRA_CAST((GHIDRA_CAST(fVar30))))->Sprite::GetLayer(pbVar16); @@ -20631,11 +20631,11 @@ LAB_00787ec4: iVar6 = (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::GetIntervalTicks(2.0,0.0); if (iVar6 != 0) { (GHIDRA_CAST((&this->_pos)))->Vector::__add(&local_16c,&this->_posOffset); - local_13c.y = (float)(GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("extra")); + local_13c.y = (float)ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("extra")); if (GHIDRA_CAST(local_13c.y) != GHIDRA_CAST(0x0)) { animState = GHIDRA_CAST(Config)::GetPillEffects(); iVar6 = _ptr_deref_or_minus1(); - pvVar15 = (GHIDRA_CAST((animState)))->AnimationState::GetLayerFrame(iVar6); + pvVar15 = AnimationState::GetLayerFrame(animState,iVar6); if (pvVar15 != (void *)0x0) { vecResult = GHIDRA_CAST(FUN_0067f2e0()); vecResult2 = (GHIDRA_CAST((GHIDRA_CAST(&local_1a0._h))))->Vector::Vector(0.0,-10.0); @@ -20853,7 +20853,7 @@ LAB_00788a4d: local_129 = 0; } else { - local_150.y = (float)(GHIDRA_CAST((&this->_bodySprite)))->ANM2::GetLayerFrame(0); + local_150.y = (float)ANM2::GetLayerFrame(&this->_bodySprite,0); if (GHIDRA_CAST(local_150.y) != GHIDRA_CAST(0x0)) { local_122 = ((GHIDRA_CAST(local_150.y))->_spriteSheetPath)._buf[4]; pbVar16 = GHIDRA_CAST(0x0); @@ -20961,7 +20961,7 @@ LAB_00788e85: local_144.y = (float)walkAnim; } if (((this->_variant == 0) && (this->_isCoopGhost == 0)) && (local_121 != '\0')) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(local_144.y),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(local_144.y),0); } local_148 = GHIDRA_CAST(&this->_playerCostumeMap[0]._isBodyLayer); local_120 = GHIDRA_CAST(&DAT_0000000f); @@ -20979,7 +20979,7 @@ LAB_00788e85: ((bVar3 = (GHIDRA_CAST((*(void **)pAVar19[1]._filename._buf)))->Item::IsNull(), bVar3 != 0 && (*GHIDRA_CAST((*GHIDRA_CAST(pAVar19[1]._filename._buf) + 4)) == 0x5a)))) { if ((pAVar19[1]._filename._buf[8] == '\0') && - ((GHIDRA_CAST((pAVar19)))->ANM2::Play(GHIDRA_CAST(local_144.y),0), pAVar19[1]._filename._buf[10] != '\0')) + (ANM2::Play(pAVar19,GHIDRA_CAST(local_144.y),0), pAVar19[1]._filename._buf[10] != '\0')) { (GHIDRA_CAST((tmpString)))->msvc::string::string_from_cstr(GHIDRA_CAST(local_144.y)); local_8 = 0x11; @@ -21002,10 +21002,10 @@ LAB_00788e85: else { if (((this->_variant == 0) && (this->_isCoopGhost == 0)) && (local_121 != '\0')) { if ((local_12a == 0) || (this->_playerType == 0x23)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(local_148,0); + ANM2::SetFrame(&this->_sprite,local_148,0); } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(local_148),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(local_148),0); } } local_130 = GHIDRA_CAST(&this->_playerCostumeMap[0]._isBodyLayer); @@ -21025,7 +21025,7 @@ LAB_00788e85: (*GHIDRA_CAST((*GHIDRA_CAST(pAVar19[1]._filename._buf) + 4)) == 0x5a)))) { piVar14 = *GHIDRA_CAST(pAVar19[1]._filename._buf); if ((*piVar14 == 3) && (piVar14[1] == 0x271)) { - (GHIDRA_CAST((pAVar19)))->ANM2::SetFrame(GHIDRA_CAST("WalkIdle"),0); + ANM2::SetFrame(pAVar19,GHIDRA_CAST("WalkIdle"),0); } else { if (local_12a == 0) { @@ -21036,7 +21036,7 @@ LAB_00788e85: (GHIDRA_CAST((tmpString)))->msvc::string::_Tidy_deallocate(); iVar6 = FUN_0040bcb0(); if (iVar6 == 0) { - (GHIDRA_CAST((pAVar19)))->ANM2::SetFrame(local_148,0); + ANM2::SetFrame(pAVar19,local_148,0); } else { (GHIDRA_CAST((GHIDRA_CAST(pAVar19))))->Sprite::Play(GHIDRA_CAST((local_68 + 0x10)),0); @@ -21045,7 +21045,7 @@ LAB_00788e85: (GHIDRA_CAST((local_68 + 0x10)))->msvc::string::_Tidy_deallocate(); } else { - (GHIDRA_CAST((pAVar19)))->ANM2::Play(GHIDRA_CAST(local_148),0); + ANM2::Play(pAVar19,GHIDRA_CAST(local_148),0); } if (pAVar19[1]._filename._buf[10] != '\0') { (GHIDRA_CAST((tmpString)))->msvc::string::string_from_cstr(GHIDRA_CAST(local_148)); @@ -21053,7 +21053,7 @@ LAB_00788e85: local_8 = 0xf; anim = GHIDRA_CAST(FUN_0060c790()); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x10; - (GHIDRA_CAST((pAVar19)))->ANM2::SetFrame(anim,0); + ANM2::SetFrame(pAVar19,anim,0); } else { local_8 = 0xd; @@ -21080,7 +21080,7 @@ LAB_00788e85: (*GHIDRA_CAST((GHIDRA_CAST(&(BVar25)) + 0x0))) = ZEXT812(0x3f800000); (*GHIDRA_CAST((GHIDRA_CAST(&(BVar25._h)) + 0x4))) = 0; local_144.y = (float)BVar25._l; - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(&s_empty); + bVar3 = ANM2::IsPlaying(&this->_sprite,&s_empty); if (bVar3 == 0) { fVar30 = local_144.y; } @@ -21284,7 +21284,7 @@ LAB_007895db: (GHIDRA_CAST((&this->_temporaryeffects)))->TemporaryEffects::AddTrinketEffect(0x17,1,1); } ThrowHeldEntity(this,&g_vectorZero); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("ghost")); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("ghost")); if (layer != GHIDRA_CAST(0x0)) { layer->_visible = 1; } @@ -21360,16 +21360,16 @@ LAB_007897da: iVar6 = 9; } if ((((this->_activeDesc[0]._item == 0x28d) && - (bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(&s_empty), bVar3 != 0)) && + (bVar3 = ANM2::IsPlaying(&this->_sprite,&s_empty), bVar3 != 0)) && (bVar3 = input_is_action_triggered(g_manager,iVar6,this->_controllerIndex,GHIDRA_CAST(0x0),0), bVar3 != 0)) && - (((local_158.y = (float)(GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("ghost")), + (((local_158.y = (float)ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("ghost")), GHIDRA_CAST(local_158.y) != GHIDRA_CAST(0x0) && (*GHIDRA_CAST(local_158.y) != 0)) && ((char)((GHIDRA_CAST(local_158.y))->_sprite)._animDefaultName._capacity != '\0')))) { (GHIDRA_CAST((GHIDRA_CAST(&local_16c))))->EntityPtr::clear(); animState = GHIDRA_CAST(Config)::GetPillEffects(); iVar6 = _ptr_deref_or_minus1(); - local_13c.y = (float)(GHIDRA_CAST((animState)))->AnimationState::GetLayerFrame(iVar6); + local_13c.y = (float)AnimationState::GetLayerFrame(animState,iVar6); if ((GHIDRA_CAST(local_13c.y) != GHIDRA_CAST(0x0)) && ((char)(GHIDRA_CAST(local_13c.y))->_variant != '\0')) { gridEntity = GHIDRA_CAST(Config)::GetPillEffects(); @@ -21411,8 +21411,8 @@ LAB_007897da: pAVar19 = &this->_sprite; local_190.y = (float)pAVar19; if (this->_playerType == 0x23) { - bVar3 = (GHIDRA_CAST((pAVar19)))->ANM2::IsPlaying(GHIDRA_CAST(local_144.y)); - if ((bVar3 != 0) && (iVar6 = (GHIDRA_CAST((pAVar19)))->ANM2::GetFrame(), iVar6 == 0x13)) { + bVar3 = ANM2::IsPlaying(pAVar19,GHIDRA_CAST(local_144.y)); + if ((bVar3 != 0) && (iVar6 = ANM2::GetFrame(pAVar19), iVar6 == 0x13)) { FUN_0042a020(); FUN_0069d9d0(); FUN_0069d9d0(); @@ -21440,7 +21440,7 @@ LAB_00789f05: } } else { - bVar3 = (GHIDRA_CAST((pAVar19)))->ANM2::IsPlaying(GHIDRA_CAST(local_144.y)); + bVar3 = ANM2::IsPlaying(pAVar19,GHIDRA_CAST(local_144.y)); if ((bVar3 != 0) && (bVar3 = (GHIDRA_CAST((GHIDRA_CAST(pAVar19))))->Sprite::IsEventTriggered("DeathSound"), bVar3 != 0)) { bVar3 = IsHologram(this); @@ -21513,16 +21513,16 @@ LAB_00789f05: } } if ((local_12a == 0) && - (((bVar3 = (GHIDRA_CAST((pAVar19)))->ANM2::IsPlaying(GHIDRA_CAST(local_144.y)), bVar3 != 0 && - ((iVar6 = (GHIDRA_CAST((pAVar19)))->ANM2::GetFrame(), 7 < iVar6 || (this->_playerType == 0x23)))) || - (bVar3 = (GHIDRA_CAST((pAVar19)))->ANM2::IsFinishedImpl(&s_empty), bVar3 != 0)))) { + (((bVar3 = ANM2::IsPlaying(pAVar19,GHIDRA_CAST(local_144.y)), bVar3 != 0 && + ((iVar6 = ANM2::GetFrame(pAVar19), 7 < iVar6 || (this->_playerType == 0x23)))) || + (bVar3 = ANM2::IsFinishedImpl(pAVar19,&s_empty), bVar3 != 0)))) { local_158.y = (float)&this->_twinPlayer; iVar6 = EntityPtr::Ref(); if ((iVar6 != 0) && (iVar6 = EntityPtr::Ref(), *GHIDRA_CAST((iVar6 + 0x173)) == '\0')) { iVar6 = EntityPtr::Ref(); activeDesc = GHIDRA_CAST(EntityPtr)::Ref(); pbVar16 = GetDeathAnimName(activeDesc); - bVar3 = (GHIDRA_CAST((GHIDRA_CAST((iVar6 + 0x48)))))->ANM2::IsPlaying(pbVar16); + bVar3 = ANM2::IsPlaying(GHIDRA_CAST((iVar6 + 0x48)),pbVar16); if (bVar3 == 0) { playerManager = GHIDRA_CAST((GHIDRA_CAST((g_game)))->Game)::GetPlayerManager(); bVar3 = (GHIDRA_CAST((playerManager)))->PlayerManager::IsCoopPlay(); @@ -21559,7 +21559,7 @@ LAB_00789f05: } } } - bVar3 = (GHIDRA_CAST((GHIDRA_CAST(local_190.y))))->ANM2::IsFinishedImpl(GHIDRA_CAST(local_144.y)); + bVar3 = ANM2::IsFinishedImpl(GHIDRA_CAST(local_190.y),GHIDRA_CAST(local_144.y)); this = player; if (bVar3 != 0) { player->_visible = 0; @@ -21992,15 +21992,15 @@ LAB_0078af55: if (cVar4 == '\0') { (GHIDRA_CAST((local_68 + 0x10)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/StatusEffects.anm2")); local_8 = 0x16; - (GHIDRA_CAST((pAVar19)))->ANM2::Load(GHIDRA_CAST((local_68 + 0x10)),1); + ANM2::Load(pAVar19,GHIDRA_CAST((local_68 + 0x10)),1); local_8 = 0xffffffff; (GHIDRA_CAST((local_68 + 0x10)))->msvc::string::_Tidy_deallocate(); } - bVar3 = (GHIDRA_CAST((pAVar19)))->ANM2::IsPlaying(&s_empty); + bVar3 = ANM2::IsPlaying(pAVar19,&s_empty); if (bVar3 != 0) { - (GHIDRA_CAST((pAVar19)))->ANM2::Update(); + ANM2::Update(pAVar19); } - (GHIDRA_CAST((pAVar19)))->ANM2::Play(GHIDRA_CAST(local_15c),0); + ANM2::Play(pAVar19,GHIDRA_CAST(local_15c),0); } Config::GetPillEffects(); local_13c.y = (float)FUN_0040bc90(); @@ -22013,7 +22013,7 @@ LAB_0078af55: local_120 = GHIDRA_CAST(FUN_0040bc90()); } (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::GetOverlayFrame(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + ANM2::GetFrame(&this->_sprite); FUN_00753830(); FUN_00839840(); cVar4 = Level::IsAltStage(); @@ -22291,14 +22291,14 @@ void Entity_Player::Render(Vector *offset) if ((this->_bodySprite)._animState._animData == (void *)0x0) { LAB_0078ced5: if (1 < this->_suplexState) { - pfVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayerFrame(0); + pfVar3 = ANM2::GetLayerFrame(&this->_sprite,0); uVar6 = extraout_EDX_00; if (pfVar3 != GHIDRA_CAST(0x0)) goto LAB_0078cef6; } isHolding = '\0'; goto LAB_0078d290; } - pfVar3 = (GHIDRA_CAST((&(this->_bodySprite)._animState)))->AnimationState::GetNullFrameById(0); + pfVar3 = AnimationState::GetNullFrameById(&(this->_bodySprite)._animState,0); uVar6 = extraout_EDX; if (pfVar3 == GHIDRA_CAST(0x0)) goto LAB_0078ced5; LAB_0078cef6: @@ -22317,7 +22317,8 @@ LAB_0078cef6: if (*GHIDRA_CAST((GHIDRA_CAST(local_50.y) + 0x1c)) != 0) { iVar7 = 0; do { - local_48.y = (float)(GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this->_heldEntity) + 0x48)))))->ANM2::GetLayer(*GHIDRA_CAST((iVar7 + *GHIDRA_CAST((GHIDRA_CAST(local_50.y) + 0x18)) + local_48.y = (float)ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this->_heldEntity) + 0x48)), + *GHIDRA_CAST((iVar7 + *GHIDRA_CAST((GHIDRA_CAST(local_50.y) + 0x18)) ))); pvVar4 = AnimationState::GetLayerFrame (GHIDRA_CAST((GHIDRA_INT(this->_heldEntity) + 0x78)), @@ -22584,7 +22585,7 @@ LAB_0078d290: (this->_statusEffectSprite)._scale.x = fVar11; local_50.x = fVar9 * 0.0 + (this->_renderPosition).x; local_50.y = fVar9 * -35.0 + (this->_renderPosition).y; - (GHIDRA_CAST((&this->_statusEffectSprite)))->ANM2::Render(&local_50,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_statusEffectSprite,&local_50,&g_vectorZero,&g_vectorZero); (this->_statusEffectSprite)._color._tint[3] = local_48.y; } } @@ -22626,7 +22627,7 @@ LAB_0078d290: drawColor._green = 0.6; drawColor._blue = 0.6; drawColor._alpha = 1.0; - (GHIDRA_CAST((&g_manager->_font6_PFTempestaSevenCondensed)))->Font::DrawString(&DAT_00b6b080,&drawColor, + Font::DrawString(&g_manager->_font6_PFTempestaSevenCondensed,&DAT_00b6b080,&drawColor, tmpColor._colorize,(float)local_8c + offset->x + 0.0, (local_48.y / local_50.y + offset->y) - 40.0); LAB_0078dbfd: @@ -22665,14 +22666,14 @@ void Entity_Player::RenderGlow(Vector *position) if (bVar1 == 0) { costumeIdx = this->_playerCostumeMap[0]._index; if (costumeIdx < 0) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); savedAlpha = (layer->_color)._tint[3]; if (g_manager->_netplayManager != *GHIDRA_CAST((g_manager + 1))) { alphaCopy = savedAlpha; bVar1 = NetplayManager::IsIdxLocalPlayer (GHIDRA_CAST(&g_manager->_netplayManager),this->_controllerIndex); if (bVar1 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); FUN_00925df0(); *GHIDRA_CAST((extraout_EDX_00 + 0x54)) = alphaCopy * savedAlpha; } @@ -22682,16 +22683,17 @@ void Entity_Player::RenderGlow(Vector *position) glowSprite = &this->_sprite; } else { - layer = (GHIDRA_CAST((GHIDRA_CAST((costumeIdx * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin) - )))))->ANM2::GetLayer(GHIDRA_CAST(this->_playerCostumeMap[0]._layerID)); + layer = ANM2::GetLayer(GHIDRA_CAST((costumeIdx * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin) + )),GHIDRA_CAST(this->_playerCostumeMap[0]._layerID)); savedAlpha = (layer->_color)._tint[3]; if (g_manager->_netplayManager != *GHIDRA_CAST((g_manager + 1))) { alphaCopy = savedAlpha; bVar1 = NetplayManager::IsIdxLocalPlayer (GHIDRA_CAST(&g_manager->_netplayManager),this->_controllerIndex); if (bVar1 == 0) { - (GHIDRA_CAST((GHIDRA_CAST((this->_playerCostumeMap[0]._index * 0x130 + - GHIDRA_INT((this->_costumeSpriteDescs)._begin))))))->ANM2::GetLayer(GHIDRA_CAST(this->_playerCostumeMap[0]._layerID)); + ANM2::GetLayer(GHIDRA_CAST((this->_playerCostumeMap[0]._index * 0x130 + + GHIDRA_INT((this->_costumeSpriteDescs)._begin))), + GHIDRA_CAST(this->_playerCostumeMap[0]._layerID)); FUN_00925df0(); *GHIDRA_CAST((extraout_EDX + 0x54)) = alphaCopy * savedAlpha; } @@ -22703,7 +22705,7 @@ void Entity_Player::RenderGlow(Vector *position) glowSprite = GHIDRA_CAST((this->_playerCostumeMap[0]._index * 0x130 + GHIDRA_INT((this->_costumeSpriteDescs)._begin))); } - layer = (GHIDRA_CAST((glowSprite)))->ANM2::GetLayer(layerName); + layer = ANM2::GetLayer(glowSprite,layerName); (layer->_color)._tint[3] = savedAlpha; } } @@ -23801,7 +23803,7 @@ LAB_00791ff1: } *GHIDRA_CAST(local_54) = this; msvc::multiset::insert(local_54); - (GHIDRA_CAST((GHIDRA_CAST((*breathEffectSlot + 0x48)))))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(GHIDRA_CAST((*breathEffectSlot + 0x48)),GHIDRA_CAST("Appear"),0); bVar2 = HasCollectible(this,0x3b,0); if (bVar2 != 0) { local_40 = 0x3f800000; @@ -25124,7 +25126,7 @@ void Entity_Player::update_effects() savedPlayer = this; puVar10 = local_78 + 0x74; if (this->_isPlayingExtraAnimation != 0) { - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Trapdoor")); + bVar2 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("Trapdoor")); puVar10 = puStack_20; if (bVar2 != 0) { ExceptionList = local_1c; @@ -25977,7 +25979,7 @@ LAB_00796ab9: FUN_007cf940(); local_a08 = GHIDRA_CAST(flags_01._l); fVar11 = (GHIDRA_CAST((&tearColorCopy)))->Color::A(); - (GHIDRA_CAST((GHIDRA_CAST(&tearColorCopy))))->Font::SetLineHeightModifier(fVar11 * (float)local_a08); + Font::SetLineHeightModifier(GHIDRA_CAST(&tearColorCopy),fVar11 * (float)local_a08); in_stack_ffffe840 = GHIDRA_CAST(&tearColorCopy); queryList->SetColor(); in_stack_ffffe82c = 0x796c1d; @@ -26511,7 +26513,7 @@ LAB_00797b3b: (GHIDRA_CAST((&pEVar23->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1ba,1,1); pcVar40 = "FloatGlow"; LAB_00797c41: - (GHIDRA_CAST((&pEVar23->_darkPrincesCrownSprite)))->ANM2::Play(GHIDRA_CAST(pcVar40),0); + ANM2::Play(&pEVar23->_darkPrincesCrownSprite,GHIDRA_CAST(pcVar40),0); } } bVar2 = HasCollectible(pEVar23,0x19f,0); @@ -27326,7 +27328,7 @@ LAB_00799548: BVar35 = (BitSet128)ZEXT816(0); } LAB_00799685: - (GHIDRA_CAST((GHIDRA_CAST(pEVar8))))->Font::SetLineHeightModifier((float)BVar35._l); + Font::SetLineHeightModifier(GHIDRA_CAST(pEVar8),(float)BVar35._l); FUN_00435d90(); pvVar28 = (GHIDRA_CAST((&pEVar23->_temporaryeffects)))->TemporaryEffects::GetNullEffect(0x6f); if (pvVar28 != (void *)0x0) { @@ -28309,7 +28311,7 @@ LAB_0079bd65: FUN_00420ae0(); cVar3 = FUN_0082ee30(); if (((cVar3 == '\0') && (bVar2 = AreControlsEnabled(pEVar23), bVar2 != 0)) && - (bVar2 = (GHIDRA_CAST((&pEVar23->_bodySprite)))->ANM2::IsPlaying(GHIDRA_CAST("UseItem")), bVar2 == 0)) { + (bVar2 = ANM2::IsPlaying(&pEVar23->_bodySprite,GHIDRA_CAST("UseItem")), bVar2 == 0)) { (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::GetCurrentRoom(); entityList = GHIDRA_CAST(FUN_00428a60()); EntityList::QuerySublist(entityList,GHIDRA_CAST(local_cd4),3,-1,-1,1,0); @@ -29587,7 +29589,7 @@ LAB_0079ee43: Color::Lerp(GHIDRA_CAST(local_78),GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar23)) + 0x170c)))),tmpColor,fVar11); entityColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&pEVar23->_sprite))))->Sprite)::Color(); fVar11 = (GHIDRA_CAST((entityColor)))->Color::A(); - (GHIDRA_CAST((GHIDRA_CAST(local_78))))->Font::SetLineHeightModifier(fVar11); + Font::SetLineHeightModifier(GHIDRA_CAST(local_78),fVar11); (GHIDRA_CAST((GHIDRA_CAST(local_78))))->Color::SetTint(0.01,0.01,0.01,1.0); (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar23)) + 0x170c)))))))->Color::operator_assign(GHIDRA_CAST(local_78)); tmpColor = GHIDRA_CAST(local_78); @@ -31527,7 +31529,7 @@ void Entity_Player::Revive() (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1400))) = 0; EvaluateItems(this); } - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0xc)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0xc)); layer->_visible = 1; } return; @@ -32075,7 +32077,7 @@ LAB_007a3da4: ExceptionList = local_10; return; } - bVar1 = (GHIDRA_CAST((&this->_bodySprite)))->ANM2::IsPlaying(GHIDRA_CAST("UseItem")); + bVar1 = ANM2::IsPlaying(&this->_bodySprite,GHIDRA_CAST("UseItem")); if (bVar1 != 0) { ExceptionList = local_10; return; @@ -33298,12 +33300,12 @@ LAB_007a5a54: if (bVar5 != 0) { UseActiveItem(this,GHIDRA_CAST((GHIDRA_INT(&local_34) + 2)),0x11c,1,-1,0); this->_isPlayingItemAnimation = 0; - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Reset(); + ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - bVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Glitch"),1); + AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); + bVar5 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Glitch"),1); if (bVar5 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingExtraAnimation = 1; @@ -33922,7 +33924,7 @@ LAB_007a6b37: local_44 = local_44 + -1; } while (local_44 != 0); if ((this->_itemState != 0x25c) || (*GHIDRA_CAST(&g_game->_stageTransition) != 0)) { - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Reset(); + ANM2::Reset(&this->_bodySprite); this->_isPlayingItemAnimation = 0; ResetItemState(this); this->_itemStateCooldown = 0; @@ -34650,11 +34652,11 @@ LAB_007a7cd9: *GHIDRA_CAST((followedPlayer + 0xc)) = 1000; *GHIDRA_CAST((followedPlayer + 0x154)) = 0x78; *GHIDRA_CAST((followedPlayer + 0x3c)) = 0; - pvVar10 = (GHIDRA_CAST((GHIDRA_CAST((followedPlayer + 0x40)))))->ANM2::GetAnimationData(GHIDRA_CAST("State5")); + pvVar10 = ANM2::GetAnimationData(GHIDRA_CAST((followedPlayer + 0x40)),GHIDRA_CAST("State5")); iVar15 = *GHIDRA_CAST((GHIDRA_CAST(pvVar10) + 0x30)); - bVar6 = (GHIDRA_CAST((GHIDRA_CAST((followedPlayer + 0x40)))))->ANM2::SetAnimation(GHIDRA_CAST("State5"),1); + bVar6 = ANM2::SetAnimation(GHIDRA_CAST((followedPlayer + 0x40)),GHIDRA_CAST("State5"),1); if (((bVar6 != 0) && (*GHIDRA_CAST((followedPlayer + 0x74)) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST((followedPlayer + 0x70)))))->AnimationState::SetFrameFloat((float)iVar15), + (AnimationState::SetFrameFloat(GHIDRA_CAST((followedPlayer + 0x70)),(float)iVar15), *GHIDRA_CAST((followedPlayer + 0x74)) != 0)) { *GHIDRA_CAST((followedPlayer + 0x84)) = 0; } @@ -35057,7 +35059,7 @@ void Entity_Player::TriggerNewRoom_TemporaryEffects() (GHIDRA_CAST((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x19f,1,1); crownAnim = "FloatGlow"; } - (GHIDRA_CAST((&this->_crownOfLightSprite)))->ANM2::Play(GHIDRA_CAST(crownAnim),0); + ANM2::Play(&this->_crownOfLightSprite,GHIDRA_CAST(crownAnim),0); } bVar2 = HasCollectible(this,0x1ba,0); if ((bVar2 != 0) && @@ -35070,7 +35072,7 @@ void Entity_Player::TriggerNewRoom_TemporaryEffects() (GHIDRA_CAST((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1ba,1,1); crownAnim = "FloatGlow"; } - (GHIDRA_CAST((&this->_darkPrincesCrownSprite)))->ANM2::Play(GHIDRA_CAST(crownAnim),0); + ANM2::Play(&this->_darkPrincesCrownSprite,GHIDRA_CAST(crownAnim),0); } iVar3 = 0; if ((this->_holyMantleStacks & 0xf0) != 0) { @@ -36475,17 +36477,17 @@ LAB_007ab230: animName = savedAnimName; } PlayExtraAnimation(player,animName); - (GHIDRA_CAST((&spriteCopy)))->ANM2::ANM2(savedSprite); + ANM2::ANM2(&spriteCopy,savedSprite); Isaac::SwapANM2(&pEVar2->_heldSprite,&spriteCopy); local_14 = GHIDRA_CAST(0x0); - (GHIDRA_CAST((this_00)))->ANM2::Reset(); - (GHIDRA_CAST((&spriteCopy._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&spriteCopy._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(this_00); + AnimationState::~AnimationState(&spriteCopy._overlayAnimState); + AnimationState::~AnimationState(&spriteCopy._animState); (GHIDRA_CAST((spriteCopy._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&spriteCopy))))->msvc::string::_Tidy_deallocate(); (pEVar2->_heldSprite)._bitflags = savedSprite->_bitflags; if (param_3 != 0) { - shadowLayer = (GHIDRA_CAST((&pEVar2->_heldSprite)))->ANM2::GetLayer(GHIDRA_CAST("shadow")); + shadowLayer = ANM2::GetLayer(&pEVar2->_heldSprite,GHIDRA_CAST("shadow")); if (shadowLayer != GHIDRA_CAST(0x0)) { if (&shadowLayer->_color != GHIDRA_CAST(local_7c)) { (shadowLayer->_color)._colorize[0] = 0.0; @@ -36539,7 +36541,7 @@ void Entity_Player::AnimateTrinket(int trinketId, uint8_t *animName, uint8_t *sp } heldSprite = &this->_heldSprite; player = this; - (GHIDRA_CAST((heldSprite)))->ANM2::Reset(); + ANM2::Reset(heldSprite); manager = g_manager; entityKey = 0x506400; _Find_lower_bound<>(lowerBoundResult,&entityKey); @@ -36551,9 +36553,9 @@ void Entity_Player::AnimateTrinket(int trinketId, uint8_t *animName, uint8_t *sp else { pickupConfig = (GHIDRA_CAST((&manager->_entityConfig)))->EntityConfig::GetEntity(5,0,0); } - (GHIDRA_CAST((heldSprite)))->ANM2::Load(&pickupConfig->anm2Path,0); + ANM2::Load(heldSprite,&pickupConfig->anm2Path,0); (GHIDRA_CAST((GHIDRA_CAST(heldSprite))))->Sprite::ReplaceSpritesheet(1,GHIDRA_CAST((trinketConfig + 0x38))); - (GHIDRA_CAST((heldSprite)))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(heldSprite,unk); animData = (this->_heldSprite)._animState._animData; if (animData != GHIDRA_CAST(0x0)) { currentAnimChar = animData; @@ -36582,9 +36584,9 @@ LAB_007ab655: ((animData[0x34] == 0 || ((this->_heldSprite)._animState._isPlaying != 0)))) goto LAB_007ab67d; } - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetAnimation(spriteAnimName,1); + bVar1 = ANM2::SetAnimation(heldSprite,spriteAnimName,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_heldSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } LAB_007ab67d: @@ -36632,10 +36634,10 @@ void Entity_Player::AnimateCard(int cardId, uint8_t *animName) ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50), cardConfig != 0)) && (ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50), *GHIDRA_CAST((cardConfig + 0x6c)) != 0)) { ppvStack_20 = (void **)(GHIDRA_INT(&cardAnm2Path) + 0x50); - (GHIDRA_CAST((heldSprite)))->ANM2::Reset(); + ANM2::Reset(heldSprite); (GHIDRA_CAST((cardAnm2Path._buf)))->msvc::string::string(*(void **)(cardConfig + 0x6c)); local_14 = 0; - (GHIDRA_CAST((heldSprite)))->ANM2::Load(&cardAnm2Path,1); + ANM2::Load(heldSprite,&cardAnm2Path,1); local_14 = 0xffffffff; if (0xf < cardAnm2Path._capacity) { uVar4 = cardAnm2Path._capacity + 1; @@ -36650,7 +36652,7 @@ void Entity_Player::AnimateCard(int cardId, uint8_t *animName) } operator_delete(pvVar2,uVar4); } - (GHIDRA_CAST((heldSprite)))->ANM2::Play(GHIDRA_CAST("Sparkle"),0); + ANM2::Play(heldSprite,GHIDRA_CAST("Sparkle"),0); cardAnimName = GHIDRA_CAST((cardConfig + 0x38)); if (0xf < *GHIDRA_CAST((cardConfig + 0x4c))) { cardAnimName = *GHIDRA_CAST(cardAnimName); @@ -36683,15 +36685,15 @@ LAB_007ab7f9: ((animData[0x34] == 0 || ((this->_heldSprite)._overlayAnimState._isPlaying != 0)))) goto LAB_007abab4; } - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetOverlayAnimation(cardAnimName,1); + bVar1 = ANM2::SetOverlayAnimation(heldSprite,cardAnimName,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_heldSprite)._overlayAnimState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_heldSprite)._overlayAnimState); (this->_heldSprite)._overlayAnimState._isPlaying = 1; } } goto LAB_007abab4; } - (GHIDRA_CAST((heldSprite)))->ANM2::Reset(); + ANM2::Reset(heldSprite); local_3c._size = 0; local_3c._capacity = 0xf; local_3c._buf[0] = '\0'; @@ -36703,7 +36705,7 @@ LAB_007ab7f9: local_3c._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_3c._buf))) + 0x0))),"gfx/ui/ui_cardspills.anm2",0x1a); local_14 = 1; - (GHIDRA_CAST((heldSprite)))->ANM2::Load(&local_3c,1); + ANM2::Load(heldSprite,&local_3c,1); local_14 = 0xffffffff; if (0xf < local_3c._capacity) { uVar4 = local_3c._capacity + 1; @@ -36725,9 +36727,9 @@ LAB_007ab7f9: (*GHIDRA_CAST((GHIDRA_CAST(&(local_3c._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_3c._buf)) + 0x0))) & 0xffffff00; if (animData == GHIDRA_CAST(0x0)) { LAB_007ab949: - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Sparkle"),1); + bVar1 = ANM2::SetAnimation(heldSprite,GHIDRA_CAST("Sparkle"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_heldSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } } @@ -36757,14 +36759,14 @@ LAB_007ab93b: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0)))) goto LAB_007ab949; } - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST("CardFronts"),1); + bVar1 = ANM2::SetOverlayAnimation(heldSprite,GHIDRA_CAST("CardFronts"),1); if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_heldSprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)cardId); + AnimationState::SetFrameFloat(&(this->_heldSprite)._overlayAnimState,(float)cardId); } uVar4 = 0; if ((this->_heldSprite)._layerCount != 0) { do { - pvVar2 = (GHIDRA_CAST((&(this->_heldSprite)._overlayAnimState)))->AnimationState::GetLayerFrame(uVar4); + pvVar2 = AnimationState::GetLayerFrame(&(this->_heldSprite)._overlayAnimState,uVar4); if ((pvVar2 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x2c)) != '\0')) goto LAB_007abab4; uVar4 = uVar4 + 1; } while (uVar4 < GHIDRA_UINT((this->_heldSprite)._layerCount)); @@ -36776,13 +36778,13 @@ LAB_007ab93b: (entityConfig = EntityConfig::GetEntity (&g_manager->_entityConfig,5,300,*GHIDRA_CAST((cardConfig + 0x54))), entityConfig == GHIDRA_CAST(0x0))) goto LAB_007abab4; - (GHIDRA_CAST((heldSprite)))->ANM2::Load(&entityConfig->anm2Path,1); + ANM2::Load(heldSprite,&entityConfig->anm2Path,1); animData = (this->_heldSprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_007aba73: - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Sparkle"),1); + bVar1 = ANM2::SetAnimation(heldSprite,GHIDRA_CAST("Sparkle"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_heldSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } } @@ -36812,9 +36814,9 @@ LAB_007aba65: if ((uVar4 != 0) || ((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0)))) goto LAB_007aba73; } - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetOverlayAnimation(&DAT_00b6b338,1); + bVar1 = ANM2::SetOverlayAnimation(heldSprite,&DAT_00b6b338,1); if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_heldSprite)._overlayAnimState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_heldSprite)._overlayAnimState,0.0); } LAB_007abab4: (this->_heldSprite)._offset.x = 0.0; @@ -36837,16 +36839,16 @@ void Entity_Player::AnimatePill(int pillColor, uint8_t *animName) ANM2 *heldSprite; heldSprite = &this->_heldSprite; - (GHIDRA_CAST((heldSprite)))->ANM2::Reset(); + ANM2::Reset(heldSprite); pillConfig = (GHIDRA_CAST((&g_manager->_entityConfig)))->EntityConfig::GetEntity(5,0x46,pillColor); if (pillConfig == GHIDRA_CAST(0x0)) goto LAB_007abbd4; - (GHIDRA_CAST((heldSprite)))->ANM2::Load(&pillConfig->anm2Path,1); + ANM2::Load(heldSprite,&pillConfig->anm2Path,1); animData = (this->_heldSprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_007abb93: - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Sparkle"),1); + bVar1 = ANM2::SetAnimation(heldSprite,GHIDRA_CAST("Sparkle"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_heldSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_heldSprite)._animState); (this->_heldSprite)._animState._isPlaying = 1; } } @@ -36877,9 +36879,9 @@ LAB_007abb85: ((animData[0x34] != 0 && ((this->_heldSprite)._animState._isPlaying == 0)))) goto LAB_007abb93; } - bVar1 = (GHIDRA_CAST((heldSprite)))->ANM2::SetOverlayAnimation(&DAT_00b6b338,1); + bVar1 = ANM2::SetOverlayAnimation(heldSprite,&DAT_00b6b338,1); if ((bVar1 != 0) && ((this->_heldSprite)._overlayAnimState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_heldSprite)._overlayAnimState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_heldSprite)._overlayAnimState,0.0); } LAB_007abbd4: (this->_heldSprite)._offset.x = 0.0; @@ -37012,12 +37014,12 @@ void Entity_Player::PlayExtraAnimation(uint8_t *animName) uint8_t isAnimSet; this->_isPlayingItemAnimation = 0; - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Reset(); + ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(animName,1); + AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); + isAnimSet = ANM2::SetAnimation(&this->_sprite,animName,1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingItemAnimation = 0; @@ -38060,7 +38062,7 @@ uint8_t Entity_Player::IsCollectibleAnimFinished(int collectible, std_string *an if (0xf < animName->_capacity) { animName_00 = *GHIDRA_CAST(animName->_buf); } - isAnimFinished = (GHIDRA_CAST((costumeSprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST(animName_00)); + isAnimFinished = ANM2::IsFinishedImpl(costumeSprite,GHIDRA_CAST(animName_00)); if ((isAnimFinished != 0) && ((animData = (costumeSprite->_animState)._animData, animData == (void *)0x0 || (*GHIDRA_CAST((GHIDRA_CAST(animData) + 0x34)) == '\0')))) { @@ -39291,7 +39293,7 @@ uint8_t Entity_Player::try_trigger_astral_projection() fVar4 = 1.1295154e-38; pEVar8 = this; astralBody = (GHIDRA_CAST((g_game)))->Game::SpawnEx(1000,6,position,&g_vectorZero,GHIDRA_CAST(this),0,seed,0); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x15c)))))->ANM2::ANM2(&this->_sprite); + ANM2::ANM2(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x15c)),&this->_sprite); other._championColor._colorize[3] = fVar4; other._filename._buf[0] = in_stack_fffffea4[0]; other._filename._buf[1] = in_stack_fffffea4[1]; @@ -39390,13 +39392,13 @@ uint8_t Entity_Player::try_trigger_astral_projection() (*GHIDRA_CAST((GHIDRA_CAST(&(other)) + 0x10a))) = SUB42(uVar9,2); other._shadowLayerIndex = seed; other._bitflags = iVar3; - (GHIDRA_CAST((&astralBody->_sprite)))->ANM2::operator_assign(other); - ghostLayer = (GHIDRA_CAST((&astralBody->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("ghost")); + ANM2::operator_assign(&astralBody->_sprite,other); + ghostLayer = ANM2::GetLayer(&astralBody->_sprite,GHIDRA_CAST("ghost")); if (ghostLayer != GHIDRA_CAST(0x0)) { ghostLayer->_visible = 0; } - (GHIDRA_CAST((&(astralBody->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - (GHIDRA_CAST((&astralBody->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + AnimationState::SetAnimationData(&(astralBody->_sprite)._overlayAnimState,(void *)0x0); + ANM2::Play(&astralBody->_sprite,GHIDRA_CAST("Death"),0); uVar9 = *GHIDRA_CAST((GHIDRA_INT(&astralBody->_flags) + 4)); *GHIDRA_CAST(&astralBody->_flags) = GHIDRA_UINT(astralBody->_flags) | 0x200000; *GHIDRA_CAST((GHIDRA_INT(&astralBody->_flags) + 4)) = uVar9; @@ -39797,12 +39799,12 @@ LAB_007b0760: if (this->_isCoopGhost != 0) { reset_body_sprite(this); this->_isPlayingItemAnimation = 0; - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Reset(); + ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("GhostAppear"),1); + AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); + bVar3 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("GhostAppear"),1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_isPlayingExtraAnimation = 1; @@ -43947,12 +43949,12 @@ void Entity_Player::update_baby_skin_effects() bVar2 = IsExtraAnimationFinished(game); if (bVar2 == 0) goto LAB_007bb58c; LAB_007bb576: - (GHIDRA_CAST((&game->_sprite)))->ANM2::PlayOverlay(GHIDRA_CAST("Dripping"),0); + ANM2::PlayOverlay(&game->_sprite,GHIDRA_CAST("Dripping"),0); (game->_sprite)._overlayRenderFirst = 1; goto LAB_007bb58c; } if (iVar5 == 3) { - pvVar6 = (GHIDRA_CAST((&game->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("Dripping")); + pvVar6 = ANM2::GetAnimationData(&game->_sprite,GHIDRA_CAST("Dripping")); if (pvVar6 != (void *)0x0) { bVar2 = IsExtraAnimationFinished(game); if (bVar2 != 0) goto LAB_007bb576; @@ -46103,7 +46105,7 @@ void Entity_Player::update_player_skin() uVar6 = uVar6 + 1; } while (uVar6 < 0xf); LAB_007bee42: - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(&this->_sprite,unk); } else { puStack_20 = GHIDRA_CAST((skinColorStr + 0x14)); @@ -46115,7 +46117,7 @@ LAB_007bee42: (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::ReplaceSpritesheet(uVar6,GHIDRA_CAST(local_74)); uVar6 = uVar6 + 1; } while (uVar6 < 0xf); - local_74 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("ghost")); + local_74 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("ghost")); this = local_78; if (local_74 == GHIDRA_CAST(0x0)) { unk = extraout_CL_01; @@ -46299,7 +46301,7 @@ void Entity_Player::InitBabySkin() (GHIDRA_INT((manager->_entityConfig)._babies._begin) + this->_babySkin * 0x38 + 0x1c)); uVar2 = uVar2 + 1; } while (uVar2 < GHIDRA_UINT((this->_sprite)._layerCount)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(&this->_sprite,unk); return; } } @@ -46331,7 +46333,7 @@ void Entity_Player::InitBabySkin() } } LAB_007bf18d: - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics((uint8_t)pEVar1); + ANM2::LoadGraphics(&this->_sprite,(uint8_t)pEVar1); return; } @@ -46619,7 +46621,7 @@ uint8_t Entity_Player::IsHeldItemVisible() isHoldingItem = IsHoldingItem(this); if ((isHoldingItem != 0) && ((this->_bodySprite)._animState._animData != (void *)0x0)) { - nullFrame = (GHIDRA_CAST((&(this->_bodySprite)._animState)))->AnimationState::GetNullFrameById(0); + nullFrame = AnimationState::GetNullFrameById(&(this->_bodySprite)._animState,0); if (nullFrame != (void *)0x0) { return *GHIDRA_CAST((GHIDRA_CAST(nullFrame) + 0xc)); } @@ -48235,7 +48237,7 @@ LAB_007c4df2: case 6: AddMaxHearts(this,(isHorsePill & 0xff ^ 1) * 2 + -4,0); TryPreventDeath(this); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); AnimateSad(this); pMVar21 = extraout_ECX_05; break; @@ -49482,9 +49484,9 @@ LAB_007c7557: } (GHIDRA_CAST((GHIDRA_CAST(pMVar21))))->LuaEngine::UsePill(pillEffect,this,useFlagsLocal); if ((char)isHorsePill != '\0') { - bVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Happy")); + bVar6 = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("Happy")); if (bVar6 == 0) { - bVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(&DAT_00b1cdf8); + bVar6 = ANM2::IsPlaying(&this->_sprite,&DAT_00b1cdf8); if (bVar6 == 0) goto LAB_007c7658; (GHIDRA_CAST((&g_manager->_sfxManager)))->SFXManager::Stop(0x10b); iVar26 = 0x25b; @@ -51218,7 +51220,7 @@ LAB_007ca198: (GHIDRA_CAST((&this->_temporaryeffects)))->TemporaryEffects::RemoveCollectibleEffect(0x19f,1); pcVar4 = "FloatNoGlow"; } - (GHIDRA_CAST((&this->_crownOfLightSprite)))->ANM2::Play(GHIDRA_CAST(pcVar4),0); + ANM2::Play(&this->_crownOfLightSprite,GHIDRA_CAST(pcVar4),0); } LAB_007ca1c8: isOwned = HasCollectible(this,0x1ba,0); @@ -51240,7 +51242,7 @@ LAB_007ca2a6: (GHIDRA_CAST((&this->_temporaryeffects)))->TemporaryEffects::AddCollectibleEffect(0x1ba,1,1); pcVar4 = "FloatGlow"; } - (GHIDRA_CAST((&this->_darkPrincesCrownSprite)))->ANM2::Play(GHIDRA_CAST(pcVar4),0); + ANM2::Play(&this->_darkPrincesCrownSprite,GHIDRA_CAST(pcVar4),0); LAB_007ca260: isOwned = HasCollectible(this,0x1ed,0); if ((isOwned != 0) || @@ -51321,7 +51323,7 @@ void Entity_Player::BreakGoldenHearts(int count) local_28 = &DAT_0000002f; builtin_strncpy(pcStack_3c,"gfx/293.000_UltraGreedCoins.anm2",0x21); local_14 = 0; - (GHIDRA_CAST((&effect->_sprite)))->ANM2::Load(GHIDRA_CAST(&pcStack_3c),1); + ANM2::Load(&effect->_sprite,GHIDRA_CAST(&pcStack_3c),1); local_14 = 0xffffffff; if (&DAT_0000000f < local_28) { size = local_28 + 1; @@ -51364,9 +51366,9 @@ LAB_007ca468: if ((uVar4 == 0) && ((animData[0x34] == 0 || ((local_54->_animState)._isPlaying != 0)))) goto LAB_007ca49c; } - bVar3 = (GHIDRA_CAST((local_54)))->ANM2::SetAnimation(GHIDRA_CAST("CrumbleNoDebris"),1); + bVar3 = ANM2::SetAnimation(local_54,GHIDRA_CAST("CrumbleNoDebris"),1); if (bVar3 != 0) { - (GHIDRA_CAST((&pAVar2->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&pAVar2->_animState); (pAVar2->_animState)._isPlaying = 1; } LAB_007ca49c: @@ -53396,10 +53398,10 @@ LAB_007cd555: LAB_007cd576: crownAnim = 0x100b6ae44; LAB_007cd57d: - bVar2 = (GHIDRA_CAST((&effectsOwner->_crownOfLightSprite)))->ANM2::SetAnimation(GHIDRA_CAST(crownAnim), + bVar2 = ANM2::SetAnimation(&effectsOwner->_crownOfLightSprite,GHIDRA_CAST(crownAnim), (uint8_t)((uint64_t)crownAnim >> 0x20)); if (bVar2 != 0) { - (GHIDRA_CAST((&(effectsOwner->_crownOfLightSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(effectsOwner->_crownOfLightSprite)._animState); tempEffects = &effectsOwner->_temporaryeffects; (effectsOwner->_crownOfLightSprite)._animState._isPlaying = 1; } @@ -53505,10 +53507,10 @@ LAB_007cd7b9: crownAnim = 0x100b6ae50; } LAB_007cd8ab: - bVar2 = (GHIDRA_CAST((&effectsOwner->_darkPrincesCrownSprite)))->ANM2::SetAnimation(GHIDRA_CAST(crownAnim), + bVar2 = ANM2::SetAnimation(&effectsOwner->_darkPrincesCrownSprite,GHIDRA_CAST(crownAnim), (uint8_t)((uint64_t)crownAnim >> 0x20)); if (bVar2 != 0) { - (GHIDRA_CAST((&(effectsOwner->_darkPrincesCrownSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(effectsOwner->_darkPrincesCrownSprite)._animState); (effectsOwner->_darkPrincesCrownSprite)._animState._isPlaying = 1; } } @@ -54340,7 +54342,7 @@ LAB_007cecd9: local_8 = GHIDRA_CAST(0x0); local_2d = (this->_sprite)._animState._isPlaying; local_44 = (this->_sprite)._animState._animFrame; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),0); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),0); update_player_skin(this); this->ResetColor(); RemoveCollectible(this,oldPlayerType,extraout_ECX); @@ -54350,9 +54352,9 @@ LAB_007cecd9: if (0xf < GHIDRA_UINT(animNameCapacity)) { pEVar3 = animName[0]; } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(pEVar3),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(pEVar3),1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_44)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(local_44)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -54365,9 +54367,9 @@ LAB_007cecd9: } if (curAnim == GHIDRA_CAST(0x0)) { LAB_007cf49f: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_38.y),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_38.y),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -54398,7 +54400,7 @@ LAB_007cf48b: goto LAB_007cf49f; } if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(local_44); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,local_44); } LAB_007cf515: if (unk == 0) { @@ -54901,9 +54903,9 @@ Entity_Familiar * Entity_Player::AddMinisaac(Vector *position, uint8_t isPlayAni animData = (minisaac->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_007d19f9: - bVar1 = (GHIDRA_CAST((&minisaac->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(&minisaac->_sprite,GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(minisaac->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(minisaac->_sprite)._animState); (minisaac->_sprite)._animState._isPlaying = 1; } } @@ -54933,7 +54935,7 @@ LAB_007d19e8: if ((uVar2 != 0) || ((animData[0x34] != 0 && ((minisaac->_sprite)._animState._isPlaying == 0)))) goto LAB_007d19f9; } - (GHIDRA_CAST((&(minisaac->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(&(minisaac->_sprite)._overlayAnimState,(void *)0x0); minisaac->_state = 1; minisaac->_entityCollisionClass = 0; uVar2 = Random(); @@ -54948,9 +54950,9 @@ LAB_007d19e8: animData = (bloodSplat->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_007d1b16: - bVar1 = (GHIDRA_CAST((&bloodSplat->_sprite)))->ANM2::SetAnimation(&DAT_00b1d534,1); + bVar1 = ANM2::SetAnimation(&bloodSplat->_sprite,&DAT_00b1d534,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(bloodSplat->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(bloodSplat->_sprite)._animState); (bloodSplat->_sprite)._animState._isPlaying = 1; } } @@ -55247,7 +55249,7 @@ uint8_t Entity_Player::TryHoldEntity(Entity *entity) (entity->_posOffset).y = g_vectorZero.y; bVar2 = (GHIDRA_CAST((GHIDRA_CAST(entity))))->Entity_Bomb::IsRocket(); if (bVar2 != 0) { - (GHIDRA_CAST((&entity->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&entity->_sprite,s_Idle,0); (entity->_sprite)._rotation = 0.0; } goto LAB_007d23e6; @@ -55318,7 +55320,7 @@ LAB_007d23e6: *heldSlot = entity; msvc::multiset::insert(heldSlot); PlayExtraAnimation(this,GHIDRA_CAST("LiftItem")); - (GHIDRA_CAST((&this->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_heldSprite); FlushQueueItem(this); this->_itemState = 0x25c; this->_itemStateCooldown = 0; @@ -55413,7 +55415,7 @@ Entity * Entity_Player::ThrowHeldEntity(Vector *Velocity) thrownEntity->_fallingAccel = 0.8; thrownEntity->_fallingSpeed = -5.0; thrownEntity->_prismTouched = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x174)))))->ANM2::ANM2(GHIDRA_CAST((heldEntity + 0x12))); + ANM2::ANM2(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x174)),GHIDRA_CAST((heldEntity + 0x12))); other._championColor._offset[0] = fVar2; other._filename._buf[0] = in_stack_fffffe8c[0]; other._filename._buf[1] = in_stack_fffffe8c[1]; @@ -55510,14 +55512,14 @@ Entity * Entity_Player::ThrowHeldEntity(Vector *Velocity) (*GHIDRA_CAST((GHIDRA_CAST(&(other)) + 0x108))) = unaff_EBX; other._shadowLayerIndex = iVar5; other._bitflags = iVar6; - (GHIDRA_CAST((&thrownEntity->_sprite)))->ANM2::operator_assign(other); + ANM2::operator_assign(&thrownEntity->_sprite,other); layerIndex = GHIDRA_CAST(0x0); if ((thrownEntity->_sprite)._layerCount != 0) { do { - layer = (GHIDRA_CAST((&thrownEntity->_sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(&thrownEntity->_sprite,layerIndex); (layer->_pos).x = g_vectorZero.x; (layer->_pos).y = g_vectorZero.y; - layer = (GHIDRA_CAST((&thrownEntity->_sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(&thrownEntity->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_size).x = g_vectorOne.x; (layer->_size).y = g_vectorOne.y; @@ -56378,7 +56380,7 @@ LAB_007d3d25: if (uVar6 == 0) { PlayExtraAnimation(this,GHIDRA_CAST("Death")); if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(24.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,24.0); } local_d4 = get_voice_pitch(this); pMVar4 = g_manager; @@ -56734,7 +56736,7 @@ LAB_007d44b8: *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x33c)) = (this->_suplexTargetPos).x; *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x340)) = (this->_suplexTargetPos).y; } - curAnimChars = (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(curAnim)); + curAnimChars = ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState),GHIDRA_CAST(curAnim)); animNameSize = &curAnimChars->_size; if (0xf < curAnimChars->_capacity) { curAnimChars = *GHIDRA_CAST(curAnimChars->_buf); @@ -56768,7 +56770,7 @@ LAB_007d44b8: return; } if ((this->_sprite)._animState._animData != (void *)0x0) { - bVar2 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b1d534); + bVar2 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,&DAT_00b1d534); manager = g_manager; if (bVar2 != 0) { fVar9 = (this->_playerSpriteScale).x; @@ -56794,7 +56796,8 @@ LAB_007d44b8: local_7b8 = *ppuVar3; seed_fart_sound_override(GHIDRA_CAST(&local_7ac)); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_7ac),1.0,2,0,1.0,0.0); - curAnimChars = (GHIDRA_CAST((GHIDRA_CAST(&(local_7bc->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(curAnim)); + curAnimChars = ANM2::GetAnimation(GHIDRA_CAST(&(local_7bc->_sprite)._animState), + GHIDRA_CAST(curAnim)); animNameSize = &curAnimChars->_size; if (0xf < curAnimChars->_capacity) { curAnimChars = *GHIDRA_CAST(curAnimChars->_buf); @@ -56997,7 +57000,7 @@ LAB_007d44b8: } if ((this->_sprite)._animState._animData != (void *)0x0) { animState = &(this->_sprite)._animState; - bVar2 = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(&DAT_00b1d3b0); + bVar2 = AnimationState::IsEventTriggered(animState,&DAT_00b1d3b0); if (bVar2 != 0) { ThrowHeldEntity(this,&g_vectorZero); } @@ -57007,7 +57010,7 @@ LAB_007d44b8: animState = &(this->_sprite)._animState; LAB_007d4fc6: if ((this->_sprite)._animState._animData != (void *)0x0) { - bVar2 = (GHIDRA_CAST((animState)))->AnimationState::WasEventTriggered(&DAT_00b1d3b0); + bVar2 = AnimationState::WasEventTriggered(animState,&DAT_00b1d3b0); if (bVar2 != 0) { fVar9 = (this->_suplexLandPos).y; fVar10 = (this->_pos).y; @@ -57240,10 +57243,10 @@ LAB_007d54e0: animName = (pickup->_sprite)._animState._animData; if (animName == GHIDRA_CAST(0x0)) { LAB_007d5690: - bVar4 = (GHIDRA_CAST((&pickup->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Collect"),1); + bVar4 = ANM2::SetAnimation(&pickup->_sprite,GHIDRA_CAST("Collect"),1); pEVar3 = local_50; if (bVar4 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&local_50->_subtype))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&local_50->_subtype)); (*GHIDRA_CAST((GHIDRA_CAST((pEVar3)) + 0x44))) = 1; pickup = collectedPickup; } @@ -59060,20 +59063,20 @@ uint8_t Entity_Player::spawn_ghost_corpse() local_14 = this; uVar3 = Random(); corpseEffect = (GHIDRA_CAST((g_game)))->Game::SpawnEx(1000,6,&this->_pos,&g_vectorZero,GHIDRA_CAST(this),0,uVar3,0); - (GHIDRA_CAST((&spriteCopy)))->ANM2::ANM2(&this->_sprite); + ANM2::ANM2(&spriteCopy,&this->_sprite); Isaac::SwapANM2(&corpseEffect->_sprite,&spriteCopy); local_8 = 0; - (GHIDRA_CAST((this_00)))->ANM2::Reset(); - (GHIDRA_CAST((&spriteCopy._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&spriteCopy._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(this_00); + AnimationState::~AnimationState(&spriteCopy._overlayAnimState); + AnimationState::~AnimationState(&spriteCopy._animState); (GHIDRA_CAST((spriteCopy._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&spriteCopy))))->msvc::string::_Tidy_deallocate(); local_8 = 0xffffffff; - ghostLayer = (GHIDRA_CAST((&corpseEffect->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("ghost")); + ghostLayer = ANM2::GetLayer(&corpseEffect->_sprite,GHIDRA_CAST("ghost")); if (ghostLayer != GHIDRA_CAST(0x0)) { ghostLayer->_visible = 0; } - (GHIDRA_CAST((&(corpseEffect->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(&(corpseEffect->_sprite)._overlayAnimState,(void *)0x0); (corpseEffect->_sprite)._playbackSpeed = 1.0; animData = (corpseEffect->_sprite)._animState._animData; if (animData != GHIDRA_CAST(0x0)) { @@ -59103,14 +59106,14 @@ LAB_007d88c5: ((animData[0x34] == 0 || ((corpseEffect->_sprite)._animState._isPlaying != 0)))) goto LAB_007d88f8; } - bVar2 = (GHIDRA_CAST((&corpseEffect->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Death"),1); + bVar2 = ANM2::SetAnimation(&corpseEffect->_sprite,GHIDRA_CAST("Death"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(corpseEffect->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(corpseEffect->_sprite)._animState); (corpseEffect->_sprite)._animState._isPlaying = 1; } LAB_007d88f8: if ((corpseEffect->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(corpseEffect->_sprite)._animState)))->AnimationState::SetFrameFloat(6.0); + AnimationState::SetFrameFloat(&(corpseEffect->_sprite)._animState,6.0); } flagsHigh = *GHIDRA_CAST((GHIDRA_INT(&corpseEffect->_flags) + 4)); *GHIDRA_CAST(&corpseEffect->_flags) = GHIDRA_UINT(corpseEffect->_flags) | 0x200000; @@ -59611,7 +59614,7 @@ void Entity_Player::RevivePlayerGhost() this->_isCoopGhost = 0; this->_isInvicible = 0; this->_entityCollisionClass = 4; - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); manager = g_manager; _Find_lower_bound<>(lowerBound,aiStack_1c + 1); if ((*GHIDRA_CAST((GHIDRA_CAST(boundNode) + 0xd)) == '\0') && (*GHIDRA_CAST((GHIDRA_CAST(boundNode) + 0x10)) < 0x100001)) @@ -59627,7 +59630,7 @@ void Entity_Player::RevivePlayerGhost() if (configNode == configHead) { ANM2Path = GHIDRA_CAST(0x74); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(ANM2Path,0); + ANM2::Load(&this->_sprite,ANM2Path,0); update_player_skin(this); if (g_game->_isRestoringGlowingHourglassState == 0) { PlayExtraAnimation(this,GHIDRA_CAST("Appear")); @@ -59699,12 +59702,12 @@ void Entity_Player::RevivePlayerGhost() twin = InitTwin(this,0x28); InitPostLevelInitStats(twin); twin->_isPlayingItemAnimation = 0; - (GHIDRA_CAST((&twin->_bodySprite)))->ANM2::Reset(); + ANM2::Reset(&twin->_bodySprite); (twin->_sprite)._playbackSpeed = 1.0; - (GHIDRA_CAST((&(twin->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - isAnimSet = (GHIDRA_CAST((&twin->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + AnimationState::SetAnimationData(&(twin->_sprite)._overlayAnimState,(void *)0x0); + isAnimSet = ANM2::SetAnimation(&twin->_sprite,GHIDRA_CAST("Appear"),1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(twin->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(twin->_sprite)._animState); (twin->_sprite)._animState._isPlaying = 1; } twin->_isPlayingExtraAnimation = 1; @@ -59820,12 +59823,12 @@ void Entity_Player::MorphToCoopGhost() this->_ghostTrinkets[1] = secondTrinket; reset_body_sprite(this); this->_isPlayingItemAnimation = 0; - (GHIDRA_CAST((&this->_bodySprite)))->ANM2::Reset(); + ANM2::Reset(&this->_bodySprite); (this->_sprite)._playbackSpeed = 1.0; - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - isAnimChanged = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("GhostAppear"),1); + AnimationState::SetAnimationData(&(this->_sprite)._overlayAnimState,(void *)0x0); + isAnimChanged = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("GhostAppear"),1); if (isAnimChanged != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } game = g_game; @@ -59935,7 +59938,7 @@ void Entity_Player::reset_body_sprite() playerEntityConfig = (GHIDRA_CAST((&manager->_entityConfig)))->EntityConfig::GetEntity(1,0,0); } sprite = &this->_sprite; - (GHIDRA_CAST((sprite)))->ANM2::Load(&playerEntityConfig->anm2Path,0); + ANM2::Load(sprite,&playerEntityConfig->anm2Path,0); iVar2 = this->_playerType; iVar1 = 0x3c; if ((iVar2 == 4) || (iVar2 == 0x19)) { @@ -59960,7 +59963,7 @@ void Entity_Player::reset_body_sprite() iVar1 = extraout_ECX; } while (layerId < GHIDRA_UINT((local_c->_sprite)._layerCount)); } - (GHIDRA_CAST((sprite)))->ANM2::LoadGraphics((uint8_t)iVar1); + ANM2::LoadGraphics(sprite,(uint8_t)iVar1); return; } @@ -60658,7 +60661,7 @@ uint8_t Entity_Player::TryForgottenThrow(Vector *dir) throwVelocity.x = (throwVelocity.x + *extraout_EAX) * 1.2; throwVelocity.y = (extraout_EAX[1] + throwVelocity.y) * 1.2; ThrowHeldEntity(soul,&throwVelocity); - (GHIDRA_CAST((&soul->_heldSprite)))->ANM2::Reset(); + ANM2::Reset(&soul->_heldSprite); soul->_blinkTime = 1; soul->_itemStateCooldown = 5; PlayExtraAnimation(soul,GHIDRA_CAST("HideItem")); @@ -61516,7 +61519,7 @@ void Entity_Player::TriggerRoomExit() layerFrame = AnimationState::GetLayerFrame (GHIDRA_CAST(((this->_sprite)._animDefaultName._buf + 8)), GHIDRA_INT(layerId)); - layerState = (GHIDRA_CAST((GHIDRA_CAST(&this->_spawnerVariant))))->ANM2::GetLayer(GHIDRA_CAST(layerId)); + layerState = ANM2::GetLayer(GHIDRA_CAST(&this->_spawnerVariant),GHIDRA_CAST(layerId)); if (((layerState->_visible != 0) && (layerFrame != (void *)0x0)) && (*GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 0x2c)) != '\0')) { local_168 = GHIDRA_CAST((*GHIDRA_CAST((local_11c + 0x18)) + layerOffset)); @@ -61899,9 +61902,9 @@ void Entity_Player::CheckPoopSpellQueue(Vector *param_2) local_4c = GHIDRA_CAST(text->_tint[0]); } titleFont = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x40)))); - local_7c.y = (float)(GHIDRA_CAST((titleFont)))->Font::get_string_width_n(GHIDRA_CAST(titleText),-1); + local_7c.y = (float)Font::get_string_width_n(titleFont,GHIDRA_CAST(titleText),-1); local_5c = GHIDRA_CAST(&(this->_sprite)._animState._isPlaying); - piVar2 = GHIDRA_CAST((GHIDRA_CAST((local_5c)))->Font)::get_string_width_n(GHIDRA_CAST(local_4c),-1); + piVar2 = GHIDRA_CAST(Font)::get_string_width_n(local_5c,GHIDRA_CAST(local_4c),-1); linesBegin = GHIDRA_CAST(0x0); local_74._blue = 0.0; local_74._alpha = 0.0; @@ -61955,7 +61958,7 @@ void Entity_Player::CheckPoopSpellQueue(Vector *param_2) if (0xf < wordCapacity) { ppppppbVar4 = uint16_t; } - local_4c = GHIDRA_CAST((GHIDRA_CAST((local_5c)))->Font)::get_string_width_n(GHIDRA_CAST(ppppppbVar4),-1); + local_4c = GHIDRA_CAST(Font)::get_string_width_n(local_5c,GHIDRA_CAST(ppppppbVar4),-1); fVar1 = local_74._alpha; framePhase = lineWidth; if (local_60 < GHIDRA_CAST((GHIDRA_INT(local_4c->_tint) + lineWidth))) { @@ -62088,7 +62091,7 @@ LAB_009603a7: drawOffset->y)); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 4; local_7c.y = (float)(GHIDRA_INT(g_screenWidth) - GHIDRA_INT(local_7c.y)) * 0.5; - pvVar5 = (GHIDRA_CAST((titleFont)))->Font::measure_string(glyphQuads,GHIDRA_CAST(titleText),&local_30,&g_vectorOne); + pvVar5 = Font::measure_string(titleFont,glyphQuads,GHIDRA_CAST(titleText),&local_30,&g_vectorOne); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 5; color._blue = 1.0; color._red = 1.0; @@ -62108,7 +62111,7 @@ LAB_009603a7: if (0xf < *GHIDRA_CAST(&line->_lineHeight)) { local_5c = *GHIDRA_CAST(line); } - framePhase = (GHIDRA_CAST((bodyFont)))->Font::get_string_width_n(GHIDRA_CAST(local_5c),-1); + framePhase = Font::get_string_width_n(bodyFont,GHIDRA_CAST(local_5c),-1); local_30 = 0; local_2c = GHIDRA_CAST(0xffff); local_28 = 0; @@ -62118,7 +62121,7 @@ LAB_009603a7: local_18 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 6; local_7c.y = (float)(GHIDRA_INT(g_screenWidth) - framePhase) * 0.5 + drawOffset->x; - pvVar5 = (GHIDRA_CAST((bodyFont)))->Font::measure_string(glyphQuads,GHIDRA_CAST(local_5c),&local_30,&g_vectorOne); + pvVar5 = Font::measure_string(bodyFont,glyphQuads,GHIDRA_CAST(local_5c),&local_30,&g_vectorOne); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 7; color_00._blue = 0.8235294; color_00._red = 0.98039216; diff --git a/generated-src/entity_projectile.cpp b/generated-src/entity_projectile.cpp index 8e12b6b..8ce1037 100644 --- a/generated-src/entity_projectile.cpp +++ b/generated-src/entity_projectile.cpp @@ -97,7 +97,7 @@ void Entity_Projectile::Init(int type, int variant, int subType, uint32_t initSe (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Init(type,variant,subType,initSeed); this->_entityGridCollisionClass = 4; if (this->_config != (void *)0x0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); } this->_height = -23.0; uVar1 = Random(); @@ -125,7 +125,7 @@ void Entity_Projectile::Init(int type, int variant, int subType, uint32_t initSe *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x470)))) = 0; uVar1 = g_graphicsManager_flags; if (iVar2 == 2) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); iVar2 = 1; if ((uVar1 & 4) == 0) { iVar2 = 6; @@ -136,7 +136,7 @@ void Entity_Projectile::Init(int type, int variant, int subType, uint32_t initSe layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; if (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 8)) == 0x10) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (layer->_pos).x = 0.0; (layer->_pos).y = 8.0; } @@ -425,7 +425,7 @@ void Entity_Projectile::Update() else { sprintf_s(subtypeHigh,0x20,GHIDRA_CAST("RegularTear%d")); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(subtypeHigh,0); + ANM2::Play(&this->_sprite,subtypeHigh,0); this->_animKey = sizeIndex; } } @@ -437,9 +437,9 @@ void Entity_Projectile::Update() (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::ReplaceSpritesheet(0,GHIDRA_CAST(auStack_3c)); uStack_14 = -1; (GHIDRA_CAST((auStack_3c)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(0); + ANM2::LoadGraphics(&this->_sprite,0); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b1d6fc,0); + ANM2::Play(&this->_sprite,&DAT_00b1d6fc,0); pvVar21 = (this->_sprite)._animState._animData; if (pvVar21 != (void *)0x0) { AnimationState::SetFrameFloat @@ -451,9 +451,9 @@ void Entity_Projectile::Update() } else if (sizeIndex == 2) { if (this->_animKey != 200) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Flickering"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Flickering"),0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar5 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar5 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(uVar9 % uVar5); (GHIDRA_CAST((auStack_cc + 0x2c)))->BlendMode::SetMode(2,0); @@ -479,16 +479,16 @@ LAB_0065334c: } Isaac::Random(4); sprintf_s(auStack_8c + 8,0x20,GHIDRA_CAST(animFormat)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(auStack_8c + 8,0); + ANM2::Play(&this->_sprite,auStack_8c + 8,0); this->_animKey = 300; } } else { if (sizeIndex == 7) { if (this->_animKey != 400) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("MoveHori"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("MoveHori"),0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar5 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar5 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(uVar9 % uVar5); this->_animKey = 400; @@ -506,7 +506,7 @@ LAB_0065334c: if (this->_scale <= 1.5 && this->_scale != 1.5) { animFormat = "Small"; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(animFormat),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(animFormat),0); this->_animKey = 700; } } @@ -520,15 +520,15 @@ LAB_0065334c: else if (sizeIndex == 9) { if (this->_animKey != 500) { sprintf_s(animName,0x20,GHIDRA_CAST("Rotate%d")); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(animName,0); + ANM2::Play(&this->_sprite,animName,0); this->_animKey = 500; } } else if (sizeIndex == 0xb) { if (this->_animKey != 600) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b1d6fc,0); + ANM2::Play(&this->_sprite,&DAT_00b1d6fc,0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar5 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar5 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite::SetFrame_1(uVar9 % uVar5); projectile->_animKey = 600; @@ -540,11 +540,11 @@ LAB_0065334c: player = GHIDRA_CAST(&this->_sprite); pEStack_35c = player; if (this->_animKey != 800) { - (GHIDRA_CAST((GHIDRA_CAST(player))))->ANM2::Play(&DAT_00b1d6fc,0); + ANM2::Play(GHIDRA_CAST(player),&DAT_00b1d6fc,0); bVar3 = EntityPtr::Ref(); set_byte_0x101(player,bVar3 & 1); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar5 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar5 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); player = pEStack_35c; (GHIDRA_CAST((GHIDRA_CAST(pEStack_35c))))->Sprite::SetFrame_1(uVar9 % uVar5); @@ -561,7 +561,7 @@ LAB_00653797: if (sizeIndex == 0xf) { if (this->_animKey != 1000) { anm2 = &this->_sprite; - (GHIDRA_CAST((anm2)))->ANM2::Play(s_Idle,0); + ANM2::Play(anm2,s_Idle,0); this = projectile; bVar3 = EntityPtr::Ref(); (GHIDRA_CAST((GHIDRA_CAST(anm2))))->Sprite::set_flip_x(bVar3 & 1); @@ -585,7 +585,7 @@ LAB_00653797: pEStack_35c = GHIDRA_CAST((*piVar13 + 0x44c)); if (GHIDRA_CAST(this->_animKey) != pEStack_35c) { sprintf_s(animName,0x20,GHIDRA_CAST("RegularTear%d")); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(animName,0); + ANM2::Play(&this->_sprite,animName,0); this->_animKey = GHIDRA_INT(pEStack_35c); } pEStack_35c = GHIDRA_CAST((GHIDRA_CAST((&this->_velocity)))->Vector)::GetAngleDegrees(); @@ -625,7 +625,7 @@ LAB_00653797: if (this->_visible == 0) { sprite = GHIDRA_CAST((GHIDRA_CAST(()))->Entity)::GetSprite(); spriteColor = GHIDRA_CAST((GHIDRA_CAST((sprite)))->Sprite)::Color(); - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(0.0); + Font::SetLineHeightModifier(spriteColor,0.0); } else { sprite = GHIDRA_CAST((GHIDRA_CAST(()))->Entity)::GetSprite(); @@ -633,7 +633,7 @@ LAB_00653797: pCVar14 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); fVar19 = (GHIDRA_CAST((pCVar14)))->Color::A(); pEStack_35c = GHIDRA_CAST((fVar19 * 0.5)); - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier((float)pEStack_35c); + Font::SetLineHeightModifier(spriteColor,(float)pEStack_35c); tmpEntity = GHIDRA_CAST(this->_child); vecResult = (GHIDRA_CAST((&this->_pos)))->Vector::__add(&tmpVecC,&this->_posOffset); (GHIDRA_CAST((tmpEntity)))->Entity::SetPosition(vecResult); @@ -645,11 +645,11 @@ LAB_00653797: player = GHIDRA_CAST(&this->_sprite); pEStack_35c = player; if (this->_animKey != 900) { - (GHIDRA_CAST((GHIDRA_CAST(player))))->ANM2::Play(&DAT_00b1d6fc,0); + ANM2::Play(GHIDRA_CAST(player),&DAT_00b1d6fc,0); bVar3 = EntityPtr::Ref(); set_byte_0x101(player,bVar3 & 1); animState = GHIDRA_CAST(Config)::GetPillEffects(); - uVar5 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + uVar5 = AnimationState::GetAnimationLength(animState); uVar9 = EntityPtr::Ref(); player = pEStack_35c; (GHIDRA_CAST((GHIDRA_CAST(pEStack_35c))))->Sprite::SetFrame_1(uVar9 % uVar5); @@ -786,7 +786,7 @@ LAB_00653d5c: pEStack_374 = GHIDRA_CAST(0x0); } spriteColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(0.0); + Font::SetLineHeightModifier(spriteColor,0.0); this->_subtype = 1000; } } @@ -1298,7 +1298,7 @@ LAB_006555d5: tmpColor = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&projectile->_sprite))))->Sprite)::Color(); (GHIDRA_CAST((GHIDRA_CAST(auStack_cc))))->Color::operator_assign(tmpColor); fVar19 = (GHIDRA_CAST((GHIDRA_CAST(auStack_cc))))->Color::A(); - (GHIDRA_CAST((GHIDRA_CAST(auStack_cc))))->Font::SetLineHeightModifier(fVar19 * 0.3); + Font::SetLineHeightModifier(GHIDRA_CAST(auStack_cc),fVar19 * 0.3); tmpEntity->SetColor(); } else if (sizeIndex == 7) { @@ -1418,7 +1418,7 @@ LAB_00655e83: (GHIDRA_CAST((tmpEntity)))->Entity::ClearEntityFlags(4); (GHIDRA_CAST((tmpEntity)))->Entity::SetField380(24.0); anm2 = GHIDRA_CAST((GHIDRA_CAST((tmpEntity)))->Entity)::GetSprite(); - (GHIDRA_CAST((anm2)))->ANM2::Play(GHIDRA_CAST("ReGenProjectile"),0); + ANM2::Play(anm2,GHIDRA_CAST("ReGenProjectile"),0); FUN_00440ed0(); this = projectile; bVar3 = (GHIDRA_CAST((GHIDRA_CAST(projectile))))->Entity::HasEntityFlags(0x1000000); @@ -3077,7 +3077,7 @@ LAB_0065a73e: pCVar14 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(anm2))))->Sprite)::Color(); fVar19 = (GHIDRA_CAST((pCVar14)))->Color::A(); VStack_3cc.y = fVar19 - *GHIDRA_CAST(VStack_3cc.y) * 0.1; - (GHIDRA_CAST((spriteColor)))->Font::SetLineHeightModifier(VStack_3cc.y); + Font::SetLineHeightModifier(spriteColor,VStack_3cc.y); pCVar14 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(anm2))))->Sprite)::Color(); VStack_3cc.y = (GHIDRA_CAST((pCVar14)))->Color::A(); this = projectile; @@ -3376,7 +3376,7 @@ void Entity_Projectile::Render(Vector *offset) uVar2 = uVar2 >> (rngShift & 0x1f) ^ uVar2; local_20.x = (float)((double)GHIDRA_INT(uVar2) + __uint_to_double_fixup[-(GHIDRA_INT(uVar2) >> 0x1f)]) * 2.3283062e-10 * 16.0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Render(&this->_renderPosition,&local_18,&local_20); + ANM2::Render(&this->_sprite,&this->_renderPosition,&local_18,&local_20); } if (this->_isRenderedAtGround != 0) { (this->_posOffset).y = this->_height + (this->_posOffset).y; diff --git a/generated-src/entity_slot.cpp b/generated-src/entity_slot.cpp index 49dd765..5696207 100644 --- a/generated-src/entity_slot.cpp +++ b/generated-src/entity_slot.cpp @@ -113,7 +113,7 @@ LAB_0065d9f6: puVar1 = puStack_20; if (((iVar4 == 0xc) && (1 < g_game->_frameCount - this->_spawnFrame)) && (this->_visible = 1, (this->_sprite)._animState._animData != (void *)0x0)) { - bVar2 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Ground")); + bVar2 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("Ground")); manager = g_manager; puVar1 = puStack_20; if (bVar2 != 0) { @@ -135,7 +135,7 @@ LAB_0065d9f6: *GHIDRA_CAST(&this->_flags) = isPrizeAnim & 0xfffffffb; *GHIDRA_CAST((GHIDRA_INT(&this->_flags) + 4)) = uVar12; if (iVar4 == 0xb) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Appear"),0); this->_visible = 1; } } @@ -189,32 +189,32 @@ LAB_0065db25: return; } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar2 = ANM2::IsFinishedImpl(&this->_sprite,&s_empty); if (bVar2 == 0) { ExceptionList = savedExceptionList; return; } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x410)))) = 1; iVar4 = *GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x548)))) + 0x488)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Prize"),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Prize"),0); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = savedExceptionList; return; } - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetLayerFrame(1,(iVar4 / 100) % 10); + AnimationState::SetLayerFrame(&(this->_sprite)._animState,1,(iVar4 / 100) % 10); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = savedExceptionList; return; } - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetLayerFrame(2,(iVar4 / 10) % 10); + AnimationState::SetLayerFrame(&(this->_sprite)._animState,2,(iVar4 / 10) % 10); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = savedExceptionList; return; } - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetLayerFrame(3,iVar4 % 10); + AnimationState::SetLayerFrame(&(this->_sprite)._animState,3,iVar4 % 10); ExceptionList = savedExceptionList; return; } @@ -277,10 +277,10 @@ LAB_0065df30: if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x410)))) == 3) goto LAB_0065df30; LAB_0065df69: if ((this->_variant == 10) && - (bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST("WiggleEnd")), bVar2 != 0)) { + (bVar2 = ANM2::IsFinishedImpl(&this->_sprite,GHIDRA_CAST("WiggleEnd")), bVar2 != 0)) { (GHIDRA_CAST((g_game->_room)))->Room::ShopRestockFull(); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x420)))) = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x424)))) = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x424)))) + 1; if (4 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x424))))) { (GHIDRA_CAST((&this->_dropRNG)))->RNG::Next(); @@ -291,7 +291,7 @@ LAB_0065df69: (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,&pEVar15->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); spawn_break_drops(pEVar15); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Death"),0); } } } @@ -313,23 +313,23 @@ LAB_0065df69: slotTimer = slotTimer + -1; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x41c)))) = slotTimer; if (((slotTimer == 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) == 2)) && (pEVar15->_variant == 1)) { - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("WiggleEnd"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("WiggleEnd"),0); slotTimer = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x41c)))); } } local_c0.y = 1.4013e-44; local_a8.y = (float)&DAT_0000000f; if (slotTimer == 0) { - bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST("WiggleEnd")); + bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,GHIDRA_CAST("WiggleEnd")); if ((bVar2 != 0) && (pEVar15->_variant == 1)) { - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Prize"),0); + ANM2::SetFrame(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); (GHIDRA_CAST((&pEVar15->_dropRNG)))->RNG::Next(); if (GHIDRA_UINT((pEVar15->_dropRNG)._seed) % 0x32 == 0) { isPrizeAnim = Random(); (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,&pEVar15->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); spawn_break_drops(pEVar15); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Death"),0); } else { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x414)))) = 0; @@ -399,77 +399,77 @@ LAB_0065e2a5: switch(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x414))))) { case 3: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,0), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,0), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,0), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,0), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,0); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,0); } break; case 4: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,2), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,2), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,2), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,2), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,2); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,2); } break; case 5: case 6: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,6), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,6), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,6), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,6), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,6); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,6); } break; case 7: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,4), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,4), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,4), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,4), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,4); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,4); } break; case 8: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,5), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,5), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,5), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,5), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,5); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,5); } break; case 9: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,1), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,1), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,1), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,1), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,1); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,1); } break; case 10: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,7), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,7), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,7), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,7), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,7); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,7); } break; case 0xb: case 0xc: case 0xd: if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,3), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,3), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,3), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,3), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,3); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,3); } break; default: @@ -485,11 +485,11 @@ LAB_0065e2a5: if (local_a8.y != local_c0.y) break; } while (GHIDRA_CAST(local_c0.y) == (*GHIDRA_CAST((GHIDRA_CAST(&(local_f8)) + 0x4)))); if ((((pEVar15->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(1,GHIDRA_INT(local_a8.y)), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,1,GHIDRA_INT(local_a8.y)), (pEVar15->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(2,GHIDRA_INT(local_c0.y)), + (AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,2,GHIDRA_INT(local_c0.y)), (pEVar15->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pEVar15->_sprite)._animState)))->AnimationState::SetLayerFrame(3,(*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_INT(local_f8))) + 0x4)))); + AnimationState::SetLayerFrame(&(pEVar15->_sprite)._animState,3,(*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_INT(local_f8))) + 0x4)))); } manager = g_manager; local_c0.y = 3.48923e-43; @@ -503,7 +503,7 @@ LAB_0065e2a5: if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x41c)))) == 0) { if (pEVar15->_variant == 0x10) { local_c0.y = (float)&pEVar15->_sprite; - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(local_c0.y))))->ANM2::IsFinishedImpl(GHIDRA_CAST("Wiggle")); + bVar2 = ANM2::IsFinishedImpl(GHIDRA_CAST(local_c0.y),GHIDRA_CAST("Wiggle")); if (bVar2 == 0) { sprite = GHIDRA_CAST(&pEVar15->_sprite); } @@ -516,11 +516,11 @@ LAB_0065e2a5: isPrizeAnim = isPrizeAnim - 5; } if (GHIDRA_INT(isPrizeAnim) < 0x19) { - (GHIDRA_CAST((GHIDRA_CAST(local_c0.y))))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(GHIDRA_CAST(local_c0.y),GHIDRA_CAST("Prize"),0); iVar4 = 0x10c; } else { - (GHIDRA_CAST((GHIDRA_CAST(local_c0.y))))->ANM2::Play(GHIDRA_CAST("NoPrize"),0); + ANM2::Play(GHIDRA_CAST(local_c0.y),GHIDRA_CAST("NoPrize"),0); iVar4 = 0x10b; } SoundEffects::PlayWithFartOverride(iVar4,1.0,2,0,1.0); @@ -547,22 +547,22 @@ LAB_0065e2a5: (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,&pEVar15->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); spawn_break_drops(pEVar15); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(GHIDRA_CAST(sprite),GHIDRA_CAST("Death"),0); } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::IsFinishedImpl(GHIDRA_CAST("Prize")); + bVar2 = ANM2::IsFinishedImpl(GHIDRA_CAST(sprite),GHIDRA_CAST("Prize")); if (bVar2 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x420)))) = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x420)))) + 1; if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x420)))) < 3) { - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Play(GHIDRA_CAST("Regenerate"),0); + ANM2::Play(GHIDRA_CAST(sprite),GHIDRA_CAST("Regenerate"),0); } else { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 4; - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Play(GHIDRA_CAST("OutOfPrizes"),0); + ANM2::Play(GHIDRA_CAST(sprite),GHIDRA_CAST("OutOfPrizes"),0); } } } else if (pEVar15->_variant == 0x11) { - bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Wiggle")); + bVar2 = ANM2::IsPlaying(&pEVar15->_sprite,GHIDRA_CAST("Wiggle")); if (bVar2 != 0) { local_c0.y = 0.3; iVar4 = (GHIDRA_CAST((g_game)))->Game::Difficulty(); @@ -580,7 +580,7 @@ LAB_0065e2a5: else { animName = "Prize"; } - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST(animName),0); } bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { @@ -590,7 +590,7 @@ LAB_0065e2a5: isPrizeAnim = Random(); (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,&pEVar15->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); spawn_break_drops(pEVar15); - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Death"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; } else { @@ -670,8 +670,8 @@ LAB_0065ed16: (((((iVar4 = pEVar15->_variant, iVar4 == 4 || ((((iVar4 == 5 || (iVar4 == 7)) || (iVar4 == 9)) || ((iVar4 == 0xd || (iVar4 == 0x12)))))) || (iVar4 == 0xe)) && - ((bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("PayPrize")), bVar2 != 0 && - (bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar2 == 0)))) || + ((bVar2 = ANM2::IsPlaying(&pEVar15->_sprite,GHIDRA_CAST("PayPrize")), bVar2 != 0 && + (bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,&s_empty), bVar2 == 0)))) || ((pEVar15->_variant == 6 || (pEVar15->_variant == 0xf)))))) { iVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))); if (iVar4 != 5) { @@ -679,8 +679,8 @@ LAB_0065ed16: iVar4 = pEVar15->_variant; if (((((iVar4 == 1) || (iVar4 == 3)) || (iVar4 == 2)) || ((iVar4 == 0x10 || (iVar4 == 0x11)))) && - (bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar2 != 0)) { - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Wiggle"),0); + (bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,&s_empty), bVar2 != 0)) { + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Wiggle"),0); } if (pEVar15->_variant == 0xe) { tmpVec = &pEVar15->_pos; @@ -716,10 +716,10 @@ LAB_0065ed16: if (((iVar4 == 1) || (iVar4 == 2)) || ((iVar4 == 3 || (((iVar4 == 0x13 || (iVar4 == 0x10)) || (iVar4 == 0x11)))))) { slotAnimState = GHIDRA_CAST(Config)::GetPillEffects(); - bVar2 = (GHIDRA_CAST((slotAnimState)))->AnimationState::IsLoopingAnimation(); - if ((bVar2 != 0) || (bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar2 != 0) + bVar2 = AnimationState::IsLoopingAnimation(slotAnimState); + if ((bVar2 != 0) || (bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,&s_empty), bVar2 != 0) ) { - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Broken"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Broken"),0); } } } @@ -729,7 +729,7 @@ LAB_0065ed16: if (bVar2 != 0) { pEVar15->_shadowSize = 0.0; } - bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,&s_empty); if (bVar2 != 0) { pEVar15->Remove(); } @@ -743,10 +743,10 @@ LAB_0065ed16: if (bVar2 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x424)))) = 0x1e; } - bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,&s_empty); if (bVar2 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 1; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&pEVar15->_sprite,s_Idle,0); } } goto LAB_00662654; @@ -773,7 +773,7 @@ LAB_0065ed16: (GHIDRA_CAST((prizeAnimName)))->msvc::string::string_from_cstr(GHIDRA_CAST("Prize")); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 1; pAVar14 = GHIDRA_CAST(Config)::GetPillEffects(); - (GHIDRA_CAST((pAVar14)))->ANM2::GetAnimation(GHIDRA_CAST(local_4c)); + ANM2::GetAnimation(pAVar14,GHIDRA_CAST(local_4c)); isPrizeAnim = FUN_0040c790(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_f8)) + 0x4))) = GHIDRA_CAST(CONCAT13(isPrizeAnim,(*GHIDRA_CAST((GHIDRA_CAST(&(local_f8)) + 0x4))))); (GHIDRA_CAST((local_4c)))->msvc::string::_Tidy_deallocate(); @@ -894,7 +894,7 @@ switchD_0065eef5_default: } break; case 2: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { isPrizeAnim = (GHIDRA_CAST((GHIDRA_CAST(pAVar10))))->RNG::RandomInt(100); @@ -1041,7 +1041,7 @@ LAB_0065f5b0: pEVar15 = savedSlot; break; case 3: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { iVar4 = (GHIDRA_CAST((g_game)))->Game::Difficulty(); @@ -1062,7 +1062,7 @@ LAB_0065f5b0: isPrizeAnim = Random(); (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,&pEVar15->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); spawn_break_drops(pEVar15); - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Death"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; } else { @@ -1123,7 +1123,7 @@ LAB_0065f5b0: } break; case 4: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); @@ -1183,14 +1183,14 @@ LAB_0065fdc3: (GHIDRA_CAST((g_game)))->Game::Spawn(5,100,tmpVec,&g_vectorZero,GHIDRA_CAST(0x0),GHIDRA_UINT(pAVar10),isPrizeAnim); pEVar15 = savedSlot; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((savedSlot)) + 0x410)))) = 4; - (GHIDRA_CAST((&savedSlot->_sprite)))->ANM2::Play(GHIDRA_CAST("Teleport"),0); + ANM2::Play(&savedSlot->_sprite,GHIDRA_CAST("Teleport"),0); level = GHIDRA_CAST(Config)::GetCollectibles(); (GHIDRA_CAST((level)))->Level::SetStateFlag(3,1); } } break; case 5: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); @@ -1241,7 +1241,7 @@ LAB_0065fc5e: (GHIDRA_CAST((g_game)))->Game::Spawn(5,100,tmpVec,&g_vectorZero,GHIDRA_CAST(0x0),newSlotTimer,isPrizeAnim); pEVar15 = savedSlot; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((savedSlot)) + 0x410)))) = 4; - (GHIDRA_CAST((&savedSlot->_sprite)))->ANM2::Play(GHIDRA_CAST("Teleport"),0); + ANM2::Play(&savedSlot->_sprite,GHIDRA_CAST("Teleport"),0); level = GHIDRA_CAST(Config)::GetCollectibles(); (GHIDRA_CAST((level)))->Level::SetStateFlag(4,1); } @@ -1249,7 +1249,7 @@ LAB_0065fc5e: break; case 6: case 0xf: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play((&PTR_s_Shell1Prize_00b64c30)[*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x41a))))],0); + ANM2::Play(&pEVar15->_sprite,(&PTR_s_Shell1Prize_00b64c30)[*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x41a))))],0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { isPrizeAnim = (GHIDRA_CAST((GHIDRA_CAST(pAVar10))))->RNG::RandomInt(3); @@ -1303,7 +1303,7 @@ LAB_0065fc5e: pEVar15 = savedSlot; } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 4; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Teleport"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Teleport"),0); } else { local_c8.y = 0.0; @@ -1379,14 +1379,14 @@ LAB_00660ed1: } } LAB_0066113f: - bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(&s_empty); + bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,&s_empty); if (bVar2 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 1; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&pEVar15->_sprite,s_Idle,0); } break; case 7: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); @@ -1462,13 +1462,13 @@ LAB_0066148d: } (*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x418))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 4; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Teleport"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Teleport"),0); } break; case 8: local_c8.y = (float)&pEVar15->_sprite; slotAnimState = GHIDRA_CAST(FUN_0041e470()); - bVar2 = (GHIDRA_CAST((slotAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("CoinInsert")); + bVar2 = AnimationState::IsEventTriggered(slotAnimState,GHIDRA_CAST("CoinInsert")); if (bVar2 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 1; isPrizeAnim = FUN_00424e60(0x14); @@ -1477,10 +1477,10 @@ LAB_0066148d: ; pAVar14 = GHIDRA_CAST((GHIDRA_INT(local_a8.y) + 1)); local_a8.y = (float)pAVar14; - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetFrame(GHIDRA_CAST("Prize"),0); - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetLayerFrame(1,(GHIDRA_INT(pAVar14) / 100) % 10); - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetLayerFrame(2,(GHIDRA_INT(pAVar14) / 10) % 10); - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetLayerFrame(3,GHIDRA_INT((GHIDRA_INT(local_a8.y) + (GHIDRA_INT(pAVar14) / 10) * -10))); + ANM2::SetFrame(GHIDRA_CAST(local_c8.y),GHIDRA_CAST("Prize"),0); + ANM2::SetLayerFrame(GHIDRA_CAST(local_c8.y),1,(GHIDRA_INT(pAVar14) / 100) % 10); + ANM2::SetLayerFrame(GHIDRA_CAST(local_c8.y),2,(GHIDRA_INT(pAVar14) / 10) % 10); + ANM2::SetLayerFrame(GHIDRA_CAST(local_c8.y),3,GHIDRA_INT((GHIDRA_INT(local_a8.y) + (GHIDRA_INT(pAVar14) / 10) * -10))); isPrizeAnim = (GHIDRA_CAST((GHIDRA_CAST(pAVar10))))->RNG::RandomInt(0x32); fVar18 = local_e0.y; if (isPrizeAnim == 0) { @@ -1555,7 +1555,7 @@ LAB_006616a8: isPrizeAnim = Random(); local_b0.y = (float)&pEVar15->_pos; (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,GHIDRA_CAST(local_b0.y),&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Death"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; local_e8.y = (float)&DAT_0000000f; do { @@ -1606,7 +1606,7 @@ LAB_006616a8: if (isPrizeAnim < GHIDRA_UINT((GHIDRA_INT(local_d0.y) * 3))) { bVar2 = 0; pbVar5 = GHIDRA_CAST(FUN_0065d1f0()); - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(pbVar5,bVar2); + ANM2::Play(&pEVar15->_sprite,pbVar5,bVar2); uVar12 = 0x12; LAB_00661b4b: Game::SetStateFlag(uVar12,1); @@ -1616,7 +1616,7 @@ LAB_00661b4b: } break; case 9: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { SoundEffects::PlayWithFartOverride(0xff,1.0,2,0,1.0); @@ -1648,13 +1648,13 @@ LAB_00661b4b: (GHIDRA_CAST((g_game)))->Game::Spawn(5,100,tmpVec,&g_vectorZero,GHIDRA_CAST(0x0),newSlotTimer,isPrizeAnim); pEVar15 = savedSlot; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((savedSlot)) + 0x410)))) = 4; - (GHIDRA_CAST((&savedSlot->_sprite)))->ANM2::Play(GHIDRA_CAST("Teleport"),0); + ANM2::Play(&savedSlot->_sprite,GHIDRA_CAST("Teleport"),0); } } break; case 10: slotAnimState = GHIDRA_CAST(FUN_0041e470()); - bVar2 = (GHIDRA_CAST((slotAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("CoinInsert")); + bVar2 = AnimationState::IsEventTriggered(slotAnimState,GHIDRA_CAST("CoinInsert")); if (bVar2 != 0) { iVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x420)))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 1; @@ -1702,7 +1702,7 @@ LAB_00662124: (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,&pEVar15->_pos,&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); spawn_break_drops(pEVar15); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Death"),0); } } newSlotTimer = 0xf; @@ -1714,7 +1714,7 @@ LAB_00662215: case 0xb: local_c8.y = (float)&pEVar15->_sprite; slotAnimState = GHIDRA_CAST(FUN_0041e470()); - bVar2 = (GHIDRA_CAST((slotAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("CoinInsert")); + bVar2 = AnimationState::IsEventTriggered(slotAnimState,GHIDRA_CAST("CoinInsert")); if (bVar2 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 1; isPrizeAnim = FUN_00424e60(0x73); @@ -1733,11 +1733,11 @@ LAB_00662215: local_a8.y = (float)(GHIDRA_INT((GHIDRA_CAST(local_a8.y))->_buf) + 1); } fVar18 = local_a8.y; - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetFrame(GHIDRA_CAST("Prize"),0); - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetLayerFrame(1,(GHIDRA_INT(fVar18) / 100) % 10); + ANM2::SetFrame(GHIDRA_CAST(local_c8.y),GHIDRA_CAST("Prize"),0); + ANM2::SetLayerFrame(GHIDRA_CAST(local_c8.y),1,(GHIDRA_INT(fVar18) / 100) % 10); iVar4 = GHIDRA_INT(fVar18) / 10; - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetLayerFrame(2,iVar4 % 10); - (GHIDRA_CAST((GHIDRA_CAST(local_c8.y))))->ANM2::SetLayerFrame(3,GHIDRA_INT((GHIDRA_INT(local_a8.y) + iVar4 * -10))); + ANM2::SetLayerFrame(GHIDRA_CAST(local_c8.y),2,iVar4 % 10); + ANM2::SetLayerFrame(GHIDRA_CAST(local_c8.y),3,GHIDRA_INT((GHIDRA_INT(local_a8.y) + iVar4 * -10))); pEVar15 = savedSlot; if (1 < GHIDRA_INT(local_a8.y)) { (GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((savedSlot)) + 0x548)))))))->PersistentGameData::TryUnlock(0xf2); @@ -1799,7 +1799,7 @@ LAB_00661da8: isPrizeAnim = Random(); local_b0.y = (float)&pEVar15->_pos; (GHIDRA_CAST((g_game)))->Game::Spawn(1000,1,GHIDRA_CAST(local_b0.y),&g_vectorZero,GHIDRA_CAST(0x0),0,isPrizeAnim); - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Death"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 3; local_e8.y = 2.10195e-44; do { @@ -1843,7 +1843,7 @@ LAB_00661fe0: if (local_d8.y < local_a0.y) { bVar2 = 0; pbVar5 = GHIDRA_CAST(FUN_0065d1f0()); - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(pbVar5,bVar2); + ANM2::Play(&pEVar15->_sprite,pbVar5,bVar2); uVar12 = 0x22; goto LAB_00661b4b; } @@ -1854,7 +1854,7 @@ LAB_00661fe0: KAGE_LogMessage(1,GHIDRA_CAST("Slot type %d is not implemented!\n")); break; case 0xd: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { isPrizeAnim = (GHIDRA_CAST((GHIDRA_CAST(pAVar10))))->RNG::RandomInt(0x10); @@ -1868,7 +1868,7 @@ LAB_00661fe0: (GHIDRA_CAST((g_game)))->Game::Spawn(5,100,tmpVec,&g_vectorZero,GHIDRA_CAST(0x0),isPrizeAnim,newSlotTimer); pEVar15 = savedSlot; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((savedSlot)) + 0x410)))) = 4; - (GHIDRA_CAST((&savedSlot->_sprite)))->ANM2::Play(GHIDRA_CAST("Teleport"),0); + ANM2::Play(&savedSlot->_sprite,GHIDRA_CAST("Teleport"),0); level = GHIDRA_CAST(Config)::GetCollectibles(); (GHIDRA_CAST((level)))->Level::SetStateFlag(3,1); PersistentGameData::IncreaseEventCounter @@ -1998,7 +1998,7 @@ LAB_006606b2: case 0x11: break; case 0x12: - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(GHIDRA_CAST("Prize"),0); + ANM2::Play(&pEVar15->_sprite,GHIDRA_CAST("Prize"),0); bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Prize"); if (bVar2 != 0) { isPrizeAnim = (GHIDRA_CAST((GHIDRA_CAST(pAVar10))))->RNG::RandomInt(0x18); @@ -2012,7 +2012,7 @@ LAB_006606b2: (GHIDRA_CAST((g_game)))->Game::Spawn(5,100,tmpVec,&g_vectorZero,GHIDRA_CAST(0x0),isPrizeAnim,newSlotTimer); pEVar15 = savedSlot; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((savedSlot)) + 0x410)))) = 4; - (GHIDRA_CAST((&savedSlot->_sprite)))->ANM2::Play(GHIDRA_CAST("Teleport"),0); + ANM2::Play(&savedSlot->_sprite,GHIDRA_CAST("Teleport"),0); level = GHIDRA_CAST(Config)::GetCollectibles(); (GHIDRA_CAST((level)))->Level::SetStateFlag(3,1); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x420)))) = 0; @@ -2120,7 +2120,7 @@ LAB_00660a66: break; case 0x13: slotAnimState = GHIDRA_CAST(FUN_0041e470()); - bVar2 = (GHIDRA_CAST((slotAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("CoinInsert")); + bVar2 = AnimationState::IsEventTriggered(slotAnimState,GHIDRA_CAST("CoinInsert")); if (bVar2 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 1; FUN_00704b50(1); @@ -2177,17 +2177,17 @@ LAB_006623ad: } } if ((((((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) == 2) && - (bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsFinishedImpl(&s_empty), bVar2 != 0)) && + (bVar2 = ANM2::IsFinishedImpl(&pEVar15->_sprite,&s_empty), bVar2 != 0)) && (iVar4 = pEVar15->_variant, iVar4 != 1)) && ((iVar4 != 8 && (iVar4 != 10)))) && (iVar4 != 0xb)) && (iVar4 != 0x13)) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x410)))) = 1; - (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&pEVar15->_sprite,s_Idle,0); } ehState = 0xffffffff; guard_check_icall(); LAB_00662654: if (((pEVar15->_variant == 6) || (pEVar15->_variant == 0xf)) && - ((bVar2 = (GHIDRA_CAST((&pEVar15->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("PayShuffle")), bVar2 != 0 && + ((bVar2 = ANM2::IsPlaying(&pEVar15->_sprite,GHIDRA_CAST("PayShuffle")), bVar2 != 0 && (bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&pEVar15->_sprite))))->Sprite::IsEventTriggered("Shuffle"), bVar2 != 0)))) { fVar18 = random_float(); local_a0.y = fVar18 * 0.1 + 1.0; @@ -2202,7 +2202,7 @@ LAB_00662654: *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x428)))) = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x428)))) + -1; } (GHIDRA_CAST((GHIDRA_CAST(pEVar15))))->Entity::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x42c)))))))->ANM2::Update(); + ANM2::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pEVar15)) + 0x42c))))); ExceptionList = savedExceptionList; return; } @@ -2567,7 +2567,7 @@ void Entity_Slot::Render(Vector *offset) (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Render(offset); if ((((this->_variant == 6) || (this->_variant == 0xf)) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x460)))) != 0)) && ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x470))) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x42c)))))))->ANM2::Render(&this->_renderPosition,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x42c)))),&this->_renderPosition,&g_vectorZero,&g_vectorZero); } return; } @@ -2592,7 +2592,7 @@ void Entity_Slot::SetPrizeType(int prizeType) Entity_Pickup::load_collectible_gfx (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x42c)))),7,*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x540)))),(this->_dropRNG)._seed, isCurseOfBlind); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x42c)))))))->ANM2::LoadGraphics(isCurseOfBlind); + ANM2::LoadGraphics(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x42c)))),isCurseOfBlind); return; } if (this->_variant == 0x10) { @@ -2604,7 +2604,7 @@ void Entity_Slot::SetPrizeType(int prizeType) (uint8_t)(~preventedCurses >> 6) & (uint8_t)((forcedCurses | debugCurses | curses) >> 6) & 1; Entity_Pickup::load_collectible_gfx (&this->_sprite,2,*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x540)))),(this->_dropRNG)._seed,isCurseOfBlind); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(isCurseOfBlind); + ANM2::LoadGraphics(&this->_sprite,isCurseOfBlind); } return; } diff --git a/generated-src/entity_tear.cpp b/generated-src/entity_tear.cpp index ce8a4b8..f340833 100644 --- a/generated-src/entity_tear.cpp +++ b/generated-src/entity_tear.cpp @@ -120,11 +120,11 @@ void Entity_Tear::Constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a0)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a4)))) = 0; local_8 = 6; - (GHIDRA_CAST((&this->_tearHaloANM2)))->ANM2::constructor(); + ANM2::constructor(&this->_tearHaloANM2); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 7; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::constructor(); + ANM2::constructor(&this->_tearEffectANM2); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),8); - (GHIDRA_CAST((&this->_deadEyeANM2)))->ANM2::constructor(); + ANM2::constructor(&this->_deadEyeANM2); (this->_posDisplacement).y = 0.0; (this->_posDisplacement).x = 0.0; (this->_parentOffset).y = 0.0; @@ -169,7 +169,7 @@ void Entity_Tear::Init(int type, int variant, int subType, uint32_t initSeed) ExceptionList = &local_10; (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::Init(type,variant,subType,initSeed); if (this->_config != (void *)0x0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); } this->_entityGridCollisionClass = 4; this->_collisionDamage = 3.5; @@ -239,7 +239,7 @@ void Entity_Tear::Init(int type, int variant, int subType, uint32_t initSeed) this->_deathFlags = 0; uVar1 = g_graphicsManager_flags; if (this->_variant == 0x25) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); iVar2 = 1; if ((uVar1 & 4) == 0) { iVar2 = 6; @@ -281,7 +281,7 @@ void Entity_Tear::Init(int type, int variant, int subType, uint32_t initSeed) bulletAnm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(bulletAnm2Path._buf))) + 0x0))),"gfx/promo/gfuel/bullet tear.anm2",0x21); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&bulletAnm2Path,1); + ANM2::Load(&this->_sprite,&bulletAnm2Path,1); local_8 = 0xffffffff; if (0xf < bulletAnm2Path._capacity) { uVar1 = bulletAnm2Path._capacity + 1; @@ -316,7 +316,7 @@ void Entity_Tear::Init(int type, int variant, int subType, uint32_t initSeed) local_2c._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))),"gfx/promo/gfuel/missile.anm2",0x1d); local_8 = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&local_2c,1); + ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar1 = local_2c._capacity + 1; @@ -337,7 +337,7 @@ void Entity_Tear::Init(int type, int variant, int subType, uint32_t initSeed) layerIndex = GHIDRA_CAST(0x1); } uVar1 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(&this->_sprite,layerIndex); iVar2 = 1; if ((uVar1 & 4) == 0) { iVar2 = 6; @@ -372,9 +372,9 @@ void Entity_Tear::ClearReferences() (**(code **)(*GHIDRA_CAST(this->_laserShotLaser) + 0x28))(); } (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::ClearReferences(); - (GHIDRA_CAST((&this->_tearHaloANM2)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_deadEyeANM2)))->ANM2::Reset(); + ANM2::Reset(&this->_tearHaloANM2); + ANM2::Reset(&this->_tearEffectANM2); + ANM2::Reset(&this->_deadEyeANM2); if (this->_stickTarget != (void *)0x0) { apEStack_c[0] = GHIDRA_CAST(&this->_stickTarget); msvc::multiset::erase(apEStack_c); @@ -2752,7 +2752,7 @@ LAB_00668fe9: local_87c = (*GHIDRA_CAST((GHIDRA_CAST(&(auVar31)) + 0x0))); decayFactor = (GHIDRA_CAST((GHIDRA_CAST(local_150))))->Color::A(); auVar31 = ZEXT416(local_87c); - (GHIDRA_CAST((GHIDRA_CAST(local_150))))->Font::SetLineHeightModifier(decayFactor * (float)local_87c); + Font::SetLineHeightModifier(GHIDRA_CAST(local_150),decayFactor * (float)local_87c); in_stack_ffffd9fc = GHIDRA_CAST(0xffffffff); (**(code **)(*GHIDRA_CAST(room) + 0x3c))(); } @@ -2784,7 +2784,7 @@ LAB_00668fe9: (GHIDRA_CAST((pEVar11)))->Entity::SetSpriteScale(pVVar9); auVar31 = ZEXT416(GHIDRA_UINT(zeroConst)); (GHIDRA_CAST((GHIDRA_CAST(local_7c))))->Color::Color(); - (GHIDRA_CAST((GHIDRA_CAST(local_7c))))->Font::SetLineHeightModifier(0.08); + Font::SetLineHeightModifier(GHIDRA_CAST(local_7c),0.08); this = tear; if (tear->_variant == 0x1b) { LAB_0066a2e0: @@ -2806,7 +2806,7 @@ LAB_0066a2bc: decayFactor = random_float(); (*GHIDRA_CAST((GHIDRA_CAST(&(auVar31)) + 0x0))) = GHIDRA_CAST((decayFactor * pointThreeConst + 0.2)); (*GHIDRA_CAST((GHIDRA_CAST(&(auVar31)) + 0x4))) = extraout_var_09; - (GHIDRA_CAST((GHIDRA_CAST(local_7c))))->Font::SetLineHeightModifier((*GHIDRA_CAST((GHIDRA_CAST(&((float)auVar31)) + 0x0)))); + Font::SetLineHeightModifier(GHIDRA_CAST(local_7c),(*GHIDRA_CAST((GHIDRA_CAST(&((float)auVar31)) + 0x0)))); } in_stack_ffffd9fc = GHIDRA_CAST(0xffffffff); pEVar11->SetColor(); @@ -3595,7 +3595,7 @@ LAB_0066cdbc: pEVar11 = GHIDRA_CAST(EntityPtr)::Ref(); (GHIDRA_CAST((pEVar11)))->Entity::GetNullOffset(&nullOffset,&DAT_00b1d3b0); animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar7 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + iVar7 = AnimationState::GetAnimationLength(animState); local_8ac = GHIDRA_CAST((360.0 / (float)iVar7)); local_87c = GHIDRA_CAST((GHIDRA_CAST((&nullOffset)))->Vector)::GetAngleDegrees(); normalize_angle_degrees((float)local_87c); @@ -3722,7 +3722,7 @@ LAB_0066c0c5: (GHIDRA_CAST(local_88c),GHIDRA_CAST(local_1d8)); playerEffects = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->Sprite)::Color(); decayFactor = (GHIDRA_CAST((playerEffects)))->Color::A(); - (GHIDRA_CAST((GHIDRA_CAST(local_1d8))))->Font::SetLineHeightModifier(decayFactor); + Font::SetLineHeightModifier(GHIDRA_CAST(local_1d8),decayFactor); in_stack_ffffd9fc = GHIDRA_CAST(0xff); (**(code **)(*GHIDRA_CAST(room) + 0x3c))(); } @@ -3861,7 +3861,7 @@ LAB_0066c6d8: if ((local_8a1 != '\0') && (bVar4 = (GHIDRA_CAST((&fromTarget2)))->Vector::operator_ne(&g_vectorZero), bVar4 != 0)) { animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar7 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + iVar7 = AnimationState::GetAnimationLength(animState); decayFactor = (float)iVar7; local_8c0 = GHIDRA_CAST((360.0 / decayFactor)); _empty_check_0x34(); @@ -4327,7 +4327,7 @@ LAB_0066de6b: local_8d0 = GHIDRA_CAST(((float)local_8d0 * -1.0)); } animState = GHIDRA_CAST(Config)::GetPillEffects(); - iVar7 = (GHIDRA_CAST((animState)))->AnimationState::GetAnimationLength(); + iVar7 = AnimationState::GetAnimationLength(animState); decayFactor = (float)iVar7; local_8c0 = GHIDRA_CAST((360.0 / decayFactor)); _empty_check_0x34(); @@ -5028,7 +5028,7 @@ LAB_0066fb70: room->_gridEntities[0x59] = (void *)0x0; (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->Sprite::SetRotation(180.0); outResult = GHIDRA_CAST(0x66fbea); - (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->ANM2::Play(GHIDRA_CAST("Stuck"),0); + ANM2::Play(GHIDRA_CAST((room->_gridEntities + 9)),GHIDRA_CAST("Stuck"),0); } pBVar6 = BitSet128::operator_and (&hydrobounceMask6,GHIDRA_CAST((room->_gridEntities + 0x101)), @@ -5268,7 +5268,7 @@ LAB_0067039b: local_8ac = GHIDRA_CAST(*puVar13); local_8e0 = GHIDRA_CAST(puVar13[1]); outResult = GHIDRA_CAST(0x670463); - (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->ANM2::Play(GHIDRA_CAST("Stuck"),0); + ANM2::Play(GHIDRA_CAST((room->_gridEntities + 9)),GHIDRA_CAST("Stuck"),0); if ((float)local_87c <= *GHIDRA_CAST(pRVar28)) { if (*GHIDRA_CAST(pRVar28) <= (float)local_8ac) { if ((float)local_8cc <= (float)room->_gridEntities[199]) { @@ -5541,7 +5541,8 @@ LAB_00670ae2: (GHIDRA_CAST((GHIDRA_CAST(room))))->Entity::LoadEntityConfig(); room->_gridEntities[0x58] = (void *)0x0; if (room->_gridEntities[0xc3] != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(room->_gridEntities[0xc3]) + 0x74)),1); + ANM2::Load(GHIDRA_CAST((room->_gridEntities + 9)), + GHIDRA_CAST((GHIDRA_INT(room->_gridEntities[0xc3]) + 0x74)),1); bVar4 = 0; psVar21 = (std_string *) (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->Sprite::GetDefaultAnimationName(); @@ -5637,7 +5638,8 @@ LAB_00670ae2: if (cVar5 != '\0') { (GHIDRA_CAST((GHIDRA_CAST(room))))->Entity::LoadEntityConfig(); if (room->_gridEntities[0xc3] != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(room->_gridEntities[0xc3]) + 0x74)),1); + ANM2::Load(GHIDRA_CAST((room->_gridEntities + 9)), + GHIDRA_CAST((GHIDRA_INT(room->_gridEntities[0xc3]) + 0x74)),1); bVar4 = 0; psVar21 = (std_string *) (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->Sprite::GetDefaultAnimationName(); @@ -5968,7 +5970,7 @@ LAB_006717e1: effect = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->Sprite)::Color(); decayFactor = Math::clamp(zeroConst,(float)pointSixConst, (float)room->_gridEntities[0xe0] / (float)local_8f4); - (GHIDRA_CAST((effect)))->Font::SetLineHeightModifier(oneConst - decayFactor); + Font::SetLineHeightModifier(effect,oneConst - decayFactor); local_b04 = (void *)0x3f19999a; pfVar15 = GHIDRA_CAST(std)::max(); room->_gridEntities[0xd3] = @@ -6108,9 +6110,9 @@ LAB_006722d8: local_8b0 = GHIDRA_CAST((room->_gridEntities + 0x115)); if (room->_gridEntities[0x115] == (void *)0x0) { if (((room->_gridEntities[2] == (void *)0x1a) || (room->_gridEntities[2] == (void *)0x30)) && - (bVar4 = (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->ANM2::IsPlaying(&s_empty), bVar4 == 0)) { + (bVar4 = ANM2::IsPlaying(GHIDRA_CAST((room->_gridEntities + 9)),&s_empty), bVar4 == 0)) { pAVar22 = GHIDRA_CAST(Config)::GetPillEffects(); - psVar21 = (GHIDRA_CAST((pAVar22)))->ANM2::GetAnimation(GHIDRA_CAST((local_1d8 + 0x2c))); + psVar21 = ANM2::GetAnimation(pAVar22,GHIDRA_CAST((local_1d8 + 0x2c))); ehState = 0x10; (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->Sprite::Play(psVar21,0); ehState = -1; @@ -6125,7 +6127,7 @@ LAB_006722d8: (GHIDRA_CAST((room->_gridEntities + 0x108)))->msvc::vector::clear(0); if ((room->_gridEntities[2] == (void *)0x1a) || (room->_gridEntities[2] == (void *)0x30)) { pAVar22 = GHIDRA_CAST(Config)::GetPillEffects(); - psVar21 = (GHIDRA_CAST((pAVar22)))->ANM2::GetAnimation(&curAnimName); + psVar21 = ANM2::GetAnimation(pAVar22,&curAnimName); ehState = 0xd; outResult = GHIDRA_CAST(0x6723d6); (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->Sprite::Play(psVar21,0); @@ -6141,7 +6143,7 @@ LAB_006722d8: pVVar14 = (GHIDRA_CAST((pVVar14)))->Vector::__add(&local_1450,GHIDRA_CAST((room->_gridEntities + 0x116))); (GHIDRA_CAST((pVVar9)))->Vector::operator_assign(pVVar14); if (((room->_gridEntities[2] == (void *)0x1a) || (room->_gridEntities[2] == (void *)0x30)) - && (bVar4 = (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->ANM2::IsPlaying(&s_empty), bVar4 != 0)) { + && (bVar4 = ANM2::IsPlaying(GHIDRA_CAST((room->_gridEntities + 9)),&s_empty), bVar4 != 0)) { (GHIDRA_CAST((GHIDRA_CAST((room->_gridEntities + 9)))))->Sprite::Stop(); } } @@ -6707,7 +6709,7 @@ void Entity_Tear::SetTearFlags(BitSet128 flags) local_30 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_44))) + 0x0))),"gfx/TearHalo.anm2",0x12); local_14 = 0; - (GHIDRA_CAST((&this->_tearHaloANM2)))->ANM2::Load(GHIDRA_CAST(local_44),1); + ANM2::Load(&this->_tearHaloANM2,GHIDRA_CAST(local_44),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_30)) { uVar3 = GHIDRA_INT(local_30) + 1; @@ -6722,7 +6724,7 @@ void Entity_Tear::SetTearFlags(BitSet128 flags) } operator_delete(freeBlock,uVar3); } - (GHIDRA_CAST((&this->_tearHaloANM2)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_tearHaloANM2,s_Idle,0); } if ((this->_tearEffectANM2)._loaded != 0) goto LAB_00676b9b; maskedFlags = BitSet128::operator_and(GHIDRA_CAST((local_44 + 4)),&flags,&g_tearFlagHorn); @@ -6739,7 +6741,7 @@ void Entity_Tear::SetTearFlags(BitSet128 flags) local_30 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_44))) + 0x0))),"gfx/LittleHornTearEffect.anm2",0x1e); local_14 = 1; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST(local_44),1); + ANM2::Load(&this->_tearEffectANM2,GHIDRA_CAST(local_44),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_30)) { uVar3 = GHIDRA_INT(local_30) + 1; @@ -6758,7 +6760,7 @@ void Entity_Tear::SetTearFlags(BitSet128 flags) if ((this->_tearEffectANM2)._layerCount != 0) { do { uVar3 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::GetLayer(layerIdx); + layer = ANM2::GetLayer(&this->_tearEffectANM2,layerIdx); blendDst = 1; if ((uVar3 & 4) == 0) { blendDst = 6; @@ -6798,9 +6800,9 @@ LAB_00676b6a: ((*GHIDRA_CAST((GHIDRA_INT((this->_tearEffectANM2)._animState._animData) + 0x34)) == '\0' || ((this->_tearEffectANM2)._animState._isPlaying != 0)))) goto LAB_00676b9b; } - bVar1 = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_tearEffectANM2,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_tearEffectANM2)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_tearEffectANM2)._animState); (this->_tearEffectANM2)._animState._isPlaying = 1; } goto LAB_00676b9b; @@ -6831,7 +6833,7 @@ LAB_00676b6a: local_30 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_44))) + 0x0))),"gfx/MysteriousTearEffect.anm2",0x1e); local_14 = 5; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST(local_44),1); + ANM2::Load(&this->_tearEffectANM2,GHIDRA_CAST(local_44),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_30)) { uVar3 = GHIDRA_INT(local_30) + 1; @@ -6848,7 +6850,7 @@ LAB_00676b6a: } anmBitflags = &(this->_tearEffectANM2)._bitflags; *anmBitflags = *anmBitflags | 0x3000; - layer = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_tearEffectANM2,GHIDRA_CAST(0x0)); pbVar5 = GHIDRA_CAST(0x1); layer->_bitflags = 0x1000; goto LAB_00676426; @@ -6862,7 +6864,7 @@ LAB_00676b6a: if (bVar1 == 0) goto LAB_00676b9b; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/DarkMatterTearEffect.anm2")); local_14 = 7; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_tearEffectANM2,&anm2Path,1); local_14 = 0xffffffff; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::_Tidy_deallocate(); } @@ -6878,7 +6880,7 @@ LAB_00676b6a: local_30 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_44))) + 0x0))),"gfx/FireMindTearEffect.anm2",0x1c); local_14 = 6; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST(local_44),1); + ANM2::Load(&this->_tearEffectANM2,GHIDRA_CAST(local_44),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_30)) { uVar3 = GHIDRA_INT(local_30) + 1; @@ -6896,7 +6898,7 @@ LAB_00676b6a: } anmBitflags = &(this->_tearEffectANM2)._bitflags; *anmBitflags = *anmBitflags | 0x3000; - layer = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_tearEffectANM2,GHIDRA_CAST(0x0)); layer->_bitflags = 0x1000; } else { @@ -6911,7 +6913,7 @@ LAB_00676b6a: local_30 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_44))) + 0x0))),"gfx/JacobsLadderTearEffect.anm2",0x20); local_14 = 4; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST(local_44),1); + ANM2::Load(&this->_tearEffectANM2,GHIDRA_CAST(local_44),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_30)) { uVar3 = GHIDRA_INT(local_30) + 1; @@ -6929,7 +6931,7 @@ LAB_00676b6a: pbVar5 = GHIDRA_CAST(0x0); LAB_00676426: uVar3 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::GetLayer(pbVar5); + layer = ANM2::GetLayer(&this->_tearEffectANM2,pbVar5); blendDst = 1; if ((uVar3 & 4) == 0) { blendDst = 6; @@ -6940,7 +6942,7 @@ LAB_00676426: layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; } - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_tearEffectANM2,s_Idle,0); goto LAB_00676b9b; } fStack_34 = 0.0; @@ -6954,7 +6956,7 @@ LAB_00676426: local_30 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_44))) + 0x0))),"gfx/HolyLightTearEffect.anm2",0x1d); local_14 = 3; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST(local_44),1); + ANM2::Load(&this->_tearEffectANM2,GHIDRA_CAST(local_44),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_30)) { uVar3 = GHIDRA_INT(local_30) + 1; @@ -6970,7 +6972,7 @@ LAB_00676426: operator_delete(freeBlock,uVar3); } uVar3 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_tearEffectANM2,GHIDRA_CAST(0x0)); blendDst = 1; if ((uVar3 & 4) == 0) { blendDst = 6; @@ -7015,7 +7017,7 @@ LAB_006767dc: local_30 = 4.34403e-44; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_44))) + 0x0))),"gfx/LittleHornTearEffect.anm2",0x1e); local_14 = 2; - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Load(GHIDRA_CAST(local_44),1); + ANM2::Load(&this->_tearEffectANM2,GHIDRA_CAST(local_44),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_30)) { uVar3 = GHIDRA_INT(local_30) + 1; @@ -7034,7 +7036,7 @@ LAB_006767dc: if ((this->_tearEffectANM2)._layerCount != 0) { do { uVar3 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::GetLayer(layerIdx); + layer = ANM2::GetLayer(&this->_tearEffectANM2,layerIdx); local_38 = 0.0; fStack_34 = 0.0; blendDst = 1; @@ -7047,7 +7049,7 @@ LAB_006767dc: layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; local_30 = 0.0; - layer = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::GetLayer(layerIdx); + layer = ANM2::GetLayer(&this->_tearEffectANM2,layerIdx); if (&layer->_color != GHIDRA_CAST(local_58)) { (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 0.7; @@ -7089,9 +7091,9 @@ LAB_006767e5: goto LAB_00676b9b; } } - bVar1 = (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_tearEffectANM2,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_tearEffectANM2)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_tearEffectANM2)._animState); (this->_tearEffectANM2)._animState._isPlaying = 1; } LAB_00676b9b: @@ -7353,7 +7355,7 @@ void Entity_Tear::apply_death_flag_effects(Entity *target) operator_delete(ptr,uVar4); bVar3 = extraout_CL_00; } - (GHIDRA_CAST((&childTear->_sprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&childTear->_sprite,bVar3); } local_60 = GHIDRA_CAST(this->_height); childTear->_height = (float)local_60; @@ -7575,7 +7577,7 @@ void Entity_Tear::ResetSpriteScale() format = "RegularTear%d"; } sprintf_s(animName,0x20,GHIDRA_CAST(format)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(animName,0); + ANM2::Play(&this->_sprite,animName,0); this->_scaleAnimNum = scaleAnimBase + uVar2; } if (GHIDRA_INT(uVar2) < 0xd) { @@ -7600,7 +7602,7 @@ void Entity_Tear::ResetSpriteScale() break; default: if (this->_scaleAnimNum != scaleAnimBase) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); this->_scaleAnimNum = scaleAnimBase; } case 0x28: @@ -7611,7 +7613,7 @@ switchD_006777c1_caseD_28: case 6: case 7: if (this->_scaleAnimNum != scaleAnimBase) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("MoveHori"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("MoveHori"),0); this->_scaleAnimNum = scaleAnimBase; } local_4c = this->_fScale / 2.75; @@ -7636,7 +7638,7 @@ switchD_006777c1_caseD_28: sprintf(animName,GHIDRA_CAST("Rotate%d")); if (((this->_sprite)._animState._animData == (void *)0x0) || ((this->_sprite)._animState._isPlaying == 0)) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(animName,0); + ANM2::Play(&this->_sprite,animName,0); animData = (this->_sprite)._animState._animData; if ((animData == (void *)0x0) || (uVar2 = *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x30)), uVar2 == 0)) { startFrame = 0; @@ -7647,11 +7649,11 @@ switchD_006777c1_caseD_28: animData = (this->_sprite)._animState._animData; } if (animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(startFrame)); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(startFrame)); } } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(animName,0); + ANM2::SetAnimation(&this->_sprite,animName,0); } fVar3 = local_4c; if (this->_variant == 8) { @@ -7661,16 +7663,16 @@ switchD_006777c1_caseD_28: case 9: if (this->_dead == 0) { if (this->_scaleAnimNum != scaleAnimBase) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Rotate"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Rotate"),0); this->_scaleAnimNum = scaleAnimBase; } (this->_sprite)._flipX = (this->_velocity).x <= 0.0 && (this->_velocity).x != 0.0; } goto switchD_006777c1_caseD_28; case 0x2e: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Flickering"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Flickering"),0); uVar2 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); iVar1 = 1; if ((uVar2 & 4) == 0) { iVar1 = 6; @@ -7683,7 +7685,7 @@ switchD_006777c1_caseD_28: goto switchD_006777c1_caseD_28; case 0x2f: case 0x31: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); local_4c = this->_fScale; fVar3 = local_4c; break; @@ -7699,12 +7701,12 @@ switchD_006777c1_caseD_28: this->_scaleAnimNum = uVar2 + scaleAnimBase; sprintf(animName,GHIDRA_CAST("Rotate%d")); if (this->_scaleAnimNum / 100 == GHIDRA_INT(local_48) / 100) { - iVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(animName,0); + iVar1 = ANM2::GetFrame(&this->_sprite); + ANM2::Play(&this->_sprite,animName,0); if (iVar1 < 0) goto LAB_00677c46; } else { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(animName,0); + ANM2::Play(&this->_sprite,animName,0); LAB_00677c46: animData = (this->_sprite)._animState._animData; if (animData == (void *)0x0) { @@ -7716,7 +7718,7 @@ LAB_00677c46: iVar1 = Isaac::Random(iVar1); } if (((this->_sprite)._animState._animData != (void *)0x0) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)iVar1), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)iVar1), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -7752,7 +7754,7 @@ LAB_00677c46: do { local_40 = fVar3 * g_vectorOne.x * fVar4; layerSizeY = fVar3 * g_vectorOne.y * fVar5; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(&this->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_size).x = local_40; (layer->_size).y = layerSizeY; @@ -7768,7 +7770,7 @@ LAB_00677c46: do { local_40 = this->_fScale * g_vectorOne.y * local_48; local_4c = this->_fScale * g_vectorOne.x * sizeMultiX; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(&this->_sprite,layerIndex); layerIndex = layerIndex + 1; (layer->_size).x = local_4c; (layer->_size).y = local_40; @@ -7785,24 +7787,24 @@ LAB_00677c46: (this->_tearHaloANM2)._scale.y = fVar3 * fVar5; (this->_tearHaloANM2)._scale.x = fVar3 * fVar4; if ((this->_tearHaloANM2)._loaded != 0) { - (GHIDRA_CAST((&(this->_tearHaloANM2)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_tearHaloANM2)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_tearHaloANM2)._animState); + AnimationState::Update(&(this->_tearHaloANM2)._overlayAnimState); } } if ((this->_tearEffectANM2)._loaded != 0) { fVar3 = this->_fScale * 0.45; (this->_tearEffectANM2)._scale.y = fVar3 * local_48; (this->_tearEffectANM2)._scale.x = fVar3 * sizeMultiX; - (GHIDRA_CAST((&(this->_tearEffectANM2)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_tearEffectANM2)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_tearEffectANM2)._animState); + AnimationState::Update(&(this->_tearEffectANM2)._overlayAnimState); } if (this->_deadEyeIntensity != 0.0) { fVar3 = this->_fScale * 0.45; (this->_deadEyeANM2)._scale.y = fVar3 * local_48; (this->_deadEyeANM2)._scale.x = fVar3 * sizeMultiX; if ((this->_deadEyeANM2)._loaded != 0) { - (GHIDRA_CAST((&(this->_deadEyeANM2)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_deadEyeANM2)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_deadEyeANM2)._animState); + AnimationState::Update(&(this->_deadEyeANM2)._overlayAnimState); } } (GHIDRA_CAST((GHIDRA_CAST(this))))->Entity::SetSize(*GHIDRA_CAST((GHIDRA_CAST(this->_config) + 0x38)) * this->_fScale, @@ -8253,11 +8255,11 @@ void Entity_Tear::Render(Vector *offset) (*GHIDRA_CAST((GHIDRA_INT(&(this->_tearFlags)._l) + 4)) & (*GHIDRA_CAST((GHIDRA_CAST(&(g_tearFlagGlow._l)) + 0x4)))) != 0) || ((GHIDRA_UINT((this->_tearFlags)._h) & GHIDRA_UINT(g_tearFlagGlow._h)) != 0 || (*GHIDRA_CAST((GHIDRA_INT(&(this->_tearFlags)._h) + 4)) & (*GHIDRA_CAST((GHIDRA_CAST(&(g_tearFlagGlow._h)) + 0x4)))) != 0)) { - (GHIDRA_CAST((&this->_tearHaloANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_tearHaloANM2,position,&g_vectorZero,&g_vectorZero); } if (((this->_tearEffectANM2)._loaded != 0) && ((GHIDRA_UINT((this->_tearEffectANM2)._bitflags) >> 0xd & 1) != 0)) { - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_tearEffectANM2,position,&g_vectorZero,&g_vectorZero); } spawnerPlayer = (Entity_Player *) @@ -8314,10 +8316,10 @@ void Entity_Tear::Render(Vector *offset) } if (((this->_tearEffectANM2)._loaded != 0) && ((GHIDRA_UINT((this->_tearEffectANM2)._bitflags) >> 0xd & 1) == 0)) { - (GHIDRA_CAST((&this->_tearEffectANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_tearEffectANM2,position,&g_vectorZero,&g_vectorZero); } if (this->_deadEyeIntensity != 0.0) { - (GHIDRA_CAST((&this->_deadEyeANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_deadEyeANM2,position,&g_vectorZero,&g_vectorZero); } FUN_00862b80(this,offset); } @@ -8642,7 +8644,7 @@ void Entity_Tear::SetDeadEyeIntensity(float intensity) anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/DeadEyeTearEffect.anm2",0x1b); local_14 = 0; - (GHIDRA_CAST((&this->_deadEyeANM2)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_deadEyeANM2,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar1 = anm2Path._capacity + 1; @@ -8658,7 +8660,7 @@ void Entity_Tear::SetDeadEyeIntensity(float intensity) operator_delete(ptr,uVar1); } uVar1 = g_graphicsManager_flags; - effectLayer = (GHIDRA_CAST((&this->_deadEyeANM2)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + effectLayer = ANM2::GetLayer(&this->_deadEyeANM2,GHIDRA_CAST(0x0)); blendMode = 1; if ((uVar1 & 4) == 0) { blendMode = 6; @@ -8668,7 +8670,7 @@ void Entity_Tear::SetDeadEyeIntensity(float intensity) effectLayer->_blendMode[2] = 1; effectLayer->_blendMode[3] = 1; effectLayer->_blendMode[4] = 1; - (GHIDRA_CAST((&this->_deadEyeANM2)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_deadEyeANM2,s_Idle,0); effectColor = &(this->_deadEyeANM2)._color; if (effectColor != GHIDRA_CAST(local_68)) { (this->_deadEyeANM2)._color._colorize[0] = 0.0; @@ -8803,7 +8805,7 @@ void Entity_Tear::ChangeVariant(int variant) savedScale = this->_fScale; this->LoadEntityConfig(local_24); if (this->_config != (void *)0x0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((GHIDRA_INT(this->_config) + 0x74)),1); if (this->_variant == 0xd) { isGfuelSeed = (GHIDRA_CAST((&g_game->_seedEffects)))->Seeds::HasSeedEffect(0x4f); if (isGfuelSeed != 0) { @@ -8818,7 +8820,7 @@ void Entity_Tear::ChangeVariant(int variant) bulletAnmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(bulletAnmPath._buf))) + 0x0))),"gfx/promo/gfuel/bullet tear.anm2",0x21); local_14 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&bulletAnmPath,1); + ANM2::Load(&this->_sprite,&bulletAnmPath,1); local_14 = 0xffffffff; if (0xf < bulletAnmPath._capacity) { uVar1 = bulletAnmPath._capacity + 1; @@ -8834,7 +8836,7 @@ void Entity_Tear::ChangeVariant(int variant) operator_delete(freeBlock,uVar1); } uVar1 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); blendSrc = 1; if ((uVar1 & 4) == 0) { blendSrc = 6; @@ -8860,7 +8862,7 @@ void Entity_Tear::ChangeVariant(int variant) missileAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(missileAnmPath._buf))) + 0x0))),"gfx/promo/gfuel/missile.anm2",0x1d); local_14 = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&missileAnmPath,1); + ANM2::Load(&this->_sprite,&missileAnmPath,1); local_14 = 0xffffffff; if (0xf < missileAnmPath._capacity) { uVar1 = missileAnmPath._capacity + 1; @@ -8879,7 +8881,7 @@ void Entity_Tear::ChangeVariant(int variant) missileAnmPath._size = 0; missileAnmPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(missileAnmPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(missileAnmPath._buf)) + 0x0))) & 0xffffff00; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); blendSrc = 1; if ((uVar1 & 4) == 0) { blendSrc = 6; @@ -8889,7 +8891,7 @@ void Entity_Tear::ChangeVariant(int variant) layer->_blendMode[2] = 1; layer->_blendMode[3] = 1; layer->_blendMode[4] = 1; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_bitflags = layer->_bitflags | 1; } } diff --git a/generated-src/entity_text.cpp b/generated-src/entity_text.cpp index addbb9a..1d72b71 100644 --- a/generated-src/entity_text.cpp +++ b/generated-src/entity_text.cpp @@ -105,7 +105,7 @@ void Entity_Text::Render(Vector *offset) if (*GHIDRA_CAST((GHIDRA_CAST(font) + 0x172)) != '\0') { str = GHIDRA_CAST((GHIDRA_INT(font) + 0x418)); font = &g_manager->_font6_PFTempestaSevenCondensed; - textWidth = (GHIDRA_CAST((font)))->Font::get_string_width_n(str,-1); + textWidth = Font::get_string_width_n(font,str,-1); worldY = *GHIDRA_CAST((GHIDRA_CAST(font) + 0x340)) + *GHIDRA_CAST((GHIDRA_CAST(font) + 0x350)); screenY = (g_screenHeight - 182.0) * 0.5; pixelScale = g_displayPixelRatio * g_screenPointScale; @@ -151,7 +151,7 @@ void Entity_Text::Render(Vector *offset) pos.x = screenX - (float)textWidth * 0.5 * fVar1; scale.y = fVar1; scale.x = fVar1; - (GHIDRA_CAST((font)))->Font::DrawString(str,pos,scale,GHIDRA_CAST((GHIDRA_INT(font) + 0x518)), + Font::DrawString(font,str,pos,scale,GHIDRA_CAST((GHIDRA_INT(font) + 0x518)), GHIDRA_CAST(&fontSettings)); ExceptionList = local_10; return; @@ -164,7 +164,7 @@ void Entity_Text::Render(Vector *offset) local_2c = 0; local_28 = 0; local_8 = 1; - (GHIDRA_CAST((font)))->Font::DrawString(str,GHIDRA_CAST((GHIDRA_INT(font) + 0x518)),&fontSettings, + Font::DrawString(font,str,GHIDRA_CAST((GHIDRA_INT(font) + 0x518)),&fontSettings, screenX - (float)textWidth * 0.5,*GHIDRA_CAST((GHIDRA_CAST(font) + 0x1a8))); } ExceptionList = local_10; diff --git a/generated-src/font.cpp b/generated-src/font.cpp deleted file mode 100644 index ff667dc..0000000 --- a/generated-src/font.cpp +++ /dev/null @@ -1,1139 +0,0 @@ -#include "classes.h" - -// 00407280 -void Font::SetLineHeightModifier(float modifier) -{ - *GHIDRA_CAST(&this->_paddingRight) = modifier; - return; -} - -// 0085e450 -void Font::EnableAutoWrap(uint16_t param_2) -{ - this->_stretchH = 1; - this->_aa = 0; - this->_paddingUp = 0; - this->_infoBitField = (uint8_t)param_2; - this->_charSet = (*GHIDRA_CAST((GHIDRA_CAST(&(param_2)) + 0x1))); - this->_paddingRight = 0; - this->_paddingDown = 0; - this->_paddingLeft = 0x80; - this->_spacingHoriz = 0x3f; - return; -} - -// 0085e470 -void Font::Load(uint8_t *path) -{ - Load(this,path,0); - return; -} - -// 009f0140 -Vector * Font::measure_rich_text(Vector *outSize, uint8_t *text, int maxWidth, float scale) -{ - uint32_t uVar1; - void *pvVar2; - KColor *baseColor; - int linesHeight; - void *pvVar3; - float lineWidth; - float widestLine; - KColor white; - void *linesBegin; - void *linesEnd; - int linesCapacityEnd; - float textScale; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - int *lineWidthPtr; - - puStack_c = &LAB_00b0ff7d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; - ExceptionList = &local_10; - linesBegin = (void *)0x0; - linesEnd = (void *)0x0; - linesCapacityEnd = 0; - local_8 = 0; - textScale = scale; - (GHIDRA_CAST((&white)))->KColor::SetFromARGB(0xffffffff); - rich_text_layout(this,text,baseColor,maxWidth,&linesBegin,scale); - pvVar3 = linesEnd; - linesHeight = (GHIDRA_INT(linesEnd) - GHIDRA_INT(linesBegin) >> 4) * - GHIDRA_UINT(*GHIDRA_CAST(&(this->_kerningPairs)._begin)); - outSize->x = 0.0; - outSize->y = (float)((double)linesHeight + __uint_to_double_fixup[-(linesHeight >> 0x1f)]) * - *GHIDRA_CAST(&this[1]._pages) * textScale; - if (linesBegin != linesEnd) { - pvVar2 = linesBegin; - do { - lineWidthPtr = GHIDRA_CAST((GHIDRA_INT(pvVar2) + 0xc)); - pvVar2 = (void *)(GHIDRA_INT(pvVar2) + 0x10); - lineWidth = (float)((double)*lineWidthPtr + __uint_to_double_fixup[-(*lineWidthPtr >> 0x1f)]); - widestLine = outSize->x; - if (outSize->x <= lineWidth) { - widestLine = lineWidth; - } - outSize->x = widestLine; - } while (pvVar2 != linesEnd); - } - pvVar2 = linesBegin; - if (linesBegin != (void *)0x0) { - for (; pvVar2 != pvVar3; pvVar2 = (void *)(GHIDRA_INT(pvVar2) + 0x10)) { - msvc::vector::_Tidy(uVar1); - } - uVar1 = linesCapacityEnd - GHIDRA_INT(linesBegin) & 0xfffffff0; - pvVar3 = linesBegin; - if (0xfff < uVar1) { - pvVar3 = *(void **)(GHIDRA_CAST(linesBegin) + -4); - uVar1 = uVar1 + 0x23; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(linesBegin) + (-4 - GHIDRA_INT(pvVar3))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pvVar3,uVar1); - } - ExceptionList = local_10; - return outSize; -} - -// 00a1a5c0 -void Font::SetAlignment(uint32_t param_1) -{ - uint32_t *in_ECX; - - *in_ECX = param_1; - return; -} - -// 00a1a5d0 -void Font::SetMaxCharacters(uint16_t param_1) -{ - int in_ECX; - - *GHIDRA_CAST((in_ECX + 4)) = param_1; - return; -} - -// 00a1a5e0 -short Font::GetMaxCharacters() -{ - return *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))); -} - -// 00a1a5f0 -uint8_t Font::IsAutoWrapEnabled() -{ - int iVar1; - - (*GHIDRA_CAST((GHIDRA_CAST(&(iVar1)) + 0x0))) = this->_stretchH; - (*GHIDRA_CAST((GHIDRA_CAST(&(iVar1)) + 0x2))) = this->_aa; - (*GHIDRA_CAST((GHIDRA_CAST(&(iVar1)) + 0x3))) = this->_paddingUp; - return iVar1 == 1; -} - -// 00a1a600 -void Font::EnableTruncation(uint16_t param_1) -{ - int in_ECX; - - *GHIDRA_CAST((in_ECX + 8)) = 2; - *GHIDRA_CAST((in_ECX + 6)) = param_1; - return; -} - -// 00a1a620 -bool Font::IsTruncationEnabled() -{ - int in_ECX; - - return *GHIDRA_CAST((in_ECX + 8)) == 2; -} - -// 00a1a630 -void Font::SetMissingCharacterOverride(uint32_t param_2) -{ - this->_spacingVert = (uint8_t)param_2; - this->_outline = (*GHIDRA_CAST((GHIDRA_CAST(&(param_2)) + 0x1))); - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x12)))) = (*GHIDRA_CAST((GHIDRA_CAST(&(param_2)) + 0x2))); - return; -} - -// 00a1a730 -void Font::Load(uint8_t *path, uint8_t unusedIsLoading) -{ - uint8_t bVar1; - int64_t lVar2; - char cVar3; - int *piVar4; - char *pcVar5; - uint8_t *pbVar6; - uint32_t uVar7; - void *pvVar8; - uint8_t *pbVar9; - void *kerningEnd; - uint32_t kerningCount; - uint32_t *pageTextures; - uint8_t *copySrc; - std_vector *kerningPairs; - uint8_t *copyDst; - int iVar10; - uint32_t *pageTextures; - bool bVar12; - undefined3 in_stack_00000009; - uint8_t image [4]; - int *imageRef; - int blockStart; - uint32_t local_438; - std_vector *kerningVector; - void *local_430; - uint32_t local_42c; - int *openFile; - Font *local_424; - uint8_t *local_420; - uint32_t local_41c; - uint8_t local_417 [514]; - char directory [513]; - uint32_t local_14; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b11203; - local_10 = ExceptionList; - local_14 = __security_cookie ^ GHIDRA_UINT((directory + 0x211)); - ExceptionList = &local_10; - local_424 = this; - Unload(this); - piVar4 = (GHIDRA_CAST((&PTR_vftable_00c37a10)))->FileSystem::Open(path,GHIDRA_CAST(0x0)); - if (piVar4 != GHIDRA_CAST(0x0)) { - iVar10 = -GHIDRA_INT(path); - do { - bVar1 = *path; - path = path + 1; - path[GHIDRA_INT((directory + iVar10))] = bVar1; - } while (bVar1 != 0); - pcVar5 = directory; - do { - pcVar5 = pcVar5 + 1; - } while (*pcVar5 != '\0'); - pcVar5 = pcVar5 + -1; - cVar3 = *pcVar5; - for (; ((cVar3 != '/' && (cVar3 != '\\')) && (pcVar5 != directory + 1)); pcVar5 = pcVar5 + -1) { - cVar3 = pcVar5[-1]; - } - *pcVar5 = '\0'; - local_41c = 0; - openFile = piVar4; - (**(code **)(*piVar4 + 0x14))(&local_41c,1,3); - pbVar9 = &DAT_00b82680; - pbVar6 = GHIDRA_CAST(&local_41c); - do { - bVar1 = *pbVar6; - bVar12 = bVar1 < *pbVar9; - if (bVar1 != *pbVar9) { -LAB_00a1a830: - uVar7 = -GHIDRA_UINT(bVar12) | 1; - goto LAB_00a1a835; - } - if (bVar1 == 0) break; - bVar1 = pbVar6[1]; - bVar12 = bVar1 < pbVar9[1]; - if (bVar1 != pbVar9[1]) goto LAB_00a1a830; - pbVar6 = pbVar6 + 2; - pbVar9 = pbVar9 + 2; - } while (bVar1 != 0); - uVar7 = 0; -LAB_00a1a835: - if (uVar7 == 0) { - local_417[2] = '\0'; - (**(code **)(*piVar4 + 0x14))(local_417 + 2,1,1); - if (local_417[2] == '\x03') { - cVar3 = (**(code **)(*piVar4 + 0x10))(); - while (cVar3 == '\0') { - local_417[2] = '\0'; - (**(code **)(*piVar4 + 0x14))(local_417 + 2,1,1); - local_41c = 0; - (**(code **)(*piVar4 + 0x14))(&local_41c,4,1); - blockStart = (**(code **)(*piVar4 + 8))(); - cVar3 = (**(code **)(*piVar4 + 0x10))(); - if (cVar3 != '\0') break; - switch(local_417[2]) { - case 1: - (**(code **)(*piVar4 + 0x14))(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4))),0x10,1); - break; - case 2: - (**(code **)(*piVar4 + 0x14))(&this->_lineHeight,0x10,1); - break; - case 3: - pbVar6 = operator_new_tracked(local_41c + 1); - local_420 = pbVar6; - (**(code **)(*piVar4 + 0x14))(pbVar6,1,local_41c); - pbVar6[local_41c] = 0; - uVar7 = GHIDRA_UINT((uint16_t)this->_pages); - local_424->_numPages = uVar7; - pageTextures = operator_new_tracked(-GHIDRA_UINT((0xfffffffb < uVar7 * 8)) | uVar7 * 8 + 4); - local_8 = 0; - if (pageTextures == GHIDRA_CAST(0x0)) { - pageTextures = GHIDRA_CAST(0x0); - } - else { - pageTextures = pageTextures + 1; - *pageTextures = uVar7; - _eh_vector_constructor_iterator_ - (pageTextures,8,uVar7,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040c5b0),TexturePtr::release); - } - local_42c = 0; - local_424->_pageTextures = pageTextures; - pbVar6 = local_420; - this = local_424; - if (local_424->_numPages != 0) { - do { - local_8 = 0xffffffff; - memset(local_417 + 3,0,0x200); - pcVar5 = directory + 1; - do { - cVar3 = *pcVar5; - pcVar5 = pcVar5 + 1; - } while (cVar3 != '\0'); - if (pcVar5 != directory + 2) { - sprintf(local_417 + 3,&DAT_00b7dea4); - } - pbVar9 = pbVar6; - do { - bVar1 = *pbVar9; - pbVar9 = pbVar9 + 1; - } while (bVar1 != 0); - copyDst = local_417 + 2; - do { - copySrc = copyDst + 1; - copyDst = copyDst + 1; - } while (*copySrc != 0); - copySrc = pbVar6; - for (uVar7 = GHIDRA_UINT((GHIDRA_INT(pbVar9) - GHIDRA_INT(pbVar6))) >> 2; uVar7 != 0; uVar7 = uVar7 - 1) - { - *GHIDRA_CAST(copyDst) = *GHIDRA_CAST(copySrc); - copySrc = copySrc + 4; - copyDst = copyDst + 4; - } - for (uVar7 = GHIDRA_INT(pbVar9) - GHIDRA_INT(pbVar6) & 3; uVar7 != 0; uVar7 = uVar7 - 1) { - *copyDst = *copySrc; - copySrc = copySrc + 1; - copyDst = copyDst + 1; - } - pbVar9 = GHIDRA_CAST(0x0); - if (_unusedIsLoading != GHIDRA_CAST(0x0)) { - pcVar5 = _unusedIsLoading; - do { - cVar3 = *pcVar5; - pcVar5 = pcVar5 + 1; - } while (cVar3 != '\0'); - pbVar9 = GHIDRA_CAST((pcVar5 + -GHIDRA_INT((_unusedIsLoading + 1)))); - if (pbVar9 == GHIDRA_CAST(0x3)) { - pbVar9 = local_417 + 3; - do { - bVar1 = *pbVar9; - pbVar9 = pbVar9 + 1; - } while (bVar1 != 0); - uVar7 = GHIDRA_INT(pbVar9) - GHIDRA_INT((local_417 + 4)); - pbVar9 = GHIDRA_CAST(0x0); - if ((4 < uVar7) && - (pbVar9 = local_417 + uVar7 + 3, local_417[uVar7 - 1] == 0x2e)) { - *GHIDRA_CAST((local_417 + uVar7)) = *GHIDRA_CAST(_unusedIsLoading); - local_417[uVar7 + 2] = _unusedIsLoading[2]; - } - } - } - pvVar8 = (void *)KAGE_Graphics_ImageManager::load_image_file - (image,local_417 + 3,pbVar9); - this = local_424; - uVar7 = local_42c; - local_8 = 1; - KAGE::SmartPointer::operator_assign - ((void *)(GHIDRA_INT(local_424->_pageTextures) + local_42c * 8),pvVar8); - local_8 = 2; - if (((imageRef != GHIDRA_CAST(0x0)) && - (cVar3 = (**(code **)(*imageRef + 0xc))(), cVar3 != '\0')) && - (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(image); - } - do { - bVar1 = *pbVar6; - pbVar6 = pbVar6 + 1; - } while (bVar1 != 0); - local_42c = uVar7 + 1; - } while (local_42c < GHIDRA_UINT(this->_numPages)); - } - local_8 = 0xffffffff; - if (local_420 != GHIDRA_CAST(0x0)) { - local_8 = 3; - tracked_alloc(1,local_420,0); - local_8 = 0xffffffff; - } - goto LAB_00a1ad1a; - case 4: - this->_numChars = local_41c / 0x14; - lVar2 = (uint64_t)(local_41c / 0x14) * 0x14; - pvVar8 = operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT(((uint64_t)lVar2 >> 0x20)) != 0)) | GHIDRA_UINT(lVar2)); - this->_chars = pvVar8; - (**(code **)(*piVar4 + 0x14))(pvVar8,0x14,this->_numChars); - if (this->_numChars != 0) { - iVar10 = 0; - uVar7 = 0; - do { - pageTextures = map_find_value(&this->_charsBlock,GHIDRA_INT(local_424->_chars) + iVar10); - iVar10 = iVar10 + 0x14; - *pageTextures = uVar7; - uVar7 = uVar7 + 1; - } while (uVar7 < GHIDRA_UINT(local_424->_numChars)); - this = local_424; - goto LAB_00a1ad1a; - } - break; - case 5: - kerningPairs = &this->_kerningPairs; - pvVar8 = kerningPairs->_begin; - kerningEnd = (this->_kerningPairs)._end; - kerningCount = local_41c / 10; - uVar7 = GHIDRA_INT(kerningEnd) - GHIDRA_INT(pvVar8) >> 4; - kerningVector = kerningPairs; - local_430 = kerningEnd; - if (kerningCount < uVar7) { - (this->_kerningPairs)._end = (void *)(kerningCount * 0x10 + GHIDRA_INT(pvVar8)); - } - else if (uVar7 < kerningCount) { - if (GHIDRA_UINT((GHIDRA_INT((this->_kerningPairs)._capacity) - GHIDRA_INT(pvVar8) >> 4)) < kerningCount) { - msvc::vector<16byte>::_Resize_reallocate(kerningCount,uVar7); - } - else { - iVar10 = kerningCount - uVar7; - if (iVar10 != 0) { - memset(kerningEnd,0,iVar10 * 0x10); - kerningEnd = (void *)(GHIDRA_INT(local_430) + iVar10 * 0x10); - } - (this->_kerningPairs)._end = kerningEnd; - } - } - if (kerningCount != 0) { - local_430 = (void *)0x0; - do { - pageTextures = GHIDRA_CAST((GHIDRA_INT(kerningPairs->_begin) + GHIDRA_INT(local_430))); - local_420 = GHIDRA_CAST(0x0); - (**(code **)(*openFile + 0x14))(&local_420,4,1); - pbVar6 = local_420; - local_42c = 0; - (**(code **)(*openFile + 0x14))(&local_42c,4,1); - pageTextures[1] = GHIDRA_UINT(pbVar6); - *pageTextures = local_42c; - local_420 = GHIDRA_CAST(0x0); - (**(code **)(*openFile + 0x14))(&local_420,2,1); - *GHIDRA_CAST((pageTextures + 2)) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_420)) + 0x0))); - local_430 = (void *)(GHIDRA_INT(local_430) + 0x10); - kerningCount = kerningCount - 1; - kerningPairs = kerningVector; - } while (kerningCount != 0); - } - this = local_424; - local_438 = local_438 & 0xffffff00; - msvc::_Sort_unchecked<16byte_u64key> - (GHIDRA_INT((local_424->_kerningPairs)._end) - GHIDRA_INT(kerningPairs->_begin) >> 4, - local_438); -LAB_00a1ad1a: - piVar4 = openFile; - } - (**(code **)(*piVar4 + 0xc))(local_41c + blockStart,0); - cVar3 = (**(code **)(*piVar4 + 0x10))(); - } - (**(code **)*piVar4)(1); - *GHIDRA_CAST(this) = 1; - } - } - } - ExceptionList = local_10; - return; -} - -// 00a1ad90 -void Font::Unload() -{ - void *pvVar1; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - uint32_t *pageTexturesHeader; - - puStack_c = &LAB_00b11230; - local_10 = ExceptionList; - ExceptionList = &local_10; - if (this->_chars != (void *)0x0) { - local_8 = 0; - tracked_alloc(1,this->_chars,0); - this->_chars = (void *)0x0; - } - local_8 = 0xffffffff; - pvVar1 = this->_pageTextures; - if (pvVar1 != (void *)0x0) { - pageTexturesHeader = GHIDRA_CAST((GHIDRA_INT(pvVar1) + -4)); - local_8 = 1; - _eh_vector_destructor_iterator_(pvVar1,8,*pageTexturesHeader,TexturePtr::release); - operator_delete(pageTexturesHeader,*pageTexturesHeader * 8 + 4); - this->_pageTextures = (void *)0x0; - } - pvVar1 = (this->_charsBlock)._head; - FID_conflict__Erase_tree_>_> - (&this->_charsBlock, - (fuzzer_allocator_> *)&this->_charsBlock, - *(_Tree_node **)(GHIDRA_INT(pvVar1) + 4)); - *(void **)(GHIDRA_CAST(pvVar1) + 4) = pvVar1; - *(void **)pvVar1 = pvVar1; - *(void **)(GHIDRA_CAST(pvVar1) + 8) = pvVar1; - (this->_charsBlock)._size = 0; - *GHIDRA_CAST(this) = 0; - this->_numChars = 0; - this->_numPages = 0; - ExceptionList = local_10; - return; -} - -// 00a1ae70 -void Font::GetCharacterWidth() -{ - FUN_00a1b510(); - return; -} - -// 00a1ae80 -int Font::GetStringWidth(uint8_t *str) -{ - int width; - - width = get_string_width_n(this,str,-1); - return width; -} - -// 00a1aea0 -short Font::GetLineHeight() -{ - return this->_lineHeight; -} - -// 00a1aeb0 -short Font::GetBaselineHeight() -{ - return this->_base; -} - -// 00a1aec0 -void Font::DrawStringScaled(uint8_t *text, Vector *pos, KColor *color, void *settings) -{ - float y; - uint32_t uVar1; - void *glyphs; - uint8_t glyphBuffer [16]; - float local_14; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b1125d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_UINT((glyphBuffer + 0x20)); - ExceptionList = &local_10; - y = pos->y; - local_14 = pos->x; - glyphs = measure_string(this,glyphBuffer,text,settings,&g_vectorOne); - local_8 = 0; - render_glyph_quads(this,glyphs,local_14,y,1.0,1.0,*color,settings); - msvc::vector<12byte>::clear(uVar1); - msvc::vector<12byte>::_Tidy(); - ExceptionList = local_10; - return; -} - -// 00a1af90 -void Font::DrawString(uint8_t *text, KColor *color, void *settings, float x, float y) -{ - uint32_t uVar1; - void *glyphs; - uint8_t local_2c [16]; - float posX; - float posY; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b1128d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_UINT((local_2c + 0x28)); - ExceptionList = &local_10; - posX = x; - posY = y; - glyphs = measure_string(this,local_2c,text,settings,&g_vectorOne); - local_8 = 0; - render_glyph_quads(this,glyphs,posX,posY,1.0,1.0,*color,settings); - msvc::vector<12byte>::clear(uVar1); - msvc::vector<12byte>::_Tidy(); - ExceptionList = local_10; - return; -} - -// 00a1b050 -void Font::DrawString(uint8_t *str, Vector *position, Vector *scale, KColor *color, void *settings) -{ - float scaleY; - float y; - uint32_t uVar1; - void *glyphs; - uint8_t glyphVector [16]; - float local_1c; - float scaleX; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b1128d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_UINT((glyphVector + 0x28)); - ExceptionList = &local_10; - scaleY = scale->y; - scaleX = scale->x; - y = position->y; - local_1c = position->x; - glyphs = measure_string(this,glyphVector,str,settings,scale); - local_8 = 0; - render_glyph_quads(this,glyphs,local_1c,y,scaleX,scaleY,*color,settings); - msvc::vector<12byte>::clear(uVar1); - msvc::vector<12byte>::_Tidy(); - ExceptionList = local_10; - return; -} - -// 00a1b140 -void Font::DrawString(uint8_t *str, Vector pos, Vector scale, KColor *color, FontSettings *settings) -{ - uint32_t uVar1; - void *glyphs; - uint8_t layout [16]; - Vector scaleCopy; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b1128d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_UINT((layout + 0x28)); - ExceptionList = &local_10; - scaleCopy.x = scale.x; - scaleCopy.y = scale.y; - glyphs = measure_string(this,layout,str,settings,&scaleCopy); - local_8 = 0; - render_glyph_quads(this,glyphs,pos.x,pos.y,scale.x,scale.y,*color,settings); - msvc::vector<12byte>::clear(uVar1); - msvc::vector<12byte>::_Tidy(); - ExceptionList = local_10; - return; -} - -// 00a1b210 -void Font::draw_string_wide_unscaled(short *text, float x, float y, KColor *color, void *settings) -{ - uint32_t uVar1; - void *glyphRun; - uint8_t glyphBuffer [16]; - float drawX; - float drawY; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b1128d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_UINT((glyphBuffer + 0x28)); - ExceptionList = &local_10; - drawX = x; - drawY = y; - glyphRun = layout_glyphs(this,glyphBuffer,GHIDRA_CAST(text),settings,&g_vectorOne); - local_8 = 0; - draw_glyph_run(this,drawX,drawY,glyphRun,1.0,1.0,*color,settings); - msvc::vector<12byte>::clear(uVar1); - msvc::vector<12byte>::_Tidy(); - ExceptionList = local_10; - return; -} - -// 00a1b3b0 -void Font::SetMissingCharacter(uint32_t character) -{ - uint8_t findResult [8]; - void *boundNode; - uint32_t characterLocal; - - characterLocal = character; - this->_missingCharacter = -1; - _Find_lower_bound<>(findResult,&character); - if (((*GHIDRA_CAST((GHIDRA_CAST(boundNode) + 0xd)) == '\0') && - (*GHIDRA_CAST((GHIDRA_CAST(boundNode) + 0x10)) <= characterLocal)) && - (boundNode != (this->_charsBlock)._head)) { - this->_missingCharacter = *GHIDRA_CAST((GHIDRA_CAST(boundNode) + 0x14)); - return; - } - this->_missingCharacter = -1; - return; -} - -// 00a1b410 -uint32_t Font::get_glyph_index(uint32_t param_1, uint32_t param_2) -{ - uint32_t uVar1; - int in_ECX; - int iVar2; - uint8_t local_14 [8]; - int local_c; - int local_8; - - local_8 = in_ECX; - _Find_lower_bound<>(local_14,¶m_1); - uVar1 = param_2; - if ((*GHIDRA_CAST((local_c + 0xd)) == '\0') && (*GHIDRA_CAST((local_c + 0x10)) <= param_1)) { - iVar2 = *GHIDRA_CAST((in_ECX + 0x40)); - if (local_c != iVar2) { - return *GHIDRA_CAST((local_c + 0x14)); - } - } - else { - iVar2 = *GHIDRA_CAST((in_ECX + 0x40)); - } - if (param_2 != 0xffffffff) { - _Find_lower_bound<>(local_14,¶m_2); - if (((*GHIDRA_CAST((local_c + 0xd)) == '\0') && (*GHIDRA_CAST((local_c + 0x10)) <= uVar1)) && - (local_c != iVar2)) { - return *GHIDRA_CAST((local_c + 0x14)); - } - } - return *GHIDRA_CAST((local_8 + 0x48)); -} - -// 00a1b580 -void Font::render_glyph(uint32_t ch, uint8_t unknown, uint32_t *prevChar, float x, float y, float scaleX, float scaleY, KColor color, void *glyphContext) -{ - char isAccepted; - int glyphIndex; - int iVar1; - uint32_t *puVar2; - uint32_t *extraout_EAX; - int unused; - KColor *color_00; - int unused_00; - uint32_t *dst; - float scaleXLocal; - float penX; - uint8_t renderQuad [112]; - uint32_t *callbackArgs; - uint8_t *local_144; - uint32_t *local_140; - uint16_t local_13c; - uint32_t srcQuadCopy; - uint32_t uStack_134; - uint32_t uStack_130; - uint32_t uStack_12c; - uint32_t local_128; - uint32_t uStack_124; - uint32_t uStack_120; - uint32_t uStack_11c; - uint32_t local_118; - uint32_t colorQuad [28]; - KColor cornerColor0; - KColor cornerColor1; - KColor cornerColor2; - KColor cornerColor3; - uint8_t srcQuad [16]; - KColor white; - float kernOffset; - void *glyphTable; - Vector local_20; - Vector local_18; - Vector local_10; - void *glyphs; - - local_20.y = (float)this; - glyphIndex = Font::get_glyph_index(ch,*GHIDRA_CAST((GHIDRA_CAST(glyphContext) + 0x10))); - if (glyphIndex == -1) { - return; - } - glyphs = this->_chars; - local_18.y = (float)GHIDRA_INT(*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 0x10))); - glyphTable = glyphs; - iVar1 = get_kerning(this,*prevChar,ch); - kernOffset = (float)iVar1 * scaleX; - penX = x - kernOffset; - x = penX; - if (*GHIDRA_CAST((GHIDRA_CAST(glyphContext) + 0x14)) == 0) { - local_10.x = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 8)); - local_10.y = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 10)); - local_20.x = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 4)); - local_20.y = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 6)); - scaleXLocal = scaleX; - quad_set_rect(srcQuad,&local_20,&local_10,unused); - local_10.x = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 8)) * scaleXLocal; - local_10.y = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 10)) * scaleY; - local_20.x = (float)GHIDRA_INT(*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 0xc))) * scaleXLocal + penX; - local_20.y = (float)GHIDRA_INT(*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 0xe))) * scaleY + y; - render_quad_set_rect(renderQuad,&local_20,&local_10,&color); - (**(code **)(**GHIDRA_CAST((GHIDRA_INT(this->_pageTextures) + - GHIDRA_UINT(*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 0x12))) * 8)) + 0x14)) - (srcQuad,renderQuad,g_drawRectUnset); - } - else { - callbackArgs = &ch; - local_144 = &unknown; - local_140 = prevChar; - FUN_00a11080(); - (GHIDRA_CAST((&white)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((colorQuad)))->ColorQuad::ColorQuad(color_00); - (GHIDRA_CAST((&cornerColor0)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((&cornerColor1)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((&cornerColor2)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((&cornerColor3)))->KColor::SetFromARGB(0xffffffff); - local_13c = *GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 0x10)); - local_18.x = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 8)); - local_18.y = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 10)); - local_10.x = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 4)); - local_10.y = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 6)); - puVar2 = quad_set_rect(srcQuad,&local_10,&local_18,unused_00); - srcQuadCopy = *puVar2; - uStack_134 = puVar2[1]; - uStack_130 = puVar2[2]; - uStack_12c = puVar2[3]; - local_128 = puVar2[4]; - uStack_124 = puVar2[5]; - uStack_120 = puVar2[6]; - uStack_11c = puVar2[7]; - local_118 = puVar2[8]; - local_10.x = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 8)) * scaleX; - local_10.y = (float)*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 10)) * scaleY; - local_18.x = (float)GHIDRA_INT(*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 0xc))) * scaleX + x; - local_18.y = (float)GHIDRA_INT(*GHIDRA_CAST((GHIDRA_CAST(glyphs) + glyphIndex * 0x14 + 0xe))) * scaleY + y; - render_quad_set_rect(renderQuad,&local_18,&local_10,&color); - puVar2 = extraout_EAX; - dst = colorQuad; - for (iVar1 = 0x1c; iVar1 != 0; iVar1 = iVar1 + -1) { - *dst = *puVar2; - puVar2 = puVar2 + 1; - dst = dst + 1; - } - isAccepted = (**(code **)(GHIDRA_CAST(glyphContext) + 0x14)) - (&callbackArgs,*GHIDRA_CAST((GHIDRA_CAST(glyphContext) + 0x18))); - if (isAccepted == '\0') { - return; - } - (**(code **)(**GHIDRA_CAST((GHIDRA_INT(*(void **)(GHIDRA_CAST(local_20.y) + 0x3c)) + - GHIDRA_UINT(*GHIDRA_CAST((GHIDRA_CAST(glyphTable) + glyphIndex * 0x14 + 0x12))) * 8)) + 0x14)) - (&srcQuadCopy,colorQuad,g_drawRectUnset); - } - *prevChar = ch; - return; -} - -// 00a1ba10 -int Font::get_string_width_utf16(short *text, int length) -{ - int iVar1; - int iVar2; - uint16_t *cursor; - uint32_t ch; - int width; - uint32_t prevChar; - uint32_t searchKey; - void *glyphMapHead; - uint16_t *textBegin; - uint16_t *textEnd; - uint8_t findResult [8]; - void *glyphNode; - - if ((*GHIDRA_CAST(this) == '\0') || (text == GHIDRA_CAST(0x0))) { - return 0; - } - FUN_00a55b00(text,length); - iVar2 = 0; - if (textBegin < textEnd) { - ch = GHIDRA_UINT(*textBegin); - prevChar = 0; - width = 0; - if (ch != 0) { - glyphMapHead = (this->_charsBlock)._head; - cursor = textBegin; - do { - cursor = cursor + 1; - searchKey = ch; - _Find_lower_bound<>(findResult,&searchKey); - if (((*GHIDRA_CAST((GHIDRA_CAST(glyphNode) + 0xd)) == '\0') && (*GHIDRA_CAST((GHIDRA_CAST(glyphNode) + 0x10)) <= ch)) - && (glyphNode != glyphMapHead)) { - iVar2 = *GHIDRA_CAST((GHIDRA_CAST(glyphNode) + 0x14)); - } - else { - iVar2 = this->_missingCharacter; - } - if (iVar2 != -1) { - iVar1 = get_kerning(this,prevChar,ch); - width = width + (*GHIDRA_CAST((GHIDRA_CAST(this->_chars) + iVar2 * 0x14 + 0x10)) - iVar1); - prevChar = ch; - } - iVar2 = width; - } while ((cursor < textEnd) && (ch = GHIDRA_UINT(*cursor), ch != 0)); - } - } - if (iVar2 < 0) { - iVar2 = 0; - } - return iVar2; -} - -// 00a1bb10 -void * Font::measure_string(void *outLayout, uint8_t *text, void *settings, Vector *scale) -{ - uint8_t *pbVar1; - uint16_t widthBudget; - uint32_t uVar3; - uint32_t lineWidth; - uint32_t maxWidth; - uint8_t *pbVar4; - uint8_t layout [4]; - uint8_t *linesBegin; - int linesEnd; - int linesCapacity; - uint8_t *lineCount; - uint32_t local_14; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - float scaleX; - uint32_t widthBudget; - - puStack_c = &LAB_00b1130b; - local_10 = ExceptionList; - uVar3 = __security_cookie ^ GHIDRA_UINT((layout + 0x24)); - ExceptionList = &local_10; - if (*GHIDRA_CAST((GHIDRA_CAST(settings) + 8)) == 1) { - widthBudget = *GHIDRA_CAST((GHIDRA_CAST(settings) + 6)); - scaleX = scale->x; - *GHIDRA_CAST(outLayout) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outLayout) + 4)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outLayout) + 8)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outLayout) + 0xc)) = 0; - local_8 = 0; - (GHIDRA_CAST((outLayout)))->FormattedText::set(text,this,GHIDRA_UINT(widthBudget),scaleX,0); - ExceptionList = local_10; - return outLayout; - } - layout[0] = 0; - linesBegin = GHIDRA_CAST(0x0); - linesEnd = 0; - linesCapacity = 0; - local_8 = 1; - msvc::vector<12byte>::clear(uVar3); - FormattedText::split_lines(text,&linesBegin); - layout[0] = layout[0] | 1; - local_8 = 2; - if (*GHIDRA_CAST((GHIDRA_CAST(settings) + 8)) == 2) { - maxWidth = GHIDRA_UINT(*GHIDRA_CAST((GHIDRA_CAST(settings) + 6))); - local_14 = get_string_width_n(this,&DAT_00b1cec0,-1); - if (maxWidth < local_14) { - local_14 = maxWidth; - } - local_14 = maxWidth - local_14; - text = GHIDRA_CAST(0x0); - lineCount = GHIDRA_CAST(((linesEnd - GHIDRA_INT(linesBegin)) / 0xc)); - pbVar4 = linesBegin; - if (lineCount != GHIDRA_CAST(0x0)) { - do { - get_string_width_n(this,*GHIDRA_CAST((pbVar4 + 4)),GHIDRA_UINT(*GHIDRA_CAST((pbVar4 + 8)))); - lineWidth = __ftoui3(); - widthBudget = local_14; - if (maxWidth < lineWidth) { - *GHIDRA_CAST((pbVar4 + 8)) = *GHIDRA_CAST((pbVar4 + 8)) + -1; - *pbVar4 = *pbVar4 | 1; - if (*GHIDRA_CAST((pbVar4 + 8)) != 0) { - widthBudget = *GHIDRA_CAST((pbVar4 + 8)); - do { - get_string_width_n(this,*GHIDRA_CAST((pbVar4 + 4)),GHIDRA_UINT(widthBudget)); - lineWidth = __ftoui3(); - if (lineWidth <= widthBudget) break; - pbVar1 = pbVar4 + 8; - *GHIDRA_CAST(pbVar1) = *GHIDRA_CAST(pbVar1) + -1; - widthBudget = *GHIDRA_CAST((pbVar4 + 8)); - } while (*GHIDRA_CAST(pbVar1) != 0); - } - } - text = text + 1; - pbVar4 = pbVar4 + 0xc; - } while (text < lineCount); - } - } - *GHIDRA_CAST(outLayout) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outLayout) + 4)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outLayout) + 8)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outLayout) + 0xc)) = 0; - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),3); - (GHIDRA_CAST((outLayout)))->FormattedText::operator_assign(layout); - msvc::vector<12byte>::clear(uVar3); - if (linesBegin != GHIDRA_CAST(0x0)) { - uVar3 = ((linesCapacity - GHIDRA_INT(linesBegin)) / 0xc) * 0xc; - pbVar4 = linesBegin; - if (0xfff < uVar3) { - pbVar4 = *GHIDRA_CAST((linesBegin + -4)); - uVar3 = uVar3 + 0x23; - if (GHIDRA_CAST(0x1f) < linesBegin + (-4 - GHIDRA_INT(pbVar4))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pbVar4,uVar3); - } - ExceptionList = local_10; - return outLayout; -} - -// 00a1c480 -void * Font::layout_glyphs(void *outRun, uint8_t *text, void *settings, Vector *boxSize) -{ - uint8_t *pbVar1; - uint8_t **ppbVar2; - float fVar3; - int iVar4; - Font *pFVar5; - uint16_t uVar6; - uint32_t uVar7; - Font *pFVar8; - void *_Dst; - int iVar9; - uint32_t uVar10; - uint8_t *pbVar11; - uint8_t *local_2c; - int local_28; - int local_24; - Font *local_20; - uint8_t *local_1c; - code *local_18; - Font *local_14; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - puStack_c = &LAB_00b11363; - local_10 = ExceptionList; - uVar7 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; - ExceptionList = &local_10; - local_14 = this; - if (*GHIDRA_CAST((GHIDRA_CAST(settings) + 8)) == 1) { - uVar6 = *GHIDRA_CAST((GHIDRA_CAST(settings) + 6)); - fVar3 = boxSize->x; - *GHIDRA_CAST(outRun) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outRun) + 4)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outRun) + 8)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outRun) + 0xc)) = 0; - local_8 = 0; - msvc::vector<12byte>::clear(uVar7); - local_20 = local_14; - local_14 = GHIDRA_CAST(&local_20); - local_18 = FUN_00a56bf0; - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); - local_1c = GHIDRA_CAST(fVar3); - FormattedText::split_lines_converted - (GHIDRA_CAST(text),GHIDRA_UINT(uVar6),GHIDRA_CAST((GHIDRA_INT(outRun) + 4)),FUN_00a56bf0,local_14); - *GHIDRA_CAST(outRun) = *GHIDRA_CAST(outRun) | 1; - ExceptionList = local_10; - return outRun; - } - local_2c = GHIDRA_CAST(0x0); - local_28 = 0; - local_24 = 0; - local_8 = 2; - msvc::vector<12byte>::clear(uVar7); - FormattedText::split_lines_utf16(GHIDRA_CAST(text),&local_2c); - local_8 = 3; - if (*GHIDRA_CAST((GHIDRA_CAST(settings) + 8)) == 2) { - uVar10 = GHIDRA_UINT(*GHIDRA_CAST((GHIDRA_CAST(settings) + 6))); - uVar7 = get_string_width_n(this,&DAT_00b1cec0,-1); - if (uVar10 < uVar7) { - uVar7 = uVar10; - } - local_14 = GHIDRA_CAST((uVar10 - uVar7)); - text = GHIDRA_CAST(0x0); - local_1c = GHIDRA_CAST(((local_28 - GHIDRA_INT(local_2c)) / 0xc)); - pbVar11 = local_2c; - if (local_1c != GHIDRA_CAST(0x0)) { - do { - get_string_width_utf16(this,*GHIDRA_CAST((pbVar11 + 4)),GHIDRA_UINT(*GHIDRA_CAST((pbVar11 + 8)))); - uVar7 = __ftoui3(); - pFVar5 = local_14; - if (uVar10 < uVar7) { - *GHIDRA_CAST((pbVar11 + 8)) = *GHIDRA_CAST((pbVar11 + 8)) + -1; - *pbVar11 = *pbVar11 | 1; - if (*GHIDRA_CAST((pbVar11 + 8)) != 0) { - uVar6 = *GHIDRA_CAST((pbVar11 + 8)); - do { - get_string_width_utf16(this,*GHIDRA_CAST((pbVar11 + 4)),GHIDRA_UINT(uVar6)); - pFVar8 = GHIDRA_CAST(__ftoui3()); - if (pFVar8 <= pFVar5) break; - pbVar1 = pbVar11 + 8; - *GHIDRA_CAST(pbVar1) = *GHIDRA_CAST(pbVar1) + -1; - uVar6 = *GHIDRA_CAST((pbVar11 + 8)); - } while (*GHIDRA_CAST(pbVar1) != 0); - } - } - text = text + 1; - pbVar11 = pbVar11 + 0xc; - } while (text < local_1c); - } - } - ppbVar2 = GHIDRA_CAST((GHIDRA_INT(outRun) + 4)); - *GHIDRA_CAST(outRun) = 0; - *ppbVar2 = GHIDRA_CAST(0x0); - *GHIDRA_CAST((GHIDRA_CAST(outRun) + 8)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(outRun) + 0xc)) = 0; - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),4); - *GHIDRA_CAST(outRun) = 1; - if (ppbVar2 != &local_2c) { - msvc::vector<12byte>::assign(local_2c,local_28,outRun); - } - if (((*GHIDRA_CAST(outRun) & 1) == 0) && - (iVar9 = *GHIDRA_CAST((GHIDRA_CAST(outRun) + 8)) - GHIDRA_INT(*ppbVar2), text = GHIDRA_CAST(0x0), iVar4 = iVar9 >> 0x1f, - iVar9 / 0xc + iVar4 != iVar4)) { - boxSize = GHIDRA_CAST(0x0); - do { - pbVar11 = *ppbVar2; - _Dst = operator_new_tracked(GHIDRA_UINT(*GHIDRA_CAST((GHIDRA_INT(&boxSize[1].x) + GHIDRA_INT(pbVar11)))) * 2); - memcpy(_Dst,*(void **)(GHIDRA_INT(&boxSize->y) + GHIDRA_INT(pbVar11)), - GHIDRA_UINT(*GHIDRA_CAST((GHIDRA_INT(&boxSize[1].x) + GHIDRA_INT(pbVar11)))) * 2); - *(void **)(GHIDRA_INT(&boxSize->y) + GHIDRA_INT(pbVar11)) = _Dst; - text = text + 1; - boxSize = GHIDRA_CAST(&boxSize[1].y); - } while (text < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(outRun) + 8)) - GHIDRA_INT(*ppbVar2)) / 0xc))); - } - msvc::vector<12byte>::clear(); - if (local_2c != GHIDRA_CAST(0x0)) { - uVar7 = ((local_24 - GHIDRA_INT(local_2c)) / 0xc) * 0xc; - pbVar11 = local_2c; - if (0xfff < uVar7) { - pbVar11 = *GHIDRA_CAST((local_2c + -4)); - uVar7 = uVar7 + 0x23; - if (GHIDRA_CAST(0x1f) < local_2c + (-4 - GHIDRA_INT(pbVar11))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pbVar11,uVar7); - } - ExceptionList = local_10; - return outRun; -} diff --git a/generated-src/font_settings.cpp b/generated-src/font_settings.cpp deleted file mode 100644 index 29c0d66..0000000 --- a/generated-src/font_settings.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "classes.h" - -// 00a1a540 -void FontSettings::constructor() -{ - *GHIDRA_CAST((this + 8)) = 0; - *GHIDRA_CAST(this) = 0; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))) = 0xffff; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))) = 0; - *GHIDRA_CAST((this + 4)) = 0x3f800000; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))) = 0xffffffff; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))) = 0; - *GHIDRA_CAST((this + 8)) = 0; - return; -} diff --git a/generated-src/formatted_text.cpp b/generated-src/formatted_text.cpp deleted file mode 100644 index 5f06c14..0000000 --- a/generated-src/formatted_text.cpp +++ /dev/null @@ -1,275 +0,0 @@ -#include "classes.h" - -// 00a55b70 -FormattedText::FormattedText(uint8_t *param_1) -{ - uint8_t *in_ECX; - uint8_t local_20 [4]; - uint32_t local_1c; - uint16_t local_18; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - uint8_t *linesEnd; - - puStack_c = &LAB_00b12810; - local_10 = ExceptionList; - ExceptionList = &local_10; - *in_ECX = 0; - in_ECX[4] = 0; - in_ECX[5] = 0; - in_ECX[6] = 0; - in_ECX[7] = 0; - in_ECX[8] = 0; - in_ECX[9] = 0; - in_ECX[10] = 0; - in_ECX[0xb] = 0; - in_ECX[0xc] = 0; - in_ECX[0xd] = 0; - in_ECX[0xe] = 0; - in_ECX[0xf] = 0; - local_8 = 0; - local_20[0] = *param_1; - local_1c = *GHIDRA_CAST((param_1 + 4)); - local_18 = *GHIDRA_CAST((param_1 + 8)); - *in_ECX = *in_ECX | 1; - linesEnd = *GHIDRA_CAST((in_ECX + 8)); - if (linesEnd == *GHIDRA_CAST((in_ECX + 0xc))) { - msvc::vector::_Emplace_reallocate(linesEnd,local_20); - } - else { - *linesEnd = local_20[0]; - *GHIDRA_CAST((linesEnd + 4)) = local_1c; - *GHIDRA_CAST((linesEnd + 8)) = local_18; - *GHIDRA_CAST((in_ECX + 8)) = *GHIDRA_CAST((in_ECX + 8)) + 0xc; - } - ExceptionList = local_10; - return; -} - -// 00a55ef0 -void FormattedText::split_lines(uint8_t *text, void *lines) -{ - uint8_t *pbVar1; - uint32_t uVar2; - uint8_t *linesEnd; - uint8_t scanChar; - int charCount; - uint8_t *pbVar3; - uint8_t ch; - uint8_t *pbVar4; - uint8_t *pbVar5; - uint8_t *pbVar6; - uint8_t *linesCapacityEnd; - uint8_t line [4]; - uint8_t *lineText; - short lineLength; - uint8_t *textStart; - int textLength; - uint8_t *local_10; - void *linesLocal; - uint8_t *local_8; - - charCount = 0; - textLength = 0; - pbVar3 = text; - if (*text != 0) { - do { - pbVar3 = pbVar3 + 1; - charCount = charCount + 1; - } while (*pbVar3 != 0); - textLength = charCount; - } - textStart = text; - linesLocal = lines; - do { - ch = *text; - pbVar3 = text; - lineText = text; - local_8 = text; - if (ch != 0) { - pbVar4 = text; - scanChar = ch; - do { - if (scanChar == 10) { - pbVar5 = pbVar4; - pbVar6 = pbVar4; - local_10 = pbVar4; - goto LAB_00a55f66; - } - scanChar = pbVar4[1]; - pbVar4 = pbVar4 + 1; - } while (scanChar != 0); - } - pbVar6 = GHIDRA_CAST(0x0); - local_10 = GHIDRA_CAST(0x0); - pbVar4 = GHIDRA_CAST(0x0); - pbVar5 = GHIDRA_CAST(0x0); - while (ch != 0) { -LAB_00a55f66: - uVar2 = 0; - while (ch == (&DAT_00b65584)[uVar2]) { - uVar2 = uVar2 + 1; - if (1 < uVar2) { - uVar2 = GHIDRA_UINT((pbVar5 != GHIDRA_CAST(0x0))); - if ((pbVar3 == GHIDRA_CAST(0x0)) || (pbVar5 <= pbVar3)) goto LAB_00a55fb8; - uVar2 = 2; - linesCapacityEnd = *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 8)); - linesEnd = *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 4)); - goto LAB_00a55fcb; - } - } - pbVar1 = pbVar3 + 1; - pbVar3 = pbVar3 + 1; - ch = *pbVar1; - } - if (pbVar4 == GHIDRA_CAST(0x0)) { - pbVar6 = GHIDRA_CAST(0x0); - } - uVar2 = GHIDRA_UINT((local_10 != GHIDRA_CAST(0x0))); - pbVar5 = pbVar6; -LAB_00a55fb8: - pbVar3 = pbVar5; - linesCapacityEnd = *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 8)); - linesEnd = *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 4)); - if (pbVar3 == GHIDRA_CAST(0x0)) { - lineLength = (short)textLength + ((short)textStart - (short)text); - line[0] = 0; - if (linesEnd == linesCapacityEnd) { - msvc::vector::_Emplace_reallocate(linesEnd,line); - return; - } - *GHIDRA_CAST((linesEnd + 4)) = text; - *linesEnd = 0; - *GHIDRA_CAST((linesEnd + 8)) = lineLength; - *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 4)) = *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 4)) + 0xc; - return; - } -LAB_00a55fcb: - lineLength = (short)pbVar3 - (short)text; - line[0] = 0; - if (linesEnd == linesCapacityEnd) { - msvc::vector::_Emplace_reallocate(linesEnd,line); - text = pbVar3 + uVar2; - } - else { - *linesEnd = 0; - *GHIDRA_CAST((linesEnd + 4)) = text; - *GHIDRA_CAST((linesEnd + 8)) = lineLength; - text = pbVar3 + uVar2; - *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 4)) = *GHIDRA_CAST((GHIDRA_CAST(linesLocal) + 4)) + 0xc; - } - } while( true ); -} - -// 00a56060 -void FormattedText::split_lines_utf16(short *text, void *outLines) -{ - short *psVar1; - int lengthCount; - uint32_t uVar2; - uint8_t *linesEnd; - short scanChar; - short currentChar; - uint8_t *linesCapacity; - short *lineEnd; - uint8_t newLine [4]; - short *newLineText; - uint16_t newLineLength; - short *textStart; - int textLength; - short *local_18; - short *local_14; - short *newlinePos; - short *local_c; - void *outLinesLocal; - - lengthCount = 0; - textLength = 0; - psVar1 = text; - if (*text != 0) { - do { - psVar1 = psVar1 + 1; - lengthCount = lengthCount + 1; - } while (*psVar1 != 0); - textLength = lengthCount; - } - textStart = text; - outLinesLocal = outLines; - do { - currentChar = *text; - newLineText = text; - local_c = text; - if (currentChar != 0) { - newlinePos = text; - scanChar = currentChar; - do { - if (scanChar == 10) goto LAB_00a560e3; - scanChar = newlinePos[1]; - newlinePos = newlinePos + 1; - } while (scanChar != 0); - } - newlinePos = GHIDRA_CAST(0x0); - if (currentChar != 0) { -LAB_00a560e3: - psVar1 = text; - do { - uVar2 = 0; - while (currentChar == (char)(&DAT_00b65584)[uVar2]) { - uVar2 = uVar2 + 1; - if (1 < uVar2) { - uVar2 = GHIDRA_UINT((newlinePos != GHIDRA_CAST(0x0))); - lineEnd = newlinePos; - if ((psVar1 == GHIDRA_CAST(0x0)) || (newlinePos <= psVar1)) goto LAB_00a5614b; - uVar2 = 2; - linesCapacity = *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 8)); - linesEnd = *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 4)); - goto LAB_00a56158; - } - } - currentChar = psVar1[1]; - psVar1 = psVar1 + 1; - } while (currentChar != 0); - } - lineEnd = newlinePos; - if (newlinePos == GHIDRA_CAST(0x0)) { - lineEnd = GHIDRA_CAST(0x0); - } - uVar2 = GHIDRA_UINT((newlinePos != GHIDRA_CAST(0x0))); -LAB_00a5614b: - psVar1 = lineEnd; - linesCapacity = *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 8)); - linesEnd = *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 4)); - if (psVar1 == GHIDRA_CAST(0x0)) { - newLine[0] = 0; - newLineLength = (uint16_t)((textLength * 2 - GHIDRA_INT(text)) + GHIDRA_INT(textStart) >> 1); - if (linesEnd == linesCapacity) { - local_18 = newlinePos; - local_14 = newlinePos; - msvc::vector::_Emplace_reallocate(linesEnd,newLine); - return; - } - *GHIDRA_CAST((linesEnd + 4)) = text; - *linesEnd = 0; - *GHIDRA_CAST((linesEnd + 8)) = newLineLength; - *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 4)) = *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 4)) + 0xc; - return; - } -LAB_00a56158: - newLine[0] = 0; - newLineLength = (uint16_t)(GHIDRA_INT(psVar1) - GHIDRA_INT(text) >> 1); - if (linesEnd == linesCapacity) { - local_18 = newlinePos; - local_14 = newlinePos; - msvc::vector::_Emplace_reallocate(linesEnd,newLine); - text = psVar1 + uVar2; - } - else { - *GHIDRA_CAST((linesEnd + 4)) = text; - text = psVar1 + uVar2; - *linesEnd = 0; - *GHIDRA_CAST((linesEnd + 8)) = newLineLength; - *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 4)) = *GHIDRA_CAST((GHIDRA_CAST(outLinesLocal) + 4)) + 0xc; - } - } while( true ); -} diff --git a/generated-src/fx_layers.cpp b/generated-src/fx_layers.cpp index f9e6ce2..70e851f 100644 --- a/generated-src/fx_layers.cpp +++ b/generated-src/fx_layers.cpp @@ -3100,7 +3100,7 @@ LAB_00992ee9: (*GHIDRA_CAST((GHIDRA_CAST(&(gfxPath._buf)) + 0x0))) = GHIDRA_CAST(0x0); (GHIDRA_CAST((gfxPath._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/Veins.anm2"),0xe); local_14 = 0x19; - (GHIDRA_CAST((veinsSprite)))->ANM2::Load(&gfxPath,1); + ANM2::Load(veinsSprite,&gfxPath,1); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xff; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))) = 0xffffff; if (0xf < gfxPath._capacity) { @@ -3117,16 +3117,16 @@ LAB_00993307: } operator_delete(psVar22,uVar8); } - spriteLayer = (GHIDRA_CAST((veinsSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + spriteLayer = ANM2::GetLayer(veinsSprite,GHIDRA_CAST(0x0)); spriteLayer->_minFilterMode = 1; - spriteLayer = (GHIDRA_CAST((veinsSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + spriteLayer = ANM2::GetLayer(veinsSprite,GHIDRA_CAST(0x0)); pFVar24 = pFStack_101e0; iVar7 = iVar7 + 1; veinsSprite = veinsSprite + 1; spriteLayer->_magFilterMode = 1; if (1 < iVar7) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pFStack_101e0)) + 0x2c8)))))))->ANM2::Play(GHIDRA_CAST("Vein1"),0); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pFVar24)) + 0x3dc)))))))->ANM2::Play(GHIDRA_CAST("Vein2"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pFStack_101e0)) + 0x2c8)))),GHIDRA_CAST("Vein1"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pFVar24)) + 0x3dc)))),GHIDRA_CAST("Vein2"),0); pfStack_101e8 = GHIDRA_CAST(0x0); pfStack_101e4 = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pFVar24)) + 0xec)))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pFVar24)) + 0x4f0)))) = @@ -4928,7 +4928,8 @@ void FXLayers::render_vein_branch(void *node) (g_game->_screenShakeOffset).x; renderPos.y = local_3c / pixelScale + *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1208)) + (g_game->_screenShakeOffset).y; - (GHIDRA_CAST((GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c8))) + iVar1 * 0x114)))))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c8))) + iVar1 * 0x114)),&renderPos,&g_vectorZero,&g_vectorZero + ); iVar1 = 3; do { node = (void *)(GHIDRA_INT(node) + 4); diff --git a/generated-src/game.cpp b/generated-src/game.cpp index 5ab782d..8ad5767 100644 --- a/generated-src/game.cpp +++ b/generated-src/game.cpp @@ -573,18 +573,18 @@ void Game::Update(Vector *param_2) if ((char)this->_stage != '\0') { if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x10))) != '\0') { if (this->_stageType == 0x15) goto LAB_0043061e; - (GHIDRA_CAST((GHIDRA_CAST(this->_roomList))))->ANM2::Render(param_2,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(this->_roomList),param_2,&g_vectorZero,&g_vectorZero); } if (this->_stageType == 0x15) { LAB_0043061e: manager = g_manager; textPos.x = param_2->x - 12.0; textPos.y = param_2->y + 0.0; - (GHIDRA_CAST((fontSettings)))->FontSettings::constructor(); + FontSettings::constructor(fontSettings); if (extraout_EDX < 0x14) { local_8 = 0; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((&manager->_font2_TeamMeatEx12)))->Font::DrawStringScaled(&DAT_00b1cebc,&textPos,color,settings); + Font::DrawStringScaled(&manager->_font2_TeamMeatEx12,&DAT_00b1cebc,&textPos,color,settings); ExceptionList = local_10; return; } @@ -598,12 +598,12 @@ LAB_0043061e: } local_8 = 2; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((&manager->_font2_TeamMeatEx12)))->Font::DrawStringScaled(&DAT_00b1cec0,&textPos,color_01,settings) + Font::DrawStringScaled(&manager->_font2_TeamMeatEx12,&DAT_00b1cec0,&textPos,color_01,settings) ; ExceptionList = local_10; return; } - (GHIDRA_CAST((GHIDRA_CAST(&this->_roomList[1].SpawnSeed))))->ANM2::Render(param_2,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&this->_roomList[1].SpawnSeed),param_2,&g_vectorZero,&g_vectorZero); } ExceptionList = local_10; return; @@ -946,7 +946,7 @@ void Game::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_roomTransition))) + 0x30)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_roomTransition))) + 0x34)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xc; - (GHIDRA_CAST((&(this->_roomTransition)._versusScreenSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_roomTransition)._versusScreenSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xd; FUN_0040d170(); FUN_0040d170(); @@ -1017,23 +1017,23 @@ void Game::constructor() (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1c030))) = 0; init_coop_awards(&this->_onlinePlayerStats); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x15; - (GHIDRA_CAST((&(this->_itemOverlay)._sprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_itemOverlay)._sprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x16; _eh_vector_constructor_iterator_ (&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_itemOverlay))) + 0x11c))),0x58,0x30,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_009abcf0), FUN_009abd50); (this->_itemOverlay)._player = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x18; - (GHIDRA_CAST((&(this->_itemOverlay)._megaMushPlayerSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_itemOverlay)._megaMushPlayerSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x19; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1d2f4)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1d2f4))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1a; _eh_vector_constructor_iterator_ (&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1d408))),0x38,5,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00420aa0),FUN_00420b00); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1b; *GHIDRA_CAST(&this->_gameOver) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_gameOver))) + 0x4)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_gameOver))) + 0x8)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_gameOver))) + 0x8))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1d63c))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1d640)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1d644)))) = 0; @@ -1050,9 +1050,9 @@ void Game::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x24ed0)))) = 0xffffffff; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x24ed4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x24ed8)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x24edc)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x24edc))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x20; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x24ff0)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x24ff0))))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x25104)))) = 0x3f400000; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x21; (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x25108))) = 0; @@ -1074,7 +1074,7 @@ void Game::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x25950)))) = 0x428c0000; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x25; *GHIDRA_CAST(&this->_onlineStatsScreen) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_onlineStatsScreen))) + 0x4)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_onlineStatsScreen))) + 0x4))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x26; _eh_vector_constructor_iterator_ (&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_onlineStatsScreen))) + 0x118))),0x114,4,ANM2::constructor,ANM2::~ANM2); @@ -1086,11 +1086,11 @@ void Game::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_minimap))) + 0x10)))) = 0; _eh_vector_constructor_iterator_((this->_minimap)._config,0x160,2,FUN_0098b0a0,FUN_0098b130); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x28; - (GHIDRA_CAST((&(this->_minimap)._itemIconsSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_minimap)._itemIconsSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x29; - (GHIDRA_CAST((&(this->_minimap)._hudPickupSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_minimap)._hudPickupSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x2a; - (GHIDRA_CAST((&(this->_minimap)._iconsSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_minimap)._iconsSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_minimap))) + 0x614)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_minimap))) + 0x618)))) = 0; (this->_minimap)._shakeOffset.y = 0.0; @@ -1143,10 +1143,10 @@ void Game::constructor() (this->_dailyChallenge)._seed = 0; (this->_dailyChallenge)._specialDailyId = 0; (this->_dailyChallenge)._isPractice = 0; - (GHIDRA_CAST((&(this->_dailyChallenge)._params)))->ChallengeParam::Reset(); + ChallengeParam::Reset(&(this->_dailyChallenge)._params); (GHIDRA_CAST((GHIDRA_CAST(&this->_scoreSheet))))->ScoreSheet::ScoreSheet(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x30; - (GHIDRA_CAST((&(this->_genericPrompt)._sprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_genericPrompt)._sprite); (this->_genericPrompt)._isOnlineVote = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_genericPrompt))) + 0x114)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_genericPrompt))) + 0x118)))) = 0; @@ -1154,7 +1154,7 @@ void Game::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_genericPrompt))) + 0x120)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_genericPrompt))) + 0x124)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x31; - (GHIDRA_CAST((&this->_completionWidgetSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_completionWidgetSprite); this->_encounteredBosses[0] = 0; this->_encounteredBosses[1] = 0; this->_encounteredBosses[2] = 0; @@ -1422,15 +1422,15 @@ Game::~Game() ((void *)(in_ECX + 0x269ec),0x20660,2,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006f2990)); msvc::vector::_Tidy(); local_8 = 0xc; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x268ac)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x268fc)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x268dc)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x268ac))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x268fc))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x268dc))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x268c4)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x268ac)))))->msvc::string::_Tidy_deallocate(); local_8 = 0xd; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x26778)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x267c8)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x267a8)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x26778))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x267c8))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x267a8))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x26790)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x26778)))))->msvc::string::_Tidy_deallocate(); msvc::vector<12byte>::_Tidy(); @@ -1468,17 +1468,17 @@ Game::~Game() (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d650)))))->Leaderboard::~Leaderboard(); msvc::vector<56byte_string>::_Tidy(); local_8 = 0x10; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d528)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d578)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d558)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x1d528))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x1d578))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x1d558))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d540)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d528)))))->msvc::string::_Tidy_deallocate(); local_8 = 0x11; _eh_vector_destructor_iterator_((void *)(in_ECX + 0x1d408),0x38,5,FUN_00420b00); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),0x12); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d2f4)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d344)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d324)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x1d2f4))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x1d344))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x1d324))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d30c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1d2f4)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x1c034)))))->ItemOverlay::~ItemOverlay(); @@ -1911,7 +1911,7 @@ LAB_006f3fd9: builtin_strncpy(anm2PathBuf,"gfx/ui/completion_widget.anm2",0x1e); (*GHIDRA_CAST((GHIDRA_CAST(&(fileName._buf)) + 0x0))) = anm2PathBuf; local_14 = (void *)0x8; - (GHIDRA_CAST((&temp_3f7f10adfc->_completionWidgetSprite)))->ANM2::Load(&fileName,1); + ANM2::Load(&temp_3f7f10adfc->_completionWidgetSprite,&fileName,1); local_14 = (void *)0xffffffff; if (0xf < fileName._capacity) { freeSize = fileName._capacity + 1; @@ -1929,10 +1929,10 @@ LAB_006f3fd9: fileName._size = 0; fileName._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(fileName._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(fileName._buf)) + 0x0))) & 0xffffffffffffff00; - bVar1 = (GHIDRA_CAST((&temp_3f7f10adfc->_completionWidgetSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&temp_3f7f10adfc->_completionWidgetSprite,s_Idle,1); if ((bVar1 != 0) && ((temp_3f7f10adfc->_completionWidgetSprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(temp_3f7f10adfc->_completionWidgetSprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(temp_3f7f10adfc->_completionWidgetSprite)._animState,0.0); if ((temp_3f7f10adfc->_completionWidgetSprite)._animState._animData != (void *)0x0) { (temp_3f7f10adfc->_completionWidgetSprite)._animState._isPlaying = 0; } @@ -1972,7 +1972,7 @@ void Game::reset_run_state() (this->_dailyChallenge)._seed = 0; (this->_dailyChallenge)._specialDailyId = 0; (this->_dailyChallenge)._isPractice = 0; - (GHIDRA_CAST((&(this->_dailyChallenge)._params)))->ChallengeParam::Reset(); + ChallengeParam::Reset(&(this->_dailyChallenge)._params); ScoreSheet::Reset(); (this->_currentColorModifier)._red = 1.0; (this->_currentColorModifier)._green = 1.0; @@ -2488,7 +2488,7 @@ LAB_006f5040: (*GHIDRA_CAST((GHIDRA_CAST(&(tmpName._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(tmpName._buf)) + 0x0))) & 0xffffffff00000000; (GHIDRA_CAST((tmpName._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/completion_widget.anm2"),0x1d); local_14 = (void *)0x12; - (GHIDRA_CAST((&pGVar1->_completionWidgetSprite)))->ANM2::Load(&tmpName,1); + ANM2::Load(&pGVar1->_completionWidgetSprite,&tmpName,1); local_14 = (void *)0xffffffff; if (0xf < tmpName._capacity) { uVar4 = tmpName._capacity + 1; @@ -2503,9 +2503,9 @@ LAB_006f5040: } operator_delete(pvVar3,uVar4); } - isIdleSet = (GHIDRA_CAST((&pGVar1->_completionWidgetSprite)))->ANM2::SetAnimation(s_Idle,1); + isIdleSet = ANM2::SetAnimation(&pGVar1->_completionWidgetSprite,s_Idle,1); if ((isIdleSet != 0) && ((pGVar1->_completionWidgetSprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pGVar1->_completionWidgetSprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(pGVar1->_completionWidgetSprite)._animState,0.0); if ((pGVar1->_completionWidgetSprite)._animState._animData != (void *)0x0) { (pGVar1->_completionWidgetSprite)._animState._isPlaying = 0; } @@ -5038,7 +5038,7 @@ void Game::Exit(uint8_t ShouldSave) *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameData)) + 0x25948)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameData)) + 0x2590c)))) = 0; *GHIDRA_CAST(&gameData->_gameOver) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((gameData->_gameOver))) + 0x8)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((gameData->_gameOver))) + 0x8))))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((gameData->_leaderboard))) + 0x4)))) = 0; playersEnd = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((gameData->_onlineStatsScreen))) + 0x56c)))); entryOffset = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((gameData->_onlineStatsScreen))) + 0x568)))); @@ -5073,8 +5073,8 @@ void Game::Exit(uint8_t ShouldSave) (gameData->_roomTransition)._flags = 0; (pGVar1->_playerManager)._roomTransitionPlayer = (void *)0x0; gameData->_gameStateFlags = 0; - (GHIDRA_CAST((&(gameData->_itemOverlay)._sprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(gameData->_itemOverlay)._megaMushPlayerSprite)))->ANM2::Reset(); + ANM2::Reset(&(gameData->_itemOverlay)._sprite); + ANM2::Reset(&(gameData->_itemOverlay)._megaMushPlayerSprite); (gameData->_itemOverlay)._state = 0; (gameData->_itemOverlay)._overlayID = 0; FUN_00421260(); @@ -6090,7 +6090,7 @@ LAB_006fbfa2: ((GHIDRA_CAST((&this->_genericPrompt)))->GenericPrompt::Render(), (this->_genericPrompt)._isOnlineVote != 0)) { local_84.y = g_screenHeight - 55.0; local_84.x = g_screenWidth * 0.5 - 32.0; - (GHIDRA_CAST((&this->_completionWidgetSprite)))->ANM2::Render(&local_84,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_completionWidgetSprite,&local_84,&g_vectorZero,&g_vectorZero); sprintf(GHIDRA_CAST(&local_48._green),GHIDRA_CAST("%d/%d")); manager = g_manager; FUN_00a1a580(); @@ -6426,7 +6426,8 @@ LAB_006fbfa2: pos.y = 10.0; pos.x = g_screenWidth * 0.5; local_48._green = stageTransitionProgress; - (GHIDRA_CAST((desyncFont)))->Font::DrawString(GHIDRA_CAST("DESYNCED"),pos,(Vector)0x4000000040000000,&local_48,settings); + Font::DrawString(desyncFont,GHIDRA_CAST("DESYNCED"),pos,(Vector)0x4000000040000000,&local_48,settings + ); local_14 = 0xffffffff; } render_debug_lua_memory(); @@ -11757,7 +11758,7 @@ LAB_007d021d: if (*labelText == 0x23) { isStringFound = 0; local_80.y = (float)(labelText + 1); - (GHIDRA_CAST((local_ac)))->StringTable::get_string(GHIDRA_CAST("Default"),0,GHIDRA_CAST(local_80.y),&isStringFound); + StringTable::get_string(local_ac,GHIDRA_CAST("Default"),0,GHIDRA_CAST(local_80.y),&isStringFound); if (isStringFound == 0) { isStringFound = 0; labelText = StringTable::get_string @@ -12243,7 +12244,7 @@ void Game::Render(Entity *entity, Vector *renderOffset) local_180.y = (float)&(entity->_sprite)._animState; local_100.y = (float)(renderOffsetLocal.y + pVVar5->y); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed),0.0); } lightSprite = local_130; local_150.y = 0.0; @@ -12307,7 +12308,7 @@ void Game::Render(Entity *entity, Vector *renderOffset) (room->_lightSprite)._rotation = lightSprite->_rotation + *GHIDRA_CAST(&(local_130->_animState)._isPlaying); local_110.y = local_100.y + local_170.y; - (GHIDRA_CAST((GHIDRA_CAST((this->_roomList[0x99]._doors + 6)))))->ANM2::Render(&local_110,&g_vectorZero, + ANM2::Render(GHIDRA_CAST((this->_roomList[0x99]._doors + 6)),&local_110,&g_vectorZero, &g_vectorZero); this = GHIDRA_CAST(room); } @@ -12342,7 +12343,7 @@ void Game::Render(Entity *entity, Vector *renderOffset) iVar19 = 0; do { local_100.y = *GHIDRA_CAST((iVar19 + *GHIDRA_CAST((GHIDRA_CAST(temp_5ff20d4b15) + 0x18)))); - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(local_100.y)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(local_100.y)); if ((layer->_bitflags & 4) != 0) { layerFramesBase = *GHIDRA_CAST((GHIDRA_CAST(temp_5ff20d4b15) + 0x18)); frameIndex = AnimationState::GetLayerFrameIdx @@ -12391,7 +12392,7 @@ void Game::Render(Entity *entity, Vector *renderOffset) local_120.x = fVar22 * pVVar5->x + local_100.y; LAB_00809a2f: pRVar17 = room; - (GHIDRA_CAST((&room->_lightSprite)))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero); + ANM2::Render(&room->_lightSprite,&local_120,&g_vectorZero,&g_vectorZero); goto LAB_00807b3d; } goto switchD_00809dea_caseD_2; @@ -12424,7 +12425,7 @@ LAB_00809a2f: if (bVar3 != 0) { (GHIDRA_CAST((local_148)))->BlendMode::SetMode(2,0); lightSprite = GHIDRA_CAST((this->_roomList[0x99]._doors + 6)); - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = (*GHIDRA_CAST((GHIDRA_CAST(&(local_148)) + 0x0))); layer->_blendMode[1] = (*GHIDRA_CAST((GHIDRA_CAST(&(local_148)) + 0x4))); layer->_blendMode[2] = GHIDRA_INT(local_140); @@ -12439,9 +12440,9 @@ LAB_00809a2f: fVar22 = (local_150.y + 2.0) * g_vectorOne.x; (room->_lightSprite)._scale.y = (local_150.y + 2.0) * g_vectorOne.y; (room->_lightSprite)._scale.x = fVar22; - (GHIDRA_CAST((lightSprite)))->ANM2::Render(&local_170,&g_vectorZero,&g_vectorZero); + ANM2::Render(lightSprite,&local_170,&g_vectorZero,&g_vectorZero); (GHIDRA_CAST((local_148)))->BlendMode::SetMode(1,0); - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = (*GHIDRA_CAST((GHIDRA_CAST(&(local_148)) + 0x0))); layer->_blendMode[1] = (*GHIDRA_CAST((GHIDRA_CAST(&(local_148)) + 0x4))); layer->_blendMode[2] = GHIDRA_INT(local_140); @@ -12556,7 +12557,7 @@ LAB_008078ab: (roomAlias->_lightSprite)._color._tint[3] = (float)local_108 * (roomAlias->_lightSprite)._color._tint[3]; if ((roomAlias->_lightSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(roomAlias->_lightSprite)._animState)))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(&(roomAlias->_lightSprite)._animState,1.0); } uVar15 = (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::GetCurses(); if ((uVar15 & 1) == 0) { @@ -12569,9 +12570,9 @@ LAB_008078ab: fVar22 = fVar21 * g_vectorOne.x; (roomAlias->_lightSprite)._scale.y = fVar21 * g_vectorOne.y; (roomAlias->_lightSprite)._scale.x = fVar22; - (GHIDRA_CAST((&roomAlias->_lightSprite)))->ANM2::Render(&local_170,&g_vectorZero,&g_vectorZero); + ANM2::Render(&roomAlias->_lightSprite,&local_170,&g_vectorZero,&g_vectorZero); if ((roomAlias->_lightSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(roomAlias->_lightSprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(roomAlias->_lightSprite)._animState,0.0); } bVar3 = (GHIDRA_CAST((GHIDRA_CAST(entity))))->Entity_Player::HasCollectible(0x1a9,0); if (bVar3 != 0) { @@ -12579,13 +12580,13 @@ LAB_008078ab: (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Color::Reset(); (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((roomAlias)) + 0x6ffc)))))))->Color::operator_assign(&tmpColor); (GHIDRA_CAST((local_148)))->BlendMode::SetMode(1,0); - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((roomAlias)) + 0x6f54)))))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((roomAlias)) + 0x6f54)))),GHIDRA_CAST(0x0)); layer->_blendMode[0] = (*GHIDRA_CAST((GHIDRA_CAST(&(local_148)) + 0x0))); layer->_blendMode[1] = (*GHIDRA_CAST((GHIDRA_CAST(&(local_148)) + 0x4))); layer->_blendMode[2] = GHIDRA_INT(local_140); layer->_blendMode[3] = GHIDRA_INT(local_13c.x); layer->_blendMode[4] = GHIDRA_INT(local_13c.y); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((roomAlias)) + 0x6f54)))))))->ANM2::Render(&local_170,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((roomAlias)) + 0x6f54)))),&local_170,&g_vectorZero,&g_vectorZero); roomAlias = room; } uVar15 = GetStageID(g_game,0); @@ -12623,7 +12624,7 @@ LAB_008078ab: local_108 = GHIDRA_CAST((this->_roomList[0x99]._doors + 6)); local_12c = GHIDRA_CAST(0x3ecccccd); pFVar7 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(local_108))))->Sprite)::Color(); - (GHIDRA_CAST((pFVar7)))->Font::SetLineHeightModifier(0.0); + Font::SetLineHeightModifier(pFVar7,0.0); maskedTearFlags = BitSet128::operator_and(GHIDRA_CAST(local_148),GHIDRA_CAST(tearFlags),&g_tearFlagGlow); bVar3 = (GHIDRA_CAST((maskedTearFlags)))->BitSet128::IsNonZero(); @@ -12725,7 +12726,7 @@ LAB_00808404: pCVar8 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(local_108))))->Sprite)::Color(); fVar22 = (GHIDRA_CAST((pCVar8)))->Color::A(); local_100.y = fVar22 + local_150.y; - (GHIDRA_CAST((pFVar7)))->Font::SetLineHeightModifier(local_100.y); + Font::SetLineHeightModifier(pFVar7,local_100.y); } lightSprite = local_108; pCVar8 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(local_108))))->Sprite)::Color(); @@ -12749,7 +12750,7 @@ LAB_00808404: pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(&local_170,&renderOffsetLocal); lightSprite = local_108; - (GHIDRA_CAST((local_108)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(local_108,pVVar5,pVVar16,pVVar12); if (local_130 != GHIDRA_CAST(0x0)) { (GHIDRA_CAST((GHIDRA_CAST(lightSprite))))->Sprite::SetFrame_1(0); } @@ -12780,7 +12781,7 @@ LAB_00808404: local_1a8._blue = 0.6; local_1a8._alpha = 1.0; FUN_00a0f750(); - layer = (GHIDRA_CAST((&(GHIDRA_CAST(entity))->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&(GHIDRA_CAST(entity))->_sprite,GHIDRA_CAST(0x0)); tmpColor._tint[0] = ((GHIDRA_CAST(entity))->_sprite)._color._tint[0]; tmpColor._tint[1] = ((GHIDRA_CAST(entity))->_sprite)._color._tint[1]; tmpColor._tint[2] = ((GHIDRA_CAST(entity))->_sprite)._color._tint[2]; @@ -12800,7 +12801,7 @@ LAB_00808404: local_1a8._blue = 0.6; local_1a8._alpha = 1.0; FUN_00a0f750(); - layer = (GHIDRA_CAST((&(GHIDRA_CAST(entity))->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&(GHIDRA_CAST(entity))->_sprite,GHIDRA_CAST(0x1)); tmpColor._tint[0] = ((GHIDRA_CAST(entity))->_sprite)._color._tint[0]; tmpColor._tint[1] = ((GHIDRA_CAST(entity))->_sprite)._color._tint[1]; tmpColor._tint[2] = ((GHIDRA_CAST(entity))->_sprite)._color._tint[2]; @@ -12837,12 +12838,12 @@ LAB_00808404: (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Color::SetTint((float)lightSprite,(float)temp_5ff20d4b15,(float)pAVar18, 1.0); (GHIDRA_CAST((GHIDRA_CAST((this->_roomList[0x9a]._doors + 2)))))->Color::operator_assign(&tmpColor); - layer = (GHIDRA_CAST((&(GHIDRA_CAST(entity))->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&(GHIDRA_CAST(entity))->_sprite,GHIDRA_CAST(0x0)); fVar22 = (layer->_size).y; this->_roomList[0x9a].AllowedDoors = GHIDRA_INT(((layer->_size).x * 0.4)); this->_roomList[0x9a]._doors[0] = GHIDRA_INT((fVar22 * 0.4)); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed),1.0); } local_110.y = ((GHIDRA_CAST(entity))->_pos).y - 9.0; LAB_00807d20: @@ -12850,10 +12851,10 @@ LAB_00807d20: pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_120.y = renderOffsetLocal.y + pVVar5->y; local_120.x = renderOffsetLocal.x + pVVar5->x; - (GHIDRA_CAST((GHIDRA_CAST((this->_roomList[0x99]._doors + 6)))))->ANM2::Render(&local_120,&g_vectorZero, + ANM2::Render(GHIDRA_CAST((this->_roomList[0x99]._doors + 6)),&local_120,&g_vectorZero, &g_vectorZero); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed),0.0); } } break; @@ -12870,12 +12871,12 @@ LAB_00807d20: goto LAB_00808e0d; } lightSprite = GHIDRA_CAST((GHIDRA_CAST((entity)))->Entity)::GetSprite(); - local_100.y = (float)(GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST("sparks")); + local_100.y = (float)ANM2::GetLayer(lightSprite,GHIDRA_CAST("sparks")); if (GHIDRA_CAST(local_100.y) != GHIDRA_CAST(0x0)) { (GHIDRA_CAST((entity)))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); iVar19 = _ptr_deref_or_minus1(); - temp_5ff20d4b15 = (GHIDRA_CAST((pAVar10)))->AnimationState::GetLayerFrame(iVar19); + temp_5ff20d4b15 = AnimationState::GetLayerFrame(pAVar10,iVar19); if ((temp_5ff20d4b15 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(temp_5ff20d4b15) + 0x2c)) != '\0')) { local_100.y = 0.5; pVVar5 = Vector::operator_mul @@ -13035,7 +13036,7 @@ LAB_008087da: pVVar12 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(&local_1b0,&renderOffsetLocal); - (GHIDRA_CAST((lightSprite)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(lightSprite,pVVar5,pVVar16,pVVar12); } local_150.y = (float)(GHIDRA_INT((GHIDRA_CAST(local_150.y))->_buf) + 1); } while (GHIDRA_INT(local_150.y) < 0x14); @@ -13066,7 +13067,7 @@ LAB_008087da: pVVar12 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(GHIDRA_CAST(local_178),&local_120); - (GHIDRA_CAST((lightSprite)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(lightSprite,pVVar5,pVVar16,pVVar12); } uVar15 = uVar15 + GHIDRA_INT(local_160.y); uVar9 = FUN_0042f160(); @@ -13104,7 +13105,7 @@ LAB_008087da: pVVar12 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(&local_180,pVVar16); pRVar17 = room; - (GHIDRA_CAST((&room->_lightSprite)))->ANM2::Render(pVVar5,pVVar12,pVVar11); + ANM2::Render(&room->_lightSprite,pVVar5,pVVar12,pVVar11); goto LAB_00807b3d; } local_100.y = (GHIDRA_CAST((GHIDRA_CAST(this))))->Room::GetLightingAlpha(); @@ -13276,7 +13277,7 @@ LAB_00809546: this->_roomList[0x9a].AllowedDoors = GHIDRA_INT((g_vectorOne.x * 0.6)); this->_roomList[0x9a]._doors[0] = GHIDRA_INT(fVar22); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed),1.0); } local_110.y = ((GHIDRA_CAST(entity))->_pos).y; local_110.x = ((GHIDRA_CAST(entity))->_pos).x; @@ -13291,11 +13292,11 @@ LAB_00809546: local_120.y = fVar22 * pVVar5->y + local_160.y; local_120.x = fVar22 * pVVar5->x + local_100.y; LAB_00809c03: - (GHIDRA_CAST((GHIDRA_CAST(local_188.y))))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(local_188.y),&local_120,&g_vectorZero,&g_vectorZero); LAB_00809c21: pRVar17 = room; if ((room->_lightSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(room->_lightSprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(room->_lightSprite)._animState,0.0); } goto LAB_00807b3d; } @@ -13406,7 +13407,7 @@ LAB_0080b3a9: if (-1 < GHIDRA_INT(uVar15)) { (GHIDRA_CAST((entity)))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); - local_160.y = (float)(GHIDRA_CAST((pAVar10)))->AnimationState::GetLayerFrame(GHIDRA_INT(local_130)); + local_160.y = (float)AnimationState::GetLayerFrame(pAVar10,GHIDRA_INT(local_130)); if (((void *)local_160.y != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(local_160.y) + 0x2c)) != '\0')) { pVVar5 = (GHIDRA_CAST((&local_13c)))->Vector::Vector(33.0,37.0); @@ -13485,7 +13486,7 @@ LAB_0080b3a9: this->_roomList[0x9a].AllowedDoors = GHIDRA_INT((g_vectorOne.x * 0.6)); this->_roomList[0x9a]._doors[0] = GHIDRA_INT(fVar22); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed),1.0); } local_110.y = ((GHIDRA_CAST(entity))->_pos).y - 12.0; local_110.x = ((GHIDRA_CAST(entity))->_pos).x + 0.0; @@ -13532,7 +13533,7 @@ LAB_0080b3a9: pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_120.y = renderOffsetLocal.y + pVVar5->y; local_120.x = renderOffsetLocal.x + pVVar5->x; - (GHIDRA_CAST((GHIDRA_CAST(local_100.y))))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(local_100.y),&local_120,&g_vectorZero,&g_vectorZero); (GHIDRA_CAST((GHIDRA_CAST(local_100.y))))->Sprite::SetFrame_1(0); } break; @@ -13581,7 +13582,7 @@ LAB_0080b3a9: pVVar12 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(&local_110,&renderOffsetLocal); - (GHIDRA_CAST((lightSprite)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(lightSprite,pVVar5,pVVar16,pVVar12); msvc::set::insert(); } } @@ -13596,7 +13597,7 @@ LAB_0080b3a9: if (bVar3 == 0) break; } temp_5ff20d4b15 = - (GHIDRA_CAST((&((GHIDRA_CAST(entity))->_sprite)._animState)))->AnimationState::GetLayerFrame(0); + AnimationState::GetLayerFrame(&((GHIDRA_CAST(entity))->_sprite)._animState,0); if ((temp_5ff20d4b15 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(temp_5ff20d4b15) + 0x2c)) != '\0')) { (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Color::Reset(); (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Color::SetTint(1.0,0.0,0.0,1.0); @@ -13606,10 +13607,10 @@ LAB_0080b3a9: GHIDRA_INT((((GHIDRA_CAST(entity))->_sprite)._scale.x * 0.5)); this->_roomList[0x9a]._doors[0] = GHIDRA_INT((fVar22 * 0.5)); if (this->_roomList[0x99].SavedGridEntities._begin != (void *)0x0) { - (GHIDRA_CAST((GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed))))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&this->_roomList[0x99].BossDeathSeed),1.0); } lightSprite = GHIDRA_CAST((this->_roomList[0x99]._doors + 6)); - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = DAT_00c35b58; layer->_blendMode[1] = DAT_00c35b5c; layer->_blendMode[2] = DAT_00c35b60; @@ -13620,8 +13621,8 @@ LAB_0080b3a9: pVVar5 = Isaac::GetRenderPosition(&local_13c,&local_110,1); local_120.y = renderOffsetLocal.y + pVVar5->y; local_120.x = renderOffsetLocal.x + pVVar5->x; - (GHIDRA_CAST((lightSprite)))->ANM2::Render(&local_120,&g_vectorZero,&g_vectorZero); - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + ANM2::Render(lightSprite,&local_120,&g_vectorZero,&g_vectorZero); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = DAT_00c354ac; layer->_blendMode[1] = DAT_00c354b0; layer->_blendMode[2] = DAT_00c354b4; @@ -13635,7 +13636,7 @@ LAB_0080b3a9: if (iVar19 == 0) { (GHIDRA_CAST((entity)))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); - temp_5ff20d4b15 = (GHIDRA_CAST((pAVar10)))->AnimationState::GetLayerFrame(0); + temp_5ff20d4b15 = AnimationState::GetLayerFrame(pAVar10,0); if (temp_5ff20d4b15 == (void *)0x0) break; pCVar8 = GHIDRA_CAST((GHIDRA_INT(temp_5ff20d4b15) + 0x30)); local_100.y = (GHIDRA_CAST((pCVar8)))->Color::A(); @@ -13678,13 +13679,13 @@ LAB_00809757: pVVar11 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(pVVar16,pVVar12); pRVar17 = room; - (GHIDRA_CAST((&room->_lightSprite)))->ANM2::Render(pVVar5,pVVar11,bottomrightclamp); + ANM2::Render(&room->_lightSprite,pVVar5,pVVar11,bottomrightclamp); goto LAB_00807b3d; case 0x41: color = GHIDRA_CAST((GHIDRA_CAST((entity)))->Entity)::SplatColor(); (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Color::operator_assign(color); pfVar4 = GHIDRA_CAST((GHIDRA_CAST((entity)))->Entity)::SpriteScale(); - (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Font::SetLineHeightModifier(*pfVar4); + Font::SetLineHeightModifier(GHIDRA_CAST(&tmpColor),*pfVar4); color = &tmpColor; goto LAB_0080a338; case 0x46: @@ -13725,7 +13726,7 @@ LAB_008092c5: pEVar1 = lightEntity; (GHIDRA_CAST((GHIDRA_CAST(lightEntity))))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); - temp_5ff20d4b15 = (GHIDRA_CAST((pAVar10)))->AnimationState::GetLayerFrame(0); + temp_5ff20d4b15 = AnimationState::GetLayerFrame(pAVar10,0); if (temp_5ff20d4b15 == (void *)0x0) { local_160.y = 1.0; } @@ -13747,7 +13748,7 @@ LAB_008092c5: case 0x5d: (GHIDRA_CAST((entity)))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); - temp_5ff20d4b15 = (GHIDRA_CAST((pAVar10)))->AnimationState::GetLayerFrame(0); + temp_5ff20d4b15 = AnimationState::GetLayerFrame(pAVar10,0); if (temp_5ff20d4b15 != (void *)0x0) { fVar20 = (long double)Color::RO(); local_100.y = (float)(fVar20 + (long double)1.0); @@ -13791,7 +13792,7 @@ LAB_0080a3bc: local_100.y = (float)lightSprite; (GHIDRA_CAST((entity)))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); - iVar19 = (GHIDRA_CAST((pAVar10)))->AnimationState::GetAnimationLength(); + iVar19 = AnimationState::GetAnimationLength(pAVar10); local_100.y = 1.0 - local_100.y / (float)iVar19; pKVar14 = (GHIDRA_CAST((GHIDRA_CAST((local_c8 + 0x18)))))->KColor::KColor(0.7,0.0,0.0,1.0); sprite = GHIDRA_CAST((GHIDRA_CAST((entity)))->Entity)::GetSprite(); @@ -13815,7 +13816,7 @@ LAB_0080a3bc: case 0x70: (GHIDRA_CAST((entity)))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); - temp_5ff20d4b15 = (GHIDRA_CAST((pAVar10)))->AnimationState::GetLayerFrame(0); + temp_5ff20d4b15 = AnimationState::GetLayerFrame(pAVar10,0); fVar22 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(temp_5ff20d4b15) + 0x30)))))->Color::A(); local_100.y = fVar22 * 6.4; (GHIDRA_CAST((GHIDRA_CAST(&tmpColor))))->Color::Color(0.4,0.7,1.0,local_100.y); @@ -13856,7 +13857,7 @@ LAB_0080aace: pVVar12 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal); - (GHIDRA_CAST((lightSprite)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(lightSprite,pVVar5,pVVar16,pVVar12); (GHIDRA_CAST((GHIDRA_CAST(lightSprite))))->Sprite::SetFrame_1(0); break; case 0x73: @@ -13917,11 +13918,11 @@ LAB_0080ae36: pEVar1 = lightEntity; (GHIDRA_CAST((GHIDRA_CAST(lightEntity))))->Entity::GetSprite(); local_150.y = (float)Config::GetPillEffects(); - bVar3 = (GHIDRA_CAST((GHIDRA_CAST(local_150.y))))->AnimationState::IsLoopingAnimation(); + bVar3 = AnimationState::IsLoopingAnimation(GHIDRA_CAST(local_150.y)); if (bVar3 == 0) { FUN_00407370(); local_100.y = (float)lightSprite; - iVar19 = (GHIDRA_CAST((GHIDRA_CAST(local_150.y))))->AnimationState::GetAnimationLength(); + iVar19 = AnimationState::GetAnimationLength(GHIDRA_CAST(local_150.y)); local_160.y = 1.0 - local_100.y / (float)iVar19; } else { @@ -13945,7 +13946,7 @@ LAB_0080a2e8: pVVar11 = &g_vectorZero; pVVar12 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar16)))->Vector::__add(pVVar5,&renderOffsetLocal); - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Render(pVVar5,pVVar12,pVVar11); + ANM2::Render(GHIDRA_CAST(sprite),pVVar5,pVVar12,pVVar11); (GHIDRA_CAST((sprite)))->Sprite::SetFrame_1(0); } break; @@ -13970,7 +13971,7 @@ LAB_0080a2e8: color = GHIDRA_CAST((GHIDRA_CAST((sprite)))->Sprite)::Color(); (GHIDRA_CAST((GHIDRA_CAST(lightSprite))))->Sprite::SetColor(color); pFVar7 = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(lightSprite))))->Sprite)::Color(); - (GHIDRA_CAST((pFVar7)))->Font::SetLineHeightModifier(local_150.y); + Font::SetLineHeightModifier(pFVar7,local_150.y); sprite = GHIDRA_CAST((GHIDRA_CAST((GHIDRA_CAST(pEVar1))))->Entity)::GetSprite(); pVVar5 = GHIDRA_CAST((GHIDRA_CAST((sprite)))->Sprite)::Scale(); local_100.y = 0.8; @@ -13984,7 +13985,7 @@ LAB_0080a2e8: pVVar12 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(&local_120,&renderOffsetLocal); - (GHIDRA_CAST((lightSprite)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(lightSprite,pVVar5,pVVar16,pVVar12); msvc::set::insert(); } break; @@ -14019,7 +14020,7 @@ LAB_0080a2e8: pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(&local_13c,&renderOffsetLocal); LAB_00807b32: - (GHIDRA_CAST((lightSprite)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(lightSprite,pVVar5,pVVar16,pVVar12); break; case 0xb1: iVar19 = (GHIDRA_CAST((entity)))->Entity::SubType(); @@ -14028,9 +14029,9 @@ LAB_00807b32: if (cVar2 != '\0') { (GHIDRA_CAST((entity)))->Entity::GetSprite(); pAVar10 = GHIDRA_CAST(Config)::GetPillEffects(); - local_100.y = (float)(GHIDRA_CAST((pAVar10)))->AnimationState::GetAnimationLength(); + local_100.y = (float)AnimationState::GetAnimationLength(pAVar10); lightSprite = GHIDRA_CAST((GHIDRA_CAST((entity)))->Entity)::GetSprite(); - iVar19 = (GHIDRA_CAST((lightSprite)))->ANM2::GetFrame(); + iVar19 = ANM2::GetFrame(lightSprite); if (GHIDRA_INT(local_100.y) - iVar19 < 7) { sprite = GHIDRA_CAST((this->_roomList[0x99]._doors + 6)); local_100.y = (float)(GHIDRA_INT(local_100.y) - iVar19) / 6.0; @@ -14073,7 +14074,7 @@ LAB_00807b3d: pVVar12 = &g_vectorZero; pVVar16 = &g_vectorZero; pVVar5 = (GHIDRA_CAST((pVVar5)))->Vector::__add(GHIDRA_CAST(local_178),&renderOffsetLocal); - (GHIDRA_CAST((lightSprite)))->ANM2::Render(pVVar5,pVVar16,pVVar12); + ANM2::Render(lightSprite,pVVar5,pVVar16,pVVar12); (GHIDRA_CAST((GHIDRA_CAST(lightSprite))))->Sprite::SetFrame_1(0); } DAT_00c7977e = 0; diff --git a/generated-src/game_over.cpp b/generated-src/game_over.cpp index 66c892c..bba5ce0 100644 --- a/generated-src/game_over.cpp +++ b/generated-src/game_over.cpp @@ -250,7 +250,7 @@ LAB_008ec408: local_30._green = slotY + (float)local_a4._unk; local_30._red = slotX + local_8c; in_stack_ffffff14 = GHIDRA_CAST(0x8ec44e); - (GHIDRA_CAST((memberSprite)))->ANM2::Render(GHIDRA_CAST(&local_30),&g_vectorZero,&g_vectorZero); + ANM2::Render(memberSprite,GHIDRA_CAST(&local_30),&g_vectorZero,&g_vectorZero); } if ((memberSprite->_animState)._animData == (void *)0x0) { slotX = slotX + local_8c; @@ -259,7 +259,7 @@ LAB_008ec408: local_8c = slotY; } else { - nullFrame = (GHIDRA_CAST((&memberSprite->_animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("Player_Info")); + nullFrame = AnimationState::GetNullFrame(&memberSprite->_animState,GHIDRA_CAST("Player_Info")); slotX = slotX + local_8c; slotY = slotY + (float)local_a4._unk; local_a4._alpha = slotX; @@ -275,63 +275,63 @@ LAB_008ec408: FUN_0040a860(); if (((user == GHIDRA_CAST(0x0)) || (isLocalMember == '\0')) || ((*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) != '\0' || (isKeyboard == '\0')))) { - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Ready_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Ready_Button")); pLVar5->_visible = 0; if ((user != GHIDRA_CAST(0x0)) && (isLocalMember != '\0')) goto LAB_008ec54e; LAB_008ec56c: - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Unready_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Unready_Button")); pLVar5->_visible = 0; if ((user != GHIDRA_CAST(0x0)) || (isVisible = 1, (*GHIDRA_CAST((GHIDRA_CAST(&(local_90[6])) + 0x20))) != '\0')) goto LAB_008ec590; } else { - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Ready_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Ready_Button")); pLVar5->_visible = 1; LAB_008ec54e: if ((*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) != '\x01') || (isKeyboard == '\0')) goto LAB_008ec56c; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Unready_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Unready_Button")); pLVar5->_visible = 1; LAB_008ec590: isVisible = 0; } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Invite_Player")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Invite_Player")); pLVar5->_visible = isVisible; FUN_0040a860(); if (((user == GHIDRA_CAST(0x0)) && ((*GHIDRA_CAST((GHIDRA_CAST(&(local_90[6])) + 0x20))) == '\0')) && (isKeyboard != '\0')) { - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Invite_Player_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Invite_Player_Button")); pLVar5->_visible = 1; LAB_008ec5da: - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Swap_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Swap_Button")); pLVar5->_visible = 0; if ((user != GHIDRA_CAST(0x0)) && (isLocalMember != '\0')) goto LAB_008ec5f4; LAB_008ec667: - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_ArrowLeft")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_ArrowLeft")); pLVar5->_visible = 0; if ((user != GHIDRA_CAST(0x0)) && (isLocalMember != '\0')) goto LAB_008ec681; LAB_008ec69f: - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_ArrowRight")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_ArrowRight")); pLVar5->_visible = 0; if (user != GHIDRA_CAST(0x0)) goto LAB_008ec6b3; LAB_008ec6e0: isVisible = 0; } else { - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Invite_Player_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Invite_Player_Button")); pLVar5->_visible = 0; if (((((user == GHIDRA_CAST(0x0)) || (playerNumber != cursorPlayerNumber)) || ((isLocalMember == '\0' || ((*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) != '\0' || ((char)user[3] != '\0')))))) || (cVar2 = FUN_008ed2e0(), cVar2 == '\0')) || ((isKeyboard == '\0' || (isSwapAllowed == '\0')))) goto LAB_008ec5da; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Swap_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Swap_Button")); pLVar5->_visible = 1; LAB_008ec5f4: if ((*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) != '\0') || (isSwapAllowed == '\0')) goto LAB_008ec667; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_ArrowLeft")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_ArrowLeft")); pLVar5->_visible = 1; LAB_008ec681: if ((*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) != '\0') || (isSwapAllowed == '\0')) goto LAB_008ec69f; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_ArrowRight")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_ArrowRight")); pLVar5->_visible = 1; LAB_008ec6b3: if ((((playerNumber != cursorPlayerNumber) || (isLocalMember == '\0')) || @@ -339,31 +339,31 @@ LAB_008ec6b3: ((((char)user[3] != '\0' || (cVar2 = FUN_008ed2e0(), cVar2 == '\0')) || (isVisible = 1, isSwapAllowed == '\0')))) goto LAB_008ec6e0; } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(&DAT_00b6d168); + pLVar5 = ANM2::GetLayer(memberSprite,&DAT_00b6d168); pLVar5->_visible = isVisible; isVisible = user != GHIDRA_CAST(0x0); - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Number")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Number")); pLVar5->_visible = isVisible; if (user == GHIDRA_CAST(0x0)) { FUN_0040a860(); LAB_008ec78b: fVar9 = slotY; fVar10 = slotX; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Character")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Character")); pLVar5->_visible = 0; if (user != GHIDRA_CAST(0x0)) goto LAB_008ec79f; LAB_008ec7cb: - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Ready")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Ready")); pLVar5->_visible = 0; if (user != GHIDRA_CAST(0x0)) goto LAB_008ec7df; LAB_008ec803: - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Unready")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Unready")); pLVar5->_visible = 0; if ((user != GHIDRA_CAST(0x0)) && ((slotY = fVar9, slotX = fVar10, isLocalMember != '\0' || (playerNumber != cursorPlayerNumber)))) goto LAB_008ec839; LAB_008ec851: - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_InProgress")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_InProgress")); pLVar5->_visible = 0; if (user != GHIDRA_CAST(0x0)) goto LAB_008ec865; LAB_008ec879: @@ -379,7 +379,7 @@ LAB_008ec879: } fVar10 = (float)local_a4._unk; fVar9 = local_30._green; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Character")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Character")); pLVar5->_visible = 1; slotY = fVar9; slotX = fVar10; @@ -387,78 +387,78 @@ LAB_008ec79f: if (((isLocalMember == '\0') && ((playerNumber == cursorPlayerNumber || (*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) != '\x01')))) || ((char)user[3] != '\0')) goto LAB_008ec7cb; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Ready")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Ready")); pLVar5->_visible = 1; LAB_008ec7df: if (((isLocalMember == '\0') || (*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) != '\x01')) || ((char)user[3] != '\0')) goto LAB_008ec803; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Unready")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Unready")); pLVar5->_visible = 1; LAB_008ec839: if ((char)user[3] == '\0') goto LAB_008ec851; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_InProgress")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_InProgress")); pLVar5->_visible = 1; LAB_008ec865: if ((isLocalMember == '\0') && (playerNumber == cursorPlayerNumber)) goto LAB_008ec879; isVisible = 1; } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Completion")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Completion")); pLVar5->_visible = isVisible; FUN_0040a860(); } else { - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Ready_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Ready_Button")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Unready_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Unready_Button")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Invite_Player")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Invite_Player")); pLVar5->_visible = 1; FUN_0040a860(); - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Invite_Player_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Invite_Player_Button")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Swap_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Swap_Button")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Number")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Number")); pLVar5->_visible = 0; FUN_0040a860(); - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Character")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Character")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Ready")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Ready")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Unready")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Unready")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_InProgress")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_InProgress")); pLVar5->_visible = 0; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Completion")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Completion")); pLVar5->_visible = 0; } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Next_Right")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Next_Right")); pLVar5->_visible = local_74; if ((playerNumber != cursorPlayerNumber) || (isVisible = 1, isKeyboard == '\0')) { isVisible = 0; } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Right_Next_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Right_Next_Button")); pLVar5->_visible = isVisible; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Next_Left")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Next_Left")); pLVar5->_visible = local_74; if ((playerNumber != cursorPlayerNumber) || (isVisible = 1, isKeyboard == '\0')) { isVisible = 0; } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Left_Next_Button")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Left_Next_Button")); pLVar5->_visible = isVisible; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Options")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Options")); pLVar5->_visible = local_74; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Options_Cursor")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Options_Cursor")); pLVar5->_visible = local_74; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Options")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Options")); if (pLVar5 == GHIDRA_CAST(0x0)) { in_stack_ffffff14 = GHIDRA_CAST(0x8eca3e); KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((memberSprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar5->_layerData),GHIDRA_UINT((local_76 == 0))); + ANM2::SetLayerFrame(memberSprite,*GHIDRA_CAST(pLVar5->_layerData),GHIDRA_UINT((local_76 == 0))); } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Player_Options_Cursor")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Player_Options_Cursor")); if (pLVar5 == GHIDRA_CAST(0x0)) { pos_01 = GHIDRA_CAST(&DAT_00000004); in_stack_ffffff14 = GHIDRA_CAST(0x8eca78); @@ -466,7 +466,7 @@ LAB_008ec865: } else { pos_01 = GHIDRA_CAST(0x8eca91); - (GHIDRA_CAST((memberSprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar5->_layerData),*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(local_90[8])) + 0x70))))); + ANM2::SetLayerFrame(memberSprite,*GHIDRA_CAST(pLVar5->_layerData),*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(local_90[8])) + 0x70))))); } if ((isKeyboard == '\0') && (playerNumber == cursorPlayerNumber)) { if ((memberSprite->_animState)._animData == (void *)0x0) { @@ -497,7 +497,7 @@ LAB_008ec865: Manager::render_button_sprite(0xc,position_01); } if (user == GHIDRA_CAST(0x0)) { - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Connection_Bar")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Connection_Bar")); isKeyboardInput = g_menuControllerIndex == 0; pLVar5->_visible = 0; if (isKeyboardInput) { @@ -525,9 +525,9 @@ LAB_008ec865: pGVar1 = local_90; if (cVar2 != '\0') { if ((char)user[2] == '\0') { - pLVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((local_90)) + 0x10)))))))->ANM2::GetLayer(GHIDRA_CAST("Player_Portrait_Random")); + pLVar5 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((local_90)) + 0x10)))),GHIDRA_CAST("Player_Portrait_Random")); pLVar5->_visible = 1; - pLVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pGVar1)) + 0x10)))))))->ANM2::GetLayer(GHIDRA_CAST("Player_Portrait")); + pLVar5 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pGVar1)) + 0x10)))),GHIDRA_CAST("Player_Portrait")); pLVar5->_visible = 0; } else { @@ -535,13 +535,13 @@ LAB_008ec865: local_30._green = (float)FUN_0069bd10(); if (local_30._green == 0.0) goto LAB_008ecbd8; portraitSprite = &(*GHIDRA_CAST((GHIDRA_CAST((local_90)) + 0x10))); - pLVar5 = (GHIDRA_CAST((GHIDRA_CAST(portraitSprite))))->ANM2::GetLayer(GHIDRA_CAST("Player_Portrait")); + pLVar5 = ANM2::GetLayer(GHIDRA_CAST(portraitSprite),GHIDRA_CAST("Player_Portrait")); pLVar5->_visible = 1; - pLVar5 = (GHIDRA_CAST((GHIDRA_CAST(portraitSprite))))->ANM2::GetLayer(GHIDRA_CAST("Player_Portrait_Random")); + pLVar5 = ANM2::GetLayer(GHIDRA_CAST(portraitSprite),GHIDRA_CAST("Player_Portrait_Random")); pLVar5->_visible = 0; Sprite::ReplaceSpritesheet (GHIDRA_CAST(portraitSprite),0x2a,GHIDRA_CAST((GHIDRA_INT(local_30._green) + 0x4c))); - (GHIDRA_CAST((GHIDRA_CAST(portraitSprite))))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(GHIDRA_CAST(portraitSprite),unk); } memberSprite = GHIDRA_CAST(local_a4._blue); } @@ -569,7 +569,7 @@ LAB_008ecbd8: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((&memberSprite->_animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("PlayerName")); + nullFrame = AnimationState::GetNullFrame(&memberSprite->_animState,GHIDRA_CAST("PlayerName")); } local_a4._red = slotX + *nullFrame; local_a4._green = slotY + nullFrame[1]; @@ -582,7 +582,7 @@ LAB_008ecbd8: pos_01 = &local_a4; in_stack_ffffff10 = 0x8eccac; in_stack_ffffff14 = GHIDRA_CAST(local_30._green); - (GHIDRA_CAST((local_ac)))->Font::DrawStringScaled(GHIDRA_CAST(local_30._green),GHIDRA_CAST(pos_01),color_02,fontSettings); + Font::DrawStringScaled(local_ac,GHIDRA_CAST(local_30._green),GHIDRA_CAST(pos_01),color_02,fontSettings); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xff; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))) = 0xffffff; iVar3 = (g_manager->_optionsConfig)._eosCrossplay; @@ -625,14 +625,14 @@ LAB_008ecbd8: } } local_76 = playerNumber != cursorPlayerNumber; - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Connection_Bar")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Connection_Bar")); pLVar5->_visible = local_76; - (GHIDRA_CAST((memberSprite)))->ANM2::SetLayerFrame(0x21,iVar3); + ANM2::SetLayerFrame(memberSprite,0x21,iVar3); FUN_008eee70(); ExceptionList = local_1c; return; } - pLVar5 = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST("Connection_Bar")); + pLVar5 = ANM2::GetLayer(memberSprite,GHIDRA_CAST("Connection_Bar")); pLVar5->_visible = 0; if (((char)user[2] == '\n') && (*GHIDRA_CAST((GHIDRA_CAST(user) + 10)) == '\0')) { sprintf_s(GHIDRA_CAST(&local_54),0x14,GHIDRA_CAST("Tokens: %d")); @@ -640,9 +640,9 @@ LAB_008ecbd8: manager = g_manager; local_30._green = slotY + nullFrame[1]; fVar9 = slotX + *nullFrame; - iVar3 = (GHIDRA_CAST((&g_manager->_font1_TeamMeatEx10)))->Font::get_string_width_n(GHIDRA_CAST(&local_54),-1); + iVar3 = Font::get_string_width_n(&g_manager->_font1_TeamMeatEx10,GHIDRA_CAST(&local_54),-1); local_30._red = fVar9 - (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]) * 0.5; - (GHIDRA_CAST((fontSettings)))->FontSettings::constructor(); + FontSettings::constructor(fontSettings); local_14 = (void *)0xf; (GHIDRA_CAST((GHIDRA_CAST((local_70 + 4)))))->KColor::SetFromARGB(0xff362f2d); pos_01 = &local_30; @@ -812,7 +812,7 @@ void GameOver::Render() if (g_manager->_netplayManager != *GHIDRA_CAST((g_manager + 1))) { screenCenter.x = screenCenter.x - 112.0; } - pLVar6 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))))))->ANM2::GetLayer(&DAT_00000006); + pLVar6 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))),&DAT_00000006); pLVar6->_visible = 0; local_fc = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((g_game->_playerManager))) + 0x7c)))); if (local_fc == GHIDRA_CAST(0x0)) { @@ -831,17 +831,17 @@ void GameOver::Render() } local_108 = GHIDRA_CAST(local_fc->_playerType); if (GHIDRA_INT(local_108) < 0x29) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))))))->ANM2::Render(&screenCenter,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))),&screenCenter,&g_vectorZero,&g_vectorZero); } else { - pLVar6 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))))))->ANM2::GetLayer(&DAT_00000004); + pLVar6 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))),&DAT_00000004); pLVar6->_visible = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))))))->ANM2::Render(&screenCenter,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))),&screenCenter,&g_vectorZero,&g_vectorZero); ModManager::RenderCustomGameOver(GHIDRA_INT(local_108),&screenCenter); } local_10c = g_vectorZero.x; local_110 = g_vectorZero.y; - pLVar6 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))))))->ANM2::GetLayer(&DAT_00000006); + pLVar6 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))),&DAT_00000006); local_104 = 0x10; pLVar6->_visible = 1; pvVar5 = (local_fc->_history)._historyItems._begin; @@ -1037,11 +1037,11 @@ LAB_00998f1b: drawPos.y = screenCenter.y + *GHIDRA_CAST((iVar7 + 0x14)); if (((iVar9 != 0) && (iVar7 = *GHIDRA_CAST((iVar9 + 0x160)), iVar7 != 0)) && (pAVar12 = GHIDRA_CAST((iVar7 + 0xdf0)), *GHIDRA_CAST((iVar7 + 0xef9)) != '\0')) { - (GHIDRA_CAST((pAVar12)))->ANM2::SetFrame(GHIDRA_CAST((iVar7 + 0xe08)),*GHIDRA_CAST((iVar9 + 100))); + ANM2::SetFrame(pAVar12,GHIDRA_CAST((iVar7 + 0xe08)),*GHIDRA_CAST((iVar9 + 100))); (GHIDRA_CAST((GHIDRA_CAST(pAVar12))))->Sprite::SetColor(&tmpColorMod); *GHIDRA_CAST((iVar7 + 0xe8c)) = g_vectorOne.x; *GHIDRA_CAST((iVar7 + 0xe90)) = g_vectorOne.y; - (GHIDRA_CAST((pAVar12)))->ANM2::Render(&drawPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(pAVar12,&drawPos,&g_vectorZero,&g_vectorZero); } } } @@ -1096,7 +1096,7 @@ LAB_00998f1b: (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; (GHIDRA_CAST((&tmpColor)))->KColor::SetFromARGB(0xff362f2d); local_100 = local_100 - 4.0; - (GHIDRA_CAST((&pMVar2->_font2_TeamMeatEx12)))->Font::DrawString(seedHalf,color,tmpColorMod._colorize, + Font::DrawString(&pMVar2->_font2_TeamMeatEx12,seedHalf,color,tmpColorMod._colorize, local_100,local_124 + 2.0); seedHalf[0] = 0; seedHalf[1] = 0; @@ -1126,7 +1126,7 @@ LAB_00998f1b: tmpColorMod._offset[2] = 0.0; local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),7); (GHIDRA_CAST((&tmpColor)))->KColor::SetFromARGB(0xff362f2d); - (GHIDRA_CAST((&pMVar2->_font2_TeamMeatEx12)))->Font::DrawString(seedHalf,color_00,tmpColorMod._colorize, + Font::DrawString(&pMVar2->_font2_TeamMeatEx12,seedHalf,color_00,tmpColorMod._colorize, local_100,local_124 + 17.0); uVar4 = local_e0; } @@ -1174,12 +1174,12 @@ LAB_0099978e: local_14 = 0xffffffff; local_120.x = (float)KAGE::System::UserProfileBase::vftable; if (cVar3 != '\0') { - pLVar6 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))))))->ANM2::GetLayer(GHIDRA_CAST("DeedsMe")); + pLVar6 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))),GHIDRA_CAST("DeedsMe")); if (pLVar6 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar6->_layerData),local_104); + ANM2::SetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x8)))),*GHIDRA_CAST(pLVar6->_layerData),local_104); } } local_104 = local_104 + 1; @@ -1188,7 +1188,7 @@ LAB_0099978e: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x38)))))))->AnimationState::GetNullFrame(nullName); + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((smallFont)) + 0x38)))),nullName); } drawPos.y = screenCenter.y + nullFrame[1]; drawPos.x = screenCenter.x + *nullFrame; @@ -1381,7 +1381,7 @@ void GameOver::Show() } while (bVar2 != 0); (GHIDRA_CAST((anm2File._buf)))->msvc::string::assign(GHIDRA_CAST(anm2Path),GHIDRA_INT(pbVar4) - GHIDRA_INT((anm2Path + 1))); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::Load(&anm2File,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),&anm2File,1); local_8 = 0xffffffff; if (0xf < anm2File._capacity) { uVar6 = anm2File._capacity + 1; @@ -1413,9 +1413,9 @@ LAB_009998fd: } } } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::SetAnimation(GHIDRA_CAST("Diary"),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),GHIDRA_CAST("Diary"),1); if (((bVar2 != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3c)))) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))))))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))),0.0), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3c)))) != 0)) { (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4c))) = 0; } @@ -1635,12 +1635,12 @@ LAB_00999c6f: AnimationState::AdvanceLayerPosition (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))),layerId,(float)stageFrame); } - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),GHIDRA_CAST(0x3)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),&DAT_00000005); layer->_visible = 0; if (isBossKiller) { - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),GHIDRA_CAST(0x3)); layer->_visible = 1; if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3c)))) == 0) || ((*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))) + 0x80)) < 4 && @@ -1650,7 +1650,7 @@ LAB_00999c6f: layerId = *GHIDRA_CAST((layerId + 0x44)); } else { - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),&DAT_00000005); layer->_visible = 1; if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3c)))) == 0) || ((*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))) + 0x80)) < 6 && @@ -1663,13 +1663,13 @@ LAB_00999c6f: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x40)))) + layerId * 4)) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))))))->AnimationState::AdvanceLayerPosition(layerId,(float)iVar7); + AnimationState::AdvanceLayerPosition(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))),layerId,(float)iVar7); LAB_00999f34: if (((pEStack_84 != GHIDRA_CAST(0x0)) && (pEStack_84->modEntry != (void *)0x0)) && (pEStack_84->isPortraitModded != 0)) { - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),GHIDRA_CAST(0x3)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))),&DAT_00000005); layer->_visible = 0; if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3c)))) != 0) && ((5 < *GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))) + 0x80)) || @@ -1681,7 +1681,7 @@ LAB_00999f34: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x40)))) + layerId * 4)) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))))))->AnimationState::AdvanceLayerPosition(layerId,0.0); + AnimationState::AdvanceLayerPosition(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))),layerId,0.0); } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x10)))) = pEStack_84; } diff --git a/generated-src/generic_popup.cpp b/generated-src/generic_popup.cpp index 93504d8..cd22e18 100644 --- a/generated-src/generic_popup.cpp +++ b/generated-src/generic_popup.cpp @@ -90,7 +90,7 @@ LAB_00837405: local_28 = 0; local_8 = 0; y = g_screenHeight * 0.5 + (&lineOffsetY)[line]; - textWidth = (GHIDRA_CAST((font)))->Font::get_string_width_utf16(GHIDRA_CAST(*lineText),-1); + textWidth = Font::get_string_width_utf16(font,GHIDRA_CAST(*lineText),-1); Font::draw_string_wide_unscaled (font,GHIDRA_CAST(*lineText), g_screenWidth * alignFactor - @@ -130,9 +130,9 @@ void GenericPopup::destructor() } (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x66])) + 0x2))))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a])) + 0x2)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x10)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(this)); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0x10))); (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(this))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; diff --git a/generated-src/generic_prompt.cpp b/generated-src/generic_prompt.cpp index c8fd7dc..6ad3204 100644 --- a/generated-src/generic_prompt.cpp +++ b/generated-src/generic_prompt.cpp @@ -31,7 +31,7 @@ void GenericPrompt::Initialize(uint8_t SmallPrompt) anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/Prompt_YesNo.anm2",0x19); local_14 = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_sprite,&anm2Path,1); if (anm2Path._capacity < 0x10) goto LAB_00837a6d; size = anm2Path._capacity + 1; ptr = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))); @@ -57,7 +57,7 @@ void GenericPrompt::Initialize(uint8_t SmallPrompt) smallAnm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(smallAnm2Path._buf))) + 0x0))),"gfx/ui/Prompt_YesNo_Small.anm2",0x1f); local_14 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&smallAnm2Path,1); + ANM2::Load(&this->_sprite,&smallAnm2Path,1); if (smallAnm2Path._capacity < 0x10) goto LAB_00837a6d; size = smallAnm2Path._capacity + 1; ptr = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(smallAnm2Path._buf))) + 0x0))); @@ -97,8 +97,8 @@ void GenericPrompt::Update(uint8_t processInput) handle_input(this); } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } animData = (this->_sprite)._animState._animData; if ((animData != GHIDRA_CAST(0x0)) && ((this->_sprite)._animState._isPlaying == 0)) { @@ -148,8 +148,8 @@ LAB_00837b60: compareResult = 0; LAB_00837b65: if (((compareResult != 0) || (animData[0x34] != 0)) && - (bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1), bVar1 != 0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + (bVar1 = ANM2::SetAnimation(&this->_sprite,s_Idle,1), bVar1 != 0)) { + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -168,7 +168,7 @@ LAB_00837b65: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._layerFrames) + layerId * 4)) = 0; - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::AdvanceLayerPosition(layerId,(float)selectedOption); + AnimationState::AdvanceLayerPosition(&(this->_sprite)._animState,layerId,(float)selectedOption); } return; } @@ -237,7 +237,7 @@ void GenericPrompt::Render() AnimationState::Render(secondAnimState,&screenCenter,&g_vectorZero,&g_vectorZero); } if ((this->_sprite)._animState._animData != (void *)0x0) { - textTopFrame = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("TextTop")); + textTopFrame = AnimationState::GetNullFrame(&(this->_sprite)._animState,GHIDRA_CAST("TextTop")); if (textTopFrame != GHIDRA_CAST(0x0)) { (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); titleFont = local_18; @@ -264,7 +264,7 @@ void GenericPrompt::Render() fVar2 = textTopFrame[5]; fVar4 = textTopFrame[4]; fVar3 = g_screenHeight * 0.5 + fVar3; - iVar1 = (GHIDRA_CAST((titleFont)))->Font::get_string_width_utf16(GHIDRA_CAST(*lineText),-1); + iVar1 = Font::get_string_width_utf16(titleFont,GHIDRA_CAST(*lineText),-1); Font::draw_string_wide (titleFont,GHIDRA_CAST(*lineText), (g_screenWidth * fVar5 + fVar6) - @@ -297,14 +297,14 @@ void GenericPrompt::Render() fVar2 = textTopFrame[4]; lineY = g_screenHeight * 0.5 + fVar3; local_28 = GHIDRA_CAST(fVar2); - bodyLineWidth = (GHIDRA_CAST((bodyFont)))->Font::get_string_width_utf16(GHIDRA_CAST(*lineText),-1); + bodyLineWidth = Font::get_string_width_utf16(bodyFont,GHIDRA_CAST(*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((bodyFont)))->Font::layout_glyphs(glyphRunBuf,GHIDRA_CAST(*lineText),&fontSettings, + glyphRun = Font::layout_glyphs(bodyFont,glyphRunBuf,GHIDRA_CAST(*lineText),&fontSettings, &layoutScale); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),2); color._green = textColor._green; @@ -433,9 +433,9 @@ LAB_00838147: if ((cmpResult == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00838173; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00838173: @@ -486,9 +486,9 @@ LAB_008381d5: } } } - bVar1 = (GHIDRA_CAST((anm2)))->ANM2::SetAnimation(GHIDRA_CAST("Dissappear"),1); + bVar1 = ANM2::SetAnimation(anm2,GHIDRA_CAST("Dissappear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&anm2->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&anm2->_animState); (anm2->_animState)._isPlaying = 1; } return; diff --git a/generated-src/grid_entity.cpp b/generated-src/grid_entity.cpp index 2b59d84..3056832 100644 --- a/generated-src/grid_entity.cpp +++ b/generated-src/grid_entity.cpp @@ -78,7 +78,7 @@ GridEntity::GridEntity() (this->_rng)._shift2 = 9; (this->_rng)._seed = -0x55e8beb1; (this->_rng)._shift3 = 7; - (GHIDRA_CAST((&this->_sprite)))->ANM2::constructor(); + ANM2::constructor(&this->_sprite); return; } @@ -157,23 +157,23 @@ GridEntity * GridEntity::InitSubclass(uint32_t flags) local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((this[1]._sprite._championColor._colorize + 1)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&this[2]._gridIndex))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x4)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((this[1]._sprite._championColor._colorize + 1))); + AnimationState::~AnimationState(GHIDRA_CAST(&this[2]._gridIndex)); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x4))))); (GHIDRA_CAST((GHIDRA_CAST(&this[1]._sprite._flipX))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this[1]._sprite._championColor._colorize + 1)))))->msvc::string::_Tidy_deallocate(); FID_conflict__Tidy(this[1]._sprite._championColor._tint + 2); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((this + 1)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&this[1]._sprite._filename._size))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&this[1]._rng._shift1))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((this + 1))); + AnimationState::~AnimationState(GHIDRA_CAST(&this[1]._sprite._filename._size)); + AnimationState::~AnimationState(GHIDRA_CAST(&this[1]._rng._shift1)); (GHIDRA_CAST((GHIDRA_CAST(&this[1]._varData))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this + 1)))))->msvc::string::_Tidy_deallocate(); *GHIDRA_CAST(this) = IsaacRepentancePlus::GridEntity::vftable; local_8 = 2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_sprite); + AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_sprite)._animState); (GHIDRA_CAST(((this->_sprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->msvc::string::_Tidy_deallocate(); if ((flags & 1) != 0) { @@ -250,7 +250,7 @@ void GridEntity::trigger_output(GridEntity *gridEntity) } else if (iVar1 == 0x14) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gridEntity)) + 0xc)))) == 0) { - (GHIDRA_CAST((&gridEntity->_sprite)))->ANM2::Play(GHIDRA_CAST("Switched"),0); + ANM2::Play(&gridEntity->_sprite,GHIDRA_CAST("Switched"),0); return; } } @@ -281,11 +281,11 @@ void GridEntity::trigger_output(GridEntity *gridEntity) } else if (iVar1 == 0x17) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gridEntity)) + 0xc)))) == 2) { - (GHIDRA_CAST((&gridEntity->_sprite)))->ANM2::Play(GHIDRA_CAST("TurnOn"),0); + ANM2::Play(&gridEntity->_sprite,GHIDRA_CAST("TurnOn"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gridEntity)) + 0xc)))) = 1; return; } - (GHIDRA_CAST((&gridEntity->_sprite)))->ANM2::Play(GHIDRA_CAST("TurnOff"),0); + ANM2::Play(&gridEntity->_sprite,GHIDRA_CAST("TurnOff"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gridEntity)) + 0xc)))) = 2; } return; diff --git a/generated-src/grid_entity_decoration.cpp b/generated-src/grid_entity_decoration.cpp index a15a8f0..47f389a 100644 --- a/generated-src/grid_entity_decoration.cpp +++ b/generated-src/grid_entity_decoration.cpp @@ -41,9 +41,9 @@ void GridEntity_Decoration::Update() ExceptionList = &local_1c; if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) != 1000) && ((this->_sprite)._loaded != 0)) { decoration = this; - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(this->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(animName)); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); + ANM2::GetAnimation(GHIDRA_CAST(&(this->_sprite)._animState),GHIDRA_CAST(animName)); animNameData = animName[0]; local_14 = GHIDRA_CAST(0x0); psVar2 = GHIDRA_CAST(animName); @@ -197,7 +197,7 @@ void GridEntity_Decoration::BeginBatches() local_2c._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))),"gfx/grid/Tiles_Rotgut.anm2",0x1b); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&local_2c,1); + ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar10 = local_2c._capacity + 1; @@ -214,15 +214,15 @@ void GridEntity_Decoration::BeginBatches() } iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); if (iVar5 == 10) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Ladder"),0); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Ladder"),0); iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); } if (iVar5 == 0x14) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Ladder"),1); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Ladder"),1); iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); } if (iVar5 == 0x1e) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::SetFrame(GHIDRA_CAST("Ladder"),2); + ANM2::SetFrame(&this->_sprite,GHIDRA_CAST("Ladder"),2); ExceptionList = local_10; return; } @@ -249,7 +249,7 @@ void GridEntity_Decoration::BeginBatches() builtin_strncpy((GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) + 0x18)))->_buf,"on.anm2",8); local_8 = 2; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&local_2c,1); + ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar10 = local_2c._capacity + 1; @@ -263,15 +263,15 @@ void GridEntity_Decoration::BeginBatches() } iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); if (iVar5 == 10) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Ladder1"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Ladder1"),0); iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); } if (iVar5 == 0x14) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Ladder2"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Ladder2"),0); iVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); } if (iVar5 == 0x1e) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Ladder3"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Ladder3"),0); ExceptionList = local_10; return; } @@ -293,7 +293,7 @@ void GridEntity_Decoration::BeginBatches() ((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))))->_capacity = 0x2e646565; builtin_strncpy((GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(local_2c._buf)) + 0x0))) + 0x18)))->_buf,"anm2",5); local_8 = 3; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&local_2c,1); + ANM2::Load(&this->_sprite,&local_2c,1); local_8 = 0xffffffff; if (0xf < local_2c._capacity) { uVar10 = local_2c._capacity + 1; @@ -321,7 +321,7 @@ void GridEntity_Decoration::BeginBatches() } decoration = savedThis; if (anm2Path._size != 0) { - (GHIDRA_CAST((&savedThis->_sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&savedThis->_sprite,&anm2Path,1); attemptsLeft = 0x14; LAB_0099b160: iVar5 = attemptsLeft + -1; @@ -509,7 +509,7 @@ LAB_0099b3bd: if (isAnimAccepted != '\0') goto LAB_0099b406; goto LAB_0099b160; LAB_0099b406: - psVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(decoration->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(curAnimName)); + psVar4 = ANM2::GetAnimation(GHIDRA_CAST(&(decoration->_sprite)._animState),GHIDRA_CAST(curAnimName)); animNameSize = &psVar4->_size; if (0xf < psVar4->_capacity) { psVar4 = *GHIDRA_CAST(psVar4->_buf); diff --git a/generated-src/grid_entity_door.cpp b/generated-src/grid_entity_door.cpp index 862c5ea..a2e061f 100644 --- a/generated-src/grid_entity_door.cpp +++ b/generated-src/grid_entity_door.cpp @@ -162,7 +162,7 @@ LAB_0070c737: if (0xf < (this->_closeAnimation)._capacity) { animName = *GHIDRA_CAST(animName->_buf); } - isChallengeOpen = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST(animName)); + isChallengeOpen = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST(animName)); if (((isChallengeOpen != 0) && (pvVar1 = (this->_sprite)._animState._animData, pvVar1 != (void *)0x0)) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x34)) == '\0')) { @@ -188,7 +188,7 @@ LAB_0070c737: } uVar8 = 0x70c823; local_c5 = (uint8_t)uVar6; - isChallengeOpen = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST(animName)); + isChallengeOpen = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST(animName)); if (isChallengeOpen == 0) { LAB_0070c871: uVar4 = GHIDRA_UINT(local_c5); @@ -198,7 +198,7 @@ LAB_0070c871: if ((pvVar1 == (void *)0x0) || (uVar4 = this->_doorFlags & 0xff, *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x34)) == '\0')) { local_c5 = (uint8_t)this->_doorFlags; - iVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetFrame(); + iVar3 = ANM2::GetFrame(&this->_sprite); if (iVar3 != 2) goto LAB_0070c871; FUN_0070bfa0(0x2f,10,uVar8,0x3f800000); uVar4 = GHIDRA_UINT((uint8_t)this->_doorFlags); @@ -210,10 +210,10 @@ LAB_0070c871: (((this->_sprite)._animState._animData == (void *)0x0 || ((this->_sprite)._animState._isPlaying == 0)))) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 2) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Opened"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Opened"),0); } else if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 1) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Closed"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Closed"),0); } } else { @@ -226,7 +226,7 @@ LAB_0070c926: if (0xf < (this->_openAnimation)._capacity) { animName = *GHIDRA_CAST(animName->_buf); } - isChallengeOpen = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsFinishedImpl(GHIDRA_CAST(animName)); + isChallengeOpen = ANM2::IsFinishedImpl(&this->_sprite,GHIDRA_CAST(animName)); if (isChallengeOpen != 0) { animData = (this->_sprite)._animState._animData; if (animData != GHIDRA_CAST(0x0)) { @@ -256,9 +256,9 @@ LAB_0070c985: ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0070c9b8; } - isChallengeOpen = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Opened"),1); + isChallengeOpen = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Opened"),1); if (isChallengeOpen != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -346,23 +346,23 @@ LAB_0070c9b8: } animState = &(this->_sprite)._animState; if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } if ((this->_extraSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_extraSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_extraSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_extraSprite)._animState); + AnimationState::Update(&(this->_extraSprite)._overlayAnimState); } if ((this->_sprite)._animState._animData != (void *)0x0) { isChallengeOpen = - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST("ScreenshakeStop")); + AnimationState::WasEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("ScreenshakeStop")); if (isChallengeOpen == 0) { if ((this->_sprite)._animState._animData != (void *)0x0) { - isChallengeOpen = (GHIDRA_CAST((animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST("ScreenshakeStart")); + isChallengeOpen = AnimationState::WasEventTriggered(animState,GHIDRA_CAST("ScreenshakeStart")); if (isChallengeOpen != 0) { (GHIDRA_CAST((g_game)))->Game::ShakeScreen(4); if ((this->_sprite)._animState._animData != (void *)0x0) { - isChallengeOpen = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("ScreenshakeStart")) + isChallengeOpen = AnimationState::IsEventTriggered(animState,GHIDRA_CAST("ScreenshakeStart")) ; manager = g_manager; if (isChallengeOpen != 0) { @@ -381,7 +381,7 @@ LAB_0070c9b8: if (this->_targetRoomType == 0x1b) { iVar3 = get_secret_exit_kind(this); if ((iVar3 == 3) && ((this->_sprite)._animState._animData != (void *)0x0)) { - isChallengeOpen = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Sound")); + isChallengeOpen = AnimationState::IsEventTriggered(animState,GHIDRA_CAST("Sound")); if (isChallengeOpen != 0) { isChallengeOpen = (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::HasPhotoDoor(); manager = g_manager; @@ -401,7 +401,7 @@ LAB_0070c9b8: } } if ((this->_sprite)._animState._animData != (void *)0x0) { - isChallengeOpen = (GHIDRA_CAST((animState)))->AnimationState::IsEventTriggered(&DAT_00b64ba4); + isChallengeOpen = AnimationState::IsEventTriggered(animState,&DAT_00b64ba4); if (isChallengeOpen != 0) { (GHIDRA_CAST((g_game)))->Game::ShakeScreen(8); SpawnDust(this); @@ -411,7 +411,7 @@ LAB_0070c9b8: } targetRoomDesc = (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::GetRoomByIdx(this->_targetRoomIdx,-1); if ((targetRoomDesc->Flags & 0x40000U) != 0) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("Background")); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("Background")); if (layer != GHIDRA_CAST(0x0)) { uStack_94 = 0; uStack_90 = 0; @@ -439,7 +439,7 @@ LAB_0070c9b8: uVar6 = Random(); local_c4 = (float)((double)GHIDRA_INT(uVar6) + __uint_to_double_fixup[-(GHIDRA_INT(uVar6) >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.5; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x3)); local_88._offset[0] = 0.0; local_88._colorize[0] = 0.0; local_88._colorize[1] = 0.0; @@ -453,7 +453,7 @@ LAB_0070c9b8: local_88._tint[1] = 0.93; local_88._tint[2] = 1.0; local_88._tint[3] = local_c4; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x3)); (GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::operator_assign(pCVar9); pCVar9 = &local_88; local_88._tint[0] = 1.0; @@ -467,7 +467,7 @@ LAB_0070c9b8: local_88._offset[0] = 0.0; local_88._offset[1] = 0.0; local_88._offset[2] = 0.0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x0)); (GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::operator_assign(pCVar9); } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) != 2) { @@ -494,9 +494,9 @@ LAB_0070c9b8: local_c4 = 1.42092e-42; seed_fart_sound_override(GHIDRA_CAST(&local_c4)); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_c4),1.0,2,0,1.0,0.0); - isChallengeOpen = (GHIDRA_CAST((&this->_sparkleSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Sparkle"),1); + isChallengeOpen = ANM2::SetAnimation(&this->_sparkleSprite,GHIDRA_CAST("Sparkle"),1); if (isChallengeOpen != 0) { - (GHIDRA_CAST((&(this->_sparkleSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sparkleSprite)._animState); (this->_sparkleSprite)._animState._isPlaying = 1; } } @@ -504,8 +504,8 @@ LAB_0070c9b8: } LAB_0070d1ab: if ((this->_sparkleSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sparkleSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sparkleSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sparkleSprite)._animState); + AnimationState::Update(&(this->_sparkleSprite)._overlayAnimState); } return; } @@ -628,7 +628,7 @@ void GridEntity_Door::LoadSprite() ExceptionList = &savedExceptionList; puVar2 = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -4)); if ((this->_extraSprite)._loaded != 0) { - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_extraSprite); puVar2 = puStack_20; } puStack_20 = puVar2; @@ -649,7 +649,7 @@ void GridEntity_Door::LoadSprite() tmpString._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/grid/door_downpour_mirror.anm2",0x23); ehState = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&tmpString,1); + ANM2::Load(&this->_sprite,&tmpString,1); ehState = 0xffffffff; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; @@ -686,7 +686,7 @@ LAB_0070d535: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(mineshaftLightPath._buf))) + 0x0))), "gfx/grid/door_mines_mineshaft_light.anm2",0x29); ehState = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&mineshaftLightPath,1); + ANM2::Load(&this->_sprite,&mineshaftLightPath,1); ehState = 0xffffffff; if (0xf < mineshaftLightPath._capacity) { uVar8 = mineshaftLightPath._capacity + 1; @@ -718,7 +718,7 @@ LAB_0070d535: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(mineshaftDarkPath._buf))) + 0x0))),"gfx/grid/door_mines_mineshaft_dark.anm2" ,0x28); ehState = 2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&mineshaftDarkPath,1); + ANM2::Load(&this->_sprite,&mineshaftDarkPath,1); ehState = 0xffffffff; if (0xf < mineshaftDarkPath._capacity) { uVar8 = mineshaftDarkPath._capacity + 1; @@ -759,7 +759,7 @@ LAB_0070e8c5: anmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/door_sparkle.anm2",0x16); ehState = 3; - (GHIDRA_CAST((&this->_sparkleSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_sparkleSprite,&anmPath,1); ehState = 0xffffffff; if (0xf < anmPath._capacity) { uVar8 = anmPath._capacity + 1; @@ -791,7 +791,7 @@ LAB_0070e980: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/grid/door_08_holeinwall _darkroom.anm2",0x2b ); ehState = 4; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&tmpString,1); + ANM2::Load(&this->_sprite,&tmpString,1); ehState = 0xffffffff; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; @@ -816,7 +816,7 @@ LAB_0070e980: tmpString._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/grid/Door_08_HoleInWall.anm2",0x21); ehState = 5; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&tmpString,0); + ANM2::Load(&this->_sprite,&tmpString,0); ehState = 0xffffffff; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; @@ -838,7 +838,7 @@ LAB_0070e980: (GHIDRA_CAST(&this->_sprite),0, (std_string *) (GHIDRA_INT(g_game->_room) + *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x1d18)) * 0x13c + 0x1e24)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(unk_00); + ANM2::LoadGraphics(&this->_sprite,unk_00); } pvVar6 = g_game->_room; tintR = *GHIDRA_CAST((GHIDRA_CAST(pvVar6) + 0x72d0)); @@ -883,7 +883,7 @@ LAB_0070e980: msvc::string::string_from_cstr (local_c8 + 0x14,GHIDRA_CAST("gfx/grid/Door_04_SelfSacrificeRoomDoor.anm2")); ehState = 0xd; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_c8 + 0x14)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_c8 + 0x14)),1); ehState = 0xffffffff; (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate(); bVar3 = (GHIDRA_CAST((&g_game->_playerManager)))->PlayerManager::AnyoneHasTrinket(0x97); @@ -915,7 +915,7 @@ LAB_0070e980: uVar8 = uVar8 + 1; } while (uVar8 < GHIDRA_UINT((this->_sprite)._layerCount)); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&this->_sprite,bVar3); this->_varData = 1; } this->_doorFlags = this->_doorFlags | 4; @@ -926,20 +926,20 @@ LAB_0070e980: (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_05_ArcadeRoomDoor.anm2")) ; ehState = 0xf; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&doorAnmPath,1); + ANM2::Load(&this->_sprite,&doorAnmPath,1); ehState = 0xffffffff; (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("KeyClosed"),9); (GHIDRA_CAST(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4); (GHIDRA_CAST(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("KeyOpen"),7); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(&this->_sprite,unk); this->_doorFlags = this->_doorFlags | 1; goto LAB_0070eb83; } if (this->_targetRoomType == 0x17) { (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_32_ExitDoor.anm2")); ehState = 0x10; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&doorAnmPath,1); + ANM2::Load(&this->_sprite,&doorAnmPath,1); ehState = 0xffffffff; (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4); @@ -971,7 +971,7 @@ LAB_0070e980: ehState = 0x11; } LAB_0070dd51: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&doorAnmPath,1); + ANM2::Load(&this->_sprite,&doorAnmPath,1); ehState = 0xffffffff; (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_openAnimation)._buf)))->msvc::string::assign(s_Open,4); @@ -991,7 +991,7 @@ LAB_0070dd51: if (bVar3 != 0) { (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_15_BossRushDoor.anm2")); ehState = 0x15; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&doorAnmPath,1); + ANM2::Load(&this->_sprite,&doorAnmPath,1); ehState = 0xffffffff; (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate(); LAB_0070e789: @@ -1001,7 +1001,7 @@ LAB_0070e789: if ((this->_targetRoomIdx == -8) || (g_game->_currentRoomIdx == -8)) { (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/door_29_doortobluewomb.anm2")); ehState = 0x16; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_c8 + 0x14)),0); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_c8 + 0x14)),0); ehState = 0xffffffff; (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate(); bVar3 = extraout_CL_07; @@ -1030,13 +1030,13 @@ LAB_0070e789: uVar8 = uVar8 + 1; } while (uVar8 < GHIDRA_UINT((this->_sprite)._layerCount)); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&this->_sprite,bVar3); goto LAB_0070e789; } if ((this->_targetRoomIdx == -7) || (g_game->_currentRoomIdx == -7)) { (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_24_MegaSatanDoor.anm2")); ehState = 0x18; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_c8 + 0x14)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_c8 + 0x14)),1); ehState = 0xffffffff; (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("Closed"),6); @@ -1048,7 +1048,7 @@ LAB_0070e789: ((this->_targetRoomIdx == -9 || (game->_currentRoomIdx == -9)))) { (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/door_30_HushDoor.anm2")); ehState = 0x19; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&doorAnmPath,1); + ANM2::Load(&this->_sprite,&doorAnmPath,1); ehState = 0xffffffff; (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("Closed"),6); @@ -1073,14 +1073,14 @@ LAB_0070e789: msvc::string::string_from_cstr (ambushDoorPath._buf,GHIDRA_CAST("gfx/grid/Door_03_AmbushRoomDoor.anm2")); ehState = 0x1c; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&ambushDoorPath,1); + ANM2::Load(&this->_sprite,&ambushDoorPath,1); pathString = &ambushDoorPath; } else { msvc::string::string_from_cstr (bossAmbushDoorPath._buf,GHIDRA_CAST("gfx/grid/Door_09_BossAmbushRoomDoor.anm2")); ehState = 0x1b; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&bossAmbushDoorPath,1); + ANM2::Load(&this->_sprite,&bossAmbushDoorPath,1); pathString = &bossAmbushDoorPath; } ehState = 0xffffffff; @@ -1097,7 +1097,7 @@ LAB_0070e789: msvc::string::string_from_cstr (devilRoomDoorPath._buf,GHIDRA_CAST("gfx/grid/Door_07_DevilRoomDoor.anm2")); ehState = 0x1e; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&devilRoomDoorPath,1); + ANM2::Load(&this->_sprite,&devilRoomDoorPath,1); ehState = 0xffffffff; (GHIDRA_CAST((devilRoomDoorPath._buf)))->msvc::string::_Tidy_deallocate(); } @@ -1106,7 +1106,7 @@ LAB_0070e789: (devilTreasureDoorPath._buf, GHIDRA_CAST("gfx/grid/Door_02_TreasureRoomDoor_Devil.anm2")); ehState = 0x1d; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&devilTreasureDoorPath,1); + ANM2::Load(&this->_sprite,&devilTreasureDoorPath,1); ehState = 0xffffffff; (GHIDRA_CAST((devilTreasureDoorPath._buf)))->msvc::string::_Tidy_deallocate(); } @@ -1116,7 +1116,7 @@ LAB_0070e789: if (bVar3 != 0) { (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_07_HolyRoomDoor.anm2")); ehState = 0x1f; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_c8 + 0x14)),1); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_c8 + 0x14)),1); ehState = 0xffffffff; (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate(); goto LAB_0070eb83; @@ -1126,12 +1126,12 @@ LAB_0070e789: sprite = &this->_sprite; (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_House.anm2")); ehState = 0x20; - (GHIDRA_CAST((sprite)))->ANM2::Load(GHIDRA_CAST((local_c8 + 0x14)),0); + ANM2::Load(sprite,GHIDRA_CAST((local_c8 + 0x14)),0); ehState = 0xffffffff; (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate(); - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x3)); layer->_visible = 0; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(sprite,&DAT_00000004); game = g_game; layer->_visible = 0; iVar4 = *GHIDRA_CAST((GHIDRA_CAST(game->_room) + 4)); @@ -1208,9 +1208,9 @@ LAB_0070e789: } if ((((uVar8 >> 10 & 1) != 0) && ((GHIDRA_UINT(roomDesc->Flags) >> 10 & 1) == 0)) && (g_game->_stageType == 0)) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x3)); layer->_visible = 1; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004); layer->_visible = 1; } } @@ -1219,24 +1219,24 @@ LAB_0070e789: if (iVar5 == 2) { (GHIDRA_CAST((GHIDRA_CAST(local_c8))))->Color::Color(0.9,0.7,1.0,1.0); color = extraout_EAX; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); (GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::operator_assign(color); } if (g_game->_stageType == 1) { (GHIDRA_CAST((GHIDRA_CAST(local_c8))))->Color::Color(); color = extraout_EAX_00; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); (GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::__mul(color); } iVar4 = this->_direction; (this->_sprite)._flipX = iVar4 == 3; (this->_sprite)._flipY = iVar4 == 2; - (GHIDRA_CAST((sprite)))->ANM2::LoadGraphics((uint8_t)iVar4); + ANM2::LoadGraphics(sprite,(uint8_t)iVar4); goto LAB_0070eb83; } (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_01_NormalDoor.anm2")); ehState = 0x23; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(GHIDRA_CAST((local_c8 + 0x14)),0); + ANM2::Load(&this->_sprite,GHIDRA_CAST((local_c8 + 0x14)),0); ehState = 0xffffffff; (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate(); game = g_game; @@ -1317,17 +1317,17 @@ LAB_0070e56f: } while (uVar8 < GHIDRA_UINT((this->_sprite)._layerCount)); } } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&this->_sprite,bVar3); (GHIDRA_CAST(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("KeyClosed"),9); (GHIDRA_CAST(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("KeyOpen"),7); goto LAB_0070eb83; } (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_10_BossRoomDoor.anm2")); ehState = 0x1a; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&doorAnmPath,1); + ANM2::Load(&this->_sprite,&doorAnmPath,1); ehState = 0xffffffff; (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::_Tidy_deallocate(); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(&DAT_00b1ce2c); + layer = ANM2::GetLayer(&this->_sprite,&DAT_00b1ce2c); if (this->_targetRoomType == 5) { layer->_visible = 1; goto LAB_0070eb83; @@ -1351,7 +1351,7 @@ LAB_0070e56f: anmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/grid/Door_Downpour.anm2",0x1c); ehState = 6; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_sprite,&anmPath,1); ehState = 0xffffffff; if (0xf < anmPath._capacity) { uVar8 = anmPath._capacity + 1; @@ -1382,7 +1382,7 @@ LAB_0070e56f: tmpString._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpString._buf))) + 0x0))),"gfx/grid/Door_Mines.anm2",0x19); ehState = 7; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&tmpString,1); + ANM2::Load(&this->_sprite,&tmpString,1); ehState = 0xffffffff; if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; @@ -1399,7 +1399,7 @@ LAB_0070e56f: } (GHIDRA_CAST((secretExitPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_Mines_Planks.anm2")); ehState = 8; - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Load(&secretExitPath,1); + ANM2::Load(&this->_extraSprite,&secretExitPath,1); pathString = &secretExitPath; goto LAB_0070db14; case 3: @@ -1407,20 +1407,20 @@ LAB_0070e56f: if (bVar3 == 0) { (GHIDRA_CAST((mausoleumDoorPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_Mausoleum.anm2")); ehState = 10; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&mausoleumDoorPath,1); + ANM2::Load(&this->_sprite,&mausoleumDoorPath,1); pathString = &mausoleumDoorPath; goto LAB_0070db14; } (GHIDRA_CAST((secretExitPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_Mausoleum_Alt.anm2")); ehState = 9; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&secretExitPath,1); + ANM2::Load(&this->_sprite,&secretExitPath,1); ehState = 0xffffffff; (GHIDRA_CAST((secretExitPath._buf)))->msvc::string::_Tidy_deallocate(); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_visible = 1; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); layer->_visible = 0; - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(&this->_sprite,&DAT_00000004); layer->_visible = 0; this->_doorFlags = this->_doorFlags | 0x40; (GHIDRA_CAST(((this->_openLockedAnimation)._buf)))->msvc::string::assign(s_Open,4); @@ -1428,7 +1428,7 @@ LAB_0070e56f: case 4: (GHIDRA_CAST((momsHeartDoorPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_MomsHeart.anm2")); ehState = 0xb; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&momsHeartDoorPath,1); + ANM2::Load(&this->_sprite,&momsHeartDoorPath,1); ehState = 0xffffffff; (GHIDRA_CAST((momsHeartDoorPath._buf)))->msvc::string::_Tidy_deallocate(); bVar1 = false; @@ -1439,21 +1439,21 @@ LAB_0070e56f: default: (GHIDRA_CAST((doorAnmPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/Door_01_NormalDoor.anm2")); ehState = 0xc; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&doorAnmPath,1); + ANM2::Load(&this->_sprite,&doorAnmPath,1); pathString = &doorAnmPath; LAB_0070db14: ehState = 0xffffffff; (GHIDRA_CAST((pathString->_buf)))->msvc::string::_Tidy_deallocate(); } if (this->_targetRoomType != 0x1b) { - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("Background")); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("Background")); if (layer != GHIDRA_CAST(0x0)) { (layer->_color)._colorize[0] = 0.5; (layer->_color)._colorize[1] = 0.5; (layer->_color)._colorize[2] = 0.5; (layer->_color)._colorize[3] = 0.6; } - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST("Light")); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST("Light")); if (layer != GHIDRA_CAST(0x0)) { LAB_0070db6f: layer->_visible = 0; @@ -1472,7 +1472,7 @@ LAB_0070eb83: } bVar3 = str_eq(GHIDRA_CAST(pathString),(this->_openLockedAnimation)._size,GHIDRA_CAST("KeyOpen"),7); if ((bVar3 != 0) || (g_game->_challenge == 0x18)) { - pvVar6 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("CoinClosed")); + pvVar6 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST("CoinClosed")); if (pvVar6 != (void *)0x0) { (GHIDRA_CAST(((this->_lockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("CoinClosed"),10); (GHIDRA_CAST(((this->_openLockedAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("CoinOpen"),8); @@ -1496,7 +1496,7 @@ LAB_0070eb83: (*GHIDRA_CAST((GHIDRA_CAST(&(tmpString._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((tmpString._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/grid/door_16_doublelock.anm2"),0x20); ehState = 0x25; - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Load(&tmpString,1); + ANM2::Load(&this->_extraSprite,&tmpString,1); if (0xf < tmpString._capacity) { uVar8 = tmpString._capacity + 1; pvVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)tmpString._buf)) + 0x0))); @@ -1514,13 +1514,13 @@ LAB_0070eb83: else if (iVar4 == 3) { (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/door_18_crackeddoor.anm2")); ehState = 0x26; - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Load(GHIDRA_CAST((local_c8 + 0x14)),1); + ANM2::Load(&this->_extraSprite,GHIDRA_CAST((local_c8 + 0x14)),1); (GHIDRA_CAST((local_c8 + 0x14)))->msvc::string::_Tidy_deallocate(); } else if ((iVar4 == 4) || (iVar4 == 6)) { (GHIDRA_CAST((barDoorPath._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/grid/door_17_bardoor.anm2")); ehState = 0x27; - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Load(&barDoorPath,1); + ANM2::Load(&this->_extraSprite,&barDoorPath,1); ehState = 0xffffffff; (GHIDRA_CAST((barDoorPath._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_closeAnimation)._buf)))->msvc::string::assign(GHIDRA_CAST("Closed"),6); @@ -1580,7 +1580,7 @@ void GridEntity_Door::UpdateAnimation() } sprite = GHIDRA_CAST(&this->_sprite); local_18 = this; - layer = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(sprite),GHIDRA_CAST(0x0)); layer->_visible = 1; iVar4 = this->_targetRoomType; if (iVar4 == 0) { @@ -1592,7 +1592,7 @@ void GridEntity_Door::UpdateAnimation() iVar1 = this->_currentRoomType; if (((((iVar1 == 7) || (iVar4 == 7)) || ((iVar1 == 8 || ((iVar4 == 8 || (iVar1 == 0x1d)))))) || (iVar4 == 0x1d)) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 7)) { - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Play(GHIDRA_CAST("Hidden"),0); + ANM2::Play(GHIDRA_CAST(sprite),GHIDRA_CAST("Hidden"),0); variantRef = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))); } else { @@ -1602,9 +1602,9 @@ void GridEntity_Door::UpdateAnimation() if (variant == 1) { if ((((iVar1 == 0x1b) || (iVar4 == 0x1b)) && (iVar4 = get_secret_exit_kind(this), iVar4 == 3)) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 3)) { - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::SetAnimation(&DAT_00b68d9c,1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST(sprite),&DAT_00b68d9c,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } this->_previousState = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); @@ -1619,9 +1619,9 @@ void GridEntity_Door::UpdateAnimation() animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_0070f2ee: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -1664,9 +1664,9 @@ LAB_0070f30b: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_0070f4b6: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -1707,7 +1707,7 @@ LAB_0070f4a5: this->_isExtraVisible = 1; if (iVar4 == 2) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) != 3) { - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Play(GHIDRA_CAST("TwoChains"),0); + ANM2::Play(&this->_extraSprite,GHIDRA_CAST("TwoChains"),0); goto LAB_0070f311; } if (this->_previousState == 3) { @@ -1720,7 +1720,7 @@ LAB_0070f4a5: pcVar5 = "KeyOpenChain1"; } } - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Play(GHIDRA_CAST(pcVar5),0); + ANM2::Play(&this->_extraSprite,GHIDRA_CAST(pcVar5),0); local_14 = variantRef; } else { @@ -1730,11 +1730,11 @@ LAB_0070f4a5: else if (((iVar4 != 4) && (iVar4 != 6)) || (pcVar5 = "Appear", spawnAge < 0xb)) { pcVar5 = GHIDRA_CAST(s_Idle); } - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Play(GHIDRA_CAST(pcVar5),0); + ANM2::Play(&this->_extraSprite,GHIDRA_CAST(pcVar5),0); if (((this->_currentRoomType == 0x1b) || (this->_targetRoomType == 0x1b)) && (iVar4 = get_secret_exit_kind(this), iVar4 == 2)) { iVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x2)); layer->_visible = iVar4 != 4; variantRef = local_18; } @@ -1752,9 +1752,9 @@ LAB_0070f4a5: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_0070f3fe: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -1790,7 +1790,7 @@ LAB_0070f3e5: if (((this->_extraSprite)._loaded == 0) || (local_14 = local_18, *GHIDRA_CAST(local_18) == 8)) goto LAB_0070f30e; this->_isExtraVisible = 1; - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->_extraSprite,GHIDRA_CAST("Appear"),0); goto LAB_0070f30b; } } @@ -1853,15 +1853,15 @@ LAB_0070efc7: ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0070f148; } sprite = GHIDRA_CAST(&this->_sprite); - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST(sprite),GHIDRA_CAST(animName),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; goto LAB_0070f145; } } else { - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Play(GHIDRA_CAST("GoldenKeyOpen"),0); + ANM2::Play(GHIDRA_CAST(sprite),GHIDRA_CAST("GoldenKeyOpen"),0); } } else { @@ -1872,7 +1872,7 @@ LAB_0070efc7: if (player->_hasGoldenKey != 0) { pcVar5 = "GoldenKeyOpenChain2"; } - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Play(GHIDRA_CAST(pcVar5),bVar2); + ANM2::Play(&this->_extraSprite,GHIDRA_CAST(pcVar5),bVar2); this->_isExtraVisible = 1; } animName = &this->_openAnimation; @@ -1882,9 +1882,9 @@ LAB_0070efc7: animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_0070f0a0: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -1948,7 +1948,7 @@ LAB_0070f174: iVar4 = *GHIDRA_CAST(variantRef); if (((iVar4 != 4) && (iVar4 != 6)) && ((this->_previousVariant == 4 || (this->_previousVariant == 6)))) { - (GHIDRA_CAST((&this->_extraSprite)))->ANM2::Play(GHIDRA_CAST("Vanish"),0); + ANM2::Play(&this->_extraSprite,GHIDRA_CAST("Vanish"),0); iVar4 = *GHIDRA_CAST(variantRef); this->_isExtraVisible = 1; } @@ -2210,7 +2210,7 @@ uint8_t GridEntity_Door::TryBlowOpen(uint8_t isFromExplosion, Entity *source) Game::SpawnParticles(g_game,&doorPos,5,rngResult % 6 + 9,8.0,color_00,100000.0,0); rngResult = Random(); poof = (GHIDRA_CAST((g_game)))->Game::SpawnEx(1000,2,&doorPos,&g_vectorZero,GHIDRA_CAST(0x0),0,rngResult,0); - (GHIDRA_CAST((&poof->_sprite)))->ANM2::Play(GHIDRA_CAST("Poof_Large1"),0); + ANM2::Play(&poof->_sprite,GHIDRA_CAST("Poof_Large1"),0); poof->_renderDepthOffset = 5.0; manager = g_manager; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) = 8; @@ -2452,12 +2452,12 @@ uint8_t GridEntity_Door::TryUnlock(Entity_Player *player, uint8_t isForce) UpdateAnimation(this); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) = 8; sprite = &this->_sprite; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x1)); layer->_visible = 0; bVar7 = local_64 == 9.66896e-44; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x2)); layer->_visible = bVar7; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(sprite,&DAT_00000004); layer->_visible = 0; return 1; } @@ -2599,12 +2599,12 @@ LAB_00710a08: return 0; } if ((this->_isExtraVisible != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 3)) { - bVar1 = (GHIDRA_CAST((&this->_extraSprite)))->ANM2::IsPlaying(GHIDRA_CAST("GoldenKeyOpenChain1")); + bVar1 = ANM2::IsPlaying(&this->_extraSprite,GHIDRA_CAST("GoldenKeyOpenChain1")); if (bVar1 != 0) { return 0; } in_stack_ffffff80 = 0x710a68; - bVar1 = (GHIDRA_CAST((&this->_extraSprite)))->ANM2::IsPlaying(GHIDRA_CAST("KeyOpenChain1")); + bVar1 = ANM2::IsPlaying(&this->_extraSprite,GHIDRA_CAST("KeyOpenChain1")); if (bVar1 != 0) { return 0; } @@ -2691,7 +2691,7 @@ LAB_00710c35: uVar5 = 0; LAB_00710c3a: if (uVar5 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("KeyOpen"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("KeyOpen"),0); pbVar6 = (this->_sprite)._animState._animData; } } @@ -2722,7 +2722,7 @@ LAB_00710ca0: uVar5 = 0; LAB_00710ca5: if ((uVar5 == 0) && - (layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(&DAT_00b1ce2c), layer != GHIDRA_CAST(0x0))) { + (layer = ANM2::GetLayer(&this->_sprite,&DAT_00b1ce2c), layer != GHIDRA_CAST(0x0))) { local_34._tint[0] = 1.0; local_34._tint[1] = 1.0; local_34._tint[2] = 1.0; diff --git a/generated-src/grid_entity_fire.cpp b/generated-src/grid_entity_fire.cpp index fc326a1..f19b894 100644 --- a/generated-src/grid_entity_fire.cpp +++ b/generated-src/grid_entity_fire.cpp @@ -51,7 +51,7 @@ void GridEntity_Fire::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/grid_fireplace.anm2",0x1d); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_sprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; @@ -69,9 +69,9 @@ void GridEntity_Fire::BeginBatches() animData = (this->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_0067dc72: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Flickering"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Flickering"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -112,7 +112,7 @@ LAB_0067dc59: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/effect_005_fire.anm2",0x1e); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; @@ -133,9 +133,9 @@ LAB_0067dc59: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) & 0xffffff00; if (animData == GHIDRA_CAST(0x0)) { LAB_0067ddb6: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->ANM2::SetAnimation(GHIDRA_CAST("FireStage00"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),GHIDRA_CAST("FireStage00"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x198))) = 1; } } @@ -240,7 +240,7 @@ LAB_0067dd97: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/Effect_Ember.anm2",0x1b); local_8 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27c)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27c)))),&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; @@ -281,9 +281,9 @@ LAB_0067e036: LAB_0067e03b: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c0))) != '\0')))) goto LAB_0067e078; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27c)))))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27c)))),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2ac)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2ac))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c0))) = 1; } LAB_0067e078: @@ -338,32 +338,32 @@ void GridEntity_Fire::Update() switch(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc))))) { case 0: - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->ANM2::Play(GHIDRA_CAST("FireStage00"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),GHIDRA_CAST("FireStage00"),0); break; case 1: - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->ANM2::Play(GHIDRA_CAST("FireStage01"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),GHIDRA_CAST("FireStage01"),0); break; case 2: - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->ANM2::Play(GHIDRA_CAST("FireStage02"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),GHIDRA_CAST("FireStage02"),0); break; case 3: - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->ANM2::Play(GHIDRA_CAST("FireStage03"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),GHIDRA_CAST("FireStage03"),0); break; case 4: if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x188)))) != 0) { (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x198))) = 0; } - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),GHIDRA_CAST(0x0)); layer->_visible = 0; } if (3 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc))))) { curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == GHIDRA_CAST(0x0)) { LAB_0067e2a3: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation((&PTR_s_NoFire_00b64fdc)[*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x26c))))] + bVar1 = ANM2::SetAnimation(&this->_sprite,(&PTR_s_NoFire_00b64fdc)[*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x26c))))] ,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -399,9 +399,10 @@ LAB_0067e28d: curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == GHIDRA_CAST(0x0)) { LAB_0067e1fb: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation((&PTR_s_Flickering_00b64fd0)[*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x26c))))],1); + bVar1 = ANM2::SetAnimation(&this->_sprite, + (&PTR_s_Flickering_00b64fd0)[*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x26c))))],1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -436,12 +437,12 @@ LAB_0067e1e5: LAB_0067e2c6: this->_collisionClass = iVar3; if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x25d))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1a4)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1a4))))); } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } if (((((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 1) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x268)))) < 1)) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) < 4)) && diff --git a/generated-src/grid_entity_gravity.cpp b/generated-src/grid_entity_gravity.cpp index 074092a..a7df974 100644 --- a/generated-src/grid_entity_gravity.cpp +++ b/generated-src/grid_entity_gravity.cpp @@ -64,7 +64,7 @@ void GridEntity_Gravity::guard_check_icall() tilesPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tilesPath._buf))) + 0x0))),"gfx/grid/Tiles_Rotgut.anm2",0x1b); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&tilesPath,1); + ANM2::Load(&this->_sprite,&tilesPath,1); local_8 = 0xffffffff; if (0xf < tilesPath._capacity) { uVar4 = tilesPath._capacity + 1; @@ -79,9 +79,9 @@ void GridEntity_Gravity::guard_check_icall() } operator_delete(freeBlock,uVar4); } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Floor"),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Floor"),1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } @@ -95,7 +95,7 @@ void GridEntity_Gravity::guard_check_icall() } uVar4 = (GHIDRA_CAST((&rng)))->RNG::RandomInt(uVar4); if ((this->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar4)); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(uVar4)); } } else { @@ -112,7 +112,7 @@ void GridEntity_Gravity::guard_check_icall() tilesPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tilesPath._buf))) + 0x0))),"gfx/grid/Tiles_Itemdungeon_Gideon.anm2",0x27); local_8 = 1; - (GHIDRA_CAST((sprite)))->ANM2::Load(&tilesPath,1); + ANM2::Load(sprite,&tilesPath,1); local_8 = 0xffffffff; if (0xf < tilesPath._capacity) { uVar4 = tilesPath._capacity + 1; @@ -144,7 +144,7 @@ void GridEntity_Gravity::guard_check_icall() itemDungeonPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(itemDungeonPath._buf))) + 0x0))),"gfx/grid/Tiles_Itemdungeon.anm2",0x20); local_8 = 2; - (GHIDRA_CAST((sprite)))->ANM2::Load(&itemDungeonPath,1); + ANM2::Load(sprite,&itemDungeonPath,1); local_8 = 0xffffffff; if (0xf < itemDungeonPath._capacity) { uVar4 = itemDungeonPath._capacity + 1; @@ -170,7 +170,7 @@ void GridEntity_Gravity::guard_check_icall() return; } sprintf_s(floorAnimName,0x1f,GHIDRA_CAST("Floor%u")); - (GHIDRA_CAST((floorSprite)))->ANM2::Play(floorAnimName,0); + ANM2::Play(floorSprite,floorAnimName,0); } } ExceptionList = local_10; @@ -223,8 +223,8 @@ void GridEntity_Gravity::Update() GHIDRA_INT((playerManager->_playerList)._begin) >> 2))); } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } diff --git a/generated-src/grid_entity_lock.cpp b/generated-src/grid_entity_lock.cpp index 2668593..e886bb3 100644 --- a/generated-src/grid_entity_lock.cpp +++ b/generated-src/grid_entity_lock.cpp @@ -29,7 +29,7 @@ void GridEntity_Lock::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/grid_locks.anm2",0x19); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_sprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { size = anm2Path._capacity + 1; @@ -56,9 +56,9 @@ void GridEntity_Lock::BeginBatches() if (payToPlayOwner == GHIDRA_CAST(0x0)) { pcVar1 = GHIDRA_CAST(s_Idle); } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar1),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(pcVar1),1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } @@ -69,9 +69,9 @@ void GridEntity_Lock::BeginBatches() } } else { - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Broken"),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Broken"),1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } @@ -99,7 +99,7 @@ void GridEntity_Lock::Update() if (((this->_sprite)._animState._animData != (void *)0x0) && (isBreakTriggered = - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Break")), + AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("Break")), isBreakTriggered != 0)) { this->_collisionClass = 0; game = g_game; @@ -142,8 +142,8 @@ LAB_007119ac: } } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } @@ -218,9 +218,9 @@ void GridEntity_Lock::break_open(Entity_Player *player) else { anim = "BreakingCoin"; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } uVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14)))); diff --git a/generated-src/grid_entity_pit.cpp b/generated-src/grid_entity_pit.cpp index 06ade0a..8725e8d 100644 --- a/generated-src/grid_entity_pit.cpp +++ b/generated-src/grid_entity_pit.cpp @@ -72,8 +72,8 @@ void GridEntity_Pit::Update() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 2; } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } if (1 < GHIDRA_UINT((this->_sprite)._layerCount)) { pGVar8 = GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) + -2)); @@ -91,10 +91,10 @@ void GridEntity_Pit::Update() KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._layerFrames) + iVar11 * 4)) = 0; - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar11,(float)GHIDRA_INT(local_dc)); + AnimationState::AdvanceLayerPosition(&(this->_sprite)._animState,iVar11,(float)GHIDRA_INT(local_dc)); } iVar11 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_visible = 1 < iVar11; } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 3) { @@ -344,10 +344,10 @@ LAB_00713111: (float)((double)GHIDRA_INT(uVar9) + __uint_to_double_fixup[-(GHIDRA_INT(uVar9) >> 0x1f)]) * 2.3283064e-10 * 0.2 + 0.1); other = extraout_EAX; - layer = (GHIDRA_CAST((&pEVar5->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&pEVar5->_sprite,GHIDRA_CAST(0x0)); (GHIDRA_CAST((GHIDRA_CAST(&layer->_color))))->Color::operator_assign(other); (GHIDRA_CAST((&iStack_7c)))->BlendMode::SetMode(2,unusedArg_01); - layer = (GHIDRA_CAST((&pEVar5->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&pEVar5->_sprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = iStack_7c; layer->_blendMode[1] = GHIDRA_INT(local_78); layer->_blendMode[2] = (*GHIDRA_CAST((GHIDRA_CAST(&(local_78)) + 0x4))); @@ -705,7 +705,7 @@ void GridEntity_Pit::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/grid_pit.anm2",0x17); local_8 = 2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,0); + ANM2::Load(&this->_sprite,&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -734,7 +734,7 @@ void GridEntity_Pit::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/grid_pit_water.anm2",0x1d); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,0); + ANM2::Load(&this->_sprite,&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -755,9 +755,9 @@ void GridEntity_Pit::BeginBatches() (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) & 0xffffff00; if (pbVar7 == GHIDRA_CAST(0x0)) { LAB_00713a2c: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST("highlights"),1); + bVar2 = ANM2::SetOverlayAnimation(&this->_sprite,GHIDRA_CAST("highlights"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._overlayAnimState); (this->_sprite)._overlayAnimState._isPlaying = 1; } } @@ -788,7 +788,7 @@ LAB_00713a16: ((pbVar7[0x34] != 0 && ((this->_sprite)._overlayAnimState._isPlaying == 0)))) goto LAB_00713a2c; } - pvVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("highlights")); + pvVar5 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST("highlights")); uVar3 = *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x30)); if (uVar3 == 0) { startFrame = 0; @@ -798,7 +798,7 @@ LAB_00713a16: startFrame = startFrame % uVar3; } if ((this->_sprite)._overlayAnimState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(startFrame)); + AnimationState::SetFrameFloat(&(this->_sprite)._overlayAnimState,(float)GHIDRA_INT(startFrame)); } pvVar5 = g_game->_room; pbVar7 = GHIDRA_CAST((GHIDRA_INT(pvVar5) + *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x1d18)) * 0x13c + 0x1ddc)); @@ -923,10 +923,10 @@ LAB_00713e5d: operator_delete(pcVar6,uVar3); bVar2 = extraout_CL_00; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar2); - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b68fb8,1); + ANM2::LoadGraphics(&this->_sprite,bVar2); + bVar2 = ANM2::SetAnimation(&this->_sprite,&DAT_00b68fb8,1); if (((bVar2 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -1097,9 +1097,9 @@ void GridEntity_Pit::update_sprite_edges() edgeFrame = cornerMask + 0x14; } } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b68fb8,1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,&DAT_00b68fb8,1); if (((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)edgeFrame), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)edgeFrame), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -1120,10 +1120,10 @@ void GridEntity_Pit::update_sprite_edges() KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._layerFrames) + iVar8 * 4)) = 0; - (GHIDRA_CAST((animState)))->AnimationState::AdvanceLayerPosition(iVar8,(float)iVar6); + AnimationState::AdvanceLayerPosition(animState,iVar8,(float)iVar6); } iVar6 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); - pLVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar5 = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); pLVar5->_visible = 1 < iVar6; } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) & 0xffffff00 | edgeFrame; diff --git a/generated-src/grid_entity_poop.cpp b/generated-src/grid_entity_poop.cpp index 02b031e..6c6cbcf 100644 --- a/generated-src/grid_entity_poop.cpp +++ b/generated-src/grid_entity_poop.cpp @@ -85,11 +85,11 @@ void GridEntity_Poop::Update() local_58 = (float)(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) / 0xfa); } sprintf_s(animName,0x1f,GHIDRA_CAST("State%d")); - pvVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(animName); + pvVar3 = ANM2::GetAnimationData(&this->_sprite,animName); local_58 = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x30)); - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(animName,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,animName,1); if (((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_58)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(local_58)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -106,9 +106,9 @@ void GridEntity_Poop::Update() pbVar4 = (this->_sprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_007149d5: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -212,9 +212,9 @@ LAB_00714b86: pbVar4 = (this->_sprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_00714be2: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("State1"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("State1"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -453,8 +453,8 @@ LAB_00714fce: } } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } ExceptionList = local_1c; return; @@ -689,7 +689,7 @@ LAB_00715bc8: giantAnm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(giantAnm2Path._buf))) + 0x0))),"gfx/grid/grid_poop_giant.anm2",0x1e); ehState = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&giantAnm2Path,1); + ANM2::Load(&this->_sprite,&giantAnm2Path,1); ehState = 0xffffffff; if (0xf < giantAnm2Path._capacity) { uVar4 = giantAnm2Path._capacity + 1; @@ -720,7 +720,7 @@ LAB_00715bc8: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/grid_poop.anm2",0x18); ehState = 1; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,0); + ANM2::Load(&this->_sprite,&anm2Path,0); ehState = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -871,7 +871,7 @@ LAB_00716065: spritesheetPathSize = 0; spritesheetPathCapacity = 0xf; spritesheetPathString[0] = GHIDRA_CAST((GHIDRA_UINT(spritesheetPathString[0]) & 0xffffff00)); - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(isSameSpritesheet); + ANM2::LoadGraphics(&this->_sprite,isSameSpritesheet); LAB_007162ed: if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 1000) { iVar3 = 4; @@ -889,11 +889,11 @@ LAB_007162ed: } if (*GHIDRA_CAST(g_game->_room) == '\0') { sprintf_s(stateAnimName,0x1f,GHIDRA_CAST("State%d")); - pvVar8 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(stateAnimName); + pvVar8 = ANM2::GetAnimationData(&this->_sprite,stateAnimName); local_1ac = *GHIDRA_CAST((GHIDRA_CAST(pvVar8) + 0x30)); - isSameSpritesheet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(stateAnimName,1); + isSameSpritesheet = ANM2::SetAnimation(&this->_sprite,stateAnimName,1); if (((isSameSpritesheet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_1ac)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(local_1ac)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -960,9 +960,9 @@ LAB_007163ec: } pcVar10 = GHIDRA_CAST(playStateAnimName); } - isSameSpritesheet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar10),1); + isSameSpritesheet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(pcVar10),1); if (isSameSpritesheet != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -986,7 +986,7 @@ LAB_00716493: ExceptionList = prevExceptionList; return; } - spawnLayer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(s_Spawn); + spawnLayer = ANM2::GetLayer(&this->_sprite,s_Spawn); if (spawnLayer != GHIDRA_CAST(0x0)) { (spawnLayer->_color)._colorize[0] = 1.9; (spawnLayer->_color)._colorize[1] = 2.0; @@ -1034,9 +1034,9 @@ LAB_0071660b: if ((uVar4 == 0) && ((pbVar7[0x34] == 0 || ((pEVar5->_sprite)._animState._isPlaying != 0)))) goto LAB_00716637; } - isSameSpritesheet = (GHIDRA_CAST((&pEVar5->_sprite)))->ANM2::SetAnimation(s_Idle,1); + isSameSpritesheet = ANM2::SetAnimation(&pEVar5->_sprite,s_Idle,1); if (isSameSpritesheet != 0) { - (GHIDRA_CAST((&(pEVar5->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pEVar5->_sprite)._animState); (pEVar5->_sprite)._animState._isPlaying = 1; } } @@ -1059,11 +1059,11 @@ void GridEntity_Poop::RespawnRedPoop() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) = 1000; this->_reviveTimer = 0x78; this->_collisionClass = 0; - animData = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("State5")); + animData = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST("State5")); frameCount = *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x30)); - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("State5"),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("State5"),1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)frameCount); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)frameCount); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } diff --git a/generated-src/grid_entity_pressure_plate.cpp b/generated-src/grid_entity_pressure_plate.cpp index d7953fa..8be1ee0 100644 --- a/generated-src/grid_entity_pressure_plate.cpp +++ b/generated-src/grid_entity_pressure_plate.cpp @@ -6,8 +6,8 @@ void GridEntity_PressurePlate::Update() uint32_t gridIndex; if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 2) { update_greed_button(this); @@ -143,9 +143,9 @@ LAB_00983615: if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00983648; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Switched"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Switched"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00983648: @@ -155,9 +155,9 @@ LAB_00983648: pbVar2 = (this->_sprite)._animState._animData; if (pbVar2 == GHIDRA_CAST(0x0)) { LAB_009836b8: - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b7cf1c,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b7cf1c,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -270,7 +270,7 @@ void GridEntity_PressurePlate::update_greed_button_anim(uint8_t isRed) return; } if (isRed != 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("OffRedStart"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("OffRedStart"),0); this->_nextGreedAnimation = "OffRed"; return; } @@ -357,7 +357,7 @@ LAB_00983958: return; } } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(this->_nextGreedAnimation,0); + ANM2::Play(&this->_sprite,this->_nextGreedAnimation,0); } return; } @@ -1609,7 +1609,7 @@ void GridEntity_PressurePlate::BeginBatches() gfxPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/grid_pressureplate.anm2",0x21); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&gfxPath,0); + ANM2::Load(&this->_sprite,&gfxPath,0); local_8 = 0xffffffff; bVar1 = extraout_CL; if (0xf < gfxPath._capacity) { @@ -1664,7 +1664,7 @@ void GridEntity_PressurePlate::BeginBatches() gfxPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(gfxPath._buf))) + 0x0))),"gfx/grid/TimerPlate.anm2",0x19); local_8 = 2; - (GHIDRA_CAST((&this->_timerPlate)))->ANM2::Load(&gfxPath,1); + ANM2::Load(&this->_timerPlate,&gfxPath,1); local_8 = 0xffffffff; if (0xf < gfxPath._capacity) { uVar3 = gfxPath._capacity + 1; @@ -1679,7 +1679,7 @@ void GridEntity_PressurePlate::BeginBatches() } operator_delete(freeBlock,uVar3); } - (GHIDRA_CAST((&this->_timerPlate)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_timerPlate,s_Idle,0); bVar1 = extraout_CL_03; break; case 3: @@ -1740,7 +1740,7 @@ LAB_009861f6: } goto LAB_009861f6; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(&this->_sprite,bVar1); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) == 2) { update_greed_button_anim(this,0); play_pending_animation(this); @@ -1748,7 +1748,7 @@ LAB_009861f6: else { iVar2 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); if (iVar2 == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(&DAT_00b7cf20,0); + ANM2::Play(&this->_sprite,&DAT_00b7cf20,0); } else if ((iVar2 == 3) || (iVar2 == 4)) { animData = (this->_sprite)._animState._animData; @@ -1778,9 +1778,9 @@ LAB_00986379: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_009863c1; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(&DAT_00b7cf1c,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,&DAT_00b7cf1c,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } diff --git a/generated-src/grid_entity_rock.cpp b/generated-src/grid_entity_rock.cpp index cfd2a4d..2faccb6 100644 --- a/generated-src/grid_entity_rock.cpp +++ b/generated-src/grid_entity_rock.cpp @@ -189,8 +189,8 @@ LAB_007191ab: } LAB_0071926c: if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); game = g_game; } iVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); @@ -421,7 +421,7 @@ void GridEntity_Rock::RenderTop(Vector *pos) *GHIDRA_CAST((this->_sprite)._color._offset) = (*GHIDRA_CAST((GHIDRA_CAST(&(roomColor._offset)) + 0x0))); (this->_sprite)._color._offset[2] = roomColor._offset[2]; } - topLayer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + topLayer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); topLayer->_visible = 1; pvVar1 = (this->_sprite)._animState._animData; if (((pvVar1 != (void *)0x0) && @@ -432,7 +432,7 @@ void GridEntity_Rock::RenderTop(Vector *pos) *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._layerFrames) + layerIndex * 4)), &g_vectorZero,&g_vectorZero,animation); } - topLayer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + topLayer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); topLayer->_visible = 0; if (spriteColor != &savedColor) { spriteColor->_tint[0] = local_58; @@ -501,7 +501,7 @@ void GridEntity_Rock::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/grid_rock.anm2",0x18); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,0); + ANM2::Load(&this->_sprite,&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar9 = anm2Path._capacity + 1; @@ -562,7 +562,7 @@ void GridEntity_Rock::BeginBatches() } while (uVar9 < GHIDRA_UINT((this->_sprite)._layerCount)); } animName = &this->_anim; - (GHIDRA_CAST((&this->_sprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&this->_sprite,bVar3); local_48 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))); bVar2 = false; if (local_48 == 0) { @@ -620,7 +620,7 @@ void GridEntity_Rock::BeginBatches() break; case 0x18: (GHIDRA_CAST((animName->_buf)))->msvc::string::assign(GHIDRA_CAST("pillar"),6); - layer = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(&this->_sprite,GHIDRA_CAST(0x1)); layer->_visible = 0; goto LAB_0071a3d7; case 0x19: @@ -660,7 +660,7 @@ LAB_0071a3d7: if (0xf < (this->_anim)._capacity) { animName = *GHIDRA_CAST(animName->_buf); } - pvVar7 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST(animName)); + pvVar7 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST(animName)); if (pvVar7 == (void *)0x0) { KAGE_LogMessage(1,GHIDRA_CAST("[warn] GridEntityRock animation %s is NULL\n")); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) = 0; @@ -746,9 +746,9 @@ LAB_0071a3d7: if (0xf < (this->_anim)._capacity) { animName = *GHIDRA_CAST(animName->_buf); } - bVar3 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar3 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (((bVar3 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_4c)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(local_4c)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -893,7 +893,7 @@ void GridEntity_Rock::SetBigRockFrame(uint32_t param_2) if (0xf < (this->_anim)._capacity) { name = *GHIDRA_CAST(anim->_buf); } - animData = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST(name)); + animData = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST(name)); if (animData != (void *)0x0) { iVar1 = *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 4)); if (iVar1 == 0) { @@ -932,9 +932,9 @@ LAB_0071aa1f: if (0xf < (this->_anim)._capacity) { anim = *GHIDRA_CAST(anim->_buf); } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if (((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(frame)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(frame)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -966,9 +966,9 @@ void GridEntity_Rock::UpdateAnimFrame() if (0xf < (this->_anim)._capacity) { anim = *GHIDRA_CAST(anim->_buf); } - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(anim),1); if ((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(frame)); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(frame)); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } diff --git a/generated-src/grid_entity_spikes.cpp b/generated-src/grid_entity_spikes.cpp index ea3ba09..5802000 100644 --- a/generated-src/grid_entity_spikes.cpp +++ b/generated-src/grid_entity_spikes.cpp @@ -49,7 +49,7 @@ void GridEntity_Spikes::BeginBatches() local_2c._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))),"gfx/grid/grid_spikes.anm2",0x1a); local_8 = 0; - (GHIDRA_CAST((sprite)))->ANM2::Load(&local_2c,0); + ANM2::Load(sprite,&local_2c,0); local_8 = 0xffffffff; isDisabled = extraout_CL; if (0xf < local_2c._capacity) { @@ -80,7 +80,7 @@ void GridEntity_Spikes::BeginBatches() isDisabled = extraout_CL_01; } while (GHIDRA_UINT(local_34.y) < GHIDRA_CAST((this->_sprite)._layerCount)); } - (GHIDRA_CAST((sprite)))->ANM2::LoadGraphics(isDisabled); + ANM2::LoadGraphics(sprite,isDisabled); if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 8) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) % 100 == 0)) { uVar5 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14)))); local_2c._buf[0xc] = '\x05'; @@ -124,9 +124,9 @@ void GridEntity_Spikes::BeginBatches() curAnim = (this->_sprite)._animState._animData; if (curAnim == GHIDRA_CAST(0x0)) { LAB_0071e528: - isDisabled = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("UnsummonPayment"),1); + isDisabled = ANM2::SetAnimation(sprite,GHIDRA_CAST("UnsummonPayment"),1); if (isDisabled != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -170,9 +170,9 @@ LAB_0071e515: if (0xf < local_2c._capacity) { psVar3 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c._buf))) + 0x0))); } - isDisabled = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(psVar3),1); + isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(psVar3),1); if ((isDisabled != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } @@ -308,9 +308,9 @@ LAB_0071e7b5: } pcVar4 = &DAT_00c80fa8; } - isDisabled = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar4),1); + isDisabled = ANM2::SetAnimation(sprite,GHIDRA_CAST(pcVar4),1); if (isDisabled != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0071e7e6; @@ -357,9 +357,9 @@ LAB_0071e47c: ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071e7e6; } - isDisabled = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_34.y),1); + isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34.y),1); if (isDisabled != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } goto LAB_0071e7e6; @@ -381,9 +381,9 @@ LAB_0071e47c: curAnim = (this->_sprite)._animState._animData; if (curAnim == GHIDRA_CAST(0x0)) { LAB_0071e3bb: - isDisabled = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_34.y),1); + isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34.y),1); if (isDisabled != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -433,9 +433,9 @@ LAB_0071e3a5: curAnim = (this->_sprite)._animState._animData; if (curAnim == GHIDRA_CAST(0x0)) { LAB_0071e2db: - isDisabled = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_34.y),1); + isDisabled = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34.y),1); if (isDisabled != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -597,7 +597,7 @@ LAB_0071ea6f: if (extraout_EDX != 0) { anim = summonAnim; } - (GHIDRA_CAST((this_00)))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(this_00,GHIDRA_CAST(anim),0); } } } @@ -607,8 +607,8 @@ LAB_0071ea6f: unsummon(this,0); } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } @@ -732,9 +732,9 @@ LAB_0071ec25: animName = "UnsummonWomb"; } } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(animName),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0071ecaa: @@ -753,9 +753,9 @@ LAB_0071ecaa: if (0xf < curAnimNameCapacity) { curAnimNameData = curAnimName[0]; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(curAnimNameData),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(curAnimNameData),1); if ((bVar1 != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData != (void *)0x0) { (this->_sprite)._animState._isPlaying = 0; } diff --git a/generated-src/grid_entity_stairs.cpp b/generated-src/grid_entity_stairs.cpp index 5aac783..e4df9c3 100644 --- a/generated-src/grid_entity_stairs.cpp +++ b/generated-src/grid_entity_stairs.cpp @@ -46,7 +46,7 @@ void GridEntity_Stairs::BeginBatches() local_18 = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_2c))) + 0x0))),"gfx/grid/door_20_secrettrapdoor.anm2",0x25); local_8 = 0; - (GHIDRA_CAST((sprite)))->ANM2::Load(GHIDRA_CAST(local_2c),0); + ANM2::Load(sprite,GHIDRA_CAST(local_2c),0); local_8 = 0xffffffff; bVar1 = extraout_CL; if (0xf < local_18) { @@ -88,7 +88,7 @@ void GridEntity_Stairs::BeginBatches() bVar1 = extraout_CL_02; } } - (GHIDRA_CAST((sprite)))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(sprite,bVar1); animData = (this->_sprite)._animState._animData; if (animData != GHIDRA_CAST(0x0)) { curAnimName = animData; @@ -124,9 +124,9 @@ LAB_0099bcf5: } } } - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Closed"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Closed"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } @@ -234,9 +234,9 @@ LAB_0099c032: curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == GHIDRA_CAST(0x0)) { LAB_0099c083: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Closed"),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Closed"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } game = g_game; @@ -275,9 +275,9 @@ LAB_0099bf89: curAnimChar = (this->_sprite)._animState._animData; if (curAnimChar == GHIDRA_CAST(0x0)) { LAB_0099bfeb: - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Open Animation"),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Open Animation"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } game = g_game; @@ -363,8 +363,8 @@ LAB_0099c12a: game->_dungeonReturnRoomIndex = returnRoomIdx; } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } LAB_0099c224: if ((*GHIDRA_CAST((GHIDRA_CAST(&(nearbyEntities)) + 0x0))) == '\0') { diff --git a/generated-src/grid_entity_statue.cpp b/generated-src/grid_entity_statue.cpp index e34fa43..4faa70a 100644 --- a/generated-src/grid_entity_statue.cpp +++ b/generated-src/grid_entity_statue.cpp @@ -10,8 +10,8 @@ void GridEntity_Statue::Render() void GridEntity_Statue::Update() { if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) == 1) { this->_collisionClass = 3; diff --git a/generated-src/grid_entity_teleporter.cpp b/generated-src/grid_entity_teleporter.cpp index b710056..52f2a5f 100644 --- a/generated-src/grid_entity_teleporter.cpp +++ b/generated-src/grid_entity_teleporter.cpp @@ -56,7 +56,7 @@ LAB_00838ca0: LAB_00838ca5: if (uVar3 == 0) goto LAB_00838e61; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("IdleOff"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("IdleOff"),0); goto LAB_00838e61; } if ((curAnimChar == GHIDRA_CAST(0x0)) || ((this->_sprite)._animState._isPlaying == 0)) { @@ -64,7 +64,7 @@ LAB_00838d09: (*GHIDRA_CAST((GHIDRA_CAST(&(auVar6)) + 0x8))) = "IdleOn"; (*GHIDRA_CAST((GHIDRA_CAST(&(auVar6)) + 0x0))) = 0x838d1800000000; (*GHIDRA_CAST((GHIDRA_CAST(&(auVar6)) + 0xc))) = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("IdleOn"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("IdleOn"),0); auVar5 = (*GHIDRA_CAST((GHIDRA_CAST(&(auVar6)) + 0x0))); } else { @@ -142,8 +142,8 @@ LAB_00838e61: *GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + this->_gridIndex * 4 + 0x76c)) = 999; } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } @@ -199,7 +199,7 @@ LAB_00838f10: } while (bVar2 != 0); (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(pbVar1,GHIDRA_INT(cursor) - GHIDRA_INT((pbVar1 + 1))); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_sprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -244,9 +244,9 @@ LAB_00839005: if ((uVar3 == 0) && ((pbVar1[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_00839038; } - bVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("IdleOn"),1); + bVar2 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("IdleOn"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_00839038: diff --git a/generated-src/grid_entity_tnt.cpp b/generated-src/grid_entity_tnt.cpp index 877c2a1..2b8dab1 100644 --- a/generated-src/grid_entity_tnt.cpp +++ b/generated-src/grid_entity_tnt.cpp @@ -42,7 +42,7 @@ void GridEntity_TNT::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/grid_tnt.anm2",0x17); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->_sprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; @@ -101,9 +101,9 @@ LAB_0071f02d: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_0071f059; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_sprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_0071f059: @@ -130,19 +130,19 @@ void GridEntity_TNT::Update() switch(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc))))) { case 0: case 1: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_sprite,s_Idle,0); return; case 2: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("IdleMedium"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("IdleMedium"),0); return; case 3: goto LAB_0071f222; case 4: - isBlownPlaying = (GHIDRA_CAST((&this->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("Blown")); + isBlownPlaying = ANM2::IsPlaying(&this->_sprite,GHIDRA_CAST("Blown")); if (isBlownPlaying == 0) { this->_frameCnt = this->_frameCnt + -1; if (this->_frameCnt < 1) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("Blown"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("Blown"),0); if (this->_frameCnt != 0) { return; } @@ -168,7 +168,7 @@ void GridEntity_TNT::Update() return; } LAB_0071f222: - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST("ReadyToExplode"),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST("ReadyToExplode"),0); return; default: return; diff --git a/generated-src/grid_entity_trap_door.cpp b/generated-src/grid_entity_trap_door.cpp index 7af8689..3f0adb3 100644 --- a/generated-src/grid_entity_trap_door.cpp +++ b/generated-src/grid_entity_trap_door.cpp @@ -70,7 +70,7 @@ void GridEntity_TrapDoor::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/VoidTrapdoor.anm2",0x1b); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -106,7 +106,7 @@ void GridEntity_TrapDoor::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/trapdoor_downpour.anm2",0x20); local_8 = 1; - (GHIDRA_CAST((sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(sprite,&anm2Path,1); local_8 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0071feb0; uVar3 = anm2Path._capacity + 1; @@ -133,7 +133,7 @@ void GridEntity_TrapDoor::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/trapdoor_mines.anm2",0x1d); local_8 = 2; - (GHIDRA_CAST((sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(sprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -149,10 +149,10 @@ void GridEntity_TrapDoor::BeginBatches() operator_delete(freeBlock,uVar3); } if (1 < GHIDRA_UINT((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))->_layerCount)) { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),GHIDRA_CAST(0x1)); layer->_visible = 0; } - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("Closed"),0); + ANM2::Play(sprite,GHIDRA_CAST("Closed"),0); uVar3 = Random(); position = (GHIDRA_CAST((GHIDRA_CAST(local_54.y))))->GridEntity::Position(&local_54); effect = (GHIDRA_CAST((g_game)))->Game::Spawn(1000,0x8b,position,&g_vectorZero,GHIDRA_CAST(0x0),0,uVar3); @@ -186,7 +186,7 @@ void GridEntity_TrapDoor::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/Door_11_TrapDoor.anm2",0x1f); local_8 = 4; - (GHIDRA_CAST((sprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(sprite,&anm2Path,1); local_8 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0071feb0; uVar3 = anm2Path._capacity + 1; @@ -212,7 +212,7 @@ void GridEntity_TrapDoor::BeginBatches() tmpPath[0] = GHIDRA_CAST(0x0); (GHIDRA_CAST((GHIDRA_CAST(tmpPath))))->msvc::string::assign(GHIDRA_CAST("gfx/grid/Door_11_TrapDoor.anm2"),0x1e); local_8 = 9; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),GHIDRA_CAST(tmpPath),1); local_8 = 0xffffffff; if (0xf < tmpPathCapacity) { uVar3 = tmpPathCapacity + 1; @@ -240,7 +240,7 @@ void GridEntity_TrapDoor::BeginBatches() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/grid/Door_11_Wombhole.anm2",0x1f); local_8 = 6; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(&anm2Path,0); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),&anm2Path,0); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -292,7 +292,7 @@ LAB_0071fe0e: if (iVar4 == 7) { bVar1 = (GHIDRA_CAST((GHIDRA_CAST(g_game))))->Level::IsAltPath(); if (bVar1 == 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),unk); goto LAB_0071feb0; } } @@ -323,7 +323,7 @@ LAB_0071fe0e: } } LAB_0071fe18: - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),bVar1); goto LAB_0071feb0; } anm2Path._size = 0; @@ -338,7 +338,7 @@ LAB_0071fe18: local_8 = 5; LAB_0071f766: anm2Path._capacity = 0x2f; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),&anm2Path,1); local_8 = 0xffffffff; if (anm2Path._capacity < 0x10) goto LAB_0071feb0; uVar3 = anm2Path._capacity + 1; @@ -356,7 +356,7 @@ LAB_0071fb7a: operator_delete(freeBlock,uVar3); LAB_0071feb0: *GHIDRA_CAST((GHIDRA_CAST(local_54.y) + 0xc)) = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)))))->ANM2::Play(GHIDRA_CAST("Closed"),0); + ANM2::Play(GHIDRA_CAST((GHIDRA_INT(local_54.y) + 0x40)),GHIDRA_CAST("Closed"),0); ExceptionList = local_10; return; } @@ -615,9 +615,9 @@ LAB_0072040a: local_34 = piVar12; if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_00720469: - bVar5 = (GHIDRA_CAST((&savedTrapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Closed"),1); + bVar5 = ANM2::SetAnimation(&savedTrapDoor->_sprite,GHIDRA_CAST("Closed"),1); if (bVar5 != 0) { - (GHIDRA_CAST((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } } @@ -693,9 +693,9 @@ LAB_00720605: ((pbVar8[0x34] == 0 || ((savedTrapDoor->_sprite)._animState._isPlaying != 0)))) goto LAB_00720642; } - bVar5 = (GHIDRA_CAST((&savedTrapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Open Animation"),1); + bVar5 = ANM2::SetAnimation(&savedTrapDoor->_sprite,GHIDRA_CAST("Open Animation"),1); if (bVar5 != 0) { - (GHIDRA_CAST((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } } @@ -837,9 +837,9 @@ LAB_00720695: pbVar8 = (trapDoor->_sprite)._animState._animData; if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_007207ef: - bVar5 = (GHIDRA_CAST((&trapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Closed"),1); + bVar5 = ANM2::SetAnimation(&trapDoor->_sprite,GHIDRA_CAST("Closed"),1); if (bVar5 != 0) { - (GHIDRA_CAST((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } game = g_game; @@ -906,16 +906,16 @@ LAB_007208b5: ((pbVar8[0x34] == 0 || ((trapDoor->_sprite)._animState._isPlaying != 0)))) goto LAB_007208e8; } - bVar5 = (GHIDRA_CAST((&trapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Opened"),1); + bVar5 = ANM2::SetAnimation(&trapDoor->_sprite,GHIDRA_CAST("Opened"),1); if (bVar5 != 0) { - (GHIDRA_CAST((&(trapDoor->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(trapDoor->_sprite)._animState); (trapDoor->_sprite)._animState._isPlaying = 1; } } else { - bVar5 = (GHIDRA_CAST((&trapDoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Opened"),1); + bVar5 = ANM2::SetAnimation(&trapDoor->_sprite,GHIDRA_CAST("Opened"),1); if (((bVar5 != 0) && ((trapDoor->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(trapDoor->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(trapDoor->_sprite)._animState,0.0), (trapDoor->_sprite)._animState._animData != (void *)0x0)) { (trapDoor->_sprite)._animState._isPlaying = 0; } @@ -1145,8 +1145,8 @@ LAB_00720a92: *GHIDRA_CAST((pcVar13 + iVar15 * 0x1c + 0x18)) = uVar16; } if ((trapDoor->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(trapDoor->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(trapDoor->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(trapDoor->_sprite)._animState); + AnimationState::Update(&(trapDoor->_sprite)._overlayAnimState); } if ((*GHIDRA_CAST((GHIDRA_CAST(&(nearbyEntities)) + 0x0))) == '\0') { if (g_mainHeap == (void *)0x0) { diff --git a/generated-src/grid_entity_wall.cpp b/generated-src/grid_entity_wall.cpp index 65d83f8..8362e85 100644 --- a/generated-src/grid_entity_wall.cpp +++ b/generated-src/grid_entity_wall.cpp @@ -61,7 +61,7 @@ void GridEntity_Wall::BeginBatches() dungeonAnm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(dungeonAnm2Path._buf))) + 0x0))),"gfx/grid/Tiles_Itemdungeon.anm2",0x20); local_8 = 2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&dungeonAnm2Path,1); + ANM2::Load(&this->_sprite,&dungeonAnm2Path,1); if (dungeonAnm2Path._capacity < 0x10) { ExceptionList = local_10; return; @@ -82,7 +82,7 @@ void GridEntity_Wall::BeginBatches() builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(bossDungeonAnm2Path._buf))) + 0x0))),"gfx/grid/Tiles_Rotgut.anm2",0x1b); local_8 = 1; } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&bossDungeonAnm2Path,1); + ANM2::Load(&this->_sprite,&bossDungeonAnm2Path,1); if (bossDungeonAnm2Path._capacity < 0x10) { ExceptionList = local_10; return; @@ -141,7 +141,7 @@ void GridEntity_Wall::guard_check_icall() sprintf_s(animNameBuf,0x1f,&DAT_00b69520); anim = GHIDRA_CAST(animNameBuf); } - (GHIDRA_CAST((&this->_sprite)))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(&this->_sprite,GHIDRA_CAST(anim),0); return; } gridWidth = room->_gridWidth; @@ -180,12 +180,12 @@ LAB_007213a9: (*GHIDRA_CAST((GHIDRA_CAST(gridBelow) + 4)) == 0x13)) { local_34.x = 1.676754e-38; } - pvVar2 = (GHIDRA_CAST((&this->_sprite)))->ANM2::GetAnimationData(GHIDRA_CAST(local_34.x)); + pvVar2 = ANM2::GetAnimationData(&this->_sprite,GHIDRA_CAST(local_34.x)); if (pvVar2 != (void *)0x0) { iVar1 = *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x30)); - isAnimSet = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_34.x),1); + isAnimSet = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST(local_34.x),1); if (((isAnimSet != 0) && ((this->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)(GHIDRA_INT(column) % iVar1)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)(GHIDRA_INT(column) % iVar1)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; return; diff --git a/generated-src/grid_entity_web.cpp b/generated-src/grid_entity_web.cpp index c9c54b7..72dd2be 100644 --- a/generated-src/grid_entity_web.cpp +++ b/generated-src/grid_entity_web.cpp @@ -33,7 +33,7 @@ void GridEntity_Web::BeginBatches() anmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/grid/grid_web.anm2",0x17); local_8 = 0; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_sprite,&anmPath,1); local_8 = 0xffffffff; if (0xf < anmPath._capacity) { startFrame = anmPath._capacity + 1; @@ -52,7 +52,7 @@ void GridEntity_Web::BeginBatches() anmPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) & 0xffffff00; if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc)))) != 0) { - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Bombed"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Bombed"),1); if (bVar1 == 0) { ExceptionList = local_10; return; @@ -61,7 +61,7 @@ void GridEntity_Web::BeginBatches() ExceptionList = local_10; return; } - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(this->_sprite)._animState,0.0); if ((this->_sprite)._animState._animData == (void *)0x0) { ExceptionList = local_10; return; @@ -97,9 +97,9 @@ LAB_00721675: ((*GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x34)) == '\0' || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_007216ad; } - bVar1 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Swaying"),1); + bVar1 = ANM2::SetAnimation(&this->_sprite,GHIDRA_CAST("Swaying"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } LAB_007216ad: @@ -113,7 +113,7 @@ LAB_007216ad: animData = (this->_sprite)._animState._animData; } if ((animData != (void *)0x0) && - ((GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(startFrame)), + (AnimationState::SetFrameFloat(&(this->_sprite)._animState,(float)GHIDRA_INT(startFrame)), (this->_sprite)._animState._animData != (void *)0x0)) { (this->_sprite)._animState._isPlaying = 0; } @@ -218,8 +218,8 @@ LAB_007219cb: } } if ((this->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_sprite)._animState); + AnimationState::Update(&(this->_sprite)._overlayAnimState); } return; } diff --git a/generated-src/hallucination_overlay.cpp b/generated-src/hallucination_overlay.cpp index f161db7..0688119 100644 --- a/generated-src/hallucination_overlay.cpp +++ b/generated-src/hallucination_overlay.cpp @@ -26,7 +26,7 @@ void HallucinationOverlay::Render(Vector *offset) (*GHIDRA_CAST((iVar1 + 0xc)) - 140.0) * 0.65) * pixelScale + 0.5)); renderPos.x = renderPos.x + offset->x; renderPos.y = (float)dVar2 / pixelScale + offset->y; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0xc)))))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((GHIDRA_INT(this) + 0xc)),&renderPos,&g_vectorZero,&g_vectorZero); if (-1 < *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(this) + 8)) + 0x20))) { FUN_0040a400(); if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x40)) != 0) { @@ -44,7 +44,7 @@ void HallucinationOverlay::Render(Vector *offset) dVar3 = floor((double)renderPos.x); renderPos.x = (float)dVar2 / pixelScale + offset->x; renderPos.y = (float)dVar3 / pixelScale + offset->y; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0xc)))))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((GHIDRA_INT(this) + 0xc)),&renderPos,&g_vectorZero,&g_vectorZero); } } return; diff --git a/generated-src/hud.cpp b/generated-src/hud.cpp index e05fbaf..3935e38 100644 --- a/generated-src/hud.cpp +++ b/generated-src/hud.cpp @@ -23,19 +23,19 @@ void HUD::constructor() ExceptionList = &local_10; _eh_vector_constructor_iterator_(this,0x6dc,8,FUN_006efc70,FUN_006efde0); local_8 = 0; - (GHIDRA_CAST((&this->_font)))->Font::Font(); + Font::Font(&this->_font); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 1; - (GHIDRA_CAST((&this->_fontKR)))->Font::Font(); + Font::Font(&this->_fontKR); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_chargeBarSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 3; - (GHIDRA_CAST((&this->_chargeBarSmallSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_chargeBarSmallSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 4; - (GHIDRA_CAST((&this->_heartsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_heartsSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 5; - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_pickupHUDSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 6; - (GHIDRA_CAST((&this->_cardsPillsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_cardsPillsSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 7; FUN_008405b0(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 8; @@ -45,11 +45,11 @@ void HUD::constructor() _eh_vector_constructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a88))),500,4,FUN_008405b0,HUD_Message::~HUD_Message) ; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 10; - (GHIDRA_CAST((&this->_fortuneSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_fortuneSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x536c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5370)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xc; - (GHIDRA_CAST((&this->_statsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_statsSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5488)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x548c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54a0)))) = 0; @@ -63,13 +63,13 @@ void HUD::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54c4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54c8)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x13; - (GHIDRA_CAST((&this->_coopMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_coopMenuSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x14; - (GHIDRA_CAST((&this->_inventorySprite)))->ANM2::constructor(); + ANM2::constructor(&this->_inventorySprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x15; - (GHIDRA_CAST((&this->_craftingTableSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_craftingTableSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x16; - (GHIDRA_CAST((&this->_poopSpellsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_poopSpellsSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x592c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5930)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x18; @@ -91,7 +91,7 @@ void HUD::constructor() } while (remaining != 0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x59a0)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x599c)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&this->_statHUD))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&this->_statHUD)); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x19; cursor = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5ab8)))); remaining = 2; @@ -120,13 +120,13 @@ void HUD::constructor() this[1]._playerHUD[0x36] = 0; this[1]._playerHUD[0x37] = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x1d; - (GHIDRA_CAST((GHIDRA_CAST((this[1]._playerHUD + 0x38)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((this[1]._playerHUD + 0x38))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x1e; - (GHIDRA_CAST((GHIDRA_CAST((this[1]._playerHUD + 0x14c)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((this[1]._playerHUD + 0x14c))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x1f; SharedPtrPair::constructor(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x20; - (GHIDRA_CAST((GHIDRA_CAST((this[1]._playerHUD + 0x28c)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((this[1]._playerHUD + 0x28c))); this[1]._playerHUD[0x3a0] = 0xff; this[1]._playerHUD[0x3a1] = 0xff; this[1]._playerHUD[0x3a2] = 0xff; @@ -154,7 +154,7 @@ void HUD::constructor() this[1]._playerHUD[0x3c3] = 0; *pbVar1 = 0; local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),0x22); - (GHIDRA_CAST((GHIDRA_CAST((this[1]._playerHUD + 0x3c4)))))->Font::Font(); + Font::Font(GHIDRA_CAST((this[1]._playerHUD + 0x3c4))); this[1]._playerHUD[0x410] = 0; this[1]._playerHUD[0x411] = 0; this[1]._playerHUD[0x412] = 0; @@ -184,9 +184,9 @@ void HUD::destructor() local_8 = 0; _eh_vector_destructor_iterator_(&this->_historyHUD,0x14,2,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006f3050)); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&this->_statHUD))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x59f4)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x59d4)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&this->_statHUD)); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x59f4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x59d4))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x59bc))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_statHUD))))->msvc::string::_Tidy_deallocate(); local_8 = 2; @@ -197,27 +197,27 @@ void HUD::destructor() } } local_8 = 3; - (GHIDRA_CAST((&this->_poopSpellsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_poopSpellsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_poopSpellsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_poopSpellsSprite); + AnimationState::~AnimationState(&(this->_poopSpellsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_poopSpellsSprite)._animState); (GHIDRA_CAST(((this->_poopSpellsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_poopSpellsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 4; - (GHIDRA_CAST((&this->_craftingTableSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_craftingTableSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_craftingTableSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_craftingTableSprite); + AnimationState::~AnimationState(&(this->_craftingTableSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_craftingTableSprite)._animState); (GHIDRA_CAST(((this->_craftingTableSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_craftingTableSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 5; - (GHIDRA_CAST((&this->_inventorySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_inventorySprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_inventorySprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_inventorySprite); + AnimationState::~AnimationState(&(this->_inventorySprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_inventorySprite)._animState); (GHIDRA_CAST(((this->_inventorySprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_inventorySprite))))->msvc::string::_Tidy_deallocate(); local_8 = 6; - (GHIDRA_CAST((&this->_coopMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_coopMenuSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_coopMenuSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_coopMenuSprite); + AnimationState::~AnimationState(&(this->_coopMenuSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_coopMenuSprite)._animState); (GHIDRA_CAST(((this->_coopMenuSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_coopMenuSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 7; @@ -263,9 +263,9 @@ void HUD::destructor() } } local_8 = 0xd; - (GHIDRA_CAST((&this->_statsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_statsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_statsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_statsSprite); + AnimationState::~AnimationState(&(this->_statsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_statsSprite)._animState); (GHIDRA_CAST(((this->_statsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_statsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xe; @@ -276,9 +276,9 @@ void HUD::destructor() } } local_8 = 0xf; - (GHIDRA_CAST((&this->_fortuneSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_fortuneSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_fortuneSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_fortuneSprite); + AnimationState::~AnimationState(&(this->_fortuneSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_fortuneSprite)._animState); (GHIDRA_CAST(((this->_fortuneSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_fortuneSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xffffffff; @@ -286,44 +286,44 @@ void HUD::destructor() _eh_vector_destructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3ed0))),500,6,HUD_Message::~HUD_Message); (GHIDRA_CAST((GHIDRA_CAST(&this->_messageMain))))->HUD_Message::~HUD_Message(); local_8 = 0x10; - (GHIDRA_CAST((&this->_cardsPillsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_cardsPillsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_cardsPillsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_cardsPillsSprite); + AnimationState::~AnimationState(&(this->_cardsPillsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_cardsPillsSprite)._animState); (GHIDRA_CAST(((this->_cardsPillsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_cardsPillsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0x11; - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_pickupHUDSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_pickupHUDSprite); + AnimationState::~AnimationState(&(this->_pickupHUDSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_pickupHUDSprite)._animState); (GHIDRA_CAST(((this->_pickupHUDSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_pickupHUDSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0x12; - (GHIDRA_CAST((&this->_heartsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_heartsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_heartsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_heartsSprite); + AnimationState::~AnimationState(&(this->_heartsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_heartsSprite)._animState); (GHIDRA_CAST(((this->_heartsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_heartsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0x13; - (GHIDRA_CAST((&this->_chargeBarSmallSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_chargeBarSmallSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_chargeBarSmallSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_chargeBarSmallSprite); + AnimationState::~AnimationState(&(this->_chargeBarSmallSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_chargeBarSmallSprite)._animState); (GHIDRA_CAST(((this->_chargeBarSmallSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_chargeBarSmallSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0x14; - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_chargeBarSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_chargeBarSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_chargeBarSprite); + AnimationState::~AnimationState(&(this->_chargeBarSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_chargeBarSprite)._animState); (GHIDRA_CAST(((this->_chargeBarSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_chargeBarSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xffffffff; - (GHIDRA_CAST((&this->_fontKR)))->Font::Unload(); + Font::Unload(&this->_fontKR); fontCharMap = &(this->_fontKR)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharMap,(fuzzer_allocator_> *)fontCharMap, *(_Tree_node **)(GHIDRA_INT((this->_fontKR)._charsBlock._head) + 4)); operator_delete(fontCharMap->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font)))->Font::Unload(); + Font::Unload(&this->_font); fontCharMap = &(this->_font)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharMap,(fuzzer_allocator_> *)fontCharMap, @@ -1139,7 +1139,7 @@ void HUD::load_item_info_graphics() resourcePath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(resourcePath._buf))) + 0x0))),"font/TeamMeatEx/TeamMeatEx12.fnt",0x21); local_14 = 0; - (GHIDRA_CAST((this->_playerHUD + 900)))->RichText::load_font(&resourcePath); + RichText::load_font(this->_playerHUD + 900,&resourcePath); local_14 = 0xffffffff; if (0xf < resourcePath._capacity) { uVar3 = resourcePath._capacity + 1; @@ -1158,7 +1158,7 @@ void HUD::load_item_info_graphics() this->_playerHUD[0x3ed] = 0x66; this->_playerHUD[0x3ee] = 0x66; this->_playerHUD[0x3ef] = 0x3f; - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x10)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((this->_playerHUD + 0x10))); chargeIconsPath._size = 0; chargeIconsPath._capacity = 0xf; chargeIconsPath._buf[0] = '\0'; @@ -1170,7 +1170,7 @@ void HUD::load_item_info_graphics() chargeIconsPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(chargeIconsPath._buf))) + 0x0))),"gfx/ui/ui_charge_icons.anm2",0x1c); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x124)))))->ANM2::Load(&chargeIconsPath,1); + ANM2::Load(GHIDRA_CAST((this->_playerHUD + 0x124)),&chargeIconsPath,1); local_14 = 0xffffffff; if (0xf < chargeIconsPath._capacity) { uVar3 = chargeIconsPath._capacity + 1; @@ -1212,9 +1212,9 @@ LAB_0083c7c5: if ((uVar3 == 0) && ((currentAnim[0x34] == 0 || (this->_playerHUD[0x168] != 0)))) goto LAB_0083c7f1; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x124)))))->ANM2::SetAnimation(GHIDRA_CAST("ChargeIcon"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this->_playerHUD + 0x124)),GHIDRA_CAST("ChargeIcon"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x154)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this->_playerHUD + 0x154))); this->_playerHUD[0x168] = 1; } LAB_0083c7f1: @@ -1233,7 +1233,7 @@ LAB_0083c7f1: resourcePath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(resourcePath._buf))) + 0x0))),"gfx/ui/minimap_icons.anm2",0x1a); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x264)))))->ANM2::Load(&resourcePath,1); + ANM2::Load(GHIDRA_CAST((this->_playerHUD + 0x264)),&resourcePath,1); if (0xf < resourcePath._capacity) { uVar3 = resourcePath._capacity + 1; pcVar2 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(resourcePath._buf))) + 0x0))); @@ -1382,7 +1382,7 @@ void HUD::update_item_info() pickupVariant = *GHIDRA_CAST((iVar2 + 0x2c)); if (pickupVariant == 100) { LAB_0083ca27: - layer = (GHIDRA_CAST((GHIDRA_CAST((iVar2 + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(GHIDRA_CAST((iVar2 + 0x48)),GHIDRA_CAST(0x1)); tmpCStr = &layer->_spriteSheetPath; if (0xf < (layer->_spriteSheetPath)._capacity) { tmpCStr = *GHIDRA_CAST(tmpCStr->_buf); @@ -1465,7 +1465,7 @@ LAB_0083ced0: } LAB_0083cfa5: (GHIDRA_CAST((this->_playerHUD + 8)))->KAGE::SmartPointer::reset((void *)0x0); - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x10)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((this->_playerHUD + 0x10))); pHVar13 = extraout_ECX_01; } else if (iVar7 == 0x15e) { @@ -1488,7 +1488,7 @@ LAB_0083cf7d: (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 0xff; (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x1))) = 0xffffff; TexturePtr::release(); - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x10)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((this->_playerHUD + 0x10))); pHVar13 = extraout_ECX_00; } else if (iVar7 == 0x46) { @@ -1502,7 +1502,7 @@ LAB_0083cf7d: *GHIDRA_CAST((local_e0->_playerHUD + 0x30))); if (entityConfig == GHIDRA_CAST(0x0)) { LAB_0083d11f: - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x10)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((this->_playerHUD + 0x10))); } else { tmpCStr = &entityConfig->anm2Path; @@ -1512,7 +1512,7 @@ LAB_0083d11f: (GHIDRA_CAST((tmpString._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST(tmpCStr)); ehState = (void *)0x7; LAB_0083d02f: - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x10)))))->ANM2::Load(&tmpString,1); + ANM2::Load(GHIDRA_CAST((this->_playerHUD + 0x10)),&tmpString,1); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 0xff; (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x1))) = 0xffffff; if (0xf < tmpString._capacity) { @@ -1528,7 +1528,7 @@ LAB_0083d02f: } operator_delete(pvVar8,uVar6); } - (GHIDRA_CAST((GHIDRA_CAST((this->_playerHUD + 0x10)))))->ANM2::Play(s_Idle,0); + ANM2::Play(GHIDRA_CAST((this->_playerHUD + 0x10)),s_Idle,0); } (GHIDRA_CAST((this->_playerHUD + 8)))->KAGE::SmartPointer::reset((void *)0x0); pHVar13 = extraout_ECX_03; @@ -2297,9 +2297,9 @@ LAB_008f8fd5: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((portrait->_animState)._isPlaying != 0)))) goto LAB_008f9000; } - bVar4 = (GHIDRA_CAST((portrait)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar4 = ANM2::SetAnimation(portrait,GHIDRA_CAST(animName),1); if (bVar4 != 0) { - (GHIDRA_CAST((&portrait->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&portrait->_animState); (portrait->_animState)._isPlaying = 1; } LAB_008f9000: @@ -2343,7 +2343,7 @@ LAB_008f9000: (portrait->_color)._offset[2] = color->_offset[2]; portrait = playerConfig->_moddedCoopMenuANM2; } - (GHIDRA_CAST((portrait)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(portrait,position,&g_vectorZero,&g_vectorZero); ExceptionList = local_1c; return; } @@ -2407,7 +2407,7 @@ void HUD::LoadGraphics() if (0xf < *GHIDRA_CAST((extraout_EAX + 0x14))) { redirectedPathChars = *GHIDRA_CAST(extraout_EAX); } - (GHIDRA_CAST((&this->_font)))->Font::Load(redirectedPathChars,0); + Font::Load(&this->_font,redirectedPathChars,0); local_14 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2450,7 +2450,7 @@ LAB_009a1b64: if (0xf < *GHIDRA_CAST((extraout_EAX_00 + 0x14))) { redirectedPathChars = *GHIDRA_CAST(extraout_EAX_00); } - (GHIDRA_CAST((&this->_fontKR)))->Font::Load(redirectedPathChars,0); + Font::Load(&this->_fontKR,redirectedPathChars,0); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),2); if (0xf < redirectedFontPathCapacity) { allocatedBytes = redirectedFontPathCapacity + 1; @@ -2491,7 +2491,7 @@ LAB_009a1c55: tmpPathCapacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpPath))) + 0x0))),"gfx/ui/ui_hearts.anm2",0x16); local_14 = 4; - (GHIDRA_CAST((&this->_heartsSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_heartsSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2517,7 +2517,7 @@ LAB_009a1c55: tmpPathCapacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpPath))) + 0x0))),"gfx/ui/hudpickups.anm2",0x17); local_14 = 5; - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_pickupHUDSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2543,7 +2543,7 @@ LAB_009a1c55: tmpPathCapacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpPath))) + 0x0))),"gfx/ui/ui_chargebar.anm2",0x19); local_14 = 6; - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_chargeBarSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2569,7 +2569,7 @@ LAB_009a1c55: tmpPathCapacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpPath))) + 0x0))),"gfx/ui/ui_chargebar_small.anm2",0x1f); local_14 = 7; - (GHIDRA_CAST((&this->_chargeBarSmallSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_chargeBarSmallSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2595,7 +2595,7 @@ LAB_009a1c55: tmpPathCapacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpPath))) + 0x0))),"gfx/ui/ui_cardspills.anm2",0x1a); local_14 = 8; - (GHIDRA_CAST((&this->_cardsPillsSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_cardsPillsSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2621,7 +2621,7 @@ LAB_009a1c55: tmpPathCapacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpPath))) + 0x0))),"gfx/ui/hudstats.anm2",0x15); local_14 = 9; - (GHIDRA_CAST((&this->_statsSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_statsSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2722,7 +2722,7 @@ LAB_009a1c55: tmpPathCapacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(tmpPath))) + 0x0))),"gfx/ui/ui_FortunePaper.anm2",0x1c); local_14 = 0x14; - (GHIDRA_CAST((&this->_fortuneSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_fortuneSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2742,7 +2742,7 @@ LAB_009a1c55: (*GHIDRA_CAST((GHIDRA_CAST(&(tmpPath)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((tmpPath)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/coop menu.anm2"),0x15); local_14 = 0x15; - (GHIDRA_CAST((&this->_coopMenuSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_coopMenuSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2757,14 +2757,14 @@ LAB_009a1c55: } operator_delete(pvVar1,allocatedBytes); } - (GHIDRA_CAST((&this->_coopMenuSprite)))->ANM2::Play(&DAT_00b6767c,0); - (GHIDRA_CAST((&this->_coopMenuSprite)))->ANM2::PlayOverlay(GHIDRA_CAST("Arrows"),0); + ANM2::Play(&this->_coopMenuSprite,&DAT_00b6767c,0); + ANM2::PlayOverlay(&this->_coopMenuSprite,GHIDRA_CAST("Arrows"),0); tmpPathSize = 0; tmpPathCapacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(tmpPath)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((tmpPath)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/ui_inventory.anm2"),0x18); local_14 = 0x16; - (GHIDRA_CAST((&this->_inventorySprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_inventorySprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2779,13 +2779,13 @@ LAB_009a1c55: } operator_delete(pvVar1,allocatedBytes); } - (GHIDRA_CAST((&this->_inventorySprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_inventorySprite,s_Idle,0); tmpPathSize = 0; tmpPathCapacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(tmpPath)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((tmpPath)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/ui_crafting.anm2"),0x17); local_14 = 0x17; - (GHIDRA_CAST((&this->_craftingTableSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_craftingTableSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2800,13 +2800,13 @@ LAB_009a1c55: } operator_delete(pvVar1,allocatedBytes); } - (GHIDRA_CAST((&this->_craftingTableSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_craftingTableSprite,s_Idle,0); tmpPathSize = 0; tmpPathCapacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(tmpPath)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((tmpPath)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/ui_poops.anm2"),0x14); local_14 = 0x18; - (GHIDRA_CAST((&this->_poopSpellsSprite)))->ANM2::Load(GHIDRA_CAST(tmpPath),1); + ANM2::Load(&this->_poopSpellsSprite,GHIDRA_CAST(tmpPath),1); local_14 = 0xffffffff; if (0xf < tmpPathCapacity) { allocatedBytes = tmpPathCapacity + 1; @@ -2821,7 +2821,7 @@ LAB_009a1c55: } operator_delete(pvVar1,allocatedBytes); } - (GHIDRA_CAST((&this->_poopSpellsSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_poopSpellsSprite,s_Idle,0); HUD_Message::load_graphics(); remaining = 6; do { @@ -2880,7 +2880,7 @@ LAB_009a1c55: (*GHIDRA_CAST((GHIDRA_CAST(&(path._buf)) + 0x0))) = GHIDRA_CAST(0x0); (GHIDRA_CAST((path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/hudstats2.anm2"),0x15); local_14 = 0x1f; - (GHIDRA_CAST((GHIDRA_CAST(&self->_statHUD))))->ANM2::Load(&path,1); + ANM2::Load(GHIDRA_CAST(&self->_statHUD),&path,1); local_14 = 0xffffffff; if (0xf < path._capacity) { allocatedBytes = path._capacity + 1; @@ -2898,9 +2898,9 @@ LAB_009a1c55: path._size = 0; path._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(path._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(path._buf)) + 0x0))) & 0xffffff00; - isAnimSet = (GHIDRA_CAST((GHIDRA_CAST(&self->_statHUD))))->ANM2::SetAnimation(s_Idle,1); + isAnimSet = ANM2::SetAnimation(GHIDRA_CAST(&self->_statHUD),s_Idle,1); if ((isAnimSet != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((self)) + 0x59d8)))) != 0)) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((self)) + 0x59d4)))))))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((self)) + 0x59d4)))),0.0); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((self)) + 0x59d8)))) != 0) { (*GHIDRA_CAST((GHIDRA_CAST((self)) + 0x59e8))) = 0; } @@ -2922,33 +2922,33 @@ void HUD::unload_graphics() HUD *playerHUD; int remaining; - (GHIDRA_CAST((&this->_font)))->Font::Unload(); - (GHIDRA_CAST((&this->_fontKR)))->Font::Unload(); - (GHIDRA_CAST((&this->_chargeBarSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_chargeBarSmallSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_heartsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_statsSprite)))->ANM2::Reset(); + Font::Unload(&this->_font); + Font::Unload(&this->_fontKR); + ANM2::Reset(&this->_chargeBarSprite); + ANM2::Reset(&this->_chargeBarSmallSprite); + ANM2::Reset(&this->_heartsSprite); + ANM2::Reset(&this->_pickupHUDSprite); + ANM2::Reset(&this->_statsSprite); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54a0))))))->KAGE::SmartPointer::reset((void *)0x0); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54a8))))))->KAGE::SmartPointer::reset((void *)0x0); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54b0))))))->KAGE::SmartPointer::reset((void *)0x0); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54bc))))))->KAGE::SmartPointer::reset((void *)0x0); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54c4))))))->KAGE::SmartPointer::reset((void *)0x0); - (GHIDRA_CAST((&this->_cardsPillsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_fortuneSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_inventorySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_craftingTableSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_poopSpellsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_coopMenuSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_cardsPillsSprite); + ANM2::Reset(&this->_fortuneSprite); + ANM2::Reset(&this->_inventorySprite); + ANM2::Reset(&this->_craftingTableSprite); + ANM2::Reset(&this->_poopSpellsSprite); + ANM2::Reset(&this->_coopMenuSprite); (GHIDRA_CAST((GHIDRA_CAST(&this->_messageMain))))->HUD_Message::free_text_buffers(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3cfc)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3cfc))))); KAGE::SmartPointer::reset(extraout_ECX); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3ce4))) = 0; messageSlot = &(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3ee8))); remaining = 6; do { (GHIDRA_CAST((GHIDRA_CAST((messageSlot + -0x18)))))->HUD_Message::free_text_buffers(); - (GHIDRA_CAST((GHIDRA_CAST((messageSlot + 8)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((messageSlot + 8))); KAGE::SmartPointer::reset(extraout_ECX_00); messageSlot[-0x10] = 0; messageSlot = messageSlot + 500; @@ -2958,7 +2958,7 @@ void HUD::unload_graphics() remaining = 4; do { (GHIDRA_CAST((GHIDRA_CAST((messageSlot + -0x18)))))->HUD_Message::free_text_buffers(); - (GHIDRA_CAST((GHIDRA_CAST((messageSlot + 8)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((messageSlot + 8))); KAGE::SmartPointer::reset(extraout_ECX_01); messageSlot[-0x10] = 0; messageSlot = messageSlot + 500; @@ -3016,16 +3016,16 @@ void HUD::Update() } while (remaining != 0); fortuneAnimState = &(this->_fortuneSprite)._animState; if ((this->_fortuneSprite)._loaded != 0) { - (GHIDRA_CAST((fortuneAnimState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_fortuneSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(fortuneAnimState); + AnimationState::Update(&(this->_fortuneSprite)._overlayAnimState); } if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a; - isEventTriggered = (GHIDRA_CAST((fortuneAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("SlideIn")); + isEventTriggered = AnimationState::IsEventTriggered(fortuneAnimState,GHIDRA_CAST("SlideIn")); manager = g_manager; if (isEventTriggered == 0) { LAB_009a2aae: if ((this->_fortuneSprite)._animState._animData == (void *)0x0) goto LAB_009a2b1a; - isEventTriggered = (GHIDRA_CAST((fortuneAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("SlideOut")); + isEventTriggered = AnimationState::IsEventTriggered(fortuneAnimState,GHIDRA_CAST("SlideOut")); manager = g_manager; if (((isEventTriggered == 0) || ((this->_fortuneSprite)._animState._animData == (void *)0x0)) || ((this->_fortuneSprite)._animState._isPlaying == 0)) goto LAB_009a2b1a; @@ -3510,14 +3510,14 @@ void HUD::ShowItemText(Entity_Player *player, ItemConfig_Item *item) (GHIDRA_CAST((hudMessage)))->HUD_Message::set_text_line(GHIDRA_CAST(pIVar8),1); } *GHIDRA_CAST((hudMessage + 3)) = 1; - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[10])) + 0x2)))))))->ANM2::SetAnimation(&DAT_00b1c208,1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[10])) + 0x2)))),&DAT_00b1c208,1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[0x1a])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[0x1a])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[0x21])) + 0x1))) = 1; pIVar8 = local_c0; } local_b9 = (*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[3])) + 0x1))); - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[10])) + 0x2)))))))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[10])) + 0x2)))),GHIDRA_CAST(0x1)); layer->_visible = local_b9; (GHIDRA_CAST((hudMessage)))->HUD_Message::UpdateTextImage(); (*GHIDRA_CAST((GHIDRA_CAST(&(hudMessage[2])) + 0x2))) = 1; @@ -3765,7 +3765,7 @@ void HUD::show_fortune_text_impl(uint8_t *text) if (iVar4 != 0) { lastSpace = cursor; } - iVar4 = (GHIDRA_CAST((font)))->Font::get_string_width_utf16(GHIDRA_CAST(&charBuffer),-1); + iVar4 = Font::get_string_width_utf16(font,GHIDRA_CAST(&charBuffer),-1); local_144 = GHIDRA_CAST((GHIDRA_INT(local_144) + iVar4)); if (0x10e < local_144) { lineEnd = cursor; @@ -3864,9 +3864,9 @@ void HUD::render_fortune_text(void *lines) iVar2 = *GHIDRA_CAST((GHIDRA_CAST(lines) + 4)); hud = this; if (iVar2 == 0) { - isAnimChanged = (GHIDRA_CAST((&this->_fortuneSprite)))->ANM2::SetAnimation(&DAT_00b1c208,1); + isAnimChanged = ANM2::SetAnimation(&this->_fortuneSprite,&DAT_00b1c208,1); if (isAnimChanged != 0) { - (GHIDRA_CAST((&(this->_fortuneSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_fortuneSprite)._animState); (this->_fortuneSprite)._animState._isPlaying = 1; } local_2c.x = 0.0; @@ -3899,7 +3899,7 @@ void HUD::render_fortune_text(void *lines) if (0xf < GHIDRA_UINT(piVar3[7])) { lineText = *GHIDRA_CAST(lineText); } - lineWidth = (GHIDRA_CAST((font)))->Font::get_string_width_n(lineText,-1); + lineWidth = Font::get_string_width_n(font,lineText,-1); maxWidth = prevMaxWidth; if (prevMaxWidth < lineWidth) { maxWidth = lineWidth; @@ -3928,9 +3928,9 @@ void HUD::render_fortune_text(void *lines) else { anim = "Text3"; } - isAnimChanged = (GHIDRA_CAST((&hud->_fortuneSprite)))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + isAnimChanged = ANM2::SetAnimation(&hud->_fortuneSprite,GHIDRA_CAST(anim),1); if (isAnimChanged != 0) { - (GHIDRA_CAST((&(pHVar1->_fortuneSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pHVar1->_fortuneSprite)._animState); (pHVar1->_fortuneSprite)._animState._isPlaying = 1; } local_2c.x = 0.0; @@ -3970,7 +3970,7 @@ void HUD::render_fortune_text(void *lines) if (0xf < GHIDRA_UINT(lineNode[7])) { lineText = *GHIDRA_CAST(lineText); } - glyphs = (GHIDRA_CAST((font)))->Font::measure_string(glyphBuffer,lineText,&drawSettings,&local_2c); + glyphs = Font::measure_string(font,glyphBuffer,lineText,&drawSettings,&local_2c); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); color._alpha = 1.0; color._red = 0.0; @@ -4308,12 +4308,12 @@ void HUD::Render() (*drawQuadFn)(quadBuffer,extraout_ECX); sprintf_s(ambushText,8,GHIDRA_CAST("%d/%d")); temp_3fc998231f = g_manager; - (GHIDRA_CAST((GHIDRA_CAST((local_70 + 0x10)))))->FontSettings::constructor(); + FontSettings::constructor(GHIDRA_CAST((local_70 + 0x10))); ehState = 0; (GHIDRA_CAST((&local_120)))->KColor::SetFromARGB(0xffffffff); iVar4 = Font::get_string_width_n (&temp_3fc998231f->_font6_PFTempestaSevenCondensed,ambushText,-1); - (GHIDRA_CAST((&temp_3fc998231f->_font6_PFTempestaSevenCondensed)))->Font::DrawString(ambushText,&local_120, + Font::DrawString(&temp_3fc998231f->_font6_PFTempestaSevenCondensed,ambushText,&local_120, settings,((float)local_ac + 53.0) - (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]), (float)local_7c + 7.0); @@ -4360,9 +4360,9 @@ void HUD::Render() ((local_ac != GHIDRA_CAST(0x0) && (local_7e == 0)))) { local_7c = GHIDRA_CAST(0x41300000); } - bVar3 = (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,s_Idle,1); if (((bVar3 != 0) && ((this->_pickupHUDSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,0.0), (this->_pickupHUDSprite)._animState._animData != (void *)0x0)) { (this->_pickupHUDSprite)._animState._isPlaying = 0; } @@ -4403,7 +4403,7 @@ void HUD::Render() (GHIDRA_CAST((&local_120)))->KColor::SetFromARGB(0xffffffff); VVar2.y = local_74 + 1.0; VVar2.x = local_78 + 16.0; - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,VVar2,(Vector)0x3f8000003f800000,color, + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,VVar2,(Vector)0x3f8000003f800000,color, GHIDRA_CAST(&drawSettingsAlt)); ehState = 0xffffffff; cursorPos.x = local_78 - local_90; @@ -4419,14 +4419,14 @@ void HUD::Render() else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar10 = 6.0; LAB_009a4737: - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::SetFrameFloat(fVar10); + AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar10); } } else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar10 = 14.0; goto LAB_009a4737; } - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Render(&cursorPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = local_90 + cursorPos.x; local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac); @@ -4441,7 +4441,7 @@ LAB_009a4737: (GHIDRA_CAST((&local_120)))->KColor::SetFromARGB(0xffffffff); pos.y = local_74 + 1.0; pos.x = local_78 + 16.0; - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,pos,(Vector)0x3f8000003f800000,color_00, + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,pos,(Vector)0x3f8000003f800000,color_00, GHIDRA_CAST(&drawSettingsAlt)); cursorPos.x = local_78 - local_90; cursorPos.y = (local_74 - local_94) + (float)local_7c; @@ -4449,9 +4449,9 @@ LAB_009a4737: ehState = 0xffffffff; if (local_ac != GHIDRA_CAST(0x0)) { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::SetFrameFloat(16.0); + AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,16.0); } - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Render(&cursorPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = local_90 + cursorPos.x; local_74 = local_94 + cursorPos.y; pEVar5 = (GHIDRA_CAST((&g_game->_playerManager)))->PlayerManager::FirstBirthrightOwner(0x19); @@ -4471,7 +4471,7 @@ LAB_009a4737: (GHIDRA_CAST((&local_120)))->KColor::SetFromARGB(0xffffffff); pos_00.y = local_74 + 1.0; pos_00.x = local_78 + 16.0; - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,pos_00,(Vector)0x3f8000003f800000,color_01, + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,pos_00,(Vector)0x3f8000003f800000,color_01, GHIDRA_CAST(&drawSettingsAlt)); cursorPos.x = local_78 - local_90; cursorPos.y = (local_74 - local_94) + (float)local_7c; @@ -4485,7 +4485,7 @@ LAB_009a4737: else { fVar10 = 3.0; } - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::SetFrameFloat(fVar10); + AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar10); } if ((this->_pickupHUDSprite)._loaded != 0) { if ((this->_pickupHUDSprite)._overlayRenderFirst == 0) { @@ -4514,7 +4514,7 @@ LAB_009a4737: (GHIDRA_CAST((&local_120)))->KColor::SetFromARGB(0xffffffff); pos_01.y = local_74 + 1.0; pos_01.x = local_78 + 16.0; - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,pos_01,(Vector)0x3f8000003f800000,color_02, + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,pos_01,(Vector)0x3f8000003f800000,color_02, GHIDRA_CAST(&drawSettingsAlt)); ehState = 0xffffffff; cursorPos.x = local_78 - local_90; @@ -4523,9 +4523,9 @@ LAB_009a4737: if (local_b8 != GHIDRA_CAST(0x0)) { cursorPos.y = local_74 + (float)local_7c; if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((secondAnimState)))->AnimationState::SetFrameFloat(15.0); + AnimationState::SetFrameFloat(secondAnimState,15.0); } - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Render(&cursorPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = local_90 + cursorPos.x; local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac); @@ -4540,7 +4540,7 @@ LAB_009a4737: (GHIDRA_CAST((&local_40)))->KColor::SetFromARGB(0xffffffff); pos_02.y = local_74 + 1.0; pos_02.x = local_78 + 16.0; - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,pos_02,(Vector)0x3f8000003f800000,color_03, + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,pos_02,(Vector)0x3f8000003f800000,color_03, GHIDRA_CAST(&drawSettingsAlt)); local_78 = local_78 - local_90; local_74 = local_74 - local_94; @@ -4550,9 +4550,9 @@ LAB_009a4737: cursorPos.y = (float)local_7c + local_74; cursorPos.x = local_78; if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((secondAnimState)))->AnimationState::SetFrameFloat(12.0); + AnimationState::SetFrameFloat(secondAnimState,12.0); } - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Render(&cursorPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_78 = local_90 + cursorPos.x; local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,&DAT_00b7ddac); @@ -4567,7 +4567,7 @@ LAB_009a4737: (GHIDRA_CAST((&local_e8)))->KColor::SetFromARGB(0xffffffff); pos_03.y = local_74 + 1.0; pos_03.x = local_78 + 16.0; - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,pos_03,(Vector)0x3f8000003f800000,color_04, + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,pos_03,(Vector)0x3f8000003f800000,color_04, GHIDRA_CAST(&drawSettings)); local_78 = local_78 - local_90; local_74 = local_74 - local_94; @@ -4717,9 +4717,9 @@ LAB_009a5258: if (local_7e == '\0') { if (0 < g_game->_victoryLap) { if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::SetFrameFloat(10.0); + AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,10.0); } - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Render(&cursorPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_pickupHUDSprite,&cursorPos,&g_vectorZero,&g_vectorZero); local_74 = local_94 + cursorPos.y; sprintf_s(&DAT_00c94328,0x10,s__d); drawSettings = 0; @@ -4731,7 +4731,7 @@ LAB_009a5258: local_f4 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 0xb; (GHIDRA_CAST((&local_120)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,color_08,&drawSettings, + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,color_08,&drawSettings, local_90 + cursorPos.x + 18.0,local_74); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 7; fVar10 = local_74 - local_94; @@ -4743,9 +4743,9 @@ LAB_009a5258: pbVar6 = (this->_pickupHUDSprite)._animState._animData; if (pbVar6 == GHIDRA_CAST(0x0)) { LAB_009a54b9: - bVar3 = (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Destination"),1); + bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,GHIDRA_CAST("Destination"),1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_pickupHUDSprite)._animState); (this->_pickupHUDSprite)._animState._isPlaying = 1; } } @@ -4827,11 +4827,11 @@ LAB_009a55b0: else if ((this->_pickupHUDSprite)._animState._animData != (void *)0x0) { fVar10 = 6.0; LAB_009a55b3: - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::SetFrameFloat(fVar10); + AnimationState::SetFrameFloat(&(this->_pickupHUDSprite)._animState,fVar10); } local_a8.y = (float)local_b8 + local_74; local_a8.x = (float)local_7c + local_78; - (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::Render(&local_a8,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_pickupHUDSprite,&local_a8,&g_vectorZero,&g_vectorZero); pbVar6 = (this->_pickupHUDSprite)._animState._animData; if (pbVar6 != GHIDRA_CAST(0x0)) { animNameCursor = pbVar6; @@ -4860,9 +4860,9 @@ LAB_009a563c: ((pbVar6[0x34] == 0 || ((this->_pickupHUDSprite)._animState._isPlaying != 0)))) goto LAB_009a565b; } - bVar3 = (GHIDRA_CAST((&this->_pickupHUDSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar3 = ANM2::SetAnimation(&this->_pickupHUDSprite,s_Idle,1); if (bVar3 != 0) { - (GHIDRA_CAST((&(this->_pickupHUDSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_pickupHUDSprite)._animState); (this->_pickupHUDSprite)._animState._isPlaying = 1; } } @@ -4884,7 +4884,7 @@ LAB_009a5404: local_108 = 0xffff; drawSettings = 0; (GHIDRA_CAST((&local_120)))->KColor::SetFromARGB(0xffffffff); - (GHIDRA_CAST((GHIDRA_CAST(local_8c))))->Font::DrawString(&DAT_00c94328,color_07,&drawSettings,local_90 + 4.0,local_74); + Font::DrawString(GHIDRA_CAST(local_8c),&DAT_00c94328,color_07,&drawSettings,local_90 + 4.0,local_74); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 7; } else if (isInClearedGreedBossRoom != '\0') { @@ -5076,7 +5076,7 @@ LAB_009a5af4: } pos_04.y = fVar10 - 14.0; pos_04.x = local_128.x; - (GHIDRA_CAST((&temp_3fc998231f->_font1_TeamMeatEx10)))->Font::DrawString(GHIDRA_CAST(statusTextBuf),pos_04, + Font::DrawString(&temp_3fc998231f->_font1_TeamMeatEx10,GHIDRA_CAST(statusTextBuf),pos_04, (Vector)0x3f8000003f800000,color_05,GHIDRA_CAST(&drawSettings)); local_7c = GHIDRA_CAST((GHIDRA_INT(local_7c) + 1)); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 0xf; @@ -5562,7 +5562,7 @@ LAB_009a6c87: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((&(pHVar7->_fortuneSprite)._animState)))->AnimationState::GetNullFrameById(0); + nullFrame = AnimationState::GetNullFrameById(&(pHVar7->_fortuneSprite)._animState,0); pHVar7 = hud; } color._unk = 0; @@ -5914,7 +5914,7 @@ void HUD::render_boss_health_bar(Vector barPos) (GHIDRA_CAST((&whiteColor)))->KColor::SetFromARGB(0xffffffff); iVar4 = Font::get_string_width_n (&pMVar2->_font6_PFTempestaSevenCondensed,GHIDRA_CAST(&local_1c),-1); - (GHIDRA_CAST((&pMVar2->_font6_PFTempestaSevenCondensed)))->Font::DrawString(GHIDRA_CAST(&local_1c),&whiteColor, + Font::DrawString(&pMVar2->_font6_PFTempestaSevenCondensed,GHIDRA_CAST(&local_1c),&whiteColor, &fontSettings, (barPos.x + 48.0) - (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]), diff --git a/generated-src/hud_message.cpp b/generated-src/hud_message.cpp index fefa01b..e7c04e5 100644 --- a/generated-src/hud_message.cpp +++ b/generated-src/hud_message.cpp @@ -18,17 +18,17 @@ HUD_Message::~HUD_Message() ExceptionList = &local_10; free_text_buffers(sprite); sprite = &(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[10])) + 0x2))); - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(sprite)); KAGE::SmartPointer::reset(extraout_ECX); (*GHIDRA_CAST((GHIDRA_CAST(&(sprite[2])) + 0x2))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x8d])) + 0x1)))))))->Font::Unload(); + Font::Unload(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x8d])) + 0x1))))); puVar1 = &(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0xa2])) + 0x2))); FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, *(_Tree_node **)(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0xa2])) + 0x2)))) + 4)); operator_delete(*(void **)puVar1,0x18); FUN_004b3950(); - (GHIDRA_CAST((GHIDRA_CAST((sprite + 0x74)))))->Font::Unload(); + Font::Unload(GHIDRA_CAST((sprite + 0x74))); puVar1 = &(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x89])) + 0x1))); FID_conflict__Erase_tree_>_> (puVar1,(fuzzer_allocator_> *)puVar1, @@ -36,9 +36,9 @@ HUD_Message::~HUD_Message() operator_delete(*(void **)puVar1,0x18); FUN_004b3950(); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x25])) + 0x1)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x1a])) + 0x2)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(sprite)); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x25])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x1a])) + 0x2))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x12])) + 0x2))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((sprite)))->msvc::string::_Tidy_deallocate(); local_8 = 1; @@ -99,7 +99,7 @@ void HUD_Message::load_graphics() local_28 = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_3c))) + 0x0))),"gfx/ui/ui_streak.anm2",0x16); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[10])) + 0x2)))))))->ANM2::Load(GHIDRA_CAST(local_3c),1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[10])) + 0x2)))),GHIDRA_CAST(local_3c),1); local_14 = 0xffffffff; if (0xf < local_28) { freeSize = local_28 + 1; @@ -140,7 +140,7 @@ void HUD_Message::load_graphics() if (0xf < *GHIDRA_CAST((extraout_EAX + 0x14))) { fontPath = *GHIDRA_CAST(extraout_EAX); } - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x74)))))->Font::Load(fontPath,0); + Font::Load(GHIDRA_CAST((in_ECX + 0x74)),fontPath,0); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),3); if (0xf < local_28) { freeSize = local_28 + 1; @@ -183,7 +183,7 @@ LAB_008409ce: if (0xf < *GHIDRA_CAST((extraout_EAX_00 + 0x14))) { fontPath = *GHIDRA_CAST(extraout_EAX_00); } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[0x8d])) + 0x1)))))))->Font::Load(fontPath,0); + Font::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[0x8d])) + 0x1)))),fontPath,0); if (0xf < local_40) { freeSize = local_40 + 1; freeBlock = local_54[0]; @@ -265,13 +265,13 @@ void HUD_Message::Show(uint8_t *title, uint8_t *subtitle, uint8_t autoHide, uint anim = "TextIn"; } *GHIDRA_CAST((this + 3)) = autoHide; - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x2)))))))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x2)))),GHIDRA_CAST(anim),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x21])) + 0x1))) = 1; } bVar1 = (*GHIDRA_CAST((GHIDRA_CAST(&(this[3])) + 0x1))); - curseLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x2)))))))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + curseLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x2)))),GHIDRA_CAST(0x1)); curseLayer->_visible = bVar1; UpdateTextImage(this); (*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2))) = 1; @@ -324,9 +324,9 @@ LAB_00840cb5: return; } } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x2)))))))->ANM2::SetAnimation(GHIDRA_CAST("TextOut"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x2)))),GHIDRA_CAST("TextOut"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x21])) + 0x1))) = 1; } } @@ -479,7 +479,7 @@ void HUD_Message::UpdateTextImage() render_text_image(titleFont,text + 1,fVar3,textY,&textColor,unused); } else { - uVar2 = (GHIDRA_CAST((titleFont)))->Font::get_string_width_utf16(text,-1); + uVar2 = Font::get_string_width_utf16(titleFont,text,-1); drawSettings = 0; local_48 = 0xffff; local_44 = 0; @@ -518,7 +518,7 @@ void HUD_Message::UpdateTextImage() render_text_image(subtitleFont,text + 1,fVar3,textY,&textColor,unused_00); } else { - uVar2 = (GHIDRA_CAST((subtitleFont)))->Font::get_string_width_utf16(text,-1); + uVar2 = Font::get_string_width_utf16(subtitleFont,text,-1); drawSettings = 0; local_48 = 0xffff; local_44 = 0; @@ -668,8 +668,8 @@ LAB_00841601: local_54 = GHIDRA_CAST(((hashMix >> 8 ^ hashMix) & 0xffff)); switch(local_5c) { case GHIDRA_CAST(0x0): - pLVar4 = (GHIDRA_CAST((&(g_game->_hud)._heartsSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - pvVar2 = (GHIDRA_CAST((pLVar4)))->LayerState::GetTexture(heartsTexture); + pLVar4 = ANM2::GetLayer(&(g_game->_hud)._heartsSprite,GHIDRA_CAST(0x0)); + pvVar2 = LayerState::GetTexture(pLVar4,heartsTexture); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 1; (GHIDRA_CAST((&local_64)))->KAGE::SmartPointer::operator_assign(pvVar2); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 2; @@ -683,8 +683,8 @@ joined_r0x00841934: } break; case GHIDRA_CAST(0x1): - pLVar4 = (GHIDRA_CAST((&(g_game->_hud)._chargeBarSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - pvVar2 = (GHIDRA_CAST((pLVar4)))->LayerState::GetTexture(chargeBarTexture); + pLVar4 = ANM2::GetLayer(&(g_game->_hud)._chargeBarSprite,GHIDRA_CAST(0x0)); + pvVar2 = LayerState::GetTexture(pLVar4,chargeBarTexture); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 3; (GHIDRA_CAST((&local_64)))->KAGE::SmartPointer::operator_assign(pvVar2); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 4; @@ -695,8 +695,8 @@ joined_r0x00841934: } break; case GHIDRA_CAST(0x2): - pLVar4 = (GHIDRA_CAST((&(g_game->_hud)._pickupHUDSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - pvVar2 = (GHIDRA_CAST((pLVar4)))->LayerState::GetTexture(pickupTexture); + pLVar4 = ANM2::GetLayer(&(g_game->_hud)._pickupHUDSprite,GHIDRA_CAST(0x0)); + pvVar2 = LayerState::GetTexture(pLVar4,pickupTexture); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 5; (GHIDRA_CAST((&local_64)))->KAGE::SmartPointer::operator_assign(pvVar2); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 6; @@ -707,8 +707,8 @@ joined_r0x00841934: } break; case GHIDRA_CAST(0x3): - pLVar4 = (GHIDRA_CAST((&(g_game->_hud)._cardsPillsSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - pvVar2 = (GHIDRA_CAST((pLVar4)))->LayerState::GetTexture(cardsPillsTexture); + pLVar4 = ANM2::GetLayer(&(g_game->_hud)._cardsPillsSprite,GHIDRA_CAST(0x0)); + pvVar2 = LayerState::GetTexture(pLVar4,cardsPillsTexture); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 7; (GHIDRA_CAST((&local_64)))->KAGE::SmartPointer::operator_assign(pvVar2); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 8; @@ -741,8 +741,8 @@ joined_r0x00841934: } break; case GHIDRA_CAST(0x6): - pLVar4 = (GHIDRA_CAST((&(g_game->_hud)._statsSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - pvVar2 = (GHIDRA_CAST((pLVar4)))->LayerState::GetTexture(statsTexture); + pLVar4 = ANM2::GetLayer(&(g_game->_hud)._statsSprite,GHIDRA_CAST(0x0)); + pvVar2 = LayerState::GetTexture(pLVar4,statsTexture); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 0xd; (GHIDRA_CAST((&local_64)))->KAGE::SmartPointer::operator_assign(pvVar2); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 0xe; @@ -878,7 +878,7 @@ LAB_00841bda: fStack_2c = 0.0; local_28 = 0.0; ehState = 0x12; - pvVar2 = (GHIDRA_CAST((font)))->Font::layout_glyphs(glyphLayout,GHIDRA_CAST(&charBuf),colorScratch + 0x10, + pvVar2 = Font::layout_glyphs(font,glyphLayout,GHIDRA_CAST(&charBuf),colorScratch + 0x10, &g_vectorOne); ehState = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x1))),0x13); Font::draw_glyph_run(font,(float)local_58,y,pvVar2,1.0,1.0,*color,colorScratch + 0x10); diff --git a/generated-src/invite_friends_menu.cpp b/generated-src/invite_friends_menu.cpp index e1a8f0d..c82c302 100644 --- a/generated-src/invite_friends_menu.cpp +++ b/generated-src/invite_friends_menu.cpp @@ -53,9 +53,9 @@ void InviteFriendsMenu::load_graphics() local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U; ExceptionList = &local_1c; local_68 = cursorSprite; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4))); cursorSprite = GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 0x118)); - (GHIDRA_CAST((cursorSprite)))->ANM2::Reset(); + ANM2::Reset(cursorSprite); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; @@ -68,7 +68,7 @@ void InviteFriendsMenu::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/InviteWidget.anm2",0x19); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar10 = anm2Path._capacity + 1; @@ -94,7 +94,7 @@ void InviteFriendsMenu::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/InviteWidget.anm2",0x19); local_14 = 3; - (GHIDRA_CAST((cursorSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(cursorSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar10 = anm2Path._capacity + 1; @@ -117,7 +117,7 @@ void InviteFriendsMenu::load_graphics() anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/InviteFriendsMenu.anm2",0x28); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar10 = anm2Path._capacity + 1; @@ -143,7 +143,7 @@ void InviteFriendsMenu::load_graphics() anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/InviteFriendsMenu.anm2",0x28); local_14 = 1; - (GHIDRA_CAST((cursorSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(cursorSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar10 = anm2Path._capacity + 1; @@ -162,9 +162,9 @@ void InviteFriendsMenu::load_graphics() pbVar5 = *GHIDRA_CAST((GHIDRA_CAST(cursorSprite) + 0x14c)); if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_009c4468: - bVar4 = (GHIDRA_CAST((cursorSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Cursor"),1); + bVar4 = ANM2::SetAnimation(cursorSprite,GHIDRA_CAST("Cursor"),1); if (bVar4 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 0x148)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 0x148))); *GHIDRA_CAST((GHIDRA_CAST(cursorSprite) + 0x15c)) = 1; } } @@ -225,9 +225,9 @@ LAB_009c4455: pbVar5 = *GHIDRA_CAST((GHIDRA_CAST(cursorSprite) + 0x38)); if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_009c455f: - bVar4 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar4 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 4)),GHIDRA_CAST("Appear"),1); if (bVar4 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 0x34)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(cursorSprite) + 0x34))); *GHIDRA_CAST((GHIDRA_CAST(cursorSprite) + 0x48)) = 1; } } @@ -415,7 +415,7 @@ LAB_009c4819: pageCount = ceil((double)(float)local_54); local_54 = GHIDRA_CAST((float)pageCount); isArrowVisible = 1 < GHIDRA_INT(pageCount); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar3) + 4)))))->ANM2::GetLayer(GHIDRA_CAST("ArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(pvVar3) + 4)),GHIDRA_CAST("ArrowUp")); arrowLayer->_visible = isArrowVisible; iVar7 = *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x230)) - *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x22c)); local_54 = GHIDRA_CAST(((float)((double)(iVar7 >> 3) + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) / @@ -424,7 +424,7 @@ LAB_009c4819: pageCount = ceil((double)(float)local_54); local_54 = GHIDRA_CAST((float)pageCount); isArrowVisible = 1 < GHIDRA_INT(pageCount); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar3) + 4)))))->ANM2::GetLayer(GHIDRA_CAST("ArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(pvVar3) + 4)),GHIDRA_CAST("ArrowDown")); arrowLayer->_visible = isArrowVisible; *GHIDRA_CAST(onlineFriends[1]) = 0; puVar1 = GHIDRA_CAST(*onlineFriends); @@ -532,13 +532,13 @@ void InviteFriendsMenu::Render() friendListFrame = GHIDRA_CAST(0x0); } else { - statusFrame = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xd)))))->AnimationState::GetNullFrame(GHIDRA_CAST("Status")); + statusFrame = AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0xd)),GHIDRA_CAST("Status")); if (in_ECX[0xe] == 0) { friendListFrame = GHIDRA_CAST(0x0); } else { friendListFrame = - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xd)))))->AnimationState::GetNullFrame(GHIDRA_CAST("FriendList")); + AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0xd)),GHIDRA_CAST("FriendList")); } } if (((*in_ECX == 2) && (statusFrame != GHIDRA_CAST(0x0))) && (friendListFrame != GHIDRA_CAST(0x0))) { @@ -556,7 +556,7 @@ void InviteFriendsMenu::Render() text = string_table_translate (GHIDRA_CAST((extraout_EDX + 0x4a920)), GHIDRA_CAST("#Online/NO_ONLINE_FRIENDS")); - (GHIDRA_CAST((statusFont)))->Font::DrawString(text,&local_2c,GHIDRA_CAST((statusFrame + 4)),&local_50,local_b4); + Font::DrawString(statusFont,text,&local_2c,GHIDRA_CAST((statusFrame + 4)),&local_50,local_b4); ExceptionList = local_10; return; } @@ -668,7 +668,7 @@ void InviteFriendsMenu::Render() if (iVar1 != iVar2) { nameColor = &highlightColor; } - (GHIDRA_CAST((nameFont)))->Font::DrawStringScaled((*GHIDRA_CAST((GHIDRA_CAST(&(local_3c)) + 0x4))),&drawPos,nameColor,&local_70); + Font::DrawStringScaled(nameFont,(*GHIDRA_CAST((GHIDRA_CAST(&(local_3c)) + 0x4))),&drawPos,nameColor,&local_70); row = row + 1; local_8 = 0xffffffff; friendIndex = GHIDRA_INT(local_20) + 1; diff --git a/generated-src/item_config.cpp b/generated-src/item_config.cpp index c6b2d51..b769235 100644 --- a/generated-src/item_config.cpp +++ b/generated-src/item_config.cpp @@ -5707,7 +5707,7 @@ LAB_0072e63a: if (GHIDRA_CAST(0xf) < ppppppbVar15[0x13]) { ppppppbVar13 = GHIDRA_CAST(*ppppppbVar13); } - pvVar8 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(modEntry) + 0x9a0)))))->ANM2::GetAnimationData(GHIDRA_CAST(ppppppbVar13)); + pvVar8 = ANM2::GetAnimationData(GHIDRA_CAST((GHIDRA_INT(modEntry) + 0x9a0)),GHIDRA_CAST(ppppppbVar13)); if (pvVar8 != (void *)0x0) { ppppppbVar15[0x1b] = GHIDRA_CAST((GHIDRA_INT(modEntry) + 0x9a0)); } diff --git a/generated-src/item_overlay.cpp b/generated-src/item_overlay.cpp index 40abb7d..1359010 100644 --- a/generated-src/item_overlay.cpp +++ b/generated-src/item_overlay.cpp @@ -13,9 +13,9 @@ ItemOverlay::~ItemOverlay() local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; - (GHIDRA_CAST((&this->_megaMushPlayerSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_megaMushPlayerSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_megaMushPlayerSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_megaMushPlayerSprite); + AnimationState::~AnimationState(&(this->_megaMushPlayerSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_megaMushPlayerSprite)._animState); (GHIDRA_CAST(((this->_megaMushPlayerSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_megaMushPlayerSprite))))->msvc::string::_Tidy_deallocate(); playerRef = &this->_player; @@ -27,9 +27,9 @@ ItemOverlay::~ItemOverlay() local_8 = 0xffffffff; _eh_vector_destructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x11c))),0x58,0x30,FUN_009abd50); local_8 = 2; - (GHIDRA_CAST((&this->_sprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_sprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_sprite); + AnimationState::~AnimationState(&(this->_sprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_sprite)._animState); (GHIDRA_CAST(((this->_sprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_sprite))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -74,7 +74,7 @@ void ItemOverlay::Update(uint8_t unk) } if ((this->_megaMushPlayerSprite)._loaded != 0) { if (unk == 0) { - (GHIDRA_CAST((&this->_megaMushPlayerSprite)))->ANM2::Update(); + ANM2::Update(&this->_megaMushPlayerSprite); } else if ((this->_megaMushPlayerSprite)._animState._animData != (void *)0x0) { AnimationState::AdvancePosition @@ -82,9 +82,9 @@ void ItemOverlay::Update(uint8_t unk) *GHIDRA_CAST((GHIDRA_INT((this->_megaMushPlayerSprite)._animState._animData) + 0x30)) + -1); } if (((this->_player != 0) && - (bVar1 = (GHIDRA_CAST((&this->_megaMushPlayerSprite)))->ANM2::IsPlaying(GHIDRA_CAST("Transform")), bVar1 != 0)) && + (bVar1 = ANM2::IsPlaying(&this->_megaMushPlayerSprite,GHIDRA_CAST("Transform")), bVar1 != 0)) && (isFastForward == 0)) { - iVar2 = (GHIDRA_CAST((&this->_megaMushPlayerSprite)))->ANM2::GetFrame(); + iVar2 = ANM2::GetFrame(&this->_megaMushPlayerSprite); manager = g_manager; if (iVar2 == 1) { local_8 = GHIDRA_CAST(0x9d); @@ -135,7 +135,7 @@ LAB_009acc1b: this->_state = 0; } if (isFastForward == 0) { - (GHIDRA_CAST((&this->_sprite)))->ANM2::Update(); + ANM2::Update(&this->_sprite); } else { if ((this->_sprite)._animState._animData == (void *)0x0) goto LAB_009accdf; @@ -144,7 +144,7 @@ LAB_009acc1b: *GHIDRA_CAST((GHIDRA_INT((this->_sprite)._animState._animData) + 0x30)) + -1); } if ((((this->_sprite)._animState._animData != (void *)0x0) && - (bVar1 = (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Sound")), + (bVar1 = AnimationState::IsEventTriggered(&(this->_sprite)._animState,GHIDRA_CAST("Sound")), manager = g_manager, bVar1 != 0)) && (this->_overlayID == 0x27)) { local_8 = GHIDRA_CAST(0x51); seed_fart_sound_override(GHIDRA_CAST(&local_8)); @@ -153,7 +153,7 @@ LAB_009acc1b: LAB_009accdf: local_8 = &(this->_sprite)._animState; if (((this->_sprite)._animState._animData != (void *)0x0) && - (bVar1 = (GHIDRA_CAST((local_8)))->AnimationState::IsEventTriggered(GHIDRA_CAST("SleepFillHP")), bVar1 != 0)) { + (bVar1 = AnimationState::IsEventTriggered(local_8,GHIDRA_CAST("SleepFillHP")), bVar1 != 0)) { playerIndex = 0; playerManager = &g_game->_playerManager; if (GHIDRA_INT((g_game->_playerManager)._playerList._end) - GHIDRA_INT((playerManager->_playerList)._begin) >> @@ -207,12 +207,12 @@ LAB_009ace00: } spriteAnimState = local_8; if ((this->_overlayID == 0x2c) && ((this->_sprite)._animState._animData != (void *)0x0)) { - bVar1 = (GHIDRA_CAST((local_8)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Transition")); + bVar1 = AnimationState::IsEventTriggered(local_8,GHIDRA_CAST("Transition")); manager = g_manager; game = g_game; if (bVar1 == 0) { if ((((this->_sprite)._animState._animData != (void *)0x0) && - (bVar1 = (GHIDRA_CAST((spriteAnimState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Static")), + (bVar1 = AnimationState::IsEventTriggered(spriteAnimState,GHIDRA_CAST("Static")), manager = g_manager, bVar1 != 0)) && (isFastForward == 0)) { _unk = 0x51; seed_fart_sound_override(GHIDRA_CAST(&unk)); @@ -300,7 +300,7 @@ void ItemOverlay::Render() scratchVec.y = g_screenHeight * 0.5; scratchVec.x = g_screenWidth * 0.5; } - (GHIDRA_CAST((sprite)))->ANM2::Render(&scratchVec,&g_vectorZero,&g_vectorZero); + ANM2::Render(sprite,&scratchVec,&g_vectorZero,&g_vectorZero); unusedArg = extraout_ECX_00; LAB_009ad1ff: shader_cache_find(GHIDRA_INT(unusedArg)); @@ -338,10 +338,10 @@ void ItemOverlay::Show(int eOverlayID, int delay, Entity_Player *player) } sprite = &this->_sprite; if (*GHIDRA_CAST((GHIDRA_CAST((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x14)) == 0) { - (GHIDRA_CAST((sprite)))->ANM2::Reset(); + ANM2::Reset(sprite); } else { - (GHIDRA_CAST((sprite)))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT((&this->_sprite + 1)) + eOverlayID * 0x58 + 4)),0); + ANM2::Load(sprite,GHIDRA_CAST((GHIDRA_INT((&this->_sprite + 1)) + eOverlayID * 0x58 + 4)),0); bVar5 = extraout_CL; if (*GHIDRA_CAST((GHIDRA_CAST((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x44)) != 0) { Sprite::ReplaceSpritesheet @@ -349,7 +349,7 @@ void ItemOverlay::Show(int eOverlayID, int delay, Entity_Player *player) GHIDRA_CAST((GHIDRA_INT((&this->_sprite + 1)) + eOverlayID * 0x58 + 0x34))); bVar5 = extraout_CL_00; } - (GHIDRA_CAST((sprite)))->ANM2::LoadGraphics(bVar5); + ANM2::LoadGraphics(sprite,bVar5); } newPlayer = player; this->_overlayID = eOverlayID; @@ -380,7 +380,7 @@ void ItemOverlay::Show(int eOverlayID, int delay, Entity_Player *player) pbVar9 = GHIDRA_CAST(0x0); if ((this->_sprite)._layerCount != 0) { do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(pbVar9); + layer = ANM2::GetLayer(sprite,pbVar9); layerData = layer->_layerData; if (layerData == (void *)0x0) { pbVar8 = &s_empty; @@ -470,9 +470,9 @@ LAB_009ad429: if ((cmpResult == 0) && ((pbVar9[0x34] == 0 || ((this->_sprite)._animState._isPlaying != 0)))) goto LAB_009ad452; } - bVar5 = (GHIDRA_CAST((&this->_sprite)))->ANM2::SetAnimation(pbVar10,1); + bVar5 = ANM2::SetAnimation(&this->_sprite,pbVar10,1); if (bVar5 != 0) { - (GHIDRA_CAST((&(this->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_sprite)._animState); (this->_sprite)._animState._isPlaying = 1; } } diff --git a/generated-src/kage_graphics.cpp b/generated-src/kage_graphics.cpp index f819ac6..8002b05 100644 --- a/generated-src/kage_graphics.cpp +++ b/generated-src/kage_graphics.cpp @@ -393,555 +393,6 @@ LAB_00a18638: return; } -// 00a18750 -void KAGE_Graphics::update_depth_renderbuffer(uint8_t isForced) -{ - uint32_t uVar1; - uint32_t height; - uint32_t widthBits; - uint8_t shift; - uint32_t uVar2; - undefined3 in_stack_00000005; - uint32_t prevFramebuffer; - int currentHeight; - int pow2Width; - uint32_t *renderbufferId; - - uVar1 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0xb4)); - if (GHIDRA_INT(uVar1) < 1) { - uVar1 = (**(code **)(*GHIDRA_CAST(this) + 0x5c))(); - } - height = *GHIDRA_CAST((GHIDRA_CAST(this) + 0xb8)); - if (GHIDRA_INT(height) < 1) { - height = (**(code **)(*GHIDRA_CAST(this) + 0x60))(); - } - if ((isForced == 0) && (*GHIDRA_CAST((GHIDRA_CAST(this) + 0xb0)) != 0)) { - (*(code *)epoxy_glBindRenderbuffer)(0x8d41,*GHIDRA_CAST((GHIDRA_CAST(this) + 0xb0))); - (*(code *)epoxy_glGetRenderbufferParameteriv)(0x8d41,0x8d42,&isForced); - (*(code *)epoxy_glGetRenderbufferParameteriv)(0x8d41,0x8d43,¤tHeight); - if ((GHIDRA_INT(uVar1) <= _isForced) && (GHIDRA_INT(height) <= currentHeight)) { - return; - } - } - if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0xb0)) != 0) { - (*(code *)epoxy_glDeleteRenderbuffers)(1,GHIDRA_INT(this) + 0xb0); - } - if (GHIDRA_INT(uVar1) < 9) { - uVar1 = 8; - uVar2 = 7; - widthBits = 4; -LAB_00a18808: - shift = 1; - do { - uVar2 = uVar2 | widthBits; - shift = shift + 1; - widthBits = uVar1 >> (shift & 0x1f); - } while (widthBits != 0); - } - else { - uVar2 = uVar1 - 1; - widthBits = uVar1 >> 1; - if (widthBits != 0) goto LAB_00a18808; - } - _isForced = uVar2 + 1; - if (GHIDRA_INT(height) < 9) { - height = 8; - uVar1 = 7; - uVar2 = 4; - } - else { - uVar1 = height - 1; - uVar2 = height >> 1; - if (uVar2 == 0) goto LAB_00a18850; - } - shift = 1; - do { - uVar1 = uVar1 | uVar2; - shift = shift + 1; - uVar2 = height >> (shift & 0x1f); - } while (uVar2 != 0); -LAB_00a18850: - (*(code *)epoxy_glGetIntegerv)(0x8ca6,&prevFramebuffer); - (*(code *)epoxy_glBindFramebuffer)(0x8d40,*GHIDRA_CAST((GHIDRA_CAST(this) + 0xac))); - renderbufferId = GHIDRA_CAST((GHIDRA_INT(this) + 0xb0)); - (*(code *)epoxy_glGenRenderbuffers)(1,renderbufferId); - pow2Width = _isForced; - KAGE_LogMessage(1,GHIDRA_CAST("Renderbuffer ID: %d size %dx%d\n")); - (*(code *)epoxy_glBindRenderbuffer)(0x8d41,*renderbufferId); - (*(code *)epoxy_glRenderbufferStorage)(0x8d41,0x81a6,pow2Width,uVar1 + 1); - (*(code *)epoxy_glFramebufferRenderbuffer)(0x8d40,0x8d00,0x8d41,*renderbufferId); - (*(code *)epoxy_glBindFramebuffer)(0x8d40,prevFramebuffer); - return; -} - -// 00a19450 -void KAGE_Graphics::set_window_size(int *param_1) -{ - int iVar1; - int iVar2; - int iVar3; - int in_ECX; - - if ((*GHIDRA_CAST((in_ECX + 0xc0)) != *param_1) || (*GHIDRA_CAST((in_ECX + 0xc4)) != param_1[1])) { - *GHIDRA_CAST((in_ECX + 0xc0)) = *param_1; - *GHIDRA_CAST((in_ECX + 0xc4)) = param_1[1]; - if ((*GHIDRA_CAST((in_ECX + 4)) & 0x100) == 0) { - iVar1 = *GHIDRA_CAST((in_ECX + 0xbc)); - if (iVar1 != 0) { - iVar2 = *param_1; - iVar3 = param_1[1]; - if (iVar2 < 0) { - _wassert(L"width >= 0", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x26f); - } - if (iVar3 < 0) { - _wassert(L"height >= 0", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x270); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - return; - } - *GHIDRA_CAST((iVar1 + 0x28)) = iVar2; - *GHIDRA_CAST((iVar1 + 0x2c)) = iVar3; - (*DAT_00c73724)(iVar1,iVar2,iVar3); - return; - } - } - else { - KAGE_LogMessage(4,GHIDRA_CAST("Setting size of window while in fullscreen, is this intended?\n")); - } - } - return; -} - -// 00a196b0 -void KAGE_Graphics::set_fullscreen(uint8_t isFullscreen, uint8_t isExclusive) -{ - void *pvVar1; - int iVar2; - HWND hWnd; - Vector *viewportOffset; - code *assertFn; - int *piVar3; - int cx; - bool isResizable; - HWND hWndInsertAfter; - int X; - int Y; - UINT uFlags; - uint32_t framebufferWidth; - uint32_t framebufferHeight; - void *local_8; - uint32_t currentModeAddr; - - if (((uint8_t)(g_graphicsManager_flags >> 8) & 1) == isFullscreen) { - return; - } - if (isFullscreen == 0) { - g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffeff; - FUN_00a6b0a0(DAT_00c799b0,DAT_00c799b4,DAT_00c799a8,DAT_00c799ac,0); - pvVar1 = g_glfwWindow; - assertFn = _wassert_exref; - if (g_glfwWindow == (void *)0x0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x3a3); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 8)) = 1; - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x40)) == 0) { - (*DAT_00c7377c)(pvVar1,1); - } - } - pvVar1 = g_glfwWindow; - isResizable = DAT_00c79a3d != '\0'; - if (g_glfwWindow == (void *)0x0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x3a3); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 4)) = GHIDRA_UINT(isResizable); - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x40)) == 0) { - (*DAT_00c73778)(pvVar1,GHIDRA_UINT(isResizable)); - } - } - uFlags = 3; - iVar2 = 0; - cx = 0; - Y = 0; - X = 0; - hWndInsertAfter = (HWND)0xfffffffe; - hWnd = (HWND)FUN_00a5f090(); - } - else { - g_graphicsManager_flags = g_graphicsManager_flags | 0x100; - local_8 = window_get_current_monitor(&DAT_00c798e0); - assertFn = _wassert_exref; - if (local_8 == (void *)0x0) { - _wassert(L"monitor != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" - ,0x1c1); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - piVar3 = GHIDRA_CAST(0x0); - } - else { - currentModeAddr = GHIDRA_INT(local_8) + 0x98; - iVar2 = (*DAT_00c736fc)(local_8,currentModeAddr); - piVar3 = GHIDRA_CAST((-GHIDRA_UINT((iVar2 != 0)) & currentModeAddr)); - } - if (isExclusive != 0) { - FUN_00a6b0a0(0,0,*piVar3,piVar3[1],piVar3[5]); - goto LAB_00a1993f; - } - FUN_00a6b0a0(0,0,*piVar3 + 1,piVar3[1],0); - pvVar1 = g_glfwWindow; - if (g_glfwWindow == (void *)0x0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x3a3); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 8)) = 0; - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x40)) == 0) { - (*DAT_00c7377c)(pvVar1,0); - } - } - pvVar1 = g_glfwWindow; - if (g_glfwWindow == (void *)0x0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x3a3); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 4)) = 0; - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x40)) == 0) { - (*DAT_00c73778)(pvVar1,0); - } - } - iVar2 = piVar3[1]; - cx = *piVar3 + 1; - hWnd = (HWND)FUN_00a5f090(); - uFlags = 0x10; - Y = 0; - X = -1; - hWndInsertAfter = (HWND)0xffffffff; - } - SetWindowPos(hWnd,hWndInsertAfter,X,Y,cx,iVar2,uFlags); -LAB_00a1993f: - pvVar1 = g_glfwWindow; - if (g_glfwWindow == (void *)0x0) { - (*assertFn)(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x333); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else if ((*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x40)) == 0) && - ((*DAT_00c73748)(pvVar1), *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x14)) != 0)) { - (*DAT_00c73754)(pvVar1); - } - pvVar1 = g_glfwWindow; - if (isFullscreen == 0) { - g_graphicsManager_flags = g_graphicsManager_flags & 0xfffff7ff; - } - else { - g_graphicsManager_flags = g_graphicsManager_flags | 0x800; - } - if (g_glfwWindow == (void *)0x0) { - (*assertFn)(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x260); - } - framebufferWidth = 0; - framebufferHeight = 0; - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - (*DAT_00c73720)(pvVar1,&framebufferWidth,&framebufferHeight); - } - piVar3 = GHIDRA_CAST(*DAT_00c799b8); - if (piVar3 != DAT_00c799b8) { - do { - (*(code *)piVar3[2])(framebufferWidth,framebufferHeight,piVar3[3]); - piVar3 = GHIDRA_CAST(*piVar3); - } while (piVar3 != DAT_00c799b8); - } - viewportOffset = GHIDRA_CAST(&DAT_00c79984); - if ((g_graphicsManager_flags & 0x40) == 0) { - viewportOffset = &g_vectorZero; - } - (*(code *)epoxy_glViewport) - (GHIDRA_INT(viewportOffset->x),GHIDRA_INT(viewportOffset->y),DAT_00c799a8,DAT_00c799ac); - update_projection(&DAT_00c798e0); - update_depth_renderbuffer(&DAT_00c798e0,0); - pvVar1 = g_glfwWindow; - if (isFullscreen == 0) { - if (g_glfwWindow == (void *)0x0) { - (*assertFn)(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" - ,0x24c); - } - if (_glfw != 0) { - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x70)) == 0x34001) { - return; - } - *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x70)) = 0x34001; - (*DAT_00c736a0)(pvVar1,GHIDRA_INT(pvVar1) + 0x1e0,GHIDRA_INT(pvVar1) + 0x1e8); - (*DAT_00c736a8)(pvVar1,0x34001); - return; - } - } - else { - if (g_glfwWindow == (void *)0x0) { - (*assertFn)(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\input.c" - ,0x24c); - } - if (_glfw != 0) { - if (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x70)) == 0x34002) { - return; - } - *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x70)) = 0x34002; - (*DAT_00c736a0)(pvVar1,GHIDRA_INT(pvVar1) + 0x1e0,GHIDRA_INT(pvVar1) + 0x1e8); - (*DAT_00c736a8)(pvVar1,0x34002); - return; - } - } - _glfwInputError(0x10001,0); - return; -} - -// 00a19df0 -uint32_t KAGE_Graphics::create_window() -{ - HMODULE hInstance; - HICON dwNewLong; - uint32_t windowStyle; - LPVOID currentContext; - int *piVar1; - int *in_ECX; - uint32_t extraout_ECX; - uint32_t extraout_ECX_00; - uint32_t extraout_ECX_01; - uint32_t extraout_ECX_02; - uint32_t extraout_ECX_03; - uint32_t extraout_ECX_04; - uint32_t extraout_ECX_05; - uint32_t extraout_ECX_06; - uint32_t uVar2; - HWND hwnd; - uint32_t extraout_ECX_07; - int *piVar3; - LPCSTR lpIconName; - int iVar4; - int local_10; - - glfwWindowHint(); - if (_glfw == 0) { - _glfwInputError(0x10001,0); - uVar2 = extraout_ECX_00; - } - else { - _DAT_00c73830 = 0; - uVar2 = extraout_ECX; - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - uVar2 = extraout_ECX_01; - } - else { - _DAT_00c7383c = 0; - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - uVar2 = extraout_ECX_02; - } - else { - _DAT_00c73c6c = 2; - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - uVar2 = extraout_ECX_03; - } - else { - _DAT_00c73c70 = 0; - } - local_10 = glfwCreateWindow(DAT_00c79a30,uVar2,in_ECX[0x2f]); - if (local_10 == 0) { - if (_glfw == 0) { - _glfwInputError(0x10001,0); - uVar2 = extraout_ECX_05; - } - else { - _DAT_00c73c6c = 1; - uVar2 = extraout_ECX_04; - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - uVar2 = extraout_ECX_06; - } - else { - _DAT_00c73c70 = 0; - } - local_10 = glfwCreateWindow(DAT_00c79a30,uVar2,in_ECX[0x2f]); - if (local_10 == 0) { - KAGE_LogMessage(0x10,GHIDRA_CAST("Failed to create OpenGL window / context\n")); - } - } - if (in_ECX[0x2f] != 0) { - FUN_00a6af90(); - } - lpIconName = (LPCSTR)GHIDRA_UINT(DAT_00c79a40); - hInstance = GetModuleHandleA((LPCSTR)0x0); - dwNewLong = LoadIconA(hInstance,lpIconName); - if (_glfw == 0) { - _glfwInputError(0x10001,0); - hwnd = (HWND)0x0; - } - else if (DAT_00c73694 == 0x60001) { - hwnd = *GHIDRA_CAST((local_10 + 0x2b4)); - } - else { - _glfwInputError(0x1000e,"Win32: Platform not initialized"); - hwnd = (HWND)0x0; - } - SetClassLongA(hwnd,-0xe,(LONG)dwNewLong); - if ((in_ECX[1] & 0x400U) == 0) { - iVar4 = -0x10; - hwnd = (HWND)FUN_00a5f090(extraout_ECX_07); - windowStyle = GetWindowLongA(hwnd,iVar4); - windowStyle = windowStyle & 0xfffeffff; - iVar4 = -0x10; - hwnd = (HWND)FUN_00a5f090(); - SetWindowLongA(hwnd,iVar4,windowStyle); - } - in_ECX[0x2f] = local_10; - if (_glfw == 0) { - _glfwInputError(0x10001,0); - goto LAB_00a1a0a2; - } - if (DAT_00c74b80 != 1) { - _wassert(L"tls->win32.allocated == GLFW_TRUE", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\win32_thread.c" - ,0x3f); - } - currentContext = TlsGetValue(DAT_00c74b84); - if ((local_10 != 0) && (*GHIDRA_CAST((local_10 + 500)) == 0)) { - _glfwInputError(0x1000a, - "Cannot make current with a window that has no OpenGL or OpenGL ES context"); - goto LAB_00a1a0a2; - } - if (currentContext == (LPVOID)0x0) { -LAB_00a1a092: - if (local_10 == 0) goto LAB_00a1a0a2; - } - else if ((local_10 == 0) || (*GHIDRA_CAST((local_10 + 0x1f8)) != *GHIDRA_CAST((GHIDRA_CAST(currentContext) + 0x1f8)))) - { - (**(code **)(GHIDRA_CAST(currentContext) + 0x22c))(0); - goto LAB_00a1a092; - } - (**(code **)(local_10 + 0x22c))(local_10); -LAB_00a1a0a2: - (*(code *)epoxy_glGetString)(0x1f02); - KAGE_LogMessage(1,GHIDRA_CAST("OpenGL version %s\n")); - (*(code *)epoxy_glGetString)(0x8b8c); - KAGE_LogMessage(1,GHIDRA_CAST("GLSL version %s\n")); - piVar1 = in_ECX + 0x2b; - if (*piVar1 != 0) { - (*(code *)epoxy_glBindFramebuffer)(0x8d40,0); - (*(code *)epoxy_glDeleteFramebuffers)(1,piVar1); - } - if (epoxy_glGenFramebuffers == GHIDRA_CAST(0x0)) { - KAGE_LogMessage(8,GHIDRA_CAST("glGenFramebuffers is NULL!\n")); - return 0; - } - (*(code *)epoxy_glGenFramebuffers)(1,piVar1); - KAGE_LogMessage(1,GHIDRA_CAST("Framebuffer ID: %d\n")); - (*(code *)epoxy_glBindFramebuffer)(0x8d40,*piVar1); - update_depth_renderbuffer(in_ECX,1); - (*(code *)epoxy_glBindFramebuffer)(0x8d40,0); - iVar4 = in_ECX[0x2f]; - if (iVar4 == 0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x41f); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - *(code **)(iVar4 + 0x274) = FUN_00a19bf0; - } - iVar4 = in_ECX[0x2f]; - if (iVar4 == 0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x414); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - *GHIDRA_CAST((iVar4 + 0x270)) = &UNK_00a19ca0; - } - iVar4 = in_ECX[0x2f]; - if (iVar4 == 0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x440); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - } - else { - *GHIDRA_CAST((iVar4 + 0x280)) = &UNK_00a19d40; - } - if ((in_ECX[1] & 0x100U) == 0) { - iVar4 = in_ECX[0x2f]; - if (iVar4 == 0) { - _wassert(L"window != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c" - ,0x245); - } - piVar3 = in_ECX + 0x34; - piVar1 = in_ECX + 0x35; - if (piVar3 != GHIDRA_CAST(0x0)) { - *piVar3 = 0; - } - if (piVar1 != GHIDRA_CAST(0x0)) { - *piVar1 = 0; - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - (**(code **)(*in_ECX + 0x78))(); - return 1; - } - (*_DAT_00c73718)(iVar4,piVar3,piVar1); - } - (**(code **)(*in_ECX + 0x78))(); - return 1; -} - // 00a67bd0 uint32_t KAGE_Graphics::submit_batch() { diff --git a/generated-src/layer_animation.cpp b/generated-src/layer_animation.cpp deleted file mode 100644 index e4e7914..0000000 --- a/generated-src/layer_animation.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "classes.h" - -// 0040c1e0 -LayerAnimation::LayerAnimation() -{ - *GHIDRA_CAST(this) = 0xffffffff; - *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = 0; - *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = 1; - return; -} diff --git a/generated-src/layer_data.cpp b/generated-src/layer_data.cpp deleted file mode 100644 index 3df15a5..0000000 --- a/generated-src/layer_data.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "classes.h" - -// 0040db70 -LayerData::~LayerData() -{ - int in_ECX; - - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x20)))))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 8)))))->msvc::string::_Tidy_deallocate(); - return; -} diff --git a/generated-src/layer_state.cpp b/generated-src/layer_state.cpp deleted file mode 100644 index 043f3ce..0000000 --- a/generated-src/layer_state.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "classes.h" - -// 00407a60 -LayerState::~LayerState() -{ - char isLastRef; - int in_ECX; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - puStack_c = &LAB_00af09f0; - local_10 = ExceptionList; - ExceptionList = &local_10; - local_8 = 0; - if (*GHIDRA_CAST((in_ECX + 0x9c)) != GHIDRA_CAST(0x0)) { - isLastRef = (**(code **)(**GHIDRA_CAST((in_ECX + 0x9c)) + 0xc)) - (__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U); - if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(in_ECX + 0x98); - } - } - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 8)))))->msvc::string::_Tidy_deallocate(); - ExceptionList = local_10; - return; -} - -// 00408590 -void * LayerState::GetTexture(void *outTexture) -{ - int iVar1; - int iVar2; - int *texture; - - texture = GHIDRA_CAST(this->_spriteSheet); - if (texture != GHIDRA_CAST(0x0)) { - iVar1 = this->_minFilterMode; - if (((texture[0xc] != iVar1) || (texture[0xd] != this->_magFilterMode)) && - ((iVar2 = this->_magFilterMode, iVar1 != texture[0xc] || (iVar2 != texture[0xd])))) { - (**(code **)(*texture + 0x44))(iVar1,iVar2); - texture[0xc] = iVar1; - texture[0xd] = iVar2; - texture = GHIDRA_CAST(this->_spriteSheet); - } - iVar1 = this->_wrapSMode; - if (((texture[0xe] != iVar1) || (texture[0xf] != this->_wrapTMode)) && - ((iVar2 = this->_wrapTMode, iVar1 != texture[0xe] || (iVar2 != texture[0xf])))) { - (**(code **)(*texture + 0x48))(iVar1,iVar2); - texture[0xe] = iVar1; - texture[0xf] = iVar2; - } - } - (GHIDRA_CAST((outTexture)))->KAGE::SmartPointer::operator_assign(&this->_spriteSheet); - return outTexture; -} - -// 00408640 -void LayerState::SetTexture(void *texture, void *textureRefCount) -{ - char isLastRef; - uint32_t uVar1; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - puStack_c = &LAB_00af0b1d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; - ExceptionList = &local_10; - local_8 = 0; - if (texture != (void *)0x0) { - this->_minFilterMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x30)); - this->_magFilterMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x34)); - this->_wrapSMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x38)); - this->_wrapTMode = *GHIDRA_CAST((GHIDRA_CAST(texture) + 0x3c)); - } - (GHIDRA_CAST((&this->_spriteSheet)))->KAGE::SmartPointer::operator_assign(&texture); - local_8 = 1; - if (textureRefCount != (void *)0x0) { - isLastRef = (**(code **)(*GHIDRA_CAST(textureRefCount) + 0xc))(uVar1); - if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(&texture); - } - } - ExceptionList = local_10; - return; -} diff --git a/generated-src/leaderboard.cpp b/generated-src/leaderboard.cpp index 377359a..c701bce 100644 --- a/generated-src/leaderboard.cpp +++ b/generated-src/leaderboard.cpp @@ -13,9 +13,9 @@ void Leaderboard::constructor() local_10 = ExceptionList; ExceptionList = &local_10; *GHIDRA_CAST((in_ECX + 4)) = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((in_ECX + 0x10))); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x124)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((in_ECX + 0x124))); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); *GHIDRA_CAST((in_ECX + 0x238)) = 0; *GHIDRA_CAST((in_ECX + 0x23c)) = 0; @@ -27,7 +27,7 @@ void Leaderboard::constructor() *GHIDRA_CAST((in_ECX + 0x25c)) = 0; *GHIDRA_CAST((in_ECX + 0x264)) = 0; *GHIDRA_CAST((in_ECX + 0x260)) = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x268)))))->ChallengeParam::Reset(); + ChallengeParam::Reset(GHIDRA_CAST((in_ECX + 0x268))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x30c)))))->ScoreSheet::ScoreSheet(); *GHIDRA_CAST((in_ECX + 0x3a8)) = 0; ExceptionList = local_10; @@ -68,15 +68,15 @@ Leaderboard::~Leaderboard() msvc::vector<12byte>::_Tidy(); FUN_004269f0(); local_8 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x24])) + 0x4)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2e])) + 0x4)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x4)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x24])) + 0x4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2e])) + 0x4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2a])) + 0x4))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x27])) + 0x4))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x24])) + 0x4))))))->msvc::string::_Tidy_deallocate(); local_8 = 3; - (GHIDRA_CAST((GHIDRA_CAST((this + 2)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0xc)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((this + 2))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0xc))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 8))); (GHIDRA_CAST((GHIDRA_CAST((this + 5)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this + 2)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -109,19 +109,19 @@ void Leaderboard::Update() } if (*in_ECX == 0) { if (*GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x119)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x18)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x10))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x18))); displayState = in_ECX[1]; } if ((displayState == 1) && ((in_ECX[0x11] == 0 || ((char)in_ECX[0x15] == '\0')))) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::Play(GHIDRA_CAST("Loading"),0); + ANM2::Play(GHIDRA_CAST((in_ECX + 4)),GHIDRA_CAST("Loading"),0); in_ECX[1] = 2; displayState = 2; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::IsPlaying(GHIDRA_CAST("Loading")); + bVar1 = ANM2::IsPlaying(GHIDRA_CAST((in_ECX + 4)),GHIDRA_CAST("Loading")); if (((bVar1 != 0) && ((char)in_ECX[0xe7] != '\0')) && (*GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x39d)) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::Play(GHIDRA_CAST("DisplayRankStart"),0); + ANM2::Play(GHIDRA_CAST((in_ECX + 4)),GHIDRA_CAST("DisplayRankStart"),0); in_ECX[1] = 3; displayState = 3; } @@ -149,14 +149,14 @@ LAB_00857630: uVar2 = 0; LAB_00857635: if (uVar2 == 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::Play(GHIDRA_CAST("DisplayRank"),0); + ANM2::Play(GHIDRA_CAST((in_ECX + 4)),GHIDRA_CAST("DisplayRank"),0); displayState = in_ECX[1]; } } if ((displayState == 4) && ((in_ECX[0x11] == 0 || ((char)in_ECX[0x15] == '\0')))) { *in_ECX = 1; in_ECX[1] = 1; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x49)))))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(GHIDRA_CAST((in_ECX + 0x49)),GHIDRA_CAST("Appear"),0); } if ((char)in_ECX[0xec] == '\0') goto LAB_0085769c; if (in_ECX[0x11] != 0) { @@ -167,14 +167,14 @@ LAB_00857635: else { if (*in_ECX != 1) goto LAB_0085769c; if (*GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x22d)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x55)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x5d)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x55))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x5d))); displayState = in_ECX[1]; } if (displayState == 1) { if ((in_ECX[0x56] == 0) || ((char)in_ECX[0x5a] == '\0')) { in_ECX[1] = 2; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x49)))))->ANM2::Play(GHIDRA_CAST("Loading"),0); + ANM2::Play(GHIDRA_CAST((in_ECX + 0x49)),GHIDRA_CAST("Loading"),0); displayState = in_ECX[1]; goto LAB_008574e8; } @@ -184,7 +184,7 @@ LAB_008574e8: if (displayState == 2) { if (in_ECX[0x92] == 0) goto LAB_00857530; in_ECX[1] = 3; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x49)))))->ANM2::Play(s_Idle,0); + ANM2::Play(GHIDRA_CAST((in_ECX + 0x49)),s_Idle,0); displayState = in_ECX[1]; } if ((displayState == 4) && ((in_ECX[0x56] == 0 || ((char)in_ECX[0x5a] == '\0')))) { @@ -248,7 +248,7 @@ void Leaderboard::update_input() (0xffffffff,FUN_00a209e0,&buttonAction,0,0); if (isTriggered != '\0') { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((closeSprite)) + 0x4)))) = 4; - (GHIDRA_CAST((GHIDRA_CAST((closeSprite + 2)))))->ANM2::Play(GHIDRA_CAST("Dissapear"),0); + ANM2::Play(GHIDRA_CAST((closeSprite + 2)),GHIDRA_CAST("Dissapear"),0); if ((*GHIDRA_CAST((closeSprite + 1)) == 0) || (*GHIDRA_CAST((closeSprite + 1)) == 1)) { iVar3 = 0; } @@ -430,7 +430,7 @@ LAB_00857bd6: closeSprite = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(closeSprite[0x24])) + 0x4)))); } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((closeSprite)) + 0x4)))) = 4; - (GHIDRA_CAST((closeSprite)))->ANM2::Play(GHIDRA_CAST(closeAnim),0); + ANM2::Play(closeSprite,GHIDRA_CAST(closeAnim),0); *GHIDRA_CAST((closeSprite + 0x76)) = 1; } return; @@ -503,9 +503,9 @@ LAB_00858145: if ((uVar2 == 0) && ((curAnimData[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x4))) != '\0')))) goto LAB_00858172; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 2)))))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 2)),GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 8))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[10])) + 0x4))) = 1; } LAB_00858172: @@ -673,7 +673,7 @@ joined_r0x00858578: LAB_00858490: if ((*GHIDRA_CAST(this) == 1) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == 3)) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x24])) + 0x4)))))))->ANM2::Play(GHIDRA_CAST("Loading"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x24])) + 0x4)))),GHIDRA_CAST("Loading"),0); } ExceptionList = local_10; return; @@ -799,7 +799,7 @@ LAB_0085875f: LAB_0085882b: if ((*in_ECX == 1) && (in_ECX[1] == 3)) { in_ECX[1] = 2; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x49)))))->ANM2::Play(GHIDRA_CAST("Loading"),0); + ANM2::Play(GHIDRA_CAST((in_ECX + 0x49)),GHIDRA_CAST("Loading"),0); } ExceptionList = local_10; return; @@ -867,7 +867,7 @@ void Leaderboard::render_daily_score_breakdown() anchorY = drawPos.y; anchorX = drawPos.x; if ((*GHIDRA_CAST((in_ECX + 0x44)) != 0) && - (nullFrame = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x40)))))->AnimationState::GetNullFrame(&DAT_00b1c208), + (nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x40)),&DAT_00b1c208), nullFrame != GHIDRA_CAST(0x0))) { drawPos.x = anchorX + *nullFrame; drawPos.y = anchorY + nullFrame[1]; @@ -957,9 +957,9 @@ void Leaderboard::render_daily_score_breakdown() local_8 = 0; fVar1 = drawPos.x; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); - this->Font::DrawString(finishTimeLabel,color,&local_30,fVar1 + fVar2,local_b0); + Font::DrawString(this,finishTimeLabel,color,&local_30,fVar1 + fVar2,local_b0); sprintf_s(finishTimeText,0x20,GHIDRA_CAST("%d:%02d:%02d")); - bonusValue = (GHIDRA_CAST((font)))->Font::get_string_width_n(finishTimeText,-1); + bonusValue = Font::get_string_width_n(font,finishTimeText,-1); local_30 = 0; local_2c = 0xffff; local_28 = 0; @@ -982,7 +982,7 @@ void Leaderboard::render_daily_score_breakdown() local_24[0xf] = 0; local_8 = 1; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); - (GHIDRA_CAST((font)))->Font::DrawString(finishTimeText,color_00,&local_30,drawPos.x - fVar1,local_b0); + Font::DrawString(font,finishTimeText,color_00,&local_30,drawPos.x - fVar1,local_b0); local_8 = 0xffffffff; } } @@ -1003,19 +1003,19 @@ void Leaderboard::render_daily_score_breakdown() FUN_00858870(*GHIDRA_CAST((in_ECX + 0x3a0))); sprintf_s(local_24,0x10,&DAT_00b6e6e8); } - local_EAX_1913 = (GHIDRA_CAST((font)))->Font::get_string_width_n(local_24,-1); + local_EAX_1913 = Font::get_string_width_n(font,local_24,-1); fVar1 = local_b0 - ((float)(local_EAX_1913 >> 1) + 0.0); (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); textColor._alpha = nullFrame[9]; - (GHIDRA_CAST((fontSettings)))->FontSettings::constructor(); + FontSettings::constructor(fontSettings); local_8 = 2; - (GHIDRA_CAST((font)))->Font::DrawString(local_24,&textColor,settings,fVar1,drawPos.y); + Font::DrawString(font,local_24,&textColor,settings,fVar1,drawPos.y); local_8 = 0xffffffff; } } if ((*GHIDRA_CAST((in_ECX + 0x44)) != 0) && (timeRankFrame = - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x40)))))->AnimationState::GetNullFrame(GHIDRA_CAST("TimeRank")), + AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x40)),GHIDRA_CAST("TimeRank")), timeRankFrame != GHIDRA_CAST(0x0))) { anchorX = anchorX + *timeRankFrame; anchorY = anchorY + timeRankFrame[1]; @@ -1026,13 +1026,13 @@ void Leaderboard::render_daily_score_breakdown() FUN_00858870(*GHIDRA_CAST((in_ECX + 0x3a4))); sprintf_s(local_24,0x10,&DAT_00b6e6e8); } - local_EAX_1913 = (GHIDRA_CAST((font)))->Font::get_string_width_n(local_24,-1); + local_EAX_1913 = Font::get_string_width_n(font,local_24,-1); fVar1 = anchorX - ((float)(local_EAX_1913 >> 1) + 0.0); (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); textColor._alpha = nullFrame[9]; - (GHIDRA_CAST((fontSettings)))->FontSettings::constructor(); + FontSettings::constructor(fontSettings); local_8 = 3; - (GHIDRA_CAST((font)))->Font::DrawString(local_24,&textColor,settings_00,fVar1,anchorY); + Font::DrawString(font,local_24,&textColor,settings_00,fVar1,anchorY); } } ExceptionList = local_10; @@ -1189,127 +1189,127 @@ void Leaderboard::render_scores() } if (local_526 != 0) { prevCleanupFlags = &(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("TextGlobal")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("TextGlobal")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData), + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[1])) + 0x4))))); } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("TextFriends")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("TextFriends")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData), + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[1])) + 0x4))))); } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("TextMine")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("TextMine")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData), + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[1])) + 0x4))))); } local_52c = GHIDRA_CAST(GHIDRA_UINT((*GHIDRA_CAST(sprite) != 0))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("TextScore")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("TextScore")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } local_52c = GHIDRA_CAST(GHIDRA_UINT((*GHIDRA_CAST(sprite) != 0))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("TextTime")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("TextTime")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } bVar2 = date_is_within_week(sprite); local_52c = GHIDRA_CAST(GHIDRA_UINT((bVar2 == 0))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("LeftArrow")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("LeftArrow")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } bVar2 = date_is_after(sprite); local_52c = GHIDRA_CAST(GHIDRA_UINT((bVar2 == 0))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("RightArrow")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("RightArrow")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } local_52c = GHIDRA_CAST(GHIDRA_UINT((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x75])) + 0x4)))) < 1))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("UpArrow")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("UpArrow")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } cVar3 = FUN_00857ff0(); local_52c = GHIDRA_CAST(GHIDRA_UINT((cVar3 == '\0'))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("DownArrow")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("DownArrow")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } local_52c = GHIDRA_CAST(GHIDRA_UINT((*GHIDRA_CAST((sprite + 1)) != 0))); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("SoloScore")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("SoloScore")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } if ((*GHIDRA_CAST((sprite + 1)) == 0) || (local_548 = 1.4013e-45, *GHIDRA_CAST((sprite + 1)) != 1)) { local_548 = 0.0; } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("SoloTime")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("SoloTime")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_548)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_548)); } local_52c = GHIDRA_CAST(0x2); if (*GHIDRA_CAST((sprite + 1)) != 2) { local_52c = GHIDRA_CAST(0x0); } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("GroupScore")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("GroupScore")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_52c)); } if ((*GHIDRA_CAST((sprite + 1)) == 2) || (local_548 = 4.2039e-45, *GHIDRA_CAST((sprite + 1)) != 3)) { local_548 = 0.0; } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::GetLayer(GHIDRA_CAST("GroupTime")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("GroupTime")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_548)); + ANM2::SetLayerFrame(GHIDRA_CAST(prevCleanupFlags),*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_548)); } } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))))))->ANM2::GetLayer(GHIDRA_CAST("Character")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))),GHIDRA_CAST("Character")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData), + ANM2::SetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))),*GHIDRA_CAST(pLVar4->_layerData), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x55])) + 0x4))))); } local_52c = GHIDRA_CAST(0x7); @@ -1337,19 +1337,19 @@ void Leaderboard::render_scores() else { iVar10 = iVar10 + 6; } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))))))->ANM2::GetLayer(&DAT_00b6e4a8); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))),&DAT_00b6e4a8); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))))))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),iVar10); + ANM2::SetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))),*GHIDRA_CAST(pLVar4->_layerData),iVar10); } iVar10 = FUN_00858370(); local_526 = iVar10 != 0; local_525 = iVar10 == 0; - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))))))->ANM2::GetLayer(GHIDRA_CAST("LeftButton")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))),GHIDRA_CAST("LeftButton")); pLVar4->_visible = local_525; - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))))))->ANM2::GetLayer(GHIDRA_CAST("RightButton")); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))),GHIDRA_CAST("RightButton")); pLVar4->_visible = local_525; originX = (g_screenWidth - 480.0) * 0.5; anchorPos.y = (g_screenHeight - 270.0) * 0.5; @@ -1405,7 +1405,7 @@ void Leaderboard::render_scores() (*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x75])) + 0x2))) = 0; prevCleanupFlags = &(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x2a])) + 0x4))); if (*GHIDRA_CAST((sprite + 0x2b)) != 0) { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->AnimationState::GetNullFrame(&DAT_00b6e3ec); + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST(prevCleanupFlags),&DAT_00b6e3ec); if (nullFrame != GHIDRA_CAST(0x0)) { local_52c = GHIDRA_CAST((originX + *nullFrame + 0.0)); local_564 = GHIDRA_CAST(((originY + nullFrame[1]) - 7.0)); @@ -1429,7 +1429,7 @@ void Leaderboard::render_scores() } dateTime = CONCAT11((*GHIDRA_CAST((GHIDRA_CAST(&(dateTime)) + 0x1))),bVar2) & 0xfffc; strftime(GHIDRA_CAST(messageText),0x48,"%a, %m/%d/%Y",&tStack_4e8); - iVar10 = (GHIDRA_CAST((font)))->Font::get_string_width_n(messageText,-1); + iVar10 = Font::get_string_width_n(font,messageText,-1); drawParams = 0; local_520 = GHIDRA_CAST(0xffff); local_51c._red = 0.0; @@ -1440,13 +1440,13 @@ void Leaderboard::render_scores() fVar12 = (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * 0.5; local_14 = 0; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); - (GHIDRA_CAST((font)))->Font::DrawString(messageText,color_00,&drawParams,(float)local_52c - fVar12, + Font::DrawString(font,messageText,color_00,&drawParams,(float)local_52c - fVar12, (float)local_564); local_14 = 0xffffffff; } if (*GHIDRA_CAST((sprite + 0x2b)) != 0) { scoresLeftFrame = - (GHIDRA_CAST((GHIDRA_CAST(prevCleanupFlags))))->AnimationState::GetNullFrame(GHIDRA_CAST("ScoresLeft")); + AnimationState::GetNullFrame(GHIDRA_CAST(prevCleanupFlags),GHIDRA_CAST("ScoresLeft")); if (*GHIDRA_CAST((sprite + 0x2b)) == 0) { local_564 = GHIDRA_CAST(0x0); } @@ -1480,9 +1480,9 @@ LAB_00859cda: pbVar5 = pbVar5 + 1; } while (bVar2 != 0); text_convert_encoding(messageText,GHIDRA_INT(pbVar5) - GHIDRA_INT((messageText + 1)),0,wideText,0x200,1); - iVar10 = (GHIDRA_CAST((font)))->Font::get_string_width_utf16(wideText,-1); + iVar10 = Font::get_string_width_utf16(font,wideText,-1); fVar12 = (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * 0.5; - (GHIDRA_CAST((fontSettings)))->FontSettings::constructor(); + FontSettings::constructor(fontSettings); local_14 = 0xc; (GHIDRA_CAST((&local_51c)))->KColor::SetFromARGB(0xff362f2d); Font::draw_string_wide_unscaled @@ -1723,11 +1723,11 @@ LAB_0085a121: local_51c._alpha = 0.0; local_51c._unk = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 8; - iVar9 = (GHIDRA_CAST((font)))->Font::get_string_width_n(rankText,-1); - (GHIDRA_CAST((font)))->Font::DrawString(rankText,&rowColorRed,&drawParams, + iVar9 = Font::get_string_width_n(font,rankText,-1); + Font::DrawString(font,rankText,&rowColorRed,&drawParams, rankX - (float)((double)iVar9 + __uint_to_double_fixup[-(iVar9 >> 0x1f)]) ,rowY); - iVar9 = (GHIDRA_CAST((font)))->Font::get_string_width_utf16(&playerName,-1); + iVar9 = Font::get_string_width_utf16(font,&playerName,-1); drawParams = 0; local_520 = GHIDRA_CAST(0xffff); local_51c._red = 0.0; @@ -1745,7 +1745,7 @@ LAB_0085a121: (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 9; nameScale.y = nameScale.x; local_538 = GHIDRA_CAST(nameScale.x); - pvVar11 = (GHIDRA_CAST((font)))->Font::layout_glyphs(glyphRun,GHIDRA_CAST(&playerName),&drawParams,&nameScale); + pvVar11 = Font::layout_glyphs(font,glyphRun,GHIDRA_CAST(&playerName),&drawParams,&nameScale); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),10); color._green = rowColorRed._green; color._red = rowColorRed._red; @@ -1765,7 +1765,7 @@ LAB_0085a121: else { sprintf_s(scoreText,0x20,s__d); } - iVar9 = (GHIDRA_CAST((font)))->Font::get_string_width_n(scoreText,-1); + iVar9 = Font::get_string_width_n(font,scoreText,-1); drawParams = 0; local_520 = GHIDRA_CAST(0xffff); local_51c._red = 0.0; @@ -1774,7 +1774,7 @@ LAB_0085a121: local_51c._alpha = 0.0; local_51c._unk = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xb; - (GHIDRA_CAST((font)))->Font::DrawString(scoreText,&rowColorRed,&drawParams, + Font::DrawString(font,scoreText,&rowColorRed,&drawParams, (originX + *local_564) - (float)((double)iVar9 + __uint_to_double_fixup[-(iVar9 >> 0x1f)]),rowY); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),1); @@ -1783,7 +1783,7 @@ LAB_0085a121: if (cVar3 != '\0') { (*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x75])) + 0x2))) = 1; fVar12 = rowY - (originY + scoresLeftFrame[1] + 7.0); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))))))->ANM2::GetLayer(&DAT_00b6e4bc); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sprite[0x24])) + 0x4)))),&DAT_00b6e4bc); (pLVar4->_pos).y = fVar12; } local_14 = 0xffffffff; diff --git a/generated-src/lobby_password_prompt.cpp b/generated-src/lobby_password_prompt.cpp index 26d6d88..5c642ac 100644 --- a/generated-src/lobby_password_prompt.cpp +++ b/generated-src/lobby_password_prompt.cpp @@ -81,7 +81,7 @@ void LobbyPasswordPrompt::Update() ExceptionList = &local_10; if ((*GHIDRA_CAST((GHIDRA_CAST(this) + 0x34)) != 0) && (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x44)) != '\0')) { local_14 = uVar1; - this->ANM2::update_appear_then_idle(); + ANM2::update_appear_then_idle(this); isTriggered = FUN_00837610(uVar1); if (isTriggered != '\0') { handle_direction_input(); diff --git a/generated-src/manager.cpp b/generated-src/manager.cpp index 13b10ca..97e55ee 100644 --- a/generated-src/manager.cpp +++ b/generated-src/manager.cpp @@ -81,10 +81,10 @@ void Manager::update_ingame_input() if (0xf < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2b08))))) { anim = *GHIDRA_CAST(anim); } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2800)))))))->ANM2::Play(anim,0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2800)))),anim,0); if ((*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2909))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2830)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2850)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2830))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2850))))); } } } @@ -399,13 +399,13 @@ Manager * Manager::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x18)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x1c)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 4; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x20)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x20))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 5; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x134)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x134))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 6; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x248)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_nightmareScene))) + 0x248))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 7; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x219d0)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x219d0))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 8; container = &(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x21ae8))); *GHIDRA_CAST(container) = 0; @@ -418,7 +418,7 @@ Manager * Manager::constructor() *GHIDRA_CAST(container) = containerProxy; *containerProxy = GHIDRA_INT(container); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 9; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x21afc)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x21afc))))); pAVar2 = &this->_achievementOverlay; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 10; (pAVar2->_queue)._proxy = (void *)0x0; @@ -431,7 +431,7 @@ Manager * Manager::constructor() (pAVar2->_queue)._proxy = containerProxy; *containerProxy = GHIDRA_INT(pAVar2); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xb; - (GHIDRA_CAST((&(this->_achievementOverlay)._sprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_achievementOverlay)._sprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xc; _eh_vector_constructor_iterator_ ((this->_achievementOverlay)._entries,0x34,0x282,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00931490), @@ -487,7 +487,7 @@ Manager * Manager::constructor() (this->_optionsConfig)._optionsIniFilePath._capacity = 0xf; (pOVar3->_optionsIniFilePath)._buf[0] = '\0'; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x12; - (GHIDRA_CAST(()))->OptionsConfig::reset_defaults(); + OptionsConfig::reset_defaults(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x13; (GHIDRA_CAST((&this->_itemConfig)))->ItemConfig::constructor(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x14; @@ -574,9 +574,9 @@ Manager * Manager::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a6f0)))) = 0xf; (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a6dc))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x1f; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a6f4)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a6f4))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x20; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a808)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a808))))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a91c)))) = 0; if (DAT_00c79860 != 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4a91c)))) = 3; @@ -596,32 +596,32 @@ Manager * Manager::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4abdc)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4abe0)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x25; - (GHIDRA_CAST((&this->_buttonsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_buttonsSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x26; - (GHIDRA_CAST((&this->_platformIconsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_platformIconsSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x27; _eh_vector_constructor_iterator_ (&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4ae0c))),8,2,GHIDRA_CAST<_func_void_void_ptr *>(&LAB_0040c5b0),TexturePtr::release); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x28; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4ae20)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4ae24)))) = 0; - (GHIDRA_CAST((&this->_font1_TeamMeatEx10)))->Font::Font(); + Font::Font(&this->_font1_TeamMeatEx10); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x29; - (GHIDRA_CAST((&this->_font2_TeamMeatEx12)))->Font::Font(); + Font::Font(&this->_font2_TeamMeatEx12); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x2a; - (GHIDRA_CAST((&this->_font3_TeamMeatEx16)))->Font::Font(); + Font::Font(&this->_font3_TeamMeatEx16); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x2b; - (GHIDRA_CAST((&this->_font4_terminus)))->Font::Font(); + Font::Font(&this->_font4_terminus); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x2c; - (GHIDRA_CAST((&this->_font5_terminus8)))->Font::Font(); + Font::Font(&this->_font5_terminus8); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x2d; - (GHIDRA_CAST((&this->_font6_PFTempestaSevenCondensed)))->Font::Font(); + Font::Font(&this->_font6_PFTempestaSevenCondensed); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x2e; - (GHIDRA_CAST((&this->_font7_Upheaval)))->Font::Font(); + Font::Font(&this->_font7_Upheaval); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x2f; - (GHIDRA_CAST((&this->_font8_LuaMiniOutlined)))->Font::Font(); + Font::Font(&this->_font8_LuaMiniOutlined); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x30; - (GHIDRA_CAST((&this->_font9_PFTempestaSevenCondensedAgain)))->Font::Font(); + Font::Font(&this->_font9_PFTempestaSevenCondensedAgain); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x31; (GHIDRA_CAST((&this->_lobbySettings)))->LobbySettings::reset(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x32; @@ -636,7 +636,7 @@ Manager * Manager::constructor() (this->_dailyChallenge)._seed = 0; (this->_dailyChallenge)._specialDailyId = 0; (this->_dailyChallenge)._isPractice = 0; - (GHIDRA_CAST((&(this->_dailyChallenge)._params)))->ChallengeParam::Reset(); + ChallengeParam::Reset(&(this->_dailyChallenge)._params); (this->_lobbyMembers)._begin = (void *)0x0; (this->_lobbyMembers)._end = (void *)0x0; (this->_lobbyMembers)._capacity = (void *)0x0; @@ -646,7 +646,7 @@ Manager * Manager::constructor() (this->_pendingMenuFadeColor)._green = 0.0; (this->_pendingMenuFadeColor)._blue = 0.0; (this->_pendingMenuFadeColor)._alpha = 0.0; - (GHIDRA_CAST((&this->_cursorSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_cursorSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x36; (this->_lastMousePosition).y = 0.0; (this->_lastMousePosition).x = 0.0; @@ -695,7 +695,7 @@ void Manager::destructor() popupButtonSprite = GHIDRA_CAST(&this->_popupButtons); buttonsLeft = 2; do { - (GHIDRA_CAST((popupButtonSprite)))->ANM2::Reset(); + ANM2::Reset(popupButtonSprite); popupButtonSprite = GHIDRA_CAST((popupButtonSprite[1]._animDefaultName._buf + 4)); buttonsLeft = buttonsLeft + -1; } while (buttonsLeft != 0); @@ -703,8 +703,8 @@ void Manager::destructor() KAGE::SmartPointer::reset(extraout_ECX_00); KAGE::SmartPointer::reset(extraout_ECX_01); KAGE::SmartPointer::reset(extraout_ECX_02); - (GHIDRA_CAST((&this->_stringTable)))->StringTable::clear(); - (GHIDRA_CAST((&this->_stringTablePc)))->StringTable::clear(); + StringTable::clear(&this->_stringTable); + StringTable::clear(&this->_stringTablePc); FUN_008f5960(); if (this->_netplayManager != *GHIDRA_CAST((this + 1))) { (GHIDRA_CAST((GHIDRA_CAST(&this->_netplayManager))))->NetplayManager::reset(1); @@ -712,9 +712,9 @@ void Manager::destructor() PopupQueue::destructor(); (GHIDRA_CAST((GHIDRA_CAST(&this->_netplayManager))))->NetplayManager::~NetplayManager(); local_8 = 0; - (GHIDRA_CAST((&this->_cursorSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_cursorSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_cursorSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_cursorSprite); + AnimationState::~AnimationState(&(this->_cursorSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_cursorSprite)._animState); (GHIDRA_CAST(((this->_cursorSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_cursorSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xffffffff; @@ -729,7 +729,7 @@ void Manager::destructor() msvc::vector::_Tidy(); (GHIDRA_CAST(((this->_lobbySettings)._password._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_lobbySettings)._seed._buf)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((&this->_font9_PFTempestaSevenCondensedAgain)))->Font::Unload(); + Font::Unload(&this->_font9_PFTempestaSevenCondensedAgain); fontCharsTree = &(this->_font9_PFTempestaSevenCondensedAgain)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -737,7 +737,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font9_PFTempestaSevenCondensedAgain)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font8_LuaMiniOutlined)))->Font::Unload(); + Font::Unload(&this->_font8_LuaMiniOutlined); fontCharsTree = &(this->_font8_LuaMiniOutlined)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -745,7 +745,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font8_LuaMiniOutlined)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font7_Upheaval)))->Font::Unload(); + Font::Unload(&this->_font7_Upheaval); fontCharsTree = &(this->_font7_Upheaval)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -753,7 +753,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font7_Upheaval)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font6_PFTempestaSevenCondensed)))->Font::Unload(); + Font::Unload(&this->_font6_PFTempestaSevenCondensed); fontCharsTree = &(this->_font6_PFTempestaSevenCondensed)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -761,7 +761,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font6_PFTempestaSevenCondensed)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font5_terminus8)))->Font::Unload(); + Font::Unload(&this->_font5_terminus8); fontCharsTree = &(this->_font5_terminus8)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -769,7 +769,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font5_terminus8)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font4_terminus)))->Font::Unload(); + Font::Unload(&this->_font4_terminus); fontCharsTree = &(this->_font4_terminus)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -777,7 +777,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font4_terminus)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font3_TeamMeatEx16)))->Font::Unload(); + Font::Unload(&this->_font3_TeamMeatEx16); fontCharsTree = &(this->_font3_TeamMeatEx16)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -785,7 +785,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font3_TeamMeatEx16)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font2_TeamMeatEx12)))->Font::Unload(); + Font::Unload(&this->_font2_TeamMeatEx12); fontCharsTree = &(this->_font2_TeamMeatEx12)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -793,7 +793,7 @@ void Manager::destructor() (GHIDRA_INT((this->_font2_TeamMeatEx12)._charsBlock._head) + 4)); operator_delete(fontCharsTree->_head,0x18); FUN_004b3950(); - (GHIDRA_CAST((&this->_font1_TeamMeatEx10)))->Font::Unload(); + Font::Unload(&this->_font1_TeamMeatEx10); fontCharsTree = &(this->_font1_TeamMeatEx10)._charsBlock; FID_conflict__Erase_tree_>_> (fontCharsTree,(fuzzer_allocator_> *)fontCharsTree, @@ -803,15 +803,15 @@ void Manager::destructor() FUN_004b3950(); _eh_vector_destructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4ae0c))),8,2,TexturePtr::release); local_8 = 1; - (GHIDRA_CAST((&this->_platformIconsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_platformIconsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_platformIconsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_platformIconsSprite); + AnimationState::~AnimationState(&(this->_platformIconsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_platformIconsSprite)._animState); (GHIDRA_CAST(((this->_platformIconsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_platformIconsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 2; - (GHIDRA_CAST((&this->_buttonsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_buttonsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_buttonsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_buttonsSprite); + AnimationState::~AnimationState(&(this->_buttonsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_buttonsSprite)._animState); (GHIDRA_CAST(((this->_buttonsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_buttonsSprite))))->msvc::string::_Tidy_deallocate(); msvc::vector<260byte>::~vector(); @@ -819,7 +819,7 @@ void Manager::destructor() (this->_popupButtons)._callback = (void *)0x0; (this->_popupButtons)._callbackContext = (void *)0x0; _eh_vector_destructor_iterator_(&this->_popupButtons,0x130,2,FUN_008ba170); - (GHIDRA_CAST((&this->_stringTablePc)))->StringTable::clear(); + StringTable::clear(&this->_stringTablePc); temp_27f248e98e1 = &(*GHIDRA_CAST((GHIDRA_CAST(&((this->_stringTablePc))) + 0xc))); msvc::map::_Erase_tree (temp_27f248e98e1,*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_stringTablePc))) + 0xc)))) + 4))); @@ -830,7 +830,7 @@ void Manager::destructor() (fuzzer_allocator_> *)temp_27f248e98e1, *(_Tree_node **)(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_stringTablePc))) + 0x4)))) + 4)); operator_delete(*(void **)temp_27f248e98e1,0x18); - (GHIDRA_CAST((&this->_stringTable)))->StringTable::clear(); + StringTable::clear(&this->_stringTable); temp_27f248e98e1 = &(*GHIDRA_CAST((GHIDRA_CAST(&((this->_stringTable))) + 0xc))); msvc::map::_Erase_tree (temp_27f248e98e1,*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_stringTable))) + 0xc)))) + 4))); @@ -987,8 +987,8 @@ void Manager::load_fonts() local_1c = ExceptionList; local_24 = __security_cookie ^ GHIDRA_UINT((redirectedPathA + 0x11)); ExceptionList = &local_1c; - (GHIDRA_CAST((&this->_font9_PFTempestaSevenCondensedAgain)))->Font::Unload(); - (GHIDRA_CAST((&this->_font7_Upheaval)))->Font::Unload(); + Font::Unload(&this->_font9_PFTempestaSevenCondensedAgain); + Font::Unload(&this->_font7_Upheaval); fallbackGlyph = *GHIDRA_CAST(&g_manager->_stringTable); if (fallbackGlyph == 2) { pcVar3 = "font/MPlus_12b.fnt"; @@ -1024,7 +1024,7 @@ LAB_009519b0: if (0xf < *GHIDRA_CAST((extraout_EAX + 0x14))) { pbVar2 = *GHIDRA_CAST(extraout_EAX); } - (GHIDRA_CAST((&this->_font7_Upheaval)))->Font::Load(pbVar2,0); + Font::Load(&this->_font7_Upheaval,pbVar2,0); local_14 = (void *)((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; @@ -1072,7 +1072,7 @@ LAB_00951a98: if (0xf < *GHIDRA_CAST((extraout_EAX_00 + 0x14))) { pbVar2 = *GHIDRA_CAST(extraout_EAX_00); } - (GHIDRA_CAST((&this->_font9_PFTempestaSevenCondensedAgain)))->Font::Load(pbVar2,0); + Font::Load(&this->_font9_PFTempestaSevenCondensedAgain,pbVar2,0); local_14 = (void *)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),2); if (0xf < redirectedPathBCapacity) { freeSize = redirectedPathBCapacity + 1; @@ -1115,7 +1115,7 @@ LAB_00951b8a: if (0xf < *GHIDRA_CAST((extraout_EAX_01 + 0x14))) { pbVar2 = *GHIDRA_CAST(extraout_EAX_01); } - (GHIDRA_CAST((&this->_font1_TeamMeatEx10)))->Font::Load(pbVar2,0); + Font::Load(&this->_font1_TeamMeatEx10,pbVar2,0); local_14 = (void *)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),4); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; @@ -1158,7 +1158,7 @@ LAB_00951c7b: if (0xf < *GHIDRA_CAST((extraout_EAX_02 + 0x14))) { pbVar2 = *GHIDRA_CAST(extraout_EAX_02); } - (GHIDRA_CAST((&this->_font2_TeamMeatEx12)))->Font::Load(pbVar2,0); + Font::Load(&this->_font2_TeamMeatEx12,pbVar2,0); local_14 = (void *)CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),6); if (0xf < redirectedPathBCapacity) { freeSize = redirectedPathBCapacity + 1; @@ -1201,7 +1201,7 @@ LAB_00951d6c: if (0xf < *GHIDRA_CAST((extraout_EAX_03 + 0x14))) { pbVar2 = *GHIDRA_CAST(extraout_EAX_03); } - (GHIDRA_CAST((&this->_font3_TeamMeatEx16)))->Font::Load(pbVar2,0); + Font::Load(&this->_font3_TeamMeatEx16,pbVar2,0); if (0xf < redirectedPathACapacity) { freeSize = redirectedPathACapacity + 1; freeBlock = redirectedPathA[0]; @@ -1377,8 +1377,8 @@ void Manager::Init() savedManager = g_manager; stringTable = &g_manager->_stringTable; g_manager->_isSavingGameState = 0; - (GHIDRA_CAST((stringTable)))->StringTable::Load(GHIDRA_CAST("stringtable.sta")); - (GHIDRA_CAST((&manager->_stringTablePc)))->StringTable::Load(GHIDRA_CAST("stringtable_pc.sta")); + StringTable::Load(stringTable,GHIDRA_CAST("stringtable.sta")); + StringTable::Load(&manager->_stringTablePc,GHIDRA_CAST("stringtable_pc.sta")); validate_language(manager,unused); manager->_selectedDifficulty = 0; manager->_isWindowFocused = 1; @@ -1475,8 +1475,8 @@ void Manager::Init() } manager = savedManager; } - (GHIDRA_CAST((&manager->_optionsConfig)))->OptionsConfig::load_config_ini(); - (GHIDRA_CAST((&manager->_optionsConfig)))->OptionsConfig::Load(optionsIniPath); + OptionsConfig::load_config_ini(&manager->_optionsConfig); + OptionsConfig::Load(&manager->_optionsConfig,optionsIniPath); piVar4 = GHIDRA_CAST(SteamInternal_ContextInit(&PTR_FUN_00c5c3a4)); if ((*piVar4 == 0) || (iVar7 = extraout_ECX, (manager->_optionsConfig)._enableSteamCloud == 0)) { KAGE_LogMessage(1,(uint8_t *) @@ -1527,7 +1527,7 @@ void Manager::Init() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/cursor.anm2",0x13); local_8 = 2; - (GHIDRA_CAST((&manager->_cursorSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&manager->_cursorSprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar6 = anm2Path._capacity + 1; @@ -1545,9 +1545,9 @@ void Manager::Init() pbVar3 = (manager->_cursorSprite)._animState._animData; if (pbVar3 == GHIDRA_CAST(0x0)) { LAB_00952994: - bVar1 = (GHIDRA_CAST((&manager->_cursorSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&manager->_cursorSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(manager->_cursorSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(manager->_cursorSprite)._animState); (manager->_cursorSprite)._animState._isPlaying = 1; } } @@ -1606,7 +1606,7 @@ LAB_00952975: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/Buttons.anm2",0x14); local_8 = 3; - (GHIDRA_CAST((&manager->_buttonsSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&manager->_buttonsSprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar6 = anm2Path._capacity + 1; @@ -1632,7 +1632,7 @@ LAB_00952975: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/PlatformIcons.anm2",0x1a); local_8 = 4; - (GHIDRA_CAST((&manager->_platformIconsSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&manager->_platformIconsSprite,&anm2Path,1); local_8 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar6 = anm2Path._capacity + 1; @@ -1676,9 +1676,9 @@ LAB_00952c0a: ((pbVar3[0x34] == 0 || ((GHIDRA_CAST((GHIDRA_INT(local_230) + 0x30)))->_isPlaying != 0)))) goto LAB_00952c36; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(local_230))))->ANM2::SetAnimation(&DAT_00b7b76c,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(local_230),&DAT_00b7b76c,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(buttonsSprite) + 0x30)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(buttonsSprite) + 0x30))); (GHIDRA_CAST((GHIDRA_INT(buttonsSprite) + 0x30)))->_isPlaying = 1; } LAB_00952c36: @@ -2402,7 +2402,7 @@ LAB_00952ff1: if (0xf < *GHIDRA_CAST((extraout_EAX_19 + 0x14))) { pathBytes = *GHIDRA_CAST(extraout_EAX_19); } - (GHIDRA_CAST((&itemConfig->_font4_terminus)))->Font::Load(pathBytes,0); + Font::Load(&itemConfig->_font4_terminus,pathBytes,0); (GHIDRA_CAST((tmpPath._buf)))->msvc::string::_Tidy_deallocate(); local_14 = 0xffffffff; if (0xf < fileName._capacity) { @@ -2430,7 +2430,7 @@ LAB_00952ff1: if (0xf < *GHIDRA_CAST((extraout_EAX_20 + 0x14))) { pathBytes = *GHIDRA_CAST(extraout_EAX_20); } - (GHIDRA_CAST((&itemConfig->_font5_terminus8)))->Font::Load(pathBytes,0); + Font::Load(&itemConfig->_font5_terminus8,pathBytes,0); (GHIDRA_CAST((redirectedPath._buf)))->msvc::string::_Tidy_deallocate(); local_14 = 0xffffffff; if (0xf < fileName._capacity) { @@ -2458,7 +2458,7 @@ LAB_00952ff1: if (0xf < *GHIDRA_CAST((extraout_EAX_21 + 0x14))) { pathBytes = *GHIDRA_CAST(extraout_EAX_21); } - (GHIDRA_CAST((&itemConfig->_font6_PFTempestaSevenCondensed)))->Font::Load(pathBytes,0); + Font::Load(&itemConfig->_font6_PFTempestaSevenCondensed,pathBytes,0); (GHIDRA_CAST((tmpPath._buf)))->msvc::string::_Tidy_deallocate(); local_14 = 0xffffffff; if (0xf < fileName._capacity) { @@ -2486,7 +2486,7 @@ LAB_00952ff1: if (0xf < *GHIDRA_CAST((extraout_EAX_22 + 0x14))) { pathBytes = *GHIDRA_CAST(extraout_EAX_22); } - (GHIDRA_CAST((&itemConfig->_font8_LuaMiniOutlined)))->Font::Load(pathBytes,0); + Font::Load(&itemConfig->_font8_LuaMiniOutlined,pathBytes,0); (GHIDRA_CAST((fontPath._buf)))->msvc::string::_Tidy_deallocate(); local_14 = 0xffffffff; if (0xf < fileName._capacity) { @@ -2580,8 +2580,8 @@ void Manager::unload_configs() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_nightmareScene))) + 0x38c)))) = 0x1100000011; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_nightmareScene))) + 0x394)))) = 0x1100000011; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_nightmareScene))) + 0x39c)))) = 0x1100000011; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_nightmareScene))) + 0x248)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((manager)) + 0x219d0)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_nightmareScene))) + 0x248))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((manager)) + 0x219d0))))); ItemConfig::clear(); (GHIDRA_CAST((&manager->_itemConfig)))->ItemConfig::reset(); challengeParams = &manager->_challengeParams; @@ -2615,11 +2615,11 @@ void Manager::unload_configs() } } FUN_0069bbf0(); - (GHIDRA_CAST((&manager->_font5_terminus8)))->Font::Unload(); - (GHIDRA_CAST((&manager->_font6_PFTempestaSevenCondensed)))->Font::Unload(); - (GHIDRA_CAST((&manager->_font7_Upheaval)))->Font::Unload(); - (GHIDRA_CAST((&manager->_font8_LuaMiniOutlined)))->Font::Unload(); - (GHIDRA_CAST((&manager->_font9_PFTempestaSevenCondensedAgain)))->Font::Unload(); + Font::Unload(&manager->_font5_terminus8); + Font::Unload(&manager->_font6_PFTempestaSevenCondensed); + Font::Unload(&manager->_font7_Upheaval); + Font::Unload(&manager->_font8_LuaMiniOutlined); + Font::Unload(&manager->_font9_PFTempestaSevenCondensedAgain); load_configs(manager); return; } @@ -2908,11 +2908,11 @@ LAB_0095497c: } local_40 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_40)) + 0x1))),bVar2); if (bVar2 != (this->_optionsConfig)._isFullscreen) { - (GHIDRA_CAST((&this->_optionsConfig)))->OptionsConfig::set_fullscreen(bVar2); + OptionsConfig::set_fullscreen(&this->_optionsConfig,bVar2); } bVar2 = input_is_action_triggered(g_manager,0x10,-1,GHIDRA_CAST(0x0),0); if (bVar2 != 0) { - (GHIDRA_CAST((&this->_optionsConfig)))->OptionsConfig::set_fullscreen((this->_optionsConfig)._isFullscreen == 0); + OptionsConfig::set_fullscreen(&this->_optionsConfig,(this->_optionsConfig)._isFullscreen == 0); } LAB_009549c7: local_40 = 0x156; @@ -3331,7 +3331,7 @@ switchD_0095519c_caseD_4: if (iVar8 == 0) { anim = GHIDRA_CAST(s_Idle); } - (GHIDRA_CAST((&pMVar4->_cursorSprite)))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(&pMVar4->_cursorSprite,GHIDRA_CAST(anim),0); pvVar2 = g_glfwWindow; if (g_glfwWindow == (void *)0x0) { _wassert(L"window != NULL", @@ -3610,16 +3610,16 @@ LAB_00955727: achievementSprite = &(temp_3f5a48c29e->_achievementOverlay)._sprite; scratchVec.y = g_screenHeight * 0.5 * 1.75; scratchVec.x = g_screenWidth * 0.5 * 0.25; - overlayLayer = (GHIDRA_CAST((achievementSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST(0x3)); overlayLayer->_minFilterMode = 1; - overlayLayer = (GHIDRA_CAST((achievementSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST(0x3)); overlayLayer->_magFilterMode = 1; } else { achievementSprite = &(temp_3f5a48c29e->_achievementOverlay)._sprite; - overlayLayer = (GHIDRA_CAST((achievementSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST(0x3)); overlayLayer->_minFilterMode = 0; - overlayLayer = (GHIDRA_CAST((achievementSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + overlayLayer = ANM2::GetLayer(achievementSprite,GHIDRA_CAST(0x3)); overlayLayer->_magFilterMode = 0; } if ((temp_3f5a48c29e->_achievementOverlay)._sprite._loaded != 0) { @@ -3655,7 +3655,7 @@ LAB_00955727: scratchVec.y = (local_40 / (float)((double)iVar8 + __uint_to_double_fixup[-(iVar8 >> 0x1f)])) * (temp_3f5a48c29e->_lastMousePosition).y; scratchVec.x = cursorScaleX * (temp_3f5a48c29e->_lastMousePosition).x; - (GHIDRA_CAST((&temp_3f5a48c29e->_cursorSprite)))->ANM2::Render(&scratchVec,&g_vectorZero,&g_vectorZero); + ANM2::Render(&temp_3f5a48c29e->_cursorSprite,&scratchVec,&g_vectorZero,&g_vectorZero); iVar8 = extraout_ECX_10; } } @@ -3704,7 +3704,7 @@ LAB_00955727: if (0xf < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3f5a48c29e)) + 0x4a6f0))))) { text = *GHIDRA_CAST(text); } - (GHIDRA_CAST((&pMVar1->_font2_TeamMeatEx12)))->Font::DrawString(text,color,&local_5c,g_screenWidth * 0.5, + Font::DrawString(&pMVar1->_font2_TeamMeatEx12,text,color,&local_5c,g_screenWidth * 0.5, g_screenHeight * 0.5 + 80.0); local_14 = 0xffffffff; iVar8 = extraout_ECX_09; @@ -3972,7 +3972,7 @@ void Manager::StartNewGame(int playerType, int challenge, Seeds unk, int difficu (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; (manager->_dailyChallenge)._isPractice = 0; - (GHIDRA_CAST((&(manager->_dailyChallenge)._params)))->ChallengeParam::Reset(); + ChallengeParam::Reset(&(manager->_dailyChallenge)._params); manager->_starting = 1; manager->_networkPlay = 0; manager->_consecutiveResetCount = 0; @@ -4700,7 +4700,7 @@ void Manager::render_button_sprite(int frame, Vector position) (g_manager->_buttonsSprite)._scale.x = g_vectorOne.x; (manager->_buttonsSprite)._scale.y = fVar1; if ((manager->_buttonsSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(manager->_buttonsSprite)._animState)))->AnimationState::SetFrameFloat((float)frame); + AnimationState::SetFrameFloat(&(manager->_buttonsSprite)._animState,(float)frame); } if ((manager->_buttonsSprite)._loaded != 0) { if ((manager->_buttonsSprite)._overlayRenderFirst == 0) { diff --git a/generated-src/menu_bestiary.cpp b/generated-src/menu_bestiary.cpp index 9281c70..9f92b4f 100644 --- a/generated-src/menu_bestiary.cpp +++ b/generated-src/menu_bestiary.cpp @@ -35,7 +35,7 @@ void Menu_Bestiary::load_graphics() menuAnmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuAnmPath._buf))) + 0x0))),"gfx/ui/main menu/BestiaryMenu.anm2",0x23); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))))))->ANM2::Load(&menuAnmPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))),&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar5 = menuAnmPath._capacity + 1; @@ -77,9 +77,9 @@ LAB_008c636a: if ((uVar5 == 0) && ((animData[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1))) != '\0')))) goto LAB_008c6396; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x12])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x12])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1))) = 1; } LAB_008c6396: @@ -94,7 +94,7 @@ LAB_008c6396: deathScreenAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(deathScreenAnmPath._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5e])) + 0x2)))))))->ANM2::Load(&deathScreenAnmPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5e])) + 0x2)))),&deathScreenAnmPath,1); local_14 = 0xffffffff; if (0xf < deathScreenAnmPath._capacity) { uVar5 = deathScreenAnmPath._capacity + 1; @@ -147,9 +147,9 @@ LAB_008c648c: } } } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5e])) + 0x2)))))))->ANM2::SetAnimation(GHIDRA_CAST("Diary"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5e])) + 0x2)))),GHIDRA_CAST("Diary"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x6e])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x6e])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x75])) + 0x1))) = 1; } ExceptionList = local_1c; @@ -184,22 +184,22 @@ void Menu_Bestiary::Update() update_cursor(this); if ((g_manager->_framecount & 1) == 0) { if (*GHIDRA_CAST((this + 0x5b)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x12])) + 0x2)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x12])) + 0x2))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d])) + 0x1))))); } if (*GHIDRA_CAST((this + 0x113)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xca])) + 0x2)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xd5])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xca])) + 0x2))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xd5])) + 0x1))))); } if ((*GHIDRA_CAST((this + 0xcc)) == 0) || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0xd1])) + 0x1))) == '\0')) { - anim = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xca])) + 0x2)))))))->ANM2::GetAnimation(GHIDRA_CAST(currentAnim)); + anim = ANM2::GetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xca])) + 0x2)))),GHIDRA_CAST(currentAnim)); local_8 = (void *)0x0; if (0xf < anim->_capacity) { anim = *GHIDRA_CAST(anim->_buf); } - isAnimSet = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xba])) + 0x2)))))))->ANM2::SetAnimation(GHIDRA_CAST(anim),1); + isAnimSet = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xba])) + 0x2)))),GHIDRA_CAST(anim),1); if (isAnimSet != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xca])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xca])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0xd1])) + 0x1))) = 1; } local_8 = (void *)0xffffffff; @@ -225,10 +225,10 @@ void Menu_Bestiary::Update() } iVar1 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x119])) + 0x1)))); uVar3 = (*GHIDRA_CAST((this + 0x120)) - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x11e])) + 0x2)))) >> 2) - 1; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))))))->ANM2::GetLayer(&DAT_00000007); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))),&DAT_00000007); arrowLayer->_visible = 0 < iVar4; iVar2 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x116])) + 0x2)))); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))))))->ANM2::GetLayer(&DAT_00000008); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))),&DAT_00000008); arrowLayer->_visible = iVar2 < GHIDRA_INT((iVar1 + 1 + ((-GHIDRA_UINT((uVar3 != 0)) & uVar3) >> 2))); ExceptionList = local_10; return; @@ -585,12 +585,12 @@ LAB_008c6b3e: if (((local_150 != GHIDRA_CAST(0x0)) && (iVar2 = *GHIDRA_CAST((local_150->_achievements + 0x128)), iVar2 != 0)) && (sprite = GHIDRA_CAST((iVar2 + 0xdf0)), *GHIDRA_CAST((iVar2 + 0xef9)) != '\0')) { - (GHIDRA_CAST((sprite)))->ANM2::SetFrame(GHIDRA_CAST((iVar2 + 0xe08)), + ANM2::SetFrame(sprite,GHIDRA_CAST((iVar2 + 0xe08)), *GHIDRA_CAST((local_150->_achievements + 0x2c))); (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::SetColor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(frontAnimState[0x96])) + 0x2))))); *GHIDRA_CAST((iVar2 + 0xe8c)) = g_vectorOne.x; *GHIDRA_CAST((iVar2 + 0xe90)) = g_vectorOne.y; - (GHIDRA_CAST((sprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(sprite,&renderPos,&g_vectorZero,&g_vectorZero); LAB_008c6f19: fVar10 = 0.0; fVar12 = local_144; @@ -853,11 +853,11 @@ LAB_008c7320: (*GHIDRA_CAST((GHIDRA_CAST(&(local_1b0)) + 0x4))) = fVar8 + fVar12 + fVar10 + 21.0; if (((local_164 != GHIDRA_CAST(0x0)) && (uVar1 = local_164[0x58], uVar1 != 0)) && (sprite = GHIDRA_CAST((uVar1 + 0xdf0)), *GHIDRA_CAST((uVar1 + 0xef9)) != '\0')) { - (GHIDRA_CAST((sprite)))->ANM2::SetFrame(GHIDRA_CAST((uVar1 + 0xe08)),local_164[0x19]); + ANM2::SetFrame(sprite,GHIDRA_CAST((uVar1 + 0xe08)),local_164[0x19]); (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::SetColor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(frontAnimState[0x96])) + 0x2))))); *GHIDRA_CAST((uVar1 + 0xe8c)) = g_vectorOne.x; *GHIDRA_CAST((uVar1 + 0xe90)) = g_vectorOne.y; - (GHIDRA_CAST((sprite)))->ANM2::Render(GHIDRA_CAST((local_1b0 + 4)),&g_vectorZero,&g_vectorZero); + ANM2::Render(sprite,GHIDRA_CAST((local_1b0 + 4)),&g_vectorZero,&g_vectorZero); LAB_008c76ff: fVar10 = 0.0; fVar12 = local_148; @@ -1019,11 +1019,11 @@ LAB_008c7985: (*GHIDRA_CAST((GHIDRA_CAST(&(local_1b0)) + 0x4))) = fVar12 + 319.0; if (((pvVar5 != (void *)0xffffffe8) && (iVar2 = *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x178)), iVar2 != 0)) && (sprite = GHIDRA_CAST((iVar2 + 0xdf0)), *GHIDRA_CAST((iVar2 + 0xef9)) != '\0')) { - (GHIDRA_CAST((sprite)))->ANM2::SetFrame(GHIDRA_CAST((iVar2 + 0xe08)),*GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x7c))); + ANM2::SetFrame(sprite,GHIDRA_CAST((iVar2 + 0xe08)),*GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x7c))); (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::SetColor(GHIDRA_CAST(local_15c.y)); *GHIDRA_CAST((iVar2 + 0xe8c)) = g_vectorOne.x; *GHIDRA_CAST((iVar2 + 0xe90)) = g_vectorOne.y; - (GHIDRA_CAST((sprite)))->ANM2::Render(GHIDRA_CAST((local_1b0 + 4)),&g_vectorZero,&g_vectorZero); + ANM2::Render(sprite,GHIDRA_CAST((local_1b0 + 4)),&g_vectorZero,&g_vectorZero); } } } @@ -1050,7 +1050,7 @@ LAB_008c7985: if ((void *)0xf < local_140._capacity) { pbVar4 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_140._buf))) + 0x0))); } - uVar1 = (GHIDRA_CAST((local_194)))->Font::get_string_width_n(pbVar4,-1); + uVar1 = Font::get_string_width_n(local_194,pbVar4,-1); fontSettings = 1; local_184 = 0xffff; local_180 = 0; @@ -1070,7 +1070,7 @@ LAB_008c7985: local_1c4._alpha = 1.0; local_144 = local_144 + 360.0; local_1c4._unk = 0; - (GHIDRA_CAST((pFVar7)))->Font::DrawString(pbVar4,&local_1c4,&fontSettings,local_144,(float)local_14c + 160.0); + Font::DrawString(pFVar7,pbVar4,&local_1c4,&fontSettings,local_144,(float)local_14c + 160.0); } else { fVar12 = 200.0 / (float)((double)GHIDRA_INT(uVar1) + __uint_to_double_fixup[-(GHIDRA_INT(uVar1) >> 0x1f)]); @@ -1091,7 +1091,7 @@ LAB_008c7985: pos.x = local_144; scale.y = fVar12; scale.x = fVar12; - (GHIDRA_CAST((pFVar7)))->Font::DrawString(pbVar4,pos,scale,&local_1c4,GHIDRA_CAST(&fontSettings)); + Font::DrawString(pFVar7,pbVar4,pos,scale,&local_1c4,GHIDRA_CAST(&fontSettings)); } (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; local_1b0 = (uint8_t [8])(double)*GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x68)); @@ -1164,7 +1164,7 @@ LAB_008c7985: local_1c4._unk = 0; pos_00.y = (float)local_14c + 200.0; pos_00.x = local_144; - (GHIDRA_CAST((pFVar7)))->Font::DrawString(textBuffer,pos_00,(Vector)0x3f0000003f000000,&local_1c4, + Font::DrawString(pFVar7,textBuffer,pos_00,(Vector)0x3f0000003f000000,&local_1c4, GHIDRA_CAST(&fontSettings)); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#BESTIARY_KILLS")); @@ -1184,7 +1184,7 @@ LAB_008c7985: local_1c4._unk = 0; pos_01.y = (float)local_14c + 210.0; pos_01.x = local_144; - (GHIDRA_CAST((pFVar7)))->Font::DrawString(textBuffer,pos_01,(Vector)0x3f0000003f000000,&local_1c4, + Font::DrawString(pFVar7,textBuffer,pos_01,(Vector)0x3f0000003f000000,&local_1c4, GHIDRA_CAST(&fontSettings)); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#BESTIARY_ENCOUNTERS")); @@ -1204,7 +1204,7 @@ LAB_008c7985: local_1c4._alpha = 1.0; pos_02.y = (float)local_14c + 220.0; pos_02.x = local_144; - (GHIDRA_CAST((pFVar7)))->Font::DrawString(textBuffer,pos_02,(Vector)0x3f0000003f000000,&local_1c4, + Font::DrawString(pFVar7,textBuffer,pos_02,(Vector)0x3f0000003f000000,&local_1c4, GHIDRA_CAST(&fontSettings)); (GHIDRA_CAST((local_140._buf)))->msvc::string::_Tidy_deallocate(); ExceptionList = local_1c; @@ -1275,7 +1275,7 @@ LAB_008c7c0b: local_1c4._blue = 0.2; local_1c4._alpha = 1.0; pbVar4 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#BESTIARY_UNKNOWN")); - (GHIDRA_CAST((local_194)))->Font::DrawString(pbVar4,&local_1c4,&fontSettings,local_144 + 360.0,(float)local_14c); + Font::DrawString(local_194,pbVar4,&local_1c4,&fontSettings,local_144 + 360.0,(float)local_14c); ExceptionList = local_1c; return; } @@ -1570,7 +1570,7 @@ void Menu_Bestiary::LoadPreview() local_90 = GHIDRA_CAST(0x0); previewSprite = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xba])) + 0x2)))); menu = this; - (GHIDRA_CAST((previewSprite)))->ANM2::Reset(); + ANM2::Reset(previewSprite); entityConfig = &g_manager->_entityConfig; iVar2 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x116])) + 0x2)))); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x119])) + 0x1)))) < iVar2) { @@ -1605,11 +1605,11 @@ LAB_008c8d25: if (*GHIDRA_CAST((GHIDRA_CAST(entityEntry) + 0x120)) == 0) { iVar2 = 0x8c; } - (GHIDRA_CAST((previewSprite)))->ANM2::Load(GHIDRA_CAST((iVar2 + GHIDRA_INT(entityEntry))),0); + ANM2::Load(previewSprite,GHIDRA_CAST((iVar2 + GHIDRA_INT(entityEntry))),0); if ((*GHIDRA_CAST((GHIDRA_CAST(entityEntry) + 0x168)) != 0) && (pbVar10 = GHIDRA_CAST(0x0), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(menu[0xe5])) + 0x1)))) != 0)) { do { - pLVar3 = (GHIDRA_CAST((previewSprite)))->ANM2::GetLayer(pbVar10); + pLVar3 = ANM2::GetLayer(previewSprite,pbVar10); local_3c._capacity = 0xf; local_3c._size = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_3c._buf)) + 0x0))) = GHIDRA_CAST(0x0); @@ -1670,7 +1670,7 @@ LAB_008c8d25: ) && (*GHIDRA_CAST((GHIDRA_CAST(entityEntry) + 0x1c)) == 1)) && (layerIdx = GHIDRA_CAST(0x0), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(menu[0xe5])) + 0x1)))) != 0)) { do { - pLVar3 = (GHIDRA_CAST((previewSprite)))->ANM2::GetLayer(layerIdx); + pLVar3 = ANM2::GetLayer(previewSprite,layerIdx); cleanupFlags = GHIDRA_CAST((GHIDRA_UINT(cleanupFlags) | 8)); if (pLVar3->_layerData == (void *)0x0) { local_3c._capacity = 0xf; @@ -1755,7 +1755,7 @@ LAB_008c9015: local_80 = GHIDRA_CAST(0x0); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(menu[0xe5])) + 0x1)))) != 0) { do { - pLVar3 = (GHIDRA_CAST((previewSprite)))->ANM2::GetLayer(GHIDRA_CAST(local_80)); + pLVar3 = ANM2::GetLayer(previewSprite,GHIDRA_CAST(local_80)); cleanupFlags = GHIDRA_CAST((GHIDRA_UINT(cleanupFlags) | 0x10)); local_78 = pLVar3; if (pLVar3->_layerData == (void *)0x0) { @@ -1858,7 +1858,7 @@ LAB_008c9312: uVar4 = 0; } *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(menu[0x115])) + 0x1)))) = uVar4; - (GHIDRA_CAST((previewSprite)))->ANM2::LoadGraphics((uint8_t)menu); + ANM2::LoadGraphics(previewSprite,(uint8_t)menu); pAVar11 = previewSprite; local_78 = GHIDRA_CAST((GHIDRA_INT(entityEntry) + 0x128)); if (0xf < *GHIDRA_CAST((GHIDRA_CAST(entityEntry) + 0x13c))) { @@ -1867,9 +1867,9 @@ LAB_008c9312: pbVar10 = (pAVar12->_animState)._animData; if (pbVar10 == GHIDRA_CAST(0x0)) { LAB_008c9339: - bVar1 = (GHIDRA_CAST((previewSprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_78),1); + bVar1 = ANM2::SetAnimation(previewSprite,GHIDRA_CAST(local_78),1); if (bVar1 != 0) { - (GHIDRA_CAST((&pAVar11->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&pAVar11->_animState); (pAVar11->_animState)._isPlaying = 1; pAVar11 = previewSprite; } @@ -1934,10 +1934,10 @@ LAB_008c93b5: ((pbVar10[0x34] == 0 || ((previewSprite->_overlayAnimState)._isPlaying != 0)))) goto LAB_008c93f3; } - bVar1 = (GHIDRA_CAST((previewSprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST(local_78),1); + bVar1 = ANM2::SetOverlayAnimation(previewSprite,GHIDRA_CAST(local_78),1); pAVar11 = previewSprite; if (bVar1 != 0) { - (GHIDRA_CAST((&previewSprite->_overlayAnimState)))->AnimationState::Rewind(); + AnimationState::Rewind(&previewSprite->_overlayAnimState); (pAVar11->_overlayAnimState)._isPlaying = 1; pAVar12 = pAVar11; } @@ -1946,7 +1946,7 @@ LAB_008c93f3: fVar14 = *GHIDRA_CAST((GHIDRA_CAST(entityEntry) + 0x10c)) * g_vectorOne.y; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(menu[0xee])) + 0x2)))) = *GHIDRA_CAST((GHIDRA_CAST(entityEntry) + 0x10c)) * g_vectorOne.x; *GHIDRA_CAST((menu + 0xf0)) = fVar14; - pLVar3 = (GHIDRA_CAST((pAVar12)))->ANM2::GetLayer(GHIDRA_CAST("shadow")); + pLVar3 = ANM2::GetLayer(pAVar12,GHIDRA_CAST("shadow")); if (pLVar3 != GHIDRA_CAST(0x0)) { pLVar3->_visible = 0; } diff --git a/generated-src/menu_challenge.cpp b/generated-src/menu_challenge.cpp index 69bf047..6be1f51 100644 --- a/generated-src/menu_challenge.cpp +++ b/generated-src/menu_challenge.cpp @@ -54,9 +54,9 @@ void Menu_Challenge::render_seed_text() ExceptionList = &local_1c; if (*GHIDRA_CAST((in_ECX + 0x34)) != 0) { menu = in_ECX; - pvVar4 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x30)))))->AnimationState::GetNullFrame(&DAT_00b75670); + pvVar4 = AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x30)),&DAT_00b75670); if (((pvVar4 == (void *)0x0) || (*GHIDRA_CAST((in_ECX + 0x4a8)) == 0)) || - (pvVar4 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x4a4)))))->AnimationState::GetNullFrame(GHIDRA_CAST("SeedPos")), + (pvVar4 = AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x4a4)),GHIDRA_CAST("SeedPos")), pvVar4 == (void *)0x0)) goto LAB_008cddc4; local_58 = GHIDRA_CAST(((g_menuManager->_ViewPosition).x + *GHIDRA_CAST((in_ECX + 0x7dc)))); local_5c = GHIDRA_CAST(((g_menuManager->_ViewPosition).y + *GHIDRA_CAST((in_ECX + 0x7e0)))); @@ -64,7 +64,7 @@ void Menu_Challenge::render_seed_text() nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x30)))))->AnimationState::GetNullFrame(&DAT_00b75670); + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x30)),&DAT_00b75670); } local_58 = GHIDRA_CAST(((float)local_58 + *nullFrame)); local_5c = GHIDRA_CAST(((float)local_5c + nullFrame[1])); @@ -72,7 +72,7 @@ void Menu_Challenge::render_seed_text() nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x4a4)))))->AnimationState::GetNullFrame(GHIDRA_CAST("SeedPos")) + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x4a4)),GHIDRA_CAST("SeedPos")) ; } textPos.x = (float)local_58 + *nullFrame + 0.0; @@ -358,9 +358,9 @@ void Menu_Challenge::destructor() } } local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x14)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 100)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x44)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x14))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 100))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x44))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x2c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x14)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -424,9 +424,9 @@ void Menu_Challenge::Update() stackCookie = __security_cookie ^ GHIDRA_UINT((seedText + 10)); ExceptionList = &local_10; if (((g_manager->_framecount & 1) == 0) && (*GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x11d)) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x11)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x11))); in_stack_ffffffb0 = 0x945ea5; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x19)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x19))); } menuManager = g_menuManager; if (g_menuManager->_fadeOutActive == 0) { @@ -652,16 +652,16 @@ void Menu_Challenge::Render() isLayerVisible = 0; } challengeSprite = &this->ChallengeMenuSprite; - layer = (GHIDRA_CAST((challengeSprite)))->ANM2::GetLayer(GHIDRA_CAST("CustomTab")); + layer = ANM2::GetLayer(challengeSprite,GHIDRA_CAST("CustomTab")); pAVar4 = &this->ChallengeMenuSprite; layer->_visible = isLayerVisible; - layer = (GHIDRA_CAST((pAVar4)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(pAVar4,GHIDRA_CAST(0x2)); layer->_visible = 0; - layer = (GHIDRA_CAST((pAVar4)))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(pAVar4,&DAT_0000000e); layer->_visible = 0; - layer = (GHIDRA_CAST((pAVar4)))->ANM2::GetLayer(&DAT_0000000f); + layer = ANM2::GetLayer(pAVar4,&DAT_0000000f); layer->_visible = 0; - layer = (GHIDRA_CAST((pAVar4)))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(pAVar4,&DAT_0000000d); layer->_visible = 0; menuPos.x = (g_menuManager->_ViewPosition).x + this->PositionX; menuPos.y = (g_menuManager->_ViewPosition).y + this->PositionY; @@ -679,7 +679,7 @@ void Menu_Challenge::Render() } AnimationState::Render(secondAnimState,&menuPos,&g_vectorZero,&g_vectorZero); } - layer = (GHIDRA_CAST((&this->ChallengeMenuSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(&this->ChallengeMenuSprite,GHIDRA_CAST(0x2)); layer->_visible = 1; challengeIndex = 1; do { @@ -756,15 +756,15 @@ LAB_00946450: } } } - layer = (GHIDRA_CAST((&this->ChallengeMenuSprite)))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(&this->ChallengeMenuSprite,&DAT_0000000e); layer->_visible = isLayerVisible; isChallengeDone = *GHIDRA_CAST((GHIDRA_INT((g_manager->_persistentGameData)._cutsceneCounters) + (challengeIndex - 0x31) )); - layer = (GHIDRA_CAST((&this->ChallengeMenuSprite)))->ANM2::GetLayer(&DAT_0000000f); + layer = ANM2::GetLayer(&this->ChallengeMenuSprite,&DAT_0000000f); isLayerVisible = isLayerVisible ^ 1; layer->_visible = isChallengeDone; - layer = (GHIDRA_CAST((&this->ChallengeMenuSprite)))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(&this->ChallengeMenuSprite,&DAT_0000000d); layer->_visible = isLayerVisible; if ((this->ChallengeMenuSprite)._loaded != 0) { if ((this->ChallengeMenuSprite)._overlayRenderFirst == 0) { @@ -975,9 +975,9 @@ LAB_00946a99: ,scale); } isLayerVisible = iVar3 != 0x15; - layer = (GHIDRA_CAST((challengeSprite)))->ANM2::GetLayer(GHIDRA_CAST("CustomPaper")); + layer = ANM2::GetLayer(challengeSprite,GHIDRA_CAST("CustomPaper")); layer->_visible = isLayerVisible; - layer = (GHIDRA_CAST((challengeSprite)))->ANM2::GetLayer(GHIDRA_CAST("CustomText")); + layer = ANM2::GetLayer(challengeSprite,GHIDRA_CAST("CustomText")); layer->_visible = isLayerVisible; return; } @@ -1033,9 +1033,9 @@ LAB_00946be9: ((animData[0x34] == 0 || ((this->ChallengeMenuSprite)._animState._isPlaying != 0)))) goto LAB_00946c23; } - bVar1 = (GHIDRA_CAST((&this->ChallengeMenuSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->ChallengeMenuSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->ChallengeMenuSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->ChallengeMenuSprite)._animState); (this->ChallengeMenuSprite)._animState._isPlaying = 1; } LAB_00946c23: diff --git a/generated-src/menu_character.cpp b/generated-src/menu_character.cpp index 902416f..148af7c 100644 --- a/generated-src/menu_character.cpp +++ b/generated-src/menu_character.cpp @@ -141,29 +141,29 @@ Menu_Character * Menu_Character::constructor() ExceptionList = &local_10; this->_PositionY = 0.0; this->_PositionX = 0.0; - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_BigCharPageSprite); local_8 = 0; - (GHIDRA_CAST((&this->_DifficultyOverlaySprite)))->ANM2::constructor(); + ANM2::constructor(&this->_DifficultyOverlaySprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 1; - (GHIDRA_CAST((&this->_GreedDecoOverlaySprite)))->ANM2::constructor(); + ANM2::constructor(&this->_GreedDecoOverlaySprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; - (GHIDRA_CAST((&this->_CharacterMenuBGSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_CharacterMenuBGSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 3; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x494)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x494))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 4; - (GHIDRA_CAST((&this->_DifficultyPageSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_DifficultyPageSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 5; - (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_SeedPageSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 6; - (GHIDRA_CAST((&this->_WinStreakPageSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_WinStreakPageSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 7; - (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_EastereggPageSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 8; (this->_eastereggPagePosition).y = 0.0; (this->_eastereggPagePosition).x = 0.0; - (GHIDRA_CAST((&this->_SeedUnlockPageSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_SeedUnlockPageSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 9; - (GHIDRA_CAST((&this->_CharacterPortraitsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_CharacterPortraitsSprite); (this->_portraitPositions)._begin = (void *)0x0; (this->_portraitPositions)._end = (void *)0x0; (this->_portraitPositions)._capacity = (void *)0x0; @@ -171,7 +171,7 @@ Menu_Character * Menu_Character::constructor() (this->_portraitScales)._end = (void *)0x0; (this->_portraitScales)._capacity = (void *)0x0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xc; - (GHIDRA_CAST((&this->_SeedEntrySprite)))->ANM2::constructor(); + ANM2::constructor(&this->_SeedEntrySprite); (this->_seedText)._buf[0] = '\0'; (this->_seedText)._buf[1] = '\0'; (this->_seedText)._buf[2] = '\0'; @@ -188,9 +188,9 @@ Menu_Character * Menu_Character::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdb0)))) = 0xf; (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd9c))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x10; - (GHIDRA_CAST((&this->_PageSwapWidgetSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_PageSwapWidgetSprite); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),0x11); - (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_TaintedMenuBGDecoSprite); this[1].Status = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))) = 0; ExceptionList = local_10; @@ -217,92 +217,92 @@ void Menu_Character::destructor() } } local_8 = 1; - (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_TaintedMenuBGDecoSprite); + AnimationState::~AnimationState(&(this->_TaintedMenuBGDecoSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_TaintedMenuBGDecoSprite)._animState); (GHIDRA_CAST(((this->_TaintedMenuBGDecoSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_TaintedMenuBGDecoSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 2; - (GHIDRA_CAST((&this->_PageSwapWidgetSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_PageSwapWidgetSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_PageSwapWidgetSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_PageSwapWidgetSprite); + AnimationState::~AnimationState(&(this->_PageSwapWidgetSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_PageSwapWidgetSprite)._animState); (GHIDRA_CAST(((this->_PageSwapWidgetSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_PageSwapWidgetSprite))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd9c))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd84))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST(((this->_seedText)._buf)))->msvc::string::_Tidy_deallocate(); local_8 = 3; - (GHIDRA_CAST((&this->_SeedEntrySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_SeedEntrySprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_SeedEntrySprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_SeedEntrySprite); + AnimationState::~AnimationState(&(this->_SeedEntrySprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_SeedEntrySprite)._animState); (GHIDRA_CAST(((this->_SeedEntrySprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_SeedEntrySprite))))->msvc::string::_Tidy_deallocate(); FID_conflict__Tidy(&this->_portraitScales); msvc::vector::_Tidy(); local_8 = 4; - (GHIDRA_CAST((&this->_CharacterPortraitsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_CharacterPortraitsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_CharacterPortraitsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_CharacterPortraitsSprite); + AnimationState::~AnimationState(&(this->_CharacterPortraitsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_CharacterPortraitsSprite)._animState); (GHIDRA_CAST(((this->_CharacterPortraitsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_CharacterPortraitsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 5; - (GHIDRA_CAST((&this->_SeedUnlockPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_SeedUnlockPageSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_SeedUnlockPageSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_SeedUnlockPageSprite); + AnimationState::~AnimationState(&(this->_SeedUnlockPageSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_SeedUnlockPageSprite)._animState); (GHIDRA_CAST(((this->_SeedUnlockPageSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_SeedUnlockPageSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 6; - (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_EastereggPageSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_EastereggPageSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_EastereggPageSprite); + AnimationState::~AnimationState(&(this->_EastereggPageSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_EastereggPageSprite)._animState); (GHIDRA_CAST(((this->_EastereggPageSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_EastereggPageSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 7; - (GHIDRA_CAST((&this->_WinStreakPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_WinStreakPageSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_WinStreakPageSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_WinStreakPageSprite); + AnimationState::~AnimationState(&(this->_WinStreakPageSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_WinStreakPageSprite)._animState); (GHIDRA_CAST(((this->_WinStreakPageSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_WinStreakPageSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 8; - (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_SeedPageSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_SeedPageSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_SeedPageSprite); + AnimationState::~AnimationState(&(this->_SeedPageSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_SeedPageSprite)._animState); (GHIDRA_CAST(((this->_SeedPageSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_SeedPageSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 9; - (GHIDRA_CAST((&this->_DifficultyPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_DifficultyPageSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_DifficultyPageSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_DifficultyPageSprite); + AnimationState::~AnimationState(&(this->_DifficultyPageSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_DifficultyPageSprite)._animState); (GHIDRA_CAST(((this->_DifficultyPageSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_DifficultyPageSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 10; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x494)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4e4)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4c4)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x494))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4e4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4c4))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4ac))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x494))))))->msvc::string::_Tidy_deallocate(); local_8 = 0xb; - (GHIDRA_CAST((&this->_CharacterMenuBGSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_CharacterMenuBGSprite); + AnimationState::~AnimationState(&(this->_CharacterMenuBGSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_CharacterMenuBGSprite)._animState); (GHIDRA_CAST(((this->_CharacterMenuBGSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_CharacterMenuBGSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xc; - (GHIDRA_CAST((&this->_GreedDecoOverlaySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_GreedDecoOverlaySprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_GreedDecoOverlaySprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_GreedDecoOverlaySprite); + AnimationState::~AnimationState(&(this->_GreedDecoOverlaySprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_GreedDecoOverlaySprite)._animState); (GHIDRA_CAST(((this->_GreedDecoOverlaySprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_GreedDecoOverlaySprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xd; - (GHIDRA_CAST((&this->_DifficultyOverlaySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_DifficultyOverlaySprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_DifficultyOverlaySprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_DifficultyOverlaySprite); + AnimationState::~AnimationState(&(this->_DifficultyOverlaySprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_DifficultyOverlaySprite)._animState); (GHIDRA_CAST(((this->_DifficultyOverlaySprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_DifficultyOverlaySprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xe; - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_BigCharPageSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_BigCharPageSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_BigCharPageSprite); + AnimationState::~AnimationState(&(this->_BigCharPageSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_BigCharPageSprite)._animState); (GHIDRA_CAST(((this->_BigCharPageSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_BigCharPageSprite))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -354,7 +354,7 @@ void Menu_Character::LoadGraphics() ((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))))->_capacity = 0x74636172; builtin_strncpy((GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) + 0x18)))->_buf,"erMenuBG.anm2",0xe); local_14 = 0; - (GHIDRA_CAST((sprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(sprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -371,10 +371,10 @@ void Menu_Character::LoadGraphics() } textureRefCount = (void *)0x3; pvVar6 = (void *)0x948303; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x3)); (GHIDRA_CAST((auStackY_f8 + 0x84)))->KAGE::SmartPointer::operator_assign(this + 1); - (GHIDRA_CAST((layer)))->LayerState::SetTexture(pvVar6,textureRefCount); - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + LayerState::SetTexture(layer,pvVar6,textureRefCount); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x3)); if (layer->_layerData == (void *)0x0) { anmPath._capacity = 0xf; anmPath._size = 0; @@ -406,9 +406,9 @@ void Menu_Character::LoadGraphics() expectedName = (this->_CharacterMenuBGSprite)._animState._animData; if (expectedName == GHIDRA_CAST(0x0)) { LAB_009483f9: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(sprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._animState); (this->_CharacterMenuBGSprite)._animState._isPlaying = 1; } } @@ -450,7 +450,7 @@ LAB_009483eb: anmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/ui/main menu/PageSwapWidget.anm2",0x25); local_14 = 2; - (GHIDRA_CAST((&this->_PageSwapWidgetSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_PageSwapWidgetSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -468,9 +468,9 @@ LAB_009483eb: expectedName = (this->_PageSwapWidgetSprite)._animState._animData; if (expectedName == GHIDRA_CAST(0x0)) { LAB_00948513: - bVar1 = (GHIDRA_CAST((&this->_PageSwapWidgetSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_PageSwapWidgetSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_PageSwapWidgetSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_PageSwapWidgetSprite)._animState); (this->_PageSwapWidgetSprite)._animState._isPlaying = 1; } } @@ -512,7 +512,7 @@ LAB_00948505: anmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/ui/main menu/CharacterMenuBGExtra.anm2",0x2b); local_14 = 3; - (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_TaintedMenuBGDecoSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -533,9 +533,9 @@ LAB_00948505: (*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) & 0xffffff00; if (expectedName == GHIDRA_CAST(0x0)) { LAB_00948653: - bVar1 = (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } } @@ -572,9 +572,9 @@ LAB_00948645: else { pcVar7 = "Appear"; } - bVar1 = (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar7),1); + bVar1 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,GHIDRA_CAST(pcVar7),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } if ((this->_TaintedMenuBGDecoSprite)._animState._animData != (void *)0x0) { @@ -593,7 +593,7 @@ LAB_00948645: } while (bVar1 != 0); (GHIDRA_CAST((anmPath._buf)))->msvc::string::assign(expectedName,GHIDRA_INT(nameCursor) - GHIDRA_INT((expectedName + 1))); local_14 = 4; - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_BigCharPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -609,7 +609,8 @@ LAB_00948645: operator_delete(pvVar6,uVar3); } if (GHIDRA_UINT(this->SelectedCharacterID) < 0x12) { - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::Play((&PTR_s_00_Random_00b24140) + ANM2::Play(&this->_BigCharPageSprite, + (&PTR_s_00_Random_00b24140) [(this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 6],0); } UpdateRotations(this); @@ -625,7 +626,7 @@ LAB_00948645: } while (bVar1 != 0); (GHIDRA_CAST((anmPath._buf)))->msvc::string::assign(expectedName,GHIDRA_INT(nameCursor) - GHIDRA_INT((expectedName + 1))); local_14 = 5; - (GHIDRA_CAST((sprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(sprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -643,9 +644,9 @@ LAB_00948645: expectedName = (this->_DifficultyOverlaySprite)._animState._animData; if (expectedName == GHIDRA_CAST(0x0)) { LAB_00948883: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("BloodStain"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("BloodStain"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_DifficultyOverlaySprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_DifficultyOverlaySprite)._animState); (this->_DifficultyOverlaySprite)._animState._isPlaying = 1; } } @@ -679,7 +680,7 @@ LAB_00948875: expectedName = GHIDRA_CAST(0x0); if ((this->_DifficultyOverlaySprite)._layerCount != 0) { do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(expectedName); + layer = ANM2::GetLayer(sprite,expectedName); expectedName = expectedName + 1; layer->_blendMode[0] = DAT_00c35e78; layer->_blendMode[1] = DAT_00c35e7c; @@ -699,7 +700,7 @@ LAB_00948875: anmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/ui/main menu/CharacterMenu.anm2",0x24); local_14 = 6; - (GHIDRA_CAST((&this->_GreedDecoOverlaySprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_GreedDecoOverlaySprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -717,9 +718,9 @@ LAB_00948875: expectedName = (this->_GreedDecoOverlaySprite)._animState._animData; if (expectedName == GHIDRA_CAST(0x0)) { LAB_00948a03: - bVar1 = (GHIDRA_CAST((&this->_GreedDecoOverlaySprite)))->ANM2::SetAnimation(GHIDRA_CAST("Greed"),1); + bVar1 = ANM2::SetAnimation(&this->_GreedDecoOverlaySprite,GHIDRA_CAST("Greed"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_GreedDecoOverlaySprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_GreedDecoOverlaySprite)._animState); (this->_GreedDecoOverlaySprite)._animState._isPlaying = 1; } } @@ -761,7 +762,7 @@ LAB_009489f5: } while (bVar1 != 0); (GHIDRA_CAST((anmPath._buf)))->msvc::string::assign(expectedName,GHIDRA_INT(nameCursor) - GHIDRA_INT((expectedName + 1))); local_14 = 7; - (GHIDRA_CAST((&this->_CharacterPortraitsSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_CharacterPortraitsSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -779,9 +780,9 @@ LAB_009489f5: expectedName = (this->_CharacterPortraitsSprite)._animState._animData; if (expectedName == GHIDRA_CAST(0x0)) { LAB_00948b05: - bVar1 = (GHIDRA_CAST((&this->_CharacterPortraitsSprite)))->ANM2::SetAnimation(&DAT_00b7bbf0,1); + bVar1 = ANM2::SetAnimation(&this->_CharacterPortraitsSprite,&DAT_00b7bbf0,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_CharacterPortraitsSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_CharacterPortraitsSprite)._animState); (this->_CharacterPortraitsSprite)._animState._isPlaying = 1; } } @@ -823,7 +824,7 @@ LAB_00948af7: anmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/ui/main menu/SeedEntry.anm2",0x20); local_14 = 8; - (GHIDRA_CAST((&this->_SeedEntrySprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_SeedEntrySprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -866,9 +867,9 @@ LAB_00948c25: ((expectedName[0x34] == 0 || ((this->_SeedEntrySprite)._animState._isPlaying != 0)))) goto LAB_00948c51; } - bVar1 = (GHIDRA_CAST((&this->_SeedEntrySprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_SeedEntrySprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_SeedEntrySprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_SeedEntrySprite)._animState); (this->_SeedEntrySprite)._animState._isPlaying = 1; } LAB_00948c51: @@ -883,7 +884,7 @@ LAB_00948c51: anmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/ui/main menu/DifficultyWidget.anm2",0x27); local_14 = 9; - (GHIDRA_CAST((&this->_DifficultyPageSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_DifficultyPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -913,13 +914,13 @@ LAB_00948c51: if (bVar5) { pcVar7 = &DAT_00b7bdc8; } - (GHIDRA_CAST((&this->_DifficultyPageSprite)))->ANM2::Play(GHIDRA_CAST(pcVar7),0); + ANM2::Play(&this->_DifficultyPageSprite,GHIDRA_CAST(pcVar7),0); anmPath._size = 0; anmPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anmPath._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/SeedWidget.anm2"),0x20); local_14 = 10; - (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_SeedPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -934,13 +935,13 @@ LAB_00948c51: } operator_delete(pvVar6,uVar3); } - (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_SeedPageSprite,s_Idle,0); anmPath._size = 0; anmPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anmPath._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/WinStreakWidget.anm2"),0x25); local_14 = 0xb; - (GHIDRA_CAST((&this->_WinStreakPageSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_WinStreakPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -955,13 +956,13 @@ LAB_00948c51: } operator_delete(pvVar6,uVar3); } - (GHIDRA_CAST((&this->_WinStreakPageSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_WinStreakPageSprite,s_Idle,0); anmPath._size = 0; anmPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(anmPath._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anmPath._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/SeedSelectionWidget.anm2"),0x29); local_14 = 0xc; - (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_EastereggPageSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -976,13 +977,13 @@ LAB_00948c51: } operator_delete(pvVar6,uVar3); } - (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::Play(&DAT_00b7bd88,0); + ANM2::Play(&this->_EastereggPageSprite,&DAT_00b7bd88,0); seedUnlockPath._size = 0; seedUnlockPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(seedUnlockPath._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((seedUnlockPath._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/SeedUnlockPaper.anm2"),0x25); local_14 = 0xd; - (GHIDRA_CAST((&this->_SeedUnlockPageSprite)))->ANM2::Load(&seedUnlockPath,1); + ANM2::Load(&this->_SeedUnlockPageSprite,&seedUnlockPath,1); if (0xf < seedUnlockPath._capacity) { uVar3 = seedUnlockPath._capacity + 1; pvVar6 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)seedUnlockPath._buf)) + 0x0))); @@ -1116,10 +1117,10 @@ LAB_009490c7: } pcVar4 = &DAT_00b7bdc8; } - bVar1 = (GHIDRA_CAST((&this->_DifficultyPageSprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar4),1); + bVar1 = ANM2::SetAnimation(&this->_DifficultyPageSprite,GHIDRA_CAST(pcVar4),1); pcVar4 = GHIDRA_CAST(extraout_ECX); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_DifficultyPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_DifficultyPageSprite)._animState); (this->_DifficultyPageSprite)._animState._isPlaying = 1; pcVar4 = GHIDRA_CAST(extraout_ECX_00); } @@ -1290,9 +1291,9 @@ LAB_00949100: else { pcVar4 = "Appear"; } - bVar1 = (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar4),1); + bVar1 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,GHIDRA_CAST(pcVar4),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } if ((this->_TaintedMenuBGDecoSprite)._animState._animData != (void *)0x0) { @@ -1361,7 +1362,7 @@ void Menu_Character::set_character_menu_shown(int characterMenuShown) } while (bVar1 != 0); (GHIDRA_CAST((local_30._buf)))->msvc::string::assign(pbVar4,GHIDRA_INT(strCursor) - GHIDRA_INT((pbVar4 + 1))); local_8 = 0; - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::Load(&local_30,1); + ANM2::Load(&this->_BigCharPageSprite,&local_30,1); local_8 = 0xffffffff; if (0xf < local_30._capacity) { uVar3 = local_30._capacity + 1; @@ -1377,7 +1378,8 @@ void Menu_Character::set_character_menu_shown(int characterMenuShown) operator_delete(freeBlock,uVar3); } if (GHIDRA_UINT(this->SelectedCharacterID) < 0x12) { - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::Play((&PTR_s_00_Random_00b24140) + ANM2::Play(&this->_BigCharPageSprite, + (&PTR_s_00_Random_00b24140) [(this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 6],0); } else { @@ -1409,9 +1411,9 @@ LAB_0094971a: ((pbVar4[0x34] == 0 || ((this->_BigCharPageSprite)._animState._isPlaying != 0)))) goto LAB_0094974d; } - bVar1 = (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::SetAnimation(&DAT_00b7bbf0,1); + bVar1 = ANM2::SetAnimation(&this->_BigCharPageSprite,&DAT_00b7bbf0,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_BigCharPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_BigCharPageSprite)._animState); (this->_BigCharPageSprite)._animState._isPlaying = 1; } } @@ -1429,7 +1431,7 @@ LAB_0094974d: } while (bVar1 != 0); (GHIDRA_CAST((local_30._buf)))->msvc::string::assign(pbVar4,GHIDRA_INT(strCursor) - GHIDRA_INT((pbVar4 + 1))); local_8 = 1; - (GHIDRA_CAST((difficultyOverlaySprite)))->ANM2::Load(&local_30,1); + ANM2::Load(difficultyOverlaySprite,&local_30,1); local_8 = 0xffffffff; if (0xf < local_30._capacity) { uVar3 = local_30._capacity + 1; @@ -1447,9 +1449,9 @@ LAB_0094974d: pbVar4 = (this->_DifficultyOverlaySprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_00949835: - bVar1 = (GHIDRA_CAST((difficultyOverlaySprite)))->ANM2::SetAnimation(GHIDRA_CAST("BloodStain"),1); + bVar1 = ANM2::SetAnimation(difficultyOverlaySprite,GHIDRA_CAST("BloodStain"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_DifficultyOverlaySprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_DifficultyOverlaySprite)._animState); (this->_DifficultyOverlaySprite)._animState._isPlaying = 1; } } @@ -1483,7 +1485,7 @@ LAB_00949827: pbVar4 = GHIDRA_CAST(0x0); if ((this->_DifficultyOverlaySprite)._layerCount != 0) { do { - layer = (GHIDRA_CAST((difficultyOverlaySprite)))->ANM2::GetLayer(pbVar4); + layer = ANM2::GetLayer(difficultyOverlaySprite,pbVar4); pbVar4 = pbVar4 + 1; layer->_blendMode[0] = DAT_00c35e78; layer->_blendMode[1] = DAT_00c35e7c; @@ -1503,7 +1505,7 @@ LAB_00949827: } while (bVar1 != 0); (GHIDRA_CAST((local_30._buf)))->msvc::string::assign(pbVar4,GHIDRA_INT(strCursor) - GHIDRA_INT((pbVar4 + 1))); local_8 = 2; - (GHIDRA_CAST((&this->_CharacterPortraitsSprite)))->ANM2::Load(&local_30,1); + ANM2::Load(&this->_CharacterPortraitsSprite,&local_30,1); local_8 = 0xffffffff; if (0xf < local_30._capacity) { uVar3 = local_30._capacity + 1; @@ -1549,9 +1551,9 @@ LAB_00949995: ((pbVar4[0x34] == 0 || ((this->_CharacterPortraitsSprite)._animState._isPlaying != 0)))) goto LAB_009499c1; } - bVar1 = (GHIDRA_CAST((&this->_CharacterPortraitsSprite)))->ANM2::SetAnimation(&DAT_00b7bbf0,1); + bVar1 = ANM2::SetAnimation(&this->_CharacterPortraitsSprite,&DAT_00b7bbf0,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_CharacterPortraitsSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_CharacterPortraitsSprite)._animState); (this->_CharacterPortraitsSprite)._animState._isPlaying = 1; } LAB_009499c1: @@ -1679,43 +1681,43 @@ void Menu_Character::Update() local_8 = (void *)(__security_cookie ^ GHIDRA_UINT((animName + 7))); if ((g_manager->_framecount & 1) == 0) { if ((this->_BigCharPageSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_BigCharPageSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_BigCharPageSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_BigCharPageSprite)._animState); + AnimationState::Update(&(this->_BigCharPageSprite)._overlayAnimState); } if ((this->_CharacterMenuBGSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_CharacterMenuBGSprite)._animState); + AnimationState::Update(&(this->_CharacterMenuBGSprite)._overlayAnimState); } if ((this->_DifficultyPageSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_DifficultyPageSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_DifficultyPageSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_DifficultyPageSprite)._animState); + AnimationState::Update(&(this->_DifficultyPageSprite)._overlayAnimState); } if ((this->_SeedPageSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_SeedPageSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_SeedPageSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_SeedPageSprite)._animState); + AnimationState::Update(&(this->_SeedPageSprite)._overlayAnimState); } if ((this->_WinStreakPageSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_WinStreakPageSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_WinStreakPageSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_WinStreakPageSprite)._animState); + AnimationState::Update(&(this->_WinStreakPageSprite)._overlayAnimState); } if ((this->_DifficultyOverlaySprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_DifficultyOverlaySprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_DifficultyOverlaySprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_DifficultyOverlaySprite)._animState); + AnimationState::Update(&(this->_DifficultyOverlaySprite)._overlayAnimState); } if ((this->_EastereggPageSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_EastereggPageSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_EastereggPageSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_EastereggPageSprite)._animState); + AnimationState::Update(&(this->_EastereggPageSprite)._overlayAnimState); } if ((this->_SeedUnlockPageSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_SeedUnlockPageSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_SeedUnlockPageSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_SeedUnlockPageSprite)._animState); + AnimationState::Update(&(this->_SeedUnlockPageSprite)._overlayAnimState); } switch(this->Difficulty) { case 0: if ((this->_DifficultyPageSprite)._animState._animData != (void *)0x0) { frame = 0.0; code_r0x00949d90: - (GHIDRA_CAST((&(this->_DifficultyPageSprite)._animState)))->AnimationState::SetFrameFloat(frame); + AnimationState::SetFrameFloat(&(this->_DifficultyPageSprite)._animState,frame); } break; case 1: @@ -1737,16 +1739,16 @@ code_r0x00949d90: } } if ((this->Status == 1) && ((this->_SeedEntrySprite)._loaded != 0)) { - (GHIDRA_CAST((&(this->_SeedEntrySprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_SeedEntrySprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_SeedEntrySprite)._animState); + AnimationState::Update(&(this->_SeedEntrySprite)._overlayAnimState); } if ((this->_TaintedMenuBGDecoSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_TaintedMenuBGDecoSprite)._animState); + AnimationState::Update(&(this->_TaintedMenuBGDecoSprite)._overlayAnimState); } if ((this->_PageSwapWidgetSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_PageSwapWidgetSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_PageSwapWidgetSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_PageSwapWidgetSprite)._animState); + AnimationState::Update(&(this->_PageSwapWidgetSprite)._overlayAnimState); } if ((this->_CharacterMenuBGSprite)._animState._animData != (void *)0x0) { in_stack_ffffffc4 = 0x949e16; @@ -1825,7 +1827,8 @@ code_r0x00949d90: if ((this->Status == 4) && (((this->_CharacterMenuBGSprite)._animState._animData == (void *)0x0 || ((this->_CharacterMenuBGSprite)._animState._isPlaying == 0)))) { - a = (GHIDRA_CAST((GHIDRA_CAST(&(this->_CharacterMenuBGSprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(animName)); + a = ANM2::GetAnimation(GHIDRA_CAST(&(this->_CharacterMenuBGSprite)._animState),GHIDRA_CAST(animName) + ); animNameSize = &a->_size; if (0xf < a->_capacity) { a = *GHIDRA_CAST(a->_buf); @@ -1845,12 +1848,12 @@ code_r0x00949d90: operator_delete(ptr,uVar3); } if (bVar1 == 0) { - (GHIDRA_CAST((&this->_CharacterMenuBGSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->_CharacterMenuBGSprite,s_Idle,0); } else { set_character_menu_shown(this,1 - this->_characterMenuShown); render_page_snapshot(this); - (GHIDRA_CAST((&this->_CharacterMenuBGSprite)))->ANM2::Play(GHIDRA_CAST("SwapIn"),0); + ANM2::Play(&this->_CharacterMenuBGSprite,GHIDRA_CAST("SwapIn"),0); manager = g_manager; soundId = 8; seed_fart_sound_override(&soundId); @@ -1888,9 +1891,9 @@ LAB_0094a0dd: ((pbVar4[0x34] == 0 || ((this->_CharacterMenuBGSprite)._animState._isPlaying != 0)))) goto LAB_0094a116; } - bVar1 = (GHIDRA_CAST((&this->_CharacterMenuBGSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_CharacterMenuBGSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._animState); (this->_CharacterMenuBGSprite)._animState._isPlaying = 1; } } @@ -1903,9 +1906,9 @@ LAB_0094a116: pbVar4 = (this->_SeedUnlockPageSprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_0094a176: - bVar1 = (GHIDRA_CAST((&this->_SeedUnlockPageSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(&this->_SeedUnlockPageSprite,GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_SeedUnlockPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_SeedUnlockPageSprite)._animState); (this->_SeedUnlockPageSprite)._animState._isPlaying = 1; } } @@ -1945,9 +1948,9 @@ LAB_0094a165: pbVar4 = (this->_SeedUnlockPageSprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_0094a21b: - bVar1 = (GHIDRA_CAST((&this->_SeedUnlockPageSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_SeedUnlockPageSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_SeedUnlockPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_SeedUnlockPageSprite)._animState); (this->_SeedUnlockPageSprite)._animState._isPlaying = 1; } } @@ -1992,9 +1995,9 @@ LAB_0094a20a: pbVar4 = (this->_SeedUnlockPageSprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_0094a2d8: - bVar1 = (GHIDRA_CAST((&this->_SeedUnlockPageSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Dissappear"),1); + bVar1 = ANM2::SetAnimation(&this->_SeedUnlockPageSprite,GHIDRA_CAST("Dissappear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_SeedUnlockPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_SeedUnlockPageSprite)._animState); (this->_SeedUnlockPageSprite)._animState._isPlaying = 1; } } @@ -2091,9 +2094,9 @@ LAB_0094a36b: } pbVar4 = &DAT_00b7bde8; } - bVar1 = (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::SetAnimation(pbVar4,1); + bVar1 = ANM2::SetAnimation(&this->_EastereggPageSprite,pbVar4,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_EastereggPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_EastereggPageSprite)._animState); (this->_EastereggPageSprite)._animState._isPlaying = 1; } LAB_0094a3e6: @@ -2172,9 +2175,9 @@ LAB_0094a435: } pbVar4 = &DAT_00b7bf2c; } - bVar1 = (GHIDRA_CAST((&this->_WinStreakPageSprite)))->ANM2::SetAnimation(pbVar4,1); + bVar1 = ANM2::SetAnimation(&this->_WinStreakPageSprite,pbVar4,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_WinStreakPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_WinStreakPageSprite)._animState); (this->_WinStreakPageSprite)._animState._isPlaying = 1; } return; @@ -2584,7 +2587,7 @@ LAB_0094ad1d: &g_vectorZero); (GHIDRA_CAST((GHIDRA_CAST(&this->_PageSwapWidgetSprite))))->Sprite::RenderLayer(1,&renderPos,&g_vectorZero, &g_vectorZero); - nullFrame = (GHIDRA_CAST((&(this->_PageSwapWidgetSprite)._animState)))->AnimationState::GetNullFrameById(0); + nullFrame = AnimationState::GetNullFrameById(&(this->_PageSwapWidgetSprite)._animState,0); local_74 = GHIDRA_CAST((renderPos.y + nullFrame[1])); glyphX = renderPos.x + *nullFrame; local_c0 = 0; @@ -2684,7 +2687,7 @@ LAB_0094ad1d: AnimationState::Render(secondAnimState,&basePos,&g_vectorZero,&g_vectorZero); } if ((this->_seedText)._size == 0) { - pLVar6 = (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar6 = ANM2::GetLayer(&this->_SeedPageSprite,GHIDRA_CAST(0x1)); local_70 = GHIDRA_CAST(0x43b28000); local_74 = GHIDRA_CAST(0x42380000); pLVar6->_visible = 1; @@ -2726,18 +2729,18 @@ LAB_0094ad1d: ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_00,scale_00); if (bVar2 == 0) { - pLVar6 = (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar6 = ANM2::GetLayer(&this->_SeedPageSprite,GHIDRA_CAST(0x2)); pLVar6->_visible = 1; } else { - pLVar6 = (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar6 = ANM2::GetLayer(&this->_SeedPageSprite,GHIDRA_CAST(0x2)); pLVar6->_visible = 0; } } else { - pLVar6 = (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar6 = ANM2::GetLayer(&this->_SeedPageSprite,GHIDRA_CAST(0x1)); pLVar6->_visible = 0; - pLVar6 = (GHIDRA_CAST((&this->_SeedPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar6 = ANM2::GetLayer(&this->_SeedPageSprite,GHIDRA_CAST(0x2)); textSettings = 0; local_94 = 0xffff; local_90._red = 0.0; @@ -2754,12 +2757,12 @@ LAB_0094ad1d: if (0xf < (this->_seedText)._capacity) { seedTextChars = *GHIDRA_CAST(seedText->_buf); } - iVar10 = (GHIDRA_CAST((local_74)))->Font::get_string_width_n(GHIDRA_CAST(seedTextChars),-1); + iVar10 = Font::get_string_width_n(local_74,GHIDRA_CAST(seedTextChars),-1); seedTextChars = seedText; if (0xf < (this->_seedText)._capacity) { seedTextChars = *GHIDRA_CAST(seedText->_buf); } - (GHIDRA_CAST((local_74)))->Font::DrawString(GHIDRA_CAST(seedTextChars),&local_b0,&textSettings, + Font::DrawString(local_74,GHIDRA_CAST(seedTextChars),&local_b0,&textSettings, (basePos.x + 400.0) - (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * 0.5, basePos.y + 57.0); @@ -2788,7 +2791,7 @@ LAB_0094ad1d: ehState = 1; (GHIDRA_CAST((&local_b0)))->KColor::SetFromARGB(0xff362f2d); renderPos.y = basePos.x + 480.0 + 185.0; - (GHIDRA_CAST((&temp_3f620328c3->_font3_TeamMeatEx16)))->Font::DrawString(GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_chars), + Font::DrawString(&temp_3f620328c3->_font3_TeamMeatEx16,GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_chars), color_00,&textSettings,renderPos.y,basePos.y + 35.0); ehState = -1; uVar4 = (this->_seedText)._size; @@ -2815,10 +2818,10 @@ LAB_0094ad1d: textEnd = (void **)(GHIDRA_INT(textEnd) + 1); } while (cVar1 != '\0'); if (textEnd != (void **)(GHIDRA_INT(&(GHIDRA_CAST(textBuf))->_chars) + 1U)) { - (GHIDRA_CAST((GHIDRA_CAST(&fontSettings))))->FontSettings::constructor(); + FontSettings::constructor(GHIDRA_CAST(&fontSettings)); ehState = 2; (GHIDRA_CAST((&local_b0)))->KColor::SetFromARGB(0xff362f2d); - (GHIDRA_CAST((&temp_3f620328c3->_font3_TeamMeatEx16)))->Font::DrawString(GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_chars), + Font::DrawString(&temp_3f620328c3->_font3_TeamMeatEx16,GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_chars), color_01,settings,renderPos.y,basePos.y + 60.0); ehState = -1; local_c4 = 0; @@ -2860,7 +2863,7 @@ LAB_0094ad1d: (GHIDRA_CAST((&local_b0)))->KColor::SetFromARGB(0xff362f2d); iVar10 = Font::get_string_width_n (&temp_3f620328c3->_font1_TeamMeatEx10,GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_scaleW),-1); - (GHIDRA_CAST((&temp_3f620328c3->_font1_TeamMeatEx10)))->Font::DrawString(GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_scaleW), + Font::DrawString(&temp_3f620328c3->_font1_TeamMeatEx10,GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_scaleW), &local_b0,&textSettings, (basePos.x + 85.0) - (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * 0.5, @@ -2874,9 +2877,9 @@ LAB_0094ad1d: (this->_eastereggPagePosition).x = (g_menuManager->_ViewPosition).x + this->_PositionX + 404.0; (this->_eastereggPagePosition).y = fVar12 + fVar13 + 238.0; isAchievementsDisallowed = (GHIDRA_CAST((seeds)))->Seeds::AchievementUnlocksDisallowed(); - pLVar6 = (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + pLVar6 = ANM2::GetLayer(&this->_EastereggPageSprite,GHIDRA_CAST(0x3)); pLVar6->_visible = isAchievementsDisallowed; - (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::Render(&this->_eastereggPagePosition,&g_vectorZero, + ANM2::Render(&this->_EastereggPageSprite,&this->_eastereggPagePosition,&g_vectorZero, &g_vectorZero); if (((this->_EastereggPageSprite)._animState._animData != (void *)0x0) && (nullFrame = AnimationState::GetNullFrame @@ -2892,11 +2895,11 @@ LAB_0094ad1d: ZEXT1644(CONCAT412(0x3f800000,CONCAT48(0x3f800000,0x3f8000003f800000))), pos_01); if (bVar2 == 0) { - pLVar6 = (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::GetLayer(&DAT_00000004); + pLVar6 = ANM2::GetLayer(&this->_EastereggPageSprite,&DAT_00000004); pLVar6->_visible = 1; } else { - pLVar6 = (GHIDRA_CAST((&this->_EastereggPageSprite)))->ANM2::GetLayer(&DAT_00000004); + pLVar6 = ANM2::GetLayer(&this->_EastereggPageSprite,&DAT_00000004); pLVar6->_visible = 0; } } @@ -2912,7 +2915,7 @@ LAB_0094ad1d: local_b0._unk = 0; ehState = 4; (GHIDRA_CAST((&local_90)))->KColor::SetFromARGB(0xff3d3234); - (GHIDRA_CAST((&temp_3f620328c3->_font1_TeamMeatEx10)))->Font::DrawString(GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_chars), + Font::DrawString(&temp_3f620328c3->_font1_TeamMeatEx10,GHIDRA_CAST(&(GHIDRA_CAST(textBuf))->_chars), color,&seedCountSettings,(this->_eastereggPagePosition).x - 18.0, (this->_eastereggPagePosition).y - 10.0); ehState = -1; @@ -2962,7 +2965,7 @@ LAB_0094ad1d: if (0xf < textBufCapacity) { pFVar8 = textBuf[0]; } - iVar10 = (GHIDRA_CAST((local_70)))->Font::get_string_width_n(GHIDRA_CAST(pFVar8),-1); + iVar10 = Font::get_string_width_n(local_70,GHIDRA_CAST(pFVar8),-1); fVar13 = 0.5; fontSettings = 0; local_d4 = 0xffff; @@ -2978,7 +2981,7 @@ LAB_0094ad1d: if (0xf < textBufCapacity) { pFVar8 = textBuf[0]; } - (GHIDRA_CAST((pFVar11)))->Font::DrawString(GHIDRA_CAST(pFVar8),&local_b0,&fontSettings, + Font::DrawString(pFVar11,GHIDRA_CAST(pFVar8),&local_b0,&fontSettings, g_screenWidth * fVar13 - fVar12,g_screenHeight * fVar13 - 26.0); pbVar3 = &(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd9c))); (*GHIDRA_CAST((GHIDRA_CAST(&(ehState)) + 0x0))) = 5; @@ -2992,7 +2995,7 @@ LAB_0094ad1d: if (0xf < textBufCapacity) { pFVar8 = textBuf[0]; } - iVar10 = (GHIDRA_CAST((pFVar11)))->Font::get_string_width_n(GHIDRA_CAST(pFVar8),-1); + iVar10 = Font::get_string_width_n(pFVar11,GHIDRA_CAST(pFVar8),-1); fVar13 = 0.5; fontSettings = 0; local_d4 = 0xffff; @@ -3008,7 +3011,7 @@ LAB_0094ad1d: if (0xf < textBufCapacity) { pFVar8 = textBuf[0]; } - (GHIDRA_CAST((pFVar11)))->Font::DrawString(GHIDRA_CAST(pFVar8),&local_b0,&fontSettings, + Font::DrawString(pFVar11,GHIDRA_CAST(pFVar8),&local_b0,&fontSettings, g_screenWidth * fVar13 - fVar12,g_screenHeight * fVar13 + 0.0); if (0xf < textBufCapacity) { uVar4 = textBufCapacity + 1; @@ -3073,7 +3076,7 @@ void Menu_Character::render_wheel(Vector *param_2, char param_3) savedThis = this; if (this->SelectedCharacterID < 0x12) { puStack_20 = edenTokensText + 0xa4; - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::Render(param_2,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_BigCharPageSprite,param_2,&g_vectorZero,&g_vectorZero); } else { ModManager::RenderCustomCharacterMenu @@ -3100,8 +3103,8 @@ void Menu_Character::render_wheel(Vector *param_2, char param_3) (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); pVVar1 = savedPosition; y = savedPosition->y + 215.0; - iVar2 = (GHIDRA_CAST((temp_27f83029b04)))->Font::get_string_width_n(edenTokensText,-1); - (GHIDRA_CAST((temp_27f83029b04)))->Font::DrawString(edenTokensText,&textColor,&drawSettings, + iVar2 = Font::get_string_width_n(temp_27f83029b04,edenTokensText,-1); + Font::DrawString(temp_27f83029b04,edenTokensText,&textColor,&drawSettings, (pVVar1->x + 240.0) - (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) * 0.5,y); local_14 = 0xffffffff; @@ -3266,9 +3269,10 @@ void Menu_Character::render_portraits(Vector *position, Vector *offset, Vector * if (*GHIDRA_CAST((iVar4 + GHIDRA_INT(g_characterPortraitOrder))) < 0x12) { iVar6 = *GHIDRA_CAST((iVar4 + GHIDRA_INT(g_characterPortraitOrder))) + this->_characterMenuShown * 0x12; local_80 = (void *)(iVar6 * 3); - bVar2 = (GHIDRA_CAST((&this->_CharacterPortraitsSprite)))->ANM2::SetAnimation((&PTR_s_00_Random_00b24140)[iVar6 * 6],1); + bVar2 = ANM2::SetAnimation(&this->_CharacterPortraitsSprite, + (&PTR_s_00_Random_00b24140)[iVar6 * 6],1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->_CharacterPortraitsSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_CharacterPortraitsSprite)._animState); (this->_CharacterPortraitsSprite)._animState._isPlaying = 1; } iVar6 = *GHIDRA_CAST((&DAT_00b24144 + GHIDRA_INT(local_80) * 8)); @@ -3294,7 +3298,7 @@ void Menu_Character::render_portraits(Vector *position, Vector *offset, Vector * iVar6 = 1; } if ((this->_CharacterPortraitsSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(this->_CharacterPortraitsSprite)._animState)))->AnimationState::SetFrameFloat((float)iVar6); + AnimationState::SetFrameFloat(&(this->_CharacterPortraitsSprite)._animState,(float)iVar6); } } characterIndex = *GHIDRA_CAST((iVar4 + GHIDRA_INT(g_characterPortraitOrder))); @@ -3573,7 +3577,8 @@ LAB_0094c9ac: seed_fart_sound_override(&local_34); (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(local_34,1.0,0,0,1.0,0.0); if (this->SelectedCharacterID < 0x12) { - (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::Play((&PTR_s_00_Random_00b24140) + ANM2::Play(&this->_BigCharPageSprite, + (&PTR_s_00_Random_00b24140) [(this->SelectedCharacterID + this->_characterMenuShown * 0x12) * 6],0); } goto LAB_0094ca89; @@ -4247,13 +4252,13 @@ void Menu_Character::UpdateRotations() pbVar5 = &DAT_00000004; bigCharSprite = &this->_BigCharPageSprite; do { - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(pbVar5); + layer = ANM2::GetLayer(bigCharSprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 0; } while (GHIDRA_INT(pbVar5) < 0x10); - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x10)); + layer = ANM2::GetLayer(bigCharSprite,GHIDRA_CAST(0x10)); layer->_visible = 1; - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(bigCharSprite,GHIDRA_CAST(0x3)); layer->_visible = 1; if (((this->_BigCharPageSprite)._animState._animData != (void *)0x0) && ((3 < *GHIDRA_CAST((GHIDRA_INT((this->_BigCharPageSprite)._animState._animation) + 0x80)) || @@ -4278,7 +4283,7 @@ LAB_0094d92f: if (0x11 < iVar3) goto LAB_0094d956; pbVar5 = &DAT_00000004; do { - layer = (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::GetLayer(pbVar5); + layer = ANM2::GetLayer(&this->_BigCharPageSprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 1; } while (GHIDRA_INT(pbVar5) < 0x10); @@ -4298,9 +4303,9 @@ LAB_0094d92f: isMarkUnlocked = 0; } bigCharSprite = &this->_BigCharPageSprite; - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(&DAT_00000008); + layer = ANM2::GetLayer(bigCharSprite,&DAT_00000008); layer->_visible = isMarkUnlocked; - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(&DAT_00000007); + layer = ANM2::GetLayer(bigCharSprite,&DAT_00000007); layer->_visible = isMarkUnlocked; uVar4 = *GHIDRA_CAST((&DAT_00b24150 + iVar3)); if ((uVar4 == 0) || @@ -4315,9 +4320,9 @@ LAB_0094d92f: else { isMarkUnlocked = 0; } - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(bigCharSprite,&DAT_0000000d); layer->_visible = isMarkUnlocked; - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(GHIDRA_CAST(0xc)); + layer = ANM2::GetLayer(bigCharSprite,GHIDRA_CAST(0xc)); layer->_visible = isMarkUnlocked; uVar4 = *GHIDRA_CAST((&DAT_00b24154 + iVar3)); if ((uVar4 == 0) || @@ -4332,14 +4337,14 @@ LAB_0094d92f: else { isMarkUnlocked = 0; } - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(&DAT_0000000f); + layer = ANM2::GetLayer(bigCharSprite,&DAT_0000000f); layer->_visible = isMarkUnlocked; - layer = (GHIDRA_CAST((bigCharSprite)))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(bigCharSprite,&DAT_0000000e); layer->_visible = isMarkUnlocked; } - layer = (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x10)); + layer = ANM2::GetLayer(&this->_BigCharPageSprite,GHIDRA_CAST(0x10)); layer->_visible = 0; - layer = (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->_BigCharPageSprite,GHIDRA_CAST(0x3)); layer->_visible = 1; if (((this->_BigCharPageSprite)._animState._animData != (void *)0x0) && ((3 < *GHIDRA_CAST((GHIDRA_INT((this->_BigCharPageSprite)._animState._animation) + 0x80)) || @@ -4458,9 +4463,9 @@ LAB_0094dc2c: ((pbVar5[0x34] == 0 || ((this->_BigCharPageSprite)._animState._isPlaying != 0)) )) goto LAB_0094dc62; } - bVar1 = (GHIDRA_CAST((&this->_BigCharPageSprite)))->ANM2::SetAnimation(GHIDRA_CAST(local_14),1); + bVar1 = ANM2::SetAnimation(&this->_BigCharPageSprite,GHIDRA_CAST(local_14),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_BigCharPageSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_BigCharPageSprite)._animState); (this->_BigCharPageSprite)._animState._isPlaying = 1; } } @@ -4744,9 +4749,9 @@ void Menu_Character::DoPageSwap() if (animData == GHIDRA_CAST(0x0)) { LAB_0094e273: local_8 = this; - local_AL_108 = (GHIDRA_CAST((&this->_CharacterMenuBGSprite)))->ANM2::SetAnimation(GHIDRA_CAST("SwapOut"),1); + local_AL_108 = ANM2::SetAnimation(&this->_CharacterMenuBGSprite,GHIDRA_CAST("SwapOut"),1); if (local_AL_108 != 0) { - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._animState); (this->_CharacterMenuBGSprite)._animState._isPlaying = 1; } } @@ -4806,25 +4811,25 @@ LAB_0094e2e5: ((animData[0x34] == 0 || ((this->_CharacterMenuBGSprite)._overlayAnimState._isPlaying != 0))) ) goto LAB_0094e310; } - local_AL_108 = (GHIDRA_CAST((&this->_CharacterMenuBGSprite)))->ANM2::SetOverlayAnimation(GHIDRA_CAST(local_8),1); + local_AL_108 = ANM2::SetOverlayAnimation(&this->_CharacterMenuBGSprite,GHIDRA_CAST(local_8),1); if (local_AL_108 != 0) { - (GHIDRA_CAST((&(this->_CharacterMenuBGSprite)._overlayAnimState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_CharacterMenuBGSprite)._overlayAnimState); (this->_CharacterMenuBGSprite)._overlayAnimState._isPlaying = 1; } LAB_0094e310: render_page_snapshot(this); if (this->_characterMenuShown == 0) { - local_AL_108 = (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + local_AL_108 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,GHIDRA_CAST("Appear"),1); if (local_AL_108 != 0) { - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } local_8 = GHIDRA_CAST(0x23a); } else { - local_AL_108 = (GHIDRA_CAST((&this->_TaintedMenuBGDecoSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Disappear"),1); + local_AL_108 = ANM2::SetAnimation(&this->_TaintedMenuBGDecoSprite,GHIDRA_CAST("Disappear"),1); if (local_AL_108 != 0) { - (GHIDRA_CAST((&(this->_TaintedMenuBGDecoSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_TaintedMenuBGDecoSprite)._animState); (this->_TaintedMenuBGDecoSprite)._animState._isPlaying = 1; } local_8 = GHIDRA_CAST(0x239); diff --git a/generated-src/menu_collection.cpp b/generated-src/menu_collection.cpp index 3c56eee..3467ded 100644 --- a/generated-src/menu_collection.cpp +++ b/generated-src/menu_collection.cpp @@ -1057,7 +1057,7 @@ LAB_008d79e6: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d79f7: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset))))->ANM2::SetAnimation(GHIDRA_CAST("IconBeggar") + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset),GHIDRA_CAST("IconBeggar") ,1); if (bVar1 != 0) { AnimationState::Rewind @@ -1076,7 +1076,7 @@ LAB_008d7198: LAB_008d71b1: iconAnimName = "IconBeggar"; LAB_008d7bad: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset))))->ANM2::SetAnimation(GHIDRA_CAST(iconAnimName) + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset),GHIDRA_CAST(iconAnimName) ,1); if (bVar1 != 0) { AnimationState::Rewind @@ -1094,7 +1094,7 @@ LAB_008d78f7: if ((cmpResult != 0) || ((curAnimation[0x34] != 0 && ((char)(topAnimState->DeathScreenSprite)._shadowLayerIndex == '\0')))) { LAB_008d7908: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset))))->ANM2::SetAnimation(GHIDRA_CAST("IconBeggar") + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset),GHIDRA_CAST("IconBeggar") ,1); if (bVar1 != 0) { AnimationState::Rewind @@ -1133,7 +1133,7 @@ LAB_008d703d: LAB_008d7056: iconAnimName = "ItemPoolChests"; LAB_008d7875: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset))))->ANM2::SetAnimation(GHIDRA_CAST(iconAnimName) + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset),GHIDRA_CAST(iconAnimName) ,1); if (bVar1 != 0) { AnimationState::Rewind @@ -1153,7 +1153,7 @@ LAB_008d6fd5: LAB_008d6fee: iconAnimName = "ItemPoolChests"; LAB_008d7a9d: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset))))->ANM2::SetAnimation(GHIDRA_CAST(iconAnimName) + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset),GHIDRA_CAST(iconAnimName) ,1); if (bVar1 != 0) { AnimationState::Rewind @@ -1173,7 +1173,7 @@ LAB_008d6f6d: LAB_008d6f86: iconAnimName = "ItemPoolChests"; LAB_008d77e0: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset))))->ANM2::SetAnimation(GHIDRA_CAST(iconAnimName) + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset),GHIDRA_CAST(iconAnimName) ,1); if (bVar1 != 0) { AnimationState::Rewind @@ -1251,9 +1251,10 @@ LAB_008d7358: LAB_008d7371: iconAnimName = "IconTreasureRoom"; LAB_008d7378: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset))))->ANM2::SetAnimation(GHIDRA_CAST(iconAnimName),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((topAnimState->DeathScreenSprite)._color._offset),GHIDRA_CAST(iconAnimName),1 + ); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(((topAnimState->DeathScreenSprite)._championColor._offset + 1)))))->AnimationState::Rewind() + AnimationState::Rewind(GHIDRA_CAST(((topAnimState->DeathScreenSprite)._championColor._offset + 1))) ; *GHIDRA_CAST(&(topAnimState->DeathScreenSprite)._shadowLayerIndex) = 1; } @@ -1307,15 +1308,15 @@ void Menu_Collection::destructor() } } local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x128)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x178)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x158)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x128))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x178))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x158))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x140)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x128)))))->msvc::string::_Tidy_deallocate(); local_8 = 2; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x14)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 100)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x44)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x14))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 100))); + AnimationState::~AnimationState(GHIDRA_CAST((in_ECX + 0x44))); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x2c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x14)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -1363,8 +1364,8 @@ void Menu_Collection::Update() page = loadedImage + 0x3c; if (((g_manager->_framecount & 1) == 0) && (page = loadedImage + 0x3c, *GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x11d)) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x11)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x19)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x11))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x19))); page = puStack_20; } puStack_20 = page; @@ -1583,10 +1584,10 @@ LAB_0094ed66: in_ECX[0x92] = GHIDRA_UINT(inputX); in_ECX[0x93] = GHIDRA_UINT(inputY); isArrowVisible = in_ECX[1] != 0; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 5)))))->ANM2::GetLayer(&DAT_00000004); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 5)),&DAT_00000004); arrowLayer->_visible = isArrowVisible; isArrowVisible = in_ECX[1] != lastPage; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 5)))))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 5)),GHIDRA_CAST(0x3)); arrowLayer->_visible = isArrowVisible; ExceptionList = local_1c; return; @@ -1727,8 +1728,8 @@ void Menu_Collection::Render() fVar8 = originX; originY = local_324.y; local_324.x = originX; - pvVar2 = (GHIDRA_CAST((&font->CollectionMenuSprite)))->ANM2::GetAnimationData(s_Idle); - pvVar3 = (GHIDRA_CAST((&font->DeathScreenSprite)))->ANM2::GetAnimationData(GHIDRA_CAST("Diary")); + pvVar2 = ANM2::GetAnimationData(&font->CollectionMenuSprite,s_Idle); + pvVar3 = ANM2::GetAnimationData(&font->DeathScreenSprite,GHIDRA_CAST("Diary")); local_32c = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x18)) + 4 + *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x4c)) * 0x10)); iVar6 = *GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x18)) + 4 + *GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x50)) * 0x10)); local_360 = GHIDRA_CAST((local_32c[4] - *GHIDRA_CAST((iVar6 + 0x10)))); @@ -1741,7 +1742,7 @@ void Menu_Collection::Render() if ((GHIDRA_INT(local_334) < 0x2dd) && (*GHIDRA_CAST((GHIDRA_INT((g_manager->_persistentGameData)._eventCounters) + local_334 + 0x82c)) == '\0')) { - layer = (GHIDRA_CAST((&font->CollectionMenuSprite)))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(&font->CollectionMenuSprite,&DAT_00000005); layer->_visible = 1; if (((font->CollectionMenuSprite)._animState._animData != (void *)0x0) && ((5 < *GHIDRA_CAST((GHIDRA_INT((font->CollectionMenuSprite)._animState._animation) + 0x80)) || @@ -1804,7 +1805,7 @@ LAB_0094f2e6: } } } - layer = (GHIDRA_CAST((&font->CollectionMenuSprite)))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(&font->CollectionMenuSprite,&DAT_00000005); layer->_visible = 0; } else { @@ -2020,7 +2021,7 @@ LAB_0094f92f: if ((font->CollectionMenuSprite)._animState._animData != (void *)0x0) { pvVar3 = (void *)0x1; pvVar2 = (void *)0x94f943; - local_32c = (GHIDRA_CAST((&(font->CollectionMenuSprite)._animState)))->AnimationState::GetNullFrameById(1); + local_32c = AnimationState::GetNullFrameById(&(font->CollectionMenuSprite)._animState,1); other = &(*GHIDRA_CAST((GHIDRA_CAST((font)) + 0x240))); local_324.y = (float)other; if (local_32c != GHIDRA_CAST(0x0)) { @@ -2101,7 +2102,7 @@ LAB_0094f92f: local_26c._alpha = 0.0; local_26c._unk = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; - pvVar2 = (GHIDRA_CAST((font)))->Font::layout_glyphs(glyphRun,textBuffer,&layoutParams,&g_vectorOne); + pvVar2 = Font::layout_glyphs(font,glyphRun,textBuffer,&layoutParams,&g_vectorOne); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; color._blue = 0.38039216; color._red = 0.47058824; @@ -2132,12 +2133,12 @@ LAB_0094f92f: local_330 = 100.0 / (float)(uVar4 + 3); } else { - local_33c = (GHIDRA_CAST((&(font->CollectionMenuSprite)._animState)))->AnimationState::GetNullFrameById(0); + local_33c = AnimationState::GetNullFrameById(&(font->CollectionMenuSprite)._animState,0); local_330 = 100.0 / (float)(uVar4 + 3); local_314 = local_33c; if (local_33c != GHIDRA_CAST(0x0)) { - layer = (GHIDRA_CAST((&font->CollectionMenuSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - piVar5 = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_354); + layer = ANM2::GetLayer(&font->CollectionMenuSprite,GHIDRA_CAST(0x0)); + piVar5 = LayerState::GetTexture(layer,&local_354); local_338 = 1; local_314 = local_33c; if (*piVar5 != 0) { @@ -2165,7 +2166,7 @@ LAB_0094fd15: if (-1 < GHIDRA_INT(local_334)) { do { pageMarkersTop = (float)local_33c; - pvVar2 = (GHIDRA_CAST((&font->CollectionMenuSprite)))->ANM2::GetAnimationData(s_Idle); + pvVar2 = ANM2::GetAnimationData(&font->CollectionMenuSprite,s_Idle); frameData = *(float **) (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x18)) + 4 + *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x50)) * 0x10); local_300 = frameData[0x1f]; @@ -2260,11 +2261,11 @@ LAB_0094fd15: renderColor._offset[2] = 0.0; pvVar2 = (void *)0x9500cf; g_currentShader = savedShader; - layer = (GHIDRA_CAST((&font->CollectionMenuSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(auStack_40a + -10); + layer = ANM2::GetLayer(&font->CollectionMenuSprite,GHIDRA_CAST(0x0)); + LayerState::GetTexture(layer,auStack_40a + -10); apply_sprite_shader_params(&renderColor,1,pvVar2,pvVar3); - layer = (GHIDRA_CAST((&font->CollectionMenuSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_34c); + layer = ANM2::GetLayer(&font->CollectionMenuSprite,GHIDRA_CAST(0x0)); + texture = LayerState::GetTexture(layer,&local_34c); local_14 = 4; (**(code **)(*GHIDRA_CAST(*texture) + 0x14))(&srcCorner0X); local_14 = 5; @@ -2332,9 +2333,9 @@ void Menu_Collection::reset() pbVar3 = GHIDRA_CAST(in_ECX[0x12]); if (pbVar3 == GHIDRA_CAST(0x0)) { LAB_00950319: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 5)))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((in_ECX + 5)),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x11)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x11))); *GHIDRA_CAST((in_ECX + 0x16)) = 1; } } @@ -2364,7 +2365,7 @@ LAB_0095030b: if ((uVar2 != 0) || ((pbVar3[0x34] != 0 && (*GHIDRA_CAST((in_ECX + 0x16)) == '\0')))) goto LAB_00950319; } - layer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 5)))))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 5)),&DAT_00000005); diarySprite = GHIDRA_CAST((in_ECX + 0x4a)); layer->_visible = 0; pbVar3 = GHIDRA_CAST(in_ECX[0x57]); @@ -2394,19 +2395,19 @@ LAB_00950387: if ((uVar2 == 0) && ((pbVar3[0x34] == 0 || (*GHIDRA_CAST((in_ECX + 0x5b)) != '\0')))) goto LAB_009503b3; } - bVar1 = (GHIDRA_CAST((diarySprite)))->ANM2::SetAnimation(GHIDRA_CAST("Diary"),1); + bVar1 = ANM2::SetAnimation(diarySprite,GHIDRA_CAST("Diary"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x56)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x56))); *GHIDRA_CAST((in_ECX + 0x5b)) = 1; } LAB_009503b3: pbVar3 = GHIDRA_CAST(0x0); do { - layer = (GHIDRA_CAST((diarySprite)))->ANM2::GetLayer(pbVar3); + layer = ANM2::GetLayer(diarySprite,pbVar3); pbVar3 = pbVar3 + 1; layer->_visible = 0; } while (GHIDRA_INT(pbVar3) < 7); - layer = (GHIDRA_CAST((diarySprite)))->ANM2::GetLayer(&DAT_00000006); + layer = ANM2::GetLayer(diarySprite,&DAT_00000006); manager = g_manager; uVar2 = 0; layer->_visible = 1; diff --git a/generated-src/menu_controller_select.cpp b/generated-src/menu_controller_select.cpp index 62547e9..6a117f4 100644 --- a/generated-src/menu_controller_select.cpp +++ b/generated-src/menu_controller_select.cpp @@ -35,8 +35,8 @@ void Menu_ControllerSelect::Update() ExceptionList = &local_10; piVar5 = in_ECX; if (*GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x119)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x18)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x10))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x18))); piVar5 = extraout_ECX; } FUN_008ca0a0(piVar5,uVar3); @@ -245,7 +245,7 @@ void Menu_ControllerSelect::Render() local_10 = ExceptionList; local_14 = __security_cookie ^ GHIDRA_UINT((nameText + 0x110)); ExceptionList = &local_10; - cursorLayer = (GHIDRA_CAST((&this->ControllerSelectSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + cursorLayer = ANM2::GetLayer(&this->ControllerSelectSprite,GHIDRA_CAST(0x2)); cursorLayer->_visible = 0; renderPos.x = (g_menuManager->_ViewPosition).x + this->PositionX; renderPos.y = (g_menuManager->_ViewPosition).y + this->PositionY; @@ -297,7 +297,7 @@ void Menu_ControllerSelect::Render() textY = (float)((double)GHIDRA_INT(row) + __uint_to_double_fixup[-(GHIDRA_INT(row) >> 0x1f)]) * 20.0 + listY ; textX = listX - (float)((double)GHIDRA_INT(row) + __uint_to_double_fixup[-(GHIDRA_INT(row) >> 0x1f)]) * 4.0; - pvVar1 = (GHIDRA_CAST((font)))->Font::layout_glyphs(glyphRun,nameText,&fontParams,&g_vectorOne); + pvVar1 = Font::layout_glyphs(font,glyphRun,nameText,&fontParams,&g_vectorOne); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); color._blue = 0.1764706; color._red = 0.21176471; @@ -312,7 +312,7 @@ void Menu_ControllerSelect::Render() iVar2 = this[1].HoldInputTimer; } while (row < GHIDRA_UINT((this[1].SelectedElement - iVar2 >> 3))); } - cursorLayer = (GHIDRA_CAST((&this->ControllerSelectSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + cursorLayer = ANM2::GetLayer(&this->ControllerSelectSprite,GHIDRA_CAST(0x2)); cursorLayer->_visible = 1; renderPos.x = ((g_menuManager->_ViewPosition).x + this->PositionX) - (float)this->SelectedElement * 4.0; diff --git a/generated-src/menu_create_lobby.cpp b/generated-src/menu_create_lobby.cpp index 3788058..3785c1c 100644 --- a/generated-src/menu_create_lobby.cpp +++ b/generated-src/menu_create_lobby.cpp @@ -16,7 +16,7 @@ void Menu_CreateLobby::unload_graphics() puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; - this->ANM2::Reset(); + ANM2::Reset(this); spriteFields = GHIDRA_CAST((GHIDRA_INT(this) + 0x13c)); remaining = 6; do { @@ -29,8 +29,8 @@ void Menu_CreateLobby::unload_graphics() } spriteFields[-6] = 0; *GHIDRA_CAST(animNameBuf) = 0; - (GHIDRA_CAST((GHIDRA_CAST((spriteFields + 2)))))->AnimationState::SetAnimationData((void *)0x0); - (GHIDRA_CAST((GHIDRA_CAST((spriteFields + 10)))))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteFields + 2)),(void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteFields + 10)),(void *)0x0); animNameBuf = spriteFields + -4; if (0xf < GHIDRA_UINT(spriteFields[1])) { animNameBuf = GHIDRA_CAST(*animNameBuf); @@ -130,7 +130,7 @@ void Menu_CreateLobby::load_graphics(ANM2 *menuSprite) menuAnmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuAnmPath._buf))) + 0x0))),"gfx/ui/main menu/CreateLobbyMenu.anm2",0x26); local_14 = 0; - (GHIDRA_CAST((menuSprite)))->ANM2::Load(&menuAnmPath,1); + ANM2::Load(menuSprite,&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar2 = menuAnmPath._capacity + 1; @@ -174,9 +174,9 @@ LAB_008cbe95: if ((uVar2 == 0) && ((currentAnim[0x34] == 0 || ((menuSprite->_animState)._isPlaying != 0)))) goto LAB_008cbec1; } - bVar1 = (GHIDRA_CAST((menuSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(menuSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&menuSprite->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&menuSprite->_animState); (menuSprite->_animState)._isPlaying = 1; } LAB_008cbec1: @@ -194,7 +194,7 @@ LAB_008cbec1: boxesAnmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(boxesAnmPath._buf))) + 0x0))),"gfx/ui/main menu/CreateLobbyBoxes.anm2",0x27); local_14 = 1; - (GHIDRA_CAST((boxSprite)))->ANM2::Load(&boxesAnmPath,1); + ANM2::Load(boxSprite,&boxesAnmPath,1); local_14 = 0xffffffff; if (0xf < boxesAnmPath._capacity) { uVar2 = boxesAnmPath._capacity + 1; @@ -244,124 +244,124 @@ void Menu_CreateLobby::update_paper_layers() paper = GHIDRA_CAST((GHIDRA_INT(paper) + paperIndex * 0x120 + 0x114)); if (paper->_layerCount != 0) { do { - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(layerIndex); + pLVar2 = ANM2::GetLayer(paper,layerIndex); layerIndex = layerIndex + 1; pLVar2->_visible = 0; } while (layerIndex < GHIDRA_CAST(paper->_layerCount)); } - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Paper")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Paper")); pLVar2->_visible = 1; if (paperIndex == 0) { if (*GHIDRA_CAST(&manager->_lobbySettings) == 2) { - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("DailyMode")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("DailyMode")); pLVar2->_visible = 1; - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("DailyMode")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("DailyMode")); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData),*GHIDRA_CAST((GHIDRA_CAST(paper) + 0x7f0))); + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData),*GHIDRA_CAST((GHIDRA_CAST(paper) + 0x7f0))); } } else { - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("ModeTitle")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("ModeTitle")); pLVar2->_visible = 1; - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(&DAT_00b734e0); + pLVar2 = ANM2::GetLayer(paper,&DAT_00b734e0); pLVar2->_visible = 1; - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("ModeTitle")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("ModeTitle")); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData),1); + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData),1); } settingValue = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_lobbySettings))) + 0x4)))); - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(&DAT_00b734e0); + pLVar2 = ANM2::GetLayer(paper,&DAT_00b734e0); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData),settingValue + 1); + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData),settingValue + 1); } } - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Arrows")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Arrows")); pLVar2->_visible = *GHIDRA_CAST((GHIDRA_CAST(paper) + 0x229)); } else if (paperIndex == 2) { if (iVar1 == 4) { LAB_008cc99f: - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Password")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Password")); pLVar2->_visible = 1; frame = GHIDRA_UINT(((manager->_lobbySettings)._password._size != 0)); - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Password")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Password")); if (pLVar2 != GHIDRA_CAST(0x0)) goto LAB_008cc9e5; KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("TagTitle")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("TagTitle")); pLVar2->_visible = 1; - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(&DAT_00b75640); + pLVar2 = ANM2::GetLayer(paper,&DAT_00b75640); pLVar2->_visible = 1; settingValue = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_lobbySettings))) + 0x14)))); - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("TagTitle")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("TagTitle")); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData),GHIDRA_UINT((settingValue != 0))); + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData),GHIDRA_UINT((settingValue != 0))); } - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(&DAT_00b75640); + pLVar2 = ANM2::GetLayer(paper,&DAT_00b75640); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData), + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_lobbySettings))) + 0x14))))); } - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Arrows")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Arrows")); pLVar2->_visible = *GHIDRA_CAST((GHIDRA_CAST(paper) + 0x469)); } } else if (paperIndex == 1) { - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Players")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Players")); pLVar2->_visible = 1; settingValue = (manager->_lobbySettings)._maxPlayers; - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Players")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Players")); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData),settingValue + -2); + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData),settingValue + -2); } - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Arrows")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Arrows")); pLVar2->_visible = *GHIDRA_CAST((GHIDRA_CAST(paper) + 0x349)); } else if (paperIndex == 3) { if (iVar1 == 4) { - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("ChallengeTitle")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("ChallengeTitle")); pLVar2->_visible = 1; settingValue = (manager->_lobbySettings)._challenge; - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("ChallengeTitle")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("ChallengeTitle")); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData),GHIDRA_UINT((0 < settingValue))); + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData),GHIDRA_UINT((0 < settingValue))); } - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Challenge")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Challenge")); pLVar2->_visible = 1; - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(GHIDRA_CAST("Challenge")); + pLVar2 = ANM2::GetLayer(paper,GHIDRA_CAST("Challenge")); if (pLVar2 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { frame = (manager->_lobbySettings)._challenge; LAB_008cc9e5: - (GHIDRA_CAST((paper)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar2->_layerData),frame); + ANM2::SetLayerFrame(paper,*GHIDRA_CAST(pLVar2->_layerData),frame); } } else if (lobbyMode != 2) { - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(&DAT_00b7562c); + pLVar2 = ANM2::GetLayer(paper,&DAT_00b7562c); pLVar2->_visible = 1; if (((manager->_lobbySettings)._seed._size == 0) && (*GHIDRA_CAST((GHIDRA_CAST(paper) + 0x7e4)) == '\0')) { @@ -370,7 +370,7 @@ LAB_008cc9e5: else { frame = 1; } - pLVar2 = (GHIDRA_CAST((paper)))->ANM2::GetLayer(&DAT_00b7562c); + pLVar2 = ANM2::GetLayer(paper,&DAT_00b7562c); if (pLVar2 != GHIDRA_CAST(0x0)) goto LAB_008cc9e5; KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } diff --git a/generated-src/menu_custom_challenge.cpp b/generated-src/menu_custom_challenge.cpp index 825adda..d179458 100644 --- a/generated-src/menu_custom_challenge.cpp +++ b/generated-src/menu_custom_challenge.cpp @@ -49,9 +49,9 @@ void Menu_CustomChallenge::Update() local_14 = __security_cookie ^ GHIDRA_UINT((seedText + 10)); ExceptionList = &local_10; if (((g_manager->_framecount & 1) == 0) && ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5d])) + 0x2))) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1))))); in_stack_ffffffb0 = 0x8ce0d5; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x20)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((this + 0x20))); } menuManager = g_menuManager; manager = g_manager; @@ -251,9 +251,9 @@ void Menu_CustomChallenge::Render() menuX = menuPos.x; if (animData == GHIDRA_CAST(0x0)) { LAB_008ce4e8: - bVar3 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::SetAnimation(&DAT_00b6767c,1); + bVar3 = ANM2::SetAnimation(GHIDRA_CAST(sprite),&DAT_00b6767c,1); if (bVar3 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1))))); *GHIDRA_CAST((this + 0x1c)) = 1; } } @@ -321,9 +321,9 @@ LAB_008ce4da: animData = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))); if (animData == GHIDRA_CAST(0x0)) { LAB_008ce698: - bVar3 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::SetAnimation(textBuf,1); + bVar3 = ANM2::SetAnimation(GHIDRA_CAST(sprite),textBuf,1); if (bVar3 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1))))); *GHIDRA_CAST((this + 0x1c)) = 1; } } @@ -399,9 +399,9 @@ LAB_008ce785: if ((uVar4 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((this + 0x1c)) != '\0')))) goto LAB_008ce7b1; } - bVar3 = (GHIDRA_CAST((GHIDRA_CAST(sprite))))->ANM2::SetAnimation(GHIDRA_CAST("Bottom"),1); + bVar3 = ANM2::SetAnimation(GHIDRA_CAST(sprite),GHIDRA_CAST("Bottom"),1); if (bVar3 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1))))); *GHIDRA_CAST((this + 0x1c)) = 1; } LAB_008ce7b1: @@ -457,9 +457,9 @@ LAB_008ce7b1: animData = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))); if (animData == GHIDRA_CAST(0x0)) { LAB_008cea15: - bVar3 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))))))->ANM2::SetAnimation(GHIDRA_CAST("Cursor"),1); + bVar3 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))),GHIDRA_CAST("Cursor"),1); if (bVar3 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1))))); *GHIDRA_CAST((this + 0x1c)) = 1; } } diff --git a/generated-src/menu_cutscenes.cpp b/generated-src/menu_cutscenes.cpp index 087dd20..4ad5594 100644 --- a/generated-src/menu_cutscenes.cpp +++ b/generated-src/menu_cutscenes.cpp @@ -16,8 +16,8 @@ void Menu_Cutscenes::Update() MenuManager *menuManager; if (((g_manager->_framecount & 1) == 0) && (*GHIDRA_CAST((GHIDRA_CAST(in_ECX) + 0x119)) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x18)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x10))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x18))); } local_8 = 0xe; isActionTriggered = @@ -130,7 +130,7 @@ LAB_008cf05f: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((in_ECX[0x12] + layerId * 4)) = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->AnimationState::AdvanceLayerPosition(layerId,(float)animData); + AnimationState::AdvanceLayerPosition(GHIDRA_CAST((in_ECX + 0x10)),layerId,(float)animData); } return; } @@ -162,7 +162,7 @@ void Menu_Cutscenes::Render() drawPos.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST((in_ECX + 8)); drawPos.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST((in_ECX + 0xc)); do { - layer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->ANM2::GetLayer(GHIDRA_CAST(*puVar2)); + layer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 0x10)),GHIDRA_CAST(*puVar2)); puVar2 = puVar2 + 1; layer->_visible = 0; } while (GHIDRA_INT(puVar2) < 0xb24010); @@ -200,7 +200,7 @@ void Menu_Cutscenes::Render() *GHIDRA_CAST((in_ECX + 0xc4)) = 0x3f000000; *GHIDRA_CAST((in_ECX + 0xe0)) = 0; } - layer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->ANM2::GetLayer(layerName); + layer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 0x10)),layerName); layer->_visible = 1; if (*GHIDRA_CAST((in_ECX + 0x119)) != '\0') { if (*GHIDRA_CAST((in_ECX + 0x80)) == '\0') { @@ -263,7 +263,7 @@ LAB_008cf3fe: } } else { - layer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->ANM2::GetLayer(layerName); + layer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 0x10)),layerName); layer->_visible = 1; if (*GHIDRA_CAST((in_ECX + 0x119)) != '\0') { if (*GHIDRA_CAST((in_ECX + 0x80)) == '\0') { diff --git a/generated-src/menu_daily_challenge.cpp b/generated-src/menu_daily_challenge.cpp index 7dfbfd0..fcc0085 100644 --- a/generated-src/menu_daily_challenge.cpp +++ b/generated-src/menu_daily_challenge.cpp @@ -33,10 +33,10 @@ void Menu_DailyChallenge::Update() return; } if (((g_manager->_framecount & 1) == 0) && (*GHIDRA_CAST((this + 0x5f)) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x21])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x21])) + 0x1))))); } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x69])) + 0x1)))))))->ANM2::update_appear_then_idle(); + ANM2::update_appear_then_idle(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x69])) + 0x1))))); (GHIDRA_CAST((GHIDRA_CAST((this + 0xd0)))))->GenericPrompt::Update(1); if (*GHIDRA_CAST(this) == 0) { daily_challenge_refresh(); @@ -131,7 +131,7 @@ void Menu_DailyChallenge::Update() input_poll_active_device(); DAT_00c5ab40 = 0; FUN_00a51aa0(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))))))->ANM2::Play(GHIDRA_CAST("Loading"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))),GHIDRA_CAST("Loading"),0); break; case 1: bVar1 = show_beta_disclaimer_popup(1,FUN_008d0ed0,this); @@ -158,9 +158,9 @@ void Menu_DailyChallenge::Update() animData = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a9])) + 0x1)))); if (animData == GHIDRA_CAST(0x0)) { code_r0x008cf92b: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 0x198)))))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 0x198)),GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x1a8)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x1a8))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ae])) + 0x2))) = 1; } } @@ -442,7 +442,7 @@ LAB_008cfe75: iVar4 = GHIDRA_INT(pbVar2) - GHIDRA_INT((animName + 1)); } text_convert_encoding(animName,iVar4,0,playerNameWide,0x200,1); - iVar4 = (GHIDRA_CAST((font)))->Font::get_string_width_utf16(playerNameWide,-1); + iVar4 = Font::get_string_width_utf16(font,playerNameWide,-1); local_18 = (uint8_t *) (175.0 / (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)])); if ((float)local_18 <= 0.0) { @@ -468,7 +468,7 @@ LAB_008cfe75: ,(float)local_18,color,&local_480); local_8 = 0xffffffff; } - text2Layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))))))->ANM2::GetLayer(GHIDRA_CAST("Text2")); + text2Layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))),GHIDRA_CAST("Text2")); if (text2Layer == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } @@ -477,17 +477,17 @@ LAB_008cfe75: if (iVar4 == 0) { if (*GHIDRA_CAST((this + 0x18)) == 0) goto LAB_008d033d; scoreNullFrame = - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))))))->AnimationState::GetNullFrame(GHIDRA_CAST("Score")); + AnimationState::GetNullFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))),GHIDRA_CAST("Score")); if (scoreNullFrame != GHIDRA_CAST(0x0)) { sprintf_s(GHIDRA_CAST(&local_3c._green),0x10,s__d); - iVar4 = (GHIDRA_CAST((font)))->Font::get_string_width_n(GHIDRA_CAST(&local_3c._green),-1); + iVar4 = Font::get_string_width_n(font,GHIDRA_CAST(&local_3c._green),-1); fVar6 = renderX + *scoreNullFrame; fVar7 = renderY + scoreNullFrame[1]; - (GHIDRA_CAST((scoreFontSettings)))->FontSettings::constructor(); + FontSettings::constructor(scoreFontSettings); local_8 = 2; (GHIDRA_CAST((GHIDRA_CAST(local_28))))->KColor::SetFromARGB(0xff362f2d); font = selectedFont; - (GHIDRA_CAST((selectedFont)))->Font::DrawString(GHIDRA_CAST(&local_3c._green),color_00,settings, + Font::DrawString(selectedFont,GHIDRA_CAST(&local_3c._green),color_00,settings, fVar6 - (float)(iVar4 / 2),fVar7 - 8.0); local_8 = 0xffffffff; local_48c = 0; @@ -507,7 +507,7 @@ LAB_008cfe75: animName = &DAT_00b75810; } sprintf_s(local_28 + 4,0x10,animName); - (GHIDRA_CAST((font)))->Font::get_string_width_n(local_28 + 4,-1); + Font::get_string_width_n(font,local_28 + 4,-1); fVar7 = renderX + *scoreNullFrame; fVar6 = renderY + scoreNullFrame[1]; fontSettings = 0; @@ -521,7 +521,7 @@ LAB_008cfe75: (GHIDRA_CAST((&local_478)))->KColor::SetFromARGB(0xff362f2d); pos.y = fVar6; pos.x = fVar7; - (GHIDRA_CAST((font)))->Font::DrawString(local_28 + 4,pos,(Vector)0x3f4000003f400000,color_01, + Font::DrawString(font,local_28 + 4,pos,(Vector)0x3f4000003f400000,color_01, GHIDRA_CAST(&fontSettings)); local_8 = 0xffffffff; } @@ -531,7 +531,7 @@ LAB_008cfe75: (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))),GHIDRA_CAST("BestStreak")), scoreNullFrame != GHIDRA_CAST(0x0))) { sprintf_s(GHIDRA_CAST(&local_3c._green),0x10,s__d); - (GHIDRA_CAST((font)))->Font::get_string_width_n(GHIDRA_CAST(&local_3c._green),-1); + Font::get_string_width_n(font,GHIDRA_CAST(&local_3c._green),-1); fVar7 = renderX + *scoreNullFrame; fVar6 = renderY + scoreNullFrame[1]; fontSettings = 0; @@ -545,14 +545,14 @@ LAB_008cfe75: (GHIDRA_CAST((&local_478)))->KColor::SetFromARGB(0xff362f2d); pos_00.y = fVar6; pos_00.x = fVar7; - (GHIDRA_CAST((font)))->Font::DrawString(GHIDRA_CAST(&local_3c._green),pos_00,(Vector)0x3f4000003f400000,color_02, + Font::DrawString(font,GHIDRA_CAST(&local_3c._green),pos_00,(Vector)0x3f4000003f400000,color_02, GHIDRA_CAST(&fontSettings)); } } } LAB_008d033d: sprintf_s(GHIDRA_CAST(&local_3c._blue),10,GHIDRA_CAST("%02d:%02d:%02d")); - uVar1 = (GHIDRA_CAST((font)))->Font::get_string_width_n(GHIDRA_CAST(&local_3c._blue),-1); + uVar1 = Font::get_string_width_n(font,GHIDRA_CAST(&local_3c._blue),-1); fVar7 = renderY + 78.0; fontSettings = 0; local_45c = 0xffff; @@ -564,7 +564,7 @@ LAB_008d033d: fVar6 = (398.0 - ((float)(uVar1 >> 1) + 0.0)) + renderX; local_8 = 5; (GHIDRA_CAST((&local_478)))->KColor::SetFromARGB(0xff362f2d); - (GHIDRA_CAST((font)))->Font::DrawString(GHIDRA_CAST(&local_3c._blue),color_03,&fontSettings,fVar6,fVar7); + Font::DrawString(font,GHIDRA_CAST(&local_3c._blue),color_03,&fontSettings,fVar6,fVar7); local_8 = 0xffffffff; (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x69])) + 0x1)))))))->GenericPopup::Render(); (GHIDRA_CAST((GHIDRA_CAST((this + 0xd0)))))->GenericPrompt::Render(); @@ -603,7 +603,7 @@ void Menu_DailyChallenge::load_graphics() anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/Menu_DailyRun.anm2",0x24); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { freeSize = anm2Path._capacity + 1; @@ -618,8 +618,8 @@ void Menu_DailyChallenge::load_graphics() } operator_delete(freeBlock,freeSize); } - (GHIDRA_CAST((GHIDRA_CAST((this + 0x13c)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x198)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((this + 0x13c))); + ANM2::Reset(GHIDRA_CAST((this + 0x198))); anm2Path._size = 0; anm2Path._capacity = 0xf; anm2Path._buf[0] = '\0'; @@ -631,7 +631,7 @@ void Menu_DailyChallenge::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/ScoreMenu.anm2",0x16); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x13c)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((this + 0x13c)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { freeSize = anm2Path._capacity + 1; @@ -657,7 +657,7 @@ void Menu_DailyChallenge::load_graphics() leaderboardPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(leaderboardPath._buf))) + 0x0))),"gfx/ui/LeaderboardMenu.anm2",0x1c); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST((this + 0x198)))))->ANM2::Load(&leaderboardPath,1); + ANM2::Load(GHIDRA_CAST((this + 0x198)),&leaderboardPath,1); local_14 = 0xffffffff; if (0xf < leaderboardPath._capacity) { freeSize = leaderboardPath._capacity + 1; diff --git a/generated-src/menu_dialog.cpp b/generated-src/menu_dialog.cpp index 32cc4a9..6244735 100644 --- a/generated-src/menu_dialog.cpp +++ b/generated-src/menu_dialog.cpp @@ -13,9 +13,9 @@ void MenuDialog::constructor() local_10 = ExceptionList; ExceptionList = &local_10; *GHIDRA_CAST(this) = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 4))); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x118)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 0x118))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x22c)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x230)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x234)) = 0; @@ -50,9 +50,9 @@ MenuDialog::~MenuDialog() puStack_c = &LAB_00af1f50; local_10 = ExceptionList; ExceptionList = &local_10; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 4))); secondSprite = GHIDRA_CAST((GHIDRA_INT(this) + 0x118)); - (GHIDRA_CAST((secondSprite)))->ANM2::Reset(); + ANM2::Reset(secondSprite); secondSprite = GHIDRA_CAST((GHIDRA_INT(this) + 0x244)); FID_conflict__Erase_tree_>_> (secondSprite,(fuzzer_allocator_> *)secondSprite, @@ -60,15 +60,15 @@ MenuDialog::~MenuDialog() operator_delete((void *)*secondSprite,0x20); vector_UserProfile_destroy((void *)(GHIDRA_INT(this) + 0x22c)); local_8 = 0; - (GHIDRA_CAST((secondSprite)))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x168)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x148)))))->AnimationState::~AnimationState(); + ANM2::Reset(secondSprite); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x168))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x148))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x130)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(secondSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x54)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x34)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 4))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x54))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x34))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x1c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 4)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; diff --git a/generated-src/menu_game.cpp b/generated-src/menu_game.cpp index 70af208..11626c2 100644 --- a/generated-src/menu_game.cpp +++ b/generated-src/menu_game.cpp @@ -21,15 +21,15 @@ void Menu_Game::destructor() } } local_8 = 1; - (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->ContinueWidgetSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->ContinueWidgetSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->ContinueWidgetSprite); + AnimationState::~AnimationState(&(this->ContinueWidgetSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->ContinueWidgetSprite)._animState); (GHIDRA_CAST(((this->ContinueWidgetSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->ContinueWidgetSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 2; - (GHIDRA_CAST((&this->GameMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->GameMenuSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->GameMenuSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->GameMenuSprite); + AnimationState::~AnimationState(&(this->GameMenuSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->GameMenuSprite)._animState); (GHIDRA_CAST(((this->GameMenuSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->GameMenuSprite))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -72,7 +72,7 @@ void Menu_Game::LoadGraphics() menuAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuAnmPath._buf))) + 0x0))),"gfx/ui/main menu/GameMenu.anm2",0x1f); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->ANM2::Load(&menuAnmPath,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 0x10)),&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar2 = menuAnmPath._capacity + 1; @@ -114,9 +114,9 @@ LAB_00980fe6: if ((uVar2 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((in_ECX + 0x54)) != '\0')))) goto LAB_00981012; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((in_ECX + 0x10)),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x40)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x40))); *GHIDRA_CAST((in_ECX + 0x54)) = 1; } LAB_00981012: @@ -132,7 +132,7 @@ LAB_00981012: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(widgetAnmPath._buf))) + 0x0))),"gfx/ui/main menu/ContinueProgress_Widget.anm2", 0x2e); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x124)))))->ANM2::Load(&widgetAnmPath,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 0x124)),&widgetAnmPath,1); local_14 = 0xffffffff; if (0xf < widgetAnmPath._capacity) { uVar2 = widgetAnmPath._capacity + 1; @@ -150,7 +150,7 @@ LAB_00981012: widgetAnmPath._size = 0; widgetAnmPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(widgetAnmPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(widgetAnmPath._buf)) + 0x0))) & 0xffffff00; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x124)))))->ANM2::SetAnimation(GHIDRA_CAST("Dissapear"),1); + ANM2::SetAnimation(GHIDRA_CAST((in_ECX + 0x124)),GHIDRA_CAST("Dissapear"),1); if (*GHIDRA_CAST((in_ECX + 0x158)) != 0) { AnimationState::AdvancePosition (GHIDRA_CAST((in_ECX + 0x154)),*GHIDRA_CAST((*GHIDRA_CAST((in_ECX + 0x158)) + 0x30)) + -1); @@ -211,7 +211,7 @@ void Menu_Game::Update() ExceptionList = &local_1c; piVar1 = (&seedsCopy)[1]._stageSeeds + 4; if ((g_menuManager->_selectedMenuID != 3) && - ((GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Dissapear"),1), + (ANM2::SetAnimation(&this->ContinueWidgetSprite,GHIDRA_CAST("Dissapear"),1), piVar1 = GHIDRA_CAST(puStack_20), (this->ContinueWidgetSprite)._animState._animData != (void *)0x0)) { AnimationState::AdvancePosition @@ -222,12 +222,12 @@ void Menu_Game::Update() puStack_20 = GHIDRA_CAST(piVar1); if ((g_manager->_framecount & 1) == 0) { if ((this->GameMenuSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->GameMenuSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->GameMenuSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->GameMenuSprite)._animState); + AnimationState::Update(&(this->GameMenuSprite)._overlayAnimState); } if ((this->ContinueWidgetSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->ContinueWidgetSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->ContinueWidgetSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->ContinueWidgetSprite)._animState); + AnimationState::Update(&(this->ContinueWidgetSprite)._overlayAnimState); } } manager = g_manager; @@ -250,7 +250,7 @@ void Menu_Game::Update() (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; (manager->_dailyChallenge)._isPractice = 0; - (GHIDRA_CAST((challengeParams)))->ChallengeParam::Reset(); + ChallengeParam::Reset(challengeParams); manager->_starting = 1; manager->_networkPlay = 0; manager->_consecutiveResetCount = 0; @@ -263,7 +263,7 @@ void Menu_Game::Update() (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; (manager->_dailyChallenge)._isPractice = 0; - (GHIDRA_CAST((challengeParams)))->ChallengeParam::Reset(); + ChallengeParam::Reset(challengeParams); manager->_starting = 1; manager->_networkPlay = 0; manager->_consecutiveResetCount = 0; @@ -498,7 +498,7 @@ LAB_00981960: LAB_00981965: if (cmpResult != 0) goto LAB_00981a25; PreRenderContinueImg(this); - (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&this->ContinueWidgetSprite,GHIDRA_CAST("Appear"),0); local_d4 = GHIDRA_CAST(0x11b); goto LAB_009819e5; } @@ -525,7 +525,7 @@ LAB_009818f3: cmpResult = 0; LAB_009818f8: if (cmpResult != 0) goto LAB_00981912; - (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&this->ContinueWidgetSprite,s_Idle,0); } else { LAB_00981881: @@ -555,7 +555,7 @@ LAB_009819c0: cmpResult = 0; LAB_009819c5: if (cmpResult != 0) { - (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::Play(GHIDRA_CAST("Dissapear"),0); + ANM2::Play(&this->ContinueWidgetSprite,GHIDRA_CAST("Dissapear"),0); local_d4 = GHIDRA_CAST(0x11c); LAB_009819e5: manager = g_manager; @@ -622,12 +622,12 @@ LAB_00981a25: fVar4 = 0.0; } *GHIDRA_CAST((GHIDRA_INT((this->GameMenuSprite)._animState._layerFrames) + GHIDRA_INT(local_e4.y) * 4)) = 0; - (GHIDRA_CAST((&(this->GameMenuSprite)._animState)))->AnimationState::AdvanceLayerPosition(GHIDRA_INT(local_e4.y),fVar4); + AnimationState::AdvanceLayerPosition(&(this->GameMenuSprite)._animState,GHIDRA_INT(local_e4.y),fVar4); LAB_00981c09: if ((g_menuControllerIndex == 0) || (isModsKeyVisible = 0, g_menuControllerIndex == -1)) { isModsKeyVisible = 1; } - modsKeyLayer = (GHIDRA_CAST((&this->GameMenuSprite)))->ANM2::GetLayer(GHIDRA_CAST("ModsKey")); + modsKeyLayer = ANM2::GetLayer(&this->GameMenuSprite,GHIDRA_CAST("ModsKey")); if (modsKeyLayer != GHIDRA_CAST(0x0)) { modsKeyLayer->_visible = isModsKeyVisible; } @@ -917,9 +917,9 @@ void Menu_Game::PreRenderContinueImg() imageCenter.x = (float)((double)iVar10 + __uint_to_double_fixup[-(iVar10 >> 0x1f)]) * 0.5; if (local_29c == GHIDRA_CAST(0x0)) { LAB_0098228c: - bVar4 = (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Character"),1); + bVar4 = ANM2::SetAnimation(&this->ContinueWidgetSprite,GHIDRA_CAST("Character"),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(this->ContinueWidgetSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->ContinueWidgetSprite)._animState); (this->ContinueWidgetSprite)._animState._isPlaying = 1; } } @@ -967,7 +967,7 @@ LAB_00982265: AnimationState::AdvanceLayerPosition (&(this->ContinueWidgetSprite)._animState,GHIDRA_INT(local_29c),(float)GHIDRA_INT(local_294)); } - layer = (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->ContinueWidgetSprite,GHIDRA_CAST(0x0)); layer->_visible = 1; local_294 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_gamestate))) + 0x19d7c)))); if (((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) && @@ -985,13 +985,13 @@ LAB_00982265: AnimationState::AdvanceLayerPosition (&(this->ContinueWidgetSprite)._animState,GHIDRA_INT(local_29c),(float)GHIDRA_INT(local_294)); } - layer = (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->ContinueWidgetSprite,GHIDRA_CAST(0x3)); layer->_visible = 1; } else { - layer = (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->ContinueWidgetSprite,GHIDRA_CAST(0x0)); layer->_visible = 0; - layer = (GHIDRA_CAST((&this->ContinueWidgetSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(&this->ContinueWidgetSprite,GHIDRA_CAST(0x3)); layer->_visible = 0; } local_294 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_gamestate))) + 0x8)))); @@ -1029,7 +1029,7 @@ LAB_00982265: ModManager::RenderCustomCharacterPortraits(secondAnimState,id,&imageCenter,color,&g_vectorOne); } if ((this->ContinueWidgetSprite)._animState._animData != (void *)0x0) { - local_29c = (GHIDRA_CAST((&(this->ContinueWidgetSprite)._animState)))->AnimationState::GetNullFrame(&DAT_00b6837c) + local_29c = AnimationState::GetNullFrame(&(this->ContinueWidgetSprite)._animState,&DAT_00b6837c) ; if (local_29c != GHIDRA_CAST(0x0)) { sprintf_s(GHIDRA_CAST(&local_30),9,GHIDRA_CAST("%02d:%02d:%02d")); @@ -1037,7 +1037,7 @@ LAB_00982265: manager = g_manager; fVar16 = imageCenter.x + *local_29c; fVar17 = imageCenter.y + local_29c[1]; - iVar7 = (GHIDRA_CAST((&g_manager->_font2_TeamMeatEx12)))->Font::get_string_width_n(GHIDRA_CAST(&local_30),-1); + iVar7 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,GHIDRA_CAST(&local_30),-1); fVar17 = fVar17 - 6.0; timeFontSettings = 0; local_260 = GHIDRA_CAST(0xffff); @@ -1060,7 +1060,7 @@ LAB_00982265: (GHIDRA_CAST((&local_244)))->KColor::SetFromARGB(0xff372b2d); pos.y = fVar17; pos.x = fVar16; - (GHIDRA_CAST((&manager->_font2_TeamMeatEx12)))->Font::DrawString(GHIDRA_CAST(&local_30),pos,*GHIDRA_CAST((pfVar5 + 4)), + Font::DrawString(&manager->_font2_TeamMeatEx12,GHIDRA_CAST(&local_30),pos,*GHIDRA_CAST((pfVar5 + 4)), color_00,GHIDRA_CAST(&timeFontSettings)); local_14 = 0xffffffff; manager = local_298; @@ -1099,7 +1099,7 @@ LAB_00982265: if (0xf < local_24c) { psVar8 = local_260; } - uVar6 = (GHIDRA_CAST((GHIDRA_CAST(local_2a4))))->Font::get_string_width_n(GHIDRA_CAST(psVar8),-1); + uVar6 = Font::get_string_width_n(GHIDRA_CAST(local_2a4),GHIDRA_CAST(psVar8),-1); if (uVar6 < 0x58) { vector_string_emplace_reallocate(&local_30,GHIDRA_CAST(0x0),GHIDRA_CAST(&local_260)); manager = local_30; @@ -1360,7 +1360,7 @@ LAB_009830f2: (GHIDRA_CAST((&local_244)))->KColor::SetFromARGB(0xff372b2d); fVar16 = local_29c[5]; fVar17 = local_29c[4]; - uVar6 = (GHIDRA_CAST((GHIDRA_CAST(local_2a4))))->Font::get_string_width_utf16(stageNameWide,-1); + uVar6 = Font::get_string_width_utf16(GHIDRA_CAST(local_2a4),stageNameWide,-1); Font::draw_string_wide (GHIDRA_CAST(local_2a4),stageNameWide,(float)local_298 - ((float)(uVar6 >> 1) + 0.0), local_2a0,fVar17,fVar16,color_01,tmpColor._colorize); @@ -1395,7 +1395,7 @@ LAB_009830f2: (GHIDRA_CAST((&local_244)))->KColor::SetFromARGB(0xff372b2d); fVar16 = local_29c[5]; fVar17 = local_29c[4]; - uVar6 = (GHIDRA_CAST((GHIDRA_CAST(local_2a4))))->Font::get_string_width_utf16(stageNameWide,-1); + uVar6 = Font::get_string_width_utf16(GHIDRA_CAST(local_2a4),stageNameWide,-1); Font::draw_string_wide (GHIDRA_CAST(local_2a4),stageNameWide,(float)local_298 - ((float)(uVar6 >> 1) + 0.0), local_2a0,fVar17,fVar16,color_02,tmpColor._colorize); diff --git a/generated-src/menu_key_config.cpp b/generated-src/menu_key_config.cpp index 389804e..dd86250 100644 --- a/generated-src/menu_key_config.cpp +++ b/generated-src/menu_key_config.cpp @@ -34,8 +34,8 @@ void Menu_KeyConfig::Update() g_manager->_isHotkeysEnabled = (char)this->State == '\0'; local_1c = this; if ((this->KeyConfigSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->KeyConfigSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->KeyConfigSprite)._animState); + AnimationState::Update(&(this->KeyConfigSprite)._overlayAnimState); } iVar5 = g_menuControllerIndex; local_20 = g_menuControllerIndex; @@ -320,7 +320,7 @@ LAB_008d9290: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + iVar5 * 4)) = 0; - (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar5,0.0); + AnimationState::AdvanceLayerPosition(&(this->KeyConfigSprite)._animState,iVar5,0.0); } LAB_008d92f5: local_8 = 3; @@ -450,7 +450,7 @@ void Menu_KeyConfig::Render() if (((this->KeyConfigSprite)._animState._animData == (void *)0x0) || ((this->KeyConfigSprite)._animState._isPlaying == 0)) { LAB_008d94f9: - (GHIDRA_CAST((GHIDRA_CAST(local_94.y))))->ANM2::Play(s_Idle,0); + ANM2::Play(GHIDRA_CAST(local_94.y),s_Idle,0); } else { keyName = (this->KeyConfigSprite)._animState._animData; @@ -543,7 +543,7 @@ LAB_008d94f5: (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; keyName = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST(actionLabels[row])); local_a0 = GHIDRA_CAST(((float)(rowOffset + -0x41) + fVar4)); - (GHIDRA_CAST((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,x,(float)local_a0); + Font::DrawString(font,keyName,&rowColor,&fontSettings,x,(float)local_a0); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); rowOffsetY = (float)rowOffset; if (controllerIndex == 0) { @@ -557,11 +557,11 @@ LAB_008d97fd: local_d0 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(primaryKey)); - layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(keyName,-1); + layerIndex = Font::get_string_width_n(font,keyName,-1); keyTextX = (originX + 400.0) - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(primaryKey)); - (GHIDRA_CAST((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0); + Font::DrawString(font,keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); } else { @@ -593,11 +593,11 @@ LAB_008d9977: local_d0 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(secondaryKey)); - layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(keyName,-1); + layerIndex = Font::get_string_width_n(font,keyName,-1); keyTextX = (originX + 300.0) - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); keyName = GHIDRA_CAST((**(code **)(*device + 0x10))(secondaryKey)); - (GHIDRA_CAST((font)))->Font::DrawString(keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0); + Font::DrawString(font,keyName,&rowColor,&fontSettings,keyTextX,(float)local_a0); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); } else { @@ -617,7 +617,7 @@ LAB_008d9977: } layerIndex = this->SelectedElement; if (currentRow == layerIndex) { - cursorLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); + cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); cursorLayer->_visible = 1; (this->KeyConfigSprite)._flipX = 1; if ((char)this->State == '\0') { @@ -767,7 +767,7 @@ LAB_008d9c3c: currentRow = row; } (this->KeyConfigSprite)._flipX = 0; - cursorLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); + cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); cursorLayer->_visible = 0; layerIndex = this->SelectedElement; } @@ -775,7 +775,7 @@ LAB_008d9c3c: rowOffset = rowOffset + rowHeight; } while (row < GHIDRA_INT((GHIDRA_UINT(isNameLess) * 4 + 0xf))); if (layerIndex != 0x13) goto LAB_008d9fde; - cursorLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); + cursorLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); cursorPos.x = originX + 75.0; cursorPos.y = originY + 390.0; cursorLayer->_visible = 1; @@ -824,7 +824,7 @@ LAB_008d9fb6: } } } - cursorLayer = (GHIDRA_CAST((GHIDRA_CAST(local_94.y))))->ANM2::GetLayer(&DAT_00000006); + cursorLayer = ANM2::GetLayer(GHIDRA_CAST(local_94.y),&DAT_00000006); cursorLayer->_visible = 0; LAB_008d9fde: local_14 = GHIDRA_CAST(0x4); @@ -1019,7 +1019,7 @@ LAB_008da445: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->KeyConfigSprite)._animState._layerFrames) + iVar4 * 4)) = 0; - (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar4,0.0); + AnimationState::AdvanceLayerPosition(&(this->KeyConfigSprite)._animState,iVar4,0.0); } LAB_008da4aa: local_8 = 1; @@ -1146,10 +1146,10 @@ LAB_008da5d5: (ppcVar1 = actionLabels + 0x1d, (this->KeyConfigSprite)._animState._isPlaying != 0)))) goto LAB_008da609; } - bVar2 = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(&this->KeyConfigSprite,s_Idle,1); ppcVar1 = GHIDRA_CAST(puStack_20); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->KeyConfigSprite)._animState); (this->KeyConfigSprite)._animState._isPlaying = 1; ppcVar1 = GHIDRA_CAST(puStack_20); } @@ -1213,9 +1213,9 @@ LAB_008da689: ((buttonName[0x34] == 0 || ((this->KeyConfigSprite)._animState._isPlaying != 0)))) goto LAB_008da6bd; } - bVar2 = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IdleUD"),1); + bVar2 = ANM2::SetAnimation(&this->KeyConfigSprite,GHIDRA_CAST("IdleUD"),1); if (bVar2 != 0) { - (GHIDRA_CAST((&(this->KeyConfigSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->KeyConfigSprite)._animState); (this->KeyConfigSprite)._animState._isPlaying = 1; } } @@ -1314,7 +1314,7 @@ LAB_008da6bd: (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; buttonName = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST(actionLabels[row])); local_84 = GHIDRA_CAST(((float)rowOffsetY + rowBaseY)); - (GHIDRA_CAST((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,x,(float)local_84); + Font::DrawString(font,buttonName,&drawColor,&drawParams,x,(float)local_84); drawParams = 0; local_c0 = 0xffff; local_bc = 0; @@ -1324,11 +1324,11 @@ LAB_008da6bd: local_ac = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(primaryButton)); - layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(buttonName,-1); + layerIndex = Font::get_string_width_n(font,buttonName,-1); buttonTextX = local_XMM1_Da_745 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(primaryButton)); - (GHIDRA_CAST((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84); + Font::DrawString(font,buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84); drawParams = 0; local_c0 = 0xffff; local_bc = 0; @@ -1338,15 +1338,15 @@ LAB_008da6bd: local_ac = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 3; buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(secondaryButton)); - layerIndex = (GHIDRA_CAST((font)))->Font::get_string_width_n(buttonName,-1); + layerIndex = Font::get_string_width_n(font,buttonName,-1); buttonTextX = (float)local_a8 - (float)((double)layerIndex + __uint_to_double_fixup[-(layerIndex >> 0x1f)]); buttonName = GHIDRA_CAST((**(code **)(*local_9c + 0x10))(secondaryButton)); - (GHIDRA_CAST((font)))->Font::DrawString(buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84); + Font::DrawString(font,buttonName,&drawColor,&drawParams,buttonTextX,(float)local_84); local_14 = GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8)); layerIndex = this->SelectedElement; if (currentRow == layerIndex) { - highlightLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); + highlightLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); highlightLayer->_visible = 1; (this->KeyConfigSprite)._flipX = 1; if ((char)this->State == '\0') { @@ -1496,7 +1496,7 @@ LAB_008daca2: currentRow = row; } (this->KeyConfigSprite)._flipX = 0; - highlightLayer = (GHIDRA_CAST((&this->KeyConfigSprite)))->ANM2::GetLayer(&DAT_00000006); + highlightLayer = ANM2::GetLayer(&this->KeyConfigSprite,&DAT_00000006); highlightLayer->_visible = 0; layerIndex = this->SelectedElement; } @@ -1505,7 +1505,7 @@ LAB_008daca2: } while (row < 0x14); if (layerIndex != 0x14) goto LAB_008db021; local_a8 = &this->KeyConfigSprite; - highlightLayer = (GHIDRA_CAST((local_a8)))->ANM2::GetLayer(&DAT_00000006); + highlightLayer = ANM2::GetLayer(local_a8,&DAT_00000006); cursorPos.x = originX + 75.0; cursorPos.y = originY + 430.0; highlightLayer->_visible = 1; @@ -1556,7 +1556,7 @@ LAB_008daff9: } } } - highlightLayer = (GHIDRA_CAST((local_a8)))->ANM2::GetLayer(&DAT_00000006); + highlightLayer = ANM2::GetLayer(local_a8,&DAT_00000006); highlightLayer->_visible = 0; LAB_008db021: local_14 = GHIDRA_CAST(0x4); diff --git a/generated-src/menu_lobby_list.cpp b/generated-src/menu_lobby_list.cpp index 643f643..24c2197 100644 --- a/generated-src/menu_lobby_list.cpp +++ b/generated-src/menu_lobby_list.cpp @@ -83,7 +83,7 @@ void Menu_LobbyList::render_lobbies() } else { lobbyListFrame = - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38)))))->AnimationState::GetNullFrame(GHIDRA_CAST("LobbyList")); + AnimationState::GetNullFrame(GHIDRA_CAST((GHIDRA_INT(this) + 0x38)),GHIDRA_CAST("LobbyList")); local_d0 = loadingFrame; } } @@ -101,7 +101,7 @@ void Menu_LobbyList::render_lobbies() local_e8 = local_14; local_e4 = local_14; pbVar1 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#Online/NO_LOBBIES")); - (GHIDRA_CAST((font)))->Font::DrawString(pbVar1,&textPos,GHIDRA_CAST((local_d0 + 4)),GHIDRA_CAST((GHIDRA_INT(this) + 0x374)), + Font::DrawString(font,pbVar1,&textPos,GHIDRA_CAST((local_d0 + 4)),GHIDRA_CAST((GHIDRA_INT(this) + 0x374)), &fontSettings); } else { @@ -191,7 +191,7 @@ void Menu_LobbyList::render_lobbies() local_e8 = 0; local_e4 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - (GHIDRA_CAST((font)))->Font::DrawStringScaled(pbVar1,&drawPos,GHIDRA_CAST((GHIDRA_INT(this) + 0x374)),&fontSettings); + Font::DrawStringScaled(font,pbVar1,&drawPos,GHIDRA_CAST((GHIDRA_INT(this) + 0x374)),&fontSettings); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; drawX = drawX + 85.0; drawPos.x = drawX; @@ -283,7 +283,7 @@ void Menu_LobbyList::render_lobbies() } animState = GHIDRA_CAST((GHIDRA_INT(this) + 0x260)); if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x264)) != 0) { - (GHIDRA_CAST((animState)))->AnimationState::SetFrameFloat((float)iVar2); + AnimationState::SetFrameFloat(animState,(float)iVar2); } if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x339)) != '\0') { if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x2a0)) == '\0') { @@ -326,12 +326,12 @@ LAB_008e0315: if (iVar2 == 0) { font = &g_manager->_font1_TeamMeatEx10; pbVar1 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#Online/IN_LOBBY")); - (GHIDRA_CAST((font)))->Font::DrawStringScaled(pbVar1,&drawPos,GHIDRA_CAST((GHIDRA_INT(this) + 0x374)),&fontSettings); + Font::DrawStringScaled(font,pbVar1,&drawPos,GHIDRA_CAST((GHIDRA_INT(this) + 0x374)),&fontSettings); } else if (iVar2 == 0x3e9) { font = &g_manager->_font1_TeamMeatEx10; pbVar1 = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#Online/IN_DEATHMATCH")); - (GHIDRA_CAST((font)))->Font::DrawStringScaled(pbVar1,&drawPos,GHIDRA_CAST((GHIDRA_INT(this) + 0x374)),&fontSettings); + Font::DrawStringScaled(font,pbVar1,&drawPos,GHIDRA_CAST((GHIDRA_INT(this) + 0x374)),&fontSettings); } else { Level::get_stage_display_name(&stageName,iVar2,GHIDRA_INT(fVar5),0,0,0,GHIDRA_UINT((1 < iVar3))); diff --git a/generated-src/menu_lobby_list_filters.cpp b/generated-src/menu_lobby_list_filters.cpp index 729569f..17ba78a 100644 --- a/generated-src/menu_lobby_list_filters.cpp +++ b/generated-src/menu_lobby_list_filters.cpp @@ -13,11 +13,11 @@ void Menu_LobbyListFilters::constructor() ExceptionList = &local_10; *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = 0; *GHIDRA_CAST(this) = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 8))); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 0x11c))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x230)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 0x230))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x344)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x348)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x34c)) = 0; @@ -37,7 +37,7 @@ void Menu_LobbyListFilters::constructor() *GHIDRA_CAST((GHIDRA_CAST(this) + 0x37c)) = 0x3e34b4b5; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x380)) = 0x3f800000; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x388)) = "gfx/ui/main menu/LobbyListFiltersMenu.anm2"; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38c)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 0x38c))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x4a0)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x4a8)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x4a4)) = 0; diff --git a/generated-src/menu_manager.cpp b/generated-src/menu_manager.cpp index f9b5a88..b7709e8 100644 --- a/generated-src/menu_manager.cpp +++ b/generated-src/menu_manager.cpp @@ -21,7 +21,7 @@ void MenuManager::constructor() this->_selectedMenuID = 0; (this->_ViewPosition).y = 0.0; (this->_ViewPosition).x = 0.0; - (GHIDRA_CAST((&this->_MenuShadowSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_MenuShadowSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x160)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x168)))) = 0; @@ -33,23 +33,23 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 5; (this->_menuTitle).PositionY = 0.0; (this->_menuTitle).PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuTitle).TitleScreenSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuTitle).TitleScreenSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2f0)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x308)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x30c)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x30c))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 7; _eh_vector_constructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x420))),0x114,3,ANM2::constructor,ANM2::~ANM2); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 8; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x764)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x764))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 9; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x878)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x878))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 10; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x98c)))) = KAGE::Network::Multiplayer::ConstLobby::vftable; KAGE::SmartPointer::SmartPointer(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x990)))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xb; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x998)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x998))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xac8))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xaac)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xab0)))) = 0; @@ -59,9 +59,9 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xc; (this->_menuGame).PositionY = 0.0; (this->_menuGame).PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuGame).GameMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuGame).GameMenuSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xd; - (GHIDRA_CAST((&(this->_menuGame).ContinueWidgetSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuGame).ContinueWidgetSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdc8)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdcc)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdd0)))) = 0xffffffff; @@ -71,20 +71,20 @@ void MenuManager::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xddc)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xde4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xde0)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xde8)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xde8))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0xf; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xefc)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf00)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf04)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf08)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf0c))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf10)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf10))))); (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1024)))))))->KColor::SetFromARGB(0xffffffff); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1038)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x103c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1040)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x10; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1044)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1044))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1174))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1158)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x115c)))) = 0; @@ -102,7 +102,7 @@ void MenuManager::constructor() (this->_menuSpecialSeeds).State = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuSpecialSeeds))) + 0x18)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuSpecialSeeds))) + 0x14)))) = 0; - (GHIDRA_CAST((&(this->_menuSpecialSeeds).SpecialSeedsSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuSpecialSeeds).SpecialSeedsSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x264c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x265c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2660)))) = 0xf; @@ -120,15 +120,15 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x14; (this->_menuChallenge).PositionY = 0.0; (this->_menuChallenge).PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuChallenge).ChallengeMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuChallenge).ChallengeMenuSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27b0)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27b4)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x15; (this->_menuCollection).PositionY = 0.0; (this->_menuCollection).PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuCollection).CollectionMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuCollection).CollectionMenuSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x16; - (GHIDRA_CAST((&(this->_menuCollection).DeathScreenSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuCollection).DeathScreenSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuCollection))) + 0x240)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuCollection))) + 0x244)))) = 0; (this->_menuCollection).MoveYAxisDirection = 0.0; @@ -139,9 +139,9 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x17; (this->_menuStats)._PositionY = 0.0; (this->_menuStats)._PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuStats)._StatsMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuStats)._StatsMenuSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x18; - (GHIDRA_CAST((&(this->_menuStats)._achievementsSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuStats)._achievementsSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x19; _eh_vector_constructor_iterator_ (&(this->_menuStats)._achievementMiniSprite1,0x114,0xb,ANM2::constructor,ANM2::~ANM2); @@ -154,26 +154,26 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1c; (this->_menuControllerSelect).PositionY = 0.0; (this->_menuControllerSelect).PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuControllerSelect).ControllerSelectSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuControllerSelect).ControllerSelectSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd278)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd27c)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd280)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1d; (this->_menuKeyConfig).PositionY = 0.0; (this->_menuKeyConfig).PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuKeyConfig).KeyConfigSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuKeyConfig).KeyConfigSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1e; (this->_menuCutscenes).PositionY = 0.0; (this->_menuCutscenes).PositionX = 0.0; - (GHIDRA_CAST((&(this->_menuCutscenes).CutscenesMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_menuCutscenes).CutscenesMenuSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x1f; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd4d4)))) = 0; this->_menuBestiary = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd4d8)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd4d8))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x20; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd5ec)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd5ec))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x21; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd700)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd700))))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd820)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd824)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd828)))) = 0; @@ -183,17 +183,17 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x22; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd854)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd850)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd858)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd858))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x23; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd978)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd974)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd97c)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd97c))))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xda94)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x24; *GHIDRA_CAST(&this->_menuOnline) = "gfx/ui/main menu/OnlineMenu.anm2"; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuOnline))) + 0x4)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuOnline))) + 0x4))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x25; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuOnline))) + 0x118)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_menuOnline))) + 0x118))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x26; (this->_menuOnline)._prevState = 1; (this->_menuOnline)._state = 0; @@ -205,13 +205,13 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x27; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdcf4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdcf0)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdcf8)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xdcf8))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x28; _eh_vector_constructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xde0c))),0x114,3,ANM2::constructor,ANM2::~ANM2); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x29; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe148)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe148))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x2a; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe25c)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe25c))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x2b; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe370)))) = 0xffffffff; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe374)))) = 0xffffffff; @@ -257,7 +257,7 @@ void MenuManager::constructor() (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x2f; (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xeb50)))))))->Menu_Options::constructor(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x30; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xedd8)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xedd8))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x31; _eh_vector_constructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xeeec))),0x120,6,FUN_008cb780,FUN_005cc630); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf5ac))) = 1; @@ -269,7 +269,7 @@ void MenuManager::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf5c4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf5c8)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x32; - (GHIDRA_CAST((&this->_onlineStatsMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_onlineStatsMenuSprite); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf6f0)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf6f8)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf6f4)))) = 0; @@ -310,7 +310,7 @@ void MenuManager::constructor() this->_scrollinterpolationX = 0.0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf814)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xf810)))) = 0; - (GHIDRA_CAST((&this->_flySprite)))->ANM2::constructor(); + ANM2::constructor(&this->_flySprite); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),0x34); create_menu_colormod_surface(); (this->_currentColorModState)._red = 1.0; @@ -344,23 +344,23 @@ MenuManager::~MenuManager() (GHIDRA_CAST(((void *)(GHIDRA_INT(in_ECX) + 0x160))))->KAGE::SmartPointer::reset((void *)0x0); KAGE::SmartPointer::reset(extraout_ECX); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf818)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf868)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf848)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf818))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf868))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf848))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf830)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf818)))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf5cc)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf61c)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf5fc)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf5cc))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf61c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf5fc))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf5e4)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xf5cc)))))->msvc::string::_Tidy_deallocate(); local_8 = 2; _eh_vector_destructor_iterator_((void *)(GHIDRA_INT(in_ECX) + 0xeeec),0x120,6,FUN_005cc630); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),3); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xedd8)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xee28)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xee08)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xedd8))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xee28))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xee08))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xedf0)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xedd8)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xeb50)))))->Menu_Options::~Menu_Options(); @@ -368,38 +368,38 @@ MenuManager::~MenuManager() FUN_008e7630(); FUN_008e4a20(); local_8 = 4; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd97c)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd9cc)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd9ac)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd97c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd9cc))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd9ac))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd994)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd97c)))))->msvc::string::_Tidy_deallocate(); local_8 = 5; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd858)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd8a8)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd888)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd858))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd8a8))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd888))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd870)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd858)))))->msvc::string::_Tidy_deallocate(); FUN_008c5d70(); local_8 = 6; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd3bc)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd40c)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd3ec)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd3bc))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd40c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd3ec))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd3d4)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd3bc)))))->msvc::string::_Tidy_deallocate(); this = GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd298)); local_8 = 7; - this->ANM2::Reset(); + ANM2::Reset(this); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),8); - this->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd2e8)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd2c8)))))->AnimationState::~AnimationState(); + ANM2::Reset(this); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd2e8))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd2c8))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd2b0)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(this))))->msvc::string::_Tidy_deallocate(); FUN_008c9e10(); local_8 = 9; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd164)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd1b4)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd194)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd164))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd1b4))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd194))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd17c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xd164)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xcecc)))))->Menu_Options::~Menu_Options(); @@ -412,9 +412,9 @@ MenuManager::~MenuManager() (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0xb90)))))->Menu_Game::destructor(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x2f4)))))->Menu_Save::~Menu_Save(); local_8 = 10; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x1dc)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x22c)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x20c)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x1dc))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x22c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x20c))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 500)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x1dc)))))->msvc::string::_Tidy_deallocate(); stringSet = GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x1cc)); @@ -444,9 +444,9 @@ MenuManager::~MenuManager() } } local_8 = 0xe; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x4c)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x9c)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x7c)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x4c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x9c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x7c))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 100)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(in_ECX) + 0x4c)))))->msvc::string::_Tidy_deallocate(); FID_conflict__Tidy(in_ECX); @@ -603,7 +603,7 @@ void MenuManager::Init() anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/MenuShadow.anm2",0x21); pvStack_14 = (void *)0x5; - (GHIDRA_CAST((&pMVar1->_MenuShadowSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&pMVar1->_MenuShadowSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -621,9 +621,9 @@ void MenuManager::Init() animData = (pMVar1->_MenuShadowSprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_00987942: - bVar2 = (GHIDRA_CAST((&pMVar1->_MenuShadowSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(&pMVar1->_MenuShadowSprite,s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(pMVar1->_MenuShadowSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pMVar1->_MenuShadowSprite)._animState); (pMVar1->_MenuShadowSprite)._animState._isPlaying = 1; } } @@ -665,7 +665,7 @@ LAB_00987929: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/fly.anm2",0x1a); pvStack_14 = (void *)0x6; - (GHIDRA_CAST((&pMVar1->_flySprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&pMVar1->_flySprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -683,9 +683,9 @@ LAB_00987929: animData = (pMVar1->_flySprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_00987a6a: - bVar2 = (GHIDRA_CAST((&pMVar1->_flySprite)))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(&pMVar1->_flySprite,s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(pMVar1->_flySprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pMVar1->_flySprite)._animState); (pMVar1->_flySprite)._animState._isPlaying = 1; } } @@ -730,7 +730,7 @@ LAB_00987a4b: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/TitleMenu.anm2",0x20); pvStack_14 = (void *)0x7; - (GHIDRA_CAST((titleSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(titleSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -773,9 +773,9 @@ LAB_00987bc9: ((animData[0x34] == 0 || ((pMVar1->_menuTitle).TitleScreenSprite._animState._isPlaying != 0)) )) goto LAB_00987c03; } - bVar2 = (GHIDRA_CAST((titleSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(titleSprite,s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(pMVar1->_menuTitle).TitleScreenSprite._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pMVar1->_menuTitle).TitleScreenSprite._animState); (pMVar1->_menuTitle).TitleScreenSprite._animState._isPlaying = 1; } LAB_00987c03: @@ -804,7 +804,7 @@ LAB_00987c03: anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/Menu_DailyRun.anm2",0x24); pvStack_14 = (void *)0x8; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pMVar1)) + 0xde8)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pMVar1)) + 0xde8)))),&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -849,7 +849,7 @@ LAB_00987c03: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/SeedsMenu.anm2",0x20); pvStack_14 = (void *)0x9; - (GHIDRA_CAST((&(pMVar1->_menuSpecialSeeds).SpecialSeedsSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(pMVar1->_menuSpecialSeeds).SpecialSeedsSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -881,7 +881,7 @@ LAB_00987c03: anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/ChallengeMenu.anm2",0x24); pvStack_14 = (void *)0xa; - (GHIDRA_CAST((&(pMVar1->_menuChallenge).ChallengeMenuSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(pMVar1->_menuChallenge).ChallengeMenuSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -908,7 +908,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/CollectionMenu.anm2"),0x24); pvStack_14 = (void *)0xb; - (GHIDRA_CAST((&(pMVar1->_menuCollection).CollectionMenuSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(pMVar1->_menuCollection).CollectionMenuSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -928,7 +928,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/Death Screen.anm2"),0x18); pvStack_14 = (void *)0xc; - (GHIDRA_CAST((&(pMVar1->_menuCollection).DeathScreenSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(pMVar1->_menuCollection).DeathScreenSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -958,7 +958,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/ModsMenu.anm2"),0x1e); pvStack_14 = (void *)0xd; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pMVar1)) + 0xd97c)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pMVar1)) + 0xd97c)))),&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -989,7 +989,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/ControllerSelectMenu.anm2"),0x2a); pvStack_14 = (void *)0xe; - (GHIDRA_CAST((&(pMVar1->_menuControllerSelect).ControllerSelectSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(pMVar1->_menuControllerSelect).ControllerSelectSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1004,7 +1004,7 @@ LAB_00987c03: } operator_delete(pvVar3,uVar4); } - (GHIDRA_CAST((&(pMVar1->_menuControllerSelect).ControllerSelectSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&(pMVar1->_menuControllerSelect).ControllerSelectSprite,s_Idle,0); FUN_008c9dd0(); (pMVar1->_menuControllerSelect).PositionX = aVStack_c0[0].y; (pMVar1->_menuControllerSelect).PositionY = (float)piStack_c4; @@ -1016,7 +1016,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/KeyConfigMenu.anm2"),0x23); pvStack_14 = (void *)0xf; - (GHIDRA_CAST((&(pMVar1->_menuKeyConfig).KeyConfigSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(pMVar1->_menuKeyConfig).KeyConfigSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1031,7 +1031,7 @@ LAB_00987c03: } operator_delete(pvVar3,uVar4); } - (GHIDRA_CAST((&(pMVar1->_menuKeyConfig).KeyConfigSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&(pMVar1->_menuKeyConfig).KeyConfigSprite,s_Idle,0); menuManager2 = g_menuManager; (pMVar1->_menuKeyConfig).PositionX = aVStack_c0[0].y; (pMVar1->_menuKeyConfig).PositionY = (float)piStack_c4; @@ -1048,7 +1048,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/EndingsMenu.anm2"),0x21); pvStack_14 = (void *)0x10; - (GHIDRA_CAST((&(pMVar1->_menuCutscenes).CutscenesMenuSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(pMVar1->_menuCutscenes).CutscenesMenuSprite,&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1078,7 +1078,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/ChallengeMenuCustom.anm2"),0x29); pvStack_14 = (void *)0x11; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pMVar1)) + 0xd858)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pMVar1)) + 0xd858)))),&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1109,7 +1109,7 @@ LAB_00987c03: piStack_c4 = GHIDRA_CAST(-pMVar1->_viewPositionSet[0x13].y); (GHIDRA_CAST((anm2Path._buf)))->msvc::string::string_from_cstr(*GHIDRA_CAST(&pMVar1->_menuOnline)); pvStack_14 = (void *)0x12; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((pMVar1->_menuOnline))) + 0x4)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((pMVar1->_menuOnline))) + 0x4)))),&anm2Path,1); pvStack_14 = (void *)0xffffffff; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::_Tidy_deallocate(); anm2Path._size = 0; @@ -1117,7 +1117,7 @@ LAB_00987c03: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/OnlineMenuSketches.anm2"),0x28); pvStack_14 = (void *)0x13; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((pMVar1->_menuOnline))) + 0x118)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((pMVar1->_menuOnline))) + 0x118)))),&anm2Path,1); pvStack_14 = (void *)0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1152,7 +1152,7 @@ LAB_00987c03: onlineStatsPath[0] = (void *)0x0; (GHIDRA_CAST((GHIDRA_CAST(onlineStatsPath))))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/OnlineStatsMenu.anm2"),0x25); pvStack_14 = (void *)0x14; - (GHIDRA_CAST((&pMVar1->_onlineStatsMenuSprite)))->ANM2::Load(GHIDRA_CAST(onlineStatsPath),1); + ANM2::Load(&pMVar1->_onlineStatsMenuSprite,GHIDRA_CAST(onlineStatsPath),1); pvStack_14 = (void *)0xffffffff; if (0xf < onlineStatsPathCapacity) { uVar4 = onlineStatsPathCapacity + 1; @@ -1192,48 +1192,48 @@ void MenuManager::unload_graphics() MenuManager *temp_3fc91b172b; temp_3fc91b172b = g_menuManager; - (GHIDRA_CAST((&(g_menuManager->_menuTitle).TitleScreenSprite)))->ANM2::Reset(); + ANM2::Reset(&(g_menuManager->_menuTitle).TitleScreenSprite); (GHIDRA_CAST((GHIDRA_CAST(&temp_3fc91b172b->_menuSave))))->Menu_Save::unload_graphics(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuGame).GameMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuGame).ContinueWidgetSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._BigCharPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._CharacterMenuBGSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._DifficultyOverlaySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._GreedDecoOverlaySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._CharacterPortraitsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._SeedEntrySprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._DifficultyPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._SeedPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._WinStreakPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._EastereggPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._SeedUnlockPageSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._PageSwapWidgetSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCharacter)._TaintedMenuBGDecoSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuSpecialSeeds).SpecialSeedsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuChallenge).ChallengeMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCollection).CollectionMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCollection).DeathScreenSprite)))->ANM2::Reset(); + ANM2::Reset(&(temp_3fc91b172b->_menuGame).GameMenuSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuGame).ContinueWidgetSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._BigCharPageSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._CharacterMenuBGSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._DifficultyOverlaySprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._GreedDecoOverlaySprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._CharacterPortraitsSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._SeedEntrySprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._DifficultyPageSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._SeedPageSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._WinStreakPageSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._EastereggPageSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._SeedUnlockPageSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._PageSwapWidgetSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCharacter)._TaintedMenuBGDecoSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuSpecialSeeds).SpecialSeedsSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuChallenge).ChallengeMenuSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCollection).CollectionMenuSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCollection).DeathScreenSprite); (GHIDRA_CAST((&temp_3fc91b172b->_menuStats)))->Menu_Stats::unload_graphics(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuOptions).OptionsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuControllerSelect).ControllerSelectSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuKeyConfig).KeyConfigSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(temp_3fc91b172b->_menuCutscenes).CutscenesMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xde8)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xf10)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0x1044)))))))->ANM2::Reset(); + ANM2::Reset(&(temp_3fc91b172b->_menuOptions).OptionsSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuControllerSelect).ControllerSelectSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuKeyConfig).KeyConfigSprite); + ANM2::Reset(&(temp_3fc91b172b->_menuCutscenes).CutscenesMenuSprite); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xde8))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xf10))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0x1044))))); (*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0x1174))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd4d8)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd5ec)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd700)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd858)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd97c)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd4d8))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd5ec))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd700))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd858))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xd97c))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xdce8))))))->Menu_OnlineLobby::unload_graphics(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xe650)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xe9d4)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((temp_3fc91b172b->_menuOnline))) + 0x4)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xeb74)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xe650))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xe9d4))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((temp_3fc91b172b->_menuOnline))) + 0x4))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xeb74))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fc91b172b)) + 0xedd8))))))->Menu_CreateLobby::unload_graphics(); - (GHIDRA_CAST((&temp_3fc91b172b->_onlineStatsMenuSprite)))->ANM2::Reset(); + ANM2::Reset(&temp_3fc91b172b->_onlineStatsMenuSprite); return; } @@ -1277,7 +1277,7 @@ void MenuManager::LoadGraphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/TitleMenu.anm2",0x20); local_14 = 0; - (GHIDRA_CAST((titleSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(titleSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1295,9 +1295,9 @@ void MenuManager::LoadGraphics() pbVar1 = (temp_3fd96d67c4->_menuTitle).TitleScreenSprite._animState._animData; if (pbVar1 == GHIDRA_CAST(0x0)) { LAB_00988edb: - bVar2 = (GHIDRA_CAST((titleSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(titleSprite,s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuTitle).TitleScreenSprite._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(temp_3fd96d67c4->_menuTitle).TitleScreenSprite._animState); (temp_3fd96d67c4->_menuTitle).TitleScreenSprite._animState._isPlaying = 1; } } @@ -1344,7 +1344,7 @@ LAB_00988ec5: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/SeedsMenu.anm2",0x20); local_14 = 1; - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuSpecialSeeds).SpecialSeedsSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(temp_3fd96d67c4->_menuSpecialSeeds).SpecialSeedsSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1370,7 +1370,7 @@ LAB_00988ec5: anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/ChallengeMenu.anm2",0x24); local_14 = 2; - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuChallenge).ChallengeMenuSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(temp_3fd96d67c4->_menuChallenge).ChallengeMenuSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1397,7 +1397,7 @@ LAB_00988ec5: anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/CollectionMenu.anm2",0x25); local_14 = 3; - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuCollection).CollectionMenuSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(temp_3fd96d67c4->_menuCollection).CollectionMenuSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1423,7 +1423,7 @@ LAB_00988ec5: anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19); local_14 = 4; - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuCollection).DeathScreenSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(temp_3fd96d67c4->_menuCollection).DeathScreenSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1452,7 +1452,7 @@ LAB_00988ec5: anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/ControllerSelectMenu.anm2",0x2b); local_14 = 5; - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuControllerSelect).ControllerSelectSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(temp_3fd96d67c4->_menuControllerSelect).ControllerSelectSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1496,7 +1496,7 @@ LAB_00989315: ((temp_3fd96d67c4->_menuControllerSelect).ControllerSelectSprite._animState._isPlaying != 0) ))) goto LAB_00989352; } - bVar2 = (GHIDRA_CAST((&(temp_3fd96d67c4->_menuControllerSelect).ControllerSelectSprite)))->ANM2::SetAnimation(s_Idle + bVar2 = ANM2::SetAnimation(&(temp_3fd96d67c4->_menuControllerSelect).ControllerSelectSprite,s_Idle ,1); if (bVar2 != 0) { AnimationState::Rewind @@ -1515,7 +1515,7 @@ LAB_00989352: anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/KeyConfigMenu.anm2",0x24); local_14 = 6; - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuKeyConfig).KeyConfigSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(temp_3fd96d67c4->_menuKeyConfig).KeyConfigSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1535,7 +1535,7 @@ LAB_00989352: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/EndingsMenu.anm2"),0x21); local_14 = 7; - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuCutscenes).CutscenesMenuSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&(temp_3fd96d67c4->_menuCutscenes).CutscenesMenuSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1550,7 +1550,7 @@ LAB_00989352: } operator_delete(freeBuf,uVar3); } - (GHIDRA_CAST((&(temp_3fd96d67c4->_menuCutscenes).CutscenesMenuSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&(temp_3fd96d67c4->_menuCutscenes).CutscenesMenuSprite,s_Idle,0); (GHIDRA_CAST((GHIDRA_CAST(&temp_3fd96d67c4->_menuDailyChallenge))))->Menu_DailyChallenge::load_graphics(); (GHIDRA_CAST((GHIDRA_CAST(&temp_3fd96d67c4->_menuBestiary))))->Menu_Bestiary::load_graphics(); anm2Path._size = 0; @@ -1558,7 +1558,7 @@ LAB_00989352: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/ChallengeMenuCustom.anm2"),0x29); local_14 = 8; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fd96d67c4)) + 0xd858)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fd96d67c4)) + 0xd858)))),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1579,7 +1579,7 @@ LAB_00989352: (*GHIDRA_CAST((GHIDRA_CAST(&(anm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/ModsMenu.anm2"),0x1e); local_14 = 9; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fd96d67c4)) + 0xd97c)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fd96d67c4)) + 0xd97c)))),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1608,7 +1608,7 @@ LAB_00989352: } while (bVar2 != 0); (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(pbVar1,GHIDRA_INT(strCursor) - GHIDRA_INT((pbVar1 + 1))); local_14 = 10; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((temp_3fd96d67c4->_menuOnline))) + 0x4)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((temp_3fd96d67c4->_menuOnline))) + 0x4)))),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -1623,7 +1623,7 @@ LAB_00989352: } operator_delete(freeBuf,uVar3); } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((temp_3fd96d67c4->_menuOnline))) + 0x4)))))))->ANM2::Play(s_Idle,0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((temp_3fd96d67c4->_menuOnline))) + 0x4)))),s_Idle,0); (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fd96d67c4)) + 0xeb50)))))))->Menu_Options::load_menu_anm2(); Menu_CreateLobby::load_graphics(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((temp_3fd96d67c4)) + 0xedd8))))); statsMenuAnm2Path._size = 0; @@ -1631,7 +1631,7 @@ LAB_00989352: (*GHIDRA_CAST((GHIDRA_CAST(&(statsMenuAnm2Path._buf)) + 0x0))) = (void *)0x0; (GHIDRA_CAST((statsMenuAnm2Path._buf)))->msvc::string::assign(GHIDRA_CAST("gfx/ui/main menu/OnlineStatsMenu.anm2"),0x25); local_14 = 0xb; - (GHIDRA_CAST((&temp_3fd96d67c4->_onlineStatsMenuSprite)))->ANM2::Load(&statsMenuAnm2Path,1); + ANM2::Load(&temp_3fd96d67c4->_onlineStatsMenuSprite,&statsMenuAnm2Path,1); local_14 = 0xffffffff; if (0xf < statsMenuAnm2Path._capacity) { uVar3 = statsMenuAnm2Path._capacity + 1; @@ -1649,7 +1649,7 @@ LAB_00989352: statsMenuAnm2Path._size = 0; statsMenuAnm2Path._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(statsMenuAnm2Path._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(statsMenuAnm2Path._buf)) + 0x0))) & 0xffffff00; - (GHIDRA_CAST((&temp_3fd96d67c4->_onlineStatsMenuSprite)))->ANM2::Play(s_Idle,0); + ANM2::Play(&temp_3fd96d67c4->_onlineStatsMenuSprite,s_Idle,0); ExceptionList = local_1c; return; } @@ -1728,8 +1728,8 @@ void MenuManager::Update() local_30 = g_menuManager; puVar1 = local_88 + 0x84; if ((g_menuManager->_MenuShadowSprite)._loaded != 0) { - (GHIDRA_CAST((&(g_menuManager->_MenuShadowSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(menu->_MenuShadowSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(g_menuManager->_MenuShadowSprite)._animState); + AnimationState::Update(&(menu->_MenuShadowSprite)._overlayAnimState); puVar1 = puStack_20; } puStack_20 = puVar1; @@ -1743,15 +1743,15 @@ void MenuManager::Update() local_24 = sin(((float)(manager->_framecount % 0x50) * 6.2831855) / 80.0); local_24 = local_24 + 8.0; local_38 = -local_24; - pLVar3 = (GHIDRA_CAST((&menu->_flySprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar3 = ANM2::GetLayer(&menu->_flySprite,GHIDRA_CAST(0x0)); (pLVar3->_pos).y = local_38; local_24 = local_24 * 0.4; - pLVar3 = (GHIDRA_CAST((&menu->_flySprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar3 = ANM2::GetLayer(&menu->_flySprite,GHIDRA_CAST(0x1)); (pLVar3->_pos).x = local_24; (pLVar3->_pos).y = local_24; if ((menu->_flySprite)._loaded != 0) { - (GHIDRA_CAST((&(menu->_flySprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(menu->_flySprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(menu->_flySprite)._animState); + AnimationState::Update(&(menu->_flySprite)._overlayAnimState); } iVar4 = menu->_selectedMenuID; if (menu->_state == 0) { @@ -1844,8 +1844,8 @@ void MenuManager::Update() case 1: if (((g_manager->_framecount & 1) == 0) && ((menu->_menuTitle).TitleScreenSprite._loaded != 0)) { - (GHIDRA_CAST((&(menu->_menuTitle).TitleScreenSprite._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(menu->_menuTitle).TitleScreenSprite._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(menu->_menuTitle).TitleScreenSprite._animState); + AnimationState::Update(&(menu->_menuTitle).TitleScreenSprite._overlayAnimState); } local_34 = -NAN; local_30 = GHIDRA_CAST(0xe); @@ -1937,16 +1937,16 @@ void MenuManager::Update() break; case 0x16: if (((g_manager->_framecount & 1) == 0) && ((menu->_onlineStatsMenuSprite)._loaded != 0)) { - (GHIDRA_CAST((&(menu->_onlineStatsMenuSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(menu->_onlineStatsMenuSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(menu->_onlineStatsMenuSprite)._animState); + AnimationState::Update(&(menu->_onlineStatsMenuSprite)._overlayAnimState); } Menu_OnlineAwards::Update(); - pLVar3 = (GHIDRA_CAST((&menu->_onlineStatsMenuSprite)))->ANM2::GetLayer(GHIDRA_CAST("Cursor")); + pLVar3 = ANM2::GetLayer(&menu->_onlineStatsMenuSprite,GHIDRA_CAST("Cursor")); if (pLVar3 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((&menu->_onlineStatsMenuSprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar3->_layerData), + ANM2::SetLayerFrame(&menu->_onlineStatsMenuSprite,*GHIDRA_CAST(pLVar3->_layerData), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((menu)) + 0xf6f0))))); } } @@ -2078,7 +2078,7 @@ void MenuManager::Render() (GHIDRA_CAST((&menuManager->_menuOptions)))->Menu_Options::Render(); Menu_Cutscenes::Render(); (GHIDRA_CAST((GHIDRA_CAST(&menuManager->_menuCustomChallenge))))->Menu_CustomChallenge::Render(); - (GHIDRA_CAST((GHIDRA_CAST(&menuManager->_menuMods))))->AnimationLayer::RenderFrame(); + AnimationLayer::RenderFrame(GHIDRA_CAST(&menuManager->_menuMods)); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((menuManager)) + 0xe648))))))->Menu_OnlineLobby::Render(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((menuManager)) + 0xdce8))))))->Menu_OnlineLobby::Render(); (GHIDRA_CAST((&menuManager->_menuOnline)))->Menu_Online::Render(); @@ -2509,7 +2509,7 @@ LAB_0098ac76: isAllMarks = has_all_completion_marks(); (this->_menuGame).GameMenuSprite._filename._buf[iVar3 + -0x442] = isAllMarks; (GHIDRA_CAST((GHIDRA_CAST(&this->_menuSave))))->Menu_Save::update_save_drawings(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT((&this->_menuTitle + 1)) + iVar3 * 0x114 + 0x1c)))))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(GHIDRA_CAST((GHIDRA_INT((&this->_menuTitle + 1)) + iVar3 * 0x114 + 0x1c)),unk); (GHIDRA_CAST((&this->_menuCharacter)))->Menu_Character::set_character_menu_shown(0); } else if (state == 4) { diff --git a/generated-src/menu_mod_challenges.cpp b/generated-src/menu_mod_challenges.cpp index 0657a95..4fc5446 100644 --- a/generated-src/menu_mod_challenges.cpp +++ b/generated-src/menu_mod_challenges.cpp @@ -38,9 +38,9 @@ LAB_008cebd5: if ((compareResult == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x54)) != '\0')))) goto LAB_008cec02; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x10)))))->ANM2::SetAnimation(&DAT_00b6767c,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x10)),&DAT_00b6767c,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x40)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x40))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x54)) = 1; } LAB_008cec02: diff --git a/generated-src/menu_mods.cpp b/generated-src/menu_mods.cpp index f19abe4..b328263 100644 --- a/generated-src/menu_mods.cpp +++ b/generated-src/menu_mods.cpp @@ -189,9 +189,9 @@ LAB_008e49b5: if ((compareResult == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((this + 0x1c)) != '\0')))) goto LAB_008e49e2; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))))))->ANM2::SetAnimation(&DAT_00b6767c,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))),&DAT_00b6767c,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1))))); *GHIDRA_CAST((this + 0x1c)) = 1; } LAB_008e49e2: diff --git a/generated-src/menu_online.cpp b/generated-src/menu_online.cpp index 8c06e53..6ac6d3a 100644 --- a/generated-src/menu_online.cpp +++ b/generated-src/menu_online.cpp @@ -31,7 +31,7 @@ void Menu_Online::render_mode_select() local_14 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U; isKeyboard = g_menuControllerIndex == 0; lobbyGameMode = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((g_manager->_lobbySettings))) + 0x4)))); - backKeyLayer = (GHIDRA_CAST((in_ECX)))->ANM2::GetLayer(GHIDRA_CAST("BackKey")); + backKeyLayer = ANM2::GetLayer(in_ECX,GHIDRA_CAST("BackKey")); local_48 = 0; backKeyLayer->_visible = isKeyboard; pvStack_5c = in_ECX[7]._overlayAnimState._nullLayerFrames; @@ -74,7 +74,7 @@ void Menu_Online::render_mode_select() gameMode = iVar1; do { if (((iVar1 != 4) || (buttonIdx != 4)) && ((in_ECX->_animState)._animData != (void *)0x0)) { - nullFrame = (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::GetNullFrame((&PTR_DAT_00b756f0)[buttonIdx]); + nullFrame = AnimationState::GetNullFrame(&in_ECX->_animState,(&PTR_DAT_00b756f0)[buttonIdx]); if (nullFrame != GHIDRA_CAST(0x0)) { nullPos.x = originX + *nullFrame + 0.0; nullPos.y = (float)-*GHIDRA_CAST((buttonLoaded + 0x13)) + originY + nullFrame[1]; @@ -100,7 +100,7 @@ void Menu_Online::render_mode_select() buttonLoaded = buttonLoaded + 0x120; } while (buttonIdx < 6); if ((iVar1 == 4) && ((in_ECX->_animState)._animData != (void *)0x0)) { - nullFrame = (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("ChallengeBox")); + nullFrame = AnimationState::GetNullFrame(&in_ECX->_animState,GHIDRA_CAST("ChallengeBox")); if (nullFrame != GHIDRA_CAST(0x0)) { nullPos.x = originX + *nullFrame; nullPos.y = originY + nullFrame[1]; @@ -117,7 +117,7 @@ void Menu_Online::render_mode_select() nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("BackButton")); + nullFrame = AnimationState::GetNullFrame(&in_ECX->_animState,GHIDRA_CAST("BackButton")); } nullPos.x = *nullFrame + menuPos.x; nullPos.y = nullFrame[1] + menuPos.y; @@ -154,8 +154,8 @@ void Menu_Online::Update() return; } if (((g_manager->_framecount & 1) == 0) && ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x10d))) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54))))); } upAction = 0x16; isActionTriggered = @@ -213,11 +213,11 @@ LAB_008e4c65: if (iVar2 != 4) goto LAB_008e4cc5; entryAnim = "Options"; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x118)))))))->ANM2::Play(GHIDRA_CAST(entryAnim),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x118)))),GHIDRA_CAST(entryAnim),0); LAB_008e4cc5: if (((g_manager->_framecount & 1) != 0) && ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x221))) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x148)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x168)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x148))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x168))))); } menuAction = 0xe; isActionTriggered = @@ -257,12 +257,12 @@ LAB_008e4cc5: MenuManager::push_menu(0x14,unused); } } - cursorLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))))))->ANM2::GetLayer(GHIDRA_CAST("Cursor")); + cursorLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))),GHIDRA_CAST("Cursor")); if (cursorLayer == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))))))->ANM2::SetLayerFrame(*GHIDRA_CAST(cursorLayer->_layerData),this->_state); + ANM2::SetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))),*GHIDRA_CAST(cursorLayer->_layerData),this->_state); return; } @@ -298,7 +298,7 @@ void Menu_Online::Render() local_24 = __security_cookie ^ GHIDRA_UINT((GHIDRA_INT(&descriptor) + 0x34U)); ExceptionList = &local_1c; isKeyboard = g_menuControllerIndex == 0; - backKeyLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))))))->ANM2::GetLayer(GHIDRA_CAST("BackKey")); + backKeyLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))),GHIDRA_CAST("BackKey")); backKeyLayer->_visible = isKeyboard; renderPos.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST((this + 1)); renderPos.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))); @@ -478,9 +478,9 @@ void Menu_Online::enter() animData = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))); if (animData == GHIDRA_CAST(0x0)) { LAB_008e52d3: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x48))) = 1; } } @@ -604,7 +604,7 @@ void Menu_Online::start_quick_match() (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; (manager->_dailyChallenge)._isPractice = 0; - (GHIDRA_CAST((&(manager->_dailyChallenge)._params)))->ChallengeParam::Reset(); + ChallengeParam::Reset(&(manager->_dailyChallenge)._params); (GHIDRA_CAST((&g_manager->_lobbySettings)))->LobbySettings::reset(); popupSize.x = (float)&DAT_bf800000; popupSize.y = (float)&DAT_bf800000; @@ -885,7 +885,7 @@ LAB_008e5f30: if (0xf < psVar1[-1]._capacity) { lineChars = *GHIDRA_CAST(psVar3->_buf); } - uVar4 = (GHIDRA_CAST((font)))->Font::get_string_width_n(GHIDRA_CAST(lineChars),-1); + uVar4 = Font::get_string_width_n(font,GHIDRA_CAST(lineChars),-1); if (0x9f < uVar4) { local_44 = GHIDRA_CAST(*lastLineSize); puVar5 = local_44 + -1; @@ -939,7 +939,7 @@ LAB_008e5d7f: if (0xf < lineChars->_capacity) { psVar1 = *GHIDRA_CAST(lineChars->_buf); } - pvVar2 = (GHIDRA_CAST((font)))->Font::measure_string(tmpLine._buf + 8,GHIDRA_CAST(psVar1),&fontParams,&g_vectorOne); + pvVar2 = Font::measure_string(font,tmpLine._buf + 8,GHIDRA_CAST(psVar1),&fontParams,&g_vectorOne); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 5; color._blue = 0.1764706; color._red = 0.21176471; @@ -1533,7 +1533,7 @@ void Menu_Online::render_descriptions() if (0xf < tmpStringCapacity) { pppppbVar4 = tmpString[0]; } - (GHIDRA_CAST((pFVar3)))->Font::DrawStringScaled(GHIDRA_CAST(pppppbVar4),&labelPos,&textColor,&fontSettings); + Font::DrawStringScaled(pFVar3,GHIDRA_CAST(pppppbVar4),&labelPos,&textColor,&fontSettings); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0; if (0xf < tmpStringCapacity) { uVar5 = tmpStringCapacity + 1; @@ -1566,7 +1566,7 @@ void Menu_Online::render_descriptions() local_78 = 0; local_7c = 0xffff; fontSettings = 2; - (GHIDRA_CAST((&g_manager->_font1_TeamMeatEx10)))->Font::DrawStringScaled(countText,pos,&textColor,&fontSettings); + Font::DrawStringScaled(&g_manager->_font1_TeamMeatEx10,countText,pos,&textColor,&fontSettings); rowY = rowY + 14.0; labelPos.y = rowY; if (statIndex == *GHIDRA_CAST((in_ECX + 0x124))) { @@ -1646,7 +1646,7 @@ void Menu_Online::render_descriptions() if (0xf < descriptionTextCapacity) { pppppbVar4 = descriptionText[0]; } - (GHIDRA_CAST((pFVar3)))->Font::DrawStringScaled(GHIDRA_CAST(pppppbVar4),&descriptionPos,&textColor,&fontSettings); + Font::DrawStringScaled(pFVar3,GHIDRA_CAST(pppppbVar4),&descriptionPos,&textColor,&fontSettings); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 5; if (0xf < descriptionTextCapacity) { uVar5 = descriptionTextCapacity + 1; diff --git a/generated-src/menu_online_lobby.cpp b/generated-src/menu_online_lobby.cpp index 94ee907..8d53200 100644 --- a/generated-src/menu_online_lobby.cpp +++ b/generated-src/menu_online_lobby.cpp @@ -22,8 +22,8 @@ void Menu_OnlineLobby::update_list_cursor() manager = g_manager; if (*GHIDRA_CAST((in_ECX + 0x10d)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x34)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x54)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x34))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x54))); } if (*GHIDRA_CAST((in_ECX + 0x124)) == '\0') { return; @@ -252,12 +252,12 @@ LAB_008db56d: soundId = 0x11a; seed_fart_sound_override(&soundId); (GHIDRA_CAST((&pMVar4->_sfxManager)))->SoundEffects::Play(soundId,1.0,2,0,1.0,0.0); - cursorLayer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::GetLayer(GHIDRA_CAST("Cursor")); + cursorLayer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 4)),GHIDRA_CAST("Cursor")); if (cursorLayer == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::SetLayerFrame(*GHIDRA_CAST(cursorLayer->_layerData), + ANM2::SetLayerFrame(GHIDRA_CAST((in_ECX + 4)),*GHIDRA_CAST(cursorLayer->_layerData), *GHIDRA_CAST((in_ECX + 0x118))); } } @@ -462,188 +462,188 @@ LAB_008db9bb: } pcVar5 = GHIDRA_CAST(s_Idle); } - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST(pcVar5),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST(pcVar5),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(sprite) + 0x34)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(sprite) + 0x34))); *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x48)) = 1; } LAB_008db9ec: - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("BackKey")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("BackKey")); pLVar4->_visible = isKeyboard; if (*GHIDRA_CAST((GHIDRA_CAST(local_20.y) + 0x4b0d8)) == 2) { local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x141)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75678); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75678); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); bVar7 = *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x142)) == '\0'; } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); bVar7 = *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x142)) == '\0'; } } else { local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x130)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75678); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75678); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } bVar7 = *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x131)) == '\0'; } local_20.y = (float)GHIDRA_UINT(!bVar7); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75680); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75680); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x132)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75668); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75668); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x133)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75670); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75670); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x134)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b756d4); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b756d4); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x13f)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75c14); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75c14); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x140)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75bf8); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75bf8); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x136)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75c00); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75c00); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x137)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00b75be8); + pLVar4 = ANM2::GetLayer(sprite,&DAT_00b75be8); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x138)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box10")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box10")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x139)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box11")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box11")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x13a)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box12")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box12")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x13b)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box13")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box13")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x13c)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box14")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box14")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x13d)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box15")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box15")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x13e)) != '\0')); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box16")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box16")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 300)) == 3)); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box17")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box17")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 300)) == 0)); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box18")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box18")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 300)) == 1)); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box19")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box19")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.y = (float)GHIDRA_UINT((*GHIDRA_CAST((GHIDRA_CAST(sprite) + 300)) == 2)); - pLVar4 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Box20")); + pLVar4 = ANM2::GetLayer(sprite,GHIDRA_CAST("Box20")); if (pLVar4 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar4->_layerData),GHIDRA_INT(local_20.y)); } local_20.x = (g_menuManager->_ViewPosition).x + *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x11c)); local_20.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST((GHIDRA_CAST(sprite) + 0x120)); @@ -666,7 +666,7 @@ LAB_008db9ec: } else { backButtonOffset = - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(sprite) + 0x34)))))->AnimationState::GetNullFrame(GHIDRA_CAST("BackButton")); + AnimationState::GetNullFrame(GHIDRA_CAST((GHIDRA_INT(sprite) + 0x34)),GHIDRA_CAST("BackButton")); } local_20.y = backButtonOffset[1] + local_20.y; local_20.x = *backButtonOffset + local_20.x; @@ -779,7 +779,7 @@ void Menu_OnlineLobby::Render() LAB_008ddc52: isLayerVisible = 0; } - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("ArrowUp")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("ArrowUp")); layer->_visible = isLayerVisible; if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x344)) == '\0') { iVar7 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x354)) - *GHIDRA_CAST((GHIDRA_CAST(this) + 0x350)); @@ -794,36 +794,36 @@ LAB_008ddc52: LAB_008ddce7: isLayerVisible = 0; } - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("ArrowDown")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("ArrowDown")); isKeyboard = g_menuControllerIndex == 0; layer->_visible = isLayerVisible; isLayerVisible = isKeyboard; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("CreateButton")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("CreateButton")); layer->_visible = isLayerVisible; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("RefreshButton")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("RefreshButton")); layer->_visible = isLayerVisible; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("FiltersButton")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("FiltersButton")); layer->_visible = isLayerVisible; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("BackButton")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("BackButton")); layer->_visible = isLayerVisible; if (((local_30 == GHIDRA_CAST(0x1)) || (g_menuControllerIndex != 0)) || (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x500)) != '\0')) { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("EnterPasswordButton")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("EnterPasswordButton")); layer->_visible = 0; if (local_30 != GHIDRA_CAST(0x1)) goto LAB_008ddd97; LAB_008ddda4: isLayerVisible = 0; } else { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("EnterPasswordButton")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("EnterPasswordButton")); layer->_visible = 1; LAB_008ddd97: isLayerVisible = 1; if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x500)) != '\0') goto LAB_008ddda4; } - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("EnterPasswordText")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("EnterPasswordText")); layer->_visible = isLayerVisible; - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("EnterPasswordPaper")); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("EnterPasswordPaper")); layer->_visible = isPasswordPaperVisible; if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x111)) != '\0') { if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x78)) == '\0') { @@ -847,7 +847,7 @@ LAB_008ddd97: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("CreateButton Position")); + nullFrame = AnimationState::GetNullFrame(animState,GHIDRA_CAST("CreateButton Position")); } scale.y = g_vectorOne.y; scale.x = g_vectorOne.x; @@ -867,7 +867,7 @@ LAB_008ddd97: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("RefreshButton Position")); + nullFrame = AnimationState::GetNullFrame(animState,GHIDRA_CAST("RefreshButton Position")); } local_70.y = originY + nullFrame[1]; scale_00.y = g_vectorOne.y; @@ -893,7 +893,7 @@ LAB_008ddd97: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("FiltersButton Position")); + nullFrame = AnimationState::GetNullFrame(animState,GHIDRA_CAST("FiltersButton Position")); } local_70.y = originY + nullFrame[1]; scale_01.y = g_vectorOne.y; @@ -919,7 +919,7 @@ LAB_008ddd97: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("BackButton Postion")); + nullFrame = AnimationState::GetNullFrame(animState,GHIDRA_CAST("BackButton Postion")); } local_70.y = originY + nullFrame[1]; scale_02.y = g_vectorOne.y; @@ -946,7 +946,7 @@ LAB_008ddd97: nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((animState)))->AnimationState::GetNullFrame(GHIDRA_CAST("EnterPasswordButton Postion")); + nullFrame = AnimationState::GetNullFrame(animState,GHIDRA_CAST("EnterPasswordButton Postion")); } local_70.y = originY + nullFrame[1]; local_70.x = originX + *nullFrame; @@ -963,7 +963,7 @@ LAB_008ddd97: local_30 = GHIDRA_CAST(0x0); } else { - local_30 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38)))))->AnimationState::GetNullFrame(GHIDRA_CAST("Loading")); + local_30 = AnimationState::GetNullFrame(GHIDRA_CAST((GHIDRA_INT(this) + 0x38)),GHIDRA_CAST("Loading")); if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x3c)) == 0) { pvVar8 = (void *)0x0; } @@ -1029,7 +1029,7 @@ LAB_008ddd97: local_78.x = originX + *local_30; local_78.y = originY + local_30[1]; loadingText = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#LOADING")); - (GHIDRA_CAST((font)))->Font::DrawString(loadingText,&local_78,GHIDRA_CAST((local_30 + 4)), + Font::DrawString(font,loadingText,&local_78,GHIDRA_CAST((local_30 + 4)), GHIDRA_CAST((GHIDRA_INT(this) + 0x374)),&local_60); local_14 = 0xffffffff; } @@ -1112,7 +1112,7 @@ void Menu_OnlineLobby::render_lobby_list() puStack_20 = countText + 0xa4; } else { - local_b0 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(cursorAnim) + 0x38)))))->AnimationState::GetNullFrame(GHIDRA_CAST("Loading")); + local_b0 = AnimationState::GetNullFrame(GHIDRA_CAST((GHIDRA_INT(cursorAnim) + 0x38)),GHIDRA_CAST("Loading")); if (*GHIDRA_CAST((GHIDRA_CAST(cursorAnim) + 0x3c)) == 0) { pfVar1 = GHIDRA_CAST(0x0); } @@ -1134,7 +1134,7 @@ void Menu_OnlineLobby::render_lobby_list() textPos.x = cursorX + *local_b0; textPos.y = local_bc + local_b0[1]; text = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#Online/NO_FRIEND_LOBBIES")); - (GHIDRA_CAST((font)))->Font::DrawString(text,&textPos,GHIDRA_CAST((local_b0 + 4)),GHIDRA_CAST((GHIDRA_INT(cursorAnim) + 0x374)), + Font::DrawString(font,text,&textPos,GHIDRA_CAST((local_b0 + 4)),GHIDRA_CAST((GHIDRA_INT(cursorAnim) + 0x374)), &drawParams); } else { @@ -1232,7 +1232,7 @@ void Menu_OnlineLobby::render_lobby_list() local_d0._alpha = 0.0; local_d0._unk = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - (GHIDRA_CAST((font)))->Font::DrawStringScaled(text,&drawPos,GHIDRA_CAST((GHIDRA_INT(cursorAnim) + 0x374)),&drawParams); + Font::DrawStringScaled(font,text,&drawPos,GHIDRA_CAST((GHIDRA_INT(cursorAnim) + 0x374)),&drawParams); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; drawPos.x = cursorX + 85.0; cursorX = drawPos.x; @@ -1306,7 +1306,7 @@ void Menu_OnlineLobby::unload_graphics() puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x10)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x10))); spriteCursor = GHIDRA_CAST((GHIDRA_INT(this) + 0x14c)); remaining = 3; do { @@ -1319,8 +1319,8 @@ void Menu_OnlineLobby::unload_graphics() } spriteCursor[-6] = 0; *GHIDRA_CAST(strBuf) = 0; - (GHIDRA_CAST((GHIDRA_CAST((spriteCursor + 2)))))->AnimationState::SetAnimationData((void *)0x0); - (GHIDRA_CAST((GHIDRA_CAST((spriteCursor + 10)))))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteCursor + 2)),(void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteCursor + 10)),(void *)0x0); strBuf = spriteCursor + -4; if (0xf < GHIDRA_UINT(spriteCursor[1])) { strBuf = GHIDRA_CAST(*strBuf); @@ -1425,7 +1425,7 @@ void Menu_OnlineLobby::load_graphics() lobbyAnmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(lobbyAnmPath._buf))) + 0x0))),"gfx/ui/main menu/OnlineLobby.anm2",0x22); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->ANM2::Load(&lobbyAnmPath,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 0x10)),&lobbyAnmPath,1); local_14 = 0xffffffff; if (0xf < lobbyAnmPath._capacity) { size = lobbyAnmPath._capacity + 1; @@ -1456,7 +1456,7 @@ LAB_008e803b: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((*GHIDRA_CAST((in_ECX + 0x48)) + layerId * 4)) = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x40)))))->AnimationState::AdvanceLayerPosition(layerId,(float)gameMode); + AnimationState::AdvanceLayerPosition(GHIDRA_CAST((in_ECX + 0x40)),layerId,(float)gameMode); } LAB_008e80ce: playerInfoIdx = 0; @@ -1473,7 +1473,7 @@ LAB_008e80ce: playerInfoAnmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(playerInfoAnmPath._buf))) + 0x0))),"gfx/ui/main menu/OnlineLobby.anm2",0x22); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((playerInfoAnim + -0xd)))))->ANM2::Load(&playerInfoAnmPath,1); + ANM2::Load(GHIDRA_CAST((playerInfoAnim + -0xd)),&playerInfoAnmPath,1); local_14 = 0xffffffff; if (0xf < playerInfoAnmPath._capacity) { uVar2 = playerInfoAnmPath._capacity + 1; @@ -1492,9 +1492,9 @@ LAB_008e80ce: (*GHIDRA_CAST((GHIDRA_CAST(&(playerInfoAnmPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(playerInfoAnmPath._buf)) + 0x0))) & 0xffffff00; if (animData == GHIDRA_CAST(0x0)) { LAB_008e81e3: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((playerInfoAnim + -0xd)))))->ANM2::SetAnimation(GHIDRA_CAST("PlayerInfo"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((playerInfoAnim + -0xd)),GHIDRA_CAST("PlayerInfo"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((playerInfoAnim + -1)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((playerInfoAnim + -1))); *GHIDRA_CAST((playerInfoAnim + 4)) = 1; } } @@ -1729,13 +1729,13 @@ LAB_008e85f9: local_62 = '\x01'; } if ((pMVar10->_framecount & 1) == 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::Update(); + ANM2::Update(GHIDRA_CAST((in_ECX + 4))); animState = GHIDRA_CAST((in_ECX + 0x55)); local_74[0] = (void *)0x3; do { if (*GHIDRA_CAST((GHIDRA_INT(&animState[6]._currentlyTriggeredEvents) + 1)) != '\0') { - (GHIDRA_CAST((animState)))->AnimationState::Update(); - (GHIDRA_CAST((animState + 1)))->AnimationState::Update(); + AnimationState::Update(animState); + AnimationState::Update(animState + 1); } animState = GHIDRA_CAST(&animState[8]._isPlaying); local_74[0] = GHIDRA_CAST((GHIDRA_INT(local_74[0]) + -1)); @@ -1750,7 +1750,7 @@ LAB_008e85f9: if ((*GHIDRA_CAST((GHIDRA_CAST(localMember) + 9)) != '\0') && (localMember = lobby_member_map_get_or_add(puVar12,GHIDRA_CAST((in_ECX + 0x1a8))), *GHIDRA_CAST((GHIDRA_CAST(localMember) + 8)) == '\n')) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x15d)))))->ANM2::Update(); + ANM2::Update(GHIDRA_CAST((in_ECX + 0x15d))); } if (((in_ECX[0x1b9] == 1) || (in_ECX[0x1b9] == 2)) || (local_62 != '\0')) goto LAB_008e8854; if (isChatClosed != '\0') { @@ -1986,9 +1986,9 @@ void Menu_OnlineLobby::init_lobby_view() curAnimData = GHIDRA_CAST(*puVar8); if (curAnimData == GHIDRA_CAST(0x0)) { LAB_008e9be8: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((puVar8 + -0xd)))))->ANM2::SetAnimation(GHIDRA_CAST("PlayerInfo"),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((puVar8 + -0xd)),GHIDRA_CAST("PlayerInfo"),1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((puVar8 + -1)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((puVar8 + -1))); *GHIDRA_CAST((puVar8 + 4)) = 1; } } @@ -3252,7 +3252,7 @@ void Menu_OnlineLobby::start_game() (manager->_dailyChallenge)._id = 0; (manager->_dailyChallenge)._seed = 0; (manager->_dailyChallenge)._specialDailyId = 0; - (GHIDRA_CAST((&(manager->_dailyChallenge)._params)))->ChallengeParam::Reset(); + ChallengeParam::Reset(&(manager->_dailyChallenge)._params); } msvc::vector::_Tidy(); (GHIDRA_CAST((lobbySettings._password._buf)))->msvc::string::_Tidy_deallocate(); @@ -3310,7 +3310,7 @@ void Menu_OnlineLobby::render_lobby_info() } else { infoNullFrame = - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x40)))))->AnimationState::GetNullFrame(GHIDRA_CAST("LobbyInfoPos")); + AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x40)),GHIDRA_CAST("LobbyInfoPos")); } drawPos.x = drawPos.y + *infoNullFrame; drawPos.y = baseY + infoNullFrame[1]; @@ -3321,9 +3321,9 @@ void Menu_OnlineLobby::render_lobby_info() infoSprite = GHIDRA_CAST((in_ECX + 0x460)); if (pbVar2 == GHIDRA_CAST(0x0)) { LAB_008ebba9: - bVar1 = (GHIDRA_CAST((infoSprite)))->ANM2::SetAnimation(&DAT_00b734e0,1); + bVar1 = ANM2::SetAnimation(infoSprite,&DAT_00b734e0,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x490)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x490))); *GHIDRA_CAST((in_ECX + 0x4a4)) = 1; } } @@ -3354,16 +3354,16 @@ LAB_008ebb96: ) goto LAB_008ebba9; } if (*GHIDRA_CAST((in_ECX + 0x569)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x490)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x4b0)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x490))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x4b0))); } manager = g_manager; - pLVar3 = (GHIDRA_CAST((infoSprite)))->ANM2::GetLayer(GHIDRA_CAST("Mode_Type")); + pLVar3 = ANM2::GetLayer(infoSprite,GHIDRA_CAST("Mode_Type")); if (pLVar3 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((infoSprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar3->_layerData), + ANM2::SetLayerFrame(infoSprite,*GHIDRA_CAST(pLVar3->_layerData), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((manager->_lobbySettings))) + 0x4))))); } if (*GHIDRA_CAST((in_ECX + 0x569)) != '\0') { @@ -3384,9 +3384,9 @@ LAB_008ebb96: pbVar2 = *GHIDRA_CAST((in_ECX + 0x494)); if (pbVar2 == GHIDRA_CAST(0x0)) { LAB_008ebce3: - bVar1 = (GHIDRA_CAST((infoSprite)))->ANM2::SetAnimation(&DAT_00b75640,1); + bVar1 = ANM2::SetAnimation(infoSprite,&DAT_00b75640,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x490)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x490))); *GHIDRA_CAST((in_ECX + 0x4a4)) = 1; } } @@ -3417,16 +3417,16 @@ LAB_008ebcd5: goto LAB_008ebce3; } if (*GHIDRA_CAST((in_ECX + 0x569)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x490)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x4b0)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x490))); + AnimationState::Update(GHIDRA_CAST((in_ECX + 0x4b0))); } tagType = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((g_manager->_lobbySettings))) + 0x14)))); - pLVar3 = (GHIDRA_CAST((infoSprite)))->ANM2::GetLayer(GHIDRA_CAST("Tag_Type")); + pLVar3 = ANM2::GetLayer(infoSprite,GHIDRA_CAST("Tag_Type")); if (pLVar3 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((infoSprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar3->_layerData),tagType); + ANM2::SetLayerFrame(infoSprite,*GHIDRA_CAST(pLVar3->_layerData),tagType); } if (*GHIDRA_CAST((in_ECX + 0x569)) != '\0') { if (*GHIDRA_CAST((in_ECX + 0x4d0)) == '\0') { @@ -3613,7 +3613,7 @@ void Menu_OnlineLobby::load_member_sprite(void *lobby, int memberIndex) pppppbVar3 = pppppbStack_6c; } if (*GHIDRA_CAST((GHIDRA_CAST(lobby) + 0x44)) != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(lobby) + 0x40)))))->AnimationState::GetNullFrame(GHIDRA_CAST(pppppbVar3)); + AnimationState::GetNullFrame(GHIDRA_CAST((GHIDRA_INT(lobby) + 0x40)),GHIDRA_CAST(pppppbVar3)); } (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; if (0xf < uStack_58) { @@ -3662,7 +3662,7 @@ LAB_008ed547: } while (iVar7 < 0xc); uVar5 = 0; do { - layer = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(GHIDRA_CAST(markLayerIds[uVar5])); + layer = ANM2::GetLayer(memberSprite,GHIDRA_CAST(markLayerIds[uVar5])); memberInfo = piStack_a4; uVar5 = uVar5 + 1; layer->_visible = 0; @@ -3794,8 +3794,8 @@ LAB_008ed547: iVar2 = 4; } pbVar6 = *GHIDRA_CAST((GHIDRA_CAST(markLayerIds) + uVar5)); - (GHIDRA_CAST((memberSprite)))->ANM2::SetLayerFrame(GHIDRA_INT(pbVar6),iVar2); - layer = (GHIDRA_CAST((memberSprite)))->ANM2::GetLayer(pbVar6); + ANM2::SetLayerFrame(memberSprite,GHIDRA_INT(pbVar6),iVar2); + layer = ANM2::GetLayer(memberSprite,pbVar6); uVar5 = uVar5 + 4; layer->_visible = 1; } while (uVar5 < 0x30); diff --git a/generated-src/menu_online_lobby_list.cpp b/generated-src/menu_online_lobby_list.cpp index c4de1b5..1871c91 100644 --- a/generated-src/menu_online_lobby_list.cpp +++ b/generated-src/menu_online_lobby_list.cpp @@ -36,7 +36,7 @@ void Menu_OnlineLobbyList::load_graphics() menuAnm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuAnm2Path._buf))) + 0x0))),"gfx/ui/main menu/LobbyListMenu.anm2",0x24); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::Load(&menuAnm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 8)),&menuAnm2Path,1); local_14 = 0xffffffff; if (0xf < menuAnm2Path._capacity) { uVar4 = menuAnm2Path._capacity + 1; @@ -62,7 +62,7 @@ void Menu_OnlineLobbyList::load_graphics() menuAnm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuAnm2Path._buf))) + 0x0))),"gfx/ui/main menu/LobbyListMenu.anm2",0x24); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)))))->ANM2::Load(&menuAnm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)),&menuAnm2Path,1); local_14 = 0xffffffff; if (0xf < menuAnm2Path._capacity) { uVar4 = menuAnm2Path._capacity + 1; @@ -80,9 +80,9 @@ void Menu_OnlineLobbyList::load_graphics() pbVar1 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x3c)); if (pbVar1 == GHIDRA_CAST(0x0)) { LAB_008dcc49: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 8)),s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x38))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x4c)) = 1; } } @@ -139,9 +139,9 @@ LAB_008dcca8: if ((uVar4 == 0) && ((pbVar1[0x34] == 0 || (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x160)) != '\0')))) goto LAB_008dcce1; } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)))))->ANM2::SetAnimation(GHIDRA_CAST("Cursor"),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)),GHIDRA_CAST("Cursor"),1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14c)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x14c))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x160)) = 1; } LAB_008dcce1: @@ -156,7 +156,7 @@ LAB_008dcce1: } while (bVar2 != 0); (GHIDRA_CAST((anm2Path._buf)))->msvc::string::assign(pbVar1,GHIDRA_INT(nameCursor) - GHIDRA_INT((pbVar1 + 1))); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38c)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x38c)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -209,9 +209,9 @@ LAB_008dcdc5: } } } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38c)))))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x38c)),s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x3bc)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x3bc))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x3d0)) = 1; } ExceptionList = local_1c; @@ -259,8 +259,8 @@ void Menu_OnlineLobbyList::Update() return; } if (((g_manager->_framecount & 1) == 0) && (*GHIDRA_CAST((GHIDRA_CAST(menuManager) + 0x111)) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(menuManager) + 0x38)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(menuManager) + 0x58)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(menuManager) + 0x38))); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(menuManager) + 0x58))); } if (*GHIDRA_CAST((GHIDRA_CAST(menuManager) + 0x4ac)) != '\0') goto LAB_008ddac2; if (*GHIDRA_CAST((GHIDRA_CAST(menuManager) + 0x500)) != '\0') { @@ -734,9 +734,9 @@ void Menu_OnlineLobbyList::reset() animData = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x3c)); if (animData == GHIDRA_CAST(0x0)) { LAB_008de435: - bVar3 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::SetAnimation(s_Idle,1); + bVar3 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 8)),s_Idle,1); if (bVar3 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x38))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x4c)) = 1; } } @@ -769,9 +769,9 @@ LAB_008de427: animData = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x150)); if (animData == GHIDRA_CAST(0x0)) { LAB_008de4a6: - bVar3 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)))))->ANM2::SetAnimation(GHIDRA_CAST("Cursor"),1); + bVar3 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)),GHIDRA_CAST("Cursor"),1); if (bVar3 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14c)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x14c))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x160)) = 1; } } @@ -817,9 +817,9 @@ LAB_008de495: *GHIDRA_CAST((GHIDRA_CAST(this) + 0x368)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x36c)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x370)) = 0; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("ArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("ArrowUp")); arrowLayer->_visible = 0; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 8)))))->ANM2::GetLayer(GHIDRA_CAST("ArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this) + 8)),GHIDRA_CAST("ArrowDown")); manager = g_manager; arrowLayer->_visible = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x4d9)) = *GHIDRA_CAST(&manager->_lobbySettings) != 0; @@ -827,9 +827,9 @@ LAB_008de495: animData = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x3c0)); if (animData == GHIDRA_CAST(0x0)) { LAB_008de5fd: - bVar3 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x38c)))))->ANM2::SetAnimation(s_Idle,1); + bVar3 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x38c)),s_Idle,1); if (bVar3 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x3bc)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x3bc))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x3d0)) = 1; } } diff --git a/generated-src/menu_online_mode.cpp b/generated-src/menu_online_mode.cpp index a4d5aa8..f7a23f3 100644 --- a/generated-src/menu_online_mode.cpp +++ b/generated-src/menu_online_mode.cpp @@ -20,8 +20,8 @@ void Menu_OnlineMode::Update() play_idle_animation(); iVar2 = extraout_ECX; if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x109)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x30)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x50)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(this) + 0x30))); + AnimationState::Update(GHIDRA_CAST((GHIDRA_INT(this) + 0x50))); iVar2 = extraout_ECX_00; } if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x7d4)) == '\0') { @@ -56,8 +56,8 @@ void Menu_OnlineMode::Update() do { FUN_008cd670(iVar2); if (*GHIDRA_CAST((GHIDRA_CAST(modeEntry) + 0x41)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((modeEntry + -0x13)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((modeEntry + -0xf)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((modeEntry + -0x13))); + AnimationState::Update(GHIDRA_CAST((modeEntry + -0xf))); } iVar1 = *GHIDRA_CAST((modeEntry + 10)); if (*GHIDRA_CAST((GHIDRA_CAST(modeEntry) + 0x4c)) == '\0') { @@ -206,9 +206,9 @@ LAB_008ccc09: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((in_ECX->_animState)._isPlaying != 0)))) goto LAB_008ccc34; } - bVar1 = (GHIDRA_CAST((in_ECX)))->ANM2::SetAnimation(idleAnimName,1); + bVar1 = ANM2::SetAnimation(in_ECX,idleAnimName,1); if (bVar1 != 0) { - (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_008ccc34: @@ -246,18 +246,18 @@ LAB_008ccaa5: (puStack_20 = local_38 + 0x34, (in_ECX->_animState)._isPlaying != 0)))) goto LAB_008ccad1; } puStack_20 = local_38 + 0x34; - bVar1 = (GHIDRA_CAST((in_ECX)))->ANM2::SetAnimation(GHIDRA_CAST("Idle_Challenge"),1); + bVar1 = ANM2::SetAnimation(in_ECX,GHIDRA_CAST("Idle_Challenge"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_008ccad1: - titleLayer = (GHIDRA_CAST((in_ECX)))->ANM2::GetLayer(GHIDRA_CAST("Title")); + titleLayer = ANM2::GetLayer(in_ECX,GHIDRA_CAST("Title")); if (titleLayer == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((in_ECX)))->ANM2::SetLayerFrame(*GHIDRA_CAST(titleLayer->_layerData),*GHIDRA_CAST(&manager->_lobbySettings)); + ANM2::SetLayerFrame(in_ECX,*GHIDRA_CAST(titleLayer->_layerData),*GHIDRA_CAST(&manager->_lobbySettings)); } ExceptionList = local_1c; return; diff --git a/generated-src/menu_options.cpp b/generated-src/menu_options.cpp index beaf9ce..3b49a1a 100644 --- a/generated-src/menu_options.cpp +++ b/generated-src/menu_options.cpp @@ -19,9 +19,9 @@ void Menu_Options::constructor() this->PositionX = 0.0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1c)))) = 0; - (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::constructor(); + ANM2::constructor(&this->OptionsSprite); local_8 = 0; - (GHIDRA_CAST((&this->GammaMenuSprite)))->ANM2::constructor(); + ANM2::constructor(&this->GammaMenuSprite); this[1].SelectedElement = 0; this[1].PositionY = 0.0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1c)))) = 0xf; @@ -59,15 +59,15 @@ Menu_Options::~Menu_Options() FID_conflict__Tidy(&this[1].OptionsSprite); (GHIDRA_CAST((GHIDRA_CAST(&this[1].SelectedElement))))->msvc::string::_Tidy_deallocate(); local_8 = 0; - (GHIDRA_CAST((&this->GammaMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->GammaMenuSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->GammaMenuSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->GammaMenuSprite); + AnimationState::~AnimationState(&(this->GammaMenuSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->GammaMenuSprite)._animState); (GHIDRA_CAST(((this->GammaMenuSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->GammaMenuSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->OptionsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->OptionsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->OptionsSprite); + AnimationState::~AnimationState(&(this->OptionsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->OptionsSprite)._animState); (GHIDRA_CAST(((this->OptionsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->OptionsSprite))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -104,7 +104,7 @@ void Menu_Options::Init(Vector *position, uint8_t isPauseScreen) anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/OptionsMenu.anm2",0x22); local_14 = 0; - (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->OptionsSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { size = anm2Path._capacity + 1; @@ -162,7 +162,7 @@ void Menu_Options::load_menu_anm2() anm2Path._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/OptionsMenu.anm2",0x22); local_14 = 0; - (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(&this->OptionsSprite,&anm2Path,1); if (0xf < anm2Path._capacity) { size = anm2Path._capacity + 1; ptr = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))); @@ -237,9 +237,9 @@ void Menu_Options::Update() game = g_game; if (g_game != GHIDRA_CAST(0x0)) { (GHIDRA_CAST((&g_game->_hud)))->HUD::unload_graphics(); - (GHIDRA_CAST((&(game->_genericPrompt)._sprite)))->ANM2::Reset(); + ANM2::Reset(&(game->_genericPrompt)._sprite); (game->_genericPrompt)._isOnlineVote = 0; - (GHIDRA_CAST((&game->_completionWidgetSprite)))->ANM2::Reset(); + ANM2::Reset(&game->_completionWidgetSprite); } manager = g_manager; pvVar8 = g_luaEngine; @@ -284,7 +284,7 @@ void Menu_Options::Update() ExceptionList = local_10; return; } - (GHIDRA_CAST((&g_manager->_optionsConfig)))->OptionsConfig::Save(); + OptionsConfig::Save(&g_manager->_optionsConfig); menuManager = g_menuManager; pvVar8 = (g_menuManager->_menuStateHistory)._end; if (1 < GHIDRA_UINT((GHIDRA_INT(pvVar8) - GHIDRA_INT((g_menuManager->_menuStateHistory)._begin) >> 2))) { @@ -297,8 +297,8 @@ void Menu_Options::Update() return; } if (((g_manager->_framecount & 1) == 0) && ((this->OptionsSprite)._loaded != 0)) { - (GHIDRA_CAST((&(this->OptionsSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->OptionsSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->OptionsSprite)._animState); + AnimationState::Update(&(this->OptionsSprite)._overlayAnimState); } manager = g_manager; if (isPauseMenu == '\0') { @@ -373,7 +373,7 @@ void Menu_Options::Update() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))) = uVar6; goto switchD_009b2b40_caseD_a; } - (GHIDRA_CAST((&g_manager->_optionsConfig)))->OptionsConfig::Save(); + OptionsConfig::Save(&g_manager->_optionsConfig); if (isPauseMenu == '\0') { FUN_0098aec0(); } @@ -569,7 +569,7 @@ LAB_009b2b22: if (1.0 <= (float)pMVar11) { pMVar11 = GHIDRA_CAST(0x3f800000); } - (GHIDRA_CAST((&manager->_optionsConfig)))->OptionsConfig::SetMusicVolume((float)pMVar11); + OptionsConfig::SetMusicVolume(&manager->_optionsConfig,(float)pMVar11); break; case 4: case 5: @@ -847,7 +847,7 @@ void Menu_Options::Render() menuY = (g_screenHeight - 270.0) * 0.5 + font->PositionY; local_34.x = menuX; local_34.y = menuY; - pLVar3 = (GHIDRA_CAST((&font->OptionsSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar3 = ANM2::GetLayer(&font->OptionsSprite,GHIDRA_CAST(0x0)); local_70._red = 0.0; local_70._green = 0.0; local_70._blue = 0.0; @@ -871,9 +871,9 @@ void Menu_Options::Render() if (iVar2 == 3) { animName = "BackgroundMultiplayer"; } - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST(animName),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -908,9 +908,9 @@ void Menu_Options::Render() + 52.0) / local_4c; roundedSpacing = (long double)roundf(local_2c); optionSpacing = (float)roundedSpacing; - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PaperTop"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("PaperTop"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -929,9 +929,9 @@ void Menu_Options::Render() } local_34.y = local_34.y + 100.0; for (; local_38 != 0; local_38 = local_38 + -1) { - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PaperMiddle"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("PaperMiddle"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -950,9 +950,9 @@ void Menu_Options::Render() } local_34.y = local_34.y + 52.0; } - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PaperBottom"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("PaperBottom"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -971,7 +971,7 @@ void Menu_Options::Render() } optionsOriginY = 0.0; optionsOriginX = 0.0; - optionPositionsFrame = (GHIDRA_CAST((sprite)))->ANM2::GetNullFrame(GHIDRA_CAST("Background"),GHIDRA_CAST("OptionPositions"),0) + optionPositionsFrame = ANM2::GetNullFrame(sprite,GHIDRA_CAST("Background"),GHIDRA_CAST("OptionPositions"),0) ; if (optionPositionsFrame != GHIDRA_CAST(0x0)) { optionsOriginX = *optionPositionsFrame; @@ -1006,27 +1006,27 @@ void Menu_Options::Render() local_48 = (float)local_38 * optionSpacing + optionsOriginY; switch(*GHIDRA_CAST((iVar2 + local_38 * 4))) { case 0: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Controls"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Controls"),1); if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { fVar5 = 0.0; LAB_009b4475: - (GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(fVar5); + AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,fVar5); if ((font->OptionsSprite)._animState._animData != (void *)0x0) { (font->OptionsSprite)._animState._isPlaying = 0; } } break; case 1: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ChangeController"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("ChangeController"),1); if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { fVar5 = 0.0; goto LAB_009b4475; } break; case 2: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(&DAT_00b7e490,1); + bVar1 = ANM2::SetAnimation(sprite,&DAT_00b7e490,1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1046,9 +1046,9 @@ LAB_009b4475: } break; case 3: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Music"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Music"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1073,9 +1073,9 @@ LAB_009b4475: case 5: animName = "PenOpacity"; LAB_009b39a1: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST(animName),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1095,9 +1095,9 @@ LAB_009b39a1: } break; case 6: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Fullscreen"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Fullscreen"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1118,19 +1118,19 @@ LAB_009b39a1: } break; case 7: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Filter"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Filter"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._filterEnabled == 0; goto LAB_009b3b5d; case 8: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Gamma"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Gamma"),1); iVar2 = extraout_ECX; if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0); iVar2 = extraout_ECX_00; if ((font->OptionsSprite)._animState._animData != (void *)0x0) { (font->OptionsSprite)._animState._isPlaying = 0; @@ -1143,9 +1143,9 @@ LAB_009b39a1: render_counter(font,GHIDRA_INT(local_34.y),iVar2,position); break; case 9: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Popups"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Popups"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1204,27 +1204,27 @@ LAB_009b39a1: } break; case 0xb: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ActiveCam"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("ActiveCam"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = GHIDRA_UINT(((g_manager->_optionsConfig)._cameraStyle != 1)); goto LAB_009b3b63; case 0xc: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ExtraHUD"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("ExtraHUD"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (g_manager->_optionsConfig)._historyHudMode; goto LAB_009b3b63; case 0xd: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("HUDOffset"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("HUDOffset"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1261,55 +1261,55 @@ LAB_009b39a1: } break; case 0xe: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("FoundHUD"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("FoundHUD"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableFoundHUD == 0; goto LAB_009b3b5d; case 0xf: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Rumble"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Rumble"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableRumble == 0; goto LAB_009b3b5d; case 0x10: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ChargeBars"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("ChargeBars"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableChargeBars == 0; goto LAB_009b3b5d; case 0x11: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("BulletVisibility"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("BulletVisibility"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableBulletVisibility == 0; goto LAB_009b3b5d; case 0x12: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("AimLock"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("AimLock"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._enableAimLock == 0; goto LAB_009b3b5d; case 0x13: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("TouchMode"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("TouchMode"),1); iVar2 = extraout_ECX_01; if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0); iVar2 = extraout_ECX_02; if ((font->OptionsSprite)._animState._animData != (void *)0x0) { (font->OptionsSprite)._animState._isPlaying = 0; @@ -1322,54 +1322,54 @@ LAB_009b39a1: render_counter(font,(g_manager->_optionsConfig)._touchMode,iVar2,position_00); break; case 0x14: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("JacobEsauControl"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("JacobEsauControl"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = GHIDRA_UINT(((g_manager->_optionsConfig)._jacobEsauControls != 1)); goto LAB_009b3b63; case 0x15: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("MultiplayerHUD"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("MultiplayerHUD"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (g_manager->_optionsConfig)._onlineHud; goto LAB_009b3b63; case 0x16: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("StreamerMode"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("StreamerMode"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._streamerMode == 0; goto LAB_009b3b5d; case 0x17: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("EnableChat"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("EnableChat"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } isOptionOff = (g_manager->_optionsConfig)._onlineChatEnabled == 0; goto LAB_009b3b5d; case 0x18: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PlayerSound"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("PlayerSound"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_28 = (g_manager->_optionsConfig)._onlinePlayerVolume; goto LAB_009b434b; case 0x19: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PlayerOpacity"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("PlayerOpacity"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1383,33 +1383,33 @@ LAB_009b434b: local_24 = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0x44)); goto LAB_009b3ba4; case 0x1a: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PlayerColors"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("PlayerColors"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } local_24 = (float)(g_manager->_optionsConfig)._onlineColorSet; - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("OnOff2")); + pLVar3 = ANM2::GetLayer(sprite,GHIDRA_CAST("OnOff2")); if (pLVar3 == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((sprite)))->ANM2::SetLayerFrame(*GHIDRA_CAST(pLVar3->_layerData),GHIDRA_INT(local_24)); + ANM2::SetLayerFrame(sprite,*GHIDRA_CAST(pLVar3->_layerData),GHIDRA_INT(local_24)); } break; case 0x1b: local_24 = (float)(g_manager->_optionsConfig)._onlineInputDelay; - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("InputDelay"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("InputDelay"),1); if ((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) { fVar5 = (float)GHIDRA_INT(local_24); goto LAB_009b4475; } break; case 0x1c: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ItemDescriptions"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("ItemDescriptions"),1); if (((bVar1 != 0) && ((font->OptionsSprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(font->OptionsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(font->OptionsSprite)._animState,0.0), (font->OptionsSprite)._animState._animData != (void *)0x0)) { (font->OptionsSprite)._animState._isPlaying = 0; } @@ -1435,11 +1435,11 @@ LAB_009b3ba4: } } if (local_38 == font->SelectedElement) { - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00000005); + pLVar3 = ANM2::GetLayer(sprite,&DAT_00000005); pLVar3->_visible = 1; } else { - pLVar3 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(&DAT_00000005); + pLVar3 = ANM2::GetLayer(sprite,&DAT_00000005); pLVar3->_visible = 0; } optionPos.x = optionsOriginX + menuX; @@ -1499,7 +1499,7 @@ LAB_009b3ba4: manager = g_manager; font = &g_manager->_font2_TeamMeatEx12; str = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#LOADING")); - iVar2 = (GHIDRA_CAST((font)))->Font::get_string_width_n(str,-1); + iVar2 = Font::get_string_width_n(font,str,-1); local_78 = 0; local_74 = 0xffff; local_70._red = 0.0; @@ -1511,7 +1511,7 @@ LAB_009b3ba4: local_34.y = (g_screenHeight - (float)(uint16_t)(manager->_font2_TeamMeatEx12)._lineHeight) * 0.5; local_24 = (g_screenWidth - (float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)])) * 0.5; - pvVar4 = (GHIDRA_CAST((font)))->Font::measure_string(glyphRun,str,&local_78,&g_vectorOne); + pvVar4 = Font::measure_string(font,glyphRun,str,&local_78,&g_vectorOne); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),1); color._blue = 1.0; color._red = 1.0; @@ -1760,7 +1760,7 @@ LAB_009b4d28: pbVar4 = GHIDRA_CAST(0x0); if (0 < layerCount) { do { - layer = (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::GetLayer(pbVar4); + layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4); layerData = layer->_layerData; if (layerData == (void *)0x0) { nameText = &s_empty; @@ -1773,7 +1773,7 @@ LAB_009b4d28: } pcVar2 = strstr(GHIDRA_CAST(nameText),"Sketch"); if (pcVar2 != GHIDRA_CAST(0x0)) { - layer = (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::GetLayer(pbVar4); + layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4); layer->_visible = 0; } layerCount = (this->OptionsSprite)._layerCount; @@ -1783,7 +1783,7 @@ LAB_009b4d28: pbVar4 = GHIDRA_CAST(0x0); if (0 < layerCount) { do { - layer = (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::GetLayer(pbVar4); + layer = ANM2::GetLayer(&this->OptionsSprite,pbVar4); haystack = &layer->_spriteSheetPath; if (0xf < (layer->_spriteSheetPath)._capacity) { haystack = *GHIDRA_CAST(haystack->_buf); @@ -1812,7 +1812,7 @@ LAB_009b4d28: pbVar4 = pbVar4 + 1; } while (GHIDRA_INT(pbVar4) < (this->OptionsSprite)._layerCount); } - (GHIDRA_CAST((&this->OptionsSprite)))->ANM2::LoadGraphics((uint8_t)&this->OptionsSprite); + ANM2::LoadGraphics(&this->OptionsSprite,(uint8_t)&this->OptionsSprite); } else { optionIdsEnd = *GHIDRA_CAST((this[1].OptionsSprite._filename._buf + 4)); @@ -1898,7 +1898,7 @@ LAB_009b4d28: path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(path._buf))) + 0x0))),"gfx/ui/main menu/GammaMenu.anm2",0x20); local_14 = 1; - (GHIDRA_CAST((&this->GammaMenuSprite)))->ANM2::Load(&path,1); + ANM2::Load(&this->GammaMenuSprite,&path,1); local_14 = 0xffffffff; if (0xf < path._capacity) { uVar3 = path._capacity + 1; @@ -1943,9 +1943,9 @@ LAB_009b4f65: ((pbVar4[0x34] == 0 || ((this->GammaMenuSprite)._animState._isPlaying != 0)))) goto LAB_009b4fa2; } - bVar1 = (GHIDRA_CAST((&this->GammaMenuSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Counter"),1); + bVar1 = ANM2::SetAnimation(&this->GammaMenuSprite,GHIDRA_CAST("Counter"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->GammaMenuSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->GammaMenuSprite)._animState); (this->GammaMenuSprite)._animState._isPlaying = 1; } LAB_009b4fa2: @@ -1980,7 +1980,7 @@ void Menu_Options::render_counter(int value, int unused, Vector position) } do { if ((digitAnim->GammaMenuSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((digitAnim)))->AnimationState::SetFrameFloat((float)(GHIDRA_INT(remainingValue) % 10)); + AnimationState::SetFrameFloat(digitAnim,(float)(GHIDRA_INT(remainingValue) % 10)); } if ((digitAnim->GammaMenuSprite)._loaded != 0) { if ((digitAnim->GammaMenuSprite)._overlayRenderFirst == 0) { @@ -2001,7 +2001,7 @@ void Menu_Options::render_counter(int value, int unused, Vector position) digitGroupCounter = digitGroupCounter + -1; if (digitGroupCounter == 0) { if ((digitAnim->GammaMenuSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((digitAnim)))->AnimationState::SetFrameFloat(10.0); + AnimationState::SetFrameFloat(digitAnim,10.0); } if ((digitAnim->GammaMenuSprite)._loaded != 0) { if ((digitAnim->GammaMenuSprite)._overlayRenderFirst == 0) { @@ -2022,7 +2022,7 @@ void Menu_Options::render_counter(int value, int unused, Vector position) } while ((remainingValue != 0) || (-1 < digitGroupCounter)); if (value < 0) { if ((digitAnim->GammaMenuSprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((digitAnim)))->AnimationState::SetFrameFloat(11.0); + AnimationState::SetFrameFloat(digitAnim,11.0); } if ((digitAnim->GammaMenuSprite)._loaded != 0) { if ((digitAnim->GammaMenuSprite)._overlayRenderFirst == 0) { diff --git a/generated-src/menu_save.cpp b/generated-src/menu_save.cpp index 6a82f8d..bc43239 100644 --- a/generated-src/menu_save.cpp +++ b/generated-src/menu_save.cpp @@ -770,9 +770,9 @@ Menu_Save::~Menu_Save() ExceptionList = &local_10; unload_graphics(this); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x236])) + 0x2)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x251])) + 0x1)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x246])) + 0x2)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x236])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x251])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x246])) + 0x2))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x23e])) + 0x2))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x236])) + 0x2))))))->msvc::string::_Tidy_deallocate(); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x232])) + 0x2)))) = KAGE::Network::Multiplayer::ConstLobby::vftable; @@ -784,23 +784,23 @@ Menu_Save::~Menu_Save() } } local_8 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1f1])) + 0x1)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1f1])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1de])) + 0x2))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2))))))->msvc::string::_Tidy_deallocate(); local_8 = 3; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x195])) + 0x1)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x18a])) + 0x2)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x195])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x18a])) + 0x2))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x182])) + 0x2))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2))))))->msvc::string::_Tidy_deallocate(); local_8 = 0xffffffff; _eh_vector_destructor_iterator_(this + 100,0x114,3,ANM2::~ANM2); local_8 = 4; - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x22])) + 0x2)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((this + 8))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x22])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0x18))); (GHIDRA_CAST((GHIDRA_CAST((this + 0x10)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -823,10 +823,10 @@ void Menu_Save::unload_graphics() puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x236])) + 0x2)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((this + 8))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x236])) + 0x2))))); *GHIDRA_CAST((this + 0x29c)) = 0; remaining = 3; spriteFields = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x71])) + 0x1)))); @@ -840,8 +840,8 @@ void Menu_Save::unload_graphics() } spriteFields[-6] = 0; *GHIDRA_CAST(stringBuf) = 0; - (GHIDRA_CAST((GHIDRA_CAST((spriteFields + 2)))))->AnimationState::SetAnimationData((void *)0x0); - (GHIDRA_CAST((GHIDRA_CAST((spriteFields + 10)))))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteFields + 2)),(void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteFields + 10)),(void *)0x0); stringBuf = spriteFields + -4; if (0xf < GHIDRA_UINT(spriteFields[1])) { stringBuf = GHIDRA_CAST(*stringBuf); @@ -938,7 +938,7 @@ void Menu_Save::LoadGraphics() menuPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuPath._buf))) + 0x0))),"gfx/ui/main menu/SaveSelectMenu.anm2",0x25); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 8)))))->ANM2::Load(&menuPath,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 8)),&menuPath,1); local_14 = 0xffffffff; if (0xf < menuPath._capacity) { uVar1 = menuPath._capacity + 1; @@ -966,7 +966,7 @@ LAB_009d963b: menuPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuPath._buf))) + 0x0))),"gfx/ui/main menu/SaveSelectMenu.anm2",0x25); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[0x17a])) + 0x2)))))))->ANM2::Load(&menuPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[0x17a])) + 0x2)))),&menuPath,1); local_14 = 0xffffffff; if (0xf < menuPath._capacity) { uVar1 = menuPath._capacity + 1; @@ -992,7 +992,7 @@ LAB_009d963b: menuPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuPath._buf))) + 0x0))),"gfx/ui/main menu/SaveSelectMenu.anm2",0x25); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[0x1d6])) + 0x2)))))))->ANM2::Load(&menuPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(in_ECX[0x1d6])) + 0x2)))),&menuPath,1); local_14 = 0xffffffff; if (0xf < menuPath._capacity) { uVar1 = menuPath._capacity + 1; @@ -1023,7 +1023,7 @@ LAB_009d963b: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(drawingPath._buf))) + 0x0))),"gfx/ui/main menu/SaveSelectMenu_Drawing.anm2", 0x2d); local_14 = 3; - (GHIDRA_CAST((GHIDRA_CAST((slotDrawing + -0xd)))))->ANM2::Load(&drawingPath,0); + ANM2::Load(GHIDRA_CAST((slotDrawing + -0xd)),&drawingPath,0); local_14 = 0xffffffff; if (0xf < drawingPath._capacity) { size = drawingPath._capacity + 1; @@ -1039,9 +1039,9 @@ LAB_009d963b: drawingPath._size = 0; drawingPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(drawingPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(drawingPath._buf)) + 0x0))) & 0xffffff00; - isAnimSet = (GHIDRA_CAST((GHIDRA_CAST((slotDrawing + -0xd)))))->ANM2::SetAnimation(s_Idle,1); + isAnimSet = ANM2::SetAnimation(GHIDRA_CAST((slotDrawing + -0xd)),s_Idle,1); if ((isAnimSet != 0) && (*slotDrawing != 0)) { - (GHIDRA_CAST((GHIDRA_CAST((slotDrawing + -1)))))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(GHIDRA_CAST((slotDrawing + -1)),0.0); if (*slotDrawing != 0) { *GHIDRA_CAST((slotDrawing + 4)) = 0; } @@ -1247,7 +1247,7 @@ void Menu_Save::Update() if ((iVar3 == 1) || (iVar3 == 2)) { if (iVar3 == 1) { *GHIDRA_CAST(this) = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::Play(GHIDRA_CAST("DeleteConfirmationAppear"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))),GHIDRA_CAST("DeleteConfirmationAppear"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))) = 1; } else { @@ -1313,7 +1313,7 @@ LAB_009d9dc5: uVar6 = extraout_ECX; slotSprite = local_63c; do { - (GHIDRA_CAST((slotSprite)))->ANM2::LoadGraphics((uint8_t)uVar6); + ANM2::LoadGraphics(slotSprite,(uint8_t)uVar6); slotSprite = slotSprite + 1; iVar3 = iVar3 + -1; uVar6 = extraout_ECX_00; @@ -1348,9 +1348,10 @@ LAB_009d9f48: if ((uVar9 == 0) && ((pbVar5[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ed])) + 0x1))) != '\0')))) goto LAB_009da447; } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::SetAnimation(GHIDRA_CAST("DeleteConfirmationDissapear"),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))), + GHIDRA_CAST("DeleteConfirmationDissapear"),1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ed])) + 0x1))) = 1; } } @@ -1371,7 +1372,7 @@ LAB_009d9f48: case 3: *GHIDRA_CAST(this) = 1; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))))))->ANM2::Play(GHIDRA_CAST("DeleteDeselect"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))),GHIDRA_CAST("DeleteDeselect"),0); } } goto LAB_009da447; @@ -1398,7 +1399,7 @@ LAB_009d9f48: if (isInputTriggered != '\0') { iVar3 = *GHIDRA_CAST(this); if (iVar3 == 2) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::Play(GHIDRA_CAST("DeleteConfirmationDissapear"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))),GHIDRA_CAST("DeleteConfirmationDissapear"),0); } else if (iVar3 == 1) { *GHIDRA_CAST(this) = 0; @@ -1412,10 +1413,10 @@ LAB_009d9f48: } } else if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))) == 3) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))))))->ANM2::Play(GHIDRA_CAST("DeleteDeselect"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))),GHIDRA_CAST("DeleteDeselect"),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Play(GHIDRA_CAST("File1Select"),0); - (GHIDRA_CAST((GHIDRA_CAST((this + 100)))))->ANM2::Play(GHIDRA_CAST("Animated"),0); + ANM2::Play(GHIDRA_CAST((this + 8)),GHIDRA_CAST("File1Select"),0); + ANM2::Play(GHIDRA_CAST((this + 100)),GHIDRA_CAST("Animated"),0); } } else { @@ -1424,9 +1425,9 @@ LAB_009d9f48: if (iVar3 == 0) { animName = "File1Deselect"; LAB_009da2a6: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((this + 8)),GHIDRA_CAST(animName),1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x18))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e])) + 0x2))) = 1; } } @@ -1446,9 +1447,9 @@ LAB_009da2a6: pbVar5 = GHIDRA_CAST(*puVar10); if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_009da318: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((puVar10 + -0xd)))))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((puVar10 + -0xd)),s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((puVar10 + -1)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((puVar10 + -1))); *GHIDRA_CAST((puVar10 + 4)) = 1; } } @@ -1482,7 +1483,7 @@ LAB_009da30a: local_634 = local_634 + -1; } while (local_634 != 0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))) = 3; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))))))->ANM2::Play(GHIDRA_CAST("DeleteSelect"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x17a])) + 0x2)))),GHIDRA_CAST("DeleteSelect"),0); } } } @@ -1496,7 +1497,7 @@ LAB_009da30a: if (iVar3 == 0) { animName = "File1Deselect"; LAB_009da182: - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(GHIDRA_CAST((this + 8)),GHIDRA_CAST(animName),0); } else { if (iVar3 == 1) { @@ -1514,9 +1515,9 @@ LAB_009da182: pbVar5 = GHIDRA_CAST(*puVar10); if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_009da1e8: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((puVar10 + -0xd)))))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((puVar10 + -0xd)),s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((puVar10 + -1)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((puVar10 + -1))); *GHIDRA_CAST((puVar10 + 4)) = 1; } } @@ -1568,7 +1569,7 @@ LAB_009da1da: if (iVar3 == 0) { animName = "File1Deselect"; LAB_009da038: - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(GHIDRA_CAST((this + 8)),GHIDRA_CAST(animName),0); } else { if (iVar3 == 1) { @@ -1586,9 +1587,9 @@ LAB_009da038: pbVar5 = GHIDRA_CAST(*puVar10); if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_009da098: - bVar2 = (GHIDRA_CAST((GHIDRA_CAST((puVar10 + -0xd)))))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST((puVar10 + -0xd)),s_Idle,1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((puVar10 + -1)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((puVar10 + -1))); *GHIDRA_CAST((puVar10 + 4)) = 1; } } @@ -1725,7 +1726,7 @@ LAB_009da5d2: LAB_009da665: iVar3 = g_manager->_currentSaveSlot; replace_slot_graphics(pMVar8,GHIDRA_CAST((this + iVar3 * 0x5c + 8))); - (GHIDRA_CAST((GHIDRA_CAST((this + iVar3 * 0x5c + 8)))))->ANM2::LoadGraphics(unk); + ANM2::LoadGraphics(GHIDRA_CAST((this + iVar3 * 0x5c + 8)),unk); (GHIDRA_CAST((&g_menuManager->_menuCharacter)))->Menu_Character::Reset(); ExceptionList = local_10; return; @@ -1749,7 +1750,7 @@ void Menu_Save::Render() menuPos.y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))); menuPosY = menuPos.y; menuPosX = menuPos.x; - layer4 = (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::GetLayer(&DAT_00000004); + layer4 = ANM2::GetLayer(GHIDRA_CAST((this + 8)),&DAT_00000004); layer4->_visible = 1; if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x60])) + 0x1))) != '\0') { if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x2d])) + 0x1))) == '\0') { @@ -1766,7 +1767,7 @@ void Menu_Save::Render() menuPosY = menuPos.y; } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))) != 0) { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::GetNullFrame(GHIDRA_CAST("Drawing1")); + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST((this + 0x18)),GHIDRA_CAST("Drawing1")); if (nullFrame != GHIDRA_CAST(0x0)) { if (this + 0x9c != GHIDRA_CAST((nullFrame + 6))) { fVar1 = nullFrame[7]; @@ -1804,7 +1805,7 @@ void Menu_Save::Render() } } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))) != 0) { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::GetNullFrame(GHIDRA_CAST("Drawing2")); + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST((this + 0x18)),GHIDRA_CAST("Drawing2")); if (nullFrame != GHIDRA_CAST(0x0)) { if (this + 0xf8 != GHIDRA_CAST((nullFrame + 6))) { fVar1 = nullFrame[7]; @@ -1842,7 +1843,7 @@ void Menu_Save::Render() } } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))) != 0) { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::GetNullFrame(GHIDRA_CAST("Drawing3")) + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST((this + 0x18)),GHIDRA_CAST("Drawing3")) ; if (nullFrame != GHIDRA_CAST(0x0)) { if (this + 0x154 != GHIDRA_CAST((nullFrame + 6))) { @@ -1942,9 +1943,9 @@ void Menu_Save::Reset() pbVar8 = *GHIDRA_CAST((this + 0x18c)); if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_009dad97: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this_00))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(this_00),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x18a])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x18a])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x191])) + 0x1))) = 1; } } @@ -1976,9 +1977,9 @@ LAB_009dad89: pbVar8 = *GHIDRA_CAST((this + 0x1e8)); if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_009dae14: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ed])) + 0x1))) = 1; } } @@ -2010,20 +2011,20 @@ LAB_009dadf5: pbVar8 = GHIDRA_CAST(0x0); if (0 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a5])) + 0x1))))) { do { - layer = (GHIDRA_CAST((GHIDRA_CAST(this_00))))->ANM2::GetLayer(pbVar8); + layer = ANM2::GetLayer(GHIDRA_CAST(this_00),pbVar8); pbVar8 = pbVar8 + 1; layer->_visible = 0; } while (GHIDRA_INT(pbVar8) < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1a5])) + 0x1))))); } - layer = (GHIDRA_CAST((GHIDRA_CAST(this_00))))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(GHIDRA_CAST(this_00),&DAT_00000005); layer->_visible = 1; - layer = (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(GHIDRA_CAST((this + 8)),&DAT_00000005); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::GetLayer(&DAT_00000009); + layer = ANM2::GetLayer(GHIDRA_CAST((this + 8)),&DAT_00000009); layer->_visible = 1; - layer = (GHIDRA_CAST((GHIDRA_CAST(this_00))))->ANM2::GetLayer(&DAT_00000009); + layer = ANM2::GetLayer(GHIDRA_CAST(this_00),&DAT_00000009); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::GetLayer(&DAT_00000009); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))),&DAT_00000009); layer->_visible = 0; iVar4 = g_manager->_currentSaveSlot + -1; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))) = 0; @@ -2039,9 +2040,9 @@ LAB_009dadf5: pbVar8 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))); if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_009daf23: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::SetAnimation(GHIDRA_CAST("File3Select"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 8)),GHIDRA_CAST("File3Select"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x18))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e])) + 0x2))) = 1; } } @@ -2098,9 +2099,9 @@ LAB_009daf85: if ((uVar3 == 0) && ((pbVar8[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x132])) + 0x2))) != '\0')))) goto LAB_009db19e; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 0x11c)))))->ANM2::SetAnimation(GHIDRA_CAST("Animated"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 0x11c)),GHIDRA_CAST("Animated"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 300)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 300))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x132])) + 0x2))) = 1; } goto LAB_009db19e; @@ -2108,9 +2109,9 @@ LAB_009daf85: pbVar8 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))); if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_009db018: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::SetAnimation(GHIDRA_CAST("File2Select"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 8)),GHIDRA_CAST("File2Select"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x18))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e])) + 0x2))) = 1; } } @@ -2167,9 +2168,9 @@ LAB_009db075: if ((uVar3 == 0) && ((pbVar8[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0xd6])) + 0x2))) != '\0')))) goto LAB_009db19e; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 0xc0)))))->ANM2::SetAnimation(GHIDRA_CAST("Animated"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 0xc0)),GHIDRA_CAST("Animated"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0xd0)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0xd0))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0xd6])) + 0x2))) = 1; } goto LAB_009db19e; @@ -2177,9 +2178,9 @@ LAB_009db075: pbVar8 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))); if (pbVar8 == GHIDRA_CAST(0x0)) { LAB_009db108: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::SetAnimation(GHIDRA_CAST("File1Select"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 8)),GHIDRA_CAST("File1Select"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x18))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e])) + 0x2))) = 1; } } @@ -2234,9 +2235,9 @@ LAB_009db160: LAB_009db165: if ((uVar3 == 0) && ((pbVar8[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x7a])) + 0x2))) != '\0')))) goto LAB_009db19e; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this + 100)))))->ANM2::SetAnimation(GHIDRA_CAST("Animated"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this + 100)),GHIDRA_CAST("Animated"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x74)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((this + 0x74))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x7a])) + 0x2))) = 1; } LAB_009db19e: @@ -2263,7 +2264,7 @@ LAB_009db19e: iVar5 = 3; uVar7 = extraout_ECX; do { - (GHIDRA_CAST((slotSprite)))->ANM2::LoadGraphics((uint8_t)uVar7); + ANM2::LoadGraphics(slotSprite,(uint8_t)uVar7); slotSprite = slotSprite + 1; iVar5 = iVar5 + -1; uVar7 = extraout_ECX_00; @@ -2484,10 +2485,10 @@ switchD_009db728_caseD_0: } operator_delete(freeBlock,uVar1); } - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); layer->_visible = 1; if (GHIDRA_CAST(negativePath) == GHIDRA_CAST(0x0)) { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x1)); layer->_visible = 0; } else { @@ -2519,12 +2520,12 @@ LAB_009db696: } operator_delete(freeBlock,uVar1); } - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x1)); layer->_visible = 1; } uVar1 = 0; do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST((uVar1 + 2))); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST((uVar1 + 2))); if (uVar1 < heartPieces) { layer->_visible = 1; } @@ -2575,22 +2576,22 @@ void Menu_Save::update_sprites() cleanupFlags = 0; if ((g_manager->_framecount & 1) == 0) { if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x60])) + 0x1))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x22])) + 0x2)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((this + 0x18))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x22])) + 0x2))))); } slotAnimState = GHIDRA_CAST((this + 0x74)); iVar7 = 3; do { if (*GHIDRA_CAST((GHIDRA_INT(&slotAnimState[6]._currentlyTriggeredEvents) + 1)) != '\0') { - (GHIDRA_CAST((slotAnimState)))->AnimationState::Update(); - (GHIDRA_CAST((slotAnimState + 1)))->AnimationState::Update(); + AnimationState::Update(slotAnimState); + AnimationState::Update(slotAnimState + 1); } slotAnimState = GHIDRA_CAST(&slotAnimState[8]._isPlaying); iVar7 = iVar7 + -1; } while (iVar7 != 0); if (*GHIDRA_CAST((this + 0x1d3)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x18a])) + 0x2)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x195])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x18a])) + 0x2))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x195])) + 0x1))))); } if (*GHIDRA_CAST(this) == 1) { uVar2 = 0x3f19999a; @@ -2621,15 +2622,15 @@ void Menu_Save::update_sprites() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1b6])) + 0x2)))) = 0x3f800000; } if ((*GHIDRA_CAST(this) == 2) && (*GHIDRA_CAST((this + 0x22f)) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1f1])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1f1])) + 0x1))))); } } switch(*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1))))) { case 0: if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))) == 0) || (uVar6 = cleanupFlags, (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e])) + 0x2))) == '\0') ) { - animName = (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->ANM2::GetAnimation(GHIDRA_CAST(curAnim)); + animName = ANM2::GetAnimation(GHIDRA_CAST((this + 0x18)),GHIDRA_CAST(curAnim)); uVar6 = 1; animNameSize = &animName->_size; if (0xf < animName->_capacity) { @@ -2657,17 +2658,17 @@ LAB_009db9d0: operator_delete(allocBlock,uVar6); } if (isNeedSelectAnim != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Play(GHIDRA_CAST("File1Select"),0); + ANM2::Play(GHIDRA_CAST((this + 8)),GHIDRA_CAST("File1Select"),0); slotAnimState = GHIDRA_CAST((this + 100)); pbVar5 = GHIDRA_CAST("Animated"); LAB_009dbbe7: - (GHIDRA_CAST((slotAnimState)))->ANM2::Play(pbVar5,0); + ANM2::Play(slotAnimState,pbVar5,0); } break; case 1: if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))) == 0) || (uVar6 = cleanupFlags, (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e])) + 0x2))) == '\0') ) { - animName = (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->ANM2::GetAnimation(GHIDRA_CAST(curAnim)); + animName = ANM2::GetAnimation(GHIDRA_CAST((this + 0x18)),GHIDRA_CAST(curAnim)); uVar6 = 2; animNameSize = &animName->_size; if (0xf < animName->_capacity) { @@ -2695,7 +2696,7 @@ LAB_009dba7b: operator_delete(allocBlock,uVar6); } if (isNeedSelectAnim != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Play(GHIDRA_CAST("File2Select"),0); + ANM2::Play(GHIDRA_CAST((this + 8)),GHIDRA_CAST("File2Select"),0); slotAnimState = GHIDRA_CAST((this + 0xc0)); pbVar5 = GHIDRA_CAST("Animated"); goto LAB_009dbbe7; @@ -2704,7 +2705,7 @@ LAB_009dba7b: case 2: if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x19])) + 0x1)))) == 0) || (uVar6 = cleanupFlags, (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e])) + 0x2))) == '\0') ) { - animName = (GHIDRA_CAST((GHIDRA_CAST((this + 0x18)))))->ANM2::GetAnimation(GHIDRA_CAST(curAnim)); + animName = ANM2::GetAnimation(GHIDRA_CAST((this + 0x18)),GHIDRA_CAST(curAnim)); uVar6 = 4; animNameSize = &animName->_size; if (0xf < animName->_capacity) { @@ -2732,7 +2733,7 @@ LAB_009dbb26: operator_delete(allocBlock,uVar6); } if (isNeedSelectAnim != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((this + 8)))))->ANM2::Play(GHIDRA_CAST("File3Select"),0); + ANM2::Play(GHIDRA_CAST((this + 8)),GHIDRA_CAST("File3Select"),0); slotAnimState = GHIDRA_CAST((this + 0x11c)); pbVar5 = GHIDRA_CAST("Animated"); goto LAB_009dbbe7; @@ -2823,9 +2824,9 @@ LAB_009dbc8d: if ((uVar6 == 0) && ((pbVar5[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ed])) + 0x1))) != '\0')))) goto LAB_009dbd1b; } - bVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))))))->ANM2::SetAnimation(GHIDRA_CAST("DeleteConfirmationIdle"),1); + bVar4 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d6])) + 0x2)))),GHIDRA_CAST("DeleteConfirmationIdle"),1); if (bVar4 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1e6])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1ed])) + 0x1))) = 1; } goto LAB_009dbd1b; @@ -3016,7 +3017,7 @@ LAB_009dbec6: } operator_delete(pppppbVar8,freeSize); } - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST((slotSheets + -0x1f)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST((slotSheets + -0x1f)),GHIDRA_CAST(0x0)); sheet = toGoCount + 1; pLVar4->_visible = 1; toGoCount = sheet; @@ -3278,7 +3279,7 @@ LAB_009dc591: drawingSprite = GHIDRA_CAST((this + 100)); sheet = 3; do { - pLVar4 = (GHIDRA_CAST((drawingSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar4 = ANM2::GetLayer(drawingSprite,GHIDRA_CAST(0x0)); drawingSprite = drawingSprite + 1; pLVar4->_visible = 1; sheet = sheet + -1; diff --git a/generated-src/menu_special_seeds.cpp b/generated-src/menu_special_seeds.cpp index b34de88..e20bb52 100644 --- a/generated-src/menu_special_seeds.cpp +++ b/generated-src/menu_special_seeds.cpp @@ -28,8 +28,8 @@ void Menu_SpecialSeeds::Update() Seeds *scaledIndex; if (((g_manager->_framecount & 1) == 0) && ((seedEffectSet->SpecialSeedsSprite)._loaded != 0)) { - (GHIDRA_CAST((&(seedEffectSet->SpecialSeedsSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(seedEffectSet->SpecialSeedsSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(seedEffectSet->SpecialSeedsSprite)._animState); + AnimationState::Update(&(seedEffectSet->SpecialSeedsSprite)._overlayAnimState); } actionId = 0x18; isActionTriggered = @@ -315,15 +315,15 @@ void Menu_SpecialSeeds::Render() local_4a0.y = baseY; local_4a0.x = baseX; spriteCopy = sprite; - nullFrame = (GHIDRA_CAST((sprite)))->ANM2::GetNullFrame(GHIDRA_CAST("PaperTop"),GHIDRA_CAST("NextSection"),0); + nullFrame = ANM2::GetNullFrame(sprite,GHIDRA_CAST("PaperTop"),GHIDRA_CAST("NextSection"),0); local_494 = GHIDRA_CAST(*nullFrame); fVar7 = (float)nullFrame[1]; textBuf2 = 1.3135225e-38; - strBuf = (GHIDRA_CAST((sprite)))->ANM2::GetNullFrame(GHIDRA_CAST("PaperBottom"),GHIDRA_CAST("ListEnd"),0); + strBuf = ANM2::GetNullFrame(sprite,GHIDRA_CAST("PaperBottom"),GHIDRA_CAST("ListEnd"),0); local_490 = *GHIDRA_CAST((GHIDRA_CAST(strBuf) + 4)); - isEffectAddable = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PaperTop"),1); + isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST("PaperTop"),1); if (((isEffectAddable != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) - && ((GHIDRA_CAST((&(sprite->SpecialSeedsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + && (AnimationState::SetFrameFloat(&(sprite->SpecialSeedsSprite)._animState,0.0), (sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) { (sprite->SpecialSeedsSprite)._animState._isPlaying = 0; } @@ -367,7 +367,7 @@ void Menu_SpecialSeeds::Render() checkmarkRngShifts = 0x900000005; fVar7 = local_4b4; local_4a8 = paperBottomY; - strBuf = (GHIDRA_CAST((sprite)))->ANM2::GetAnimationData(GHIDRA_CAST("PaperMiddle")); + strBuf = ANM2::GetAnimationData(sprite,GHIDRA_CAST("PaperMiddle")); local_490 = *GHIDRA_CAST((GHIDRA_CAST(strBuf) + 0x30)); if (fVar7 < paperBottomY) { do { @@ -388,17 +388,17 @@ void Menu_SpecialSeeds::Render() } textBuf2 = 1.3136013e-38; nullFrameOffset = - (GHIDRA_CAST((sprite)))->ANM2::GetNullFrame(GHIDRA_CAST("PaperMiddle"),GHIDRA_CAST("NextSection"),local_4b8); + ANM2::GetNullFrame(sprite,GHIDRA_CAST("PaperMiddle"),GHIDRA_CAST("NextSection"),local_4b8); local_4ac = *nullFrameOffset; local_494 = GHIDRA_CAST(nullFrameOffset[1]); if (local_4a8 < (float)local_494 + local_4b4) { local_4b8 = 4; textBuf2 = 1.3136112e-38; - nullFrameOffset = (GHIDRA_CAST((sprite)))->ANM2::GetNullFrame(GHIDRA_CAST("PaperMiddle"),GHIDRA_CAST("NextSection"),4); + nullFrameOffset = ANM2::GetNullFrame(sprite,GHIDRA_CAST("PaperMiddle"),GHIDRA_CAST("NextSection"),4); local_4ac = *nullFrameOffset; local_494 = GHIDRA_CAST(nullFrameOffset[1]); } - isEffectAddable = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PaperMiddle"),1); + isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST("PaperMiddle"),1); if (((isEffectAddable != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -426,9 +426,9 @@ void Menu_SpecialSeeds::Render() local_4a0.x = local_4a0.x + local_4ac; } while (local_4b4 < local_4a8); } - isEffectAddable = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("PaperBottom"),1); + isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST("PaperBottom"),1); if (((isEffectAddable != 0) && ((sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) - && ((GHIDRA_CAST((&(sprite->SpecialSeedsSprite)._animState)))->AnimationState::SetFrameFloat(0.0), + && (AnimationState::SetFrameFloat(&(sprite->SpecialSeedsSprite)._animState,0.0), (sprite->SpecialSeedsSprite)._animState._animData != (void *)0x0)) { (sprite->SpecialSeedsSprite)._animState._isPlaying = 0; } @@ -514,9 +514,9 @@ LAB_008f0d3c: ; checkmarkSeed = checkmarkSeed >> 7 ^ checkmarkSeed; local_490 = GHIDRA_CAST((checkmarkSeed % 3)); - isEffectAddable = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Checkmark"),1); + isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST("Checkmark"),1); if (((isEffectAddable != 0) && ((sprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&sprite->_animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_490)), + (AnimationState::SetFrameFloat(&sprite->_animState,(float)GHIDRA_INT(local_490)), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } @@ -795,7 +795,7 @@ LAB_008f0d3c: local_490 = GHIDRA_CAST((((float)(GHIDRA_UINT(local_4ac) >> 8 & 0xff) + 0.0) / 255.0)); local_4ac = ((float)(GHIDRA_UINT(local_4ac) & 0xff) + 0.0) / 255.0; colorAlpha = ((float)uVar5 + 0.0) / 255.0; - strBuf = (GHIDRA_CAST((local_494)))->Font::layout_glyphs(glyphRun,GHIDRA_CAST(&local_458[0]._scaleW),&local_45c, + strBuf = Font::layout_glyphs(local_494,glyphRun,GHIDRA_CAST(&local_458[0]._scaleW),&local_45c, &g_vectorOne); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 5; color._green = (float)local_490; @@ -815,7 +815,7 @@ LAB_008f0d3c: (*GHIDRA_CAST((GHIDRA_CAST(&(local_458[0])) + 0x12))) = 0; local_458[0]._lineHeight = 0; local_458[0]._base = 0; - seedListBytes = (GHIDRA_CAST((local_494)))->Font::get_string_width_utf16(&local_458[0]._scaleW,-1); + seedListBytes = Font::get_string_width_utf16(local_494,&local_458[0]._scaleW,-1); local_4f4 = (float)((double)seedListBytes + __uint_to_double_fixup[-(seedListBytes >> 0x1f)] ); if (iVar3 == 2) { @@ -823,9 +823,9 @@ LAB_008f0d3c: if (isEffectAddable == 0) goto LAB_008f1841; local_490 = GHIDRA_CAST(0x0); LAB_008f174b: - isEffectAddable = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("NoAchievement"),1); + isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST("NoAchievement"),1); if (((isEffectAddable != 0) && ((sprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&sprite->_animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_490)), + (AnimationState::SetFrameFloat(&sprite->_animState,(float)GHIDRA_INT(local_490)), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } @@ -891,9 +891,9 @@ LAB_008f19db: } } if (local_4a8 == sprite->PositionX) { - isEffectAddable = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Cursor"),1); + isEffectAddable = ANM2::SetAnimation(sprite,GHIDRA_CAST("Cursor"),1); if (((isEffectAddable != 0) && ((sprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&sprite->_animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&sprite->_animState,0.0), (sprite->_animState)._animData != (void *)0x0)) { (sprite->_animState)._isPlaying = 0; } diff --git a/generated-src/menu_stats.cpp b/generated-src/menu_stats.cpp index 5c1e105..f18e9da 100644 --- a/generated-src/menu_stats.cpp +++ b/generated-src/menu_stats.cpp @@ -95,7 +95,8 @@ void Menu_Stats::Render(int param_2) } if (((this->_StatsMenuSprite)._filename._size == 0xd8) && (0 < *GHIDRA_CAST((this->_achievementMiniSprite2)._animDefaultName._buf))) { - pLVar2 = (GHIDRA_CAST((GHIDRA_CAST(&(this->_StatsMenuSprite)._animDefaultName._capacity))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + pLVar2 = ANM2::GetLayer(GHIDRA_CAST(&(this->_StatsMenuSprite)._animDefaultName._capacity),GHIDRA_CAST(0x0) + ); (pLVar2->_size).x = g_vectorZero.x; (pLVar2->_size).y = g_vectorZero.y; iVar5 = *GHIDRA_CAST((this->_achievementMiniSprite2)._filename._buf); @@ -112,7 +113,7 @@ void Menu_Stats::Render(int param_2) if ((this->_StatsMenuSprite)._filename._size == 0xd3) { if (*GHIDRA_CAST((this->_achievementMiniSprite2)._animDefaultName._buf) == 4) { *GHIDRA_CAST((GHIDRA_CAST(this->_IconIDtoUseForAchievementID) + 0x31)) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(this->_StatsMenuSprite)._animDefaultName._capacity))))->ANM2::Play(GHIDRA_CAST("Death"),0); + ANM2::Play(GHIDRA_CAST(&(this->_StatsMenuSprite)._animDefaultName._capacity),GHIDRA_CAST("Death"),0); if ((this->_StatsMenuSprite)._overlayAnimState._animFrame != 0.0) { AnimationState::AdvancePosition (GHIDRA_CAST(&(this->_StatsMenuSprite)._overlayAnimState._nullLayerFrames), @@ -121,7 +122,8 @@ void Menu_Stats::Render(int param_2) } } else if (0 < *GHIDRA_CAST(((this->_achievementMiniSprite2)._filename._buf + 0xc))) { - (GHIDRA_CAST((GHIDRA_CAST(&(this->_StatsMenuSprite)._animDefaultName._capacity))))->ANM2::PlayOverlay(GHIDRA_CAST("Mantle"),0); + ANM2::PlayOverlay(GHIDRA_CAST(&(this->_StatsMenuSprite)._animDefaultName._capacity), + GHIDRA_CAST("Mantle"),0); } } uVar7 = (this->_StatsMenuSprite)._filename._size; @@ -368,15 +370,15 @@ Menu_Stats::~Menu_Stats() _eh_vector_destructor_iterator_(this->_achievementOverlayEntries,0x34,0x282,FUN_00420b00); _eh_vector_destructor_iterator_(&this->_achievementMiniSprite1,0x114,0xb,ANM2::~ANM2); local_8 = 0; - (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_achievementsSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_achievementsSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_achievementsSprite); + AnimationState::~AnimationState(&(this->_achievementsSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_achievementsSprite)._animState); (GHIDRA_CAST(((this->_achievementsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_achievementsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((&this->_StatsMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_StatsMenuSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_StatsMenuSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_StatsMenuSprite); + AnimationState::~AnimationState(&(this->_StatsMenuSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_StatsMenuSprite)._animState); (GHIDRA_CAST(((this->_StatsMenuSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_StatsMenuSprite))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -400,8 +402,8 @@ void Menu_Stats::unload_graphics() puStack_c = &LAB_00b05a30; local_10 = ExceptionList; ExceptionList = &local_10; - (GHIDRA_CAST((&this->_StatsMenuSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_StatsMenuSprite); + ANM2::Reset(&this->_achievementsSprite); spriteFields = &(this->_achievementMiniSprite1)._animDefaultName._size; spritesLeft = 0xb; do { @@ -414,8 +416,8 @@ void Menu_Stats::unload_graphics() } spriteFields[-6] = 0; *GHIDRA_CAST(fileNameChars) = 0; - (GHIDRA_CAST((GHIDRA_CAST((spriteFields + 2)))))->AnimationState::SetAnimationData((void *)0x0); - (GHIDRA_CAST((GHIDRA_CAST((spriteFields + 10)))))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteFields + 2)),(void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((spriteFields + 10)),(void *)0x0); animName = GHIDRA_CAST((spriteFields + -4)); if (0xf < spriteFields[1]) { animName = *GHIDRA_CAST(animName->_buf); @@ -514,7 +516,7 @@ void Menu_Stats::LoadGraphics() anmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/ui/main menu/StatsMenu.anm2",0x20); local_14 = 0; - (GHIDRA_CAST((&this->_StatsMenuSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_StatsMenuSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -542,7 +544,7 @@ LAB_009ec971: anmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anmPath._buf))) + 0x0))),"gfx/ui/achievement/achievements.anm2",0x25); local_14 = 1; - (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::Load(&anmPath,1); + ANM2::Load(&this->_achievementsSprite,&anmPath,1); local_14 = 0xffffffff; if (0xf < anmPath._capacity) { uVar3 = anmPath._capacity + 1; @@ -572,7 +574,7 @@ LAB_009ec971: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(componentsPath._buf))) + 0x0))),"gfx/ui/main menu/SecretsMenuComponents.anm2", 0x2c); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST((miniSpriteAnimData + -0xd)))))->ANM2::Load(&componentsPath,1); + ANM2::Load(GHIDRA_CAST((miniSpriteAnimData + -0xd)),&componentsPath,1); local_14 = 0xffffffff; if (0xf < componentsPath._capacity) { uVar3 = componentsPath._capacity + 1; @@ -616,9 +618,9 @@ LAB_009ecb55: if ((uVar3 == 0) && ((currentAnim[0x34] == 0 || (*GHIDRA_CAST((miniSpriteAnimData + 4)) != 0)))) goto LAB_009ecb85; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((miniSpriteAnimData + -0xd)))))->ANM2::SetAnimation(GHIDRA_CAST("Icon1Unlocked"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((miniSpriteAnimData + -0xd)),GHIDRA_CAST("Icon1Unlocked"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((miniSpriteAnimData + -1)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((miniSpriteAnimData + -1))); *GHIDRA_CAST((miniSpriteAnimData + 4)) = 1; } } @@ -645,8 +647,8 @@ void Menu_Stats::Update() Manager *manager; if (((g_manager->_framecount & 1) == 0) && ((this->_StatsMenuSprite)._loaded != 0)) { - (GHIDRA_CAST((&(this->_StatsMenuSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_StatsMenuSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_StatsMenuSprite)._animState); + AnimationState::Update(&(this->_StatsMenuSprite)._overlayAnimState); } manager = g_manager; this->_countItemsInCollection = 0; @@ -699,7 +701,7 @@ void Menu_Stats::Update() targetFrame = 0.0; } *GHIDRA_CAST((GHIDRA_INT((this->_StatsMenuSprite)._animState._layerFrames) + iVar1 * 4)) = 0; - (GHIDRA_CAST((&(this->_StatsMenuSprite)._animState)))->AnimationState::AdvanceLayerPosition(iVar1,targetFrame); + AnimationState::AdvanceLayerPosition(&(this->_StatsMenuSprite)._animState,iVar1,targetFrame); } LAB_009ecd3e: if (this->_isAchievementScreenVisible == 0) { @@ -721,7 +723,7 @@ LAB_009ecd3e: KAGE_LogMessage(0x10,GHIDRA_CAST("id out of bounds\n")); } *GHIDRA_CAST((GHIDRA_INT((this->_StatsMenuSprite)._animState._layerFrames) + layerId * 4)) = 0; - (GHIDRA_CAST((&(this->_StatsMenuSprite)._animState)))->AnimationState::AdvanceLayerPosition(layerId,(float)iVar1); + AnimationState::AdvanceLayerPosition(&(this->_StatsMenuSprite)._animState,layerId,(float)iVar1); } return; } @@ -777,7 +779,7 @@ void Menu_Stats::Render() local_50.x = local_58.y; menuY = local_50.y; local_44.y = (float)this; - hiddenLayer = (GHIDRA_CAST((&this->_StatsMenuSprite)))->ANM2::GetLayer(&DAT_00000007); + hiddenLayer = ANM2::GetLayer(&this->_StatsMenuSprite,&DAT_00000007); hiddenLayer->_visible = 0; if ((this->_StatsMenuSprite)._loaded != 0) { if ((this->_StatsMenuSprite)._overlayRenderFirst == 0) { @@ -869,9 +871,9 @@ void Menu_Stats::Render() color._blue = 0.8; color._alpha = 1.0; y = (g_menuManager->_ViewPosition).y + *GHIDRA_CAST((GHIDRA_CAST(local_44.y) + 0x18)) + 30.0; - iVar4 = (GHIDRA_CAST((&g_manager->_font1_TeamMeatEx10)))->Font::get_string_width_n(countText,-1); + iVar4 = Font::get_string_width_n(&g_manager->_font1_TeamMeatEx10,countText,-1); fVar3 = local_44.y; - (GHIDRA_CAST((&pMVar1->_font1_TeamMeatEx10)))->Font::DrawString(countText,&color,&fontParams, + Font::DrawString(&pMVar1->_font1_TeamMeatEx10,countText,&color,&fontParams, ((pMVar2->_ViewPosition).x + *GHIDRA_CAST((GHIDRA_CAST(local_44.y) + 0x14)) + 240.0) - (float)((double)iVar4 + __uint_to_double_fixup[-(iVar4 >> 0x1f)]) * 0.5,y); local_14 = 0xffffffff; @@ -954,9 +956,9 @@ void Menu_Stats::reset_state() animData = (this->_StatsMenuSprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_009ed415: - bVar1 = (GHIDRA_CAST((&this->_StatsMenuSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_StatsMenuSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_StatsMenuSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_StatsMenuSprite)._animState); (this->_StatsMenuSprite)._animState._isPlaying = 1; } } @@ -987,14 +989,14 @@ LAB_009ed407: ((animData[0x34] != 0 && ((this->_StatsMenuSprite)._animState._isPlaying == 0)))) goto LAB_009ed415; } - achievementsLayer = (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + achievementsLayer = ANM2::GetLayer(&this->_achievementsSprite,GHIDRA_CAST(0x0)); achievementsLayer->_visible = 0; animData = (this->_cursorLeftSprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_009ed496: - bVar1 = (GHIDRA_CAST((&this->_cursorLeftSprite)))->ANM2::SetAnimation(GHIDRA_CAST("CursorLeft"),1); + bVar1 = ANM2::SetAnimation(&this->_cursorLeftSprite,GHIDRA_CAST("CursorLeft"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_cursorLeftSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_cursorLeftSprite)._animState); (this->_cursorLeftSprite)._animState._isPlaying = 1; } } @@ -1053,9 +1055,9 @@ LAB_009ed4fc: ((animData[0x34] == 0 || ((this->_cursorRightSprite)._animState._isPlaying != 0)))) goto LAB_009ed535; } - bVar1 = (GHIDRA_CAST((&this->_cursorRightSprite)))->ANM2::SetAnimation(GHIDRA_CAST("CursorRight"),1); + bVar1 = ANM2::SetAnimation(&this->_cursorRightSprite,GHIDRA_CAST("CursorRight"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_cursorRightSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_cursorRightSprite)._animState); (this->_cursorRightSprite)._animState._isPlaying = 1; } LAB_009ed535: @@ -1090,7 +1092,7 @@ int Menu_Stats::render_number(uint32_t value, Vector position) void *animData; ANM2 *animation; - digitLayer = (GHIDRA_CAST((&this->_StatsMenuSprite)))->ANM2::GetLayer(&DAT_00000007); + digitLayer = ANM2::GetLayer(&this->_StatsMenuSprite,&DAT_00000007); digitLayer->_visible = 1; do { remainingValue = value / 10; @@ -1672,7 +1674,7 @@ void Menu_Stats::update_stats_screen() uVar5 = uVar5 + 1; } while (uVar5 < 0x282); local_54->_isAchievementScreenVisible = 1; - (GHIDRA_CAST((&local_54->_achievementsSprite)))->ANM2::Play(GHIDRA_CAST("Appear"),0); + ANM2::Play(&local_54->_achievementsSprite,GHIDRA_CAST("Appear"),0); bVar3 = (GHIDRA_CAST((&g_manager->_persistentGameData)))->PersistentGameData::Unlocked(local_58); if (bVar3 == 0) { (*GHIDRA_CAST((GHIDRA_CAST(&(local_50)) + 0x14))) = msvc::_Allocate(0x30); @@ -1705,7 +1707,7 @@ void Menu_Stats::update_stats_screen() &persistentData->_achievementOverlayEntries[extraout_EDX_00]._gfx); bVar3 = extraout_CL; } - (GHIDRA_CAST((&persistentData->_achievementsSprite)))->ANM2::LoadGraphics(bVar3); + ANM2::LoadGraphics(&persistentData->_achievementsSprite,bVar3); persistentData->_achievementScrollThruListPosition = 0.0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_50)) + 0x10))) = 0.0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_50)) + 0x14))) = 0.0; @@ -1831,15 +1833,15 @@ void Menu_Stats::update_achievements() ExceptionList = &local_1c; if (((g_manager->_framecount & 1) == 0) || (0x3c < this->_holdInputTimer)) { if ((this->_achievementsSprite)._loaded != 0) { - (GHIDRA_CAST((&(this->_achievementsSprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(this->_achievementsSprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(this->_achievementsSprite)._animState); + AnimationState::Update(&(this->_achievementsSprite)._overlayAnimState); } miniAnimState = &(this->_achievementMiniSprite1)._animState; local_6c = (void *)0xb; do { if (*GHIDRA_CAST((GHIDRA_INT(&miniAnimState[6]._currentlyTriggeredEvents) + 1)) != '\0') { - (GHIDRA_CAST((miniAnimState)))->AnimationState::Update(); - (GHIDRA_CAST((miniAnimState + 1)))->AnimationState::Update(); + AnimationState::Update(miniAnimState); + AnimationState::Update(miniAnimState + 1); } miniAnimState = GHIDRA_CAST(&miniAnimState[8]._isPlaying); local_6c = (void *)(GHIDRA_INT(local_6c) + -1); @@ -2005,9 +2007,9 @@ LAB_009ee575: } animName = "Dissapear"; LAB_009ee6a3: - bVar1 = (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST(animName),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_achievementsSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } @@ -2019,9 +2021,9 @@ LAB_009ee6a3: pbVar4 = (this->_achievementsSprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_009ee474: - bVar1 = (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Dissapear"),1); + bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST("Dissapear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_achievementsSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } @@ -2107,8 +2109,8 @@ LAB_009ee764: uVar2 = 0; LAB_009ee769: if (((uVar2 != 0) || (pbVar4[0x34] != 0)) && - (bVar1 = (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1), bVar1 != 0)) { - (GHIDRA_CAST((&(this->_achievementsSprite)._animState)))->AnimationState::Rewind(); + (bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST("Appear"),1), bVar1 != 0)) { + AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } iVar5 = this->_selectedAchievmentId + -1; @@ -2338,9 +2340,9 @@ LAB_009eeaa5: pbVar4 = (this->_achievementsSprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_009eeb44: - bVar1 = (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_achievementsSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } @@ -2446,9 +2448,9 @@ LAB_009eeb25: pbVar4 = (this->_achievementsSprite)._animState._animData; if (pbVar4 == GHIDRA_CAST(0x0)) { LAB_009eed44: - bVar1 = (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear2"),1); + bVar1 = ANM2::SetAnimation(&this->_achievementsSprite,GHIDRA_CAST("Appear2"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_achievementsSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_achievementsSprite)._animState); (this->_achievementsSprite)._animState._isPlaying = 1; } } @@ -2582,7 +2584,7 @@ LAB_009eeec0: } bVar1 = (uint8_t)uVar2; } - (GHIDRA_CAST((&this->_achievementsSprite)))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(&this->_achievementsSprite,bVar1); } LAB_009eeedc: if (240.0 < this->_achievementScrollInPosition) { @@ -2866,9 +2868,9 @@ LAB_009ef3d5: sprintf(unlockedAnimName,GHIDRA_CAST("Icon%dUnlocked")); pbVar4 = unlockedAnimName; LAB_009ef4ef: - bVar1 = (GHIDRA_CAST((&this->_achievementMiniSprite1 + GHIDRA_INT(pvVar8))))->ANM2::SetAnimation(pbVar4,1); + bVar1 = ANM2::SetAnimation(&this->_achievementMiniSprite1 + GHIDRA_INT(pvVar8),pbVar4,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(&this->_achievementMiniSprite1)[GHIDRA_INT(pvVar8)]._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(&this->_achievementMiniSprite1)[GHIDRA_INT(pvVar8)]._animState); (&this->_achievementMiniSprite1)[GHIDRA_INT(pvVar8)]._animState._isPlaying = 1; } } @@ -2909,9 +2911,9 @@ LAB_009ef495: } pbVar4 = lockedAnimName; LAB_009ef4bb: - bVar1 = (GHIDRA_CAST((&this->_achievementMiniSprite5)))->ANM2::SetAnimation(pbVar4,1); + bVar1 = ANM2::SetAnimation(&this->_achievementMiniSprite5,pbVar4,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(this->_achievementMiniSprite5)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(this->_achievementMiniSprite5)._animState); (this->_achievementMiniSprite5)._animState._isPlaying = 1; } } diff --git a/generated-src/menu_title.cpp b/generated-src/menu_title.cpp index d6cf399..1f14d6d 100644 --- a/generated-src/menu_title.cpp +++ b/generated-src/menu_title.cpp @@ -112,7 +112,7 @@ void Menu_Title::load_graphics() operator_delete(pvVar4,uVar2); bVar1 = extraout_CL_00; } - (GHIDRA_CAST((titleSprite)))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(titleSprite,bVar1); if (0xf < sheetPathCapacity) { uVar2 = sheetPathCapacity + 1; ppppbVar5 = sheetPath[0]; diff --git a/generated-src/minimap.cpp b/generated-src/minimap.cpp index 06b7a89..a2937f5 100644 --- a/generated-src/minimap.cpp +++ b/generated-src/minimap.cpp @@ -37,7 +37,7 @@ Minimap::~Minimap() } } local_8 = 1; - (GHIDRA_CAST((&this->_iconsSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_iconsSprite); frameBlock = (this->_iconsSprite)._overlayAnimState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { @@ -105,7 +105,7 @@ Minimap::~Minimap() (GHIDRA_CAST(((this->_iconsSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_iconsSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 6; - (GHIDRA_CAST((&this->_hudPickupSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_hudPickupSprite); frameBlock = (this->_hudPickupSprite)._overlayAnimState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { @@ -173,7 +173,7 @@ Minimap::~Minimap() (GHIDRA_CAST(((this->_hudPickupSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_hudPickupSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 0xb; - (GHIDRA_CAST((&this->_itemIconsSprite)))->ANM2::Reset(); + ANM2::Reset(&this->_itemIconsSprite); frameBlock = (this->_itemIconsSprite)._overlayAnimState._layerFrames; if (frameBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { @@ -555,7 +555,7 @@ LAB_0098ba0a: } self->_config[0]._minimapIconNum = GHIDRA_INT(fVar16); local_74.x = (float)local_4c; - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(self))))->ANM2::SetAnimation(GHIDRA_CAST("RoomOutline"),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(self),GHIDRA_CAST("RoomOutline"),1); if (((bVar5 != 0) && (*GHIDRA_CAST((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) && (AnimationState::SetFrameFloat @@ -732,7 +732,7 @@ LAB_0098bf22: self->_config[0]._mapSprite._scale.x = 1.0; } if (local_88->ListIndex == roomList[iVar13].ListIndex) { - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(self))))->ANM2::SetAnimation(GHIDRA_CAST("RoomCurrent"),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(self),GHIDRA_CAST("RoomCurrent"),1); if (((bVar5 != 0) && (*GHIDRA_CAST((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) && (AnimationState::SetFrameFloat @@ -780,7 +780,7 @@ LAB_0098bf22: else { uVar20 = 0x100b7d350; } - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(self))))->ANM2::SetAnimation(GHIDRA_CAST(uVar20), + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(self),GHIDRA_CAST(uVar20), (uint8_t)((uint64_t)uVar20 >> 0x20)); if (((bVar5 != 0) && (*GHIDRA_CAST((pMVar4->_config[0]._mapSprite._animDefaultName._buf + 4)) != 0)) && @@ -1448,9 +1448,9 @@ LAB_0098cc6f: iconSprite = iconSpriteRef; pbVar10 = GHIDRA_CAST(0x0); if (local_2c != GHIDRA_CAST(0x0)) { - bVar5 = (GHIDRA_CAST((iconSpriteRef)))->ANM2::SetAnimation(local_2c,1); + bVar5 = ANM2::SetAnimation(iconSpriteRef,local_2c,1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), (iconSprite->_animState)._animData != (void *)0x0)) { (iconSprite->_animState)._isPlaying = 0; } @@ -1486,7 +1486,7 @@ LAB_0098cc6f: if ((uVar6 & 0x1000) == 0) { if ((uVar6 & 0x20) == 0) { if ((char)uVar6 < '\0') { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconPill"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconPill"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -1505,7 +1505,8 @@ LAB_0098cc6f: if ((uVar6 & 0x800) == 0) { if ((uVar6 & 0x4000) == 0) { if ((uVar6 & 0x8000) != 0) { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconPortal"), + bVar5 = ANM2::SetAnimation(iconSprite, + GHIDRA_CAST("IconPortal"), 1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != @@ -1519,7 +1520,8 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconLadder"),1) + bVar5 = ANM2::SetAnimation(iconSprite, + GHIDRA_CAST("IconLadder"),1) ; if (((bVar5 != 0) && ((iconSprite->_animState)._animData != @@ -1533,7 +1535,8 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconSlot"),1); + bVar5 = ANM2::SetAnimation(iconSprite, + GHIDRA_CAST("IconSlot"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && @@ -1547,7 +1550,8 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconBeggar"),1); + bVar5 = ANM2::SetAnimation(iconSprite, + GHIDRA_CAST("IconBeggar"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0 )) && (AnimationState::SetFrameFloat @@ -1560,7 +1564,8 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconBattery"),1); + bVar5 = ANM2::SetAnimation(iconSprite, + GHIDRA_CAST("IconBattery"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -1573,7 +1578,8 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconCoin"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconCoin"),1 + ); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -1586,7 +1592,7 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconPoop"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconPoop"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -1598,7 +1604,7 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconBomb"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconBomb"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -1610,7 +1616,7 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconKey"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconKey"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -1622,10 +1628,10 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconCard"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconCard"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *GHIDRA_CAST((iconSpriteOwner + 0x534)) != 0)) { (iconSprite->_animState)._isPlaying = 0; } @@ -1633,10 +1639,10 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconRune"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconRune"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && - ((GHIDRA_CAST((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *GHIDRA_CAST((iconSpriteOwner + 0x534)) != 0)) { (iconSprite->_animState)._isPlaying = 0; } @@ -1644,7 +1650,7 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconChest"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconChest"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat @@ -1656,9 +1662,9 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconTrinket"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconTrinket"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0) - ) && ((GHIDRA_CAST((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0), + ) && (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *GHIDRA_CAST((iconSpriteOwner + 0x534)) != 0)) { (iconSprite->_animState)._isPlaying = 0; } @@ -1666,9 +1672,9 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconItem"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconItem"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) - && ((GHIDRA_CAST((&iconSprite->_animState)))->AnimationState::SetFrameFloat(0.0), + && (AnimationState::SetFrameFloat(&iconSprite->_animState,0.0), *GHIDRA_CAST((iconSpriteOwner + 0x534)) != 0)) { (iconSprite->_animState)._isPlaying = 0; } @@ -1676,7 +1682,7 @@ LAB_0098cc6f: } } else { - bVar5 = (GHIDRA_CAST((iconSprite)))->ANM2::SetAnimation(GHIDRA_CAST("IconHeart"),1); + bVar5 = ANM2::SetAnimation(iconSprite,GHIDRA_CAST("IconHeart"),1); if (((bVar5 != 0) && ((iconSprite->_animState)._animData != (void *)0x0)) && (AnimationState::SetFrameFloat (&iconSprite->_animState,(float)GHIDRA_INT(heartIconFrame)), @@ -1795,7 +1801,7 @@ void Minimap::Init() local_38._unk = 0x1f; builtin_strncpy(GHIDRA_CAST(anm2Path),"gfx/ui/minimap1.anm2",0x15); local_14 = 0; - (GHIDRA_CAST((&this->_config[0]._mapSprite)))->ANM2::Load(GHIDRA_CAST(anm2Path),1); + ANM2::Load(&this->_config[0]._mapSprite,GHIDRA_CAST(anm2Path),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_38._unk)) { uVar11 = local_38._unk + 1; @@ -1830,7 +1836,7 @@ void Minimap::Init() local_38._unk = 0x1f; builtin_strncpy(GHIDRA_CAST(anm2Path),"gfx/ui/minimap2.anm2",0x15); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((this->_config[1]._mapSprite._filename._buf + 4)))))->ANM2::Load(GHIDRA_CAST(anm2Path),1); + ANM2::Load(GHIDRA_CAST((this->_config[1]._mapSprite._filename._buf + 4)),GHIDRA_CAST(anm2Path),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_38._unk)) { uVar11 = local_38._unk + 1; @@ -1902,7 +1908,7 @@ void Minimap::Init() local_38._unk = 0x1f; builtin_strncpy(GHIDRA_CAST(anm2Path),"gfx/ui/mapitemicons.anm2",0x19); local_14 = 4; - (GHIDRA_CAST((&pMVar2->_itemIconsSprite)))->ANM2::Load(GHIDRA_CAST(anm2Path),1); + ANM2::Load(&pMVar2->_itemIconsSprite,GHIDRA_CAST(anm2Path),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_38._unk)) { uVar11 = local_38._unk + 1; @@ -1928,7 +1934,7 @@ void Minimap::Init() local_38._unk = 0x1f; builtin_strncpy(GHIDRA_CAST(anm2Path),"gfx/ui/hudpickups.anm2",0x17); local_14 = 5; - (GHIDRA_CAST((&pMVar2->_hudPickupSprite)))->ANM2::Load(GHIDRA_CAST(anm2Path),1); + ANM2::Load(&pMVar2->_hudPickupSprite,GHIDRA_CAST(anm2Path),1); local_14 = 0xffffffff; if (0xf < GHIDRA_UINT(local_38._unk)) { uVar11 = local_38._unk + 1; @@ -1968,7 +1974,7 @@ void Minimap::Init() iconsPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(iconsPath._buf))) + 0x0))),"gfx/ui/minimap_icons.anm2",0x1a); local_14 = 8; - (GHIDRA_CAST((&pMVar2->_iconsSprite)))->ANM2::Load(&iconsPath,1); + ANM2::Load(&pMVar2->_iconsSprite,&iconsPath,1); if (0xf < iconsPath._capacity) { uVar11 = iconsPath._capacity + 1; ptr = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(iconsPath._buf))) + 0x0))); @@ -2152,9 +2158,9 @@ void Minimap::render_icons(float *param_2) do { uVar3 = iconFrames[iconIndex]; if (GHIDRA_INT(uVar3) < 0) { - isAnimSet = (GHIDRA_CAST((iconsSprite)))->ANM2::SetAnimation(GHIDRA_CAST("curses"),1); + isAnimSet = ANM2::SetAnimation(iconsSprite,GHIDRA_CAST("curses"),1); if ((isAnimSet != 0) && ((pMVar2->_itemIconsSprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pMVar2->_itemIconsSprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(~uVar3)); + AnimationState::SetFrameFloat(&(pMVar2->_itemIconsSprite)._animState,(float)GHIDRA_INT(~uVar3)); animData = (pMVar2->_itemIconsSprite)._animState._animData; LAB_0098e430: if (animData != (void *)0x0) { @@ -2163,9 +2169,9 @@ LAB_0098e430: } } else { - isAnimSet = (GHIDRA_CAST((iconsSprite)))->ANM2::SetAnimation(GHIDRA_CAST("icons"),1); + isAnimSet = ANM2::SetAnimation(iconsSprite,GHIDRA_CAST("icons"),1); if ((isAnimSet != 0) && ((pMVar2->_itemIconsSprite)._animState._animData != (void *)0x0)) { - (GHIDRA_CAST((&(pMVar2->_itemIconsSprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar3)); + AnimationState::SetFrameFloat(&(pMVar2->_itemIconsSprite)._animState,(float)GHIDRA_INT(uVar3)); animData = (pMVar2->_itemIconsSprite)._animState._animData; goto LAB_0098e430; } @@ -2286,9 +2292,10 @@ void Minimap::Render() local_114._green = (this->_shakeOffset).y + 16.0 + fVar5; local_d0._tint[3] = local_118; local_88 = local_118; - (GHIDRA_CAST((&this->_config[0]._mapSprite)))->ANM2::SetFrame(GHIDRA_CAST("Frame"),0); + ANM2::SetFrame(&this->_config[0]._mapSprite,GHIDRA_CAST("Frame"),0); (GHIDRA_CAST((GHIDRA_CAST(this->_config))))->Sprite::SetColor(&local_d0); - (GHIDRA_CAST((&this->_config[0]._mapSprite)))->ANM2::Render(GHIDRA_CAST(&local_114),&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_config[0]._mapSprite,GHIDRA_CAST(&local_114),&g_vectorZero,&g_vectorZero + ); if ((*GHIDRA_CAST((GHIDRA_CAST(&(local_144)) + 0x0))) == '\0') { (GHIDRA_CAST((GHIDRA_CAST(&local_d0))))->Color::Color(); (GHIDRA_CAST((GHIDRA_CAST(this->_config))))->Sprite::SetColor(color); @@ -2561,17 +2568,17 @@ void Minimap::render_score_time() textY = hudInset * -24.0; shakeX = (game->_screenShakeOffset).x; local_88 = (game->_screenShakeOffset).y; - iVar1 = (GHIDRA_CAST((font)))->Font::get_string_width_n(GHIDRA_CAST(" 00:00:00"),-1); + iVar1 = Font::get_string_width_n(font,GHIDRA_CAST(" 00:00:00"),-1); labelText = string_table_translate(local_74,GHIDRA_CAST("#MINIMAP_TIME_LABEL")); - iVar2 = (GHIDRA_CAST((fontCopy)))->Font::get_string_width_n(labelText,-1); + iVar2 = Font::get_string_width_n(fontCopy,labelText,-1); pSVar5 = &g_manager->_stringTable; local_78 = (StringTable *) ((float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) + (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])); local_6c = local_78; - iVar1 = (GHIDRA_CAST((fontCopy)))->Font::get_string_width_n(GHIDRA_CAST(" 000000"),-1); + iVar1 = Font::get_string_width_n(fontCopy,GHIDRA_CAST(" 000000"),-1); labelText = string_table_translate(pSVar5,GHIDRA_CAST("#MINIMAP_TIME_LABEL")); - iVar2 = (GHIDRA_CAST((font)))->Font::get_string_width_n(labelText,-1); + iVar2 = Font::get_string_width_n(font,labelText,-1); local_74 = (StringTable *) ((float)((double)iVar2 + __uint_to_double_fixup[-(iVar2 >> 0x1f)]) + (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])); @@ -2657,7 +2664,7 @@ void Minimap::render_score_time() } sprintf_s(valueText,0x40,GHIDRA_CAST("%02d:%02d:%02d")); fontCopy = font; - iVar1 = (GHIDRA_CAST((font)))->Font::get_string_width_n(valueText,-1); + iVar1 = Font::get_string_width_n(font,valueText,-1); local_a8 = 0; local_a4 = 0xffff; local_a0 = 0; @@ -2669,7 +2676,7 @@ void Minimap::render_score_time() labelText = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#MINIMAP_TIME_LABEL")); local_6c = GHIDRA_CAST((shakeX + (float)local_6c)); local_7c = textY + 30.0 + local_88; - (GHIDRA_CAST((fontCopy)))->Font::DrawString(labelText,&local_bc,&local_a8,(float)local_6c,local_7c); + Font::DrawString(fontCopy,labelText,&local_bc,&local_a8,(float)local_6c,local_7c); local_a8 = 0; local_a4 = 0xffff; local_a0 = 0; @@ -2678,7 +2685,7 @@ void Minimap::render_score_time() uStack_94 = 0; local_90 = 0; local_14 = 1; - (GHIDRA_CAST((fontCopy)))->Font::DrawString(valueText,&local_bc,&local_a8,((float)local_78 - (float)iVar1) + shakeX, + Font::DrawString(fontCopy,valueText,&local_bc,&local_a8,((float)local_78 - (float)iVar1) + shakeX, local_7c); local_14 = 0xffffffff; LAB_0098f558: @@ -2688,20 +2695,20 @@ LAB_0098f558: local_bc._red = 1.0; local_bc._green = 1.0; local_bc._blue = 1.0; - (GHIDRA_CAST((GHIDRA_CAST(&local_a8))))->FontSettings::constructor(); + FontSettings::constructor(GHIDRA_CAST(&local_a8)); local_14 = 2; labelText = string_table_translate(&g_manager->_stringTable,GHIDRA_CAST("#MINIMAP_SCORE_LABEL")); textY = textY + 46.0 + local_88; - (GHIDRA_CAST((fontCopy)))->Font::DrawString(labelText,&local_bc,settings,(float)local_6c,textY); + Font::DrawString(fontCopy,labelText,&local_bc,settings,(float)local_6c,textY); local_14 = 0xffffffff; uStack_94 = 0; local_90 = 0; (GHIDRA_CAST((GHIDRA_CAST(&g_game->_scoreSheet))))->ScoreSheet::Calculate(); sprintf_s(valueText,0x40,s__d); - (GHIDRA_CAST((fontCopy)))->Font::get_string_width_n(valueText,-1); - (GHIDRA_CAST((local_e4)))->FontSettings::constructor(); + Font::get_string_width_n(fontCopy,valueText,-1); + FontSettings::constructor(local_e4); local_14 = 3; - (GHIDRA_CAST((fontCopy)))->Font::DrawString(valueText,&local_bc,settings_00, + Font::DrawString(fontCopy,valueText,&local_bc,settings_00, ((float)local_78 - (float)extraout_EDX) + shakeX,textY); } ExceptionList = local_1c; diff --git a/generated-src/mod.cpp b/generated-src/mod.cpp index 96810b4..b6dd9c8 100644 --- a/generated-src/mod.cpp +++ b/generated-src/mod.cpp @@ -75,7 +75,7 @@ void Mod::load_menu_sprites() (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; } if (pbVar4 != GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((sprite)))->ANM2::Load(&contentPath,1); + ANM2::Load(sprite,&contentPath,1); } (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xff; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))) = 0xffffff; diff --git a/generated-src/mod_manager.cpp b/generated-src/mod_manager.cpp index 5bfeac0..50c9190 100644 --- a/generated-src/mod_manager.cpp +++ b/generated-src/mod_manager.cpp @@ -11,15 +11,15 @@ ModManager::~ModManager() local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((this + 0xab18)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xab32])) + 0x2)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0xab28)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((this + 0xab18))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xab32])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0xab28))); (GHIDRA_CAST((GHIDRA_CAST((this + 0xab20)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this + 0xab18)))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((this + 0xaabc)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xaad6])) + 0x2)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0xaacc)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((this + 0xaabc))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0xaad6])) + 0x2))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0xaacc))); (GHIDRA_CAST((GHIDRA_CAST((this + 0xaac4)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this + 0xaabc)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((this + 0xaab4)))))->msvc::string::_Tidy_deallocate(); @@ -1059,7 +1059,7 @@ LAB_008f46dd: (GHIDRA_CAST((GHIDRA_CAST(&g_manager->_entityConfig))))->Menu_Mods::Update(); (GHIDRA_CAST((local_84._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST("gfx/ui/mod_defaults.anm2")); local_14 = 0x20; - (GHIDRA_CAST((GHIDRA_CAST((this + 0xab18)))))->ANM2::Load(&local_84,1); + ANM2::Load(GHIDRA_CAST((this + 0xab18)),&local_84,1); (GHIDRA_CAST((local_84._buf)))->msvc::string::_Tidy_deallocate(); ExceptionList = local_1c; return; @@ -3030,9 +3030,9 @@ LAB_008f8b45: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((gameOverAnm->_animState)._isPlaying != 0)))) goto LAB_008f8b70; } - bVar1 = (GHIDRA_CAST((gameOverAnm)))->ANM2::SetAnimation(GHIDRA_CAST(displayName),1); + bVar1 = ANM2::SetAnimation(gameOverAnm,GHIDRA_CAST(displayName),1); if (bVar1 != 0) { - (GHIDRA_CAST((&gameOverAnm->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&gameOverAnm->_animState); (gameOverAnm->_animState)._isPlaying = 1; } LAB_008f8b70: @@ -3053,7 +3053,7 @@ LAB_008f8b70: displayNameTextSize = 0; displayNameTextCapacity = 0xf; displayNameText[0] = (void *)(GHIDRA_UINT(displayNameText[0]) & 0xffffff00); - (GHIDRA_CAST((playerConfig->_moddedGameOverANM2)))->ANM2::Render(position,&g_vectorZero,&g_vectorZero); + ANM2::Render(playerConfig->_moddedGameOverANM2,position,&g_vectorZero,&g_vectorZero); ExceptionList = local_10; return; } @@ -3181,9 +3181,9 @@ LAB_008f8e0a: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((menuSprite->_animState)._isPlaying != 0)))) goto LAB_008f8e35; } - bVar1 = (GHIDRA_CAST((menuSprite)))->ANM2::SetAnimation(GHIDRA_CAST(displayName),1); + bVar1 = ANM2::SetAnimation(menuSprite,GHIDRA_CAST(displayName),1); if (bVar1 != 0) { - (GHIDRA_CAST((&menuSprite->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&menuSprite->_animState); (menuSprite->_animState)._isPlaying = 1; } LAB_008f8e35: @@ -3204,7 +3204,7 @@ LAB_008f8e35: displayNameSize = 0; displayNameCapacity = 0xf; displayNameStr[0] = (void *)(GHIDRA_UINT(displayNameStr[0]) & 0xffffff00); - (GHIDRA_CAST((playerConfig->_moddedMenuBackgroundANM2)))->ANM2::Render(renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(playerConfig->_moddedMenuBackgroundANM2,renderPos,&g_vectorZero,&g_vectorZero); ExceptionList = local_10; return; } diff --git a/generated-src/netplay_manager.cpp b/generated-src/netplay_manager.cpp index 9300e6a..98d8f2e 100644 --- a/generated-src/netplay_manager.cpp +++ b/generated-src/netplay_manager.cpp @@ -174,9 +174,9 @@ NetplayManager::~NetplayManager() local_8 = 1; NetplayTextPopup::clear(); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),2); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x591])) + 0x1)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((this + 0x5ac)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5a1])) + 0x1)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x591])) + 0x1))))); + AnimationState::~AnimationState(GHIDRA_CAST((this + 0x5ac))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x5a1])) + 0x1))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x599])) + 0x1))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x591])) + 0x1))))))->msvc::string::_Tidy_deallocate(); msvc::deque<36byte>::_Tidy(); @@ -263,7 +263,7 @@ void NetplayManager::Init() local_40._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_40._buf))) + 0x0))),"gfx/ui/ui_streak.anm2",0x16); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x591])) + 0x1)))))))->ANM2::Load(&local_40,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x591])) + 0x1)))),&local_40,1); local_14 = 0xffffffff; if (0xf < local_40._capacity) { size = local_40._capacity + 1; @@ -278,7 +278,7 @@ void NetplayManager::Init() } operator_delete(strBuf,size); } - paperLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x591])) + 0x1)))))))->ANM2::GetLayer(GHIDRA_CAST("paper")); + paperLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x591])) + 0x1)))),GHIDRA_CAST("paper")); paperLayer->_visible = 0; msvc::list>::push_back(); msvc::list>::push_back(); @@ -415,7 +415,7 @@ void NetplayManager::Init() local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),3); *GHIDRA_CAST((pNVar1 + 0x61c)) = *extraout_EAX_00; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(pNVar1[0x61e])) + 0x2)))) = extraout_EAX_00[2]; - (GHIDRA_CAST((pNVar1 + 0x620)))->FormattedText::operator_assign(extraout_EAX_00 + 3); + FormattedText::operator_assign(pNVar1 + 0x620,extraout_EAX_00 + 3); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(pNVar1[0x625])) + 0x1)))) = extraout_EAX_00[7]; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(pNVar1[0x626])) + 0x2)))) = extraout_EAX_00[8]; *GHIDRA_CAST((pNVar1 + 0x628)) = extraout_EAX_00[9]; @@ -1569,10 +1569,10 @@ uint8_t NetplayManager::Update() puVar2 = received + 0x34; if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x85d])) + 0x1)))) != 0) && (puVar2 = received + 0x34, (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x862])) + 0x2))) != '\0')) { - (GHIDRA_CAST((GHIDRA_CAST((this + 0x84c)))))->ANM2::update_appear_then_idle(); + ANM2::update_appear_then_idle(GHIDRA_CAST((this + 0x84c))); if (*GHIDRA_CAST((this + 0x90b)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x8c2])) + 0x2)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x8cd])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x8c2])) + 0x2))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x8cd])) + 0x1))))); } local_2c = GHIDRA_CAST(&DAT_0000000f); cVar3 = (**(code **)(PTR_vftable_00c57b18 + 0x74))(0xffffffff,FUN_00a209e0,&local_2c); @@ -1888,7 +1888,7 @@ void NetplayManager::Render() if (0xf < *GHIDRA_CAST((str + 0x14))) { str = *GHIDRA_CAST(str); } - (GHIDRA_CAST((&manager->_font2_TeamMeatEx12)))->Font::DrawString(str,&drawPos,GHIDRA_CAST((centerNull + 4)),&white, + Font::DrawString(&manager->_font2_TeamMeatEx12,str,&drawPos,GHIDRA_CAST((centerNull + 4)),&white, &drawParams); } local_8 = 0xffffffff; @@ -1903,7 +1903,7 @@ void NetplayManager::Render() if (isActive != '\0') { drawPos.x = (g_screenWidth - 480.0) * 0.5 + 240.0; drawPos.y = (g_screenHeight - 270.0) * 0.5 + 150.0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(topAnimState[0x8b2])) + 0x2)))))))->ANM2::Render(&drawPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(topAnimState[0x8b2])) + 0x2)))),&drawPos,&g_vectorZero,&g_vectorZero); } } if ((*GHIDRA_CAST((topAnimState + 0x924)) != 0) && ((*GHIDRA_CAST((GHIDRA_CAST(&(topAnimState[0x929])) + 0x1))) != '\0')) { @@ -4500,9 +4500,9 @@ LAB_00910e26: currentAnimData = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2834)))); if (currentAnimData == GHIDRA_CAST(0x0)) { LAB_00910ee9: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2800)))))))->ANM2::SetAnimation(GHIDRA_CAST(local_3c),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2800)))),GHIDRA_CAST(local_3c),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2830)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2830))))); (*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2844))) = 1; } } @@ -4533,8 +4533,8 @@ LAB_00910ed5: goto LAB_00910ee9; } if ((*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2909))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2830)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2850)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2830))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((player)) + 0x2850))))); } LAB_00910f7e: uVar11 = uVar11 + 1; @@ -7285,8 +7285,8 @@ void NetplayManager::update_text_popup() local_8 = GHIDRA_CAST((__security_cookie ^ GHIDRA_UINT((GHIDRA_INT(&animName) + 0x1cU)))); bVar13 = false; if (*GHIDRA_CAST((this + 0x5f)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x21])) + 0x1)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x21])) + 0x1))))); } if (*(void **)(this + 0x18) == (void *)0x0) { (*GHIDRA_CAST((GHIDRA_CAST(&(animName._buf)) + 0x0))) = GHIDRA_CAST(0x0); @@ -7440,7 +7440,7 @@ LAB_00923b55: goto LAB_00923c61; } if ((*GHIDRA_CAST((this + 0x18)) == 0) || ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d])) + 0x1))) == '\0')) { - psVar7 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))))))->ANM2::GetAnimation(&animName); + psVar7 = ANM2::GetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))),&animName); bVar13 = true; puVar1 = &psVar7->_size; if (0xf < psVar7->_capacity) { @@ -7508,9 +7508,9 @@ LAB_00923c4c: } pcVar10 = "TextIn"; LAB_00923c61: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))))))->ANM2::SetAnimation(GHIDRA_CAST(pcVar10),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[6])) + 0x2)))),GHIDRA_CAST(pcVar10),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2))))); (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x1d])) + 0x1))) = 1; } return; diff --git a/generated-src/netplay_text_popup.cpp b/generated-src/netplay_text_popup.cpp index ad72055..4aecfe8 100644 --- a/generated-src/netplay_text_popup.cpp +++ b/generated-src/netplay_text_popup.cpp @@ -13,9 +13,9 @@ void NetplayTextPopup::destructor() ExceptionList = &local_10; clear(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 100)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x44)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x14))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 100))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x44))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x2c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->msvc::string::_Tidy_deallocate(); msvc::deque<36byte>::_Tidy(); @@ -68,6 +68,6 @@ LAB_00923900: if (*GHIDRA_CAST((in_ECX + 0x48)) != 0) { *GHIDRA_CAST((in_ECX + 0x58)) = 0; } - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x14)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((in_ECX + 0x14))); return; } diff --git a/generated-src/nightmare_scene.cpp b/generated-src/nightmare_scene.cpp index 9beed9b..2d604c0 100644 --- a/generated-src/nightmare_scene.cpp +++ b/generated-src/nightmare_scene.cpp @@ -317,13 +317,13 @@ LAB_0092030e: } local_14 = GHIDRA_CAST(CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),1)); if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x351))) == '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::Load(GHIDRA_CAST(&progressAnm2Path),1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST(&progressAnm2Path),1); uVar5 = extraout_ECX_01; } if (((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x129))) == '\0') && - ((GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))))))->ANM2::Load(GHIDRA_CAST(&backgroundAnm2Path),1), + (ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))),GHIDRA_CAST(&backgroundAnm2Path),1), uVar5 = extraout_ECX_02, 7 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xa0)))))) { - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))))))->ANM2::GetLayer(&DAT_00000007); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))),&DAT_00000007); layer->_bitflags = layer->_bitflags | 0x60; uVar5 = extraout_ECX_03; } @@ -406,26 +406,26 @@ void NightmareScene::Update() uVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))); if ((uVar3 & 1) == 0) { if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x129))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x50)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x70)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x50))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x70))))); } if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x239))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x160)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x180)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x160))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x180))))); } if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54)))) == 0) || ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x64))) == '\0')) { anim = "Dogma"; if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x244))) == '\0') { anim = &DAT_00b1b410; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))))))->ANM2::Play(GHIDRA_CAST(anim),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))),GHIDRA_CAST(anim),0); } if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x23d))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184))))); if ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) == *GHIDRA_CAST((this + 1)) * 2) && - (isSkipPressed = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))))))->ANM2::SetAnimation(GHIDRA_CAST("Scene"),1), isSkipPressed != 0)) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164)))))))->AnimationState::Rewind(); + (isSkipPressed = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))),GHIDRA_CAST("Scene"),1), isSkipPressed != 0)) { + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x178))) = 1; } if (((((*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x118))) != '\0') && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x12c)))) != 0)) && @@ -439,13 +439,13 @@ LAB_00920712: if (0xf < *GHIDRA_CAST((queuedAnim + 0x14))) { queuedAnim = *GHIDRA_CAST(queuedAnim); } - isSkipPressed = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))))))->ANM2::SetOverlayAnimation(queuedAnim,1); + isSkipPressed = ANM2::SetOverlayAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))),queuedAnim,1); if (isSkipPressed != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x198))) = 1; } if (9 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1b4))))) { - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))))))->ANM2::GetLayer(&DAT_00000009); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))),&DAT_00000009); layer->_bitflags = layer->_bitflags | 0x60; } } @@ -467,7 +467,7 @@ LAB_00920712: (isSkipPressed = AnimationState::IsEventTriggered (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164)))),GHIDRA_CAST("Interrupt")), isSkipPressed != 0)) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134))))); TextureCache::Purge(); *GHIDRA_CAST(this) = 0; return; @@ -488,7 +488,7 @@ LAB_00920712: else { framesLeft = *GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x168)))) + 0x30)); } - currentFrame = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))))))->ANM2::GetFrame(); + currentFrame = ANM2::GetFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134))))); framesLeft = framesLeft - currentFrame; } else { @@ -534,8 +534,8 @@ LAB_009208ec: LAB_009208ee: if (!isSkipPressed) goto LAB_00920918; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4))))); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134))))); TextureCache::Purge(); uVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))); *GHIDRA_CAST(this) = 0; @@ -611,8 +611,8 @@ void NightmareScene::Render() local_58 = 0.0; do { pbVar9 = *GHIDRA_CAST((GHIDRA_CAST(local_58) + *GHIDRA_CAST((GHIDRA_CAST(local_74) + 0x18)))); - local_60 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x50)))))))->AnimationState::GetLayerFrame(GHIDRA_INT(pbVar9)); - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))))))->ANM2::GetLayer(pbVar9); + local_60 = AnimationState::GetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x50)))),GHIDRA_INT(pbVar9)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))),pbVar9); if (((layer->_visible != 0) && (local_60 != (void *)0x0)) && (*GHIDRA_CAST((GHIDRA_CAST(local_60) + 0x2c)) != '\0')) { local_64 = GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(local_74) + 0x18)) + GHIDRA_INT(local_58))); @@ -748,18 +748,18 @@ void NightmareScene::Render() local_88.x = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x98)))) + *nullFrame; local_88.y = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x9c)))) + nullFrame[1]; if (*GHIDRA_CAST((GHIDRA_CAST(local_60) + 0xef9)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_60) + 0xdf0)))))->ANM2::SetFrame(GHIDRA_CAST((GHIDRA_INT(local_60) + 0xe08)), + ANM2::SetFrame(GHIDRA_CAST((GHIDRA_INT(local_60) + 0xdf0)),GHIDRA_CAST((GHIDRA_INT(local_60) + 0xe08)), *GHIDRA_CAST((iVar6 + 100))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_60) + 0xdf0)))))->Sprite::SetColor(GHIDRA_CAST((nullFrame + 6))); *GHIDRA_CAST((GHIDRA_CAST(local_60) + 0xe8c)) = nullFrame[4]; *GHIDRA_CAST((GHIDRA_CAST(local_60) + 0xe90)) = nullFrame[5]; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(local_60) + 0xdf0)))))->ANM2::Render(&local_88,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((GHIDRA_INT(local_60) + 0xdf0)),&local_88,&g_vectorZero,&g_vectorZero); } } else { local_60 = *(void **)(iVar6 + 100); LAB_00920dfe: - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))))))->ANM2::GetLayer(pbVar9); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))),pbVar9); fVar12 = (float)local_5c[2]; fVar8 = nullFrame[1]; (layer->_pos).x = (float)local_5c[1] + *nullFrame; @@ -787,7 +787,7 @@ LAB_00920dfe: (layer->_color)._offset[1] = fVar12; (layer->_color)._offset[2] = nullFrame[0x10]; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))))))->ANM2::SetLayerFrame(*local_5c,GHIDRA_INT(local_60)); + ANM2::SetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))),*local_5c,GHIDRA_INT(local_60)); iVar6 = *local_5c; if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x10d))) != '\0') { if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x74))) == '\0') { @@ -944,9 +944,9 @@ LAB_0092117e: local_58 = (float)local_5c + 13.5; if (pbVar9 == GHIDRA_CAST(0x0)) { LAB_009212c6: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST("Connector"),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST("Connector"),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x28c))) = 1; fVar8 = iconCount; } @@ -1006,9 +1006,9 @@ LAB_009212a5: pbVar9 = *GHIDRA_CAST((stageBarSprite + 0x34)); if (pbVar9 == GHIDRA_CAST(0x0)) { LAB_009213f6: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST("Levels"),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST("Levels"),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x28c))) = 1; fVar8 = iconCount; } @@ -1069,9 +1069,9 @@ LAB_009213d5: pbVar9 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27c)))); if (pbVar9 == GHIDRA_CAST(0x0)) { LAB_00921544: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST("ClearFloor"),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST("ClearFloor"),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x28c))) = 1; } } @@ -1128,9 +1128,9 @@ LAB_00921525: pbVar9 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27c)))); if (pbVar9 == GHIDRA_CAST(0x0)) { LAB_0092166b: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST("NotClearFloor"),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST("NotClearFloor"),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x28c))) = 1; } } @@ -1248,9 +1248,9 @@ LAB_0092179c: } animName = "BossIndicator"; LAB_0092183b: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST(animName),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST(animName),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x28c))) = 1; } } @@ -1278,9 +1278,9 @@ LAB_00921852: local_64 = GHIDRA_CAST(((float)g_game->_timeCounter / (float)g_game->_bossRushParTime)); if (pbVar9 == GHIDRA_CAST(0x0)) { LAB_00921997: - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST("Clock"),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST("Clock"),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x28c))) = 1; } } @@ -1328,7 +1328,7 @@ LAB_00921978: } } if (-2 < GHIDRA_INT(local_74)) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::SetAnimation(GHIDRA_CAST("IsaacIndicator"),1); + ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))),GHIDRA_CAST("IsaacIndicator"),1); renderState = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x27c)))) != 0) { AnimationState::SetFrameFloat @@ -1583,9 +1583,9 @@ LAB_00921eab: gfuelPrefixSize = 0; gfuelPrefixCapacity = 0xf; gfuelPrefix = GHIDRA_CAST((GHIDRA_UINT(gfuelPrefix) & 0xffffff00)); - (GHIDRA_CAST((&gfuelAnm2)))->ANM2::constructor(); + ANM2::constructor(&gfuelAnm2); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),4); - (GHIDRA_CAST((&gfuelAnm2)))->ANM2::Load(GHIDRA_CAST(gfuelPath),1); + ANM2::Load(&gfuelAnm2,GHIDRA_CAST(gfuelPath),1); if (gfuelAnm2._loaded != 0) { stringData = GHIDRA_CAST(gfuelPath); if (0xf < gfuelPathCapacity) { @@ -1594,9 +1594,9 @@ LAB_00921eab: (GHIDRA_CAST((sceneAnm2Path._buf)))->msvc::string::assign(GHIDRA_CAST(stringData),gfuelPathSize); } (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 5; - (GHIDRA_CAST((&gfuelAnm2)))->ANM2::Reset(); - (GHIDRA_CAST((&gfuelAnm2._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&gfuelAnm2._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&gfuelAnm2); + AnimationState::~AnimationState(&gfuelAnm2._overlayAnimState); + AnimationState::~AnimationState(&gfuelAnm2._animState); (GHIDRA_CAST((gfuelAnm2._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&gfuelAnm2))))->msvc::string::_Tidy_deallocate(); local_14 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8; @@ -1671,7 +1671,7 @@ LAB_00921eab: deathScreenPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(deathScreenPath._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 7; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x4)))))))->ANM2::Load(&deathScreenPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x4)))),&deathScreenPath,1); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; if (0xf < deathScreenPath._capacity) { uVar16 = deathScreenPath._capacity + 1; @@ -1689,7 +1689,7 @@ LAB_00921eab: deathScreenPath._size = 0; deathScreenPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(deathScreenPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(deathScreenPath._buf)) + 0x0))) & 0xffffff00; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x4)))))))->ANM2::Play(GHIDRA_CAST("Diary"),0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x4)))),GHIDRA_CAST("Diary"),0); diaryColor._offset[0] = -0.1283; diaryColor._colorize[0] = 0.0; diaryColor._colorize[1] = 0.0; @@ -2268,16 +2268,16 @@ LAB_00922f0e: } KAGE_LogMessage(1,GHIDRA_CAST("[warn] could not load player config for type %d.\n")); LAB_00923057: - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sceneRef[1])) + 0x130)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sceneRef[1])) + 0x130))))); scene = sceneRef; bVar8 = extraout_CL; if (*GHIDRA_CAST((GHIDRA_CAST(pvVar17) + 0x8c)) != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sceneRef[1])) + 0x130)))))))->ANM2::Load(GHIDRA_CAST((GHIDRA_INT(pvVar17) + 0x7c)),1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(sceneRef[1])) + 0x130)))),GHIDRA_CAST((GHIDRA_INT(pvVar17) + 0x7c)),1); anim = &(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x148))); if (0xf < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x15c))))) { anim = *GHIDRA_CAST(anim); } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x130)))))))->ANM2::Play(anim,0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(scene[1])) + 0x130)))),anim,0); bVar8 = extraout_CL_00; } game = g_game; @@ -2289,19 +2289,19 @@ LAB_00923057: (GHIDRA_CAST((GHIDRA_CAST(puVar15))))->Sprite::ReplaceSpritesheet(3,&local_8c); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),6); (GHIDRA_CAST((local_8c._buf)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((GHIDRA_CAST(puVar15))))->ANM2::LoadGraphics(unk_00); - bVar8 = (GHIDRA_CAST((GHIDRA_CAST(puVar15))))->ANM2::SetAnimation(GHIDRA_CAST("Intro"),1); + ANM2::LoadGraphics(GHIDRA_CAST(puVar15),unk_00); + bVar8 = ANM2::SetAnimation(GHIDRA_CAST(puVar15),GHIDRA_CAST("Intro"),1); if (bVar8 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x50)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x50))))); (*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x64))) = 1; } scene = sceneRef; puVar15 = &(*GHIDRA_CAST((GHIDRA_CAST((sceneRef)) + 0x134))); - (GHIDRA_CAST((GHIDRA_CAST(puVar15))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(puVar15))))->ANM2::Load(&sceneAnm2Path,1); - bVar8 = (GHIDRA_CAST((GHIDRA_CAST(puVar15))))->ANM2::SetAnimation(GHIDRA_CAST("Scene"),1); + ANM2::Reset(GHIDRA_CAST(puVar15)); + ANM2::Load(GHIDRA_CAST(puVar15),&sceneAnm2Path,1); + bVar8 = ANM2::SetAnimation(GHIDRA_CAST(puVar15),GHIDRA_CAST("Scene"),1); if (((bVar8 != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x168)))) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x164)))))))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x164)))),0.0), *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x168)))) != 0)) { (*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x178))) = 0; } @@ -2309,15 +2309,15 @@ LAB_00923057: if (((((iVar9 == 4) || (iVar9 == 0x10)) || ((iVar9 == 0x11 || ((iVar9 == 0xe || (iVar9 == 0x19)))))) || (iVar9 == 0x23)) || (iVar9 == 0x21)) { - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((sceneRef)) + 0x20)))))))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((sceneRef)) + 0x20)))),GHIDRA_CAST(0x2)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x20)))))))->ANM2::GetLayer(&DAT_00000006); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x20)))),&DAT_00000006); layer->_visible = 1; } else { - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((sceneRef)) + 0x20)))))))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((sceneRef)) + 0x20)))),GHIDRA_CAST(0x2)); layer->_visible = 1; - layer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x20)))))))->ANM2::GetLayer(&DAT_00000006); + layer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((scene)) + 0x20)))),&DAT_00000006); layer->_visible = 0; } scene = sceneRef; @@ -2437,34 +2437,34 @@ NightmareScene::~NightmareScene() local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x130)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x180)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x160)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x130))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x180))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x160))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x148))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x130))))))->msvc::string::_Tidy_deallocate(); msvc::deque<32byte>::_Tidy(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x54)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x34)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x54))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x34))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1c))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x4))))))->msvc::string::_Tidy_deallocate(); local_8 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x298)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x298))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x278))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x260))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x248))))))->msvc::string::_Tidy_deallocate(); local_8 = 3; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x184))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x164))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14c))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x134))))))->msvc::string::_Tidy_deallocate(); local_8 = 4; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x70)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x50)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x70))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x50))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x20))))))->msvc::string::_Tidy_deallocate(); FID_conflict__Tidy(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14)))); diff --git a/generated-src/npc_helper.cpp b/generated-src/npc_helper.cpp index 9bfb430..84693a8 100644 --- a/generated-src/npc_helper.cpp +++ b/generated-src/npc_helper.cpp @@ -335,9 +335,9 @@ LAB_0049f8bb: if ((compareResult == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_0049f8ee; } - bVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ChargeBegin"),1); + bVar1 = ANM2::SetAnimation(&npc->_sprite,GHIDRA_CAST("ChargeBegin"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_0049f8ee: @@ -383,7 +383,7 @@ void NpcHelper::chimera_render_child(Entity_NPC *npc, Vector *offset) if (((((npc->_type == 0x38e) && (npc->_variant == 1)) && (npc->_state == 0x10)) && ((piVar7 = GHIDRA_CAST(npc->_child), piVar7 != GHIDRA_CAST(0x0) && (piVar7[0x2d9] == 0x10)))) && (*GHIDRA_CAST((GHIDRA_CAST(piVar7) + 0x171)) == '\0')) { - layerFrame = (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::GetLayerFrame(2); + layerFrame = AnimationState::GetLayerFrame(&(npc->_sprite)._animState,2); if ((layerFrame != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 0x2c)) != '\0')) { iVar1 = piVar7[0xcf]; iVar2 = piVar7[0x37]; @@ -393,7 +393,7 @@ void NpcHelper::chimera_render_child(Entity_NPC *npc, Vector *offset) piVar7[0xcf] = GHIDRA_INT((npc->_pos).x); piVar7[0xd0] = GHIDRA_INT((npc->_pos).y); iVar6 = *GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 0x14)); - pLVar8 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar8 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x2)); frameX = *GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 0x10)); if (pLVar8->_flipX != 0) { frameX = frameX ^ 0x80000000; @@ -696,9 +696,9 @@ LAB_004a2fd9: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((pEVar7->_sprite)._animState._isPlaying != 0)))) goto LAB_004a2fed; } - bVar1 = (GHIDRA_CAST((&pEVar7->_sprite)))->ANM2::SetAnimation(&DAT_00b1d33c,1); + bVar1 = ANM2::SetAnimation(&pEVar7->_sprite,&DAT_00b1d33c,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(pEVar7->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pEVar7->_sprite)._animState); (pEVar7->_sprite)._animState._isPlaying = 1; npcLocal->_state = 6; return; @@ -1022,9 +1022,9 @@ void NpcHelper::delirium_spawn_form_parts(Entity_NPC *npc, float maxHealth) local_24 = pEVar6; if (animData == GHIDRA_CAST(0x0)) { LAB_004a8acc: - bVar4 = (GHIDRA_CAST((&pEVar6->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("WalkBodyHori"),1); + bVar4 = ANM2::SetAnimation(&pEVar6->_sprite,GHIDRA_CAST("WalkBodyHori"),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(pEVar6->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(pEVar6->_sprite)._animState); (pEVar6->_sprite)._animState._isPlaying = 1; } } @@ -1500,9 +1500,9 @@ LAB_004a971c: if ((uVar5 == 0) && ((curAnimData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_004a9753; } - bVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Blink"),1); + bVar1 = ANM2::SetAnimation(&npc->_sprite,GHIDRA_CAST("Blink"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -1866,9 +1866,9 @@ LAB_004aa3d4: anim = &DAT_00b1e0e4; } LAB_004aa517: - isAnimSet = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(anim,1); + isAnimSet = ANM2::SetAnimation(&npc->_sprite,anim,1); if (isAnimSet != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -1965,8 +1965,8 @@ LAB_004aa7f9: } if (step != 0) { if ((GHIDRA_UINT(step) <= GHIDRA_UINT(local_1c)) && ((npc->_sprite)._loaded != 0)) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(npc->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(npc->_sprite)._animState); + AnimationState::Update(&(npc->_sprite)._overlayAnimState); } (npc->_pos).x = stepVelocityX + (npc->_pos).x; (npc->_pos).y = stepVelocityY + (npc->_pos).y; @@ -1982,8 +1982,8 @@ LAB_004aa7f9: cycleId & 0x7f; } else if ((npc->_sprite)._loaded != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Update(); - (GHIDRA_CAST((&(npc->_sprite)._overlayAnimState)))->AnimationState::Update(); + AnimationState::Update(&(npc->_sprite)._animState); + AnimationState::Update(&(npc->_sprite)._overlayAnimState); return; } return; @@ -2276,9 +2276,9 @@ LAB_004b1488: animData = (npc->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_004b152e: - bVar4 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(s_Attack1,1); + bVar4 = ANM2::SetAnimation(&npc->_sprite,s_Attack1,1); if (bVar4 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -2322,9 +2322,9 @@ LAB_004b1515: animData = (npc->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_004b162e: - bVar4 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Attack2Start"),1); + bVar4 = ANM2::SetAnimation(&npc->_sprite,GHIDRA_CAST("Attack2Start"),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -2383,9 +2383,9 @@ LAB_004b1615: animData = (npc->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_004b177e: - bVar4 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(&DAT_00b1d2e4,1); + bVar4 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b1d2e4,1); if (bVar4 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -2431,9 +2431,9 @@ LAB_004b1765: animData = (npc->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_004b1874: - bVar4 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Attack4Start"),1); + bVar4 = ANM2::SetAnimation(&npc->_sprite,GHIDRA_CAST("Attack4Start"),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -2824,7 +2824,7 @@ void NpcHelper::gideon_update_death(Entity_NPC *npc) } pitch = 1.0; if ((npc->_sprite)._animState._animData != (void *)0x0) { - bVar3 = (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Sound")); + bVar3 = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,GHIDRA_CAST("Sound")); manager = g_manager; if (bVar3 != 0) { eventPitch = 1.0; @@ -2972,9 +2972,9 @@ LAB_004b3c2c: ((*GHIDRA_CAST((GHIDRA_INT((afterimage->_sprite)._animState._animData) + 0x34)) == '\0' || ((afterimage->_sprite)._animState._isPlaying != 0)))) goto LAB_004b3c68; } - bVar1 = (GHIDRA_CAST((&afterimage->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST(animNameData),1); + bVar1 = ANM2::SetAnimation(&afterimage->_sprite,GHIDRA_CAST(animNameData),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(afterimage->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(afterimage->_sprite)._animState); (afterimage->_sprite)._animState._isPlaying = 1; } LAB_004b3c68: @@ -2999,8 +2999,8 @@ LAB_004b3c68: AnimationState::SetFrameFloat (&(afterimage->_sprite)._animState,(npc->_sprite)._animState._animFrame); } - afterimageLayer = (GHIDRA_CAST((&afterimage->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); - npcLayer = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + afterimageLayer = ANM2::GetLayer(&afterimage->_sprite,GHIDRA_CAST(0x0)); + npcLayer = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x0)); (afterimageLayer->_color)._tint[3] = (npcLayer->_color)._tint[3]; afterimage->_entityGridCollisionClass = 0; afterimage->_entityCollisionClass = 0; @@ -3737,7 +3737,7 @@ void NpcHelper::hornfel_render_minecart(Entity_NPC *npc, ANM2 *minecartSprite, V frameIndex < *GHIDRA_CAST((layerIndex + 8)))))))) && (npcFrame = GHIDRA_CAST((frameIndex * 0x6c + *GHIDRA_CAST((layerIndex + 4)))), npcFrame != GHIDRA_CAST(0x0))) { - (GHIDRA_CAST((frameCopy)))->AnimationState::copy_assign(cartFrame); + AnimationState::copy_assign(frameCopy,cartFrame); local_88 = frameCopy; npcSprite = &npc->_sprite; local_84 = 1; @@ -3745,14 +3745,14 @@ void NpcHelper::hornfel_render_minecart(Entity_NPC *npc, ANM2 *minecartSprite, V frameCopy[0]._animation = (void *)(((float)frameCopy[0]._animation - 0.0) + *npcFrame); frameCopy[0]._animData = (void *)(((float)frameCopy[0]._animData - 224.0) + npcFrame[1]); local_80 = 1; - pLVar2 = (GHIDRA_CAST((npcSprite)))->ANM2::GetLayer(&DAT_00000004); + pLVar2 = ANM2::GetLayer(npcSprite,&DAT_00000004); pLVar2->_visible = 1; - pLVar2 = (GHIDRA_CAST((npcSprite)))->ANM2::GetLayer(&DAT_00000004); + pLVar2 = ANM2::GetLayer(npcSprite,&DAT_00000004); (pLVar2->_color)._tint[3] = (minecartSprite->_color)._tint[3]; AnimationLayer::RenderFrame (GHIDRA_CAST(&renderLayer),renderPosLocal,0,&g_vectorZero,&g_vectorZero, npcSprite); - pLVar2 = (GHIDRA_CAST((npcSprite)))->ANM2::GetLayer(&DAT_00000004); + pLVar2 = ANM2::GetLayer(npcSprite,&DAT_00000004); pLVar2->_visible = 0; } } @@ -3777,14 +3777,14 @@ void NpcHelper::hornfel_charge(Entity_NPC *npc) if (0.0 <= cartVelocityX) { animName = "IdleRight"; } - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(sprite,GHIDRA_CAST(animName),0); return; } animName = "IdleUp"; if (0.0 <= cartVelocityY) { animName = "IdleDown"; } - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(sprite,GHIDRA_CAST(animName),0); return; } if (ABS(cartVelocityY) < ABS(cartVelocityX)) { @@ -3792,14 +3792,14 @@ void NpcHelper::hornfel_charge(Entity_NPC *npc) if (0.0 <= cartVelocityX) { animName = "ChargeRight"; } - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(sprite,GHIDRA_CAST(animName),0); return; } animName = "ChargeUp"; if (0.0 <= cartVelocityY) { animName = "ChargeDown"; } - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(sprite,GHIDRA_CAST(animName),0); return; } @@ -4113,7 +4113,7 @@ LAB_004b8213: builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/965.001_hornfel minecart.anm2",0x22 ); local_14 = 0; - (GHIDRA_CAST((minecartSprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(minecartSprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar2 = anm2Path._capacity + 1; @@ -4527,21 +4527,21 @@ LAB_004b8df1: animName = "Attack1Left"; } LAB_004b9068: - (GHIDRA_CAST((&npc->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&npc->_sprite,GHIDRA_CAST(animName),0); } else { animName = "Attack1Left_Back"; if (0.0 <= (float)local_28) { animName = "Attack1Right_Back"; } - (GHIDRA_CAST((&npc->_sprite)))->ANM2::Play(GHIDRA_CAST(animName),0); + ANM2::Play(&npc->_sprite,GHIDRA_CAST(animName),0); *GHIDRA_CAST((GHIDRA_INT(&npc->_projectileDelay) + 3)) = 0; } } else { if (uVar1 != 1) { if (uVar1 == 2) { - (GHIDRA_CAST((&npc->_sprite)))->ANM2::Play(s_Attack2,0); + ANM2::Play(&npc->_sprite,s_Attack2,0); npc->_state = 9; *GHIDRA_CAST(&npc->_projectileCooldown) = 0x96; } @@ -4582,7 +4582,7 @@ LAB_004b9068: animName = "Attack1Double"; goto LAB_004b9068; } - (GHIDRA_CAST((&npc->_sprite)))->ANM2::Play(GHIDRA_CAST("Attack1Double_Back"),0); + ANM2::Play(&npc->_sprite,GHIDRA_CAST("Attack1Double_Back"),0); *GHIDRA_CAST((GHIDRA_INT(&npc->_projectileDelay) + 3)) = 0; } npc->_state = 8; @@ -4882,9 +4882,9 @@ void NpcHelper::hornfel_set_anim(Entity_NPC *npc, int stateFrame) animData = (npc->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_004bb896: - bVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(s_Open,1); + bVar1 = ANM2::SetAnimation(&npc->_sprite,s_Open,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -5390,7 +5390,7 @@ void NpcHelper::horny_boys_render(Entity_NPC *npc, Vector *offset) layerOffset = 0; do { iVar1 = *GHIDRA_CAST((layerOffset + *GHIDRA_CAST((GHIDRA_CAST(animData) + 0x18)))); - layerFrame = (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::GetLayerFrame(iVar1); + layerFrame = AnimationState::GetLayerFrame(&(npc->_sprite)._animState,iVar1); if ((((layerFrame != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(layerFrame) + 0x2c)) != '\0')) && (iVar1 - 3U < 3)) && (dequeIndex = ((npc->_entityDeque)._offset - 3) + iVar1, @@ -5657,7 +5657,7 @@ void NpcHelper::moms_heart_attack_pattern(Entity_NPC *npc, int pattern, int stat return; } (*GHIDRA_CAST((GHIDRA_CAST(&(projParams.BulletFlags)) + 0x0))) = baseBulletFlags; - isHeartbeat = (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Heartbeat")); + isHeartbeat = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,GHIDRA_CAST("Heartbeat")); if (isHeartbeat == 0) { return; } @@ -5861,7 +5861,7 @@ LAB_004d358e: return; } (*GHIDRA_CAST((GHIDRA_CAST(&(projParams.BulletFlags)) + 0x0))) = baseBulletFlags; - isHeartbeat = (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Heartbeat")); + isHeartbeat = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,GHIDRA_CAST("Heartbeat")); if (isHeartbeat == 0) { return; } @@ -6590,7 +6590,7 @@ void NpcHelper::ball_and_chain_render_chain(float *param_1) local_9c = local_9c + (float)dVar5 / pixelScale; local_98.y = local_9c; local_90 = local_98.x; - pLVar1 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar1 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x1)); pLVar1->_visible = 1; DAT_00c78ef4 = 1; (*GHIDRA_CAST((GHIDRA_CAST(&(DAT_00c78ef8)) + 0x0))) = 1; @@ -6604,7 +6604,7 @@ void NpcHelper::ball_and_chain_render_chain(float *param_1) (local_90 - renderPos.x) * (local_90 - renderPos.x)); BeamRenderer::Add(&local_98,color_00,1.0,fVar2); BeamRenderer::End(); - pLVar1 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar1 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x1)); local_8c = g_displayPixelRatio; pLVar1->_visible = 0; local_8c = local_8c * g_screenPointScale; @@ -6619,10 +6619,10 @@ void NpcHelper::ball_and_chain_render_chain(float *param_1) renderPos.x = snappedX + *param_1; local_98.x = *GHIDRA_CAST((in_ECX + 0xec)); *GHIDRA_CAST((in_ECX + 0xec)) = 0; - pLVar1 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar1 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x2)); pLVar1->_visible = 1; (GHIDRA_CAST((GHIDRA_CAST(sprite))))->Sprite::RenderLayer(2,&renderPos,&g_vectorZero,&g_vectorZero); - pLVar1 = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar1 = ANM2::GetLayer(sprite,GHIDRA_CAST(0x2)); pLVar1->_visible = 0; *GHIDRA_CAST((in_ECX + 0xec)) = local_98.x; } @@ -7319,9 +7319,9 @@ void NpcHelper::leper_flesh_ai(Entity_NPC *npc) pbVar5 = (npc->_sprite)._animState._animData; if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_005489d8: - bVar2 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(local_c8,1); + bVar2 = ANM2::SetAnimation(&npc->_sprite,local_c8,1); if (bVar2 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -7772,12 +7772,12 @@ LAB_0054f962: if (iVar7 == 5) { fVar13 = -fVar13; } - layer = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(&npc->_sprite,layerIndex); (layer->_pos).x = (fVar12 - fVar11) * 0.65; (layer->_pos).y = ((fVar14 - fVar15) + (fVar1 - fVar13)) * 0.65; dVar2 = __uint_to_double_fixup[-(GHIDRA_INT(layerIndex) >> 0x1f)]; fVar12 = *pfVar5; - layer = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(layerIndex); + layer = ANM2::GetLayer(&npc->_sprite,layerIndex); pfVar5 = pfVar5 + 1; layer->_visible = fVar12 <= -6.0 - (float)((double)GHIDRA_INT(layerIndex) + dVar2) * 3.0; layerIndex = layerIndex + 1; @@ -7968,7 +7968,7 @@ void NpcHelper::willo_attack(Entity_NPC *npc) npc->_state = 3; return; } - isEventTriggered = (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::IsEventTriggered(&DAT_00b6166c); + isEventTriggered = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,&DAT_00b6166c); manager = g_manager; if (isEventTriggered != 0) { local_b8 = 1.0; @@ -7985,7 +7985,7 @@ void NpcHelper::willo_attack(Entity_NPC *npc) if ((npc->_sprite)._animState._animData == (void *)0x0) { return; } - isEventTriggered = (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::IsEventTriggered(GHIDRA_CAST("Shoot")); + isEventTriggered = AnimationState::IsEventTriggered(&(npc->_sprite)._animState,GHIDRA_CAST("Shoot")); manager = g_manager; if (isEventTriggered == 0) { return; @@ -8105,9 +8105,9 @@ LAB_00559175: } } } - bVar1 = (GHIDRA_CAST((&willo->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("UnderwaterSpawn"),1); + bVar1 = ANM2::SetAnimation(&willo->_sprite,GHIDRA_CAST("UnderwaterSpawn"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(willo->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(willo->_sprite)._animState); (willo->_sprite)._animState._isPlaying = 1; } return willo; @@ -8140,9 +8140,9 @@ LAB_005590d5: if ((flagsHigh == 0) && ((animData[0x34] == 0 || ((willo->_sprite)._animState._isPlaying != 0)))) goto LAB_00559108; } - bVar1 = (GHIDRA_CAST((&willo->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("UnderwaterAttack"),1); + bVar1 = ANM2::SetAnimation(&willo->_sprite,GHIDRA_CAST("UnderwaterAttack"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(willo->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(willo->_sprite)._animState); (willo->_sprite)._animState._isPlaying = 1; } LAB_00559108: @@ -8860,7 +8860,7 @@ void NpcHelper::clutch_spawn_fire(Entity_NPC *npc, Entity *target) animPathCapacity = &DAT_0000002f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_4c))) + 0x10))),"gfx/009.002_Fire Projectile.anm2",0x21); local_14 = 0; - (GHIDRA_CAST((fireSprite)))->ANM2::Load(GHIDRA_CAST((local_4c + 0x10)),1); + ANM2::Load(fireSprite,GHIDRA_CAST((local_4c + 0x10)),1); local_14 = 0xffffffff; if (&DAT_0000000f < animPathCapacity) { size = animPathCapacity + 1; @@ -8902,9 +8902,9 @@ LAB_00572e4b: ((*GHIDRA_CAST((GHIDRA_INT((fire->_sprite)._animState._animData) + 0x34)) == '\0' || ((fire->_sprite)._animState._isPlaying != 0)))) goto LAB_00572e7c; } - bVar4 = (GHIDRA_CAST((fireSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Flickering"),1); + bVar4 = ANM2::SetAnimation(fireSprite,GHIDRA_CAST("Flickering"),1); if (bVar4 != 0) { - (GHIDRA_CAST((&(fire->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(fire->_sprite)._animState); (fire->_sprite)._animState._isPlaying = 1; } LAB_00572e7c: @@ -8912,7 +8912,7 @@ LAB_00572e7c: pbVar6 = GHIDRA_CAST(0x0); if ((local_50->_sprite)._layerCount != 0) { do { - layer = (GHIDRA_CAST((fireSprite)))->ANM2::GetLayer(pbVar6); + layer = ANM2::GetLayer(fireSprite,pbVar6); fVar3 = fRam00c34e34; fVar2 = fRam00c34e30; fVar9 = fRam00c34e2c; @@ -9000,11 +9000,11 @@ void NpcHelper::clutch_render(Entity_NPC *npc, Vector *offset) int *pointDeque; if (npc->_variant == 0) { - pLVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x1)); if ((0.0 < (pLVar1->_color)._tint[3]) && ((npc->_vectorDeque1)._size != 0)) { - pLVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x1)); pLVar1->_visible = 1; - pLVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x2)); layerId = GHIDRA_CAST(0x1); layerOffset = 0x3c; pLVar1->_visible = 1; @@ -9067,7 +9067,7 @@ void NpcHelper::clutch_render(Entity_NPC *npc, Vector *offset) if (iVar3 == 7) { segmentStretch = 1.0; LAB_00575d73: - pLVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(layerId); + pLVar1 = ANM2::GetLayer(&npc->_sprite,layerId); (pLVar1->_size).x = segmentStretch; (pLVar1->_size).y = 1.0; if ((npc->_sprite)._flipX == 0) { @@ -9093,10 +9093,10 @@ LAB_00575d73: iVar6 = *GHIDRA_CAST((*GHIDRA_CAST((iVar6 + 4)) + (*GHIDRA_CAST((iVar6 + 8)) - 1U & pointBlock) * 4)); fVar7 = atan2f(pfVar2[1] - *GHIDRA_CAST((iVar6 + 4 + pointSlotOffset)), *pfVar2 - *GHIDRA_CAST((iVar6 + pointSlotOffset))); - pLVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(layerId); + pLVar1 = ANM2::GetLayer(&npc->_sprite,layerId); pLVar1->_rotation = fVar7 * 57.295776 * flipSign; if ((npc->_sprite)._overlayAnimState._animData != (void *)0x0) { - (GHIDRA_CAST((&(npc->_sprite)._overlayAnimState)))->AnimationState::SetFrameFloat((float)iVar3); + AnimationState::SetFrameFloat(&(npc->_sprite)._overlayAnimState,(float)iVar3); } if ((npc->_sprite)._loaded != 0) { if ((npc->_sprite)._overlayRenderFirst == 0) { @@ -9183,9 +9183,9 @@ LAB_00575ed0: layerId = layerId + 1; layerOffset = layerOffset + 4; } while (layerOffset < 0x41); - pLVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x1)); + pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x1)); pLVar1->_visible = 0; - pLVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + pLVar1 = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x2)); pLVar1->_visible = 0; } } @@ -9465,9 +9465,9 @@ LAB_00576915: goto LAB_00576948; } ExceptionList = &local_10; - bVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(&DAT_00b61c98,1); + bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00b61c98,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_00576948: @@ -9666,9 +9666,9 @@ LAB_00583029: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((segment->_sprite)._animState._isPlaying != 0)))) goto LAB_00583051; } - bVar1 = (GHIDRA_CAST((&segment->_sprite)))->ANM2::SetAnimation(anim,1); + bVar1 = ANM2::SetAnimation(&segment->_sprite,anim,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(segment->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(segment->_sprite)._animState); (segment->_sprite)._animState._isPlaying = 1; } LAB_00583051: @@ -10923,7 +10923,7 @@ void NpcHelper::tuff_twins_play_anim(Entity_NPC *npc, uint8_t *animName, int unu if (0xf < fullAnimCapacity) { ppppbVar2 = fullAnim[0]; } - (GHIDRA_CAST((&npc->_sprite)))->ANM2::Play(GHIDRA_CAST(ppppbVar2),0); + ANM2::Play(&npc->_sprite,GHIDRA_CAST(ppppbVar2),0); if (0xf < fullAnimCapacity) { oldSize = fullAnimCapacity + 1; ppppbVar2 = fullAnim[0]; @@ -11065,7 +11065,7 @@ void NpcHelper::tuff_twins_body_attack_anim(Entity_NPC *npc) } tuff_twins_play_anim(npc,GHIDRA_CAST(attackAnim),unused); if ((npc->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::SetFrameFloat((float)savedFrame); + AnimationState::SetFrameFloat(&(npc->_sprite)._animState,(float)savedFrame); return; } } @@ -11866,9 +11866,9 @@ LAB_005ab305: if ((animCompare == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0))) ) goto LAB_005ab33c; } - bVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(&DAT_00c7f858,1); + bVar1 = ANM2::SetAnimation(&npc->_sprite,&DAT_00c7f858,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } LAB_005ab33c: @@ -12951,9 +12951,9 @@ LAB_006d0fd5: if ((uVar2 == 0) && ((animData[0x34] == 0 || ((npc->_sprite)._animState._isPlaying != 0)))) goto LAB_006d1001; } - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(sprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -12986,7 +12986,7 @@ LAB_006d107e: local_c = (fVar5 * 0.9) / npc->_maxHitPoints + 0.1; local_10 = local_c * g_vectorOne.y; local_c = local_c * g_vectorOne.x; - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST(0x0)); (layer->_size).x = local_c; (layer->_size).y = local_10; if (npc->_health <= 1.5 && npc->_health != 1.5) goto LAB_006d114a; @@ -13002,7 +13002,7 @@ LAB_006d114a: npc->_state = 0x10; npc->_entityCollisionClass = 0; npc->_entityGridCollisionClass = 0; - (GHIDRA_CAST((sprite)))->ANM2::Play(GHIDRA_CAST("Disappear"),0); + ANM2::Play(sprite,GHIDRA_CAST("Disappear"),0); goto LAB_006d1556; } } @@ -13059,7 +13059,7 @@ LAB_006d12d6: local_10 = (npc->_health * 0.9) / npc->_maxHitPoints + 0.1; local_c = local_10 * g_vectorOne.y; local_10 = local_10 * g_vectorOne.x; - layer = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x0)); (layer->_size).x = local_10; (layer->_size).y = local_c; if (1.5 < npc->_health || npc->_health == 1.5) goto LAB_006d1556; @@ -13069,9 +13069,9 @@ LAB_006d12d6: animData = (npc->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_006d13b6: - bVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Disappear"),1); + bVar1 = ANM2::SetAnimation(&npc->_sprite,GHIDRA_CAST("Disappear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } @@ -13116,15 +13116,15 @@ LAB_006d13a8: local_10 = (fVar4 * 0.9) / npc->_maxHitPoints + 0.1; local_c = local_10 * g_vectorOne.y; local_10 = local_10 * g_vectorOne.x; - layer = (GHIDRA_CAST((&npc->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&npc->_sprite,GHIDRA_CAST(0x0)); (layer->_size).x = local_10; (layer->_size).y = local_c; animData = (npc->_sprite)._animState._animData; if (animData == GHIDRA_CAST(0x0)) { LAB_006d14f6: - bVar1 = (GHIDRA_CAST((&npc->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(&npc->_sprite,GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&(npc->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(npc->_sprite)._animState); (npc->_sprite)._animState._isPlaying = 1; } } diff --git a/generated-src/online_chat.cpp b/generated-src/online_chat.cpp index dd4309b..13ea921 100644 --- a/generated-src/online_chat.cpp +++ b/generated-src/online_chat.cpp @@ -119,7 +119,7 @@ LAB_0091d341: textGreen = *GHIDRA_CAST((iVar3 + 0x5e0)); textBlue = *GHIDRA_CAST((iVar3 + 0x5e4)); alphaLocal = local_58._alpha; - iVar3 = (GHIDRA_CAST((font)))->Font::get_string_width_n(&DAT_00c93010,-1); + iVar3 = Font::get_string_width_n(font,&DAT_00c93010,-1); iVar4 = *GHIDRA_CAST(this); local_3c.x = *GHIDRA_CAST((iVar4 + 0x5f4)); offsetX = local_3c.x * *GHIDRA_CAST((GHIDRA_CAST(this) + 0x1c)); @@ -181,7 +181,7 @@ LAB_0091d341: local_8 = 7.00649e-45; local_20[0].y = (fVar6 - offsetY) + lineHeight; local_20[0].x = (position->x - offsetX) + 0.0; - (GHIDRA_CAST((drawFont)))->Font::DrawString(&DAT_00c93010,local_20,&local_3c,&local_58,&local_7c); + Font::DrawString(drawFont,&DAT_00c93010,local_20,&local_3c,&local_58,&local_7c); } else { local_b0 = 0; @@ -194,7 +194,7 @@ LAB_0091d341: local_8 = 0.0; local_34.x = position->x - offsetX; local_34.y = position->y - offsetY; - (GHIDRA_CAST((drawFont)))->Font::DrawString(&DAT_00c93010,&local_34,&local_3c,&local_58,&local_b0); + Font::DrawString(drawFont,&DAT_00c93010,&local_34,&local_3c,&local_58,&local_b0); local_8 = -NAN; local_34.y = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)); iVar4 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)) - GHIDRA_INT(local_34.y); @@ -250,7 +250,7 @@ LAB_0091d913: else { lastLine = GHIDRA_CAST(0x0); } - iVar3 = (GHIDRA_CAST((font)))->Font::get_string_width_n(lastLine,-1); + iVar3 = Font::get_string_width_n(font,lastLine,-1); iVar4 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x14)); fVar6 = (float)((double)iVar3 + __uint_to_double_fixup[-(iVar3 >> 0x1f)]); } diff --git a/generated-src/online_emotes.cpp b/generated-src/online_emotes.cpp index d8923ae..c7d3e69 100644 --- a/generated-src/online_emotes.cpp +++ b/generated-src/online_emotes.cpp @@ -16,9 +16,9 @@ void OnlineEmotes::constructor() *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)) = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 0x14))); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x128)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((GHIDRA_INT(this) + 0x128))); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); _eh_vector_constructor_iterator_ ((void *)(GHIDRA_INT(this) + 0x23c),0x18,0x3b,FUN_0040c380,msvc::string::_Tidy_deallocate); @@ -43,20 +43,20 @@ void OnlineEmotes::destructor() *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = 0x3c; *GHIDRA_CAST((GHIDRA_CAST(this) + 8)) = 0; *GHIDRA_CAST((GHIDRA_CAST(this) + 0xc)) = 0; - (GHIDRA_CAST((secondAnm2)))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->ANM2::Reset(); + ANM2::Reset(secondAnm2); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x14))); _eh_vector_destructor_iterator_ ((void *)(GHIDRA_INT(this) + 0x23c),0x18,0x3b,msvc::string::_Tidy_deallocate); local_8 = 0; - (GHIDRA_CAST((secondAnm2)))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x178)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x158)))))->AnimationState::~AnimationState(); + ANM2::Reset(secondAnm2); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x178))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x158))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x140)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(secondAnm2))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 100)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x44)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x14))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 100))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x44))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x2c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -99,7 +99,7 @@ void OnlineEmotes::load_anm2() overlayAnm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(overlayAnm2Path._buf))) + 0x0))),"gfx/OnlineEmotes.anm2",0x16); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x128)))))->ANM2::Load(&overlayAnm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x128)),&overlayAnm2Path,1); local_14 = 0xffffffff; if (0xf < overlayAnm2Path._capacity) { uVar5 = overlayAnm2Path._capacity + 1; @@ -125,7 +125,7 @@ void OnlineEmotes::load_anm2() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/OnlineEmotes.anm2",0x16); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x14)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar5 = anm2Path._capacity + 1; @@ -170,9 +170,9 @@ LAB_0042fd7c: if ((uVar5 == 0) && ((pbVar3[0x34] == 0 || (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x58)) != '\0')))) goto LAB_0042fdb0; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x14)))))->ANM2::SetAnimation(GHIDRA_CAST("Bubble"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x14)),GHIDRA_CAST("Bubble"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x44)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x44))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x58)) = 1; } LAB_0042fdb0: diff --git a/generated-src/online_stats_screen.cpp b/generated-src/online_stats_screen.cpp index d7723ba..408ea48 100644 --- a/generated-src/online_stats_screen.cpp +++ b/generated-src/online_stats_screen.cpp @@ -15,9 +15,9 @@ OnlineStatsScreen::~OnlineStatsScreen() msvc::vector<56byte_string>::_Tidy(); _eh_vector_destructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x118))),0x114,4,ANM2::~ANM2); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1c))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4))))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; diff --git a/generated-src/options_config.cpp b/generated-src/options_config.cpp deleted file mode 100644 index 745e213..0000000 --- a/generated-src/options_config.cpp +++ /dev/null @@ -1,1019 +0,0 @@ -#include "classes.h" - -// 00924180 -void OptionsConfig::load_config_ini() -{ - uint8_t isEnabled; - uint32_t uVar1; - uint8_t *extraout_EAX; - uint8_t *pathText; - int *file; - int fileSize; - void *pvVar2; - uint32_t uVar3; - void *keyValues [2]; - void *redirectedPath [4]; - float local_34; - float local_30; - std_string configName; - uint32_t local_14; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - Manager *manager; - - manager = g_manager; - puStack_c = &LAB_00b0a77d; - local_10 = ExceptionList; - uVar1 = __security_cookie ^ GHIDRA_UINT(&(&configName)[1]._size); - ExceptionList = &local_10; - this->_enableColorCorrection = 1; - this->_enableLighting = 1; - this->_enableShockwave = 1; - this->_enableCaustics = 1; - this->_enableFilter = 1; - this->_enablePixelation = 1; - this->_enableBloom = 1; - this->_enableWaterSurface = 1; - this->_enableInterpolation = 1; - this->_getsSetToEnableWaterSurface = 1; - this->_enableColorModifier = 1; - configName._capacity = 0xf; - configName._size = 10; - builtin_strncpy(configName._buf,"config.ini",0xb); - local_8 = 0; - local_14 = uVar1; - ModManager::TryRedirectPath - (GHIDRA_CAST(&manager->_modManager),GHIDRA_CAST(redirectedPath),&configName); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 1; - pathText = extraout_EAX; - if (0xf < *GHIDRA_CAST((extraout_EAX + 0x14))) { - pathText = *GHIDRA_CAST(extraout_EAX); - } - file = (GHIDRA_CAST((&PTR_vftable_00c37a10)))->FileSystem::Open(pathText,GHIDRA_CAST(0x0)); - local_8 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_8))) + 0x1))) << 8; - if (0xf < GHIDRA_UINT(local_30)) { - uVar3 = GHIDRA_INT(local_30) + 1; - pvVar2 = redirectedPath[0]; - if (0xfff < uVar3) { - pvVar2 = *(void **)(GHIDRA_INT(redirectedPath[0]) + -4); - uVar3 = GHIDRA_INT(local_30) + 0x24; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(redirectedPath[0]) + (-4 - GHIDRA_INT(pvVar2))))) goto LAB_009242ab; - } - operator_delete(pvVar2,uVar3); - } - local_8 = -1; - local_34 = 0.0; - local_30 = 2.10195e-44; - redirectedPath[0] = (void *)(GHIDRA_UINT(redirectedPath[0]) & 0xffffff00); - if (0xf < configName._capacity) { - uVar3 = configName._capacity + 1; - pvVar2 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)configName._buf)) + 0x0))); - if (0xfff < uVar3) { - pvVar2 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(configName._buf)) + 0x0))) + -4); - uVar3 = configName._capacity + 0x24; - if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST((GHIDRA_CAST(&(configName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar2))))) { -LAB_009242ab: - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pvVar2,uVar3); - } - if (file != GHIDRA_CAST(0x0)) { - fileSize = (**(code **)(*file + 4))(uVar1); - pvVar2 = operator_new_tracked(fileSize + 1); - *GHIDRA_CAST((GHIDRA_CAST(pvVar2) + fileSize)) = 0; - (**(code **)(*file + 0x14))(pvVar2,1,fileSize); - (**(code **)*file)(1); - keyvalue_map_parse(pvVar2); - local_8 = 3; - tracked_alloc(1,pvVar2,0); - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),2); - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableColorCorrection"),1); - this->_enableColorCorrection = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableCaustics"),1); - this->_enableCaustics = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableShockwave"),1); - this->_enableShockwave = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableLighting"),1); - this->_enableLighting = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableFilter"),1); - this->_enableFilter = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnablePixelation"),1); - this->_enablePixelation = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableBloom"),1); - this->_enableBloom = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableWaterSurface"),1); - this->_enableWaterSurface = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableInterpolation"),1); - this->_enableInterpolation = isEnabled; - isEnabled = read_bool(GHIDRA_CAST(keyValues),GHIDRA_CAST("EnableColorModifier"),1); - this->_enableColorModifier = isEnabled; - this->_getsSetToEnableWaterSurface = this->_enableWaterSurface; - FUN_00431200(keyValues,*GHIDRA_CAST((GHIDRA_INT(keyValues[0]) + 4))); - operator_delete(keyValues[0],0x40); - } - ExceptionList = local_10; - return; -} - -// 00924440 -void OptionsConfig::Load(uint8_t *path) -{ - OptionsConfig *this_00; - uint8_t isMusicEnabled; - int *piVar1; - int iVar2; - void *fileText; - int iVar3; - uint8_t *pbVar4; - uint8_t *******compareCursor; - int unused; - int unused_00; - int unused_01; - uint32_t uVar5; - uint8_t *******pppppppbVar6; - bool isLess; - float in_XMM0_Da; - int windowSize; - uint8_t *******local_7c; - OptionsConfig *config; - uint8_t *local_74; - uint8_t isLegacyPath; - uint8_t *******local_6c [2]; - uint8_t *searchText; - float searchTextSize; - float searchTextCapacity; - uint8_t *******legacyPath [4]; - int *legacyPathSize; - float legacyPathCapacity; - uint8_t betaKey [32]; - uint32_t local_14; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - Manager *manager; - - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xff; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))) = 0xff; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x2))) = 0xff; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x3))) = 0xff; - puStack_c = &LAB_00b0a7cd; - local_10 = ExceptionList; - local_14 = __security_cookie ^ GHIDRA_UINT((betaKey + 0x30)); - ExceptionList = &local_10; - local_74 = path; - config = this; - reset_defaults(this,local_14); - pbVar4 = path; - do { - isMusicEnabled = *pbVar4; - pbVar4 = pbVar4 + 1; - } while (isMusicEnabled != 0); - (GHIDRA_CAST((GHIDRA_CAST(this))))->msvc::string::assign(path,GHIDRA_INT(pbVar4) - GHIDRA_INT((path + 1))); - piVar1 = (GHIDRA_CAST((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_read(path); - isLegacyPath = 0; - local_7c = GHIDRA_CAST(piVar1); - if (piVar1 == GHIDRA_CAST(0x0)) { - legacyPathCapacity = 2.10195e-44; - legacyPath[0] = GHIDRA_CAST(0x0); - pbVar4 = local_74; - do { - isMusicEnabled = *pbVar4; - pbVar4 = pbVar4 + 1; - } while (isMusicEnabled != 0); - legacyPathSize = piVar1; - (GHIDRA_CAST((GHIDRA_CAST(legacyPath))))->msvc::string::assign(local_74,GHIDRA_INT(pbVar4) - GHIDRA_INT((local_74 + 1))); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))) = 0; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x2))) = 0; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x3))) = 0; - local_74 = msvc::_Allocate(0x20); - searchTextSize = 3.92364e-44; - searchTextCapacity = 4.34403e-44; - local_74[0] = 'B'; - local_74[1] = 'i'; - local_74[2] = 'n'; - local_74[3] = 'd'; - local_74[4] = 'i'; - local_74[5] = 'n'; - local_74[6] = 'g'; - local_74[7] = ' '; - local_74[8] = 'o'; - local_74[9] = 'f'; - local_74[10] = ' '; - local_74[0xb] = 'I'; - local_74[0xc] = 's'; - local_74[0xd] = 'a'; - local_74[0xe] = 'a'; - local_74[0xf] = 'c'; - in_XMM0_Da = 2.838854e+29; - local_74[0x10] = 0x20; - local_74[0x11] = 0x52; - local_74[0x12] = 0x65; - local_74[0x13] = 0x70; - local_74[0x14] = 0x65; - local_74[0x15] = 0x6e; - local_74[0x16] = 0x74; - local_74[0x17] = 0x61; - local_74[0x18] = 'n'; - local_74[0x19] = 'c'; - local_74[0x1a] = 'e'; - local_74[0x1b] = '+'; - local_74[0x1c] = 0; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 1; - local_7c = GHIDRA_CAST(legacyPath); - if (0xf < GHIDRA_UINT(legacyPathCapacity)) { - local_7c = legacyPath[0]; - } - searchText = local_74; - if (GHIDRA_CAST(0x1b) < legacyPathSize) { - piVar1 = GHIDRA_CAST(0xffffffff); - if (legacyPathSize + -7 != GHIDRA_CAST(0xffffffff)) { - piVar1 = legacyPathSize + -7; - } - isLegacyPath = *local_74; - pppppppbVar6 = GHIDRA_CAST((GHIDRA_INT(piVar1) + GHIDRA_INT(local_7c))); -LAB_00924554: - if (*GHIDRA_CAST(pppppppbVar6) != isLegacyPath) { -LAB_009245a7: - if (pppppppbVar6 == local_7c) goto LAB_009245c8; - pppppppbVar6 = GHIDRA_CAST((GHIDRA_INT(pppppppbVar6) + -1)); - goto LAB_00924554; - } - uVar5 = 0x18; - compareCursor = pppppppbVar6; - pbVar4 = local_74; - do { - if (*compareCursor != *GHIDRA_CAST(pbVar4)) { - isMusicEnabled = (uint8_t)*compareCursor; - isLess = isMusicEnabled < *pbVar4; - if ((((isMusicEnabled == *pbVar4) && - (isLess = *GHIDRA_CAST((GHIDRA_CAST(compareCursor) + 1)) < pbVar4[1], - *GHIDRA_CAST((GHIDRA_CAST(compareCursor) + 1)) == pbVar4[1])) && - (isLess = *GHIDRA_CAST((GHIDRA_CAST(compareCursor) + 2)) < pbVar4[2], - *GHIDRA_CAST((GHIDRA_CAST(compareCursor) + 2)) == pbVar4[2])) && - (isLess = *GHIDRA_CAST((GHIDRA_CAST(compareCursor) + 3)) < pbVar4[3], - *GHIDRA_CAST((GHIDRA_CAST(compareCursor) + 3)) == pbVar4[3])) { - uVar5 = 0; - } - else { - uVar5 = -GHIDRA_UINT(isLess) | 1; - } - goto LAB_0092459a; - } - compareCursor = compareCursor + 1; - pbVar4 = pbVar4 + 4; - isLess = 3 < uVar5; - uVar5 = uVar5 - 4; - } while (isLess); - uVar5 = 0; -LAB_0092459a: - if (uVar5 != 0) goto LAB_009245a7; - if (GHIDRA_INT(pppppppbVar6) - GHIDRA_INT(local_7c) != 0xffffffff) { - msvc::string::replace - (GHIDRA_CAST(legacyPath),GHIDRA_INT(pppppppbVar6) - GHIDRA_INT(local_7c),0x1c, - GHIDRA_CAST("Binding of Isaac Afterbirth+"),0x1c); - } -LAB_009245c8: - this = config; - } - pppppppbVar6 = GHIDRA_CAST(legacyPath); - if (0xf < GHIDRA_UINT(legacyPathCapacity)) { - pppppppbVar6 = legacyPath[0]; - } - piVar1 = (GHIDRA_CAST((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_read(GHIDRA_CAST(pppppppbVar6)); - local_7c = GHIDRA_CAST(piVar1); - if (piVar1 == GHIDRA_CAST(0x0)) { - Save(this); - operator_delete(local_74,0x20); - if (GHIDRA_UINT(legacyPathCapacity) < 0x10) { - ExceptionList = local_10; - return; - } - uVar5 = GHIDRA_INT(legacyPathCapacity) + 1; - local_6c[0] = legacyPath[0]; - if (0xfff < uVar5) { - local_6c[0] = GHIDRA_CAST(legacyPath[0][-1]); - uVar5 = GHIDRA_INT(legacyPathCapacity) + 0x24; - if (GHIDRA_CAST(0x1f) < GHIDRA_CAST((GHIDRA_INT(legacyPath[0]) + (-4 - GHIDRA_INT(local_6c[0]))))) { -LAB_0092466d: - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - goto LAB_00924ce7; - } - isLegacyPath = 1; - operator_delete(local_74,0x20); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xff; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))) = 0xff; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x2))) = 0xff; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x3))) = 0xff; - if (0xf < GHIDRA_UINT(legacyPathCapacity)) { - uVar5 = GHIDRA_INT(legacyPathCapacity) + 1; - pppppppbVar6 = legacyPath[0]; - if (0xfff < uVar5) { - pppppppbVar6 = GHIDRA_CAST(legacyPath[0][-1]); - uVar5 = GHIDRA_INT(legacyPathCapacity) + 0x24; - if (GHIDRA_CAST(0x1f) < GHIDRA_CAST((GHIDRA_INT(legacyPath[0]) + (-4 - GHIDRA_INT(pppppppbVar6))))) - goto LAB_0092466d; - } - operator_delete(pppppppbVar6,uVar5); - } - legacyPathSize = GHIDRA_CAST(0x0); - legacyPathCapacity = 2.10195e-44; - legacyPath[0] = GHIDRA_CAST((GHIDRA_UINT(legacyPath[0]) & 0xffffff00)); - } - iVar2 = (**(code **)(*piVar1 + 4))(); - fileText = operator_new_tracked(iVar2 + 1); - pppppppbVar6 = local_7c; - *GHIDRA_CAST((GHIDRA_CAST(fileText) + iVar2)) = 0; - (**(code **)(GHIDRA_INT(*local_7c) + 0x14))(fileText,1,iVar2); - (*(code *)**pppppppbVar6)(1); - keyvalue_map_parse(fileText); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 3; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))) = 0; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x2))) = 0; - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x3))) = 0; - tracked_alloc(1,fileText,0); - (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; - keyvalue_map_read_int("Language",0); - (GHIDRA_CAST((g_manager)))->Manager::validate_language(unused); - keyvalue_map_read_float("MusicVolume"); - this_00 = config; - manager = g_manager; - config->_musicVolume = in_XMM0_Da; - (manager->_musicManager)._isEnabled = 0.0 < in_XMM0_Da; - (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._volume = - (manager->_optionsConfig)._musicVolume; - (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._targetVolume = - (manager->_optionsConfig)._musicVolume; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("MusicEnabled"),1); - if (isMusicEnabled == 0) { - (g_manager->_musicManager)._isEnabled = 0; - } - keyvalue_map_read_float("SFXVolume"); - manager = g_manager; - this_00->_sfxVolume = in_XMM0_Da; - (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::ClearVolumeModifier(); - keyvalue_map_read_float("MapOpacity"); - this_00->_mapOpacity = in_XMM0_Da; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("Filter"),0); - this_00->_filterEnabled = isMusicEnabled; - keyvalue_map_read_float("Exposure"); - this_00->_exposure = in_XMM0_Da; - keyvalue_map_read_float("Brightness"); - this_00->_brightness = in_XMM0_Da; - keyvalue_map_read_float("Gamma"); - this_00->_gamma = in_XMM0_Da; - keyvalue_map_read_float("Contrast"); - this_00->_contrast = in_XMM0_Da; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("ControllerHotplug"),1); - this_00->_controlHotplugEnabled = isMusicEnabled; - if (isMusicEnabled != ((uint8_t)(DAT_00c57b1c >> 1) & 1)) { - if (isMusicEnabled == 0) { - DAT_00c57b1c = DAT_00c57b1c & 0xfffffffd; - } - else { - (**(code **)(DAT_00c57b64 + 8))(FUN_00a220c0,2,0x1000,&PTR_vftable_00c57b18); - DAT_00c57b1c = DAT_00c57b1c | 2; - } - } - iVar2 = keyvalue_map_read_int("PopUps",1); - this_00->_popupsMode = iVar2; - iVar2 = keyvalue_map_read_int("CameraStyle",1); - this_00->_cameraStyle = iVar2; - iVar2 = keyvalue_map_read_int("ShowRecentItems",0); - this_00->_historyHudMode = iVar2; - keyvalue_map_read_float("HudOffset"); - this_00->_hudOffset = in_XMM0_Da; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("TryImportSave"),0); - this_00->_tryImportSave = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("BossHpOnBottom"),1); - this_00->_bossHpOnBottom = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("FoundHUD"),0); - this_00->_enableFoundHUD = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("EnableMods"),1); - this_00->_enableMods = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("RumbleEnabled"),1); - this_00->_enableRumble = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("ChargeBars"),0); - this_00->_enableChargeBars = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("BulletVisibility"),0); - this_00->_enableBulletVisibility = isMusicEnabled; - iVar2 = keyvalue_map_read_int("TouchMode",1); - this_00->_touchMode = iVar2; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("AimLock"),1); - this_00->_enableAimLock = isMusicEnabled; - iVar2 = keyvalue_map_read_int("JacobEsauControls",1); - this_00->_jacobEsauControls = iVar2; - iVar2 = keyvalue_map_read_int("AscentVoiceOver",1); - this_00->_ascentVoiceover = iVar2 != 0; - iVar2 = keyvalue_map_read_int("OnlineHud",0); - this_00->_onlineHud = iVar2; - iVar3 = keyvalue_map_read_int("OnlinePlayerVolume",6); - iVar2 = 0; - if (0 < iVar3) { - iVar2 = iVar3; - } - iVar3 = 10; - if (iVar2 < 10) { - iVar3 = iVar2; - } - this_00->_onlinePlayerVolume = iVar3; - iVar3 = keyvalue_map_read_int("OnlinePlayerOpacity",10); - iVar2 = 0; - if (0 < iVar3) { - iVar2 = iVar3; - } - iVar3 = 10; - if (iVar2 < 10) { - iVar3 = iVar2; - } - this_00->_onlinePlayerOpacity = iVar3; - iVar2 = keyvalue_map_read_int("MultiplayerColorSet",0); - this_00->_onlineColorSet = iVar2; - iVar3 = keyvalue_map_read_int("OnlineInputDelay",3); - iVar2 = 5; - if (iVar3 < 5) { - iVar2 = iVar3; - } - iVar3 = 1; - if (1 < iVar2) { - iVar3 = iVar2; - } - this_00->_onlineInputDelay = iVar3; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("ItemInfoDisplayEnabled"),0); - this_00->_itemInfoDisplayEnabled = isMusicEnabled; - sprintf(betaKey,GHIDRA_CAST("AcceptedPublicBeta_%s")); - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),betaKey,0); - this_00->_acceptedPublicBeta_VERSION = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("AcceptedDataCollectionDisclaimer"),0) - ; - this_00->_acceptedDataCollectionDisclaimer = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("EnableDebugConsole"),0); - this_00->_enableDebugConsole = isMusicEnabled; - iVar2 = keyvalue_map_read_int("AnnouncerVoiceMode",0); - this_00->_announcerVoiceMode = iVar2; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("OnlineChatEnabled"),1); - this_00->_onlineChatEnabled = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("OnlineChatFilterEnabled"),1); - this_00->_onlineFilterEnabled = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("StreamerMode"),0); - this_00->_streamerMode = isMusicEnabled; - iVar2 = keyvalue_map_read_int("MaxScale",99); - this_00->_maxScale = iVar2; - iVar2 = keyvalue_map_read_int("MaxRenderScale",2); - this_00->_maxRenderScale = iVar2; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("VSync"),1); - set_vsync(this_00,isMusicEnabled); - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("PauseOnFocusLost"),1); - this_00->_enablePauseOnFocusLost = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("SteamCloud"),1); - this_00->_enableSteamCloud = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("MouseControl"),0); - this_00->_enableMouseControl = isMusicEnabled; - glfwSetInputMode(g_glfwWindow,(isMusicEnabled != 0) + 0x34001); - iVar2 = keyvalue_map_read_int("ConsoleFont",0); - this_00->_consoleFont = iVar2; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("FadedConsoleDisplay"),0); - this_00->_enableFadedConsoleDisplay = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("SaveCommandHistory"),1); - this_00->_enableSaveCommandHistory = isMusicEnabled; - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("UseExclusiveFullscreen"),0); - this_00->_enableBorderlessFullscreen = isMusicEnabled; - piVar1 = glfw_get_window_size(&windowSize,unused_00); - iVar2 = keyvalue_map_read_int("WindowWidth",*piVar1); - this_00->_windowWidth = iVar2; - piVar1 = glfw_get_window_size(&windowSize,unused_01); - iVar2 = keyvalue_map_read_int("WindowHeight",piVar1[1]); - this_00->_windowHeight = iVar2; - iVar2 = keyvalue_map_read_int("WindowPosX",0); - if ((iVar2 < 8) || (0xffff < iVar2)) { - iVar2 = 8; - } - iVar3 = keyvalue_map_read_int("WindowPosY",0); - if ((iVar3 < 8) || (0xffff < iVar3)) { - iVar3 = 0x20; - } - this_00->_windowPosX = iVar2; - this_00->_windowPosY = iVar3; - glfw_set_window_pos(iVar2,iVar3); - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("Fullscreen"),0); - set_fullscreen(this_00,isMusicEnabled); - isMusicEnabled = read_bool(GHIDRA_CAST(local_6c),GHIDRA_CAST("EnableEpicOverlay"),1); - this_00->_enableEpicOverlay = isMusicEnabled; - iVar2 = keyvalue_map_read_int("EosCrossplay",0); - this_00->_eosCrossplay = iVar2; - if (isLegacyPath != 0) { - this_00->_gamma = 1.0; - this_00->_hudOffset = 1.0; - } - FUN_00431200(local_6c,local_6c[0][1]); - uVar5 = 0x40; -LAB_00924ce7: - operator_delete(local_6c[0],uVar5); - ExceptionList = local_10; - return; -} - -// 00924d10 -void OptionsConfig::Save() -{ - char cVar1; - int *file; - uint8_t *lineEnd; - char *lineCursor; - uint8_t abStackY_4a4 [128]; - uint8_t abStack_31e [2]; - uint8_t abStack_22e [2]; - uint8_t abStack_1e6 [2]; - uint8_t abStack_1b6 [2]; - uint8_t abStack_19e [2]; - uint32_t uStack_190; - uint8_t auStack_174 [2]; - uint8_t abStack_172 [6]; - uint8_t abStack_16c [12]; - uint8_t abStack_160 [12]; - uint8_t abStack_154 [12]; - uint8_t line [260]; - uint32_t local_44; - uint8_t lineChar; - - local_44 = __security_cookie ^ GHIDRA_UINT(auStack_174); - if (0xf < (this->_optionsIniFilePath)._capacity) { - this = *GHIDRA_CAST((this->_optionsIniFilePath)._buf); - } - file = (GHIDRA_CAST((&PTR_vftable_00c5aa80)))->SaveDataManager::open_file_write(GHIDRA_CAST(this),0); - if (file == GHIDRA_CAST(0x0)) { - uStack_190 = 0x924d6c; - KAGE_LogMessage(1,GHIDRA_CAST("[warn] could not opn %s for writing. options will not be saved.\n")); - return; - } - uStack_190 = 0x924d98; - sprintf_s(line,0x100,GHIDRA_CAST("[Options]\r\n")); - lineEnd = line; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - uStack_190 = 0x924dba; - (**(code **)(*file + 0x1c))(); - uStack_190 = *GHIDRA_CAST(&g_manager->_stringTable); - sprintf_s(abStack_154,0x100,GHIDRA_CAST("Language=%d\r\n")); - lineEnd = abStack_154; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - uStack_190 = GHIDRA_INT(lineEnd) - GHIDRA_INT((abStack_154 + 1)); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_160,0x100,GHIDRA_CAST("MusicVolume=%.4f\r\n")); - lineEnd = abStack_160; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_16c,0x100,GHIDRA_CAST("MusicEnabled=%d\r\n")); - lineEnd = abStack_16c; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(auStack_174 + -4,0x100,GHIDRA_CAST("SFXVolume=%.4f\r\n")); - lineCursor = auStack_174 + -4; - do { - cVar1 = *lineCursor; - lineCursor = lineCursor + 1; - } while (cVar1 != '\0'); - (**(code **)(*file + 0x1c))(); - sprintf_s(auStack_174 + -0x10,0x100,GHIDRA_CAST("MapOpacity=%.4f\r\n")); - lineCursor = auStack_174 + -0x10; - do { - cVar1 = *lineCursor; - lineCursor = lineCursor + 1; - } while (cVar1 != '\0'); - (**(code **)(*file + 0x1c))(); - sprintf_s(GHIDRA_CAST(&uStack_190),0x100,GHIDRA_CAST("Fullscreen=%d\r\n")); - lineCursor = GHIDRA_CAST(&uStack_190); - do { - cVar1 = *lineCursor; - lineCursor = lineCursor + 1; - } while (cVar1 != '\0'); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_19e + 2,0x100,GHIDRA_CAST("Filter=%d\r\n")); - lineEnd = abStack_19e + 2; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_19e + -10,0x100,GHIDRA_CAST("Exposure=%.4f\r\n")); - lineEnd = abStack_19e + -10; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1b6 + 2,0x100,GHIDRA_CAST("Gamma=%.4f\r\n")); - lineEnd = abStack_1b6 + 2; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1b6 + -10,0x100,GHIDRA_CAST("ControllerHotplug=%d\r\n")); - lineEnd = abStack_1b6 + -10; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1b6 + -0x16,0x100,GHIDRA_CAST("PopUps=%d\r\n")); - lineEnd = abStack_1b6 + -0x16; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1e6 + 0xe,0x100,GHIDRA_CAST("CameraStyle=%d\r\n")); - lineEnd = abStack_1e6 + 0xe; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1e6 + 2,0x100,GHIDRA_CAST("ShowRecentItems=%d\r\n")); - lineEnd = abStack_1e6 + 2; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1e6 + -10,0x100,GHIDRA_CAST("HudOffset=%.4f\r\n")); - lineEnd = abStack_1e6 + -10; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1e6 + -0x16,0x100,GHIDRA_CAST("TryImportSave=%d\r\n")); - lineEnd = abStack_1e6 + -0x16; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_1e6 + -0x22,0x100,GHIDRA_CAST("FoundHUD=%d\r\n")); - lineEnd = abStack_1e6 + -0x22; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + 0x1a,0x100,GHIDRA_CAST("EnableMods=%d\r\n")); - lineEnd = abStack_22e + 0x1a; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + 0xe,0x100,GHIDRA_CAST("RumbleEnabled=%d\r\n")); - lineEnd = abStack_22e + 0xe; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + 2,0x100,GHIDRA_CAST("ChargeBars=%d\r\n")); - lineEnd = abStack_22e + 2; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -10,0x100,GHIDRA_CAST("BulletVisibility=%d\r\n")); - lineEnd = abStack_22e + -10; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x16,0x100,GHIDRA_CAST("TouchMode=%d\r\n")); - lineEnd = abStack_22e + -0x16; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x22,0x100,GHIDRA_CAST("AimLock=%d\r\n")); - lineEnd = abStack_22e + -0x22; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x2e,0x100,GHIDRA_CAST("JacobEsauControls=%d\r\n")); - lineEnd = abStack_22e + -0x2e; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x3a,0x100,GHIDRA_CAST("AscentVoiceOver=%d\r\n")); - lineEnd = abStack_22e + -0x3a; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x46,0x100,GHIDRA_CAST("OnlineHud=%d\r\n")); - lineEnd = abStack_22e + -0x46; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x52,0x100,GHIDRA_CAST("StreamerMode=%d\r\n")); - lineEnd = abStack_22e + -0x52; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x5e,0x100,GHIDRA_CAST("OnlinePlayerVolume=%d\r\n")); - lineEnd = abStack_22e + -0x5e; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x6a,0x100,GHIDRA_CAST("OnlinePlayerOpacity=%d\r\n")); - lineEnd = abStack_22e + -0x6a; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_22e + -0x76,0x100,GHIDRA_CAST("OnlineChatEnabled=%d\r\n")); - lineEnd = abStack_22e + -0x76; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x6e,0x100,GHIDRA_CAST("OnlineChatFilterEnabled=%d\r\n")); - lineEnd = abStack_31e + 0x6e; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x62,0x100,GHIDRA_CAST("MultiplayerColorSet=%d\r\n")); - lineEnd = abStack_31e + 0x62; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x56,0x100,GHIDRA_CAST("OnlineInputDelay=%d\r\n")); - lineEnd = abStack_31e + 0x56; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x4a,0x100,GHIDRA_CAST("ItemInfoDisplayEnabled=%d\r\n")); - lineEnd = abStack_31e + 0x4a; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x3e,0x100,GHIDRA_CAST("AcceptedPublicBeta_%s=%d\r\n")); - lineEnd = abStack_31e + 0x3e; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x32,0x100,GHIDRA_CAST("AcceptedDataCollectionDisclaimer=%d\r\n")); - lineEnd = abStack_31e + 0x32; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x26,0x100,GHIDRA_CAST("EnableDebugConsole=%d\r\n")); - lineEnd = abStack_31e + 0x26; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0x1a,0x100,GHIDRA_CAST("MaxScale=%d\r\n")); - lineEnd = abStack_31e + 0x1a; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 0xe,0x100,GHIDRA_CAST("MaxRenderScale=%d\r\n")); - lineEnd = abStack_31e + 0xe; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + 2,0x100,GHIDRA_CAST("VSync=%d\r\n")); - lineEnd = abStack_31e + 2; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -10,0x100,GHIDRA_CAST("PauseOnFocusLost=%d\r\n")); - lineEnd = abStack_31e + -10; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x16,0x100,GHIDRA_CAST("SteamCloud=%d\r\n")); - lineEnd = abStack_31e + -0x16; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x22,0x100,GHIDRA_CAST("MouseControl=%d\r\n")); - lineEnd = abStack_31e + -0x22; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x2e,0x100,GHIDRA_CAST("BossHpOnBottom=%d\r\n")); - lineEnd = abStack_31e + -0x2e; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x3a,0x100,GHIDRA_CAST("AnnouncerVoiceMode=%d\r\n")); - lineEnd = abStack_31e + -0x3a; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x46,0x100,GHIDRA_CAST("ConsoleFont=%d\r\n")); - lineEnd = abStack_31e + -0x46; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x52,0x100,GHIDRA_CAST("FadedConsoleDisplay=%d\r\n")); - lineEnd = abStack_31e + -0x52; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x5e,0x100,GHIDRA_CAST("SaveCommandHistory=%d\r\n")); - lineEnd = abStack_31e + -0x5e; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x6a,0x100,GHIDRA_CAST("WindowWidth=%d\r\n")); - lineEnd = abStack_31e + -0x6a; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(abStack_31e + -0x76,0x100,GHIDRA_CAST("WindowHeight=%d\r\n")); - lineEnd = abStack_31e + -0x76; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(); - sprintf_s(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x3a0)),0x100,GHIDRA_CAST("WindowPosX=%d\r\n")); - lineCursor = GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x3a0)); - do { - cVar1 = *lineCursor; - lineCursor = lineCursor + 1; - } while (cVar1 != '\0'); - (**(code **)(*file + 0x1c))(GHIDRA_INT(register0x00000010) + -0x3a0,1); - sprintf_s(abStackY_4a4 + 0xf8,0x100,GHIDRA_CAST("WindowPosY=%d\r\n")); - lineEnd = abStackY_4a4 + 0xf8; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(abStackY_4a4 + 0xf8,1,GHIDRA_INT(lineEnd) - GHIDRA_INT((abStackY_4a4 + 0xf9))); - sprintf_s(abStackY_4a4 + 0xec,0x100,GHIDRA_CAST("UseExclusiveFullscreen=%d\r\n")); - lineEnd = abStackY_4a4 + 0xec; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(abStackY_4a4 + 0xec,1,GHIDRA_INT(lineEnd) - GHIDRA_INT((abStackY_4a4 + 0xed))); - sprintf_s(abStackY_4a4 + 0xe0,0x100,GHIDRA_CAST("EnableEpicOverlay=%d\r\n")); - lineEnd = abStackY_4a4 + 0xe0; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(abStackY_4a4 + 0xe0,1,GHIDRA_INT(lineEnd) - GHIDRA_INT((abStackY_4a4 + 0xe1))); - sprintf_s(abStackY_4a4 + 0xd4,0x100,GHIDRA_CAST("EosCrossplay=%d\r\n")); - lineEnd = abStackY_4a4 + 0xd4; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(abStackY_4a4 + 0xd4,1,GHIDRA_INT(lineEnd) - GHIDRA_INT((abStackY_4a4 + 0xd5))); - sprintf_s(abStackY_4a4 + 200,0x100,&DAT_00b657f8); - lineEnd = abStackY_4a4 + 200; - do { - lineChar = *lineEnd; - lineEnd = lineEnd + 1; - } while (lineChar != 0); - (**(code **)(*file + 0x1c))(abStackY_4a4 + 200,1,GHIDRA_INT(lineEnd) - GHIDRA_INT((abStackY_4a4 + 0xc9))); - (**(code **)*file)(1); - return; -} - -// 00925c00 -void OptionsConfig::SetMusicVolume(float volume) -{ - Manager *manager; - - manager = g_manager; - this->_musicVolume = volume; - (manager->_musicManager)._isEnabled = 0.0 < volume; - (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._volume = - (manager->_optionsConfig)._musicVolume; - (manager->_musicManager)._channels[(manager->_musicManager)._currentChannel]._targetVolume = - (manager->_optionsConfig)._musicVolume; - return; -} - -// 00925ce0 -void OptionsConfig::set_vsync(uint32_t param_2) -{ - void *pvVar1; - uint32_t videoMode; - int isModeOk; - uint8_t isVsync; - float hzRatio; - float hzDeviation; - - this->_enableVSync = (uint8_t)param_2; - isVsync = (uint8_t)param_2; - if ((uint8_t)param_2 != 0) { - pvVar1 = window_get_current_monitor(&DAT_00c798e0); - if (pvVar1 == (void *)0x0) { - _wassert(L"monitor != NULL", - L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\monitor.c" - ,0x1c1); - } - if (_glfw == 0) { - _glfwInputError(0x10001,0); - videoMode = 0; - } - else { - isModeOk = (*DAT_00c736fc)(pvVar1,GHIDRA_INT(pvVar1) + 0x98U); - videoMode = -GHIDRA_UINT((isModeOk != 0)) & GHIDRA_INT(pvVar1) + 0x98U; - } - hzRatio = (float)*GHIDRA_CAST((videoMode + 0x14)) / 60.0; - float_split(); - hzDeviation = 1.0 - hzRatio; - if (hzRatio <= 1.0 - hzRatio) { - hzDeviation = hzRatio; - } - if (0.04 < hzDeviation) { - KAGE_LogMessage(1,GHIDRA_CAST("Display Hz: %d, Target: 60.. disabling vsync for this session.\n")); - param_2 = param_2 & 0xffffff00; - isVsync = 0; - } - } - if (isVsync != ((uint8_t)(g_graphicsManager_flags >> 9) & 1)) { - if (isVsync == 0) { - g_graphicsManager_flags = g_graphicsManager_flags & 0xfffffdff; - } - else { - g_graphicsManager_flags = g_graphicsManager_flags | 0x200; - } - FUN_00a1a470(param_2); - } - return; -} diff --git a/generated-src/pause_screen.cpp b/generated-src/pause_screen.cpp index 749c250..998058c 100644 --- a/generated-src/pause_screen.cpp +++ b/generated-src/pause_screen.cpp @@ -35,7 +35,7 @@ void PauseScreen::load_drop_player_menu() menuAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuAnmPath._buf))) + 0x0))),"gfx/ui/Menu_DropPlayer.anm2",0x1c); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::Load(&menuAnmPath,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 4)),&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar3 = menuAnmPath._capacity + 1; @@ -53,9 +53,9 @@ void PauseScreen::load_drop_player_menu() animData = *GHIDRA_CAST((in_ECX + 0x38)); if (animData == GHIDRA_CAST(0x0)) { LAB_008d1114: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::SetAnimation(GHIDRA_CAST("Background"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((in_ECX + 4)),GHIDRA_CAST("Background"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x34)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x34))); *GHIDRA_CAST((in_ECX + 0x48)) = 1; } } @@ -96,7 +96,7 @@ LAB_008d1106: counterAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(counterAnmPath._buf))) + 0x0))),"gfx/ui/DropPlayer_Counter.anm2",0x1f); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x118)))))->ANM2::Load(&counterAnmPath,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 0x118)),&counterAnmPath,1); local_14 = 0xffffffff; if (0xf < counterAnmPath._capacity) { uVar3 = counterAnmPath._capacity + 1; @@ -141,9 +141,9 @@ LAB_008d123d: if ((uVar3 == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((in_ECX + 0x15c)) != '\0')))) goto LAB_008d1269; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x118)))))->ANM2::SetAnimation(GHIDRA_CAST("UpperSelector"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((in_ECX + 0x118)),GHIDRA_CAST("UpperSelector"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x148)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x148))); *GHIDRA_CAST((in_ECX + 0x15c)) = 1; } LAB_008d1269: @@ -179,12 +179,12 @@ void PauseScreen::update_player_info_page() } build_player_user_list(this); if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x10d))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x34))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x54))))); } if ((*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x221))) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x148)))))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x168)))))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x148))))); + AnimationState::Update(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x168))))); } memberCount = online_lobby_get_member_count(); optionCount = memberCount + -1; @@ -310,9 +310,9 @@ LAB_008d15c1: } } } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x118)))))))->ANM2::SetAnimation(local_8,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x118)))),local_8,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x148)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x148))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x15c))) = 1; } return; @@ -615,9 +615,9 @@ LAB_008d3472: LAB_008d354d: update_items_page(); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))) == 0) { - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("DescriptionArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("DescriptionArrowUp")); arrowLayer->_visible = 0; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("DescriptionArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("DescriptionArrowDown")); arrowLayer->_visible = 0; update_trinket_display(this); update_pocket_item_display(this); @@ -629,10 +629,10 @@ LAB_008d354d: descriptionLineCount = InfoDisplayEntry::count_lines(player,*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x38)))) + 4))); iVar1 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x44)))); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("DescriptionArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("DescriptionArrowUp")); arrowLayer->_visible = 0 < iVar1; uVar2 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x48)))); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("DescriptionArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("DescriptionArrowDown")); arrowLayer->_visible = uVar2 < descriptionLineCount; update_trinket_display(this); update_pocket_item_display(this); @@ -694,7 +694,7 @@ void PauseScreen::render_items_page() } if (*GHIDRA_CAST((in_ECX + 0x338)) != 0) { backButtonNull = - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x334)))))->AnimationState::GetNullFrame(GHIDRA_CAST("BackButton")); + AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x334)),GHIDRA_CAST("BackButton")); if (backButtonNull != GHIDRA_CAST(0x0)) { glyphX = pagePos.x + *backButtonNull; glyphY = pagePos.y + backButtonNull[1]; @@ -896,9 +896,9 @@ void PauseScreen::update_items_page() in_ECX[0xd] = 0; in_ECX[0xe] = 0; (GHIDRA_CAST((in_ECX + 0xf)))->KAGE::SmartPointer::reset((void *)0x0); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xc1)))))->ANM2::GetLayer(GHIDRA_CAST("ItemsArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 0xc1)),GHIDRA_CAST("ItemsArrowUp")); arrowLayer->_visible = 0; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xc1)))))->ANM2::GetLayer(GHIDRA_CAST("ItemsArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 0xc1)),GHIDRA_CAST("ItemsArrowDown")); arrowLayer->_visible = 0; goto LAB_008d3fcb; } @@ -1067,10 +1067,10 @@ LAB_008d3ede: (GHIDRA_CAST((&manager->_sfxManager)))->SoundEffects::Play(GHIDRA_INT(local_48),1.0,2,0,1.0,0.0); } isArrowVisible = 0 < in_ECX[0xc]; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xc1)))))->ANM2::GetLayer(GHIDRA_CAST("ItemsArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 0xc1)),GHIDRA_CAST("ItemsArrowUp")); arrowLayer->_visible = isArrowVisible; isArrowVisible = GHIDRA_UINT(in_ECX[2]) < GHIDRA_UINT((local_28 - in_ECX[0xc])); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0xc1)))))->ANM2::GetLayer(GHIDRA_CAST("ItemsArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST((in_ECX + 0xc1)),GHIDRA_CAST("ItemsArrowDown")); arrowLayer->_visible = isArrowVisible; LAB_008d3fcb: if (shownItems != (void *)0x0) { @@ -1176,10 +1176,10 @@ void PauseScreen::update_trinket_display() 0x41f00000,*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x14)))) == 2); scrollLimit = InfoDisplayEntry::count_lines(pEVar4,pEVar4->_trinketsID[0]); trinketConfig = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x58)))); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("TrinketArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("TrinketArrowUp")); arrowLayer->_visible = 0 < trinketConfig; uVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pauseScreen)) + 0x5c)))); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("TrinketArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("TrinketArrowDown")); arrowLayer->_visible = uVar3 < scrollLimit; ExceptionList = local_10; return; @@ -1189,9 +1189,9 @@ void PauseScreen::update_trinket_display() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4c)))) = 0; (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x50))))))->KAGE::SmartPointer::reset((void *)0x0); } - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("TrinketArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("TrinketArrowUp")); arrowLayer->_visible = 0; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("TrinketArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x304)))),GHIDRA_CAST("TrinketArrowDown")); arrowLayer->_visible = 0; ExceptionList = local_10; return; @@ -1251,7 +1251,7 @@ void PauseScreen::update_pocket_item_display() joined_r0x008d4475: if (pocketId == 0) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x60)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64))))); goto LAB_008d448a; } } @@ -1279,7 +1279,7 @@ joined_r0x008d4475: in_stack_ffffff80 = 5; pickupConfig = (GHIDRA_CAST((entityConfig)))->EntityConfig::GetEntity(5,0x46,player->_pocketSlots[iVar5 * 2]); if (pickupConfig == GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64))))); } else { anm2PathChars = &pickupConfig->anm2Path; @@ -1288,7 +1288,7 @@ joined_r0x008d4475: } (GHIDRA_CAST((anm2PathStr._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST(anm2PathChars)); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Load(&anm2PathStr,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))),&anm2PathStr,1); local_14 = 0xffffffff; if (0xf < anm2PathStr._capacity) { uVar4 = anm2PathStr._capacity + 1; @@ -1304,7 +1304,7 @@ joined_r0x008d4475: operator_delete(freePtr,uVar4); } in_stack_ffffff80 = 0x8d44e9; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Play(s_Idle,0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))),s_Idle,0); } } else { @@ -1327,7 +1327,7 @@ joined_r0x008d4475: pickupConfig = (GHIDRA_CAST((&manager->_entityConfig)))->EntityConfig::GetEntity(5,300,*GHIDRA_CAST((pocketId + 0x54))) ; if (pickupConfig == GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64))))); } else { anm2PathStr._size = 0; @@ -1341,7 +1341,7 @@ joined_r0x008d4475: anm2PathStr._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2PathStr._buf))) + 0x0))),"gfx/ui/ui_cardspills.anm2",0x1a); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Load(&anm2PathStr,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))),&anm2PathStr,1); local_14 = 0xffffffff; if (0xf < anm2PathStr._capacity) { uVar4 = anm2PathStr._capacity + 1; @@ -1357,13 +1357,13 @@ joined_r0x008d4475: operator_delete(freePtr,uVar4); } in_stack_ffffff80 = 0x8d4636; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::SetFrame(GHIDRA_CAST("CardFronts"), + ANM2::SetFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))),GHIDRA_CAST("CardFronts"), player->_pocketSlots[iVar5 * 2]); uVar4 = 0; isAnyLayerVisible = false; if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0xe4)))) != 0) { do { - pvVar2 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x94)))))))->AnimationState::GetLayerFrame(uVar4); + pvVar2 = AnimationState::GetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x94)))),uVar4); if ((pvVar2 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar2) + 0x2c)) != '\0')) { isAnyLayerVisible = true; } @@ -1377,7 +1377,7 @@ joined_r0x008d4475: } (GHIDRA_CAST((cardAnm2Path._buf)))->msvc::string::string_from_cstr(GHIDRA_CAST(anm2PathChars)); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Load(&cardAnm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))),&cardAnm2Path,1); local_14 = 0xffffffff; if (0xf < cardAnm2Path._capacity) { uVar4 = cardAnm2Path._capacity + 1; @@ -1396,7 +1396,7 @@ joined_r0x008d4475: cardAnm2Path._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(cardAnm2Path._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(cardAnm2Path._buf)) + 0x0))) & 0xffffff00; in_stack_ffffff80 = 0x8d4712; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))))))->ANM2::Play(&DAT_00b6b338,0); + ANM2::Play(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x64)))),&DAT_00b6b338,0); } } } @@ -1407,18 +1407,18 @@ LAB_008d471f: in_stack_ffffff80,0x41f00000,*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x14)))) == 3); uVar3 = InfoDisplayEntry::count_lines(player,player->_pocketSlots[0]); pocketId = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x17c)))); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("PocketArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))),GHIDRA_CAST("PocketArrowUp")); arrowLayer->_visible = 0 < pocketId; uVar4 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x180)))); - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("PocketArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))),GHIDRA_CAST("PocketArrowDown")); arrowLayer->_visible = uVar4 < uVar3; ExceptionList = local_1c; return; } LAB_008d448a: - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("PocketArrowUp")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))),GHIDRA_CAST("PocketArrowUp")); arrowLayer->_visible = 0; - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))))))->ANM2::GetLayer(GHIDRA_CAST("PocketArrowDown")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((entityConfig)) + 0x304)))),GHIDRA_CAST("PocketArrowDown")); arrowLayer->_visible = 0; ExceptionList = local_1c; return; @@ -1635,15 +1635,15 @@ void PauseScreen::constructor() local_10 = ExceptionList; ExceptionList = &local_10; this->_menuType = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c))))); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x140)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x140))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 3; - (GHIDRA_CAST((&(this->_genericPrompt)._sprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_genericPrompt)._sprite); (this->_genericPrompt)._isOnlineVote = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_genericPrompt))) + 0x114)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((this->_genericPrompt))) + 0x118)))) = 0; @@ -1675,7 +1675,7 @@ void PauseScreen::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x890)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x894)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x898)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x89c)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x89c))))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x9b0)))) = 0xffffffff; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x9b4)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x9b8)))) = 0; @@ -1684,17 +1684,17 @@ void PauseScreen::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x9d0)))) = 0xf; (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x9bc))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 10; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x9d4)))))))->Font::Font(); + Font::Font(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x9d4))))); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xa20)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xa24)))) = 0x3f800000; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xb; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xa28)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xa28))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xc; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xb3c)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xb3c))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xd; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc50)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc50))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xe; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd64)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xd64))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0xf; (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe78))))))->KAGE::SmartPointer::SmartPointer((void *)0x0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe80)))) = 0; @@ -1702,14 +1702,14 @@ void PauseScreen::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe88)))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe8c)))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x11; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe94)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe94))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x12; (GHIDRA_CAST((this + 1)))->MenuDialog::constructor(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 0x13; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x268)))) = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x26c)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x26c))))); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),0x14); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x380)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x380))))); pGVar1 = &this[1]._genericPrompt; (pGVar1->_sprite)._animDefaultName._buf[0] = '\0'; (pGVar1->_sprite)._animDefaultName._buf[1] = '\0'; @@ -1750,9 +1750,9 @@ PauseScreen::~PauseScreen() FUN_008d0f10(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U); (GHIDRA_CAST((this + 1)))->MenuDialog::~MenuDialog(); local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe94)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xee4)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xec4)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe94))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xee4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xec4))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xeac))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xe94))))))->msvc::string::_Tidy_deallocate(); local_8 = 1; @@ -1765,33 +1765,33 @@ PauseScreen::~PauseScreen() (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x838))))))->PauseScreen_MyStuff::~PauseScreen_MyStuff(); (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5b0)))))))->Menu_Options::~Menu_Options(); local_8 = 2; - (GHIDRA_CAST((&(this->_genericPrompt)._sprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_genericPrompt)._sprite._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_genericPrompt)._sprite._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&(this->_genericPrompt)._sprite); + AnimationState::~AnimationState(&(this->_genericPrompt)._sprite._overlayAnimState); + AnimationState::~AnimationState(&(this->_genericPrompt)._sprite._animState); (GHIDRA_CAST(((this->_genericPrompt)._sprite._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_genericPrompt))))->msvc::string::_Tidy_deallocate(); local_8 = 3; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3b8)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x398)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x3b8))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x398))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x380))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368))))))->msvc::string::_Tidy_deallocate(); local_8 = 4; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2a4)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x284)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2a4))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x284))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x26c))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254))))))->msvc::string::_Tidy_deallocate(); local_8 = 5; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x140)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x190)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x170)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x140))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x190))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x170))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x140))))))->msvc::string::_Tidy_deallocate(); local_8 = 6; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c)))))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7c)))))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5c)))))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7c))))); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x5c))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x44))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c))))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -1852,7 +1852,7 @@ void PauseScreen::Init() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen.anm2",0x18); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x2c)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x2c)))),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1878,7 +1878,7 @@ void PauseScreen::Init() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen_small.anm2",0x1e); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x140)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x140)))),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1904,7 +1904,7 @@ void PauseScreen::Init() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreenStats.anm2",0x1d); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x254)))))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x254)))),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1931,7 +1931,7 @@ void PauseScreen::Init() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19); local_14 = 3; - (GHIDRA_CAST((GHIDRA_CAST(deathScreenSprite))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(deathScreenSprite),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar4 = anm2Path._capacity + 1; @@ -1972,19 +1972,19 @@ LAB_009b5bd0: LAB_009b5bd5: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || ((*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x3ac))) != '\0')))) goto LAB_009b5c01; } - bVar2 = (GHIDRA_CAST((GHIDRA_CAST(deathScreenSprite))))->ANM2::SetAnimation(GHIDRA_CAST("Diary"),1); + bVar2 = ANM2::SetAnimation(GHIDRA_CAST(deathScreenSprite),GHIDRA_CAST("Diary"),1); if (bVar2 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x398)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x398))))); (*GHIDRA_CAST((GHIDRA_CAST((deathScreenSprite)) + 0x3ac))) = 1; } LAB_009b5c01: pbVar5 = GHIDRA_CAST(0x0); do { - layer = (GHIDRA_CAST((GHIDRA_CAST(deathScreenSprite))))->ANM2::GetLayer(pbVar5); + layer = ANM2::GetLayer(GHIDRA_CAST(deathScreenSprite),pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 0; } while (GHIDRA_INT(pbVar5) < 7); - layer = (GHIDRA_CAST((GHIDRA_CAST(deathScreenSprite))))->ANM2::GetLayer(&DAT_00000006); + layer = ANM2::GetLayer(GHIDRA_CAST(deathScreenSprite),&DAT_00000006); layer->_visible = 1; other = Manager::LoadImage(myStuffImage,GHIDRA_CAST("gfx/ui/menu_mystuff.png")); pPVar1 = pauseScreen; @@ -2345,7 +2345,7 @@ LAB_009b6311: iVar3 = (GHIDRA_CAST((&g_manager->_netplayManager)))->InputManager::FirstLocalDeviceID(); } local_21 = iVar3 == 0; - backKeyLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xb3c)))))))->ANM2::GetLayer(GHIDRA_CAST("BackKey")); + backKeyLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xb3c)))),GHIDRA_CAST("BackKey")); backKeyLayer->_visible = local_21; (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x848))) = 1; local_60 = CONCAT44((*GHIDRA_CAST((GHIDRA_CAST(&(local_60)) + 0x4))),(uint32_t)local_60); @@ -2485,8 +2485,8 @@ void PauseScreen::Render() if (iVar2 != 1) { spriteOffset = 0x2c; } - local_18.x = (float)(GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - spriteOffset + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("Menu Title")); + local_18.x = (float)ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + spriteOffset + -0x47c)),GHIDRA_CAST("Menu Title")); if (GHIDRA_CAST(local_18.x) != GHIDRA_CAST(0x0)) { if ((g_manager->_netplayManager == *GHIDRA_CAST((g_manager + 1))) || ((game->_dailyChallenge)._id != 0)) { @@ -2502,8 +2502,8 @@ void PauseScreen::Render() if (iVar2 != 1) { spriteOffset = 0x2c; } - layer = (GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - spriteOffset + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("SeedPaper")); + layer = ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + spriteOffset + -0x47c)),GHIDRA_CAST("SeedPaper")); if (layer != GHIDRA_CAST(0x0)) { layer->_visible = (game->_dailyChallenge)._id == 0; iVar2 = this->_menuType; @@ -2521,7 +2521,8 @@ void PauseScreen::Render() if (iVar2 != 1) { spriteOffset = 0x2c; } - (GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c)))))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + spriteOffset + -0x47c)), + &renderPos,&g_vectorZero,&g_vectorZero); render_lobby_buttons(this,&renderPos); iVar2 = 0x170; if (this->_menuType != 1) { @@ -2535,16 +2536,16 @@ void PauseScreen::Render() layerName = GHIDRA_CAST(0x0); if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2d4)))) != 0) { do { - targetLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))))))->ANM2::GetLayer(layerName); + targetLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))),layerName); (targetLayer->_pos).x = *GHIDRA_CAST(((layer->_spriteSheetPath)._buf + 8)); (targetLayer->_pos).y = *GHIDRA_CAST(((layer->_spriteSheetPath)._buf + 0xc)); - targetLayer = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))))))->ANM2::GetLayer(layerName); + targetLayer = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))),layerName); layerName = layerName + 1; (targetLayer->_size).x = (float)(layer->_spriteSheetPath)._size; (targetLayer->_size).y = (float)(layer->_spriteSheetPath)._capacity; } while (layerName < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2d4))))); } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))))))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x254)))),&renderPos,&g_vectorZero,&g_vectorZero); } iVar2 = 0x170; render_seed_paper(this,&renderPos); @@ -2657,9 +2658,9 @@ LAB_009b7713: iVar3 = 0x2c; } menuSprite = GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + iVar3 + -0x47c)); - bVar1 = (GHIDRA_CAST((menuSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Appear"),1); + bVar1 = ANM2::SetAnimation(menuSprite,GHIDRA_CAST("Appear"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&menuSprite->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&menuSprite->_animState); (menuSprite->_animState)._isPlaying = 1; } if (g_manager->_netplayManager == *GHIDRA_CAST((g_manager + 1))) { @@ -2734,8 +2735,8 @@ LAB_009b77c7: if (menuType != 1) { iVar3 = 0x2c; } - local_10.x = (float)(GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - iVar3 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("Invite")); + local_10.x = (float)ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + iVar3 + -0x47c)),GHIDRA_CAST("Invite")); if (GHIDRA_CAST(local_10.x) != GHIDRA_CAST(0x0)) { (GHIDRA_CAST(local_10.x))->_visible = g_manager->_netplayManager != *GHIDRA_CAST((g_manager + 1)); menuType = this->_menuType; @@ -2744,8 +2745,8 @@ LAB_009b77c7: if (menuType != 1) { iVar3 = 0x2c; } - local_10.x = (float)(GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - iVar3 + -0x47c)))))->ANM2::GetLayer(&DAT_00b79bb0); + local_10.x = (float)ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + iVar3 + -0x47c)),&DAT_00b79bb0); if (GHIDRA_CAST(local_10.x) != GHIDRA_CAST(0x0)) { if ((g_manager->_netplayManager == *GHIDRA_CAST((g_manager + 1))) || (GHIDRA_UINT((*GHIDRA_CAST((g_manager + 1)) - g_manager->_netplayManager >> 2)) < 2)) { @@ -2760,8 +2761,8 @@ LAB_009b77c7: if (menuType != 1) { iVar2 = 0x2c; } - bloodLayer = (GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - iVar2 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("Blood")); + bloodLayer = ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + iVar2 + -0x47c)),GHIDRA_CAST("Blood")); if (bloodLayer != GHIDRA_CAST(0x0)) { bloodLayer->_visible = g_game->_difficulty == 1; } @@ -2813,7 +2814,7 @@ void PauseScreen::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen.anm2",0x18); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x2c)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 0x2c)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -2839,7 +2840,7 @@ void PauseScreen::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreen_small.anm2",0x1e); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x140)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 0x140)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -2865,7 +2866,7 @@ void PauseScreen::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/PauseScreenStats.anm2",0x1d); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x254)))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST((in_ECX + 0x254)),&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -2893,7 +2894,7 @@ void PauseScreen::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19); local_14 = 3; - (GHIDRA_CAST((diarySprite)))->ANM2::Load(&anm2Path,1); + ANM2::Load(diarySprite,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { uVar3 = anm2Path._capacity + 1; @@ -2911,9 +2912,9 @@ void PauseScreen::load_graphics() curAnimName = *GHIDRA_CAST((in_ECX + 0x39c)); if (curAnimName == GHIDRA_CAST(0x0)) { LAB_009b7d75: - bVar1 = (GHIDRA_CAST((diarySprite)))->ANM2::SetAnimation(GHIDRA_CAST("Diary"),1); + bVar1 = ANM2::SetAnimation(diarySprite,GHIDRA_CAST("Diary"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x398)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((in_ECX + 0x398))); *GHIDRA_CAST((in_ECX + 0x3ac)) = 1; } } @@ -2945,11 +2946,11 @@ LAB_009b7d67: } curAnimName = GHIDRA_CAST(0x0); do { - layer = (GHIDRA_CAST((diarySprite)))->ANM2::GetLayer(curAnimName); + layer = ANM2::GetLayer(diarySprite,curAnimName); curAnimName = curAnimName + 1; layer->_visible = 0; } while (GHIDRA_INT(curAnimName) < 7); - layer = (GHIDRA_CAST((diarySprite)))->ANM2::GetLayer(&DAT_00000006); + layer = ANM2::GetLayer(diarySprite,&DAT_00000006); layer->_visible = 1; image = Manager::LoadImage(loadedImage,GHIDRA_CAST("gfx/ui/menu_mystuff.png")); temp_3f06a66df3 = savedThis; @@ -2976,7 +2977,7 @@ LAB_009b7d67: deathScreenPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(deathScreenPath._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19); local_14 = 6; - (GHIDRA_CAST((diarySprite)))->ANM2::Load(&deathScreenPath,1); + ANM2::Load(diarySprite,&deathScreenPath,1); local_14 = 0xffffffff; if (0xf < deathScreenPath._capacity) { uVar3 = deathScreenPath._capacity + 1; @@ -3021,21 +3022,21 @@ LAB_009b7f08: if ((uVar3 == 0) && ((curAnimName[0x34] == 0 || (*GHIDRA_CAST((temp_3f06a66df3 + 0xc94)) != '\0')))) goto LAB_009b7f34; } - bVar1 = (GHIDRA_CAST((diarySprite)))->ANM2::SetAnimation(GHIDRA_CAST("Diary"),1); + bVar1 = ANM2::SetAnimation(diarySprite,GHIDRA_CAST("Diary"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((temp_3f06a66df3 + 0xc80)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((temp_3f06a66df3 + 0xc80))); *GHIDRA_CAST((temp_3f06a66df3 + 0xc94)) = 1; } LAB_009b7f34: curAnimName = GHIDRA_CAST(0x0); if (*GHIDRA_CAST((savedThis + 0xcd0)) != 0) { do { - layer = (GHIDRA_CAST((diarySprite)))->ANM2::GetLayer(curAnimName); + layer = ANM2::GetLayer(diarySprite,curAnimName); curAnimName = curAnimName + 1; layer->_visible = 0; } while (curAnimName < *GHIDRA_CAST((savedThis + 0xcd0))); } - layer = (GHIDRA_CAST((diarySprite)))->ANM2::GetLayer(GHIDRA_CAST("Items")); + layer = ANM2::GetLayer(diarySprite,GHIDRA_CAST("Items")); layer->_visible = 1; ExceptionList = local_1c; return; @@ -3101,16 +3102,16 @@ LAB_009b8065: if (currentPlayer->_menuType != 1) { iVar3 = 0x2c; } - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + - iVar3 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("StuffArrow1")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + + iVar3 + -0x47c)),GHIDRA_CAST("StuffArrow1")); if (arrowLayer != GHIDRA_CAST(0x0)) { arrowLayer->_visible = 0 < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((currentPlayer)) + 0x24)))); } if (currentPlayer->_menuType != 1) { iVar2 = 0x2c; } - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + - iVar2 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("StuffArrow2")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + + iVar2 + -0x47c)),GHIDRA_CAST("StuffArrow2")); if (arrowLayer != GHIDRA_CAST(0x0)) { arrowLayer->_visible = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((currentPlayer)) + 0x24)))) < maxScroll; return; @@ -3122,8 +3123,8 @@ LAB_009b8065: if (iVar3 != 1) { iVar2 = 0x2c; } - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + - iVar2 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("StuffArrow1")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + + iVar2 + -0x47c)),GHIDRA_CAST("StuffArrow1")); if (arrowLayer != GHIDRA_CAST(0x0)) { arrowLayer->_visible = 0; iVar3 = currentPlayer->_menuType; @@ -3131,8 +3132,8 @@ LAB_009b8065: if (iVar3 != 1) { arrowSpriteOffset = 0x2c; } - arrowLayer = (GHIDRA_CAST((GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + - arrowSpriteOffset + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("StuffArrow2")); + arrowLayer = ANM2::GetLayer(GHIDRA_CAST(((currentPlayer->_genericPrompt)._sprite._filename._buf + + arrowSpriteOffset + -0x47c)),GHIDRA_CAST("StuffArrow2")); if (arrowLayer != GHIDRA_CAST(0x0)) { arrowLayer->_visible = 0; } @@ -3185,7 +3186,8 @@ void PauseScreen::render_seed_paper(Vector *renderOffset) iVar2 = 0x2c; } seedPaperLayer = - (GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("SeedPaper")); + ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c)), + GHIDRA_CAST("SeedPaper")); if (seedPaperLayer != GHIDRA_CAST(0x0)) { if ((g_game->_dailyChallenge)._id == 0) { seedPaperLayer->_visible = 1; @@ -3238,10 +3240,10 @@ void PauseScreen::render_seed_paper(Vector *renderOffset) } memcpy(halfText,psVar1,*psVar3); manager = g_manager; - (GHIDRA_CAST((firstHalfSettings)))->FontSettings::constructor(); + FontSettings::constructor(firstHalfSettings); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); - (GHIDRA_CAST((&manager->_font2_TeamMeatEx12)))->Font::DrawStringScaled(halfText,&firstLinePos,color,settings); + Font::DrawStringScaled(&manager->_font2_TeamMeatEx12,halfText,&firstLinePos,color,settings); local_50 = 4; local_54 = seedStringSize - 4; local_80 = 0; @@ -3272,7 +3274,7 @@ void PauseScreen::render_seed_paper(Vector *renderOffset) halfText[0xf] = 0; memcpy(halfText,psVar1->_buf + 5,*psVar3); manager = g_manager; - (GHIDRA_CAST((secondHalfSettings)))->FontSettings::constructor(); + FontSettings::constructor(secondHalfSettings); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),2); (GHIDRA_CAST((&textColor)))->KColor::SetFromARGB(0xff362f2d); Font::DrawStringScaled @@ -3343,7 +3345,7 @@ void PauseScreen::render_my_stuff(Vector *pos) iVar2 = 0x2c; } local_5c = GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + iVar2 + -0x47c)); - local_4c = (GHIDRA_CAST((GHIDRA_CAST(local_5c))))->ANM2::GetLayer(GHIDRA_CAST("MyStuff")); + local_4c = ANM2::GetLayer(GHIDRA_CAST(local_5c),GHIDRA_CAST("MyStuff")); if (local_4c != GHIDRA_CAST(0x0)) { if (local_4c->_layerData == GHIDRA_CAST(0x0)) { iVar2 = -1; @@ -3357,8 +3359,8 @@ void PauseScreen::render_my_stuff(Vector *pos) if (iVar2 != 1) { iVar3 = 0x2c; } - local_48 = (GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - iVar3 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("StuffArrow1")); + local_48 = ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + iVar3 + -0x47c)),GHIDRA_CAST("StuffArrow1")); if (local_48 != GHIDRA_CAST(0x0)) { menuSprite = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c)))); if (iVar2 == 1) { @@ -3377,7 +3379,7 @@ void PauseScreen::render_my_stuff(Vector *pos) if (iVar2 == 1) { pAVar8 = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x140)))); } - pLVar4 = (GHIDRA_CAST((pAVar8)))->ANM2::GetLayer(GHIDRA_CAST("StuffArrow2")); + pLVar4 = ANM2::GetLayer(pAVar8,GHIDRA_CAST("StuffArrow2")); if (pLVar4 != GHIDRA_CAST(0x0)) { menuSprite = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x2c)))); if (iVar2 == 1) { @@ -3402,7 +3404,7 @@ void PauseScreen::render_my_stuff(Vector *pos) else { iVar2 = *GHIDRA_CAST(local_4c->_layerData); } - pvVar5 = (GHIDRA_CAST((GHIDRA_CAST((puVar9 + 0x30)))))->AnimationState::GetLayerFrame(iVar2); + pvVar5 = AnimationState::GetLayerFrame(GHIDRA_CAST((puVar9 + 0x30)),iVar2); if (pvVar5 != (void *)0x0) { local_58 = GHIDRA_CAST((local_44->x + *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x10)))); local_5c = GHIDRA_CAST((local_44->y + *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x14)))); @@ -3420,14 +3422,14 @@ void PauseScreen::render_my_stuff(Vector *pos) else { iVar2 = *GHIDRA_CAST(local_48->_layerData); } - pvVar5 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x398)))))))->AnimationState::GetLayerFrame(iVar2); + pvVar5 = AnimationState::GetLayerFrame(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x398)))),iVar2); if (pvVar5 != (void *)0x0) { local_4c = *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x10)); local_48 = *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x14)); - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368)))))))->ANM2::GetLayer(&DAT_00000006); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368)))),&DAT_00000006); (pLVar4->_pos).x = -(float)local_4c; (pLVar4->_pos).y = -(float)local_48; - pLVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368)))))))->ANM2::GetLayer(&DAT_00000006); + pLVar4 = ANM2::GetLayer(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x368)))),&DAT_00000006); (pLVar4->_size).x = scaleX; (pLVar4->_size).y = scaleY; } @@ -3694,7 +3696,7 @@ LAB_009b8afd: in_stack_ffffff74 = 0x9b8ba1; pos_00.y = in_stack_ffffff80; pos_00.x = in_stack_ffffff7c; - (GHIDRA_CAST((&manager->_font1_TeamMeatEx10)))->Font::DrawString(GHIDRA_CAST(&DAT_00b1bddc),pos_00, + Font::DrawString(&manager->_font1_TeamMeatEx10,GHIDRA_CAST(&DAT_00b1bddc),pos_00, (Vector)0x3f19999a3f19999a,color_00,GHIDRA_CAST(&fontSettings)); local_14 = 0xffffffff; } @@ -3705,8 +3707,8 @@ LAB_009b8afd: if (this->_menuType != 1) { iVar3 = 0x2c; } - buttonLayer = (GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - iVar3 + -0x47c)))))->ANM2::GetLayer(GHIDRA_CAST("Invite")); + buttonLayer = ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + iVar3 + -0x47c)),GHIDRA_CAST("Invite")); iVar3 = 0x170; if (buttonLayer->_visible != 0) { iVar2 = 0x174; @@ -3751,8 +3753,8 @@ LAB_009b8afd: if (this->_menuType != 1) { iVar2 = 0x2c; } - buttonLayer = (GHIDRA_CAST((GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + - iVar2 + -0x47c)))))->ANM2::GetLayer(&DAT_00b79bb0); + buttonLayer = ANM2::GetLayer(GHIDRA_CAST(((this->_genericPrompt)._sprite._filename._buf + + iVar2 + -0x47c)),&DAT_00b79bb0); if (buttonLayer->_visible != 0) { iVar2 = 0x174; if (this->_menuType != 1) { diff --git a/generated-src/pause_screen_my_stuff.cpp b/generated-src/pause_screen_my_stuff.cpp index cf11b45..eb6c222 100644 --- a/generated-src/pause_screen_my_stuff.cpp +++ b/generated-src/pause_screen_my_stuff.cpp @@ -38,34 +38,34 @@ PauseScreen_MyStuff::~PauseScreen_MyStuff() } } local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x52c)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x57c)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x55c)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x52c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x57c))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x55c))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x544)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x52c)))))->msvc::string::_Tidy_deallocate(); local_8 = 2; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x418)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x468)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x448)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x418))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x468))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x448))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x430)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x418)))))->msvc::string::_Tidy_deallocate(); local_8 = 3; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x304)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x354)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x334)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x304))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x354))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x334))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x31c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x304)))))->msvc::string::_Tidy_deallocate(); local_8 = 4; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x1f0)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x240)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x220)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x1f0))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x240))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x220))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x208)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x1f0)))))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST(((void *)(GHIDRA_INT(this) + 0x184))))->RichText::~RichText(); + RichText::~RichText((void *)(GHIDRA_INT(this) + 0x184)); local_8 = 5; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 100)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0xb4)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x94)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 100))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0xb4))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x94))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x7c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 100)))))->msvc::string::_Tidy_deallocate(); local_8 = 6; @@ -125,7 +125,7 @@ void PauseScreen_MyStuff::Init() filePath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(filePath._buf))) + 0x0))),"font/TeamMeatEx/TeamMeatEx12.fnt",0x21); local_14 = 0; - (GHIDRA_CAST(((void *)(GHIDRA_INT(this) + 0x184))))->RichText::load_font(&filePath); + RichText::load_font((void *)(GHIDRA_INT(this) + 0x184),&filePath); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; @@ -153,7 +153,7 @@ void PauseScreen_MyStuff::Init() filePath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(filePath._buf))) + 0x0))),"gfx/ui/PauseScreen_MyStuff.anm2",0x20); local_14 = 1; - (GHIDRA_CAST((sprite)))->ANM2::Load(&filePath,1); + ANM2::Load(sprite,&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; @@ -171,9 +171,9 @@ void PauseScreen_MyStuff::Init() pbVar5 = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x338)); if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_008d2e85: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(sprite,s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x334)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x334))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x348)) = 1; } } @@ -203,7 +203,7 @@ LAB_008d2e77: if ((uVar4 != 0) || ((pbVar5[0x34] != 0 && (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x348)) == '\0')))) goto LAB_008d2e85; } - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Cursor")); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST("Cursor")); selfRef = self; sprite = GHIDRA_CAST((GHIDRA_INT(self) + 0x418)); filePath._size = 0; @@ -218,7 +218,7 @@ LAB_008d2e77: filePath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(filePath._buf))) + 0x0))),"gfx/ui/Death Screen.anm2",0x19); local_14 = 2; - (GHIDRA_CAST((sprite)))->ANM2::Load(&filePath,1); + ANM2::Load(sprite,&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; @@ -236,9 +236,9 @@ LAB_008d2e77: pbVar5 = *GHIDRA_CAST((GHIDRA_CAST(selfRef) + 0x44c)); if (pbVar5 == GHIDRA_CAST(0x0)) { LAB_008d2fa5: - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Diary"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("Diary"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(selfRef) + 0x448)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(selfRef) + 0x448))); *GHIDRA_CAST((GHIDRA_CAST(selfRef) + 0x45c)) = 1; } } @@ -271,12 +271,12 @@ LAB_008d2f97: pbVar5 = GHIDRA_CAST(0x0); if (*GHIDRA_CAST((GHIDRA_CAST(self) + 0x498)) != 0) { do { - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(pbVar5); + layer = ANM2::GetLayer(sprite,pbVar5); pbVar5 = pbVar5 + 1; layer->_visible = 0; } while (pbVar5 < *GHIDRA_CAST((GHIDRA_CAST(self) + 0x498))); } - layer = (GHIDRA_CAST((sprite)))->ANM2::GetLayer(GHIDRA_CAST("Items")); + layer = ANM2::GetLayer(sprite,GHIDRA_CAST("Items")); selfRef = self; sprite = GHIDRA_CAST((GHIDRA_INT(self) + 0x52c)); filePath._size = 0; @@ -291,7 +291,7 @@ LAB_008d2f97: filePath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(filePath._buf))) + 0x0))),"gfx/ui/ui_charge_icons.anm2",0x1c); local_14 = 3; - (GHIDRA_CAST((sprite)))->ANM2::Load(&filePath,1); + ANM2::Load(sprite,&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; @@ -333,9 +333,9 @@ LAB_008d30f5: if ((uVar4 == 0) && ((pbVar5[0x34] == 0 || (*GHIDRA_CAST((GHIDRA_CAST(selfRef) + 0x570)) != '\0')))) goto LAB_008d3121; } - bVar1 = (GHIDRA_CAST((sprite)))->ANM2::SetAnimation(GHIDRA_CAST("ChargeIcon"),1); + bVar1 = ANM2::SetAnimation(sprite,GHIDRA_CAST("ChargeIcon"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(selfRef) + 0x55c)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(selfRef) + 0x55c))); *GHIDRA_CAST((GHIDRA_CAST(selfRef) + 0x570)) = 1; } LAB_008d3121: @@ -351,7 +351,7 @@ LAB_008d3121: filePath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(filePath._buf))) + 0x0))),"gfx/ui/minimap_icons.anm2",0x1a); local_14 = 4; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(selfRef) + 0x1f0)))))->ANM2::Load(&filePath,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(selfRef) + 0x1f0)),&filePath,1); local_14 = 0xffffffff; if (0xf < filePath._capacity) { uVar4 = filePath._capacity + 1; diff --git a/generated-src/player_hud.cpp b/generated-src/player_hud.cpp index 205e413..d47eea9 100644 --- a/generated-src/player_hud.cpp +++ b/generated-src/player_hud.cpp @@ -14,7 +14,7 @@ void PlayerHUD::set_active_charge_frame(int collectibleId, Entity_Player *player if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(8.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),8.0); return; } item = (GHIDRA_CAST((&g_manager->_itemConfig)))->ItemConfig::GetCollectible(collectibleId); @@ -29,13 +29,13 @@ void PlayerHUD::set_active_charge_frame(int collectibleId, Entity_Player *player if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(7.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),7.0); return; } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(6.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),6.0); return; } iVar1 = item->maxCharges; @@ -43,14 +43,14 @@ void PlayerHUD::set_active_charge_frame(int collectibleId, Entity_Player *player if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(5.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),5.0); return; } if (iVar1 == 6) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(4.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),4.0); return; } if (iVar1 != 4) { @@ -58,34 +58,34 @@ void PlayerHUD::set_active_charge_frame(int collectibleId, Entity_Player *player if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(2.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),2.0); return; } if (iVar1 == 2) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),1.0); return; } if (iVar1 != 1) { if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(7.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),7.0); return; } if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),0.0); return; } LAB_00840055: if (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x158)))) == 0) { return; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))))))->AnimationState::SetFrameFloat(3.0); + AnimationState::SetFrameFloat(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x154)))),3.0); return; } @@ -1012,10 +1012,10 @@ LAB_008430a9: pocketEntityConfig = (GHIDRA_CAST((&g_manager->_entityConfig)))->EntityConfig::GetEntity(5,iVar11,iVar8); } if (pocketEntityConfig == GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((hud)) + 0x238))) + GHIDRA_INT(local_1430))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((hud)) + 0x238))) + GHIDRA_INT(local_1430)))); } else { - (GHIDRA_CAST((GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((hud)) + 0x238))) + GHIDRA_INT(local_1430))))))->ANM2::Load(&pocketEntityConfig->anm2Path,1); + ANM2::Load(GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((hud)) + 0x238))) + GHIDRA_INT(local_1430))),&pocketEntityConfig->anm2Path,1); } *GHIDRA_CAST((GHIDRA_INT(&local_1430->_fearCountdown) + GHIDRA_INT(hud))) = local_1438; *GHIDRA_CAST((GHIDRA_INT(&local_1430->_burnCountdown) + GHIDRA_INT(hud))) = iVar8; @@ -1676,7 +1676,7 @@ void PlayerHUD::render_inventory(Vector *pos, float scale) fVar6 = iconSize * 0.25; } else { - dotLayer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this->_HUD) + 22000)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + dotLayer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(this->_HUD) + 22000)),GHIDRA_CAST(0x0)); local_68 = iconSize * 0.25; (dotLayer->_color)._tint[3] = 0.5; pvVar1 = this->_HUD; @@ -1896,10 +1896,10 @@ LAB_0084959e: craftSlots = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6a0)))); if (((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6a4)))) - GHIDRA_INT(craftSlots)) / 0xc < 1) || ((local_7c = GHIDRA_CAST((craftSlots + 1)), craftSlots[1] == 0 && (-1 < *craftSlots)))) { - isAnimationSet = (GHIDRA_CAST((craftingSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Result"),1); + isAnimationSet = ANM2::SetAnimation(craftingSprite,GHIDRA_CAST("Result"),1); unusedArg = extraout_ECX_04; if ((isAnimationSet != 0) && ((craftingSprite->_animState)._animData != (void *)0x0)) { - (GHIDRA_CAST((&craftingSprite->_animState)))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(&craftingSprite->_animState,1.0); unusedArg = extraout_ECX_05; if (*GHIDRA_CAST((hud + 0x5738)) != 0) { (craftingSprite->_animState)._isPlaying = 0; @@ -1955,9 +1955,9 @@ LAB_0084959e: } } else { - isAnimationSet = (GHIDRA_CAST((craftingSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Result"),1); + isAnimationSet = ANM2::SetAnimation(craftingSprite,GHIDRA_CAST("Result"),1); if ((isAnimationSet != 0) && ((craftingSprite->_animState)._animData != (void *)0x0)) { - (GHIDRA_CAST((&craftingSprite->_animState)))->AnimationState::SetFrameFloat(1.0); + AnimationState::SetFrameFloat(&craftingSprite->_animState,1.0); if ((craftingSprite->_animState)._animData != (void *)0x0) { (craftingSprite->_animState)._isPlaying = 0; } @@ -2196,11 +2196,11 @@ LAB_0084959e: } renderPos.y = local_6c + local_6c + savedPos->y; renderPos.x = ((-26.0 - (float)(GHIDRA_INT(pPVar5) * 0xc + -0xc)) + 8.0) * local_6c + savedPos->x; - isAnimationSet = (GHIDRA_CAST((craftingSprite)))->ANM2::SetAnimation(s_Idle,1); + isAnimationSet = ANM2::SetAnimation(craftingSprite,s_Idle,1); unusedArg = extraout_ECX_01; if ((isAnimationSet != 0) && (unusedArg = extraout_ECX_01, (craftingSprite->_animState)._animData != (void *)0x0)) { - (GHIDRA_CAST((&craftingSprite->_animState)))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(&craftingSprite->_animState,0.0); unusedArg = hud; if (*GHIDRA_CAST((hud + 0x5738)) != 0) { (craftingSprite->_animState)._isPlaying = 0; @@ -2226,9 +2226,9 @@ LAB_0084959e: else { local_70 = this + 1; if (this[1]._player == (void *)0x0) { - isAnimationSet = (GHIDRA_CAST((craftingSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Result"),1); + isAnimationSet = ANM2::SetAnimation(craftingSprite,GHIDRA_CAST("Result"),1); if ((isAnimationSet != 0) && (*GHIDRA_CAST((puVar11 + 0x5738)) != 0)) { - (GHIDRA_CAST((GHIDRA_CAST((puVar11 + 0x5734)))))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(GHIDRA_CAST((puVar11 + 0x5734)),0.0); if (*GHIDRA_CAST((hud + 0x5738)) != 0) { puVar11[0x5748] = 0; } @@ -2248,7 +2248,7 @@ LAB_0084959e: *GHIDRA_CAST((puVar11 + 0x57b8)) = 0x3f000000; *GHIDRA_CAST((puVar11 + 0x57d4)) = 0; } - (GHIDRA_CAST((craftingSprite)))->ANM2::Render(pos,&g_vectorZero,&g_vectorZero); + ANM2::Render(craftingSprite,pos,&g_vectorZero,&g_vectorZero); (GHIDRA_CAST((&tmpColor)))->Color::Color(); if (GHIDRA_CAST((puVar11 + 0x57ac)) != extraout_EAX_02) { uVar1 = extraout_EAX_02[1]; @@ -2270,14 +2270,14 @@ LAB_0084959e: } } else { - isAnimationSet = (GHIDRA_CAST((craftingSprite)))->ANM2::SetAnimation(GHIDRA_CAST("Result"),1); + isAnimationSet = ANM2::SetAnimation(craftingSprite,GHIDRA_CAST("Result"),1); if ((isAnimationSet != 0) && (*GHIDRA_CAST((puVar11 + 0x5738)) != 0)) { - (GHIDRA_CAST((GHIDRA_CAST((puVar11 + 0x5734)))))->AnimationState::SetFrameFloat(0.0); + AnimationState::SetFrameFloat(GHIDRA_CAST((puVar11 + 0x5734)),0.0); if (*GHIDRA_CAST((hud + 0x5738)) != 0) { puVar11[0x5748] = 0; } } - (GHIDRA_CAST((craftingSprite)))->ANM2::Render(pos,&g_vectorZero,&g_vectorZero); + ANM2::Render(craftingSprite,pos,&g_vectorZero,&g_vectorZero); scratchVec.x = (float)&DAT_42000000; scratchVec.y = (float)&DAT_42000000; renderPos.x = (pos->x + (g_game->_screenShakeOffset).x) - local_6c * 16.0; @@ -2346,9 +2346,9 @@ LAB_0084959e: local_6c + pos->y; bagSlotPos.x = local_9c; bagSlotPos.y = local_98; - isAnimationSet = (GHIDRA_CAST((craftingSprite)))->ANM2::SetAnimation(s_Idle,1); + isAnimationSet = ANM2::SetAnimation(craftingSprite,s_Idle,1); if ((isAnimationSet != 0) && (*GHIDRA_CAST((puVar11 + 0x5738)) != 0)) { - (GHIDRA_CAST((GHIDRA_CAST((puVar11 + 0x5734)))))->AnimationState::SetFrameFloat((float)GHIDRA_INT(local_7c)); + AnimationState::SetFrameFloat(GHIDRA_CAST((puVar11 + 0x5734)),(float)GHIDRA_INT(local_7c)); if (*GHIDRA_CAST((hud + 0x5738)) != 0) { puVar11[0x5748] = 0; } @@ -2474,9 +2474,9 @@ void PlayerHUD::RenderSpellQueue(Vector *pos, float scale) *GHIDRA_CAST((GHIDRA_CAST(hud) + 0x58cc)) = slotAlpha; if (slot == 0) { spellFrame = *GHIDRA_CAST((GHIDRA_CAST(playerHud->_player) + 0x1f58)); - isAnimSet = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(hud) + 0x5818)))))->ANM2::SetAnimation(s_Idle,1); + isAnimSet = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(hud) + 0x5818)),s_Idle,1); if (((isAnimSet != 0) && (*GHIDRA_CAST((GHIDRA_CAST(hud) + 0x584c)) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(hud) + 0x5848)))))->AnimationState::SetFrameFloat((float)spellFrame), + (AnimationState::SetFrameFloat(GHIDRA_CAST((GHIDRA_INT(hud) + 0x5848)),(float)spellFrame), *GHIDRA_CAST((GHIDRA_CAST(hud) + 0x584c)) != 0)) { *GHIDRA_CAST((GHIDRA_CAST(hud) + 0x585c)) = 0; } @@ -2567,9 +2567,9 @@ LAB_0084a744: else { spellFrame = 0; } - isAnimSet = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(hud) + 0x5818)))))->ANM2::SetAnimation(GHIDRA_CAST("IdleSmall"),1); + isAnimSet = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(hud) + 0x5818)),GHIDRA_CAST("IdleSmall"),1); if (((isAnimSet != 0) && (*GHIDRA_CAST((GHIDRA_CAST(hud) + 0x584c)) != 0)) && - ((GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(hud) + 0x5848)))))->AnimationState::SetFrameFloat((float)spellFrame), + (AnimationState::SetFrameFloat(GHIDRA_CAST((GHIDRA_INT(hud) + 0x5848)),(float)spellFrame), *GHIDRA_CAST((GHIDRA_CAST(hudCopy) + 0x584c)) != 0)) { *GHIDRA_CAST((GHIDRA_CAST(hud) + 0x585c)) = 0; } diff --git a/generated-src/popup.cpp b/generated-src/popup.cpp index 7268c71..a5f7225 100644 --- a/generated-src/popup.cpp +++ b/generated-src/popup.cpp @@ -1323,7 +1323,7 @@ LAB_009c2c9c: lineHeight = (float)*GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(this) + 4)) + 0x14)) * *GHIDRA_CAST((GHIDRA_CAST(this) + 0x10)); if (lineRecord != linesEnd) { do { - iVar1 = (GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(this) + 4)))))->Font::get_string_width_n(GHIDRA_CAST(*lineRecord),-1); + iVar1 = Font::get_string_width_n(*GHIDRA_CAST((GHIDRA_CAST(this) + 4)),GHIDRA_CAST(*lineRecord),-1); if (fVar7 <= (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)])) { fVar7 = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); } @@ -1346,7 +1346,7 @@ LAB_009c2c9c: if (lineRecord != linesEnd) { fVar7 = 0.5; do { - lineWidth = (GHIDRA_CAST((*GHIDRA_CAST((GHIDRA_CAST(this) + 4)))))->Font::get_string_width_n(GHIDRA_CAST(*lineRecord),-1); + lineWidth = Font::get_string_width_n(*GHIDRA_CAST((GHIDRA_CAST(this) + 4)),GHIDRA_CAST(*lineRecord),-1); iVar1 = lineRecord[0xb]; if (iVar1 == 0) { fVar8 = *GHIDRA_CAST((GHIDRA_CAST(this) + 8)); diff --git a/generated-src/popup_buttons.cpp b/generated-src/popup_buttons.cpp index 982ae6c..68cf8f9 100644 --- a/generated-src/popup_buttons.cpp +++ b/generated-src/popup_buttons.cpp @@ -78,7 +78,7 @@ void PopupButtons::load_graphics() anm2Path._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(anm2Path._buf))) + 0x0))),"gfx/ui/ButtonPromptWidget.anm2",0x1f); local_14 = 0; - this->ANM2::Load(&anm2Path,1); + ANM2::Load(this,&anm2Path,1); local_14 = 0xffffffff; if (0xf < anm2Path._capacity) { size = anm2Path._capacity + 1; @@ -123,9 +123,9 @@ LAB_00423bf3: if ((uVar3 == 0) && ((animData[0x34] == 0 || ((in_ECX->_animState)._isPlaying != 0)))) goto LAB_00423c1f; } - bVar1 = (GHIDRA_CAST((in_ECX)))->ANM2::SetAnimation(GHIDRA_CAST("LeftPrompt"),1); + bVar1 = ANM2::SetAnimation(in_ECX,GHIDRA_CAST("LeftPrompt"),1); if (bVar1 != 0) { - (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&in_ECX->_animState); (in_ECX->_animState)._isPlaying = 1; } LAB_00423c1f: @@ -164,9 +164,9 @@ LAB_00423c5d: } } } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((in_ECX[1]._animDefaultName._buf + 4)))))->ANM2::SetAnimation(GHIDRA_CAST("RightPrompt"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((in_ECX[1]._animDefaultName._buf + 4)),GHIDRA_CAST("RightPrompt"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&in_ECX[1]._animState._previouslyTriggeredEvents))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&in_ECX[1]._animState._previouslyTriggeredEvents)); *GHIDRA_CAST(&in_ECX[1]._overlayAnimState._animFrame) = 1; } ExceptionList = local_1c; @@ -243,12 +243,12 @@ void PopupButtons::Render() buttonIndex = 0; do { uVar2 = buttonIndex; - textLayer = (GHIDRA_CAST((GHIDRA_CAST((piVar5 + -0x47)))))->ANM2::GetLayer(&DAT_00b1c208); + textLayer = ANM2::GetLayer(GHIDRA_CAST((piVar5 + -0x47)),&DAT_00b1c208); if (textLayer == GHIDRA_CAST(0x0)) { KAGE_LogMessage(4,GHIDRA_CAST("[warn] no layer named %s\n")); } else { - (GHIDRA_CAST((GHIDRA_CAST((piVar5 + -0x47)))))->ANM2::SetLayerFrame(*GHIDRA_CAST(textLayer->_layerData),*piVar5); + ANM2::SetLayerFrame(GHIDRA_CAST((piVar5 + -0x47)),*GHIDRA_CAST(textLayer->_layerData),*piVar5); } piVar5[-0x20] = GHIDRA_INT(buttonScale); piVar5[-0x1f] = GHIDRA_INT(buttonScale); @@ -300,7 +300,7 @@ void PopupButtons::Render() else { str = GHIDRA_CAST((**(code **)(*piVar1 + 0x10))(iVar4)); } - (GHIDRA_CAST((font)))->Font::DrawString(str,textPos,&textScale,&textColor,&textSettings); + Font::DrawString(font,str,textPos,&textScale,&textColor,&textSettings); } else { fVar6 = buttonScale * 1.5; diff --git a/generated-src/popup_window.cpp b/generated-src/popup_window.cpp index bee9a69..67b8784 100644 --- a/generated-src/popup_window.cpp +++ b/generated-src/popup_window.cpp @@ -95,12 +95,12 @@ LAB_009b7585: if (*GHIDRA_CAST((GHIDRA_CAST(this) + 4)) != 1) { iVar1 = 0x2c; } - (GHIDRA_CAST((GHIDRA_CAST((iVar1 + GHIDRA_INT(this))))))->ANM2::Play(GHIDRA_CAST("Dissapear"),0); + ANM2::Play(GHIDRA_CAST((iVar1 + GHIDRA_INT(this))),GHIDRA_CAST("Dissapear"),0); iVar1 = 400; if (*GHIDRA_CAST((GHIDRA_CAST(this) + 4)) != 1) { iVar1 = 0x7c; } - (GHIDRA_CAST((GHIDRA_CAST((iVar1 + GHIDRA_INT(this))))))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((iVar1 + GHIDRA_INT(this))),(void *)0x0); } return; } diff --git a/generated-src/rail_manager.cpp b/generated-src/rail_manager.cpp index e14dd1a..a8665f0 100644 --- a/generated-src/rail_manager.cpp +++ b/generated-src/rail_manager.cpp @@ -15,9 +15,9 @@ void RailManager::Render(Vector *offset) Vector renderPos; int gridWidth; - bVar1 = (GHIDRA_CAST((&frontAnimState->_sprite)))->ANM2::SetAnimation(&DAT_00b804d8,1); + bVar1 = ANM2::SetAnimation(&frontAnimState->_sprite,&DAT_00b804d8,1); if (((bVar1 != 0) && ((frontAnimState->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(frontAnimState->_sprite)._animState)))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(&(frontAnimState->_sprite)._animState,0.0), (frontAnimState->_sprite)._animState._animData != (void *)0x0)) { (frontAnimState->_sprite)._animState._isPlaying = 0; } @@ -40,7 +40,7 @@ LAB_009e2fd2: if ((frontAnimState->_sprite)._animState._animData != (void *)0x0) { bVar1 = bVar1 & 0xf; LAB_009e2fe1: - (GHIDRA_CAST((&(frontAnimState->_sprite)._animState)))->AnimationState::SetFrameFloat((float)bVar1); + AnimationState::SetFrameFloat(&(frontAnimState->_sprite)._animState,(float)bVar1); } } gridWidth = *GHIDRA_CAST((GHIDRA_CAST(frontAnimState->_room) + 0xc)); diff --git a/generated-src/revive_player_menu.cpp b/generated-src/revive_player_menu.cpp index d4508da..bd4e215 100644 --- a/generated-src/revive_player_menu.cpp +++ b/generated-src/revive_player_menu.cpp @@ -11,15 +11,15 @@ RevivePlayerMenu::~RevivePlayerMenu() local_10 = ExceptionList; ExceptionList = &local_10; local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x124)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x174)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x154)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x124))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x174))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x154))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x13c)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x124)))))->msvc::string::_Tidy_deallocate(); local_8 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x10)))))->ANM2::Reset(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x60)))))->AnimationState::~AnimationState(); - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x40)))))->AnimationState::~AnimationState(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(this) + 0x10))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x60))); + AnimationState::~AnimationState(GHIDRA_CAST((GHIDRA_INT(this) + 0x40))); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x28)))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x10)))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_10; @@ -60,7 +60,7 @@ void RevivePlayerMenu::Init() menuAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(menuAnmPath._buf))) + 0x0))),"gfx/ui/Menu_RevivePlayer.anm2",0x1e); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x10)))))->ANM2::Load(&menuAnmPath,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x10)),&menuAnmPath,1); local_14 = 0xffffffff; if (0xf < menuAnmPath._capacity) { uVar3 = menuAnmPath._capacity + 1; @@ -78,9 +78,9 @@ void RevivePlayerMenu::Init() curAnim = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x44)); if (curAnim == GHIDRA_CAST(0x0)) { LAB_008ef6a3: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x10)))))->ANM2::SetAnimation(GHIDRA_CAST("Background"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x10)),GHIDRA_CAST("Background"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x40)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x40))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x54)) = 1; } } @@ -121,7 +121,7 @@ LAB_008ef695: selectorAnmPath._capacity = 0x2f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(selectorAnmPath._buf))) + 0x0))),"gfx/ui/RevivePlayer_Selector.anm2",0x22); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x124)))))->ANM2::Load(&selectorAnmPath,1); + ANM2::Load(GHIDRA_CAST((GHIDRA_INT(this) + 0x124)),&selectorAnmPath,1); local_14 = 0xffffffff; if (0xf < selectorAnmPath._capacity) { uVar3 = selectorAnmPath._capacity + 1; @@ -166,9 +166,9 @@ LAB_008ef7c5: if ((uVar3 == 0) && ((curAnim[0x34] == 0 || (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x168)) != '\0')))) goto LAB_008ef7f1; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x124)))))->ANM2::SetAnimation(GHIDRA_CAST("UpperSelector"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((GHIDRA_INT(this) + 0x124)),GHIDRA_CAST("UpperSelector"),1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x154)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((GHIDRA_INT(this) + 0x154))); *GHIDRA_CAST((GHIDRA_CAST(this) + 0x168)) = 1; } LAB_008ef7f1: @@ -214,20 +214,20 @@ void RevivePlayerMenu::Render() if (((*in_ECX == 1) && (iVar1 != 0)) && ((game->_hud)._isVisible != 0)) { textPos.x = g_screenWidth * 0.5; textPos.y = g_screenHeight * 0.5; - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 4)))))->ANM2::Render(&textPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST((in_ECX + 4)),&textPos,&g_vectorZero,&g_vectorZero); manager = g_manager; - iVar1 = (GHIDRA_CAST((&g_manager->_font2_TeamMeatEx12)))->Font::get_string_width_n(GHIDRA_CAST("REVIVE PLAYER"),-1); + iVar1 = Font::get_string_width_n(&g_manager->_font2_TeamMeatEx12,GHIDRA_CAST("REVIVE PLAYER"),-1); local_18.y = (float)((double)iVar1 + __uint_to_double_fixup[-(iVar1 >> 0x1f)]); if (in_ECX[0x11] == 0) { nullFrame = GHIDRA_CAST(0x0); } else { - nullFrame = (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x10)))))->AnimationState::GetNullFrame(GHIDRA_CAST("Title")); + nullFrame = AnimationState::GetNullFrame(GHIDRA_CAST((in_ECX + 0x10)),GHIDRA_CAST("Title")); manager = g_manager; } textPos.y = textPos.y + nullFrame[1]; textPos.x = (textPos.x + *nullFrame) - local_18.y * 0.5; - (GHIDRA_CAST((fontSettings)))->FontSettings::constructor(); + FontSettings::constructor(fontSettings); local_8 = 0; (GHIDRA_CAST((&white)))->KColor::SetFromARGB(0xffffffff); Font::DrawStringScaled @@ -252,8 +252,8 @@ void RevivePlayerMenu::Render() local_18.y = local_18.y + 65.0; anim = "UpperSelector"; } - (GHIDRA_CAST((GHIDRA_CAST((menu + 0x49)))))->ANM2::Play(GHIDRA_CAST(anim),0); - (GHIDRA_CAST((GHIDRA_CAST((menu + 0x49)))))->ANM2::Render(&local_18,&g_vectorZero,&g_vectorZero); + ANM2::Play(GHIDRA_CAST((menu + 0x49)),GHIDRA_CAST(anim),0); + ANM2::Render(GHIDRA_CAST((menu + 0x49)),&local_18,&g_vectorZero,&g_vectorZero); } ExceptionList = local_10; return; diff --git a/generated-src/rich_text.cpp b/generated-src/rich_text.cpp deleted file mode 100644 index 31d5313..0000000 --- a/generated-src/rich_text.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "classes.h" - -// 009efa10 -RichText::~RichText() -{ - uint32_t *this_00; - int iVar1; - int iVar2; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - ANM2 *iconSprite; - char *imageMap; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b0feb0; - local_10 = ExceptionList; - ExceptionList = &local_10; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x18)))))->Font::Unload(); - iVar1 = *GHIDRA_CAST((GHIDRA_CAST(this) + 100)); - if (iVar1 != 0) { - iVar2 = *GHIDRA_CAST((iVar1 + 0x120)); - msvc::map::_Erase_tree(iVar1 + 0x120,*GHIDRA_CAST((iVar2 + 4))); - *GHIDRA_CAST((iVar2 + 4)) = iVar2; - *GHIDRA_CAST(iVar2) = iVar2; - *GHIDRA_CAST((iVar2 + 8)) = iVar2; - *GHIDRA_CAST((iVar1 + 0x124)) = 0; - iconSprite = *GHIDRA_CAST((GHIDRA_CAST(this) + 100)); - if (iconSprite != GHIDRA_CAST(0x0)) { - imageMap = iconSprite[1]._filename._buf + 0xc; - local_8 = 0; - iVar1 = *GHIDRA_CAST(imageMap); - msvc::map::_Erase_tree(imageMap,*GHIDRA_CAST((iVar1 + 4))); - *GHIDRA_CAST((iVar1 + 4)) = iVar1; - *GHIDRA_CAST(iVar1) = iVar1; - *GHIDRA_CAST((iVar1 + 8)) = iVar1; - iconSprite[1]._filename._size = 0; - (GHIDRA_CAST((iconSprite)))->ANM2::Reset(); - msvc::map::_Erase_tree(imageMap,*GHIDRA_CAST((*GHIDRA_CAST(imageMap) + 4))); - operator_delete(*(void **)imageMap,0x1c); - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); - (GHIDRA_CAST((iconSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&iconSprite->_overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&iconSprite->_animState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST(((iconSprite->_animDefaultName)._buf)))->msvc::string::_Tidy_deallocate(); - (GHIDRA_CAST((GHIDRA_CAST(iconSprite))))->msvc::string::_Tidy_deallocate(); - operator_delete(iconSprite,0x128); - *GHIDRA_CAST((GHIDRA_CAST(this) + 100)) = 0; - } - } - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x18)))))->Font::Unload(); - this_00 = GHIDRA_CAST((GHIDRA_INT(this) + 0x58)); - FID_conflict__Erase_tree_>_> - (this_00,(fuzzer_allocator_> *)this_00, - *(_Tree_node **)(*GHIDRA_CAST((GHIDRA_CAST(this) + 0x58)) + 4)); - operator_delete((void *)*this_00,0x18); - FUN_004b3950(); - this->msvc::string::_Tidy_deallocate(); - ExceptionList = local_10; - return; -} diff --git a/generated-src/rich_text_icon.cpp b/generated-src/rich_text_icon.cpp deleted file mode 100644 index 70b1106..0000000 --- a/generated-src/rich_text_icon.cpp +++ /dev/null @@ -1,487 +0,0 @@ -#include "classes.h" - -// 009f24b0 -void RichTextIcon::render(Vector *pos, int iconType, int iconId, float alpha) -{ - void *imageMap = this; - float r; - Vector *pVVar1; - int *imageSlot; - uint8_t *shader; - ColorMod *color; - uint32_t *imagePtr; - ColorMod *color_00; - LayerState *layer; - int layerId; - uint32_t size; - float fVar2; - float in_XMM2_Da; - uint8_t auStackY_1a8 [128]; - void *pvVar3; - Vector *image; - void *imageRefCount; - uint8_t quad [112]; - Color local_a0; - KColor tintColor; - Vector local_60; - void *savedImageMap; - Vector *local_54; - uint8_t local_50 [40]; - float local_28; - uint32_t local_24; - uint8_t *puStack_20; - void *local_1c; - uint8_t *puStack_18; - uint32_t local_14; - void *imageMap; - - puStack_20 = local_50 + 0x4c; - local_14 = 0xffffffff; - puStack_18 = &LAB_00b100ed; - local_1c = ExceptionList; - local_24 = __security_cookie ^ GHIDRA_UINT((local_50 + 0x40)); - ExceptionList = &local_1c; - local_54 = pos; - set_icon(); - if (iconType == 2) { - imageMap = (void *)(GHIDRA_INT(imageMap) + 0x120); - pvVar3 = (void *)0x9f2522; - savedImageMap = imageMap; - imageSlot = map_int_ImagePtr_subscript(imageMap,&iconId); - if (*imageSlot != 0) { - shader = &g_shaders; - if ((DAT_00c7911c & 1) == 0) { - shader = g_currentShader; - } - g_currentShader = shader; - if (0.0 < *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0x114))) { - pvVar3 = (void *)0x9f2563; - imageSlot = map_int_ImagePtr_subscript(imageMap,&iconId); - fVar2 = (float)((double)*GHIDRA_CAST((*imageSlot + 0x14)) + - __uint_to_double_fixup[-(*GHIDRA_CAST((*imageSlot + 0x14)) >> 0x1f)]); - if (*GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0x114)) <= fVar2 && fVar2 != *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0x114))) { - imageSlot = map_int_ImagePtr_subscript(imageMap,&iconId); - local_60.y = (*GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0x114)) / - (float)((double)*GHIDRA_CAST((*imageSlot + 0x14)) + - __uint_to_double_fixup[-(*GHIDRA_CAST((*imageSlot + 0x14)) >> 0x1f)])) * 1.5 - ; - (GHIDRA_CAST((&tintColor)))->KColor::SetFromARGB(0xffffffff); - imageSlot = map_int_ImagePtr_subscript(imageMap,&iconId); - pVVar1 = local_54; - local_54 = (Vector *) - ((float)((double)*GHIDRA_CAST((*imageSlot + 0x14)) + - __uint_to_double_fixup[-(*GHIDRA_CAST((*imageSlot + 0x14)) >> 0x1f)]) * - local_60.y + local_54->y); - imageSlot = map_int_ImagePtr_subscript(imageMap,&iconId); - fVar2 = pVVar1->x; - image = local_54; - render_quad_set_uniform_color - (quad,fVar2,pVVar1->y, - (float)((double)*GHIDRA_CAST((*imageSlot + 0x10)) + - __uint_to_double_fixup[-(*GHIDRA_CAST((*imageSlot + 0x10)) >> 0x1f)]) * - local_60.y + fVar2,(float)local_54,&tintColor); - pvVar3 = (void *)0x9f266e; - (GHIDRA_CAST((GHIDRA_CAST(local_50))))->Color::Color(); - imageMap = map_int_ImagePtr_subscript(savedImageMap,&iconId); - (GHIDRA_CAST((auStackY_1a8 + 0x84)))->KAGE::SmartPointer::operator_assign(imageMap); - apply_sprite_shader_params(color,1,image,pvVar3); - imagePtr = map_int_ImagePtr_subscript(savedImageMap,&iconId); - tintColor._unk = 0; - tintColor._red = 1.0; - tintColor._green = 1.0; - tintColor._blue = 1.0; - tintColor._alpha = alpha; - (**(code **)(*GHIDRA_CAST(*imagePtr) + 0x1c))(); - ExceptionList = local_1c; - return; - } - } - imageRefCount = (void *)0x9f26e3; - (GHIDRA_CAST((GHIDRA_CAST(local_50))))->Color::Color(); - imageMap = map_int_ImagePtr_subscript(savedImageMap,&iconId); - (GHIDRA_CAST((auStackY_1a8 + 0x84)))->KAGE::SmartPointer::operator_assign(imageMap); - apply_sprite_shader_params(color_00,1,pvVar3,imageRefCount); - imagePtr = map_int_ImagePtr_subscript(savedImageMap,&iconId); - tintColor._unk = 0; - tintColor._red = 1.0; - tintColor._green = 1.0; - tintColor._blue = 1.0; - tintColor._alpha = alpha; - (**(code **)(*GHIDRA_CAST(*imagePtr) + 0x20))(); - } - } - else { - get_animation_name(GHIDRA_CAST((local_50 + 0x14)),iconType); - local_14 = 0; - layer = (GHIDRA_CAST((imageMap)))->ANM2::get_layer_by_string(GHIDRA_CAST((local_50 + 0x14))); - if (layer != GHIDRA_CAST(0x0)) { - if (layer->_layerData == GHIDRA_CAST(0x0)) { - layerId = -1; - } - else { - layerId = *GHIDRA_CAST(layer->_layerData); - } - imageMap = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(imageMap) + 0x30)))))->AnimationState::GetLayerFrame(layerId); - fVar2 = *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0x114)); - local_60.y = 0.0; - r = *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xc)); - if ((0.0 < fVar2) && (fVar2 < r)) { - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0x9c)) = fVar2 / r; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xa0)) = fVar2 / r; - } - tintColor._unk = 0; - tintColor._red = 1.0; - tintColor._green = 1.0; - tintColor._blue = 1.0; - tintColor._alpha = alpha; - (GHIDRA_CAST((&local_a0)))->Color::Color(r,in_XMM2_Da,0.0,(float)&tintColor); - if (GHIDRA_CAST((GHIDRA_INT(imageMap) + 0xa8)) != &local_a0) { - (GHIDRA_CAST((GHIDRA_INT(imageMap) + 0xa8)))->_tint[0] = local_a0._tint[0]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xac)) = local_a0._tint[1]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xb0)) = local_a0._tint[2]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xb4)) = local_a0._tint[3]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xb8)) = local_a0._colorize[0]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xbc)) = local_a0._colorize[1]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xc0)) = local_a0._colorize[2]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xc4)) = local_a0._colorize[3]; - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 200)) = (*GHIDRA_CAST((GHIDRA_CAST(&(local_a0._offset)) + 0x0))); - *GHIDRA_CAST((GHIDRA_CAST(imageMap) + 0xd0)) = local_a0._offset[2]; - } - local_60.x = local_54->x + local_60.y; - local_60.y = local_54->y + local_60.y; - (GHIDRA_CAST((imageMap)))->ANM2::Render(&local_60,&g_vectorZero,&g_vectorZero); - } - if (0xf < GHIDRA_UINT(local_28)) { - size = GHIDRA_INT(local_28) + 1; - imageMap = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)local_50)) + 0x14))); - if (0xfff < size) { - imageMap = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(local_50)) + 0x14))) + -4); - size = GHIDRA_INT(local_28) + 0x24; - if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST((GHIDRA_CAST(&(local_50)) + 0x14))) + (-4 - GHIDRA_INT(imageMap))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(imageMap,size); - } - } - ExceptionList = local_1c; - return; -} - -// 009f28b0 -Vector * RichTextIcon::get_size(Vector *outSize) -{ - int *piVar1; - int *piVar2; - LayerState *layer; - int iVar3; - void *pvVar4; - uint32_t size; - float fVar5; - float scaledHeight; - std_string animName; - uint32_t local_18; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - float frameHeight; - double heightFixup; - float maxHeight; - - local_8 = 0xffffffff; - puStack_c = &LAB_00af85cd; - local_10 = ExceptionList; - local_18 = __security_cookie ^ GHIDRA_INT(&animName) + 0x2cU; - ExceptionList = &local_10; - outSize->y = 0.0; - outSize->x = 0.0; - if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x118)) == 2) { - piVar2 = GHIDRA_CAST((GHIDRA_INT(this) + 0x11c)); - piVar1 = map_int_ImagePtr_subscript((void *)(GHIDRA_INT(this) + 0x120),piVar2); - if (*piVar1 == 0) { - ExceptionList = local_10; - return outSize; - } - piVar1 = map_int_ImagePtr_subscript((void *)(GHIDRA_INT(this) + 0x120),piVar2); - iVar3 = *GHIDRA_CAST((*piVar1 + 0x14)); - heightFixup = __uint_to_double_fixup[-(iVar3 >> 0x1f)]; - piVar1 = map_int_ImagePtr_subscript((void *)(GHIDRA_INT(this) + 0x120),piVar2); - outSize->x = (float)((double)*GHIDRA_CAST((*piVar1 + 0x10)) + - __uint_to_double_fixup[-(*GHIDRA_CAST((*piVar1 + 0x10)) >> 0x1f)]); - outSize->y = (float)((double)iVar3 + heightFixup); - if (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x114)) <= 0.0) { - ExceptionList = local_10; - return outSize; - } - piVar1 = map_int_ImagePtr_subscript((void *)(GHIDRA_INT(this) + 0x120),piVar2); - fVar5 = (float)((double)*GHIDRA_CAST((*piVar1 + 0x14)) + - __uint_to_double_fixup[-(*GHIDRA_CAST((*piVar1 + 0x14)) >> 0x1f)]); - if (fVar5 < *GHIDRA_CAST((GHIDRA_CAST(this) + 0x114)) || fVar5 == *GHIDRA_CAST((GHIDRA_CAST(this) + 0x114))) { - ExceptionList = local_10; - return outSize; - } - piVar2 = map_int_ImagePtr_subscript((void *)(GHIDRA_INT(this) + 0x120),piVar2); - fVar5 = (*GHIDRA_CAST((GHIDRA_CAST(this) + 0x114)) / - (float)((double)*GHIDRA_CAST((*piVar2 + 0x14)) + - __uint_to_double_fixup[-(*GHIDRA_CAST((*piVar2 + 0x14)) >> 0x1f)])) * 1.5; - scaledHeight = fVar5 * outSize->y; - outSize->x = fVar5 * outSize->x; - } - else { - if (*(void **)(GHIDRA_CAST(this) + 0x34) == (void *)0x0) { - animName._capacity = 0xf; - animName._size = 0; - (*GHIDRA_CAST((GHIDRA_CAST(&(animName._buf)) + 0x0))) = (void *)0x0; - } - else { - (GHIDRA_CAST((animName._buf)))->msvc::string::string(*(void **)(GHIDRA_CAST(this) + 0x34)); - } - local_8 = 0; - layer = this->ANM2::get_layer_by_string(&animName); - local_8 = 0xffffffff; - if (0xf < animName._capacity) { - size = animName._capacity + 1; - pvVar4 = (*GHIDRA_CAST((GHIDRA_CAST(&((void *)animName._buf)) + 0x0))); - if (0xfff < size) { - pvVar4 = *(void **)((*GHIDRA_CAST((GHIDRA_CAST(&(animName._buf)) + 0x0))) + -4); - size = animName._capacity + 0x24; - if (0x1f < GHIDRA_UINT(((*GHIDRA_CAST((GHIDRA_CAST(&(animName._buf)) + 0x0))) + (-4 - GHIDRA_INT(pvVar4))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pvVar4,size); - } - if (layer == GHIDRA_CAST(0x0)) { - ExceptionList = local_10; - return outSize; - } - if (layer->_layerData == GHIDRA_CAST(0x0)) { - iVar3 = -1; - } - else { - iVar3 = *GHIDRA_CAST(layer->_layerData); - } - pvVar4 = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(this) + 0x30)))))->AnimationState::GetLayerFrame(iVar3); - fVar5 = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 8)); - outSize->x = fVar5; - frameHeight = *GHIDRA_CAST((GHIDRA_CAST(pvVar4) + 0xc)); - outSize->y = frameHeight; - maxHeight = *GHIDRA_CAST((GHIDRA_CAST(this) + 0x114)); - if (maxHeight <= 0.0) { - ExceptionList = local_10; - return outSize; - } - if (frameHeight <= maxHeight) { - ExceptionList = local_10; - return outSize; - } - scaledHeight = frameHeight * (maxHeight / frameHeight); - outSize->x = fVar5 * (maxHeight / frameHeight); - } - outSize->y = scaledHeight; - ExceptionList = local_10; - return outSize; -} - -// 009f2b10 -std_string * RichTextIcon::get_animation_name(std_string *outName, int iconType) -{ - if (iconType == 0) { - outName->_buf[0] = '\0'; - outName->_buf[1] = '\0'; - outName->_buf[2] = '\0'; - outName->_buf[3] = '\0'; - outName->_size = 0; - outName->_capacity = 0xf; - outName->_buf[0] = '\0'; - outName->_size = 7; - memmove(outName,"players",7); - outName->_buf[7] = '\0'; - return outName; - } - if (iconType == 1) { - outName->_buf[0] = '\0'; - outName->_buf[1] = '\0'; - outName->_buf[2] = '\0'; - outName->_buf[3] = '\0'; - outName->_size = 0; - outName->_capacity = 0xf; - outName->_buf[0] = '\0'; - outName->_size = 7; - memmove(outName,"pickups",7); - outName->_buf[7] = '\0'; - return outName; - } - if (iconType == 3) { - outName->_buf[0] = '\0'; - outName->_buf[1] = '\0'; - outName->_buf[2] = '\0'; - outName->_buf[3] = '\0'; - outName->_size = 0; - outName->_capacity = 0xf; - outName->_buf[0] = '\0'; - outName->_size = 5; - memmove(outName,"rooms",5); - outName->_buf[5] = '\0'; - return outName; - } - KAGE_LogMessage(8,GHIDRA_CAST("Invalid icon type (%d) for get_animation_name() \n")); - outName->_buf[0] = '\0'; - outName->_buf[1] = '\0'; - outName->_buf[2] = '\0'; - outName->_buf[3] = '\0'; - outName->_size = 0; - outName->_capacity = 0xf; - outName->_buf[0] = '\0'; - outName->_size = 0; - outName->_buf[0] = '\0'; - return outName; -} - -// 009f2c10 -void RichTextIcon::set_icon(int param_1, int param_2) -{ - uint8_t bVar1; - char isLastRef; - std_string *psVar2; - uint8_t *currentAnimChar; - uint32_t uVar3; - ItemConfig_Item *pIVar4; - int *imageSlot; - void *pvVar5; - void *imageSlotRef; - ANM2 *in_ECX; - std_string *newAnimChar; - int iVar6; - bool isLess; - uint8_t loadedImage [4]; - int *loadedImageRef; - void *animName [5]; - uint32_t animNameCapacity; - uint32_t local_14; - void *local_10; - uint8_t *puStack_c; - void *local_8; - uint8_t *animData; - ANM2 *iconData; - Manager *manager; - - iVar6 = param_2; - manager = g_manager; - local_8 = (void *)0xffffffff; - puStack_c = &LAB_00b10135; - local_10 = ExceptionList; - local_14 = __security_cookie ^ GHIDRA_UINT((animName + 10)); - ExceptionList = &local_10; - if (param_1 == 2) { - iconData = in_ECX + 1; - (iconData->_filename)._buf[4] = '\x02'; - (iconData->_filename)._buf[5] = '\0'; - (iconData->_filename)._buf[6] = '\0'; - (iconData->_filename)._buf[7] = '\0'; - pIVar4 = (GHIDRA_CAST((&manager->_itemConfig)))->ItemConfig::GetCollectible(param_2); - if (pIVar4 != GHIDRA_CAST(0x0)) { - imageSlot = map_int_ImagePtr_subscript(in_ECX[1]._filename._buf + 0xc,¶m_2); - if (*imageSlot == 0) { - psVar2 = &pIVar4->gfxFilename; - if (0xf < (pIVar4->gfxFilename)._capacity) { - psVar2 = *GHIDRA_CAST(psVar2->_buf); - } - pvVar5 = Manager::LoadImage(loadedImage,GHIDRA_CAST(psVar2)); - local_8 = (void *)0x1; - imageSlotRef = map_int_ImagePtr_subscript(in_ECX[1]._filename._buf + 0xc,¶m_2); - (GHIDRA_CAST((imageSlotRef)))->KAGE::SmartPointer::operator_assign(pvVar5); - local_8 = (void *)0x2; - if (loadedImageRef != GHIDRA_CAST(0x0)) { - isLastRef = (**(code **)(*loadedImageRef + 0xc))(); - if ((isLastRef != '\0') && (g_imageReleaseFn != (void *)0x0)) { - (*g_imageReleaseFn)(loadedImage); - } - } - } -LAB_009f2dec: - iVar6 = param_2; - } -LAB_009f2def: - *GHIDRA_CAST((in_ECX[1]._filename._buf + 8)) = iVar6; - } - else { - psVar2 = get_animation_name(GHIDRA_CAST(animName),param_1); - local_8 = (void *)0x0; - if (0xf < psVar2->_capacity) { - psVar2 = *GHIDRA_CAST(psVar2->_buf); - } - animData = (in_ECX->_animState)._animData; - if (animData == GHIDRA_CAST(0x0)) { -LAB_009f2caa: - bVar1 = (GHIDRA_CAST((in_ECX)))->ANM2::SetAnimation(GHIDRA_CAST(psVar2),1); - if (bVar1 != 0) { - (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::Rewind(); - (in_ECX->_animState)._isPlaying = 1; - } - } - else { - currentAnimChar = animData; - if (0xf < *GHIDRA_CAST((animData + 0x14))) { - currentAnimChar = *GHIDRA_CAST(animData); - } - newAnimChar = psVar2; - do { - bVar1 = *currentAnimChar; - isLess = bVar1 < (uint8_t)newAnimChar->_buf[0]; - if (bVar1 != newAnimChar->_buf[0]) { -LAB_009f2c97: - uVar3 = -GHIDRA_UINT(isLess) | 1; - goto LAB_009f2c9c; - } - if (bVar1 == 0) break; - bVar1 = currentAnimChar[1]; - isLess = bVar1 < (uint8_t)newAnimChar->_buf[1]; - if (bVar1 != newAnimChar->_buf[1]) goto LAB_009f2c97; - currentAnimChar = currentAnimChar + 2; - newAnimChar = GHIDRA_CAST((newAnimChar->_buf + 2)); - } while (bVar1 != 0); - uVar3 = 0; -LAB_009f2c9c: - if ((uVar3 != 0) || ((animData[0x34] != 0 && ((in_ECX->_animState)._isPlaying == 0)))) - goto LAB_009f2caa; - } - local_8 = (void *)0xffffffff; - if (0xf < animNameCapacity) { - uVar3 = animNameCapacity + 1; - pvVar5 = animName[0]; - if (0xfff < uVar3) { - pvVar5 = *(void **)(GHIDRA_INT(animName[0]) + -4); - uVar3 = animNameCapacity + 0x24; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(animName[0]) + (-4 - GHIDRA_INT(pvVar5))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pvVar5,uVar3); - } - *GHIDRA_CAST((in_ECX[1]._filename._buf + 4)) = param_1; - if (-1 < param_2) { - pvVar5 = (in_ECX->_animState)._animData; - if (pvVar5 == (void *)0x0) { - iVar6 = 0; - } - else { - iVar6 = *GHIDRA_CAST((GHIDRA_CAST(pvVar5) + 0x30)); - } - if (param_2 <= iVar6) { - iVar6 = param_2; - if (pvVar5 != (void *)0x0) { - (GHIDRA_CAST((&in_ECX->_animState)))->AnimationState::SetFrameFloat((float)param_2); - goto LAB_009f2dec; - } - goto LAB_009f2def; - } - } - KAGE_LogMessage(8,GHIDRA_CAST("Invalid icon id (%d) for Icon Type %d \n")); - } - ExceptionList = local_10; - return; -} diff --git a/generated-src/room.cpp b/generated-src/room.cpp index 1a1753f..379627b 100644 --- a/generated-src/room.cpp +++ b/generated-src/room.cpp @@ -778,9 +778,9 @@ Room * Room::constructor() *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x1bc0)))) = 0; (GHIDRA_CAST((GHIDRA_CAST(&this->_backdrop))))->Backdrop::constructor(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 6; - (GHIDRA_CAST((&this->_lightSprite)))->ANM2::constructor(); + ANM2::constructor(&this->_lightSprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 7; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f54)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f54))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 8; shopItemDeque = &this->_shopItemDeque; shopItemDeque->_proxy = (void *)0x0; @@ -806,7 +806,7 @@ Room * Room::constructor() entriesLeft = entriesLeft + -1; puVar2 = puVar2 + 7; } while (entriesLeft != 0); - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100))))); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 10; gridIndexSet = this->_pendingGridRemovals; gridIndexSet[0] = 0; @@ -902,12 +902,12 @@ Room * Room::constructor() (this->_waterCurrent).y = 0.0; (this->_waterCurrent).x = 0.0; (this->_railManager)._room = this; - (GHIDRA_CAST((&(this->_railManager)._sprite)))->ANM2::constructor(); + ANM2::constructor(&(this->_railManager)._sprite); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x11; _eh_vector_constructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7744))),4,8,FUN_0042a020,FUN_00579700); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x12; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x776c)))) = this; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7770)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7770))))); (*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7884))) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7888)))) = 0; this->_beastBlastForce = 0.0; @@ -1015,7 +1015,7 @@ Room::~Room() FUN_007ea0c0(this->_Camera); } local_8 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7770)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7770))))); iVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x77c8)))); if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { @@ -1086,7 +1086,7 @@ Room::~Room() _eh_vector_destructor_iterator_(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7744))),4,8,FUN_00579700); railSprite = &(this->_railManager)._sprite; local_8 = 5; - (GHIDRA_CAST((railSprite)))->ANM2::Reset(); + ANM2::Reset(railSprite); freeBlock = (this->_railManager)._sprite._overlayAnimState._layerFrames; if (freeBlock != (void *)0x0) { if (g_mainHeap == (void *)0x0) { @@ -1169,7 +1169,7 @@ Room::~Room() *(_Tree_node **)(*GHIDRA_CAST(this->_pendingGridRemovals) + 4)); operator_delete(*(void **)gridIndexSet,0x14); local_8 = 10; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100))))); iVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7158)))); if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { @@ -1241,7 +1241,7 @@ Room::~Room() (this->_shopItemDeque)._proxy = (void *)0x0; operator_delete(freeBlock,8); local_8 = 0xf; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f54)))))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f54))))); iVar3 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6fac)))); if (iVar3 != 0) { if (g_mainHeap == (void *)0x0) { @@ -1263,13 +1263,13 @@ Room::~Room() tracked_alloc(1,*(void **)&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6fb0))),0); *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6fb0)))) = 0; } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f84)))))))->AnimationState::~AnimationState(); + AnimationState::~AnimationState(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f84))))); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f6c))))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x6f54))))))->msvc::string::_Tidy_deallocate(); local_8 = 0x12; - (GHIDRA_CAST((&this->_lightSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_lightSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_lightSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_lightSprite); + AnimationState::~AnimationState(&(this->_lightSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_lightSprite)._animState); (GHIDRA_CAST(((this->_lightSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_lightSprite))))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_backdrop))))->Backdrop::destructor(); @@ -2868,7 +2868,7 @@ LAB_007ed9e7: pRVar9 = room; } } - (GHIDRA_CAST((GHIDRA_CAST((iVar5 + 0x5d0)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((iVar5 + 0x5d0))); } fVar13 = gridIndexLocal; } @@ -3684,9 +3684,9 @@ void Room::MakeDoor(int slot) (GHIDRA_CAST((newDoor)))->GridEntity::GridEntity(); (*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x0))) = 3; *GHIDRA_CAST(newDoor) = IsaacRepentancePlus::GridEntity_Door::vftable; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(newDoor[1])) + 0x14)))))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(newDoor[1])) + 0x14))))); local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),4); - (GHIDRA_CAST((GHIDRA_CAST((newDoor[1]._sprite._championColor._colorize + 1)))))->ANM2::constructor(); + ANM2::constructor(GHIDRA_CAST((newDoor[1]._sprite._championColor._colorize + 1))); newDoor[2]._sprite._color._colorize[1] = 0.0; newDoor[2]._sprite._color._offset[1] = 0.0; newDoor[2]._sprite._color._offset[2] = 2.10195e-44; @@ -5237,7 +5237,7 @@ LAB_007f1a86: local_40._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(local_40._buf))) + 0x0))),"gfx/Effect_SatanRadial.anm2",0x1c); local_14 = 2; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100)))))))->ANM2::Load(&local_40,0); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100)))),&local_40,0); local_14 = -1; bVar2 = extraout_CL; if (0xf < local_40._capacity) { @@ -5279,7 +5279,7 @@ LAB_007f1a86: bVar2 = extraout_CL_02; } } - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100)))))))->ANM2::LoadGraphics(bVar2); + ANM2::LoadGraphics(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x7100)))),bVar2); uVar9 = extraout_ECX_03; LAB_007f1c03: KAGE::SmartPointer::reset(uVar9); @@ -5972,7 +5972,7 @@ void Room::Init(RoomConfig_Room *config, RoomDescriptor *descriptor) lightGradientPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(lightGradientPath._buf))) + 0x0))),"gfx/LightGradient.anm2",0x17); uStack_14 = 0; - (GHIDRA_CAST((pickup)))->ANM2::Load(&lightGradientPath,1); + ANM2::Load(pickup,&lightGradientPath,1); uStack_14 = 0xffffffff; if (0xf < lightGradientPath._capacity) { uVar7 = lightGradientPath._capacity + 1; @@ -5990,9 +5990,9 @@ void Room::Init(RoomConfig_Room *config, RoomDescriptor *descriptor) lightGradientPath._size = 0; lightGradientPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(lightGradientPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(lightGradientPath._buf)) + 0x0))) & 0xffffff00; - layer = (GHIDRA_CAST((pickup)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(pickup,GHIDRA_CAST(0x0)); layer->_minFilterMode = 1; - layer = (GHIDRA_CAST((pickup)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(pickup,GHIDRA_CAST(0x0)); pGStack_54c = GHIDRA_CAST(&(currentRoom->_lightSprite)._animDefaultName); layer->_magFilterMode = 1; if (0xf < (currentRoom->_lightSprite)._animDefaultName._capacity) { @@ -6001,9 +6001,9 @@ void Room::Init(RoomConfig_Room *config, RoomDescriptor *descriptor) pbVar24 = (currentRoom->_lightSprite)._animState._animData; if (pbVar24 == GHIDRA_CAST(0x0)) { LAB_007f2c5c: - bVar5 = (GHIDRA_CAST((pickup)))->ANM2::SetAnimation(GHIDRA_CAST(pGStack_54c),1); + bVar5 = ANM2::SetAnimation(pickup,GHIDRA_CAST(pGStack_54c),1); if (bVar5 != 0) { - (GHIDRA_CAST((&(currentRoom->_lightSprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(currentRoom->_lightSprite)._animState); (currentRoom->_lightSprite)._animState._isPlaying = 1; } } @@ -6035,7 +6035,7 @@ LAB_007f2c49: ((*GHIDRA_CAST((GHIDRA_INT((currentRoom->_lightSprite)._animState._animData) + 0x34)) != '\0' && ((currentRoom->_lightSprite)._animState._isPlaying == 0)))) goto LAB_007f2c5c; } - layer = (GHIDRA_CAST((¤tRoom->_lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(¤tRoom->_lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = DAT_00c354ac; layer->_blendMode[1] = DAT_00c354b0; layer->_blendMode[2] = DAT_00c354b4; @@ -6055,7 +6055,7 @@ LAB_007f2c49: spotLightPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(spotLightPath._buf))) + 0x0))),"gfx/SpotLight.anm2",0x13); uStack_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST(puVar12))))->ANM2::Load(&spotLightPath,1); + ANM2::Load(GHIDRA_CAST(puVar12),&spotLightPath,1); uStack_14 = 0xffffffff; if (0xf < spotLightPath._capacity) { uVar7 = spotLightPath._capacity + 1; @@ -6073,9 +6073,9 @@ LAB_007f2c49: spotLightPath._size = 0; spotLightPath._capacity = 0xf; (*GHIDRA_CAST((GHIDRA_CAST(&(spotLightPath._buf)) + 0x0))) = (*GHIDRA_CAST((GHIDRA_CAST(&(spotLightPath._buf)) + 0x0))) & 0xffffff00; - layer = (GHIDRA_CAST((GHIDRA_CAST(puVar12))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(puVar12),GHIDRA_CAST(0x0)); layer->_minFilterMode = 1; - layer = (GHIDRA_CAST((GHIDRA_CAST(puVar12))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(puVar12),GHIDRA_CAST(0x0)); pGStack_54c = GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((currentRoom)) + 0x6f6c)))); layer->_magFilterMode = 1; if (0xf < *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((currentRoom)) + 0x6f80))))) { @@ -6110,9 +6110,9 @@ LAB_007f2e25: ((*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((currentRoom)) + 0x6f88)))) + 0x34)) == '\0' || ((*GHIDRA_CAST((GHIDRA_CAST((currentRoom)) + 0x6f98))) != '\0')))) goto LAB_007f2e57; } - bVar5 = (GHIDRA_CAST((GHIDRA_CAST(puVar12))))->ANM2::SetAnimation(GHIDRA_CAST(pGStack_54c),1); + bVar5 = ANM2::SetAnimation(GHIDRA_CAST(puVar12),GHIDRA_CAST(pGStack_54c),1); if (bVar5 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((currentRoom)) + 0x6f84)))))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((currentRoom)) + 0x6f84))))); (*GHIDRA_CAST((GHIDRA_CAST((currentRoom)) + 0x6f98))) = 1; } } @@ -13256,7 +13256,7 @@ code_r0x008009bf: if (*GHIDRA_CAST((iVar3 + 0x2c)) == 0) { fVar9 = fVar9 - *GHIDRA_CAST((iVar3 + 0x33c)); fVar8 = fVar8 - *GHIDRA_CAST((iVar3 + 0x340)); - layer = (GHIDRA_CAST((GHIDRA_CAST((iVar3 + 0x48)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((iVar3 + 0x48)),GHIDRA_CAST(0x0)); fVar8 = sqrtf(fVar8 * fVar8 + fVar9 * fVar9); fVar9 = 1.0 - fVar8 / 1500.0; fVar8 = 0.0; @@ -14965,8 +14965,8 @@ LAB_0080377c: (GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(this))->_roomList[0x19].Dimension))))->EntityList::Update(0); (GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(this))->_roomList[0x1e].SavedEntities))))->Camera::Update(0); if (*GHIDRA_CAST((GHIDRA_INT((GHIDRA_CAST(this))->_roomList[0x28]._doors) + 0x1d)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(this))->_roomList[0x27].AllowedDoors))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST(((GHIDRA_CAST(this))->_roomList[0x27]._doors + 7)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST(&(GHIDRA_CAST(this))->_roomList[0x27].AllowedDoors)); + AnimationState::Update(GHIDRA_CAST(((GHIDRA_CAST(this))->_roomList[0x27]._doors + 7))); } if ((GHIDRA_CAST(this))->_roomList[0x28].Flags == 0x1a) { pbVar25 = GHIDRA_CAST((GHIDRA_CAST(this))->_roomList[0x27]._doors[0]); @@ -14996,9 +14996,9 @@ LAB_00803ee5: ((*GHIDRA_CAST(((GHIDRA_CAST(this))->_roomList[0x27]._doors[0] + 0x34)) == '\0' || ((char)(GHIDRA_CAST(this))->_roomList[0x27]._doors[4] != '\0')))) goto LAB_00803f16; } - bVar15 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((GHIDRA_CAST(this))->_roomList[0x26])) + 0xa0)))))))->ANM2::SetAnimation(s_Idle,1); + bVar15 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((GHIDRA_CAST(this))->_roomList[0x26])) + 0xa0)))),s_Idle,1); if (bVar15 != 0) { - (GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(this))->_roomList[0x27].AllowedDoors))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST(&(GHIDRA_CAST(this))->_roomList[0x27].AllowedDoors)); *GHIDRA_CAST(((GHIDRA_CAST(this))->_roomList[0x27]._doors + 4)) = 1; } } @@ -16459,7 +16459,7 @@ void Room::render_player_light(Entity_Player *player, Vector *offset) } else { if ((*GHIDRA_CAST((minecart + 0x7c)) == 0) || - (pVVar6 = (GHIDRA_CAST((GHIDRA_CAST((minecart + 0x78)))))->AnimationState::GetNullFrameById(0), + (pVVar6 = AnimationState::GetNullFrameById(GHIDRA_CAST((minecart + 0x78)),0), pVVar6 == GHIDRA_CAST(0x0))) { pVVar6 = &g_vectorZero; } @@ -16490,7 +16490,7 @@ void Room::render_player_light(Entity_Player *player, Vector *offset) uVar7 = g_graphicsManager_flags; if (bVar5 != 0) { lightSprite = &this->_lightSprite; - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); color._tint[0] = 0.4; color._colorize[0] = 0.0; color._colorize[1] = 0.0; @@ -16516,9 +16516,9 @@ void Room::render_player_light(Entity_Player *player, Vector *offset) fVar8 = fVar9 * g_vectorOne.x; (local_1c->_lightSprite)._scale.y = fVar9 * g_vectorOne.y; (local_1c->_lightSprite)._scale.x = fVar8; - (GHIDRA_CAST((lightSprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(lightSprite,&renderPos,&g_vectorZero,&g_vectorZero); uVar7 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); minecart = 1; offset = GHIDRA_CAST(renderPos.y); if ((uVar7 & 4) == 0) { @@ -16535,7 +16535,7 @@ void Room::render_player_light(Entity_Player *player, Vector *offset) uVar7 = g_graphicsManager_flags; if (player->_babySkin == 0x42) { lightSprite = &this->_lightSprite; - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); color._offset[0] = 0.0; color._offset[1] = 0.0; minecart = 1; @@ -16560,9 +16560,9 @@ void Room::render_player_light(Entity_Player *player, Vector *offset) fVar8 = g_vectorOne.y * 2.0; (local_1c->_lightSprite)._scale.x = g_vectorOne.x * 2.0; (local_1c->_lightSprite)._scale.y = fVar8; - (GHIDRA_CAST((lightSprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(lightSprite,&renderPos,&g_vectorZero,&g_vectorZero); uVar7 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); minecart = 1; offset = GHIDRA_CAST(renderPos.y); if ((uVar7 & 4) == 0) { @@ -16746,7 +16746,7 @@ void Room::render_player_light(Entity_Player *player, Vector *offset) (this->_lightSprite)._scale.x = g_vectorOne.x * 0.5; (this->_lightSprite)._scale.y = fVar8; } - (GHIDRA_CAST((lightSprite)))->ANM2::Render(&renderPos,&g_vectorZero,&g_vectorZero); + ANM2::Render(lightSprite,&renderPos,&g_vectorZero,&g_vectorZero); return; } @@ -16879,7 +16879,7 @@ LAB_0080cac5: dVar6 = floor((double)local_20.y); local_20.x = local_18.y + *param_3; local_20.y = (float)dVar6 / (float)local_10 + param_3[1]; - layer = (GHIDRA_CAST((&this->_lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(&this->_lightSprite,GHIDRA_CAST(0x0)); game = g_game; layer->_blendMode[0] = DAT_00c35b6c; layer->_blendMode[1] = DAT_00c35b70; @@ -16902,8 +16902,8 @@ LAB_0080cac5: fVar5 = g_vectorOne.y * 0.8; (this->_lightSprite)._scale.x = g_vectorOne.x * 0.8; (this->_lightSprite)._scale.y = fVar5; - (GHIDRA_CAST((&this->_lightSprite)))->ANM2::Render(&local_20,&g_vectorZero,&g_vectorZero); - layer = (GHIDRA_CAST((&this->_lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + ANM2::Render(&this->_lightSprite,&local_20,&g_vectorZero,&g_vectorZero); + layer = ANM2::GetLayer(&this->_lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = DAT_00c354ac; layer->_blendMode[1] = DAT_00c354b0; layer->_blendMode[2] = DAT_00c354b4; @@ -16960,8 +16960,8 @@ LAB_0080cac5: if (iVar2 == 1) { return; } - isLastBoss = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::IsPlaying(GHIDRA_CAST("KeyOpen")); - if ((isLastBoss != 0) && (frame = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::GetFrame(), frame < 0x13)) { + isLastBoss = ANM2::IsPlaying(¶m_2->_sprite,GHIDRA_CAST("KeyOpen")); + if ((isLastBoss != 0) && (frame = ANM2::GetFrame(¶m_2->_sprite), frame < 0x13)) { return; } if (iVar2 != 8) { @@ -17031,15 +17031,15 @@ LAB_0080cac5: fVar5 = (float)dVar6; } else { - layer = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(¶m_2->_sprite,&DAT_00000005); if (layer->_visible == 0) { return; } - layer = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(¶m_2->_sprite,&DAT_00000005); if ((layer->_color)._tint[3] <= 0.0) { return; } - layer = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(¶m_2->_sprite,&DAT_00000005); (GHIDRA_CAST((&local_68)))->Color::Color(1.0,0.95,0.9,(layer->_color)._tint[3]); (GHIDRA_CAST((GHIDRA_CAST(&this->_lightSprite))))->Sprite::SetColor(color_06); (this->_lightSprite)._scale.x = g_vectorOne.x; @@ -17075,11 +17075,11 @@ LAB_0080cac5: } } else { - layer = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(¶m_2->_sprite,GHIDRA_CAST(0x3)); if (layer->_visible == 0) { return; } - layer = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::GetLayer(GHIDRA_CAST(0x3)); + layer = ANM2::GetLayer(¶m_2->_sprite,GHIDRA_CAST(0x3)); (GHIDRA_CAST((GHIDRA_CAST(&this->_lightSprite))))->Sprite::SetColor(&layer->_color); (this->_lightSprite)._scale.x = g_vectorOne.x; (this->_lightSprite)._scale.y = g_vectorOne.y; @@ -17107,13 +17107,13 @@ LAB_0080cac5: return; } lightSprite = &this->_lightSprite; - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); local_3c._seed = layer->_blendMode[0]; local_3c._shift1 = layer->_blendMode[1]; local_3c._shift2 = layer->_blendMode[2]; local_3c._shift3 = layer->_blendMode[3]; iVar2 = layer->_blendMode[4]; - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[0] = DAT_00c35b6c; layer->_blendMode[1] = DAT_00c35b70; layer->_blendMode[2] = DAT_00c35b74; @@ -17132,8 +17132,8 @@ LAB_0080cac5: dVar6 = floor((double)local_20.y); local_20.x = local_18.y + *param_3; local_20.y = (float)dVar6 / fVar5 + param_3[1]; - (GHIDRA_CAST((lightSprite)))->ANM2::Render(&local_20,&g_vectorZero,&g_vectorZero); - layer = (GHIDRA_CAST((lightSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + ANM2::Render(lightSprite,&local_20,&g_vectorZero,&g_vectorZero); + layer = ANM2::GetLayer(lightSprite,GHIDRA_CAST(0x0)); layer->_blendMode[1] = local_3c._shift1; layer->_blendMode[0] = local_3c._seed; layer->_blendMode[2] = local_3c._shift2; @@ -17141,7 +17141,7 @@ LAB_0080cac5: layer->_blendMode[4] = iVar2; return; } - layerFrame = (GHIDRA_CAST((¶m_2->_sprite)))->ANM2::GetLayerFrame(0); + layerFrame = ANM2::GetLayerFrame(¶m_2->_sprite,0); if (layerFrame == (void *)0x0) { return; } @@ -17242,7 +17242,7 @@ LAB_0080cac5: if ((param_2->_sprite)._animState._animData == (void *)0x0) { return; } - local_10 = (GHIDRA_CAST((&(param_2->_sprite)._animState)))->AnimationState::GetNullFrameById(0); + local_10 = AnimationState::GetNullFrameById(&(param_2->_sprite)._animState,0); if (local_10 == GHIDRA_CAST(0x0)) { return; } @@ -17268,7 +17268,7 @@ LAB_0080cac5: LAB_0080e2c3: pVVar4 = &local_20; LAB_0080e2d3: - (GHIDRA_CAST((&this->_lightSprite)))->ANM2::Render(pVVar4,&g_vectorZero,&g_vectorZero); + ANM2::Render(&this->_lightSprite,pVVar4,&g_vectorZero,&g_vectorZero); switchD_0080c86a_caseD_8: return; } @@ -18280,10 +18280,10 @@ LAB_0080f949: if ((GHIDRA_INT(local_1e4) < GHIDRA_INT(local_204)) && (((rock->_backdropType == 0x12 || (rock->_backdropType == 0x1c)) && ((*GHIDRA_CAST((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((rock)) + 0x4)))) + 0x44)) & 1) == 0)))) { - pvVar8 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((rock)) + 0x7100)))))))->ANM2::GetAnimationData(s_Idle); + pvVar8 = ANM2::GetAnimationData(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((rock)) + 0x7100)))),s_Idle); local_1e4 = GHIDRA_CAST(GHIDRA_INT(((float)*GHIDRA_CAST((GHIDRA_CAST(pvVar8) + 0x30)) * ((float)GHIDRA_INT(local_1e4) / (float)GHIDRA_INT(local_204))))); - bVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((rock)) + 0x7100)))))))->ANM2::SetAnimation(s_Idle,1); + bVar4 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((rock)) + 0x7100)))),s_Idle,1); if (((bVar4 != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((rock)) + 0x7134)))) != 0)) && (AnimationState::SetFrameFloat (GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((rock)) + 0x7130)))),(float)GHIDRA_INT(local_1e4)), @@ -18452,10 +18452,10 @@ LAB_0080f949: do { pvVar8 = *(void **)local_1e0; if ((pvVar8 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar8) + 4)) == 7)) { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar8) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(pvVar8) + 0x40)),GHIDRA_CAST(0x0)); layer->_visible = 0; (**(code **)(**GHIDRA_CAST(local_1e0) + 0xc))(); - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(*(void **))local_1e0 + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(*(void **))local_1e0 + 0x40)),GHIDRA_CAST(0x0)); layer->_visible = 1; } local_1e0 = GHIDRA_CAST((GHIDRA_INT(local_1e0) + 4)); @@ -18816,7 +18816,8 @@ LAB_0080f949: *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&((GHIDRA_CAST(room))->_roomList[0x9b])) + 0xa8)))) = 0; } uVar6 = g_graphicsManager_flags; - layer = (GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(room))->_roomList[0x9a].SavedEffects._capacity))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(&(GHIDRA_CAST(room))->_roomList[0x9a].SavedEffects._capacity), + GHIDRA_CAST(0x0)); pGVar18 = g_game; iVar14 = 1; if ((uVar6 & 4) == 0) { @@ -18853,7 +18854,7 @@ LAB_0080f949: ; local_224.y = (float)local_ac / (float)local_1d4 + (float)(GHIDRA_CAST(room))->_roomList[0x18].Group; - (GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(room))->_roomList[0x9a].SavedEffects._capacity))))->ANM2::Render(&local_224, + ANM2::Render(GHIDRA_CAST(&(GHIDRA_CAST(room))->_roomList[0x9a].SavedEffects._capacity),&local_224, &g_vectorZero,&g_vectorZero); } local_1f0 = GHIDRA_CAST((GHIDRA_INT(&pGVar18->_stage) + 1)); @@ -19052,10 +19053,10 @@ LAB_0080f949: local_ac = *GHIDRA_CAST((GHIDRA_CAST(local_1d4) + 4)); if ((GHIDRA_INT(local_1f8.y) < GHIDRA_INT(local_ac)) && ((room->_backdropType == 0x12 || (room->_backdropType == 0x1c)))) { - pvVar8 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((room)) + 0x7100)))))))->ANM2::GetAnimationData(s_Idle); + pvVar8 = ANM2::GetAnimationData(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((room)) + 0x7100)))),s_Idle); local_1f8.y = (float)GHIDRA_INT(((float)*GHIDRA_CAST((GHIDRA_CAST(pvVar8) + 0x30)) * ((float)GHIDRA_INT(local_1f8.y) / (float)GHIDRA_INT(local_ac)))); - bVar4 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((room)) + 0x7100)))))))->ANM2::SetAnimation(s_Idle,1); + bVar4 = ANM2::SetAnimation(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((room)) + 0x7100)))),s_Idle,1); if ((bVar4 != 0) && ((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((room)) + 0x7134)))) != 0 && (AnimationState::SetFrameFloat @@ -19076,7 +19077,7 @@ LAB_0080f949: local_21c.x = VStack_c4.y + (float)pGVar18->_stage; local_21c.y = (float)dVar19 / (float)local_1f0 + (float)pGVar18->_stageType; local_1f8.y = (float)(float)dVar19; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((room)) + 0x7100)))))))->ANM2::Render(&local_21c,&g_vectorZero,&g_vectorZero); + ANM2::Render(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((room)) + 0x7100)))),&local_21c,&g_vectorZero,&g_vectorZero); } local_1d4 = GHIDRA_CAST((GHIDRA_INT(local_1d4) + 0x1c)); local_204 = GHIDRA_CAST((GHIDRA_INT(local_204) + -1)); @@ -19361,7 +19362,7 @@ LAB_0080f949: local_1f8.y = *GHIDRA_CAST(((GHIDRA_CAST(room))->_stageType + 0xb4)); sprintf_s(debugText,0x80,GHIDRA_CAST("%s %s %d %s (group %d)")); manager = g_manager; - uVar6 = (GHIDRA_CAST((&g_manager->_font5_terminus8)))->Font::get_string_width_n(debugText,-1); + uVar6 = Font::get_string_width_n(&g_manager->_font5_terminus8,debugText,-1); (*GHIDRA_CAST((GHIDRA_CAST(&(local_1b8)) + 0x10))) = 0.0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_1b8)) + 0x14))) = 9.18341e-41; (*GHIDRA_CAST((GHIDRA_CAST(&(local_1b8)) + 0x18))) = 0.0; @@ -19370,7 +19371,7 @@ LAB_0080f949: fStack_194 = 0.0; local_190 = 0.0; local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),1); - (GHIDRA_CAST((&manager->_font5_terminus8)))->Font::DrawString(debugText,GHIDRA_CAST(&DAT_00c5d134),local_1b8 + 0x10, + Font::DrawString(&manager->_font5_terminus8,debugText,GHIDRA_CAST(&DAT_00c5d134),local_1b8 + 0x10, g_screenWidth * 0.5 - ((float)(uVar6 >> 1) + 0.0),g_screenHeight - 12.0); (GHIDRA_CAST((stageName._buf)))->msvc::string::_Tidy_deallocate(); } @@ -25332,12 +25333,12 @@ void Room::render_water() do { pvVar1 = *gridEntityIt; if ((pvVar1 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 4)) == 7)) { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar1) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(pvVar1) + 0x40)),GHIDRA_CAST(0x0)); layer->_visible = 0; renderOffsetX.x = -(this->_renderSurfaceTopLeft).x; renderOffsetX.y = -(this->_renderSurfaceTopLeft).y; (**(code **)(*GHIDRA_CAST(*gridEntityIt) + 0xc))(); - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(*gridEntityIt) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(*gridEntityIt) + 0x40)),GHIDRA_CAST(0x0)); layer->_visible = 1; } iVar11 = this->_gridWidth; @@ -25352,12 +25353,12 @@ void Room::render_water() do { pvVar1 = *gridEntityIt; if ((pvVar1 != (void *)0x0) && (*GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 4)) == 7)) { - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(pvVar1) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(pvVar1) + 0x40)),GHIDRA_CAST(0x0)); layer->_visible = 0; renderOffsetX.x = -(this->_renderSurfaceTopLeft).x; renderOffsetX.y = -(this->_renderSurfaceTopLeft).y; (**(code **)(*GHIDRA_CAST(*gridEntityIt) + 0xc))(); - layer = (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(*gridEntityIt) + 0x40)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((GHIDRA_INT(*gridEntityIt) + 0x40)),GHIDRA_CAST(0x0)); layer->_visible = 1; } local_18 = local_18 + 1; @@ -27300,16 +27301,16 @@ LAB_00824b4c: uVar3 = Random(); particle = (GHIDRA_CAST((g_game)))->Game::SpawnEx(1000,0x8a,&spawnPos,&velocity,GHIDRA_CAST(0x0),0,uVar3,0); particleSprite = &particle->_sprite; - idleAnimData = (GHIDRA_CAST((particleSprite)))->ANM2::GetAnimationData(s_Idle); + idleAnimData = ANM2::GetAnimationData(particleSprite,s_Idle); uVar3 = *GHIDRA_CAST((GHIDRA_CAST(idleAnimData) + 0x30)); uVar4 = 0; if (uVar3 != 0) { uVar4 = Random(); uVar4 = uVar4 % uVar3; } - bVar2 = (GHIDRA_CAST((particleSprite)))->ANM2::SetAnimation(s_Idle,1); + bVar2 = ANM2::SetAnimation(particleSprite,s_Idle,1); if (((bVar2 != 0) && ((particle->_sprite)._animState._animData != (void *)0x0)) && - ((GHIDRA_CAST((&(particle->_sprite)._animState)))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar4)), + (AnimationState::SetFrameFloat(&(particle->_sprite)._animState,(float)GHIDRA_INT(uVar4)), (particle->_sprite)._animState._animData != (void *)0x0)) { (particle->_sprite)._animState._isPlaying = 0; } @@ -27362,7 +27363,7 @@ LAB_00824b4c: particleColor._tint[3] = (float)((double)GHIDRA_INT(uVar3) + __uint_to_double_fixup[-(GHIDRA_INT(uVar3) >> 0x1f)]) * 2.3283064e-10 * 0.3 + 0.7; - layer = (GHIDRA_CAST((particleSprite)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(particleSprite,GHIDRA_CAST(0x0)); if (&layer->_color != &particleColor) { (layer->_color)._tint[0] = particleColor._tint[0]; (layer->_color)._tint[1] = particleColor._tint[1]; @@ -27687,7 +27688,7 @@ uint8_t Room::spawn_grid_from_desc(uint32_t gridIndex, GridEntityDesc *outDesc, } ExceptionList = ppvVar5; if (outSprite != GHIDRA_CAST(0x0)) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x168)))))->ANM2::ANM2(&pGVar7->_sprite); + ANM2::ANM2(GHIDRA_CAST((GHIDRA_INT(register0x00000010) + -0x168)),&pGVar7->_sprite); other._championColor._offset[1] = in_stack_ffffff90; other._filename._buf[0] = in_stack_fffffe98[0]; other._filename._buf[1] = in_stack_fffffe98[1]; @@ -27788,7 +27789,7 @@ uint8_t Room::spawn_grid_from_desc(uint32_t gridIndex, GridEntityDesc *outDesc, (*GHIDRA_CAST((GHIDRA_CAST(&(other)) + 0x10a))) = SUB42(in_stack_ffffffa0,2); other._shadowLayerIndex = in_stack_ffffffa4; other._bitflags = in_stack_ffffffa8; - (GHIDRA_CAST((outSprite)))->ANM2::operator_assign(other); + ANM2::operator_assign(outSprite,other); } if (outDesc != GHIDRA_CAST(0x0)) { listData = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((pGVar7)) + 0x8)))); @@ -27990,7 +27991,7 @@ Entity_Effect * Room::PickupGridEntity(int GridIndex) gridDesc._varData = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(gridDesc)) + 0x18))) = (*GHIDRA_CAST((GHIDRA_CAST(&(gridDesc)) + 0x18))) & 0xffffff00; gridDesc._variableSeed = 0x16a9de81; - (GHIDRA_CAST((&gridSprite)))->ANM2::constructor(); + ANM2::constructor(&gridSprite); local_14 = 0; isSpawned = spawn_grid_from_desc(this,GridIndex,&gridDesc,&gridSprite); if (isSpawned == 0) { @@ -28013,9 +28014,9 @@ Entity_Effect * Room::PickupGridEntity(int GridIndex) pickupEffect->_state = this->_backdropType; } local_14 = 1; - (GHIDRA_CAST((&gridSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&gridSprite._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&gridSprite._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&gridSprite); + AnimationState::~AnimationState(&gridSprite._overlayAnimState); + AnimationState::~AnimationState(&gridSprite._animState); (GHIDRA_CAST((gridSprite._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&gridSprite))))->msvc::string::_Tidy_deallocate(); ExceptionList = local_1c; @@ -28988,7 +28989,7 @@ void Room::open_red_room_doors(int doorSlot, RoomDescriptor *targetRoom) this_00->_slot = slot; if (((iVar2 == 1) || (iVar2 == 2)) || (iVar2 == 3)) { *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this_00)) + 0x8)))) = 8; - (GHIDRA_CAST((&this_00->_extraSprite)))->ANM2::Reset(); + ANM2::Reset(&this_00->_extraSprite); (GHIDRA_CAST((this_00)))->GridEntity_Door::LoadSprite(); iVar2 = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this_00)) + 0x8)))); } @@ -29510,9 +29511,9 @@ void Room::render_pit_rails(float *param_2) int gridSlotOffset; Vector renderPos; - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((this->_gridEntities + 0x68)))))->ANM2::SetAnimation(GHIDRA_CAST("pitrail"),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((this->_gridEntities + 0x68)),GHIDRA_CAST("pitrail"),1); if (((bVar1 != 0) && (this->_gridEntities[0x75] != (void *)0x0)) && - ((GHIDRA_CAST((GHIDRA_CAST((this->_gridEntities + 0x74)))))->AnimationState::SetFrameFloat(0.0), + (AnimationState::SetFrameFloat(GHIDRA_CAST((this->_gridEntities + 0x74)),0.0), this->_gridEntities[0x75] != (void *)0x0)) { *GHIDRA_CAST((this->_gridEntities + 0x79)) = 0; } diff --git a/generated-src/room_transition.cpp b/generated-src/room_transition.cpp index b010233..230225e 100644 --- a/generated-src/room_transition.cpp +++ b/generated-src/room_transition.cpp @@ -28,9 +28,9 @@ RoomTransition::~RoomTransition() (&this->_sprites,*GHIDRA_CAST((GHIDRA_INT((this->_sprites)._head) + 4))); operator_delete((this->_sprites)._head,0x128); local_8 = 1; - (GHIDRA_CAST((&this->_versusScreenSprite)))->ANM2::Reset(); - (GHIDRA_CAST((&(this->_versusScreenSprite)._overlayAnimState)))->AnimationState::~AnimationState(); - (GHIDRA_CAST((&(this->_versusScreenSprite)._animState)))->AnimationState::~AnimationState(); + ANM2::Reset(&this->_versusScreenSprite); + AnimationState::~AnimationState(&(this->_versusScreenSprite)._overlayAnimState); + AnimationState::~AnimationState(&(this->_versusScreenSprite)._animState); (GHIDRA_CAST(((this->_versusScreenSprite)._animDefaultName._buf)))->msvc::string::_Tidy_deallocate(); (GHIDRA_CAST((GHIDRA_CAST(&this->_versusScreenSprite))))->msvc::string::_Tidy_deallocate(); local_8 = 2; @@ -213,14 +213,14 @@ LAB_0082f4e7: } local_64 = GHIDRA_CAST(&this->_versusScreenSprite); if (isAnm2LoadNeeded != '\0') { - (GHIDRA_CAST((GHIDRA_CAST(local_64))))->ANM2::Load(&anm2Path,1); + ANM2::Load(GHIDRA_CAST(local_64),&anm2Path,1); } if (bossID1 == 99) { local_64 = GHIDRA_CAST(&this->_versusScreenSprite); - layer = (GHIDRA_CAST((GHIDRA_CAST(local_64))))->ANM2::GetLayer(&DAT_0000000b); + layer = ANM2::GetLayer(GHIDRA_CAST(local_64),&DAT_0000000b); layer->_bitflags = layer->_bitflags | 0x60; } - layer = (GHIDRA_CAST((&this->_versusScreenSprite)))->ANM2::GetLayer(&DAT_0000000b); + layer = ANM2::GetLayer(&this->_versusScreenSprite,&DAT_0000000b); layer->_blendMode[0] = 0; layer->_blendMode[1] = 4; layer->_blendMode[2] = 7; @@ -252,27 +252,27 @@ LAB_0082f7d9: psVar4 = GHIDRA_CAST((GHIDRA_INT(local_70) + iVar5 * 0x148)); local_70 = psVar4; if (psVar4 == GHIDRA_CAST(0x0)) goto LAB_0082f7d9; - layer = (GHIDRA_CAST((GHIDRA_CAST(local_64))))->ANM2::GetLayer(&DAT_00000005); + layer = ANM2::GetLayer(GHIDRA_CAST(local_64),&DAT_00000005); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0xc)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0xc)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_0000000f); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_0000000f); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x12)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x12)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x15)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x15)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x10)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x10)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_00000013); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_00000013); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x16)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x16)); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_00000011); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_00000011); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_00000014); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_00000014); layer->_visible = 0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_00000017); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_00000017); pGVar17 = local_7c; layer->_visible = 0; FUN_00831780(psVar4,5,0xc,3); @@ -835,16 +835,16 @@ LAB_0082fd47: } operator_delete(pbVar15,GHIDRA_UINT(texture)); } - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_00000004); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_00000004); (layer->_pos).x = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x4c)); (layer->_pos).y = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x50)); - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_0000000d); (layer->_pos).x = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x4c)); (layer->_pos).y = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x50)); - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_00000009); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_00000009); (layer->_pos).x = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x4c)); (layer->_pos).y = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x50)); - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_0000000e); (layer->_pos).x = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x4c)); fVar13 = *GHIDRA_CAST((GHIDRA_CAST(local_64) + 0x50)); (layer->_pos).y = fVar13; @@ -882,7 +882,7 @@ LAB_0082fd47: local_14 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_UINT(local_14))) + 0x1))) << 8; (GHIDRA_CAST((tmpString._buf)))->msvc::string::_Tidy_deallocate(); local_5d = bossID1 != 0x37; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x2)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x2)); layer->_visible = local_5d; fVar13 = extraout_ECX; } @@ -914,10 +914,10 @@ LAB_0082fd47: if (GHIDRA_CAST(0x1f) < GHIDRA_CAST(((*GHIDRA_CAST((GHIDRA_CAST(&(tmpString._buf)) + 0x0))) + (-4 - GHIDRA_INT(pbVar15))))) goto LAB_00830911; } operator_delete(pbVar15,GHIDRA_UINT(texture)); - (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::LoadGraphics((uint8_t)texture); + ANM2::LoadGraphics(GHIDRA_CAST(versusSprite),(uint8_t)texture); LAB_0083041c: - layer = (GHIDRA_CAST((GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(GHIDRA_CAST(0x2)); - piVar8 = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&portraitTexture); + layer = ANM2::GetLayer(GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)),GHIDRA_CAST(0x2)); + piVar8 = LayerState::GetTexture(layer,&portraitTexture); local_14 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))),0x10); local_6c = GHIDRA_CAST((cleanupFlags | 2)); cleanupFlags = GHIDRA_UINT(local_6c); @@ -926,8 +926,8 @@ LAB_0083047c: local_5d = 0; } else { - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x2)); - texture = (GHIDRA_CAST((layer)))->LayerState::GetTexture(&local_2c); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x2)); + texture = LayerState::GetTexture(layer,&local_2c); local_14 = 0x11; local_6c = GHIDRA_CAST((cleanupFlags | 4)); cleanupFlags = GHIDRA_UINT(local_6c); @@ -957,38 +957,38 @@ LAB_0083047c: } versusAnm2 = GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)); if (local_5d == 0) { - layer = (GHIDRA_CAST((versusAnm2)))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(versusAnm2,GHIDRA_CAST(0x0)); (layer->_color)._tint[0] = 0.0; (layer->_color)._tint[1] = 0.0; (layer->_color)._tint[2] = 0.0; (layer->_color)._tint[3] = 1.0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_0000000d); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 0.5568628; (layer->_color)._tint[2] = 0.4666667; (layer->_color)._tint[3] = 1.0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_0000000e); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 0.5568628; (layer->_color)._tint[2] = 0.4666667; (layer->_color)._tint[3] = 1.0; } else { - layer = (GHIDRA_CAST((versusAnm2)))->ANM2::GetLayer(GHIDRA_CAST(0x2)); - (GHIDRA_CAST((layer)))->LayerState::GetTexture(&portraitTexture); + layer = ANM2::GetLayer(versusAnm2,GHIDRA_CAST(0x2)); + LayerState::GetTexture(layer,&portraitTexture); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0x14; (**(code **)(*portraitTexture + 0x30))(0,0,2,1,&local_2c); - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x0)); (layer->_color)._tint[3] = 1.0; (layer->_color)._tint[0] = (float)local_2c * 0.003921569; (layer->_color)._tint[1] = (float)pixelGreen * 0.003921569; (layer->_color)._tint[2] = (float)pixelBlue * 0.003921569; - layer = (GHIDRA_CAST((GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)),&DAT_0000000d); (layer->_color)._tint[3] = 1.0; (layer->_color)._tint[0] = (float)((GHIDRA_UINT(local_28) & 0xff) * 2) * 0.003921569; (layer->_color)._tint[1] = (float)((GHIDRA_UINT(local_28) >> 8 & 0xff) * 2) * 0.003921569; (layer->_color)._tint[2] = (float)((GHIDRA_UINT(local_28) >> 0x10 & 0xff) * 2) * 0.003921569; - layer = (GHIDRA_CAST((GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)),&DAT_0000000e); (layer->_color)._tint[0] = (float)((GHIDRA_UINT(local_28) & 0xff) * 2) * 0.003921569; (layer->_color)._tint[1] = (float)((GHIDRA_UINT(local_28) >> 8 & 0xff) * 2) * 0.003921569; (layer->_color)._tint[2] = (float)((GHIDRA_UINT(local_28) >> 0x10 & 0xff) * 2) * 0.003921569; @@ -1003,7 +1003,7 @@ LAB_0083047c: versusSprite = GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)); } if (bossID1 == 0x37) { - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),GHIDRA_CAST(0x0)); (layer->_color)._tint[0] = 0.0; (layer->_color)._tint[1] = 0.0; (layer->_color)._tint[2] = 0.0; @@ -1012,19 +1012,19 @@ LAB_0083047c: } else { LAB_0083066a: - (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::LoadGraphics(SUB41(fVar13,0)); + ANM2::LoadGraphics(GHIDRA_CAST(versusSprite),SUB41(fVar13,0)); if (bossID1 != 99) goto LAB_0083041c; - layer = (GHIDRA_CAST((GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)))))->ANM2::GetLayer(GHIDRA_CAST(0x0)); + layer = ANM2::GetLayer(GHIDRA_CAST((pGVar17->_roomList[0]._doors + 2)),GHIDRA_CAST(0x0)); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 1.0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_0000000d); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_0000000d); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; (layer->_color)._tint[3] = 1.0; - layer = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::GetLayer(&DAT_0000000e); + layer = ANM2::GetLayer(GHIDRA_CAST(versusSprite),&DAT_0000000e); (layer->_color)._tint[0] = 1.0; (layer->_color)._tint[1] = 1.0; (layer->_color)._tint[2] = 1.0; @@ -1058,26 +1058,26 @@ LAB_0083077d: operator_delete(pbVar15,GHIDRA_UINT(texture)); bVar1 = extraout_CL_00; } - (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::LoadGraphics(bVar1); + ANM2::LoadGraphics(GHIDRA_CAST(versusSprite),bVar1); if ((g_manager->_netplayManager == *GHIDRA_CAST((g_manager + 1))) || (uVar3 = (GHIDRA_CAST((&g_game->_playerManager)))->PlayerManager::count_main_players(), uVar3 < 2)) { pcVar20 = "DoubleTrouble"; goto LAB_008308ce; } - (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::Play(GHIDRA_CAST("DoubleTroubleCoop"),1); + ANM2::Play(GHIDRA_CAST(versusSprite),GHIDRA_CAST("DoubleTroubleCoop"),1); } else if ((g_manager->_netplayManager == *GHIDRA_CAST((g_manager + 1))) || (uVar3 = (GHIDRA_CAST((&g_game->_playerManager)))->PlayerManager::count_main_players(), uVar3 < 2)) { pcVar20 = "Scene"; LAB_008308ce: - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::SetAnimation(GHIDRA_CAST(pcVar20),1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(versusSprite),GHIDRA_CAST(pcVar20),1); if (bVar1 != 0) { - (GHIDRA_CAST((&versusSprite->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&versusSprite->_animState); (versusSprite->_animState)._isPlaying = 1; } } else { - (GHIDRA_CAST((GHIDRA_CAST(versusSprite))))->ANM2::Play(GHIDRA_CAST("SceneCoop"),1); + ANM2::Play(GHIDRA_CAST(versusSprite),GHIDRA_CAST("SceneCoop"),1); } pGVar17->_stage = 2; if (GHIDRA_CAST(&DAT_0000000f) < anm2Path._capacity) { @@ -1343,7 +1343,7 @@ LAB_00830e96: (GHIDRA_CAST((GHIDRA_INT(local_50.y) + 0x33c)))->y = (float)piVar10; (GHIDRA_CAST((GHIDRA_CAST(local_50.y))))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST("Appear")); if (((GHIDRA_CAST((GHIDRA_INT(fVar8) + 0x48)))->_animState)._animData != (void *)0x0) { - (GHIDRA_CAST((&(GHIDRA_CAST((GHIDRA_INT(fVar8) + 0x48)))->_animState)))->AnimationState::SetFrameFloat(2.0); + AnimationState::SetFrameFloat(&(GHIDRA_CAST((GHIDRA_INT(fVar8) + 0x48)))->_animState,2.0); } *GHIDRA_CAST((GHIDRA_CAST(fVar8) + 0x410)) = 0; fVar8 = local_48.y; @@ -1393,7 +1393,7 @@ LAB_00831623: if (pEVar9 != GHIDRA_CAST(0x0)) { (GHIDRA_CAST((pEVar9)))->Entity_Player::PlayExtraAnimation(GHIDRA_CAST("Appear")); if ((pEVar9->_sprite)._animState._animData != (void *)0x0) { - (GHIDRA_CAST((&(pEVar9->_sprite)._animState)))->AnimationState::SetFrameFloat(2.0); + AnimationState::SetFrameFloat(&(pEVar9->_sprite)._animState,2.0); } game = g_game; pEVar9->_isControlsEnabled = 0; @@ -1535,21 +1535,21 @@ LAB_00831497: *GHIDRA_CAST((GHIDRA_CAST(player) + 0x33c)) = fVar8; *GHIDRA_CAST((GHIDRA_CAST(player) + 0x340)) = pEVar9; *GHIDRA_CAST((GHIDRA_CAST(player) + 0x139a)) = 0; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(player) + 0x41c)))))->ANM2::Reset(); + ANM2::Reset(GHIDRA_CAST((GHIDRA_INT(player) + 0x41c))); *GHIDRA_CAST((GHIDRA_CAST(player) + 0x14c)) = 0x3f800000; - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(player) + 0x98)))))->AnimationState::SetAnimationData((void *)0x0); + AnimationState::SetAnimationData(GHIDRA_CAST((GHIDRA_INT(player) + 0x98)),(void *)0x0); local_40 = GHIDRA_CAST((GHIDRA_INT(player) + 0x48)); - isAnimSet = (GHIDRA_CAST((local_40)))->ANM2::SetAnimation(s_Jump,1); + isAnimSet = ANM2::SetAnimation(local_40,s_Jump,1); playerSprite = local_40; if (isAnimSet != 0) { - (GHIDRA_CAST((&local_40->_animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&local_40->_animState); (playerSprite->_animState)._isPlaying = 1; player = local_48.y; } *GHIDRA_CAST((GHIDRA_CAST(player) + 0x1398)) = 1; *GHIDRA_CAST((GHIDRA_CAST(player) + 0x139a)) = 0; if (*GHIDRA_CAST((GHIDRA_CAST(player) + 0x7c)) != 0) { - (GHIDRA_CAST((GHIDRA_CAST((GHIDRA_INT(player) + 0x78)))))->AnimationState::SetFrameFloat(local_50.y); + AnimationState::SetFrameFloat(GHIDRA_CAST((GHIDRA_INT(player) + 0x78)),local_50.y); } game = g_game; pfVar4 = &local_48.y; @@ -1797,7 +1797,7 @@ void RoomTransition::Update() if ((((iVar12 == 0xb) || (iVar12 == 0x10)) || (iVar12 == 0x13)) && (((local_50 != GHIDRA_CAST(0x0) && (idlePlayer != GHIDRA_CAST(0x0))) && (5 < GHIDRA_INT(local_60))))) { - psVar6 = (GHIDRA_CAST((GHIDRA_CAST(&(local_50->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(animName)); + psVar6 = ANM2::GetAnimation(GHIDRA_CAST(&(local_50->_sprite)._animState),GHIDRA_CAST(animName)); local_8 = GHIDRA_CAST(0x0); if (0xf < psVar6->_capacity) { psVar6 = *GHIDRA_CAST(psVar6->_buf); @@ -1967,14 +1967,14 @@ LAB_00831dc6: ChangeRoom(this); } else { - (GHIDRA_CAST((&this->_versusScreenSprite)))->ANM2::Update(); + ANM2::Update(&this->_versusScreenSprite); piVar8 = (this->_sprites)._head; piVar13 = GHIDRA_CAST(*piVar8); if (piVar13 != piVar8) { do { if (*GHIDRA_CAST((GHIDRA_CAST(piVar13) + 0x11d)) != '\0') { - (GHIDRA_CAST((GHIDRA_CAST((piVar13 + 0x11)))))->AnimationState::Update(); - (GHIDRA_CAST((GHIDRA_CAST((piVar13 + 0x19)))))->AnimationState::Update(); + AnimationState::Update(GHIDRA_CAST((piVar13 + 0x11))); + AnimationState::Update(GHIDRA_CAST((piVar13 + 0x19))); } piVar8 = GHIDRA_CAST(piVar13[2]); if (*GHIDRA_CAST((GHIDRA_CAST(piVar8) + 0xd)) == '\0') { diff --git a/generated-src/score_sheet.cpp b/generated-src/score_sheet.cpp index ee87ac1..8817ff0 100644 --- a/generated-src/score_sheet.cpp +++ b/generated-src/score_sheet.cpp @@ -30,7 +30,7 @@ void ScoreSheet::LoadAnm2() scoreAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(scoreAnmPath._buf))) + 0x0))),"gfx/ui/ScoreMenu.anm2",0x16); local_14 = 0; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))))))->ANM2::Load(&scoreAnmPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))),&scoreAnmPath,1); local_14 = 0xffffffff; if (0xf < scoreAnmPath._capacity) { uVar2 = scoreAnmPath._capacity + 1; @@ -56,7 +56,7 @@ void ScoreSheet::LoadAnm2() leaderboardAnmPath._capacity = 0x1f; builtin_strncpy((*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(leaderboardAnmPath._buf))) + 0x0))),"gfx/ui/LeaderboardMenu.anm2",0x1c); local_14 = 1; - (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x61])) + 0x1)))))))->ANM2::Load(&leaderboardAnmPath,1); + ANM2::Load(GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x61])) + 0x1)))),&leaderboardAnmPath,1); if (0xf < leaderboardAnmPath._capacity) { uVar2 = leaderboardAnmPath._capacity + 1; pcVar1 = (*GHIDRA_CAST((GHIDRA_CAST(&(GHIDRA_CAST(leaderboardAnmPath._buf))) + 0x0))); diff --git a/generated-src/sprite.cpp b/generated-src/sprite.cpp index 3eb778f..0d6fa6d 100644 --- a/generated-src/sprite.cpp +++ b/generated-src/sprite.cpp @@ -40,88 +40,13 @@ uint8_t Sprite::FlipY() return this->_flipY; } -// 0040a140 -void Sprite::RenderLayer(int layerId, Vector *position, Vector *topLeftClamp, Vector *bottomRightClamp) -{ - if (this->_loaded != 0) { - if (this->_overlayRenderFirst != 0) { - FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); - FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); - return; - } - FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); - FUN_0040a080(layerId,position,topLeftClamp,bottomRightClamp); - } - return; -} - -// 0040a2b0 -void Sprite::PlayRandom(uint32_t seed) -{ - uint8_t bVar1; - uint8_t *curAnimName; - uint32_t cmpResult; - uint8_t *animNameCursor; - uint8_t *anim; - bool isLess; - uint8_t *curAnimData; - - if (this->_animCount == 0) { - KAGE_LogMessage(1,GHIDRA_CAST("[warn] PlayRandom: no animations\n")); - return; - } - anim = GHIDRA_CAST(((seed % GHIDRA_UINT(this->_animCount)) * 0x13c + GHIDRA_INT(this->_animData))); - if (0xf < *GHIDRA_CAST((anim + 0x14))) { - anim = *GHIDRA_CAST(anim); - } - curAnimData = (this->_animState)._animData; - if (curAnimData != GHIDRA_CAST(0x0)) { - curAnimName = curAnimData; - if (0xf < *GHIDRA_CAST((curAnimData + 0x14))) { - curAnimName = *GHIDRA_CAST(curAnimData); - } - animNameCursor = anim; - do { - bVar1 = *curAnimName; - isLess = bVar1 < *animNameCursor; - if (bVar1 != *animNameCursor) { -LAB_0040a320: - cmpResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_0040a325; - } - if (bVar1 == 0) break; - bVar1 = curAnimName[1]; - isLess = bVar1 < animNameCursor[1]; - if (bVar1 != animNameCursor[1]) goto LAB_0040a320; - curAnimName = curAnimName + 2; - animNameCursor = animNameCursor + 2; - } while (bVar1 != 0); - cmpResult = 0; -LAB_0040a325: - if (cmpResult == 0) { - if (curAnimData[0x34] == 0) { - return; - } - if ((this->_animState)._isPlaying != 0) { - return; - } - } - } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::SetAnimation(anim,1); - if (bVar1 != 0) { - (GHIDRA_CAST((&this->_animState)))->AnimationState::Rewind(); - (this->_animState)._isPlaying = 1; - } - return; -} - // 0040a360 void Sprite::Play(std_string *animName, uint8_t isForce) { if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::Play(GHIDRA_CAST(animName),isForce); + ANM2::Play(GHIDRA_CAST(this),GHIDRA_CAST(animName),isForce); return; } @@ -133,7 +58,7 @@ void Sprite::IsPlaying(uint8_t *param_1) if (0xf < *GHIDRA_CAST((param_1 + 0x14))) { param_1 = *GHIDRA_CAST(param_1); } - (GHIDRA_CAST((in_ECX)))->ANM2::IsPlaying(param_1); + ANM2::IsPlaying(in_ECX,param_1); return; } @@ -145,7 +70,7 @@ uint8_t Sprite::IsFinished(std_string *animName) if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::IsFinishedImpl(GHIDRA_CAST(animName)); + bVar1 = ANM2::IsFinishedImpl(GHIDRA_CAST(this),GHIDRA_CAST(animName)); return bVar1; } @@ -157,7 +82,7 @@ uint8_t Sprite::SetAnimation(std_string *name, uint8_t isReset) if (0xf < name->_capacity) { name = *GHIDRA_CAST(name->_buf); } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::SetAnimation(GHIDRA_CAST(name),isReset); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST(this),GHIDRA_CAST(name),isReset); return bVar1; } @@ -165,26 +90,7 @@ uint8_t Sprite::SetAnimation(std_string *name, uint8_t isReset) void Sprite::SetFrame_1(int frame) { if ((this->_animState)._animData != (void *)0x0) { - (GHIDRA_CAST((&this->_animState)))->AnimationState::SetFrameFloat((float)frame); - } - return; -} - -// 0040a760 -void Sprite::SetLastFrame() -{ - if ((this->_animState)._animData != (void *)0x0) { - AnimationState::AdvancePosition - (&this->_animState,*GHIDRA_CAST((GHIDRA_INT((this->_animState)._animData) + 0x30)) + -1); - } - return; -} - -// 0040a910 -void Sprite::Stop() -{ - if ((this->_animState)._animData != (void *)0x0) { - (this->_animState)._isPlaying = 0; + AnimationState::SetFrameFloat(&this->_animState,(float)frame); } return; } @@ -197,7 +103,7 @@ void Sprite::PlayOverlay(uint8_t *param_1, uint8_t param_2) if (0xf < *GHIDRA_CAST((param_1 + 0x14))) { param_1 = *GHIDRA_CAST(param_1); } - (GHIDRA_CAST((in_ECX)))->ANM2::PlayOverlay(param_1,param_2); + ANM2::PlayOverlay(in_ECX,param_1,param_2); return; } @@ -223,7 +129,7 @@ uint8_t Sprite::SetOverlayAnimation(std_string *animName, uint8_t isReset) if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::SetOverlayAnimation(GHIDRA_CAST(animName),isReset); + bVar1 = ANM2::SetOverlayAnimation(GHIDRA_CAST(this),GHIDRA_CAST(animName),isReset); return bVar1; } @@ -235,29 +141,13 @@ void Sprite::SetOverlayFrame(std_string *animName, int frame) if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - isAnimationSet = (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::SetOverlayAnimation(GHIDRA_CAST(animName),1); + isAnimationSet = ANM2::SetOverlayAnimation(GHIDRA_CAST(this),GHIDRA_CAST(animName),1); if ((isAnimationSet != 0) && ((this->_overlayAnimState)._animData != (void *)0x0)) { - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::SetFrameFloat((float)frame); + AnimationState::SetFrameFloat(&this->_overlayAnimState,(float)frame); } return; } -// 0040ac50 -int Sprite::GetOverlayFrame() -{ - if ((this->_overlayAnimState)._animData == (void *)0x0) { - return -1; - } - return GHIDRA_INT((this->_overlayAnimState)._animFrame); -} - -// 0040ac60 -void Sprite::RemoveOverlay() -{ - (GHIDRA_CAST((&this->_overlayAnimState)))->AnimationState::SetAnimationData((void *)0x0); - return; -} - // 0040b000 uint8_t Sprite::IsEventTriggered(void *eventName) { @@ -269,7 +159,7 @@ uint8_t Sprite::IsEventTriggered(void *eventName) if ((this->_animState)._animData == (void *)0x0) { return 0; } - isTriggered = (GHIDRA_CAST((&this->_animState)))->AnimationState::IsEventTriggered(eventName); + isTriggered = AnimationState::IsEventTriggered(&this->_animState,eventName); return isTriggered; } @@ -284,28 +174,16 @@ uint8_t Sprite::WasEventTriggered(std_string *eventName) if ((this->_animState)._animData == (void *)0x0) { return 0; } - local_AL_32 = (GHIDRA_CAST((&this->_animState)))->AnimationState::WasEventTriggered(GHIDRA_CAST(eventName)); + local_AL_32 = AnimationState::WasEventTriggered(&this->_animState,GHIDRA_CAST(eventName)); return local_AL_32; } -// 0040b1d0 -void * Sprite::GetNullFrame(uint8_t *nullLayerName) -{ - void *nullFrame; - - if ((this->_animState)._animData == (void *)0x0) { - return (void *)0x0; - } - nullFrame = (GHIDRA_CAST((&this->_animState)))->AnimationState::GetNullFrame(nullLayerName); - return nullFrame; -} - // 0040b200 LayerState * Sprite::GetLayer(uint8_t *layerName) { LayerState *layer; - layer = (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::GetLayer(layerName); + layer = ANM2::GetLayer(GHIDRA_CAST(this),layerName); return layer; } @@ -347,51 +225,10 @@ KColor * Sprite::GetTexel(KColor *param_2, float param_3, float param_4, float p return param_2; } -// 0040bf30 -uint8_t Sprite::ReplaceSpritesheet(int layerId, std_string *pngFilename) -{ - uint32_t lengthA; - uint8_t isSamePath; - int layerOffset; - std_string *layerPathData; - std_string *newPathData; - std_string *layerPath; - void *layerStates; - - if ((-1 < layerId) && (layerId < this->_layerCount)) { - layerStates = this->_layerState; - layerOffset = layerId * 0xa0; - layerPath = GHIDRA_CAST((layerOffset + 8 + GHIDRA_INT(layerStates))); - layerPathData = layerPath; - if (0xf < layerPath->_capacity) { - layerPathData = *GHIDRA_CAST(layerPath->_buf); - } - lengthA = pngFilename->_size; - newPathData = pngFilename; - if (0xf < pngFilename->_capacity) { - newPathData = *GHIDRA_CAST(pngFilename->_buf); - } - isSamePath = str_eq(GHIDRA_CAST(newPathData),lengthA,GHIDRA_CAST(layerPathData),layerPath->_size); - if (isSamePath == 0) { - if (layerPath == pngFilename) { - *GHIDRA_CAST((layerOffset + 0x30 + GHIDRA_INT(layerStates))) = 0; - return 1; - } - if (0xf < pngFilename->_capacity) { - pngFilename = *GHIDRA_CAST(pngFilename->_buf); - } - (GHIDRA_CAST((GHIDRA_CAST(layerPath))))->msvc::string::assign(GHIDRA_CAST(pngFilename),lengthA); - *GHIDRA_CAST((layerOffset + 0x30 + GHIDRA_INT(this->_layerState))) = 0; - return 1; - } - } - return 0; -} - // 0040bff0 void Sprite::LoadGraphics() { - (GHIDRA_CAST((GHIDRA_CAST(this))))->ANM2::LoadGraphics((uint8_t)this); + ANM2::LoadGraphics(GHIDRA_CAST(this),(uint8_t)this); return; } @@ -435,13 +272,6 @@ void Sprite::SetOverlayRenderPriority(uint8_t param_2) return; } -// 00435c60 -void Sprite::set_flip_x(uint8_t isFlipX) -{ - this->_flipX = isFlipX; - return; -} - // 0043ee80 void Sprite::SetRotation(float rotation) { @@ -474,62 +304,3 @@ Vector * Sprite::Offset() { return &this->_offset; } - -// 004a5cf0 -std_string * Sprite::GetDefaultAnimationName() -{ - return &this->_animDefaultName; -} - -// 0085db20 -char * Sprite::GetAnimation(char *param_2) -{ - void *animData; - - animData = (this->_animState)._animData; - if (animData == (void *)0x0) { - param_2[0] = '\0'; - param_2[1] = '\0'; - param_2[2] = '\0'; - param_2[3] = '\0'; - param_2[0x10] = '\0'; - param_2[0x11] = '\0'; - param_2[0x12] = '\0'; - param_2[0x13] = '\0'; - param_2[0x14] = '\x0f'; - param_2[0x15] = '\0'; - param_2[0x16] = '\0'; - param_2[0x17] = '\0'; - *param_2 = '\0'; - param_2[0x10] = '\0'; - param_2[0x11] = '\0'; - param_2[0x12] = '\0'; - param_2[0x13] = '\0'; - *param_2 = '\0'; - return param_2; - } - (GHIDRA_CAST((param_2)))->msvc::string::string(animData); - return param_2; -} - -// 0085db70 -std_string * Sprite::GetOverlayAnimation(std_string *outName) -{ - void *animData; - - animData = (this->_overlayAnimState)._animData; - if (animData == (void *)0x0) { - outName->_buf[0] = '\0'; - outName->_buf[1] = '\0'; - outName->_buf[2] = '\0'; - outName->_buf[3] = '\0'; - outName->_size = 0; - outName->_capacity = 0xf; - outName->_buf[0] = '\0'; - outName->_size = 0; - outName->_buf[0] = '\0'; - return outName; - } - (GHIDRA_CAST((outName->_buf)))->msvc::string::string(animData); - return outName; -} diff --git a/generated-src/stage_transition.cpp b/generated-src/stage_transition.cpp index 93a5f78..7a8b5d5 100644 --- a/generated-src/stage_transition.cpp +++ b/generated-src/stage_transition.cpp @@ -173,9 +173,9 @@ LAB_0092f849: if (((trapdoor == GHIDRA_CAST(0x0)) || (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((trapdoor)) + 0x4)))) != 0x11)) || (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((trapdoor)) + 0x8)))) != 0)) goto LAB_0092f849; if (local_2e != '\0') { - bVar3 = (GHIDRA_CAST((&trapdoor->_sprite)))->ANM2::SetAnimation(GHIDRA_CAST("Player Exit"),1); + bVar3 = ANM2::SetAnimation(&trapdoor->_sprite,GHIDRA_CAST("Player Exit"),1); if (bVar3 != 0) { - (GHIDRA_CAST((&(trapdoor->_sprite)._animState)))->AnimationState::Rewind(); + AnimationState::Rewind(&(trapdoor->_sprite)._animState); (trapdoor->_sprite)._animState._isPlaying = 1; } if (*GHIDRA_CAST((GHIDRA_CAST(g_game->_room) + 0x7240)) <= 0.2) { @@ -255,7 +255,7 @@ LAB_0092f849: } if (((trapdoorGrid->_sprite)._animState._animData == (void *)0x0) || ((trapdoorGrid->_sprite)._animState._isPlaying == 0)) goto LAB_0092f849; - (GHIDRA_CAST((&trapdoorGrid->_sprite)))->ANM2::Update(); + ANM2::Update(&trapdoorGrid->_sprite); cVar8 = '\0'; } catchUpPlayer = waitingPlayer; @@ -264,7 +264,7 @@ LAB_0092f849: if (cVar8 == '\0') goto LAB_0092f901; } else { - animName = (GHIDRA_CAST((GHIDRA_CAST(&(player->_sprite)._animState))))->ANM2::GetAnimation(GHIDRA_CAST(tmpString)); + animName = ANM2::GetAnimation(GHIDRA_CAST(&(player->_sprite)._animState),GHIDRA_CAST(tmpString)); local_8 = (void *)0x0; if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); diff --git a/generated-src/stat_hud.cpp b/generated-src/stat_hud.cpp index 0cf8e00..730f8e7 100644 --- a/generated-src/stat_hud.cpp +++ b/generated-src/stat_hud.cpp @@ -104,7 +104,7 @@ void StatHUD::Render(float *param_1) } else { if (*GHIDRA_CAST((in_ECX + 0x34)) != 0) { - (GHIDRA_CAST((GHIDRA_CAST((in_ECX + 0x30)))))->AnimationState::SetFrameFloat((float)GHIDRA_INT(uVar4)); + AnimationState::SetFrameFloat(GHIDRA_CAST((in_ECX + 0x30)),(float)GHIDRA_INT(uVar4)); } *GHIDRA_CAST((in_ECX + 0xb4)) = 0x3f000000; if (*GHIDRA_CAST((in_ECX + 0x109)) != '\0') { @@ -238,7 +238,7 @@ LAB_0084c717: local_78._unk = 0; local_8 = 0; local_48 = local_4c; - glyphs = (GHIDRA_CAST((font)))->Font::measure_string(glyphBuffer,textBuffers + 0xc,&local_80,&g_vectorOne) + glyphs = Font::measure_string(font,glyphBuffer,textBuffers + 0xc,&local_80,&g_vectorOne) ; local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); color._green = (float)local_48; @@ -287,7 +287,7 @@ LAB_0084c717: local_98 = 0; local_94 = 0; local_8 = 2; - (GHIDRA_CAST((font)))->Font::DrawString(textBuffers,&local_78,&local_ac,spacing + textX + 30.0,textY); + Font::DrawString(font,textBuffers,&local_78,&local_ac,spacing + textX + 30.0,textY); } local_8 = 0xffffffff; auVar6 = ZEXT416(GHIDRA_UINT(rowY)); diff --git a/generated-src/string_table.cpp b/generated-src/string_table.cpp deleted file mode 100644 index 7dd4201..0000000 --- a/generated-src/string_table.cpp +++ /dev/null @@ -1,1280 +0,0 @@ -#include "classes.h" - -// 00a26710 -void StringTable::constructor() -{ - void *mapHead; - StringTable *in_ECX; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b11ae0; - local_10 = ExceptionList; - ExceptionList = &local_10; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((in_ECX)) + 0x4)))) = 0; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((in_ECX)) + 0x8)))) = 0; - mapHead = operator_new(0x18); - *(void **)mapHead = mapHead; - *(void **)(GHIDRA_CAST(mapHead) + 4) = mapHead; - *(void **)(GHIDRA_CAST(mapHead) + 8) = mapHead; - *GHIDRA_CAST((GHIDRA_CAST(mapHead) + 0xc)) = 0x101; - *(void **)&(*GHIDRA_CAST((GHIDRA_CAST((in_ECX)) + 0x4))) = mapHead; - local_8 = 0; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((in_ECX)) + 0xc)))) = 0; - *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((in_ECX)) + 0x10)))) = 0; - mapHead = operator_new(0x28); - *(void **)mapHead = mapHead; - *(void **)(GHIDRA_CAST(mapHead) + 4) = mapHead; - *(void **)(GHIDRA_CAST(mapHead) + 8) = mapHead; - *GHIDRA_CAST((GHIDRA_CAST(mapHead) + 0xc)) = 0x101; - *(void **)&(*GHIDRA_CAST((GHIDRA_CAST((in_ECX)) + 0xc))) = mapHead; - *GHIDRA_CAST((in_ECX + 1)) = 0; - clear(in_ECX); - ExceptionList = local_10; - return; -} - -// 00a26810 -uint8_t StringTable::Load(uint8_t *fileName) -{ - uint8_t *fullPath; - uint8_t *knownExtChar; - uint32_t compareResult; - uint8_t *extCursor; - bool isLess; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - uint8_t ch; - - local_8 = 0xffffffff; - puStack_c = &LAB_00af12f0; - local_10 = ExceptionList; - ExceptionList = &local_10; - fullPath = path_join(fileName,GHIDRA_CAST(0x0),0,0); - if (fullPath == GHIDRA_CAST(0x0)) { - ExceptionList = local_10; - return 0; - } - extCursor = fullPath; - do { - ch = *extCursor; - extCursor = extCursor + 1; - } while (ch != 0); - ch = fullPath[GHIDRA_INT(extCursor) - GHIDRA_INT((fullPath + 1))]; - extCursor = fullPath + (GHIDRA_INT(extCursor) - GHIDRA_INT((fullPath + 1))); - while ((ch != 0x2e && (extCursor != fullPath))) { - extCursor = extCursor + -1; - ch = *extCursor; - } - extCursor = extCursor + 1; - clear(this); - (*GHIDRA_CAST((GHIDRA_CAST(&(fileName)) + 0x3))) = 0; - knownExtChar = &DAT_00b9c154; - do { - ch = *extCursor; - isLess = ch < *knownExtChar; - if (ch != *knownExtChar) { -LAB_00a268c0: - compareResult = -GHIDRA_UINT(isLess) | 1; - goto LAB_00a268c5; - } - if (ch == 0) break; - ch = extCursor[1]; - isLess = ch < knownExtChar[1]; - if (ch != knownExtChar[1]) goto LAB_00a268c0; - extCursor = extCursor + 2; - knownExtChar = knownExtChar + 2; - } while (ch != 0); - compareResult = 0; -LAB_00a268c5: - if (compareResult == 0) { - (*GHIDRA_CAST((GHIDRA_CAST(&(fileName)) + 0x3))) = StringTable::load_file(fullPath); - } - local_8 = 0; - tracked_alloc(1,fullPath,0); - if (((*GHIDRA_CAST((GHIDRA_CAST(&(fileName)) + 0x3))) != 0) && (*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))) != 0)) { - *GHIDRA_CAST(this) = *GHIDRA_CAST((**GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))) + 0x10)); - } - ExceptionList = local_10; - return (*GHIDRA_CAST((GHIDRA_CAST(&(fileName)) + 0x3))); -} - -// 00a26d30 -uint8_t * StringTable::get_string_by_index(uint8_t *category, int language, uint32_t keyIndex) -{ - uint8_t *pbVar1; - int iVar2; - uint32_t uVar3; - void *categoryName; - uint8_t findResult [8]; - int languageNode; - int languageIndex; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - iVar2 = language; - local_8 = 0xffffffff; - puStack_c = &LAB_00b11b40; - local_10 = ExceptionList; - uVar3 = __security_cookie ^ GHIDRA_UINT((findResult + 0x1c)); - ExceptionList = &local_10; - msvc::set::find_node(findResult,&language); - if ((*GHIDRA_CAST((languageNode + 0xd)) != '\0') || (iVar2 < *GHIDRA_CAST((languageNode + 0x10)))) { - languageNode = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4)))); - } - if (languageNode != *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x4))))) { - languageIndex = *GHIDRA_CAST((languageNode + 0x14)); - if ((-1 < languageIndex) && (languageIndex <= *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0x8)))))) { - categoryName = (void *)string_duplicate_lower(uVar3); - language = GHIDRA_INT(categoryName); - msvc::map::find(&category,&language); - pbVar1 = category; - if (category == *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((this)) + 0xc))))) { - if (categoryName != (void *)0x0) { - local_8 = 1; - tracked_alloc(1,categoryName,0); - } - ExceptionList = local_10; - return GHIDRA_CAST("StringTable::InvalidCategory"); - } - if (GHIDRA_UINT((*GHIDRA_CAST((category + 0x20)) - *GHIDRA_CAST((category + 0x1c)) >> 2)) <= keyIndex) { - if (categoryName != (void *)0x0) { - local_8 = 2; - tracked_alloc(1,categoryName,0); - } - ExceptionList = local_10; - return GHIDRA_CAST("StringTable::InvalidKeyIndex"); - } - msvc::map::find(&language,*GHIDRA_CAST((category + 0x1c)) + keyIndex * 4); - if (language == *GHIDRA_CAST((pbVar1 + 0x14))) { - if (categoryName != (void *)0x0) { - local_8 = 3; - tracked_alloc(1,categoryName,0); - } - ExceptionList = local_10; - return GHIDRA_CAST("StringTable::InvalidKey"); - } - pbVar1 = *GHIDRA_CAST((*GHIDRA_CAST((language + 0x14)) + languageIndex * 4)); - if (pbVar1 == GHIDRA_CAST(0x0)) { - if (categoryName != (void *)0x0) { - local_8 = 4; - tracked_alloc(1,categoryName,0); - } - ExceptionList = local_10; - return GHIDRA_CAST("StringTable::UntranslatedString"); - } - if (categoryName != (void *)0x0) { - local_8 = 5; - tracked_alloc(1,categoryName,0); - } - ExceptionList = local_10; - return pbVar1; - } - } - ExceptionList = local_10; - return GHIDRA_CAST("StringTable::InvalidLanguage"); -} - -// 00a26f20 -uint32_t StringTable::load_file(uint8_t *param_1) -{ - uint8_t bVar1; - void *pvVar2; - int64_t lVar3; - uint32_t uVar4; - int *piVar5; - int iVar6; - void *pvVar7; - uint32_t *puVar8; - void **this; - uint8_t *pbVar9; - uint8_t *pbVar10; - uint8_t *pbVar11; - int iVar12; - void **this_00; - char *pcVar13; - char *pcVar14; - bool bVar15; - uint8_t auStack_100a4 [8]; - int iStack_1009c; - char *pcStack_10098; - uint8_t *pbStack_10094; - int iStack_10090; - int iStack_1008c; - void *pvStack_10088; - void *pvStack_10084; - void *pvStack_10080; - void *pvStack_1007c; - void *pvStack_10078; - uint32_t *puStack_10074; - uint8_t *puStack_10070; - uint8_t *pbStack_1006c; - uint32_t *puStack_10068; - char *pcStack_10064; - uint32_t *puStack_10060; - uint8_t *pbStack_1005c; - uint8_t auStack_10058 [48]; - uint8_t auStack_10028 [65560]; - void *local_10; - uint8_t *puStack_c; - uint32_t local_8; - - local_8 = 0xffffffff; - puStack_c = &LAB_00b11b7b; - local_10 = ExceptionList; - uVar4 = __security_cookie ^ GHIDRA_UINT((auStack_10028 + 0x10024)); - ExceptionList = &local_10; - piVar5 = (GHIDRA_CAST((&PTR_vftable_00c37a10)))->FileSystem::Open(param_1,GHIDRA_CAST(0x0)); - if (piVar5 != GHIDRA_CAST(0x0)) { - (**(code **)(*piVar5 + 0xc))(0,0,uVar4); - iVar6 = (**(code **)(*piVar5 + 4))(); - pbStack_10094 = operator_new_tracked(iVar6 + 1); - (**(code **)(*piVar5 + 0x14))(pbStack_10094,iVar6,1); - pbStack_10094[iVar6] = 0; - (**(code **)*piVar5)(1); - pbVar11 = pbStack_10094; - if (pbStack_10094 != GHIDRA_CAST(0x0)) { - FUN_00413b90(); - local_8 = 0; - iVar6 = 0xa26fe0; - pbVar9 = pbVar11; - (GHIDRA_CAST((auStack_10058)))->rapidxml::xml_document::parse(pbVar11); - pbVar10 = g_xmlParseError; - g_xmlParseError = GHIDRA_CAST(0x0); - if (pbVar10 == GHIDRA_CAST(0x0)) { - pbStack_1006c = (GHIDRA_CAST((auStack_10058)))->xml_node::first_node(GHIDRA_CAST("stringtable"),iVar6,(uint8_t)pbVar9) - ; - pvVar7 = (GHIDRA_CAST((pbStack_1006c)))->xml_node::first_node(GHIDRA_CAST("languages"),iVar6,(uint8_t)pbVar9); - puStack_10070 = (GHIDRA_CAST((pvVar7)))->xml_node::first_node(GHIDRA_CAST("language"),iVar6,(uint8_t)pbVar9); - pcStack_10064 = GHIDRA_CAST(0x0); - for (; puStack_10070 != GHIDRA_CAST(0x0); - puStack_10070 = *GHIDRA_CAST((puStack_10070 + 0x2c))) { - pbVar11 = s_id; - do { - pbStack_1005c = pbVar11; - pbVar11 = pbStack_1005c + 1; - } while (*pbVar11 != 0); - pbStack_1005c = pbStack_1005c + -0xb1bfef; - for (puVar8 = *GHIDRA_CAST((puStack_10070 + 0x20)); puVar8 != GHIDRA_CAST(0x0); - puVar8 = GHIDRA_CAST(puVar8[6])) { - pbVar11 = GHIDRA_CAST(*puVar8); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pbVar10 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pbVar10 = GHIDRA_CAST(puVar8[2]); - } - if (pbVar10 == pbStack_1005c) { - pbVar10 = pbVar10 + GHIDRA_INT(pbVar11); - if (pbVar10 <= pbVar11) { -LAB_00a270f0: - pbVar9 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar8[1]) != GHIDRA_CAST(0x0)) { - pbVar9 = GHIDRA_CAST(puVar8[1]); - } - iVar6 = 0xa27104; - iStack_10090 = atoi(GHIDRA_CAST(pbVar9)); - pcVar13 = pcStack_10064; - if (iStack_10090 < 0x14) { - pcStack_10064 = pcStack_10064 + 1; - pbVar9 = GHIDRA_CAST(&iStack_10090); - iVar6 = 0xa27136; - puVar8 = GHIDRA_CAST(FUN_00a279f0(pbVar9)); - *puVar8 = pcVar13; - } - break; - } - iVar12 = GHIDRA_INT(s_id) - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar12]) { - pbVar11 = pbVar11 + 1; - if (pbVar10 <= pbVar11) goto LAB_00a270f0; - } - } - } - } - puStack_10068 = (GHIDRA_CAST((pbStack_1006c)))->xml_node::first_node(GHIDRA_CAST("category"),iVar6,(uint8_t)pbVar9); - if (puStack_10068 != GHIDRA_CAST(0x0)) { -LAB_00a27170: - pbVar11 = s_name; - do { - pbStack_1005c = pbVar11; - pbVar11 = pbStack_1005c + 1; - } while (*pbVar11 != 0); - puVar8 = GHIDRA_CAST(puStack_10068[8]); - pbStack_1005c = pbStack_1005c + -0xb1c13b; - if (puVar8 != GHIDRA_CAST(0x0)) { -LAB_00a27192: - pbVar11 = GHIDRA_CAST(*puVar8); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pbVar9 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pbVar9 = GHIDRA_CAST(puVar8[2]); - } - if (pbVar9 != pbStack_1005c) goto LAB_00a2737d; - pbVar9 = pbVar9 + GHIDRA_INT(pbVar11); - if (pbVar11 < pbVar9) { - iVar6 = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar6]) { - pbVar11 = pbVar11 + 1; - if (pbVar9 <= pbVar11) goto LAB_00a271e0; - } - goto LAB_00a2737d; - } -LAB_00a271e0: - pbVar11 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar8[1]) != GHIDRA_CAST(0x0)) { - pbVar11 = GHIDRA_CAST(puVar8[1]); - } - pbVar9 = pbVar11 + 1; - do { - bVar1 = *pbVar11; - pbVar11 = pbVar11 + 1; - } while (bVar1 != 0); - pbStack_1006c = operator_new_tracked(GHIDRA_UINT((pbVar11 + (1 - GHIDRA_INT(pbVar9))))); - pbVar11 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar8[1]) != GHIDRA_CAST(0x0)) { - pbVar11 = GHIDRA_CAST(puVar8[1]); - } - pbStack_1005c = pbStack_1006c; - iVar6 = tolower(GHIDRA_INT((char)*pbVar11)); - *pbStack_1005c = (uint8_t)iVar6; - if (*pbVar11 != 0) { - iVar6 = GHIDRA_INT(pbStack_1005c) - GHIDRA_INT(pbVar11); - do { - pbVar9 = pbVar11 + 1; - pbVar11 = pbVar11 + 1; - iVar12 = tolower(GHIDRA_INT((char)*pbVar9)); - pbVar11[iVar6] = (uint8_t)iVar12; - } while (*pbVar11 != 0); - } - iVar6 = iStack_1008c; - if (*GHIDRA_CAST((iStack_1008c + 0x14)) == 0) { - *GHIDRA_CAST((iStack_1008c + 0x14)) = pbStack_1006c; - } - pvStack_10078 = (void *)0x0; - pvStack_10080 = (void *)0x0; - pvStack_1007c = (void *)0x0; - pvStack_10088 = (void *)0x0; - pvStack_10084 = (void *)0x0; - pvStack_10088 = operator_new(0x18); - *(void **)pvStack_10088 = pvStack_10088; - *(void **)(GHIDRA_CAST(pvStack_10088) + 4) = pvStack_10088; - *(void **)(GHIDRA_CAST(pvStack_10088) + 8) = pvStack_10088; - *GHIDRA_CAST((GHIDRA_CAST(pvStack_10088) + 0xc)) = 0x101; - pvStack_10080 = (void *)0x0; - pvStack_1007c = (void *)0x0; - pvStack_10078 = (void *)0x0; - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),3); - pbStack_1005c = GHIDRA_CAST((iVar6 + 0xc)); - this = (void **)FUN_00a27960(&pbStack_1006c); - pbVar11 = GHIDRA_CAST((iVar6 + 0xc)); - if (this != &pvStack_10088) { - pvVar7 = *this; - FID_conflict__Erase_tree_>_> - (this,(fuzzer_allocator_> *)this, - *(_Tree_node **)(GHIDRA_INT(pvVar7) + 4)); - *(void **)(GHIDRA_CAST(pvVar7) + 4) = pvVar7; - *(void **)pvVar7 = pvVar7; - *(void **)(GHIDRA_CAST(pvVar7) + 8) = pvVar7; - this[1] = (void *)0x0; - pvVar7 = *this; - *this = pvStack_10088; - pvVar2 = this[1]; - this[1] = pvStack_10084; - pbVar11 = pbStack_1005c; - pvStack_10088 = pvVar7; - pvStack_10084 = pvVar2; - } - this_00 = this + 2; - if (this_00 != &pvStack_10080) { - FID_conflict__Tidy(this_00); - *this_00 = pvStack_10080; - this[3] = pvStack_1007c; - this[4] = pvStack_10078; - pvStack_10080 = (void *)0x0; - pvStack_1007c = (void *)0x0; - pvStack_10078 = (void *)0x0; - } - local_8 = local_8 & 0xffffff00; - if (pvStack_10080 != (void *)0x0) { - uVar4 = (GHIDRA_INT(pvStack_10078) - GHIDRA_INT(pvStack_10080) >> 2) * 4; - pvVar7 = pvStack_10080; - if (0xfff < uVar4) { - pvVar7 = *(void **)(GHIDRA_CAST(pvStack_10080) + -4); - uVar4 = uVar4 + 0x23; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvStack_10080) + (-4 - GHIDRA_INT(pvVar7))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(pvVar7,uVar4); - pvStack_10080 = (void *)0x0; - pvStack_1007c = (void *)0x0; - pvStack_10078 = (void *)0x0; - } - FID_conflict__Erase_tree_>_> - (&pvStack_10088, - (fuzzer_allocator_> *)&pvStack_10088, - *(_Tree_node **)(GHIDRA_INT(pvStack_10088) + 4)); - operator_delete(pvStack_10088,0x18); - msvc::map::_Find_lower_bound(auStack_100a4,&pbStack_1006c); - iStack_10090 = iStack_1009c; - if (*GHIDRA_CAST((iStack_1009c + 0xd)) == '\0') { - pbVar9 = *GHIDRA_CAST((iStack_1009c + 0x10)); - pbVar10 = pbStack_1006c; - do { - bVar1 = *pbVar10; - bVar15 = bVar1 < *pbVar9; - if (bVar1 != *pbVar9) { -LAB_00a27470: - uVar4 = -GHIDRA_UINT(bVar15) | 1; - goto LAB_00a27475; - } - if (bVar1 == 0) break; - bVar1 = pbVar10[1]; - bVar15 = bVar1 < pbVar9[1]; - if (bVar1 != pbVar9[1]) goto LAB_00a27470; - pbVar10 = pbVar10 + 2; - pbVar9 = pbVar9 + 2; - } while (bVar1 != 0); - uVar4 = 0; -LAB_00a27475: - if (GHIDRA_INT(uVar4) < 0) goto LAB_00a27479; - } - else { -LAB_00a27479: - iStack_10090 = *GHIDRA_CAST(pbVar11); - } - pcVar13 = "key"; - do { - pcVar14 = pcVar13; - pcVar13 = pcVar14 + 1; - } while (*pcVar13 != '\0'); - puStack_10060 = GHIDRA_CAST(puStack_10068[6]); - if (puStack_10060 != GHIDRA_CAST(0x0)) { - do { - pbVar11 = GHIDRA_CAST(*puStack_10060); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pcVar13 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pcVar13 = GHIDRA_CAST(puStack_10060[2]); - } - if (pcVar13 == pcVar14 + -0xb80fdb) { - pbVar9 = GHIDRA_CAST((pcVar13 + GHIDRA_INT(pbVar11))); - if (pbVar9 <= pbVar11) { -LAB_00a274e0: - iVar6 = iStack_1008c; - pbVar11 = s_name; - do { - pbStack_1005c = pbVar11; - pbVar11 = pbStack_1005c + 1; - } while (*pbVar11 != 0); - pbStack_1005c = pbStack_1005c + -0xb1c13b; - puVar8 = GHIDRA_CAST(puStack_10060[8]); - if (puVar8 != GHIDRA_CAST(0x0)) { -LAB_00a27508: - pbVar11 = GHIDRA_CAST(*puVar8); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pbVar9 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pbVar9 = GHIDRA_CAST(puVar8[2]); - } - if (pbVar9 != pbStack_1005c) goto LAB_00a27645; - pbVar9 = pbVar11 + GHIDRA_INT(pbVar9); - if (pbVar11 < pbVar9) { - iVar12 = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar12]) { - pbVar11 = pbVar11 + 1; - if (pbVar9 <= pbVar11) goto LAB_00a27560; - } - goto LAB_00a27645; - } -LAB_00a27560: - lVar3 = (uint64_t)*GHIDRA_CAST((iStack_1008c + 8)) * 4; - pbStack_1005c = - operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT(((uint64_t)lVar3 >> 0x20)) != 0)) | GHIDRA_UINT(lVar3)); - memset(pbStack_1005c,0,*GHIDRA_CAST((iVar6 + 8)) << 2); - pbVar11 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar8[1]) != GHIDRA_CAST(0x0)) { - pbVar11 = GHIDRA_CAST(puVar8[1]); - } - pbVar9 = pbVar11 + 1; - do { - bVar1 = *pbVar11; - pbVar11 = pbVar11 + 1; - } while (bVar1 != 0); - puStack_10070 = operator_new_tracked(GHIDRA_UINT((pbVar11 + (1 - GHIDRA_INT(pbVar9))))); - pbVar11 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar8[1]) != GHIDRA_CAST(0x0)) { - pbVar11 = GHIDRA_CAST(puVar8[1]); - } - pcStack_10064 = puStack_10070; - iVar6 = tolower(GHIDRA_INT((char)*pbVar11)); - *pcStack_10064 = (char)iVar6; - if (*pbVar11 != 0) { - iVar6 = GHIDRA_INT(pcStack_10064) - GHIDRA_INT(pbVar11); - do { - pbVar9 = pbVar11 + 1; - pbVar11 = pbVar11 + 1; - iVar12 = tolower(GHIDRA_INT((char)*pbVar9)); - pbVar11[iVar6] = (uint8_t)iVar12; - } while (*pbVar11 != 0); - } - iVar6 = iStack_10090; - puVar8 = GHIDRA_CAST(FUN_00a27a10(&puStack_10070)); - *puVar8 = pbStack_1005c; - piVar5 = *GHIDRA_CAST((iVar6 + 0x20)); - if (piVar5 == *GHIDRA_CAST((iVar6 + 0x24))) { - msvc::vector::_Emplace_reallocate(piVar5,&puStack_10070); - } - else { - *piVar5 = GHIDRA_INT(puStack_10070); - *GHIDRA_CAST((iVar6 + 0x20)) = *GHIDRA_CAST((iVar6 + 0x20)) + 4; - } - pcVar13 = "string"; - do { - pcStack_10064 = pcVar13; - pcVar13 = pcStack_10064 + 1; - } while (*pcVar13 != '\0'); - pcStack_10064 = pcStack_10064 + -0xb6eaab; - puStack_10074 = GHIDRA_CAST(puStack_10060[6]); - if (puStack_10074 != GHIDRA_CAST(0x0)) { - do { - pbVar11 = GHIDRA_CAST(*puStack_10074); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pcVar13 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pcVar13 = GHIDRA_CAST(puStack_10074[2]); - } - if (pcVar13 == pcStack_10064) { - pbVar9 = GHIDRA_CAST((pcVar13 + GHIDRA_INT(pbVar11))); - if (pbVar9 <= pbVar11) { -LAB_00a27710: - pcStack_10064 = GHIDRA_CAST(0x0); -LAB_00a27720: - if (pcStack_10064 < *GHIDRA_CAST((iStack_1008c + 8))) { - pbVar11 = &g_xmlNullStr; - if (GHIDRA_CAST(puStack_10074[1]) != GHIDRA_CAST(0x0)) { - pbVar11 = GHIDRA_CAST(puStack_10074[1]); - } - pbVar9 = pbVar11 + 1; - do { - bVar1 = *pbVar11; - pbVar11 = pbVar11 + 1; - } while (bVar1 != 0); - pcVar13 = operator_new_tracked(GHIDRA_UINT((pbVar11 + (1 - GHIDRA_INT(pbVar9))))); - pbVar10 = &g_xmlNullStr; - if (GHIDRA_CAST(puStack_10074[1]) != GHIDRA_CAST(0x0)) { - pbVar10 = GHIDRA_CAST(puStack_10074[1]); - } - strncpy(pcVar13,GHIDRA_CAST(pbVar10), - (size_t)(pbVar11 + (1 - GHIDRA_INT(pbVar9)))); - *GHIDRA_CAST((pbStack_1005c + GHIDRA_INT(pcStack_10064) * 4)) = pcVar13; - pcStack_10064 = pcStack_10064 + 1; - pcVar13 = "string"; - do { - pcStack_10098 = pcVar13; - pcVar13 = pcStack_10098 + 1; - } while (*pcVar13 != '\0'); - pcStack_10098 = pcStack_10098 + -0xb6eaab; - puStack_10074 = GHIDRA_CAST(puStack_10074[0xb]); - if (puStack_10074 != GHIDRA_CAST(0x0)) { - do { - pbVar11 = GHIDRA_CAST(*puStack_10074); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pcVar13 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pcVar13 = GHIDRA_CAST(puStack_10074[2]); - } - if (pcVar13 == pcStack_10098) { - pbVar9 = pbVar11 + GHIDRA_INT(pcVar13); - if (pbVar9 <= pbVar11) goto LAB_00a27720; - iVar6 = GHIDRA_INT("string") - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar6]) { - pbVar11 = pbVar11 + 1; - if (pbVar9 <= pbVar11) goto LAB_00a27720; - } - } - puStack_10074 = GHIDRA_CAST(puStack_10074[0xb]); - if (puStack_10074 == GHIDRA_CAST(0x0)) break; - } while( true ); - } - } - break; - } - iVar6 = GHIDRA_INT("string") - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar6]) { - pbVar11 = pbVar11 + 1; - if (pbVar9 <= pbVar11) goto LAB_00a27710; - } - } - puStack_10074 = GHIDRA_CAST(puStack_10074[0xb]); - } while (puStack_10074 != GHIDRA_CAST(0x0)); - } - } -LAB_00a27656: - pcVar13 = "key"; - do { - pcVar14 = pcVar13; - pcVar13 = pcVar14 + 1; - } while (*pcVar13 != '\0'); - puStack_10060 = GHIDRA_CAST(puStack_10060[0xb]); - do { - if (puStack_10060 == GHIDRA_CAST(0x0)) goto LAB_00a2787e; - pbVar11 = GHIDRA_CAST(*puStack_10060); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pcVar13 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pcVar13 = GHIDRA_CAST(puStack_10060[2]); - } - if (pcVar13 == pcVar14 + -0xb80fdb) { - pbVar9 = pbVar11 + GHIDRA_INT(pcVar13); - if (pbVar9 <= pbVar11) goto LAB_00a274e0; - iVar6 = GHIDRA_INT(&DAT_00b80fdc) - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar6]) { - pbVar11 = pbVar11 + 1; - if (pbVar9 <= pbVar11) goto LAB_00a274e0; - } - } - puStack_10060 = GHIDRA_CAST(puStack_10060[0xb]); - } while( true ); - } - iVar6 = GHIDRA_INT(&DAT_00b80fdc) - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar6]) { - pbVar11 = pbVar11 + 1; - if (pbVar9 <= pbVar11) goto LAB_00a274e0; - } - } - puStack_10060 = GHIDRA_CAST(puStack_10060[0xb]); - } while (puStack_10060 != GHIDRA_CAST(0x0)); - puStack_10060 = GHIDRA_CAST(0x0); - } - } -LAB_00a2787e: - pcVar13 = "category"; - do { - pcVar14 = pcVar13; - pcVar13 = pcVar14 + 1; - } while (*pcVar13 != '\0'); - puStack_10068 = GHIDRA_CAST(puStack_10068[0xb]); - if (puStack_10068 != GHIDRA_CAST(0x0)) { - do { - pbVar11 = GHIDRA_CAST(*puStack_10068); - if (pbVar11 == GHIDRA_CAST(0x0)) { - pcVar13 = GHIDRA_CAST(0x0); - pbVar11 = &g_xmlNullStr; - } - else { - pcVar13 = GHIDRA_CAST(puStack_10068[2]); - } - if (pcVar13 == pcVar14 + -0xb9c11b) { - pbVar9 = pbVar11 + GHIDRA_INT(pcVar13); - if (pbVar9 <= pbVar11) goto LAB_00a27170; - iVar6 = GHIDRA_INT("category") - GHIDRA_INT(pbVar11); - while (*pbVar11 == pbVar11[iVar6]) { - pbVar11 = pbVar11 + 1; - if (pbVar9 <= pbVar11) goto LAB_00a27170; - } - } - puStack_10068 = GHIDRA_CAST(puStack_10068[0xb]); - if (puStack_10068 == GHIDRA_CAST(0x0)) break; - } while( true ); - } - } - local_8 = 4; - (GHIDRA_CAST((auStack_10028)))->xml_memory_pool::clear(); - local_8 = 5; - tracked_alloc(1,pbStack_10094,0); - ExceptionList = local_10; - return 1; - } - local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); - tracked_alloc(1,pbVar11,0); - local_8 = 2; - (GHIDRA_CAST((auStack_10028)))->xml_memory_pool::clear(); - } - } - ExceptionList = local_10; - return 0; -LAB_00a2737d: - puVar8 = GHIDRA_CAST(puVar8[6]); - if (puVar8 == GHIDRA_CAST(0x0)) goto LAB_00a2787e; - goto LAB_00a27192; -LAB_00a27645: - puVar8 = GHIDRA_CAST(puVar8[6]); - if (puVar8 == GHIDRA_CAST(0x0)) goto LAB_00a27656; - goto LAB_00a27508; -} - -// 00a27038 -uint32_t StringTable::load_xml() -{ - void *pvVar1; - int *piVar2; - int lowerChar; - uint8_t *pbVar3; - void *freeBlock; - uint8_t *pbVar4; - uint8_t *pbVar5; - int lowerChar; - uint32_t uVar7; - char *pcVar8; - uint8_t *attrValue; - int unaff_EBP; - uint32_t *puVar9; - int *entryVector; - char *pcVar10; - bool isLess; - int in_stack_fffffff8; - uint8_t *in_stack_fffffffc; - int64_t allocBytes; - uint8_t ch; - uint8_t *lowerName; - - pvVar1 = xml_node::first_node - ((void *)(unaff_EBP + -0x10054),GHIDRA_CAST("stringtable"),in_stack_fffffff8, - (uint8_t)in_stack_fffffffc); - *(void **)(unaff_EBP + -0x10068) = pvVar1; - pvVar1 = xml_node::first_node - (pvVar1,GHIDRA_CAST("languages"),in_stack_fffffff8,(uint8_t)in_stack_fffffffc); - pvVar1 = (GHIDRA_CAST((pvVar1)))->xml_node::first_node(GHIDRA_CAST("language"),in_stack_fffffff8,(uint8_t)in_stack_fffffffc) - ; - *GHIDRA_CAST((unaff_EBP + -0x10060)) = 0; - *(void **)(unaff_EBP + -0x1006c) = pvVar1; - while (pvVar1 != (void *)0x0) { - pbVar4 = s_id; - do { - pbVar5 = pbVar4; - pbVar4 = pbVar5 + 1; - } while (*pbVar4 != 0); - puVar9 = *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x20)); - pbVar5 = pbVar5 + -0xb1bfef; - *GHIDRA_CAST((unaff_EBP + -0x10058)) = pbVar5; - for (; puVar9 != GHIDRA_CAST(0x0); puVar9 = GHIDRA_CAST(puVar9[6])) { - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pbVar3 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pbVar3 = GHIDRA_CAST(puVar9[2]); - } - if (pbVar3 == pbVar5) { - pbVar3 = pbVar3 + GHIDRA_INT(pbVar4); - if (pbVar3 <= pbVar4) { -LAB_00a270f0: - in_stack_fffffffc = &g_xmlNullStr; - if (GHIDRA_CAST(puVar9[1]) != GHIDRA_CAST(0x0)) { - in_stack_fffffffc = GHIDRA_CAST(puVar9[1]); - } - in_stack_fffffff8 = 0xa27104; - lowerChar = atoi(GHIDRA_CAST(in_stack_fffffffc)); - *GHIDRA_CAST((unaff_EBP + -0x1008c)) = lowerChar; - if (lowerChar < 0x14) { - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x10060)); - *GHIDRA_CAST((unaff_EBP + -0x10060)) = lowerChar + 1; - in_stack_fffffffc = GHIDRA_CAST((unaff_EBP + -0x1008c)); - in_stack_fffffff8 = 0xa27136; - piVar2 = GHIDRA_CAST(FUN_00a279f0(in_stack_fffffffc)); - *piVar2 = lowerChar; - } - break; - } - lowerChar = GHIDRA_INT(s_id) - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar3 <= pbVar4) goto LAB_00a270f0; - } - pbVar5 = *GHIDRA_CAST((unaff_EBP + -0x10058)); - } - } - pvVar1 = *(void **)(*GHIDRA_CAST((unaff_EBP + -0x1006c)) + 0x2c); - *(void **)(unaff_EBP + -0x1006c) = pvVar1; - } - pvVar1 = xml_node::first_node - (*(void **)(unaff_EBP + -0x10068),GHIDRA_CAST("category"),in_stack_fffffff8, - (uint8_t)in_stack_fffffffc); - *(void **)(unaff_EBP + -0x10064) = pvVar1; - if (pvVar1 == (void *)0x0) { -LAB_00a2701b: - *GHIDRA_CAST((unaff_EBP + -4)) = 4; - (GHIDRA_CAST(((void *)(unaff_EBP + -0x10024))))->xml_memory_pool::clear(); - *GHIDRA_CAST((unaff_EBP + -4)) = 5; - tracked_alloc(1,*(void **)(unaff_EBP + -0x10090),0); - ExceptionList = *(void **)(unaff_EBP + -0xc); - return 1; - } -LAB_00a27170: - pbVar4 = s_name; - do { - pbVar5 = pbVar4; - pbVar4 = pbVar5 + 1; - } while (*pbVar4 != 0); - puVar9 = *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x20)); - pbVar5 = pbVar5 + -0xb1c13b; - *GHIDRA_CAST((unaff_EBP + -0x10058)) = pbVar5; - if (puVar9 != GHIDRA_CAST(0x0)) { -LAB_00a27192: - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pbVar3 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pbVar3 = GHIDRA_CAST(puVar9[2]); - } - if (pbVar3 != pbVar5) goto LAB_00a2737d; - pbVar3 = pbVar3 + GHIDRA_INT(pbVar4); - if (pbVar4 < pbVar3) { - lowerChar = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar3 <= pbVar4) goto LAB_00a271e0; - } - pbVar5 = *GHIDRA_CAST((unaff_EBP + -0x10058)); - goto LAB_00a2737d; - } -LAB_00a271e0: - pbVar4 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar9[1]) != GHIDRA_CAST(0x0)) { - pbVar4 = GHIDRA_CAST(puVar9[1]); - } - pbVar5 = pbVar4 + 1; - do { - ch = *pbVar4; - pbVar4 = pbVar4 + 1; - } while (ch != 0); - pvVar1 = operator_new_tracked(GHIDRA_UINT((pbVar4 + (1 - GHIDRA_INT(pbVar5))))); - pbVar5 = GHIDRA_CAST(puVar9[1]); - *(void **)(unaff_EBP + -0x10068) = pvVar1; - *(void **)(unaff_EBP + -0x10058) = pvVar1; - pbVar4 = &g_xmlNullStr; - if (pbVar5 != GHIDRA_CAST(0x0)) { - pbVar4 = pbVar5; - } - lowerChar = tolower(GHIDRA_INT((char)*pbVar4)); - lowerName = *GHIDRA_CAST((unaff_EBP + -0x10058)); - *lowerName = (char)lowerChar; - if (*pbVar4 != 0) { - lowerChar = GHIDRA_INT(lowerName) - GHIDRA_INT(pbVar4); - do { - pbVar5 = pbVar4 + 1; - pbVar4 = pbVar4 + 1; - lowerChar = tolower(GHIDRA_INT((char)*pbVar5)); - pbVar4[lowerChar] = (uint8_t)lowerChar; - } while (*pbVar4 != 0); - } - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x10088)); - if (*GHIDRA_CAST((lowerChar + 0x14)) == 0) { - *GHIDRA_CAST((lowerChar + 0x14)) = *GHIDRA_CAST((unaff_EBP + -0x10068)); - } - *GHIDRA_CAST((unaff_EBP + -0x10074)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10084)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10080)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x1007c)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10078)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10084)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10080)) = 0; - pvVar1 = operator_new(0x18); - *(void **)pvVar1 = pvVar1; - *(void **)(GHIDRA_CAST(pvVar1) + 4) = pvVar1; - *(void **)(GHIDRA_CAST(pvVar1) + 8) = pvVar1; - *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0xc)) = 0x101; - *(void **)(unaff_EBP + -0x10084) = pvVar1; - *GHIDRA_CAST((unaff_EBP + -0x1007c)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10078)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10074)) = 0; - puVar9 = GHIDRA_CAST((lowerChar + 0xc)); - *GHIDRA_CAST((unaff_EBP + -4)) = 3; - *GHIDRA_CAST((unaff_EBP + -0x10058)) = puVar9; - piVar2 = GHIDRA_CAST(FUN_00a27960(unaff_EBP + -0x10068)); - if (piVar2 != GHIDRA_CAST((unaff_EBP + -0x10084))) { - lowerChar = *piVar2; - FID_conflict__Erase_tree_>_> - (piVar2,(fuzzer_allocator_> *)piVar2, - *(_Tree_node **)(lowerChar + 4)); - *GHIDRA_CAST((lowerChar + 4)) = lowerChar; - *GHIDRA_CAST(lowerChar) = lowerChar; - *GHIDRA_CAST((lowerChar + 8)) = lowerChar; - puVar9 = *GHIDRA_CAST((unaff_EBP + -0x10058)); - piVar2[1] = 0; - lowerChar = *piVar2; - *piVar2 = *GHIDRA_CAST((unaff_EBP + -0x10084)); - *GHIDRA_CAST((unaff_EBP + -0x10084)) = lowerChar; - lowerChar = piVar2[1]; - piVar2[1] = *GHIDRA_CAST((unaff_EBP + -0x10080)); - *GHIDRA_CAST((unaff_EBP + -0x10080)) = lowerChar; - } - entryVector = piVar2 + 2; - if (entryVector == GHIDRA_CAST((unaff_EBP + -0x1007c))) { - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x10074)); - pvVar1 = *(void **)(unaff_EBP + -0x1007c); - } - else { - FID_conflict__Tidy(entryVector); - pvVar1 = (void *)0x0; - *entryVector = *GHIDRA_CAST((unaff_EBP + -0x1007c)); - piVar2[3] = *GHIDRA_CAST((unaff_EBP + -0x10078)); - piVar2[4] = *GHIDRA_CAST((unaff_EBP + -0x10074)); - lowerChar = 0; - *GHIDRA_CAST((unaff_EBP + -0x1007c)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10078)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10074)) = 0; - } - *GHIDRA_CAST((unaff_EBP + -4)) = 0; - if (pvVar1 != (void *)0x0) { - uVar7 = (lowerChar - GHIDRA_INT(pvVar1) >> 2) * 4; - freeBlock = pvVar1; - if (0xfff < uVar7) { - freeBlock = *(void **)(GHIDRA_CAST(pvVar1) + -4); - uVar7 = uVar7 + 0x23; - if (0x1f < GHIDRA_UINT((GHIDRA_INT(pvVar1) + (-4 - GHIDRA_INT(freeBlock))))) { - /* WARNING: Subroutine does not return */ - _invalid_parameter_noinfo_noreturn(); - } - } - operator_delete(freeBlock,uVar7); - *GHIDRA_CAST((unaff_EBP + -0x1007c)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10078)) = 0; - *GHIDRA_CAST((unaff_EBP + -0x10074)) = 0; - } - FID_conflict__Erase_tree_>_> - ((void *)(unaff_EBP + -0x10084),(void *)(unaff_EBP + -0x10084), - *(_Tree_node **)(*GHIDRA_CAST((unaff_EBP + -0x10084)) + 4)); - operator_delete(*(void **)(unaff_EBP + -0x10084),0x18); - msvc::map::_Find_lower_bound(unaff_EBP + -0x100a0,unaff_EBP + -0x10068); - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x10098)); - *GHIDRA_CAST((unaff_EBP + -0x1008c)) = lowerChar; - if (*GHIDRA_CAST((lowerChar + 0xd)) == '\0') { - pbVar4 = *GHIDRA_CAST((lowerChar + 0x10)); - pbVar5 = *GHIDRA_CAST((unaff_EBP + -0x10068)); - do { - ch = *pbVar5; - isLess = ch < *pbVar4; - if (ch != *pbVar4) { -LAB_00a27470: - uVar7 = -GHIDRA_UINT(isLess) | 1; - goto LAB_00a27475; - } - if (ch == 0) break; - ch = pbVar5[1]; - isLess = ch < pbVar4[1]; - if (ch != pbVar4[1]) goto LAB_00a27470; - pbVar5 = pbVar5 + 2; - pbVar4 = pbVar4 + 2; - } while (ch != 0); - uVar7 = 0; -LAB_00a27475: - if (GHIDRA_INT(uVar7) < 0) goto LAB_00a27479; - } - else { -LAB_00a27479: - *GHIDRA_CAST((unaff_EBP + -0x1008c)) = *puVar9; - } - pcVar10 = "key"; - do { - pcVar8 = pcVar10; - pcVar10 = pcVar8 + 1; - } while (*pcVar10 != '\0'); - puVar9 = *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x10064)) + 0x18)); - *GHIDRA_CAST((unaff_EBP + -0x1005c)) = puVar9; - while (puVar9 != GHIDRA_CAST(0x0)) { - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pcVar10 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pcVar10 = GHIDRA_CAST(puVar9[2]); - } - if (pcVar10 == pcVar8 + -0xb80fdb) { - pbVar5 = GHIDRA_CAST((pcVar10 + GHIDRA_INT(pbVar4))); - if (pbVar5 <= pbVar4) { -LAB_00a274e0: - pbVar4 = s_name; - do { - pbVar5 = pbVar4; - pbVar4 = pbVar5 + 1; - } while (*pbVar4 != 0); - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x1005c)); - pbVar5 = pbVar5 + -0xb1c13b; - *GHIDRA_CAST((unaff_EBP + -0x10058)) = pbVar5; - puVar9 = *GHIDRA_CAST((lowerChar + 0x20)); - if (puVar9 != GHIDRA_CAST(0x0)) { -LAB_00a27508: - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pbVar3 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pbVar3 = GHIDRA_CAST(puVar9[2]); - } - if (pbVar3 != pbVar5) goto LAB_00a27645; - pbVar3 = pbVar4 + GHIDRA_INT(pbVar3); - if (pbVar4 < pbVar3) { - lowerChar = GHIDRA_INT(s_name) - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar3 <= pbVar4) goto LAB_00a27560; - } - pbVar5 = *GHIDRA_CAST((unaff_EBP + -0x10058)); - goto LAB_00a27645; - } -LAB_00a27560: - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x10088)); - allocBytes = (uint64_t)*GHIDRA_CAST((lowerChar + 8)) * 4; - pvVar1 = operator_new_tracked - (-GHIDRA_UINT((GHIDRA_INT(((uint64_t)allocBytes >> 0x20)) != 0)) | - GHIDRA_UINT(allocBytes)); - lowerChar = *GHIDRA_CAST((lowerChar + 8)); - *(void **)(unaff_EBP + -0x10058) = pvVar1; - memset(pvVar1,0,lowerChar << 2); - pbVar4 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar9[1]) != GHIDRA_CAST(0x0)) { - pbVar4 = GHIDRA_CAST(puVar9[1]); - } - pbVar5 = pbVar4 + 1; - do { - ch = *pbVar4; - pbVar4 = pbVar4 + 1; - } while (ch != 0); - pvVar1 = operator_new_tracked(GHIDRA_UINT((pbVar4 + (1 - GHIDRA_INT(pbVar5))))); - pbVar5 = GHIDRA_CAST(puVar9[1]); - *(void **)(unaff_EBP + -0x1006c) = pvVar1; - *(void **)(unaff_EBP + -0x10060) = pvVar1; - pbVar4 = &g_xmlNullStr; - if (pbVar5 != GHIDRA_CAST(0x0)) { - pbVar4 = pbVar5; - } - lowerChar = tolower(GHIDRA_INT((char)*pbVar4)); - lowerName = *GHIDRA_CAST((unaff_EBP + -0x10060)); - *lowerName = (char)lowerChar; - if (*pbVar4 != 0) { - lowerChar = GHIDRA_INT(lowerName) - GHIDRA_INT(pbVar4); - do { - pbVar5 = pbVar4 + 1; - pbVar4 = pbVar4 + 1; - lowerChar = tolower(GHIDRA_INT((char)*pbVar5)); - pbVar4[lowerChar] = (uint8_t)lowerChar; - } while (*pbVar4 != 0); - } - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x1008c)); - puVar9 = GHIDRA_CAST(FUN_00a27a10(unaff_EBP + -0x1006c)); - *puVar9 = *GHIDRA_CAST((unaff_EBP + -0x10058)); - puVar9 = *GHIDRA_CAST((lowerChar + 0x20)); - if (puVar9 == *GHIDRA_CAST((lowerChar + 0x24))) { - msvc::vector::_Emplace_reallocate(puVar9,unaff_EBP + -0x1006c); - } - else { - *puVar9 = *GHIDRA_CAST((unaff_EBP + -0x1006c)); - *GHIDRA_CAST((lowerChar + 0x20)) = *GHIDRA_CAST((lowerChar + 0x20)) + 4; - } - pcVar10 = "string"; - do { - pcVar8 = pcVar10; - pcVar10 = pcVar8 + 1; - } while (*pcVar10 != '\0'); - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x1005c)); - pcVar8 = pcVar8 + -0xb6eaab; - *GHIDRA_CAST((unaff_EBP + -0x10060)) = pcVar8; - puVar9 = *GHIDRA_CAST((lowerChar + 0x18)); - *GHIDRA_CAST((unaff_EBP + -0x10070)) = puVar9; - if (puVar9 != GHIDRA_CAST(0x0)) { - do { - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pcVar10 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pcVar10 = GHIDRA_CAST(puVar9[2]); - } - if (pcVar10 == pcVar8) { - pbVar5 = GHIDRA_CAST((pcVar10 + GHIDRA_INT(pbVar4))); - if (pbVar4 < pbVar5) { - lowerChar = GHIDRA_INT("string") - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar5 <= pbVar4) goto LAB_00a27710; - } - pcVar8 = *GHIDRA_CAST((unaff_EBP + -0x10060)); - goto LAB_00a277d1; - } -LAB_00a27710: - uVar7 = 0; - *GHIDRA_CAST((unaff_EBP + -0x10060)) = 0; - goto LAB_00a27720; - } -LAB_00a277d1: - puVar9 = GHIDRA_CAST(puVar9[0xb]); - *GHIDRA_CAST((unaff_EBP + -0x10070)) = puVar9; - } while (puVar9 != GHIDRA_CAST(0x0)); -LAB_00a27650: - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x1005c)); - } - } - pcVar10 = "key"; - do { - pcVar8 = pcVar10; - pcVar10 = pcVar8 + 1; - } while (*pcVar10 != '\0'); - puVar9 = *GHIDRA_CAST((lowerChar + 0x2c)); - *GHIDRA_CAST((unaff_EBP + -0x1005c)) = puVar9; - do { - if (puVar9 == GHIDRA_CAST(0x0)) goto LAB_00a27878; - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pcVar10 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pcVar10 = GHIDRA_CAST(puVar9[2]); - } - if (pcVar10 == pcVar8 + -0xb80fdb) { - pbVar5 = pbVar4 + GHIDRA_INT(pcVar10); - if (pbVar5 <= pbVar4) goto LAB_00a274e0; - lowerChar = GHIDRA_INT(&DAT_00b80fdc) - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar5 <= pbVar4) goto LAB_00a274e0; - } - } - puVar9 = *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x1005c)) + 0x2c)); - *GHIDRA_CAST((unaff_EBP + -0x1005c)) = puVar9; - } while( true ); - } - lowerChar = GHIDRA_INT(&DAT_00b80fdc) - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar5 <= pbVar4) goto LAB_00a274e0; - } - } - puVar9 = *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x1005c)) + 0x2c)); - *GHIDRA_CAST((unaff_EBP + -0x1005c)) = puVar9; - } -LAB_00a27878: - pvVar1 = *(void **)(unaff_EBP + -0x10064); - } - pcVar10 = "category"; - do { - pcVar8 = pcVar10; - pcVar10 = pcVar8 + 1; - } while (*pcVar10 != '\0'); - puVar9 = *GHIDRA_CAST((GHIDRA_CAST(pvVar1) + 0x2c)); - *GHIDRA_CAST((unaff_EBP + -0x10064)) = puVar9; - if (puVar9 != GHIDRA_CAST(0x0)) { - do { - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pcVar10 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pcVar10 = GHIDRA_CAST(puVar9[2]); - } - if (pcVar10 == pcVar8 + -0xb9c11b) { - pbVar5 = pbVar4 + GHIDRA_INT(pcVar10); - if (pbVar5 <= pbVar4) goto LAB_00a278d0; - lowerChar = GHIDRA_INT("category") - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar5 <= pbVar4) goto LAB_00a278d0; - } - } - puVar9 = *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x10064)) + 0x2c)); - *GHIDRA_CAST((unaff_EBP + -0x10064)) = puVar9; - if (puVar9 == GHIDRA_CAST(0x0)) break; - } while( true ); - } - goto LAB_00a2701b; -LAB_00a2737d: - puVar9 = GHIDRA_CAST(puVar9[6]); - if (puVar9 == GHIDRA_CAST(0x0)) goto LAB_00a27878; - goto LAB_00a27192; -LAB_00a27645: - puVar9 = GHIDRA_CAST(puVar9[6]); - if (puVar9 == GHIDRA_CAST(0x0)) goto LAB_00a27650; - goto LAB_00a27508; -LAB_00a27720: - if (uVar7 < *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x10088)) + 8))) { - pbVar4 = &g_xmlNullStr; - if (GHIDRA_CAST(puVar9[1]) != GHIDRA_CAST(0x0)) { - pbVar4 = GHIDRA_CAST(puVar9[1]); - } - pbVar5 = pbVar4 + 1; - do { - ch = *pbVar4; - pbVar4 = pbVar4 + 1; - } while (ch != 0); - pcVar10 = operator_new_tracked(GHIDRA_UINT((pbVar4 + (1 - GHIDRA_INT(pbVar5))))); - pbVar3 = *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x10070)) + 4)); - attrValue = &g_xmlNullStr; - if (pbVar3 != GHIDRA_CAST(0x0)) { - attrValue = pbVar3; - } - strncpy(pcVar10,GHIDRA_CAST(attrValue),(size_t)(pbVar4 + (1 - GHIDRA_INT(pbVar5)))); - lowerChar = *GHIDRA_CAST((unaff_EBP + -0x10060)); - *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x10058)) + lowerChar * 4)) = pcVar10; - *GHIDRA_CAST((unaff_EBP + -0x10060)) = lowerChar + 1; - pcVar10 = "string"; - do { - pcVar8 = pcVar10; - pcVar10 = pcVar8 + 1; - } while (*pcVar10 != '\0'); - pcVar8 = pcVar8 + -0xb6eaab; - *GHIDRA_CAST((unaff_EBP + -0x10094)) = pcVar8; - puVar9 = *GHIDRA_CAST((*GHIDRA_CAST((unaff_EBP + -0x10070)) + 0x2c)); - *GHIDRA_CAST((unaff_EBP + -0x10070)) = puVar9; - if (puVar9 != GHIDRA_CAST(0x0)) { - do { - pbVar4 = GHIDRA_CAST(*puVar9); - if (pbVar4 == GHIDRA_CAST(0x0)) { - pcVar10 = GHIDRA_CAST(0x0); - pbVar4 = &g_xmlNullStr; - } - else { - pcVar10 = GHIDRA_CAST(puVar9[2]); - } - if (pcVar10 == pcVar8) { - pbVar5 = pbVar4 + GHIDRA_INT(pcVar10); - if (pbVar5 <= pbVar4) goto LAB_00a2780c; - lowerChar = GHIDRA_INT("string") - GHIDRA_INT(pbVar4); - while (*pbVar4 == pbVar4[lowerChar]) { - pbVar4 = pbVar4 + 1; - if (pbVar5 <= pbVar4) goto LAB_00a2780c; - } - pcVar8 = *GHIDRA_CAST((unaff_EBP + -0x10094)); - } - puVar9 = GHIDRA_CAST(puVar9[0xb]); - *GHIDRA_CAST((unaff_EBP + -0x10070)) = puVar9; - if (puVar9 == GHIDRA_CAST(0x0)) break; - } while( true ); - } - } - goto LAB_00a27650; -LAB_00a2780c: - uVar7 = *GHIDRA_CAST((unaff_EBP + -0x10060)); - goto LAB_00a27720; -LAB_00a278d0: - pvVar1 = *(void **)(unaff_EBP + -0x10064); - goto LAB_00a27170; -} diff --git a/generated-src/stubs.cpp b/generated-src/stubs.cpp index 55d42d6..577047a 100644 --- a/generated-src/stubs.cpp +++ b/generated-src/stubs.cpp @@ -8220,6 +8220,11 @@ uint32_t _DAT_e76476a4{}; uint32_t register0x00000010{}; uint32_t register0x0000001e{}; +uint32_t EntityPtr::Ref() { generated_stub("EntityPtr::Ref 0040c3a0"); } +void EntityPtr::Set(Entity *entity) { generated_stub("EntityPtr::Set 004cf1d0"); } +void EntityPtr::SetReference(EntityPtr *ptr, Entity *entity) { generated_stub("EntityPtr::SetReference 006b5b50"); } +void EntityPtr::SetReference(Entity *entity) { generated_stub("EntityPtr::SetReference 00872050"); } +EntityPtr * EntityPtr::clear() { generated_stub("EntityPtr::clear 00a0fe80"); } Vector * Vector::operator_mul(Vector *outResult, float *scalar, Vector *vector) { generated_stub("Vector::operator_mul 004171d0"); } Vector * Vector::ToCardinal(Vector *outResult, Vector *vec) { generated_stub("Vector::ToCardinal 0067f170"); } Vector * Vector::mul_065(Vector *outResult, Vector *source) { generated_stub("Vector::mul_065 0067f2b0"); } @@ -8255,47 +8260,6 @@ Vector * Vector::__div_assign(float *divisor) { generated_stub("Vector::__div_as uint8_t Vector::operator_eq(Vector *other) { generated_stub("Vector::operator_eq 00a10600"); } uint8_t Vector::operator_ne(Vector *other) { generated_stub("Vector::operator_ne 00a10630"); } Vector * Vector::__unm(Vector *outResult) { generated_stub("Vector::__unm 00a10660"); } -uint8_t AnimationState::IsLoopingAnimation() { generated_stub("AnimationState::IsLoopingAnimation 004073b0"); } -AnimationState::AnimationState(void *owner, AnimationState *other) { generated_stub("AnimationState::AnimationState 004086e0"); } -void AnimationState::SetLayerFrame(int layerID, int frame) { generated_stub("AnimationState::SetLayerFrame 00408ef0"); } -int AnimationState::GetLayerFrameIdx(int layerId) { generated_stub("AnimationState::GetLayerFrameIdx 00408f70"); } -void AnimationState::SetNullLayerFrame(int nullLayerId, int frame) { generated_stub("AnimationState::SetNullLayerFrame 00408fc0"); } -void * AnimationState::GetNullFrameById(int nullLayerId) { generated_stub("AnimationState::GetNullFrameById 0040ac70"); } -void * AnimationState::GetNullFrame(uint8_t *nullLayerName) { generated_stub("AnimationState::GetNullFrame 0040ace0"); } -uint8_t AnimationState::IsEventTriggered(uint8_t *eventName) { generated_stub("AnimationState::IsEventTriggered 0040add0"); } -uint8_t AnimationState::WasEventTriggered(uint8_t *eventName) { generated_stub("AnimationState::WasEventTriggered 0040ae70"); } -int AnimationState::NextEventTrigger(uint8_t *eventName) { generated_stub("AnimationState::NextEventTrigger 0040af10"); } -AnimationState * AnimationState::copy_assign(AnimationState *other) { generated_stub("AnimationState::copy_assign 0040bbf0"); } -int AnimationState::GetAnimationLength() { generated_stub("AnimationState::GetAnimationLength 00440e30"); } -ANM2::ANM2(ANM2 *other) { generated_stub("ANM2::ANM2 00407690"); } -ANM2 * ANM2::operator_assign(ANM2 other) { generated_stub("ANM2::operator_assign 00407e90"); } -ANM2::~ANM2() { generated_stub("ANM2::~ANM2 00408170"); } -void ANM2::Update() { generated_stub("ANM2::Update 00409100"); } -void ANM2::Render(Vector *position, Vector *topleftclamp, Vector *bottomrightclamp) { generated_stub("ANM2::Render 0040a0d0"); } -uint8_t ANM2::IsPlaying(uint8_t *name) { generated_stub("ANM2::IsPlaying 0040a4d0"); } -uint8_t ANM2::IsFinishedImpl(uint8_t *animName) { generated_stub("ANM2::IsFinishedImpl 0040a550"); } -void ANM2::SetFrame(std_string *anim, int frame) { generated_stub("ANM2::SetFrame 0040a690"); } -int ANM2::GetFrame() { generated_stub("ANM2::GetFrame 0040a780"); } -void ANM2::SetLayerFrame(int layerid, int frame) { generated_stub("ANM2::SetLayerFrame 0040a7e0"); } -void ANM2::SetOverlayFrame(uint8_t *anim, int frame) { generated_stub("ANM2::SetOverlayFrame 0040abf0"); } -void ANM2::SetOverlayFrame(int frame) { generated_stub("ANM2::SetOverlayFrame 0040ac30"); } -uint8_t ANM2::WasEventTriggered(uint8_t *eventName) { generated_stub("ANM2::WasEventTriggered 0040b090"); } -void * ANM2::GetNullFrame(uint8_t *animName, uint8_t *nullLayerName, int frame) { generated_stub("ANM2::GetNullFrame 0040b0c0"); } -void * ANM2::GetLayerFrame(int nullLayerId) { generated_stub("ANM2::GetLayerFrame 0040b1a0"); } -LayerState * ANM2::GetLayer(uint8_t *layerName) { generated_stub("ANM2::GetLayer 0040b220"); } -LayerState * ANM2::get_layer_by_string(std_string *name) { generated_stub("ANM2::get_layer_by_string 0040b310"); } -KColor * ANM2::GetTexel(AnimationState *anim, KColor *outColor, int layerId, Vector samplePos, Vector renderPos, float alphaThreshold) { generated_stub("ANM2::GetTexel 0040b600"); } -void ANM2::Reload() { generated_stub("ANM2::Reload 0040bea0"); } -void ANM2::LoadGraphics(uint8_t unk) { generated_stub("ANM2::LoadGraphics 0040c000"); } -std_string * ANM2::GetAnimation(std_string *outName) { generated_stub("ANM2::GetAnimation 00452bf0"); } -void ANM2::LoadDeliriumForm(ANM2 *sprite, int type, int variant, uint8_t isReloadAnm2) { generated_stub("ANM2::LoadDeliriumForm 004a5d10"); } -void ANM2::copy_animation_to(ANM2 *source, ANM2 *dest) { generated_stub("ANM2::copy_animation_to 0078b3b0"); } -void ANM2::update_appear_then_idle() { generated_stub("ANM2::update_appear_then_idle 00837210"); } -uint32_t EntityPtr::Ref() { generated_stub("EntityPtr::Ref 0040c3a0"); } -void EntityPtr::Set(Entity *entity) { generated_stub("EntityPtr::Set 004cf1d0"); } -void EntityPtr::SetReference(EntityPtr *ptr, Entity *entity) { generated_stub("EntityPtr::SetReference 006b5b50"); } -void EntityPtr::SetReference(Entity *entity) { generated_stub("EntityPtr::SetReference 00872050"); } -EntityPtr * EntityPtr::clear() { generated_stub("EntityPtr::clear 00a0fe80"); } void EntityRef::constructor(Entity *entity) { generated_stub("EntityRef::constructor 00431310"); } EntityRef::EntityRef() { generated_stub("EntityRef::EntityRef 00435c70"); } EntityRef * EntityRef::operator_(EntityRef *other) { generated_stub("EntityRef::operator_ 00499960"); } @@ -8624,18 +8588,6 @@ void Ambush::StartChallenge() { generated_stub("Ambush::StartChallenge 00833420" void Ambush::SpawnWave() { generated_stub("Ambush::SpawnWave 00833600"); } void Ambush::SpawnBossrushWave() { generated_stub("Ambush::SpawnBossrushWave 00833c40"); } void Ambush::Update() { generated_stub("Ambush::Update 00834350"); } -int AnimationData::find_null_index(uint8_t *name) { generated_stub("AnimationData::find_null_index 0040b520"); } -void AnimationLayer::RenderFrame() { generated_stub("AnimationLayer::RenderFrame 008e3db0"); } -AnmCache::~AnmCache() { generated_stub("AnmCache::~AnmCache 0040d240"); } -void AnmCache::LogMemoryUsage() { generated_stub("AnmCache::LogMemoryUsage 0040d4c0"); } -void AnmCache::Load(std_string *param_1, std_string *param_2) { generated_stub("AnmCache::Load 0040db90"); } -void AnmCache::AddRef(std_string *path) { generated_stub("AnmCache::AddRef 0040e110"); } -void AnmCache::RemoveRef(std_string *path) { generated_stub("AnmCache::RemoveRef 0040e2b0"); } -void AnmCache::Clear() { generated_stub("AnmCache::Clear 0040e470"); } -void AnmCache::Preload(uint8_t *path) { generated_stub("AnmCache::Preload 0040ea50"); } -void AnmCache::ParseFile(std_string *path, uint32_t pathHash) { generated_stub("AnmCache::ParseFile 0040ed50"); } -int AnmCache::entry_get(uint32_t param_1) { generated_stub("AnmCache::entry_get 00414500"); } -int * AnmCache::lower_bound_find(int *param_1, uint32_t *param_2) { generated_stub("AnmCache::lower_bound_find 00416490"); } void * Backdrop::render_grid_rect(void *outQuad, int x, int y, int width, int height) { generated_stub("Backdrop::render_grid_rect 00932120"); } void Backdrop::constructor() { generated_stub("Backdrop::constructor 009321c0"); } void Backdrop::destructor() { generated_stub("Backdrop::destructor 00932570"); } @@ -8719,7 +8671,6 @@ void CellSpace::insert(Entity *entity) { generated_stub("CellSpace::insert 0041b void CellSpace::collide_entity(Entity *entity) { generated_stub("CellSpace::collide_entity 0041bdf0"); } void CellSpace::collide(void *entityB) { generated_stub("CellSpace::collide 0041c070"); } void CellSpace::collide_self() { generated_stub("CellSpace::collide_self 0041c2a0"); } -void ChallengeParams::operator_assign_move(char *param_1) { generated_stub("ChallengeParams::operator_assign_move 009584b0"); } void Checksum::Update(uint8_t *data, uint32_t size) { generated_stub("Checksum::Update 00683410"); } Color::Color() { generated_stub("Color::Color 00407170"); } ColorMod * Color::operator_assign(ColorMod *other) { generated_stub("Color::operator_assign 004071c0"); } @@ -9787,38 +9738,6 @@ uint8_t * FileSystem::ResolvePath(uint8_t *path) { generated_stub("FileSystem::R void * FileSystem::Open(uint8_t *path, int *outResolvedPath) { generated_stub("FileSystem::Open 00a178d0"); } uint8_t FileSystem::open_disk_file(uint8_t *path, void **outFile) { generated_stub("FileSystem::open_disk_file 00a17ea0"); } uint8_t FileSystem::open_archive_file(uint8_t *path, void **outFile) { generated_stub("FileSystem::open_archive_file 00a17f40"); } -void Font::SetLineHeightModifier(float modifier) { generated_stub("Font::SetLineHeightModifier 00407280"); } -void Font::EnableAutoWrap(uint16_t param_2) { generated_stub("Font::EnableAutoWrap 0085e450"); } -void Font::Load(uint8_t *path) { generated_stub("Font::Load 0085e470"); } -Vector * Font::measure_rich_text(Vector *outSize, uint8_t *text, int maxWidth, float scale) { generated_stub("Font::measure_rich_text 009f0140"); } -void Font::SetAlignment(uint32_t param_1) { generated_stub("Font::SetAlignment 00a1a5c0"); } -void Font::SetMaxCharacters(uint16_t param_1) { generated_stub("Font::SetMaxCharacters 00a1a5d0"); } -short Font::GetMaxCharacters() { generated_stub("Font::GetMaxCharacters 00a1a5e0"); } -uint8_t Font::IsAutoWrapEnabled() { generated_stub("Font::IsAutoWrapEnabled 00a1a5f0"); } -void Font::EnableTruncation(uint16_t param_1) { generated_stub("Font::EnableTruncation 00a1a600"); } -bool Font::IsTruncationEnabled() { generated_stub("Font::IsTruncationEnabled 00a1a620"); } -void Font::SetMissingCharacterOverride(uint32_t param_2) { generated_stub("Font::SetMissingCharacterOverride 00a1a630"); } -void Font::Load(uint8_t *path, uint8_t unusedIsLoading) { generated_stub("Font::Load 00a1a730"); } -void Font::Unload() { generated_stub("Font::Unload 00a1ad90"); } -void Font::GetCharacterWidth() { generated_stub("Font::GetCharacterWidth 00a1ae70"); } -int Font::GetStringWidth(uint8_t *str) { generated_stub("Font::GetStringWidth 00a1ae80"); } -short Font::GetLineHeight() { generated_stub("Font::GetLineHeight 00a1aea0"); } -short Font::GetBaselineHeight() { generated_stub("Font::GetBaselineHeight 00a1aeb0"); } -void Font::DrawStringScaled(uint8_t *text, Vector *pos, KColor *color, void *settings) { generated_stub("Font::DrawStringScaled 00a1aec0"); } -void Font::DrawString(uint8_t *text, KColor *color, void *settings, float x, float y) { generated_stub("Font::DrawString 00a1af90"); } -void Font::DrawString(uint8_t *str, Vector *position, Vector *scale, KColor *color, void *settings) { generated_stub("Font::DrawString 00a1b050"); } -void Font::DrawString(uint8_t *str, Vector pos, Vector scale, KColor *color, FontSettings *settings) { generated_stub("Font::DrawString 00a1b140"); } -void Font::draw_string_wide_unscaled(short *text, float x, float y, KColor *color, void *settings) { generated_stub("Font::draw_string_wide_unscaled 00a1b210"); } -void Font::SetMissingCharacter(uint32_t character) { generated_stub("Font::SetMissingCharacter 00a1b3b0"); } -uint32_t Font::get_glyph_index(uint32_t param_1, uint32_t param_2) { generated_stub("Font::get_glyph_index 00a1b410"); } -void Font::render_glyph(uint32_t ch, uint8_t unknown, uint32_t *prevChar, float x, float y, float scaleX, float scaleY, KColor color, void *glyphContext) { generated_stub("Font::render_glyph 00a1b580"); } -int Font::get_string_width_utf16(short *text, int length) { generated_stub("Font::get_string_width_utf16 00a1ba10"); } -void * Font::measure_string(void *outLayout, uint8_t *text, void *settings, Vector *scale) { generated_stub("Font::measure_string 00a1bb10"); } -void * Font::layout_glyphs(void *outRun, uint8_t *text, void *settings, Vector *boxSize) { generated_stub("Font::layout_glyphs 00a1c480"); } -void FontSettings::constructor() { generated_stub("FontSettings::constructor 00a1a540"); } -FormattedText::FormattedText(uint8_t *param_1) { generated_stub("FormattedText::FormattedText 00a55b70"); } -void FormattedText::split_lines(uint8_t *text, void *lines) { generated_stub("FormattedText::split_lines 00a55ef0"); } -void FormattedText::split_lines_utf16(short *text, void *outLines) { generated_stub("FormattedText::split_lines_utf16 00a56060"); } void FrameQueue::setSize(int count) { generated_stub("FrameQueue::setSize 00aaa500"); } FriendEntry::~FriendEntry() { generated_stub("FriendEntry::~FriendEntry 008e1f30"); } void ItemPool::ReplaceBlacklistedPickup(int *param_2, uint32_t *param_3, uint32_t *param_4) { generated_stub("ItemPool::ReplaceBlacklistedPickup 0042b560"); } @@ -11265,19 +11184,10 @@ void * KAGE_Graphics::create_image(void *outImage, int width, int height, int fo void KAGE_Graphics::flush_batches() { generated_stub("KAGE_Graphics::flush_batches 00a139f0"); } void KAGE_Graphics::SetRenderTarget(void *target, uint8_t isNoFlip) { generated_stub("KAGE_Graphics::SetRenderTarget 00a18300"); } void KAGE_Graphics::update_projection() { generated_stub("KAGE_Graphics::update_projection 00a18530"); } -void KAGE_Graphics::update_depth_renderbuffer(uint8_t isForced) { generated_stub("KAGE_Graphics::update_depth_renderbuffer 00a18750"); } -void KAGE_Graphics::set_window_size(int *param_1) { generated_stub("KAGE_Graphics::set_window_size 00a19450"); } -void KAGE_Graphics::set_fullscreen(uint8_t isFullscreen, uint8_t isExclusive) { generated_stub("KAGE_Graphics::set_fullscreen 00a196b0"); } -uint32_t KAGE_Graphics::create_window() { generated_stub("KAGE_Graphics::create_window 00a19df0"); } uint32_t KAGE_Graphics::submit_batch() { generated_stub("KAGE_Graphics::submit_batch 00a67bd0"); } void * KAGE_Graphics_ImageManager::load_image_file(void *param_1, uint8_t *param_2) { generated_stub("KAGE_Graphics_ImageManager::load_image_file 00a118d0"); } void KeyConfigs::apply_to_device(int deviceId) { generated_stub("KeyConfigs::apply_to_device 00835c90"); } void * LRoomTileDesc::GetRandomTile(void *ret, uint32_t seed) { generated_stub("LRoomTileDesc::GetRandomTile 0081fb70"); } -LayerAnimation::LayerAnimation() { generated_stub("LayerAnimation::LayerAnimation 0040c1e0"); } -LayerData::~LayerData() { generated_stub("LayerData::~LayerData 0040db70"); } -LayerState::~LayerState() { generated_stub("LayerState::~LayerState 00407a60"); } -void * LayerState::GetTexture(void *outTexture) { generated_stub("LayerState::GetTexture 00408590"); } -void LayerState::SetTexture(void *texture, void *textureRefCount) { generated_stub("LayerState::SetTexture 00408640"); } void * Level::GetCurrentRoom() { generated_stub("Level::GetCurrentRoom 00407480"); } void Level::SetStateFlag(int flag, uint8_t isSet) { generated_stub("Level::SetStateFlag 00428a80"); } bool Level::IsAltStage() { generated_stub("Level::IsAltStage 0042a2c0"); } @@ -11511,11 +11421,6 @@ uint8_t MusicManager::IsEnabled() { generated_stub("MusicManager::IsEnabled 0085 Game * MusicManager::Game_0() { generated_stub("MusicManager::Game_0 0086fc60"); } void SoundEffects::Play(int ID, float Volume, int FrameDelay, uint8_t Loop, float Pitch, float Pan) { generated_stub("SoundEffects::Play 0092dc30"); } void SoundEffects::ClearVolumeModifier() { generated_stub("SoundEffects::ClearVolumeModifier 0092e430"); } -void OptionsConfig::load_config_ini() { generated_stub("OptionsConfig::load_config_ini 00924180"); } -void OptionsConfig::Load(uint8_t *path) { generated_stub("OptionsConfig::Load 00924440"); } -void OptionsConfig::Save() { generated_stub("OptionsConfig::Save 00924d10"); } -void OptionsConfig::SetMusicVolume(float volume) { generated_stub("OptionsConfig::SetMusicVolume 00925c00"); } -void OptionsConfig::set_vsync(uint32_t param_2) { generated_stub("OptionsConfig::set_vsync 00925ce0"); } ModManager::~ModManager() { generated_stub("ModManager::~ModManager 008f2ff0"); } void ModManager::LoadModContent() { generated_stub("ModManager::LoadModContent 008f30d0"); } void ModManager::LoadModItemPools() { generated_stub("ModManager::LoadModItemPools 008f46f0"); } @@ -11531,11 +11436,6 @@ void ModManager::Reset() { generated_stub("ModManager::Reset 008f8c00"); } void ModManager::RenderCustomCharacterMenu(int characterId, Vector *renderPos, Sprite *defaultSprite) { generated_stub("ModManager::RenderCustomCharacterMenu 008f8d00"); } void ModManager::add_mod_entry(std_string *name, std_string *dir, std_string *path) { generated_stub("ModManager::add_mod_entry 008f9f40"); } void ModManager::UpdateWorkshopMods() { generated_stub("ModManager::UpdateWorkshopMods 008fa390"); } -void StringTable::constructor() { generated_stub("StringTable::constructor 00a26710"); } -uint8_t StringTable::Load(uint8_t *fileName) { generated_stub("StringTable::Load 00a26810"); } -uint8_t * StringTable::get_string_by_index(uint8_t *category, int language, uint32_t keyIndex) { generated_stub("StringTable::get_string_by_index 00a26d30"); } -uint32_t StringTable::load_file(uint8_t *param_1) { generated_stub("StringTable::load_file 00a26f20"); } -uint32_t StringTable::load_xml() { generated_stub("StringTable::load_xml 00a27038"); } uint8_t NetplayManager::process_consolidated_messages() { generated_stub("NetplayManager::process_consolidated_messages 008fd530"); } NetplayManager::~NetplayManager() { generated_stub("NetplayManager::~NetplayManager 00906a90"); } void NetplayManager::Init() { generated_stub("NetplayManager::Init 00906d60"); } @@ -12012,11 +11912,6 @@ ReferenceCountBase::ReferenceCountBase() { generated_stub("ReferenceCountBase::R void RenderBatch::set_state(int param_1) { generated_stub("RenderBatch::set_state 00a66e30"); } uint8_t RenderBatch::is_state_equal(void *texture) { generated_stub("RenderBatch::is_state_equal 00a670c0"); } void RenderTarget::Clear() { generated_stub("RenderTarget::Clear 00a18230"); } -RichText::~RichText() { generated_stub("RichText::~RichText 009efa10"); } -void RichTextIcon::render(Vector *pos, int iconType, int iconId, float alpha) { generated_stub("RichTextIcon::render 009f24b0"); } -Vector * RichTextIcon::get_size(Vector *outSize) { generated_stub("RichTextIcon::get_size 009f28b0"); } -std_string * RichTextIcon::get_animation_name(std_string *outName, int iconType) { generated_stub("RichTextIcon::get_animation_name 009f2b10"); } -void RichTextIcon::set_icon(int param_1, int param_2) { generated_stub("RichTextIcon::set_icon 009f2c10"); } uint8_t RichTextSpan::try_merge(void *other) { generated_stub("RichTextSpan::try_merge 009ef9a0"); } void RichTextSpan::move_construct(void *dest, void *source) { generated_stub("RichTextSpan::move_construct 009f1ef0"); } int Room::GetGridHeight() { generated_stub("Room::GetGridHeight 0040c2e0"); } @@ -12266,28 +12161,20 @@ std_string * SpecialSeed::get_display_name(std_string *outName) { generated_stub void Sprite::SetColor(ColorMod *color) { generated_stub("Sprite::SetColor 004073d0"); } uint8_t Sprite::FlipX() { generated_stub("Sprite::FlipX 00407420"); } uint8_t Sprite::FlipY() { generated_stub("Sprite::FlipY 00407430"); } -void Sprite::RenderLayer(int layerId, Vector *position, Vector *topLeftClamp, Vector *bottomRightClamp) { generated_stub("Sprite::RenderLayer 0040a140"); } -void Sprite::PlayRandom(uint32_t seed) { generated_stub("Sprite::PlayRandom 0040a2b0"); } void Sprite::Play(std_string *animName, uint8_t isForce) { generated_stub("Sprite::Play 0040a360"); } void Sprite::IsPlaying(uint8_t *param_1) { generated_stub("Sprite::IsPlaying 0040a4b0"); } uint8_t Sprite::IsFinished(std_string *animName) { generated_stub("Sprite::IsFinished 0040a530"); } uint8_t Sprite::SetAnimation(std_string *name, uint8_t isReset) { generated_stub("Sprite::SetAnimation 0040a5b0"); } void Sprite::SetFrame_1(int frame) { generated_stub("Sprite::SetFrame_1 0040a720"); } -void Sprite::SetLastFrame() { generated_stub("Sprite::SetLastFrame 0040a760"); } -void Sprite::Stop() { generated_stub("Sprite::Stop 0040a910"); } void Sprite::PlayOverlay(uint8_t *param_1, uint8_t param_2) { generated_stub("Sprite::PlayOverlay 0040a920"); } void Sprite::IsOverlayPlaying() { generated_stub("Sprite::IsOverlayPlaying 0040a9d0"); } void Sprite::IsOverlayFinished() { generated_stub("Sprite::IsOverlayFinished 0040aa50"); } uint8_t Sprite::SetOverlayAnimation(std_string *animName, uint8_t isReset) { generated_stub("Sprite::SetOverlayAnimation 0040aad0"); } void Sprite::SetOverlayFrame(std_string *animName, int frame) { generated_stub("Sprite::SetOverlayFrame 0040abb0"); } -int Sprite::GetOverlayFrame() { generated_stub("Sprite::GetOverlayFrame 0040ac50"); } -void Sprite::RemoveOverlay() { generated_stub("Sprite::RemoveOverlay 0040ac60"); } uint8_t Sprite::IsEventTriggered(void *eventName) { generated_stub("Sprite::IsEventTriggered 0040b000"); } uint8_t Sprite::WasEventTriggered(std_string *eventName) { generated_stub("Sprite::WasEventTriggered 0040b060"); } -void * Sprite::GetNullFrame(uint8_t *nullLayerName) { generated_stub("Sprite::GetNullFrame 0040b1d0"); } LayerState * Sprite::GetLayer(uint8_t *layerName) { generated_stub("Sprite::GetLayer 0040b200"); } KColor * Sprite::GetTexel(KColor *param_2, float param_3, float param_4, float param_5, float param_6, float param_7, int param_8) { generated_stub("Sprite::GetTexel 0040b590"); } -uint8_t Sprite::ReplaceSpritesheet(int layerId, std_string *pngFilename) { generated_stub("Sprite::ReplaceSpritesheet 0040bf30"); } void Sprite::LoadGraphics() { generated_stub("Sprite::LoadGraphics 0040bff0"); } Vector * Sprite::Scale() { generated_stub("Sprite::Scale 00417200"); } long double Sprite::Rotation() { generated_stub("Sprite::Rotation 00417210"); } @@ -12295,15 +12182,11 @@ uint8_t Sprite::IsLoaded() { generated_stub("Sprite::IsLoaded 00420160"); } void Sprite::SetScale(Vector *scale) { generated_stub("Sprite::SetScale 00420170"); } std_string * Sprite::GetFilename(std_string *outName) { generated_stub("Sprite::GetFilename 004312e0"); } void Sprite::SetOverlayRenderPriority(uint8_t param_2) { generated_stub("Sprite::SetOverlayRenderPriority 00431300"); } -void Sprite::set_flip_x(uint8_t isFlipX) { generated_stub("Sprite::set_flip_x 00435c60"); } void Sprite::SetRotation(float rotation) { generated_stub("Sprite::SetRotation 0043ee80"); } int Sprite::GetLayerCount() { generated_stub("Sprite::GetLayerCount 00440e40"); } void Sprite::set_offset(Vector *offset) { generated_stub("Sprite::set_offset 00456340"); } long double Sprite::PlaybackSpeed() { generated_stub("Sprite::PlaybackSpeed 00456360"); } Vector * Sprite::Offset() { generated_stub("Sprite::Offset 0049cb40"); } -std_string * Sprite::GetDefaultAnimationName() { generated_stub("Sprite::GetDefaultAnimationName 004a5cf0"); } -char * Sprite::GetAnimation(char *param_2) { generated_stub("Sprite::GetAnimation 0085db20"); } -std_string * Sprite::GetOverlayAnimation(std_string *outName) { generated_stub("Sprite::GetOverlayAnimation 0085db70"); } SpriteTrailData::~SpriteTrailData() { generated_stub("SpriteTrailData::~SpriteTrailData 005d2370"); } void StatsPanel::add_stat_line() { generated_stub("StatsPanel::add_stat_line 0084dc00"); } void StatsPanel::set(Entity_Player *player, uint8_t isGoldenTrinket) { generated_stub("StatsPanel::set 0084dea0"); } @@ -12614,17 +12497,7 @@ bool FUN_004073a0() { generated_stub("FUN_004073a0 004073a0"); } void FUN_00407470() { generated_stub("FUN_00407470 00407470"); } int FUN_004074a0() { generated_stub("FUN_004074a0 004074a0"); } void Isaac::SwapANM2(ANM2 *left, ANM2 *right) { generated_stub("Isaac::SwapANM2 00407ae0"); } -void FUN_0040a080(int param_1, Vector *param_2, Vector *param_3, Vector *param_4) { generated_stub("FUN_0040a080 0040a080"); } -void FUN_0040a400(int param_1) { generated_stub("FUN_0040a400 0040a400"); } -void FUN_0040a740() { generated_stub("FUN_0040a740 0040a740"); } void _empty_check_0x34() { generated_stub("_empty_check_0x34 0040a7c0"); } -void FUN_0040a860(uint8_t *param_1, int param_2) { generated_stub("FUN_0040a860 0040a860"); } -uint32_t FUN_0040a8a0(int param_1) { generated_stub("FUN_0040a8a0 0040a8a0"); } -void FUN_0040a9c0() { generated_stub("FUN_0040a9c0 0040a9c0"); } -uint32_t FUN_0040a9f0(uint8_t *param_1) { generated_stub("FUN_0040a9f0 0040a9f0"); } -uint32_t FUN_0040aa70(uint8_t *param_1) { generated_stub("FUN_0040aa70 0040aa70"); } -int FUN_0040b4d0(int param_1) { generated_stub("FUN_0040b4d0 0040b4d0"); } -uint32_t FUN_0040bc90() { generated_stub("FUN_0040bc90 0040bc90"); } void FUN_0040bcb0(uint8_t *param_1) { generated_stub("FUN_0040bcb0 0040bcb0"); } void guard_check_icall() { generated_stub("guard_check_icall 0040c200"); } void FUN_0040c230() { generated_stub("FUN_0040c230 0040c230"); } @@ -12690,8 +12563,6 @@ void FUN_00414b50() { generated_stub("FUN_00414b50 00414b50"); } uint8_t * Catch_All_00414cab() { generated_stub("Catch_All_00414cab 00414cab"); } void FUN_00414ccb() { generated_stub("FUN_00414ccb 00414ccb"); } void FUN_00414d60(uint32_t *param_1, void *param_2) { generated_stub("FUN_00414d60 00414d60"); } -void InterpolateNullFrames(void *frameBuf, uint32_t *frameCountPtr, void *scratch) { generated_stub("InterpolateNullFrames 00414e00"); } -void InterpolateLayerFrames(void *frames, uint32_t *frameCount, void *scratchFrames) { generated_stub("InterpolateLayerFrames 00415170"); } ANM2 ** FUN_004156c0(ANM2 **param_1, uint32_t *param_2) { generated_stub("FUN_004156c0 004156c0"); } void FUN_00415ae0(uint32_t param_1, int *param_2) { generated_stub("FUN_00415ae0 00415ae0"); } void FUN_00415b30() { generated_stub("FUN_00415b30 00415b30"); } @@ -12831,7 +12702,6 @@ void Player_stats_add(void *onlineStats, uint32_t statId, Entity_Player *player, void init_coop_awards(void *awards) { generated_stub("init_coop_awards 00425b70"); } uint64_t player_get_net_user_id(Entity_Player *player) { generated_stub("player_get_net_user_id 004264c0"); } int * FUN_00426560(int param_1, int param_2) { generated_stub("FUN_00426560 00426560"); } -void FUN_004269f0() { generated_stub("FUN_004269f0 004269f0"); } void FUN_00427290() { generated_stub("FUN_00427290 00427290"); } int holiday_get_current(uint32_t yyyymmdd) { generated_stub("holiday_get_current 00427870"); } void FUN_00428560(uint32_t *param_1, uint32_t param_2) { generated_stub("FUN_00428560 00428560"); } @@ -12952,7 +12822,6 @@ void FUN_0042f7a0(uint32_t *param_1) { generated_stub("FUN_0042f7a0 0042f7a0"); uint32_t * FUN_0042f800(uint32_t *param_1) { generated_stub("FUN_0042f800 0042f800"); } void ItemUseAnim::update() { generated_stub("ItemUseAnim::update 004303e0"); } void FUN_00430750(int param_1, uint32_t param_2) { generated_stub("FUN_00430750 00430750"); } -void init_engine_parameters() { generated_stub("init_engine_parameters 004307c0"); } void FUN_00430f50() { generated_stub("FUN_00430f50 00430f50"); } void FUN_00431030() { generated_stub("FUN_00431030 00431030"); } void FUN_00431050() { generated_stub("FUN_00431050 00431050"); } @@ -13835,12 +13704,8 @@ void FUN_00683a90(int param_1, int param_2) { generated_stub("FUN_00683a90 00683 size_t FUN_00683b60(void *param_1, int param_2, int param_3) { generated_stub("FUN_00683b60 00683b60"); } int FUN_00683bb0(char *param_1, char *param_2) { generated_stub("FUN_00683bb0 00683bb0"); } uint32_t FUN_00683c10(void *param_1, int param_2, int param_3) { generated_stub("FUN_00683c10 00683c10"); } -uint32_t * keyvalue_map_parse(uint8_t *param_1) { generated_stub("keyvalue_map_parse 00683d00"); } -int keyvalue_map_read_int(uint32_t param_1, int param_2) { generated_stub("keyvalue_map_read_int 00684130"); } -void keyvalue_map_read_float(uint32_t param_1) { generated_stub("keyvalue_map_read_float 006843a0"); } void FUN_00684450() { generated_stub("FUN_00684450 00684450"); } void FUN_006844a0() { generated_stub("FUN_006844a0 006844a0"); } -char * keyvalue_map_get(char *param_1, uint8_t *param_2) { generated_stub("keyvalue_map_get 00684590"); } void sha1_transform() { generated_stub("sha1_transform 006846c0"); } void sha1_digest(uint32_t param_1) { generated_stub("sha1_digest 00684920"); } KColor * hsv_to_rgb(KColor *outColor, float hue, float saturation, float value, float alpha) { generated_stub("hsv_to_rgb 00684b90"); } @@ -17096,7 +16961,6 @@ int * FUN_00930a00(int param_1) { generated_stub("FUN_00930a00 00930a00"); } uint32_t FUN_00930b20() { generated_stub("FUN_00930b20 00930b20"); } void FUN_00930ec0() { generated_stub("FUN_00930ec0 00930ec0"); } void FUN_00930ee0(char param_1) { generated_stub("FUN_00930ee0 00930ee0"); } -int IsaacMain(int argc, uint8_t **argv) { generated_stub("IsaacMain 00931050"); } void FUN_00931f50(uint32_t *param_1, int param_2) { generated_stub("FUN_00931f50 00931f50"); } void FUN_00931fc0(uint32_t *param_1, uint32_t *param_2) { generated_stub("FUN_00931fc0 00931fc0"); } void FUN_00932020(uint32_t *param_1, int param_2) { generated_stub("FUN_00932020 00932020"); } @@ -17233,7 +17097,6 @@ void FUN_009a8a40() { generated_stub("FUN_009a8a40 009a8a40"); } void _player_hud_set_heart_anim_state(int param_1) { generated_stub("_player_hud_set_heart_anim_state 009a90b0"); } void move_directory_files() { generated_stub("move_directory_files 009a90e0"); } uint8_t delete_directory_recursive(uint8_t *path) { generated_stub("delete_directory_recursive 009a9250"); } -void FontKerningPair::SetupSaveDirectories() { generated_stub("FontKerningPair::SetupSaveDirectories 009a9510"); } void FUN_009a9fc0(int param_1, int param_2) { generated_stub("FUN_009a9fc0 009a9fc0"); } void FUN_009aa020(char param_1) { generated_stub("FUN_009aa020 009aa020"); } int FontKerningPair::IsaacStartup(int argc, uint8_t **argv) { generated_stub("FontKerningPair::IsaacStartup 009aa040"); } @@ -17507,7 +17370,6 @@ void FUN_00a110e0(uint32_t param_1, uint8_t param_2) { generated_stub("FUN_00a11 void FUN_00a11130(Vector *param_1, Vector *param_2, Vector *param_3, Vector *param_4) { generated_stub("FUN_00a11130 00a11130"); } void * quad_set_rect(void *self, Vector *pos, Vector *size, int unused) { generated_stub("quad_set_rect 00a11160"); } void FUN_00a112a0(uint32_t *param_1) { generated_stub("FUN_00a112a0 00a112a0"); } -void KAGE_LogMessage(uint32_t flags, uint8_t *format) { generated_stub("KAGE_LogMessage 00a112c0"); } void FUN_00a11590(uint32_t param_1, uint32_t param_2) { generated_stub("FUN_00a11590 00a11590"); } void copy_20_bytes(void *self, void *src) { generated_stub("copy_20_bytes 00a115c0"); } void FUN_00a115f0(uint8_t param_1) { generated_stub("FUN_00a115f0 00a115f0"); } @@ -17642,12 +17504,9 @@ int * glfw_get_window_size(int *outSize, int unused) { generated_stub("glfw_get_ void glfw_set_window_pos(int param_1, int param_2) { generated_stub("glfw_set_window_pos 00a19600"); } void FUN_00a19b60() { generated_stub("FUN_00a19b60 00a19b60"); } void FUN_00a19bc0() { generated_stub("FUN_00a19bc0 00a19bc0"); } -void FUN_00a19bf0(void *param_1, int param_2, int param_3) { generated_stub("FUN_00a19bf0 00a19bf0"); } void FUN_00a19dd0() { generated_stub("FUN_00a19dd0 00a19dd0"); } void * window_get_current_monitor(void *window) { generated_stub("window_get_current_monitor 00a1a2e0"); } -void FUN_00a1a470(uint8_t param_1) { generated_stub("FUN_00a1a470 00a1a470"); } void FUN_00a1a500() { generated_stub("FUN_00a1a500 00a1a500"); } -void FUN_00a1a580(uint32_t param_1) { generated_stub("FUN_00a1a580 00a1a580"); } void FUN_00a1a6f0() { generated_stub("FUN_00a1a6f0 00a1a6f0"); } int FUN_00a1b510(uint32_t param_1) { generated_stub("FUN_00a1b510 00a1b510"); } void FUN_00a1d4d0(uint32_t param_1, uint32_t *param_2) { generated_stub("FUN_00a1d4d0 00a1d4d0"); } @@ -17829,7 +17688,6 @@ int glfwGetMouseButton() { generated_stub("glfwGetMouseButton 00a264f0"); } void FUN_00a26570() { generated_stub("FUN_00a26570 00a26570"); } void FUN_00a26620() { generated_stub("FUN_00a26620 00a26620"); } uint32_t FUN_00a26670() { generated_stub("FUN_00a26670 00a26670"); } -void FUN_00a266a0() { generated_stub("FUN_00a266a0 00a266a0"); } void FUN_00a267c0() { generated_stub("FUN_00a267c0 00a267c0"); } void FUN_00a27930() { generated_stub("FUN_00a27930 00a27930"); } int FUN_00a27960(uint32_t param_1) { generated_stub("FUN_00a27960 00a27960"); } @@ -17895,7 +17753,6 @@ void FUN_00a2bcb0(uint32_t param_1, int *param_2) { generated_stub("FUN_00a2bcb0 void FUN_00a2bd60(uint32_t *param_1, uint32_t param_2) { generated_stub("FUN_00a2bd60 00a2bd60"); } void FUN_00a2bd90(uint32_t *param_1, int *param_2) { generated_stub("FUN_00a2bd90 00a2bd90"); } void sound_entry_ptr_destroy() { generated_stub("sound_entry_ptr_destroy 00a2bf60"); } -uint8_t * utf8_decode_next(uint8_t *text, uint32_t *outCodepoint, uint8_t *end) { generated_stub("utf8_decode_next 00a2bfe0"); } short * utf8_to_utf16_alloc(uint8_t *text) { generated_stub("utf8_to_utf16_alloc 00a2c370"); } void FUN_00a2c470(uint8_t *param_1, uint32_t param_2, int param_3) { generated_stub("FUN_00a2c470 00a2c470"); } void FUN_00a2c570(uint16_t *param_1, int param_2, int *param_3) { generated_stub("FUN_00a2c570 00a2c570"); } @@ -21029,8 +20886,6 @@ void FUN_00a55b00(short *param_1, int param_2) { generated_stub("FUN_00a55b00 00 uint16_t FUN_00a55b50() { generated_stub("FUN_00a55b50 00a55b50"); } void FUN_00a55c20() { generated_stub("FUN_00a55c20 00a55c20"); } uint8_t * FUN_00a56300(uint16_t *param_1, uint16_t *param_2, uint8_t *param_3) { generated_stub("FUN_00a56300 00a56300"); } -void formatted_text_measure(uint8_t *param_1, int param_2, uint32_t *param_3) { generated_stub("formatted_text_measure 00a56750"); } -void FUN_00a56bf0(short *param_1, int param_2, uint32_t *param_3) { generated_stub("FUN_00a56bf0 00a56bf0"); } uint8_t * FUN_00a56d60(uint8_t *param_1) { generated_stub("FUN_00a56d60 00a56d60"); } uint8_t * FUN_00a56da0(uint8_t *param_1) { generated_stub("FUN_00a56da0 00a56da0"); } void FUN_00a56de0(uint8_t param_1) { generated_stub("FUN_00a56de0 00a56de0"); } @@ -21169,7 +21024,6 @@ void FUN_00a5ef90(uint32_t *param_1) { generated_stub("FUN_00a5ef90 00a5ef90"); uint32_t FUN_00a5efc0(uint32_t param_1, uint32_t param_2, uint32_t param_3) { generated_stub("FUN_00a5efc0 00a5efc0"); } int FUN_00a5f000(uint32_t param_1, int param_2, uint32_t param_3, uint32_t param_4) { generated_stub("FUN_00a5f000 00a5f000"); } uint32_t FUN_00a5f090() { generated_stub("FUN_00a5f090 00a5f090"); } -void kage_system_init() { generated_stub("kage_system_init 00a5f0e0"); } void FUN_00a5f1a0(uint32_t *param_1) { generated_stub("FUN_00a5f1a0 00a5f1a0"); } char * FUN_00a5f1c0() { generated_stub("FUN_00a5f1c0 00a5f1c0"); } uint32_t FUN_00a5f200() { generated_stub("FUN_00a5f200 00a5f200"); } @@ -21178,7 +21032,6 @@ uint32_t FUN_00a5f2e0() { generated_stub("FUN_00a5f2e0 00a5f2e0"); } uint32_t FUN_00a5f310() { generated_stub("FUN_00a5f310 00a5f310"); } uint32_t FUN_00a5f340() { generated_stub("FUN_00a5f340 00a5f340"); } uint32_t FUN_00a5f370() { generated_stub("FUN_00a5f370 00a5f370"); } -void log_file_open(uint8_t *param_1) { generated_stub("log_file_open 00a5f3a0"); } void FUN_00a5f4b0(uint8_t param_1) { generated_stub("FUN_00a5f4b0 00a5f4b0"); } uint32_t FUN_00a5f510() { generated_stub("FUN_00a5f510 00a5f510"); } void FUN_00a5f630() { generated_stub("FUN_00a5f630 00a5f630"); } @@ -21331,7 +21184,6 @@ void FUN_00a68360() { generated_stub("FUN_00a68360 00a68360"); } void FUN_00a68440(uint8_t param_1) { generated_stub("FUN_00a68440 00a68440"); } uint32_t FUN_00a68470() { generated_stub("FUN_00a68470 00a68470"); } void FUN_00a68480() { generated_stub("FUN_00a68480 00a68480"); } -uint64_t GetTimeNs() { generated_stub("GetTimeNs 00a68490"); } void FUN_00a684f0(uint8_t param_1) { generated_stub("FUN_00a684f0 00a684f0"); } void FUN_00a68540() { generated_stub("FUN_00a68540 00a68540"); } void FUN_00a68570(uint32_t param_1) { generated_stub("FUN_00a68570 00a68570"); } @@ -21443,7 +21295,6 @@ void FUN_00a70d20(uint32_t *param_1, uint32_t param_2) { generated_stub("FUN_00a void FUN_00a70d50(uint32_t param_1, int *param_2) { generated_stub("FUN_00a70d50 00a70d50"); } void FUN_00a70e00(int *param_1, uint32_t *param_2) { generated_stub("FUN_00a70e00 00a70e00"); } void FUN_00a70fe0() { generated_stub("FUN_00a70fe0 00a70fe0"); } -uint32_t KAGE::System::Init() { generated_stub("KAGE::System::Init 00a710a0"); } void KAGE::System::update() { generated_stub("KAGE::System::update 00a714e0"); } void kage_shutdown() { generated_stub("kage_shutdown 00a71770"); } uint32_t FUN_00a71c20() { generated_stub("FUN_00a71c20 00a71c20"); } diff --git a/generated-src/weapon.cpp b/generated-src/weapon.cpp index b62044e..974435d 100644 --- a/generated-src/weapon.cpp +++ b/generated-src/weapon.cpp @@ -13,7 +13,7 @@ uint8_t Weapon::is_held_item(ANM2 *sprite, std_string *animName, void *itemDesc) if (0xf < animName->_capacity) { animName = *GHIDRA_CAST(animName->_buf); } - animData = (GHIDRA_CAST((sprite)))->ANM2::GetAnimationData(GHIDRA_CAST(animName)); + animData = ANM2::GetAnimationData(sprite,GHIDRA_CAST(animName)); if (animData != (void *)0x0) { return 1; } @@ -964,7 +964,7 @@ LAB_009f51e9: } bVar2 = isAllFinished; if (isHeldItem) { - bVar2 = (GHIDRA_CAST((sprite)))->ANM2::IsFinishedImpl(emptyAnimName); + bVar2 = ANM2::IsFinishedImpl(sprite,emptyAnimName); if ((bVar2 != 0) && ((pvVar3 = (sprite->_animState)._animData, pvVar3 == (void *)0x0 || (*GHIDRA_CAST((GHIDRA_CAST(pvVar3) + 0x34)) == '\0')))) { diff --git a/generated-src/weapon_bone.cpp b/generated-src/weapon_bone.cpp index 8dc75fe..6287295 100644 --- a/generated-src/weapon_bone.cpp +++ b/generated-src/weapon_bone.cpp @@ -173,9 +173,9 @@ LAB_009ff054: LAB_009ff059: if ((uVar3 == 0) && ((pbVar2[0x34] == 0 || (*GHIDRA_CAST((knife + 0x8c)) != '\0')))) break; } - bVar1 = (GHIDRA_CAST((GHIDRA_CAST((knife + 0x48)))))->ANM2::SetAnimation(s_Idle,1); + bVar1 = ANM2::SetAnimation(GHIDRA_CAST((knife + 0x48)),s_Idle,1); if (bVar1 != 0) { - (GHIDRA_CAST((GHIDRA_CAST((knife + 0x78)))))->AnimationState::Rewind(); + AnimationState::Rewind(GHIDRA_CAST((knife + 0x78))); *GHIDRA_CAST((knife + 0x8c)) = 1; } } diff --git a/scripts/source_tree.py b/scripts/source_tree.py index eab640a..b0d123e 100644 --- a/scripts/source_tree.py +++ b/scripts/source_tree.py @@ -363,7 +363,7 @@ stubs, dataStubs = [], [] # (owner, declaration, address): everything src/ has def class_emit(cls, stack=()): if cls in done or cls in stack or cls in PRELUDE_TYPES: return if cls in curatedClasses: return # declared by src/, only forward-declared here - parent = base.get(cls) if base.get(cls) in names else None + parent = base.get(cls) if base.get(cls) in names and base.get(cls) not in curatedClasses else None # a src/ parent stays bytes if parent: class_emit(parent, stack + (cls,)) namespace, _, shortName = cls.rpartition('::') isNested = namespace in names # Cutscene::ANM2Part: declared inside Cutscene, defined after it @@ -449,7 +449,7 @@ def intrinsic_define(name): # CONCAT412: x=4, y=12; ZEXT1632: x=16, y=32 (a le # Everything that is not a method of a class above: free functions (FUN_ too) and namespace functions, as declared free, freeSeen = collections.defaultdict(list), set() for addr, (cls, method, ret, cc, params, thisParam, _) in sorted(funcs.items()): - if cls in done or not IDENT.match(method) or (cls and not QUALIFIED.match(cls)) or (cls, method) in freeSeen or (not cls and method in STD_NAMES): continue + if cls in done or cls in curatedClasses or not IDENT.match(method) or (cls and not QUALIFIED.match(cls)) or (cls, method) in freeSeen or (not cls and method in STD_NAMES): continue freeSeen.add((cls, method)) if thisParam: params = [re.sub(r'\bthis$', 'self', thisParam)] + params free[cls].append(f'{ret} {method}({", ".join(params)}); // {addr:08x}') @@ -512,8 +512,19 @@ with open(outDir + '/classes.h', 'w') as o: # One .cpp per class: each body under the declaration it was declared with; a renamed `this` gets an alias. members = {f'{f[0]}::{f[1]}' for f in funcs.values() if f[3] == '__thiscall' and f[0] in done} spans, files = collections.defaultdict(list), {} -curated = {int(a, 16) for root, _, names_ in os.walk(srcDir) for n in names_ if n.endswith(('.cpp', '.h')) - for a in re.findall(r'//\s*([0-9a-f]{8})\b', open(os.path.join(root, n), errors='replace').read())} +def curated_load(): # addresses src/ took over: the one starting a comment, and every one in a (a, b, c to d) list on it + found, addresses = set(), sorted(funcs) + for root, _, files_ in os.walk(srcDir): + for name in [f for f in files_ if f.endswith(('.cpp', '.h'))]: + for comment in re.findall(r'//(.*)', open(os.path.join(root, name), errors='replace').read()): + lists = re.findall(r'\(((?:[0-9a-f]{8}(?:\s*(?:,|to)\s*)?)+)\)', comment) + lead = re.match(r'\s*([0-9a-f]{8})\b', comment) + for item in lists + ([lead[1]] if lead else []): + for low, high in re.findall(r'([0-9a-f]{8})(?:\s*to\s*([0-9a-f]{8}))?', item): + high = high or low + found |= {a for a in addresses if int(low, 16) <= a <= int(high, 16)} | {int(low, 16)} + return found +curated = curated_load() for cls in [c for c in done if not LIBRARY.match(c)]: parts, line = ['#include "classes.h"\n'], 2 for addr, (_, method, ret, cc, params) in methods.get(cls, []): diff --git a/src/anm2.cpp b/src/anm2.cpp index bdda860..29a637b 100644 --- a/src/anm2.cpp +++ b/src/anm2.cpp @@ -1,38 +1,69 @@ #include "anm2.h" -#include "classes.h" +#include "data.h" #include "log.h" #include +#include #include #include #include #include -#include +#include +#include + +using simdjson::dom::array; +using simdjson::dom::element; +using simdjson::dom::object; -// An MSVC string keeps up to 15 characters in its own buffer, and a pointer to the heap there past that. -constexpr uint32_t STRING_INLINE_CAPACITY = 15; constexpr int LOG_MESSAGE_SIZE = 1024; constexpr int FRAME_INDEX_UNSET = -1; -constexpr float ANIMATION_FRAME_UNSET = -1.0f; -// Trigger event ids pick a bit of a 32-bit event mask. -constexpr uint32_t EVENT_ID_MASK = 31; -constexpr int NO_SHADOW_LAYER = -1; -constexpr const char* SHADOW_LAYER_NAME = "shadow"; -// Layers and nulls named with this first are lit (AnimRenderFlag). -constexpr char LIGHT_LAYER_PREFIX = '*'; -constexpr float PLAYBACK_SPEED_DEFAULT = 1.0f; -// The g_graphicsManager_flags bit that makes layers blend with premultiplied alpha. +constexpr uint32_t EVENT_BIT_MASK = 31; +constexpr float CHANNEL = 255; +constexpr float PERCENT = 100; +constexpr float HALF = 0.5f; +constexpr float DEGREES_HALF_TURN = 180; +constexpr float DEGREES_TURN = 360; +constexpr float RADIANS_PER_DEGREE = 0.017453292f; +constexpr float GLITCH_TURN = 90; +constexpr int SHIMMER_STEPS = 256; constexpr uint32_t GRAPHICS_PREMULTIPLIED_ALPHA = 4; -constexpr ColorMod COLOR_DEFAULT = {{1, 1, 1, 1}, {0, 0, 0, 0}, {0, 0, 0}}; -constexpr ColorMod CHAMPION_COLOR_DEFAULT = {{1, 1, 1, 0}, {0, 0, 0, 0}, {0, 0, 0}}; +constexpr uint32_t MSVC_STRING_INLINE_CAPACITY = 15; +constexpr char LIGHT_LAYER_PREFIX = '*'; +constexpr std::string_view SHADOW_LAYER_NAME = "shadow"; +constexpr std::string_view APPEAR_ANIMATION = "Appear"; +constexpr std::string_view IDLE_ANIMATION = "Idle"; +constexpr std::string_view CHAMPION_COLOR_UNIFORM = "ChampionColor"; +constexpr int UNIFORM_COLOR_MOD = 11; -// What tracked_alloc does with its block. -enum TrackedAllocMode : uint8_t +// Delirium's forms swap a boss's or monster's spritesheets for the ones under DELIRIUM_FORMS_FOLDER. +constexpr int DELIRIUM_TYPE = 412; +constexpr std::string_view GFX_FOLDER = "gfx/"; +constexpr std::string_view BOSSES_FOLDER = "bosses"; +constexpr std::string_view MONSTERS_FOLDER = "monsters"; +constexpr std::string_view DELIRIUM_FORMS_FOLDER = "Bosses/AfterbirthPlus/DeliriumForms"; + +// The xorshift the glitch jitter draws from, and the one a procedural item's layer turns by. +constexpr uint32_t GLITCH_SEED = 0x9e3779b9; +constexpr uint32_t PROCEDURAL_SHIFTS[] = {5, 9, 7}; + +// What Manager::LoadImage fills: the image and its KAGE reference count. +struct ImageHandle { - TRACKED_ALLOCATE = 0, - TRACKED_FREE = 1 + KAGE::Graphics::ImageBase* image = nullptr; + void* refCount = nullptr; }; -// Formats a message for KAGE_LogMessage, whose declaration takes no arguments to format. +// What reading one .anm2 needs at hand: its path for messages and its spritesheets' regions as keyframes. +struct Anm2Parse +{ + std::string path; + std::vector> regions; + std::vector layerSheets; +}; + +static std::unordered_map> cacheFiles; +static const std::string EMPTY_NAME; + +// Formats a message for KAGE_LogMessage, whose declaration takes nothing to format with. static void log_print(LogLevel level, const char* format, ...) { char message[LOG_MESSAGE_SIZE]; @@ -44,156 +75,624 @@ static void log_print(LogLevel level, const char* format, ...) KAGE_LogMessage(level, (uint8_t*)message); } -static char* string_text(std_string& text) +// An MSVC string's text, for the records still kept in the original layout. +static std::string_view std_string_view(const std_string& text) { - return text._capacity <= STRING_INLINE_CAPACITY ? text._buf : *(char**)text._buf; + return {text._capacity > MSVC_STRING_INLINE_CAPACITY ? *(char* const*)text._buf : text._buf, text._size}; } -// Makes a string empty without storage, as a fresh one. -static void string_reset(std_string& text) +static bool is_prefix_case_insensitive(std::string_view text, std::string_view prefix) { - text = {}; - text._capacity = STRING_INLINE_CAPACITY; + auto isSame = [](char a, char b) { return std::tolower((unsigned char)a) == std::tolower((unsigned char)b); }; + return text.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), text.begin(), isSame); } -// Empties a string, keeping its storage. -static void string_clear(std_string& text) +// The position of a name in a file's list, or -1. +static int name_index(const std::vector* names, std::string_view name) { - string_text(text)[0] = '\0'; - text._size = 0; + if (!names) return -1; + + auto found = std::find(names->begin(), names->end(), name); + return found == names->end() ? -1 : (int)(found - names->begin()); } -static void string_copy(std_string& to, std_string& from) +// KAGE's render pass flags, which the graphics layer owns. +static bool is_reflection_pass() { - ((msvc::string*)&to)->assign((uint8_t*)string_text(from), from._size); + return DAT_00c7977d != 0; } -static void string_free(std_string& text) +static bool is_light_pass() { - ((msvc::string*)&text)->_Tidy_deallocate(); + return DAT_00c7977e != 0; } -// Frees each string, then the array. -static void string_array_free(std_string* strings, uint32_t count) +static bool is_procedural_item_pass() { - for (uint32_t i = 0; i < count; i++) string_free(strings[i]); - delete[] strings; + return DAT_00c7977f != 0; } -// A tracked block of count frame indices, all unset, or null for no tracks. -static int* frame_indices_create(int count) +static bool is_screen_shake_applied() { - if (count <= 0) return nullptr; - - auto indices = (int*)tracked_alloc(TRACKED_ALLOCATE, nullptr, count * sizeof(int)); - std::fill_n(indices, count, FRAME_INDEX_UNSET); - return indices; + return DAT_00c33910 != 0; } -static void frame_indices_free(int*& indices) +// A colour a fraction t of the way to another, every channel, as Color::Lerp does. +static ColorMod color_lerp(const ColorMod& from, const ColorMod& to, float t) { - tracked_alloc(TRACKED_FREE, indices, 0); - indices = nullptr; + float rest = 1 - t; + ColorMod color; + + for (int i = 0; i < 4; i++) color._tint[i] = from._tint[i] * rest + to._tint[i] * t; + for (int i = 0; i < 4; i++) color._colorize[i] = from._colorize[i] * rest + to._colorize[i] * t; + for (int i = 0; i < 3; i++) color._offset[i] = from._offset[i] * rest + to._offset[i] * t; + return color; } -// Moves frame indices onto a new track count, keeping the ones both counts share. -static void frame_indices_resize(int*& indices, int oldCount, int newCount) +// Tints a colour by another, as Color's *= does: tints multiply, offsets add and colorizes average. +static void color_multiply(ColorMod& color, const ColorMod& other) { - if (oldCount == newCount) return; + for (int i = 0; i < 4; i++) color._tint[i] = other._tint[i] * color._tint[i]; - int* resized = frame_indices_create(newCount); - if (resized && indices) std::copy_n(indices, std::min(oldCount, newCount), resized); - frame_indices_free(indices); - indices = resized; + if (other._colorize[0] + other._colorize[1] + other._colorize[2] != 0) + { + bool isColorized = color._colorize[0] + color._colorize[1] + color._colorize[2] != 0; + for (int i = 0; i < 4; i++) + color._colorize[i] = isColorized ? (color._colorize[i] + other._colorize[i]) * HALF : other._colorize[i]; + } + + for (int i = 0; i < 3; i++) color._offset[i] = other._offset[i] + color._offset[i]; } -// 004087a0 Frees the frame indices. -AnimationState::~AnimationState() +// An angle brought into [-180, 180] degrees. +static float angle_wrap(float angle) { - frame_indices_free(_layerFrames); - frame_indices_free(_nullLayerFrames); + if (std::fabs(angle) > DEGREES_TURN) angle = (float)std::fmod((double)angle, (double)DEGREES_TURN); + if (angle > DEGREES_HALF_TURN) return angle - DEGREES_TURN; + if (angle < -DEGREES_HALF_TURN) return angle + DEGREES_TURN; + return angle; +} + +// An angle a fraction t of the way to another, the short way round. +static float angle_lerp(float from, float to, float t) +{ + from = angle_wrap(from); + to = angle_wrap(to); + if (std::fabs(to - from) > DEGREES_HALF_TURN) + { + if (to > from) from += DEGREES_TURN; + else to += DEGREES_TURN; + } + return angle_wrap((to - from) * t + from); +} + +// Moves a keyframe's position, scale, colour and rotation a fraction t of the way between two keyframes. +static void frame_lerp(NullFrame& frame, const NullFrame& from, const NullFrame& to, float t) +{ + frame.pos.x = (to.pos.x - from.pos.x) * t + from.pos.x; + frame.pos.y = (to.pos.y - from.pos.y) * t + from.pos.y; + frame.scale.x = (to.scale.x - from.scale.x) * t + from.scale.x; + frame.scale.y = (to.scale.y - from.scale.y) * t + from.scale.y; + frame.color = color_lerp(from.color, to.color, t); + frame.rotation = angle_lerp(from.rotation, to.rotation, t); +} + +// 00415170 Bakes a track's interpolation, as InterpolateLayerFrames and InterpolateNullFrames (00414e00) do. +// An interpolated keyframe but the last becomes one keyframe per tick, linear toward the next whatever the easing. +// t steps by 1 / duration added up in floats, as the game adds it. +template static std::vector track_interpolate(const std::vector& frames) +{ + std::vector baked; + int tick = 0; + + for (size_t i = 0; i < frames.size(); i++) + { + const Frame& from = frames[i]; + if (i + 1 == frames.size() || !from.isInterpolated) + { + Frame& frame = baked.emplace_back(from); + frame.startFrame = tick; + frame.endFrame = tick + from.duration; + tick += from.duration; + continue; + } + + if (i + 1 >= ANM2_FRAME_LIMIT) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"too many frames after interpolation\n"); + float step = 1.0f / (float)from.duration; + float t = 0; + for (int k = 0; k < from.duration; k++) + { + Frame& frame = baked.emplace_back(from); + frame_lerp(frame, from, frames[i + 1], t); + frame.duration = 1; + frame.startFrame = tick; + frame.endFrame = ++tick; + t = step + t; + } + } + return baked; +} + +// Multiplies the root track into a track, cutting its keyframes wherever a root keyframe ends. +// A piece keeps its source's duration, only its end is right. The root does not turn positions. +// The original applies a stale root keyframe when an animation has none. Here that root changes nothing. +template static std::vector track_root_apply(std::vector& frames, + const std::vector& root, + const std::string& path) +{ + static const NullFrame ROOT_NONE; + std::vector baked; + size_t rootIndex = 0; + int tick = 0; + + for (Frame& source : frames) + { + source.startFrame = tick; + for (int k = 0; k < source.duration; k++) + { + size_t previous = rootIndex; + bool isRootEnded = false; + + tick++; + if (rootIndex + 1 < root.size()) + { + while (tick >= root[rootIndex].endFrame && ++rootIndex + 1 < root.size()) {} + isRootEnded = rootIndex > previous; + } + if (!isRootEnded && k != source.duration - 1) continue; + + if (baked.size() >= ANM2_FRAME_LIMIT) + log_print(LOG_ASSERT, "%s: too many frames after interpolation/root frame adjustment\n", path.c_str()); + const NullFrame& rootFrame = root.empty() ? ROOT_NONE : root[previous]; + Frame& frame = baked.emplace_back(source); + frame.pos.x = frame.pos.x * rootFrame.scale.x + rootFrame.pos.x; + frame.pos.y = rootFrame.scale.y * frame.pos.y + rootFrame.pos.y; + frame.isVisible = frame.isVisible && rootFrame.isVisible; + frame.scale.x = frame.scale.x * rootFrame.scale.x; + frame.scale.y = rootFrame.scale.y * frame.scale.y; + color_multiply(frame.color, rootFrame.color); + frame.rotation = rootFrame.rotation + frame.rotation; + frame.endFrame = tick; + source.startFrame = tick; + } + } + return baked; +} + +static float number_get(object source, std::string_view key, float fallback) +{ + double value; + return source[key].get(value) ? fallback : (float)value; +} + +static bool is_get(object source, std::string_view key, bool fallback) +{ + bool value; + return source[key].get(value) ? fallback : value; +} + +static std::string_view text_get(object source, std::string_view key) +{ + std::string_view value; + return source[key].get(value) ? std::string_view() : value; +} + +// A list of numbers read into values, each keeping its fallback where the list stops short. +template static void numbers_get(object source, std::string_view key, float (&values)[COUNT]) +{ + array list; + if (source[key].get(list)) return; + + for (size_t i = 0; i < COUNT; i++) + { + double value; + if (!list.at(i).get(value)) values[i] = (float)value; + } +} + +// A keyframe of Anm2Ed's JSON, a region of its spritesheet too, converted as the game converts its XML. +// Any easing plays as the game's linear interpolation. The game has no alpha offset. +static AnimationFrame frame_read(object source, const std::vector* regions) +{ + AnimationFrame frame; + float crop[2] = {}; + float offset[3] = {}; + float pivot[2] = {}; + float pos[2] = {}; + float scale[2] = {PERCENT, PERCENT}; + float size[2] = {}; + float tint[4] = {CHANNEL, CHANNEL, CHANNEL, CHANNEL}; + int64_t region; + + numbers_get(source, "crop", crop); + numbers_get(source, "offset", offset); + numbers_get(source, "pivot", pivot); + numbers_get(source, "pos", pos); + numbers_get(source, "scale", scale); + numbers_get(source, "size", size); + numbers_get(source, "tint", tint); + + frame.crop = vector_make(crop[0], crop[1]); + frame.width = size[0]; + frame.height = size[1]; + frame.pivot = vector_make(pivot[0], pivot[1]); + std::string_view origin = text_get(source, "origin"); + if (origin == "topLeft") frame.pivot = Vector{}; + if (origin == "center") frame.pivot = vector_make(frame.width * HALF, frame.height * HALF); + if (regions && !source["region"].get(region) && region >= 0 && region < (int64_t)regions->size()) + { + const AnimationFrame& shown = (*regions)[region]; + frame.crop = shown.crop; + frame.pivot = shown.pivot; + frame.width = shown.width; + frame.height = shown.height; + } + + for (int i = 0; i < 4; i++) frame.color._tint[i] = tint[i] / CHANNEL; + for (int i = 0; i < 3; i++) frame.color._offset[i] = offset[i] / CHANNEL; + frame.pos = vector_make(pos[0], pos[1]); + frame.scale = vector_make(scale[0] / PERCENT, scale[1] / PERCENT); + frame.rotation = number_get(source, "rotation", 0); + frame.duration = (int)number_get(source, "delay", 1); + frame.isVisible = is_get(source, "visible", true); + frame.isInterpolated = !text_get(source, "interpolation").empty(); + return frame; +} + +template static std::vector frames_read(object source, std::string_view key, + const std::vector* regions) +{ + std::vector frames; + array list; + if (source[key].get(list)) return frames; + + for (element entry : list) + { + object fields; + if (!entry.get(fields)) frames.push_back(frame_read(fields, regions)); + } + return frames; +} + +// An animation's layer tracks in drawing order, a group's among them in its place. +// The game has no groups, so a group's root transform is left out. +static void layer_tracks_read(object source, const Anm2Parse& parse, AnimationData& animation, + const std::vector& root) +{ + array tracks; + if (source["layers"].get(tracks)) return; + + for (element entry : tracks) + { + object fields; + if (entry.get(fields)) continue; + if (!fields["group"].error()) + { + layer_tracks_read(fields, parse, animation, root); + continue; + } + + if (animation.animLayers.size() >= ANM2_LAYER_LIMIT) + log_print(LOG_ASSERT, "%s: too many animation layers\n", parse.path.c_str()); + int layerId = (int)number_get(fields, "layer", -1); + bool isKnown = layerId >= 0 && layerId < (int)parse.layerSheets.size(); + int sheet = isKnown ? parse.layerSheets[layerId] : -1; + bool isSheet = sheet >= 0 && sheet < (int)parse.regions.size(); + const std::vector* regions = isSheet ? &parse.regions[sheet] : nullptr; + auto frames = track_interpolate(frames_read(fields, "frames", regions)); + animation.animLayers.push_back( + {track_root_apply(frames, root, parse.path), layerId, is_get(fields, "visible", true)}); + } +} + +static void null_tracks_read(object source, const Anm2Parse& parse, AnimationData& animation, + const std::vector& root) +{ + array tracks; + if (source["nulls"].get(tracks)) return; + + for (element entry : tracks) + { + object fields; + if (entry.get(fields)) continue; + + if (animation.nullLayers.size() >= ANM2_LAYER_LIMIT) + log_print(LOG_ASSERT, "%s: too many null layers\n", parse.path.c_str()); + auto frames = track_interpolate(frames_read(fields, "frames", nullptr)); + animation.nullLayers.push_back({track_root_apply(frames, root, parse.path), + (int)number_get(fields, "null", -1), is_get(fields, "visible", true)}); + } +} + +// A trigger fires each of its events on its frame, one game trigger per event. +static void triggers_read(object source, const Anm2Parse& parse, AnimationData& animation) +{ + array triggers; + if (source["triggers"].get(triggers)) return; + + for (element entry : triggers) + { + object fields; + array events; + if (entry.get(fields) || fields["events"].get(events)) continue; + + for (element event : events) + { + double eventId; + if (event.get(eventId)) continue; + if (animation.eventTriggers.size() >= ANM2_TRIGGER_LIMIT) + log_print(LOG_ASSERT, "%s: too many triggers\n", parse.path.c_str()); + animation.eventTriggers.push_back({(int)number_get(fields, "at", 0), (uint32_t)eventId}); + } + } +} + +// Every animation of a list in file order, a group's among them in its place. +static void animations_read(object list, const Anm2Parse& parse, AnmFileData& file) +{ + for (auto [name, value] : list) + { + object fields; + object group; + if (value.get(fields)) continue; + if (!fields["animations"].get(group)) + { + animations_read(group, parse, file); + continue; + } + + AnimationData& animation = file.animations.emplace_back(); + animation.name = name; + animation.index = (int)file.animations.size() - 1; + animation.length = (int)number_get(fields, "length", 1); + animation.isLooping = is_get(fields, "loop", true); + + auto root = track_interpolate(frames_read(fields, "root", nullptr)); + layer_tracks_read(fields, parse, animation, root); + null_tracks_read(fields, parse, animation, root); + triggers_read(fields, parse, animation); + for (size_t i = 0; i < animation.animLayers.size(); i++) + { + int layerId = animation.animLayers[i].layerId; + if (layerId >= 0 && layerId < ANM2_LAYER_LIMIT) animation.layerMap[layerId] = (int)i; + } + } +} + +// The names of a list of objects, or of plain strings. +static std::vector names_read(object document, std::string_view key) +{ + std::vector names; + array list; + if (document[key].get(list)) return names; + + for (element entry : list) + { + object fields; + std::string_view name; + if (!entry.get(fields)) name = text_get(fields, "name"); + else if (entry.is_string()) name = entry.get_string().value_unsafe(); + names.emplace_back(name); + } + return names; +} + +// 0040ed50 Parses an .anm2, Anm2Ed's JSON document (its docs/json_format.md), into what the game plays. +// Ids are indices into their lists. Spritesheet paths become relative to resources/, from the .anm2's folder. +static std::shared_ptr file_parse(const std::string& path) +{ + static simdjson::dom::parser parser; + auto file = std::make_shared(); + Anm2Parse parse = {path, {}, {}}; + std::vector sheetPaths; + object document; + array list; + + if (parser.load(resource_path(path)).get(document) || document["anm2ed"].error()) + { + log_print(LOG_INFO, "ERROR Could not open %s\n", path.c_str()); + return nullptr; + } + + if (!document["spritesheets"].get(list)) + for (element entry : list) + { + object fields; + if (entry.get(fields)) continue; + std::string relative(text_get(fields, "path")); + std::replace(relative.begin(), relative.end(), '\\', '/'); + auto resolved = std::filesystem::path(path).parent_path() / relative; + sheetPaths.push_back(resolved.lexically_normal().generic_string()); + parse.regions.push_back(frames_read(fields, "regions", nullptr)); + } + + if (!document["layers"].get(list)) + for (element entry : list) + { + object fields; + LayerData& layer = file->layers.emplace_back(); + bool isRead = !entry.get(fields); + layer.id = (int)file->layers.size() - 1; + layer.name = isRead ? text_get(fields, "name") : ""; + layer.spriteSheetId = isRead ? (int)number_get(fields, "sheet", 0) : 0; + if (layer.id >= ANM2_LAYER_LIMIT) + log_print(LOG_ASSERT, "%s: invalid layer id %d\n", path.c_str(), layer.id); + if (layer.spriteSheetId >= 0 && layer.spriteSheetId < (int)sheetPaths.size()) + layer.spriteSheetPath = sheetPaths[layer.spriteSheetId]; + else log_print(LOG_ASSERT, "%s: invalid spritesheet id %d\n", path.c_str(), layer.spriteSheetId); + parse.layerSheets.push_back(layer.spriteSheetId); + } + if (file->layers.empty()) log_print(LOG_ASSERT, "%s: no layers\n", path.c_str()); + + file->nullLayerNames = names_read(document, "nulls"); + if (file->nullLayerNames.size() > ANM2_LAYER_LIMIT) + log_print(LOG_ASSERT, "%s: invalid Null ID %d\n", path.c_str(), ANM2_LAYER_LIMIT); + file->eventNames = names_read(document, "events"); + if (file->eventNames.size() > ANM2_EVENT_LIMIT) + log_print(LOG_ASSERT, "%s: invalid Event ID %d\n", path.c_str(), ANM2_EVENT_LIMIT); + + file->defaultAnimation = text_get(document, "defaultAnimation"); + object animations; + if (!document["animations"].get(animations)) animations_read(animations, parse, *file); + return file; +} + +// A KAGE image as layers share it. The texture cache keeps a cached one until the last layer showing it lets go. +static std::shared_ptr image_share(ImageHandle loaded, const std::string& path, + bool isCached) +{ + if (!loaded.image) return nullptr; + + auto release = [path, isCached](KAGE::Graphics::ImageBase*) + { + if (isCached) TextureCache::Release((uint8_t*)path.c_str()); + }; + return {loaded.image, release}; +} + +// 0040db90 Gives a sprite the parsed file at its path, parsing it on first use, with fresh layer states. +// A file that fails to load leaves the sprite as it was. The original's reload flag is set by nothing, so a cached +// file is never parsed again. +void AnmCache::Load(ANM2& sprite) +{ + if (sprite.filename.empty()) return; + + std::string key = resource_path(sprite.filename); + auto found = cacheFiles.find(key); + std::shared_ptr file = found != cacheFiles.end() ? found->second : file_parse(sprite.filename); + if (!file) + { + log_print(LOG_INFO, "AnmCache failed to load %s\n", sprite.filename.c_str()); + return; + } + + cacheFiles[key] = file; + sprite.file = file; + sprite.animState.file = file.get(); + sprite.overlayAnimState.file = file.get(); + sprite.layerStates.assign(file->layers.size(), LayerState()); + for (size_t i = 0; i < file->layers.size(); i++) sprite.layerStates[i].Init(&file->layers[i]); +} + +// 0040ea50 Parses an .anm2 ahead of time, and loads each spritesheet the texture cache lacks. +void AnmCache::Preload(std::string_view path) +{ + if (path.empty()) return; + + std::string key = resource_path(path); + if (!cacheFiles.contains(key)) + { + auto file = file_parse(std::string(path)); + if (!file) return; + cacheFiles[key] = file; + } + + for (const LayerData& layer : cacheFiles[key]->layers) + { + if (TextureCache::Has((uint8_t*)layer.spriteSheetPath.c_str())) continue; + ImageHandle loaded; + Manager::LoadImage(&loaded, (uint8_t*)layer.spriteSheetPath.c_str()); + TextureCache::Add(loaded.image, loaded.refCount); + } +} + +// 0040e470 Drops every file no sprite holds. +void AnmCache::Clear() +{ + std::erase_if(cacheFiles, [](const auto& entry) + { + if (entry.second.use_count() > 1) return false; + log_print(LOG_INFO, "AnmCache: Clear %s.\n", entry.first.c_str()); + return true; + }); +} + +// 0040d4c0 Logs what the cached files' animations take. +void AnmCache::LogMemoryUsage() +{ + size_t bytes = 0; + + for (const auto& [path, file] : cacheFiles) + for (const AnimationData& animation : file->animations) + { + bytes += sizeof(AnimationData); + for (const AnimationLayer& layer : animation.animLayers) + bytes += sizeof(AnimationLayer) + layer.frames.size() * sizeof(AnimationFrame); + for (const AnimationNullLayer& layer : animation.nullLayers) + bytes += sizeof(AnimationNullLayer) + layer.frames.size() * sizeof(NullFrame); + } + log_print(LOG_INFO, "AnmCache memory usage: %u bytes in %u entries.\n", (unsigned)bytes, + (unsigned)cacheFiles.size()); } // 00408830 Starts over on an animation, or none, with every track before its first keyframe and no events. -void AnimationState::SetAnimationData(void* animData) +void AnimationState::SetAnimationData(const AnimationData* data) { - _animData = (AnimationData*)animData; - frame_indices_free(_layerFrames); - frame_indices_free(_nullLayerFrames); - _layerFrames = frame_indices_create(_animData ? _animData->_layerCount : 0); - _nullLayerFrames = frame_indices_create(_animData ? _animData->_nullLayerCount : 0); - - _animFrame = ANIMATION_FRAME_UNSET; - _isPlaying = false; - _currentlyTriggeredEvents = 0; - _previouslyTriggeredEvents = 0; + animData = data; + layerFrames.assign(data ? data->animLayers.size() : 0, FRAME_INDEX_UNSET); + nullLayerFrames.assign(data ? data->nullLayers.size() : 0, FRAME_INDEX_UNSET); + animFrame = ANIMATION_FRAME_UNSET; + isPlaying = false; + currentlyTriggeredEvents = 0; + previouslyTriggeredEvents = 0; } // 00408970 Switches animation, keeping the frame, play state, events and each shared track's keyframe. // The original copies the old count of indices, overflowing a smaller array, and stores new null indices in the layer // slot, so the next update crashes. Here each array keeps the indices both animations have. -void AnimationState::ChangeAnimationKeepFrame(void* animData) +void AnimationState::ChangeAnimationKeepFrame(const AnimationData* data) { - auto data = (AnimationData*)animData; - - frame_indices_resize(_layerFrames, _animData ? _animData->_layerCount : 0, data ? data->_layerCount : 0); - frame_indices_resize(_nullLayerFrames, _animData ? _animData->_nullLayerCount : 0, - data ? data->_nullLayerCount : 0); - _animData = data; + layerFrames.resize(data ? data->animLayers.size() : 0, FRAME_INDEX_UNSET); + nullLayerFrames.resize(data ? data->nullLayers.size() : 0, FRAME_INDEX_UNSET); + animData = data; } -// 00408b90 Moves a layer track forward to the keyframe holding a frame, never back. +// Moves a track's keyframe forward to the one holding a frame, never back. +template static void track_advance(const std::vector& frames, int& index, float targetFrame) +{ + while (index >= 0 && index + 1 < (int)frames.size() && !(targetFrame < (float)frames[index].endFrame)) index++; +} + +// 00408b90 Moves a layer track forward to the keyframe holding a frame. // The original logs a bad track and reads it anyway. Here it stops after the log. void AnimationState::AdvanceLayerPosition(int layerId, float targetFrame) { - if (!_animData || layerId < 0 || layerId >= _animData->_layerCount) + if (!animData || layerId < 0 || layerId >= (int)animData->animLayers.size()) { KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"id out of bounds\n"); return; } - - AnimationLayer& layer = _animData->_animLayers[layerId]; - int& index = _layerFrames[layerId]; - - while (index >= 0 && index + 1 < layer._numFrames && !(targetFrame < (float)layer._animFrames[index].endFrame)) - index++; + track_advance(animData->animLayers[layerId].frames, layerFrames[layerId], targetFrame); } -// 00408c10 Moves a null track forward to the keyframe holding a frame, never back. +// 00408c10 Moves a null track forward to the keyframe holding a frame. // The original logs a bad track and reads it anyway. Here it stops after the log. -void AnimationState::AdvanceNullLayerPosition(int nullLayerID, float targetFrame) +void AnimationState::AdvanceNullLayerPosition(int nullLayerId, float targetFrame) { - if (!_animData || nullLayerID < 0 || nullLayerID >= _animData->_nullLayerCount) + if (!animData || nullLayerId < 0 || nullLayerId >= (int)animData->nullLayers.size()) { KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"id out of bounds\n"); return; } - - AnimationNullLayer& layer = _animData->_nullLayers[nullLayerID]; - int& index = _nullLayerFrames[nullLayerID]; - - while (index >= 0 && index + 1 < layer._numFrames && !(targetFrame < (float)layer._nullFrames[index]._endFrame)) - index++; + track_advance(animData->nullLayers[nullLayerId].frames, nullLayerFrames[nullLayerId], targetFrame); } // 00408c90 Fires the event of every trigger exactly on the current frame, into both event masks. // The original logs a missing animation and crashes. Here it returns after the log. void AnimationState::FireTriggersAtCurrentFrame() { - if (!_animData) + if (!animData) { KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"AnimationData is NULL\n"); return; } - for (int i = 0; i < _animData->_eventTriggerCount; i++) + for (const AnimationData_EventTrigger& trigger : animData->eventTriggers) { - AnimationData_EventTrigger& trigger = _animData->_eventTriggers[i]; - if ((float)trigger._animationFrame != _animFrame) continue; - - int bit = 1 << (trigger._eventId & EVENT_ID_MASK); - _currentlyTriggeredEvents |= bit; - _previouslyTriggeredEvents |= bit; + if ((float)trigger.animationFrame != animFrame) continue; + uint32_t bit = 1u << (trigger.eventId & EVENT_BIT_MASK); + currentlyTriggeredEvents |= bit; + previouslyTriggeredEvents |= bit; } } @@ -201,324 +700,1055 @@ void AnimationState::FireTriggersAtCurrentFrame() // Without an animation it does nothing, where the original crashes. void AnimationState::AdvancePosition(int targetFrame) { - if (!_animData) return; + if (!animData) return; - int currentFrame = (int)std::floor(_animFrame); + int currentFrame = (int)std::floor(animFrame); if (targetFrame < currentFrame) log_print(LOG_ASSERT, "Animation::AdvancePosition cannot go backward (new: %d, cur: %d)\n", targetFrame, currentFrame); float target = (float)targetFrame; - _currentlyTriggeredEvents = 0; - while (_animFrame < target) + currentlyTriggeredEvents = 0; + while (animFrame < target) { - _animFrame = std::floor(_animFrame) + 1; + animFrame = std::floor(animFrame) + 1; FireTriggersAtCurrentFrame(); } - for (int i = 0; i < _animData->_layerCount; i++) AdvanceLayerPosition(i, target); - for (int i = 0; i < _animData->_nullLayerCount; i++) AdvanceNullLayerPosition(i, target); + for (int i = 0; i < (int)layerFrames.size(); i++) AdvanceLayerPosition(i, target); + for (int i = 0; i < (int)nullLayerFrames.size(); i++) AdvanceNullLayerPosition(i, target); } // 00408e00 Jumps to a frame clamped below the animation's length, firing only its triggers. -// The tracks restart and catch up to the unclamped frame. -// Without an animation it does nothing, where the original crashes. +// The tracks restart and catch up to the unclamped frame. Without an animation it does nothing, where the original +// crashes. void AnimationState::SetFrameFloat(float frame) { - if (!_animData) return; + if (!animData) return; - float lastFrame = std::nextafter((float)_animData->_length, 0.0f); - _currentlyTriggeredEvents = 0; - _animFrame = frame <= lastFrame ? frame : lastFrame; + float lastFrame = std::nextafter((float)animData->length, 0.0f); + currentlyTriggeredEvents = 0; + animFrame = frame <= lastFrame ? frame : lastFrame; FireTriggersAtCurrentFrame(); - for (int i = 0; i < _animData->_layerCount; i++) + for (int i = 0; i < (int)layerFrames.size(); i++) { - _layerFrames[i] = 0; + layerFrames[i] = 0; AdvanceLayerPosition(i, frame); } - for (int i = 0; i < _animData->_nullLayerCount; i++) + for (int i = 0; i < (int)nullLayerFrames.size(); i++) { - _nullLayerFrames[i] = 0; + nullLayerFrames[i] = 0; AdvanceNullLayerPosition(i, frame); } } -// 00409030 Plays on by the sprite's playback speed, looping or stopping on the last frame at the end. -void AnimationState::Update() +// The track an animation keys a layer id with, or -1. Logs a layer id outside the sprite's layers. +static int layer_track_get(const AnimationState& state, int layerId) { - if (!_animData || !_isPlaying) return; - - float nextFrame = _animFrame + _animation->_playbackSpeed; - int nextWholeFrame = (int)std::floor(nextFrame); - if (nextWholeFrame < _animData->_length) + int layerCount = state.file ? (int)state.file->layers.size() : 0; + if (layerId < 0 || layerId >= layerCount) { - AdvancePosition(nextWholeFrame); - _animFrame = nextFrame; + KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"LayerId out of bounds\n"); + return -1; + } + if (!state.animData || layerId >= ANM2_LAYER_LIMIT) return -1; + return state.animData->layerMap[layerId]; +} + +// 00408ef0 Puts a layer's track back to its keyframe holding a frame. +// The original logs a layer the animation does not key and writes before its array. Here it stops after the log. +void AnimationState::SetLayerFrame(int layerId, int frame) +{ + int layerCount = file ? (int)file->layers.size() : 0; + if (layerId < 0 || layerId >= layerCount) + { + KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"LayerId out of bounds\n"); return; } - if (_animData->_loop) + int track = layer_track_get(*this, layerId); + if (track < 0 || track >= (int)layerFrames.size()) + { + KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"id out of bounds\n"); + return; + } + layerFrames[track] = 0; + AdvanceLayerPosition(track, (float)frame); +} + +// 00408f70 The keyframe index a layer's track is on, 0 for a layer outside the sprite. +// The original reads before its array for a layer the animation does not key. Here that is -1. +int AnimationState::GetLayerFrameIdx(int layerId) const +{ + int layerCount = file ? (int)file->layers.size() : 0; + if (layerId < 0 || layerId >= layerCount) + { + KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"LayerId out of bounds\n"); + return 0; + } + + int track = layer_track_get(*this, layerId); + return track >= 0 ? layerFrames[track] : FRAME_INDEX_UNSET; +} + +// 00408fc0 Puts a null track back to its keyframe holding a frame. +// The original logs a bad track and writes it anyway. Here it stops after the log. +void AnimationState::SetNullLayerFrame(int nullLayerId, int frame) +{ + int nullCount = file ? (int)file->nullLayerNames.size() : 0; + if (nullLayerId < 0 || nullLayerId >= nullCount) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"layerId out of bounds\n"); + if (nullLayerId < 0 || nullLayerId >= (int)nullLayerFrames.size()) + { + KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"id out of bounds\n"); + return; + } + + nullLayerFrames[nullLayerId] = 0; + AdvanceNullLayerPosition(nullLayerId, (float)frame); +} + +// 00409030 Plays on by the sprite's playback speed, looping or stopping on the last frame at the end. +// A loop restarts without stepping the frames it skips, so a fast loop can miss an event near its end. +void AnimationState::Update(float playbackSpeed) +{ + if (!animData || !isPlaying) return; + + float nextFrame = animFrame + playbackSpeed; + int nextWholeFrame = (int)std::floor(nextFrame); + if (nextWholeFrame < animData->length) + { + AdvancePosition(nextWholeFrame); + animFrame = nextFrame; + return; + } + + if (animData->isLooping) { Rewind(); return; } - int lastFrame = _animData->_length - 1; - if ((int)std::floor(_animFrame) <= lastFrame) AdvancePosition(lastFrame); - _isPlaying = false; + int lastFrame = animData->length - 1; + if ((int)std::floor(animFrame) <= lastFrame) AdvancePosition(lastFrame); + isPlaying = false; } // 0040a1b0 Goes back to frame 0 with only its events fired and every track on its first keyframe. -// Without an animation it only resets the frame and events, where the original crashes. void AnimationState::Rewind() { - _animFrame = 0; - _currentlyTriggeredEvents = 0; - _previouslyTriggeredEvents = 0; + animFrame = 0; + currentlyTriggeredEvents = 0; + previouslyTriggeredEvents = 0; FireTriggersAtCurrentFrame(); - if (!_animData) return; - - std::fill_n(_layerFrames, _animData->_layerCount, 0); - std::fill_n(_nullLayerFrames, _animData->_nullLayerCount, 0); + std::fill(layerFrames.begin(), layerFrames.end(), 0); + std::fill(nullLayerFrames.begin(), nullLayerFrames.end(), 0); } -// 0040a220 The keyframe a sprite layer shows now, or null. +// 0040a030 Draws every layer track on its current keyframe, bottom first. +void AnimationState::Render(const SpriteDraw& draw, const ANM2& animation) const +{ + if (!animData) return; + + for (size_t i = 0; i < animData->animLayers.size(); i++) + animData->animLayers[i].RenderFrame(draw, layerFrames[i], animation); +} + +// 0040a080 Draws one layer on its current keyframe, if the animation keys it. +void AnimationState::RenderLayer(int layerId, const SpriteDraw& draw, const ANM2& animation) const +{ + if (!animData || layerId < 0 || layerId >= (int)animation.layerStates.size() || layerId >= ANM2_LAYER_LIMIT) return; + + int track = animData->layerMap[layerId]; + if (track >= 0) animData->animLayers[track].RenderFrame(draw, layerFrames[track], animation); +} + +// 0040a220 The keyframe a layer shows now, or null. // Like the original it lets a layer id equal to the layer count through, but never one past the layer map. -void* AnimationState::GetLayerFrame(int layerId) +const AnimationFrame* AnimationState::GetLayerFrame(int layerId) const { - if (!_animData) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"AnimationData is NULL\n"); - if (layerId < 0 || layerId >= (int)_animation->_layerCount) - KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"LayerId out of bounds\n"); - if (!_animData || layerId < 0 || layerId > (int)_animation->_layerCount || layerId >= ANM2_LAYER_LIMIT) - return nullptr; + int layerCount = file ? (int)file->layers.size() : 0; + if (!animData) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"AnimationData is NULL\n"); + if (layerId < 0 || layerId >= layerCount) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"LayerId out of bounds\n"); + if (!animData || layerId < 0 || layerId > layerCount || layerId >= ANM2_LAYER_LIMIT) return nullptr; - int track = _animData->_layerMap[layerId]; - if (track < 0 || track >= _animData->_layerCount) return nullptr; + int track = animData->layerMap[layerId]; + if (track < 0 || track >= (int)animData->animLayers.size()) return nullptr; - AnimationLayer& layer = _animData->_animLayers[track]; - int index = _layerFrames[track]; - return index >= 0 && index < layer._numFrames ? &layer._animFrames[index] : nullptr; + const std::vector& frames = animData->animLayers[track].frames; + int index = layerFrames[track]; + return index >= 0 && index < (int)frames.size() ? &frames[index] : nullptr; } -// Selects a named animation on a state, from its start or keeping the frame, and false when the sprite has none. -static bool animation_select(ANM2& sprite, AnimationState& state, uint8_t* name, uint8_t reset) +// 0040ac70 The keyframe the first track of a null shows now, or null. +// The original logs a missing animation and crashes. Here it returns null after the log. +const NullFrame* AnimationState::GetNullFrameById(int nullLayerId) const { - void* data = sprite.GetAnimationData(name); + if (!animData) + { + KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"AnimationData is NULL\n"); + return nullptr; + } + + for (size_t i = 0; i < animData->nullLayers.size(); i++) + { + const AnimationNullLayer& layer = animData->nullLayers[i]; + int index = nullLayerFrames[i]; + if (layer.nullLayerId == nullLayerId && index >= 0 && index < (int)layer.frames.size()) + return &layer.frames[index]; + } + return nullptr; +} + +// 0040ace0 The keyframe a null shows now, by name. +const NullFrame* AnimationState::GetNullFrame(std::string_view nullLayerName) const +{ + if (!animData) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"AnimationData is NULL\n"); + + int index = name_index(file ? &file->nullLayerNames : nullptr, nullLayerName); + return index < 0 ? nullptr : GetNullFrameById(index); +} + +// The mask bit an event of the file fires, or 0 for an event it lacks. +static uint32_t event_bit_get(const AnimationState& state, std::string_view eventName) +{ + if (!state.animData) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"AnimationData is NULL\n"); + + int index = name_index(state.file ? &state.file->eventNames : nullptr, eventName); + return index < 0 ? 0 : 1u << (index & EVENT_BIT_MASK); +} + +// 0040add0 Whether an event fired on the last step. +bool AnimationState::IsEventTriggered(std::string_view eventName) const +{ + return (currentlyTriggeredEvents & event_bit_get(*this, eventName)) != 0; +} + +// 0040ae70 Whether an event fired since the animation started. +bool AnimationState::WasEventTriggered(std::string_view eventName) const +{ + return (previouslyTriggeredEvents & event_bit_get(*this, eventName)) != 0; +} + +// 0040af10 The nearest frame after the current one, truncated, an event fires on, or -1. +// The original crashes without an animation. Here that is -1. +int AnimationState::NextEventTrigger(std::string_view eventName) const +{ + if (!animData) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"AnimationData is NULL\n"); + + int eventId = name_index(file ? &file->eventNames : nullptr, eventName); + int nextFrame = -1; + int nearest = -1; + if (eventId < 0 || !animData) return nextFrame; + + for (const AnimationData_EventTrigger& trigger : animData->eventTriggers) + { + int distance = trigger.animationFrame - (int)animFrame; + if (trigger.eventId != (uint32_t)eventId || distance <= 0 || (nearest >= 0 && distance >= nearest)) continue; + nearest = distance; + nextFrame = trigger.animationFrame; + } + return nextFrame; +} + +// 00452bf0 The name of the animation shown, or an empty one. +const std::string& AnimationState::GetAnimation() const +{ + return animData ? animData->name : EMPTY_NAME; +} + +// 0040bc90 The animation's position in its file, or -1. +int AnimationState::GetAnimationIndex() const +{ + return animData ? animData->index : -1; +} + +// 00440e30 The animation's length in frames, or 0. +int AnimationState::GetAnimationLength() const +{ + return animData ? animData->length : 0; +} + +// 004073b0 Whether the animation shown loops. +bool AnimationState::IsLoopingAnimation() const +{ + return animData && animData->isLooping; +} + +// Whether an animation plays, the named one if a name is given. +bool AnimationState::is_playing(std::string_view name) const +{ + return animData && isPlaying && (name.empty() || animData->name == name); +} + +// Whether an animation stopped, the named one if a name is given. With none shown, only for no name. +bool AnimationState::is_finished(std::string_view name) const +{ + if (!animData) return name.empty(); + return !isPlaying && (name.empty() || animData->name == name); +} + +// 004081d0 A layer with no layer data, no spritesheet and the default look. +LayerState::LayerState() +{ + Init(nullptr); +} + +// 00408310 Points a layer at its layer data and resets its spritesheet, transform, colour, blending and render flags. +void LayerState::Init(const LayerData* data) +{ + bool isPremultiplied = g_graphicsManager_flags & GRAPHICS_PREMULTIPLIED_ALPHA; + + layerData = data; + spriteSheetPath = data ? data->spriteSheetPath : ""; + spriteSheet = nullptr; + isSpriteSheetLoaded = false; + isUnknown31 = false; + + isFlipX = false; + isFlipY = false; + size = vector_make(1, 1); + rotation = 0; + pos = Vector{}; + color = COLOR_DEFAULT; + isVisible = true; + + blendMode[BLEND_EQUATION] = BLEND_EQUATION_ADD; + blendMode[BLEND_RGB_SOURCE] = isPremultiplied ? BLEND_FACTOR_ONE : BLEND_FACTOR_SRC_ALPHA; + blendMode[BLEND_RGB_DEST] = BLEND_FACTOR_ONE_MINUS_SRC_ALPHA; + blendMode[BLEND_ALPHA_SOURCE] = BLEND_FACTOR_ONE; + blendMode[BLEND_ALPHA_DEST] = BLEND_FACTOR_ONE_MINUS_SRC_ALPHA; + + minFilterMode = DAT_00c3799c; + magFilterMode = DAT_00c379a0; + wrapSMode = DAT_00c379a4; + wrapTMode = DAT_00c379a8; + bitflags = 0; + cropOffset = Vector{}; +} + +// A rectangle's corners: top left, top right, bottom left, bottom right. +static void quad_set(DestinationQuad& quad, float left, float top, float right, float bottom) +{ + quad._topLeft = vector_make(left, top); + quad._topRight = vector_make(right, top); + quad._bottomLeft = vector_make(left, bottom); + quad._bottomRight = vector_make(right, bottom); +} + +// Scales a quad about a pivot, as Quad::scale does. +static void quad_scale(DestinationQuad& quad, Vector pivot, Vector scale) +{ + if (scale.x == 1 && scale.y == 1) return; + + for (Vector* corner : {&quad._topLeft, &quad._topRight, &quad._bottomLeft, &quad._bottomRight}) + *corner = vector_make((corner->x - pivot.x) * scale.x + pivot.x, (corner->y - pivot.y) * scale.y + pivot.y); +} + +// Turns a quad about a pivot by radians, as Quad::rotate does. +static void quad_rotate(DestinationQuad& quad, Vector pivot, float angle) +{ + if (angle == 0) return; + + float cosine = std::cos(angle); + float sine = std::sin(angle); + for (Vector* corner : {&quad._topLeft, &quad._topRight, &quad._bottomLeft, &quad._bottomRight}) + { + float x = corner->x - pivot.x; + float y = corner->y - pivot.y; + *corner = vector_make(x * cosine - y * sine + pivot.x, y * cosine + x * sine + pivot.y); + } +} + +static void quad_columns_swap(DestinationQuad& quad) +{ + std::swap(quad._topLeft, quad._topRight); + std::swap(quad._bottomLeft, quad._bottomRight); +} + +static void quad_rows_swap(DestinationQuad& quad) +{ + std::swap(quad._topLeft, quad._bottomLeft); + std::swap(quad._topRight, quad._bottomRight); +} + +// The KAGE random the glitch jitter draws from. +// The original shares KAGE's global render RNG (00c33914), which classes.h does not declare yet. +static RNG& glitch_rng() +{ + static RNG rng = [] + { + RNG seeded; + seeded.SetSeed(GLITCH_SEED, 0); + return seeded; + }(); + return rng; +} + +// 004098a0 The spritesheet rectangle a layer keyframe shows, clamped and mirrored as the sprite and layer flip. +SourceQuad AnimationLayer::GetSourceQuad(const AnimationFrame& frame, const LayerState& layer, const SpriteDraw& draw, + const ANM2& animation) +{ + bool isFlipY = animation.isFlipY != is_reflection_pass(); + float width = frame.scale.x * layer.size.x; + float height = frame.scale.y * layer.size.y; + float spriteScaleX = animation.isFlipX ? -animation.scale.x : animation.scale.x; + float spriteScaleY = isFlipY ? -animation.scale.y : animation.scale.y; + SourceQuad quad; + + quad_set(quad, draw.topLeftClamp.x / width + frame.crop.x, draw.topLeftClamp.y / height + frame.crop.y, + (frame.crop.x + frame.width) - draw.bottomRightClamp.x / width, + (frame.crop.y + frame.height) - draw.bottomRightClamp.y / height); + quad._coordinateSpace = 1; + if ((spriteScaleX < 0) != ((layer.isFlipX ? -width : width) < 0)) quad_columns_swap(quad); + if ((spriteScaleY < 0) != ((layer.isFlipY ? -height : height) < 0)) quad_rows_swap(quad); + + if ((animation.bitflags | layer.bitflags) & ANIM_RENDER_GLITCH) + { + float shiftY = (glitch_rng().RandomFloat() - HALF) * (quad._bottomLeft.y - quad._topLeft.y); + float shiftX = (glitch_rng().RandomFloat() - HALF) * (quad._topRight.x - quad._topLeft.x); + for (Vector* corner : {&quad._topLeft, &quad._topRight, &quad._bottomLeft, &quad._bottomRight}) + *corner = vector_make(corner->x + shiftX, corner->y + shiftY); + } + + for (Vector* corner : {&quad._topLeft, &quad._topRight, &quad._bottomLeft, &quad._bottomRight}) + *corner = vector_make(layer.cropOffset.x + corner->x, layer.cropOffset.y + corner->y); + return quad; +} + +// 00409cb0 Where a layer keyframe lands on screen: scaled and turned about the layer's place, then the sprite's. +// A flipped sprite or layer mirrors its pivot and turns the other way. +DestinationQuad AnimationLayer::GetDestQuad(const AnimationFrame& frame, const LayerState& layer, + const SpriteDraw& draw, const ANM2& animation) +{ + bool isFlipY = animation.isFlipY != is_reflection_pass(); + Vector layerScale = vector_make(frame.scale.x * layer.size.x, frame.scale.y * layer.size.y); + Vector spriteScale = animation.scale; + Vector shake = is_screen_shake_applied() && g_game ? g_game->_screenShakeOffset : Vector{}; + float layerRotation = frame.rotation + layer.rotation; + float spriteRotation = animation.rotation; + float pivotX = frame.pivot.x; + float pivotY = frame.pivot.y; + float x = frame.pos.x + layer.pos.x + animation.offset.x; + float y = frame.pos.y + layer.pos.y + animation.offset.y; + DestinationQuad quad; + + if ((animation.bitflags | layer.bitflags) & ANIM_RENDER_SIZE_WITH_SPRITE) + { + spriteScale = vector_make(layer.size.x * animation.scale.x, layer.size.y * animation.scale.y); + layerScale = frame.scale; + } + if (layer.isFlipX) layerScale.x = -layerScale.x; + if (animation.isFlipX) spriteScale.x = -spriteScale.x; + if (spriteScale.x < 0) + { + spriteScale.x = -spriteScale.x; + layerRotation = -layerRotation; + spriteRotation = -spriteRotation; + x = -x; + pivotX = frame.width - frame.pivot.x; + } + if (layerScale.x < 0) + { + layerScale.x = -layerScale.x; + pivotX = frame.width - pivotX; + } + if (layer.isFlipY) layerScale.y = -layerScale.y; + if (isFlipY) spriteScale.y = -spriteScale.y; + if (spriteScale.y < 0) + { + spriteScale.y = -spriteScale.y; + pivotY = frame.height - frame.pivot.y; + layerRotation = -layerRotation; + spriteRotation = -spriteRotation; + y = -y; + } + if (layerScale.y < 0) + { + layerScale.y = -layerScale.y; + pivotY = frame.height - pivotY; + } + + float originX = shake.x + draw.position.x; + float originY = shake.y + draw.position.y; + Vector layerOrigin = vector_make(originX + x, originY + y); + Vector spriteOrigin = vector_make(originX + animation.offset.x, originY + animation.offset.y); + float left = layerOrigin.x - pivotX; + float top = layerOrigin.y - pivotY; + + quad_set(quad, draw.topLeftClamp.x / layerScale.x + left, draw.topLeftClamp.y / layerScale.y + top, + (left + frame.width) - draw.bottomRightClamp.x / layerScale.x, + (top + frame.height) - draw.bottomRightClamp.y / layerScale.y); + quad_scale(quad, layerOrigin, layerScale); + quad_scale(quad, spriteOrigin, spriteScale); + quad_rotate(quad, layerOrigin, layerRotation * RADIANS_PER_DEGREE); + quad_rotate(quad, spriteOrigin, spriteRotation * RADIANS_PER_DEGREE); + return quad; +} + +// The colour a layer keyframe draws in: the sprite's, layer's and keyframe's together, the top of KAGE's colour +// stack instead while one is pushed, or the layer's and keyframe's alone for an untinted layer. +static ColorMod layer_color_get(const AnimationFrame& frame, const LayerState& layer, const ANM2& animation, + unsigned int flags) +{ + ColorMod color = (flags & ANIM_RENDER_UNTINTED) ? layer.color : animation.color; + + if (flags & ANIM_RENDER_UNTINTED) color_multiply(color, frame.color); + else if (g_colorStackSize != 0) color = *(const ColorMod*)(uintptr_t)FUN_0040c6f0(); + else + { + color_multiply(color, layer.color); + color_multiply(color, frame.color); + } + + if (is_reflection_pass()) + { + color._tint[3] *= HALF; + if (g_game) color._tint[3] *= g_game->_room->_waterAmount; + } + return color; +} + +// A procedural item's layer turns its spritesheet rectangle a quarter about its middle, either way, and may mirror it, +// the same way every frame for a sprite. +static void procedural_item_turn(SourceQuad& source, const AnimationFrame& frame, const LayerState& layer, + const ANM2& animation) +{ + RNG rng; + void* renderTarget = nullptr; + Vector center = vector_make(frame.width * HALF + frame.crop.x, frame.height * HALF + frame.crop.y); + + rng._seed = (uint32_t)(uintptr_t)&animation; + rng._shift1 = PROCEDURAL_SHIFTS[0]; + rng._shift2 = PROCEDURAL_SHIFTS[1]; + rng._shift3 = PROCEDURAL_SHIFTS[2]; + std::memcpy(&renderTarget, g_game->_proceduralItemManager._renderTarget, sizeof(renderTarget)); + if (layer.spriteSheet.get() == renderTarget) + center = vector_make(center.x + layer.cropOffset.x, center.y + layer.cropOffset.y); + + quad_rotate(source, center, (rng.RandomInt(2) == 0 ? GLITCH_TURN : -GLITCH_TURN) * RADIANS_PER_DEGREE); + if (rng.RandomInt(2) != 0) quad_columns_swap(source); +} + +// 00409120 Draws one keyframe of a layer track with the layer's spritesheet, colour, blending and shader. +// The original reads past the sprite's layers for a track keying a missing layer. Here it draws nothing. +void AnimationLayer::RenderFrame(const SpriteDraw& draw, int frameIndex, const ANM2& animation) const +{ + if (!isVisible || frameIndex < 0 || frameIndex >= (int)frames.size()) return; + + const AnimationFrame& frame = frames[frameIndex]; + if (!frame.isVisible || layerId < 0 || layerId >= (int)animation.layerStates.size()) return; + + const LayerState& layer = animation.layerStates[layerId]; + unsigned int flags = animation.bitflags | layer.bitflags; + if (!layer.isVisible || !layer.spriteSheet || ((flags & ANIM_RENDER_LIGHT_PASS_ONLY) && !is_light_pass())) return; + + std::array savedBlendMode; + std::copy_n(g_graphicsManager_blendMode, BLEND_PART_COUNT, savedBlendMode.begin()); + std::copy(layer.blendMode.begin(), layer.blendMode.end(), g_graphicsManager_blendMode); + + ColorMod color = layer_color_get(frame, layer, animation, flags); + SourceQuad source = GetSourceQuad(frame, layer, draw, animation); + DestinationQuad dest = GetDestQuad(frame, layer, draw, animation); + if (is_procedural_item_pass()) procedural_item_turn(source, frame, layer, animation); + + bool isChampion = flags & ANIM_RENDER_COLOROFFSET_CHAMPION; + bool isShimmering = !isChampion && (flags & (ANIM_RENDER_STATIC | ANIM_RENDER_GOLDEN)); + if (isShimmering) + { + bool isGameTime = !(flags & ANIM_RENDER_IGNORE_GAME_TIME); + int frameCount = isGameTime ? g_game->_frameCount : (int)(g_manager->_framecount / 2); + color._colorize[3] = (float)(frameCount % SHIMMER_STEPS) / SHIMMER_STEPS; + } + + KColor tint; + tint._red = color._tint[0]; + tint._green = color._tint[1]; + tint._blue = color._tint[2]; + tint._alpha = color._tint[3]; + tint._unk = 0; + if (isChampion || isShimmering || !(flags & ANIM_RENDER_SHADER_KEPT)) + apply_sprite_shader_params(&color, 1, layer.spriteSheet.get(), nullptr); + if (isChampion) + ((Shader*)g_currentShader)->set_uniform((uint8_t*)CHAMPION_COLOR_UNIFORM.data(), UNIFORM_COLOR_MOD, + (void*)&animation.championColor, 0); + layer.spriteSheet->FUN_00a128f0((uint32_t)(uintptr_t)&source, &dest, (float*)&tint); + + std::copy(savedBlendMode.begin(), savedBlendMode.end(), g_graphicsManager_blendMode); + shader_cache_find(0); +} + +// 00407690 Copies a sprite, sharing its file and spritesheets. The copy starts with no offset and no render flags. +ANM2::ANM2(const ANM2& other) +{ + *this = other; +} + +// 00407e90 Assigns a copy, made as the copy constructor makes one. +ANM2& ANM2::operator=(const ANM2& other) +{ + ANM2Base::operator=(other); + offset = Vector{}; + bitflags = 0; + return *this; +} + +// 00407f10 Unloads the sprite and puts every setting back to its default. +void ANM2::Reset() +{ + ANM2Base::operator=(ANM2Base()); +} + +// 0040bd50 Loads an .anm2 through the cache, then finds the shadow layer and flags the lit layers and nulls. +// Like the original it counts as loaded even when the file failed to load. +void ANM2::Load(std::string_view path, GraphicsLoad graphics) +{ + filename = path; + AnmCache::Load(*this); + if (graphics == GRAPHICS_LOAD) LoadGraphics(); + + animState.SetAnimationData(nullptr); + overlayAnimState.SetAnimationData(nullptr); + isLoaded = true; + shadowLayerIndex = NO_SHADOW_LAYER; + for (int i = 0; i < (int)layerStates.size(); i++) + { + LayerState& layer = layerStates[i]; + std::string_view name = layer.layerData ? std::string_view(layer.layerData->name) : std::string_view(); + + if (name == SHADOW_LAYER_NAME) shadowLayerIndex = i; + else if (name.starts_with(LIGHT_LAYER_PREFIX)) + { + layer.bitflags |= ANIM_RENDER_UNTINTED | ANIM_RENDER_LIGHT_PASS_ONLY; + bitflags |= ANIM_RENDER_ENABLE_LAYER_LIGHTING; + } + } + + if (!file) return; + for (const std::string& name : file->nullLayerNames) + if (name.starts_with(LIGHT_LAYER_PREFIX)) bitflags |= ANIM_RENDER_ENABLE_NULL_LAYER_LIGHTING; +} + +// 0040bea0 Loads the file again with fresh layer states, then their spritesheets. +void ANM2::Reload() +{ + if (filename.empty()) return; + + AnmCache::Load(*this); + LoadGraphics(); +} + +// 0040c000, 0040bff0 Loads the spritesheet of every layer that lacks it, sharing images through the texture cache. +void ANM2::LoadGraphics() +{ + for (LayerState& layer : layerStates) + { + if (layer.isSpriteSheetLoaded) continue; + + ImageHandle loaded; + Manager::LoadImage(&loaded, (uint8_t*)layer.spriteSheetPath.c_str()); + bool isValid = loaded.image && loaded.image->FUN_00a123b0() != 0; + if (isValid) TextureCache::Add(loaded.image, loaded.refCount); + + layer.spriteSheet = image_share(loaded, layer.spriteSheetPath, isValid); + layer.isSpriteSheetLoaded = isValid; + layer.isUnknown31 = false; + } +} + +// 0040bf30 Points a layer at another spritesheet for the next LoadGraphics, false when the layer or path stays. +bool ANM2::ReplaceSpritesheet(int layerId, std::string_view path) +{ + if (layerId < 0 || layerId >= (int)layerStates.size() || layerStates[layerId].spriteSheetPath == path) return false; + + layerStates[layerId].spriteSheetPath = path; + layerStates[layerId].isSpriteSheetLoaded = false; + return true; +} + +// 004a5d10 Dresses a sprite as Delirium's form of an entity: each boss or monster spritesheet that has a Delirium +// version swaps for it, then the default animation stops on its first frame. +// Where the original asks the file system for the swapped sheet, this looks under resources/. +void ANM2::LoadDeliriumForm(ANM2& sprite, int type, int variant, bool isReloadAnm2) +{ + EntityConfig_Entity* entity = isReloadAnm2 ? g_manager->_entityConfig.GetEntity(type, variant, 0) : nullptr; + if (entity) sprite.Load(std_string_view(entity->anm2Path), GRAPHICS_DEFER); + + for (int i = 0; i < (int)sprite.layerStates.size() && type != DELIRIUM_TYPE; i++) + { + std::string path = sprite.layerStates[i].spriteSheetPath; + if (path.size() < GFX_FOLDER.size()) continue; + + std::string_view folder = std::string_view(path).substr(GFX_FOLDER.size()); + size_t replaced = is_prefix_case_insensitive(folder, BOSSES_FOLDER) ? BOSSES_FOLDER.size() + : is_prefix_case_insensitive(folder, MONSTERS_FOLDER) ? MONSTERS_FOLDER.size() + : 0; + if (!replaced) continue; + + path.replace(GFX_FOLDER.size(), replaced, DELIRIUM_FORMS_FOLDER); + if (std::filesystem::exists(resource_path(path))) sprite.ReplaceSpritesheet(i, path); + } + + sprite.LoadGraphics(); + sprite.SetFrame(sprite.GetDefaultAnimationName(), 0); +} + +// 00409100 Plays both animations on by the playback speed. +void ANM2::Update() +{ + if (!isLoaded) return; + + animState.Update(playbackSpeed); + overlayAnimState.Update(playbackSpeed); +} + +// 0040a0d0 Draws the main animation and the overlay, the overlay first when it renders first. +void ANM2::Render(const SpriteDraw& draw) const +{ + if (!isLoaded) return; + + const AnimationState& first = isOverlayRenderFirst ? overlayAnimState : animState; + const AnimationState& second = isOverlayRenderFirst ? animState : overlayAnimState; + first.Render(draw, *this); + second.Render(draw, *this); +} + +// 0040a140 Draws one layer of both animations, in the order Render draws them. +void ANM2::RenderLayer(int layerId, const SpriteDraw& draw) const +{ + if (!isLoaded) return; + + const AnimationState& first = isOverlayRenderFirst ? overlayAnimState : animState; + const AnimationState& second = isOverlayRenderFirst ? animState : overlayAnimState; + first.RenderLayer(layerId, draw, *this); + second.RenderLayer(layerId, draw, *this); +} + +// Selects a named animation on a state, from its start or keeping the frame, false when the sprite has none. +static bool state_select(const ANM2& sprite, AnimationState& state, std::string_view name, AnimationSwitch mode) +{ + const AnimationData* data = sprite.GetAnimationData(name); if (!data) { - log_print(LOG_INFO, "[warn] no animation named %s\n", (char*)name); + log_print(LOG_INFO, "[warn] no animation named %.*s\n", (int)name.size(), name.data()); return false; } - if (reset) state.SetAnimationData(data); + if (mode == SWITCH_RESET) state.SetAnimationData(data); else state.ChangeAnimationKeepFrame(data); return true; } -// Whether playing a name leaves a state as it is: the animation it shows, unforced, either not looping or playing. -static bool is_animation_kept(AnimationState& state, uint8_t* name, uint8_t isForced) +// Plays an animation from its start. Unforced, the one shown stays as it is unless it loops and has stopped. +static void state_play(const ANM2& sprite, AnimationState& state, std::string_view name, PlayMode mode) { - AnimationData* data = state._animData; - bool isShown = data && strcmp(string_text(data->_name), (char*)name) == 0; - return !isForced && isShown && (!data->_loop || state._isPlaying); -} - -static void animation_play(ANM2& sprite, AnimationState& state, uint8_t* name, uint8_t isForced) -{ - if (is_animation_kept(state, name, isForced) || !animation_select(sprite, state, name, true)) return; + const AnimationData* data = state.animData; + bool isShown = data && data->name == name; + if (mode == PLAY_UNFORCED && isShown && (!data->isLooping || state.isPlaying)) return; + if (!state_select(sprite, state, name, SWITCH_RESET)) return; state.Rewind(); - state._isPlaying = true; + state.isPlaying = true; } -// 004074c0 Builds a sprite with nothing loaded. -void ANM2::constructor() +// 0040a380, 0040a360 Plays an animation from its start, as state_play decides. +void ANM2::Play(std::string_view name, PlayMode mode) { - string_reset(_filename); - string_reset(_animDefaultName); - for (AnimationState* state : {&_animState, &_overlayAnimState}) + state_play(*this, animState, name, mode); +} + +// 0040a2b0 Plays the animation a seed picks, unforced. +void ANM2::PlayRandom(uint32_t seed) +{ + if (!file || file->animations.empty()) { - state->_animation = this; - state->_layerFrames = nullptr; - state->_nullLayerFrames = nullptr; + KAGE_LogMessage(LOG_INFO, (uint8_t*)"[warn] PlayRandom: no animations\n"); + return; } - _layerState = nullptr; - Reset(); + Play(file->animations[seed % (uint32_t)file->animations.size()].name); } -// 00407f10 Unloads the sprite, dropping its cache reference, and puts every setting back to its default. -void ANM2::Reset() +// 0040a400 Plays the animation at a position in the file, unforced. +void ANM2::PlayIndex(int index) { - if (_filename._size != 0) AnmCache::RemoveRef(&_filename); - string_clear(_filename); - _animState.SetAnimationData(nullptr); - _overlayAnimState.SetAnimationData(nullptr); - string_clear(_animDefaultName); - - _animData = nullptr; - _animCount = 0; - delete[] _layerState; - _layerState = nullptr; - _layerCount = 0; - _nullLayerNames = nullptr; - _numNullLayers = 0; - _eventNames = nullptr; - _numEvents = 0; - - _offset = g_vectorZero; - _scale = g_vectorOne; - _rotation = 0; - _color = COLOR_DEFAULT; - _championColor = CHAMPION_COLOR_DEFAULT; - _flipX = false; - _flipY = false; - _playbackSpeed = PLAYBACK_SPEED_DEFAULT; - _isUnknown108 = false; - _loaded = false; - _overlayRenderFirst = false; - _shadowLayerIndex = NO_SHADOW_LAYER; - _bitflags = 0; + if (!file || index < 0 || index >= (int)file->animations.size()) + { + KAGE_LogMessage(LOG_INFO, (uint8_t*)"[warn] Animation index out of range!\n"); + return; + } + Play(file->animations[index].name); } -// 0040a380 Plays an animation from its start, unless it is the one shown and either not looping or still playing. -void ANM2::Play(uint8_t* anim, uint8_t isForced) +// 0040a5d0, 0040a5b0 Selects an animation on the main state, false when there is none of that name. +bool ANM2::SetAnimation(std::string_view name, AnimationSwitch mode) { - animation_play(*this, _animState, anim, isForced); + return state_select(*this, animState, name, mode); } -// 0040a5d0 Selects an animation on the main state, false when there is none of that name. -uint8_t ANM2::SetAnimation(uint8_t* anim, uint8_t reset) +// 0040a690, 0040a6e0 Shows a frame of an animation, stopped. +void ANM2::SetFrame(std::string_view name, int frame) { - return animation_select(*this, _animState, anim, reset); + if (!SetAnimation(name) || !animState.animData) return; + + animState.SetFrameFloat((float)frame); + animState.isPlaying = false; } -// 0040a940 Plays an overlay animation from its start, unless it is the one shown and either not looping or playing. -void ANM2::PlayOverlay(uint8_t* animName, uint8_t isForce) +// 0040a740, 0040a720 Jumps the main animation to a frame, still playing if it was. +void ANM2::SetFrame(float frame) { - animation_play(*this, _overlayAnimState, animName, isForce); + if (animState.animData) animState.SetFrameFloat(frame); } -// 0040aaf0 Selects an animation on the overlay state, false when there is none of that name. -uint8_t ANM2::SetOverlayAnimation(uint8_t* anim, uint8_t reset) +// 0040a760 Steps to the last frame, firing the events on the way, still playing if it was. +void ANM2::SetLastFrame() { - return animation_select(*this, _overlayAnimState, anim, reset); + if (animState.animData) animState.AdvancePosition(animState.animData->length - 1); } -// 0040bcd0 The animation with a name, or null. -void* ANM2::GetAnimationData(uint8_t* name) +// 0040a780 The whole frame the main animation is on, or -1. +int ANM2::GetFrame() const { - for (int i = 0; i < _animCount; i++) - if (strcmp(string_text(_animData[i]._name), (char*)name) == 0) return &_animData[i]; + return animState.animData ? (int)std::floor(animState.animFrame) : -1; +} + +// 0040a910 Stops the main animation where it is. +void ANM2::Stop() +{ + if (animState.animData) animState.isPlaying = false; +} + +// 0040a4d0, 0040a4b0 Whether the main animation plays, the named one if a name is given. +bool ANM2::IsPlaying(std::string_view name) const +{ + return animState.is_playing(name); +} + +// 0040a550, 0040a530 Whether the main animation stopped, the named one if a name is given. +bool ANM2::IsFinished(std::string_view name) const +{ + return animState.is_finished(name); +} + +// 0085db20 The main animation's name, or an empty one. +const std::string& ANM2::GetAnimation() const +{ + return animState.GetAnimation(); +} + +// 004a5cf0 The file's default animation, or an empty name. +const std::string& ANM2::GetDefaultAnimationName() const +{ + return file ? file->defaultAnimation : EMPTY_NAME; +} + +// 0040bcd0, 0040bcb0 The animation with a name, or null. +const AnimationData* ANM2::GetAnimationData(std::string_view name) const +{ + if (!file) return nullptr; + + for (const AnimationData& animation : file->animations) + if (animation.name == name) return &animation; return nullptr; } -// 0040bd50 Loads an .anm2 through the cache, then finds the shadow layer and flags the lit layers and nulls. -void ANM2::Load(std_string* ANM2Path, uint8_t isLoadingGraphics) +// 0040a940, 0040a920 Plays an overlay animation from its start, as state_play decides. +void ANM2::PlayOverlay(std::string_view name, PlayMode mode) { - if (_filename._size != 0) AnmCache::RemoveRef(&_filename); - if (ANM2Path != &_filename) string_copy(_filename, *ANM2Path); - AnmCache::Load(ANM2Path, (std_string*)this); - AnmCache::AddRef(ANM2Path); - if (isLoadingGraphics) LoadGraphics(0); + state_play(*this, overlayAnimState, name, mode); +} - _animState.SetAnimationData(nullptr); - _overlayAnimState.SetAnimationData(nullptr); - _loaded = true; - _shadowLayerIndex = NO_SHADOW_LAYER; - for (unsigned int i = 0; i < _layerCount; i++) +// 0040aaf0, 0040aad0 Selects an animation on the overlay state, false when there is none of that name. +bool ANM2::SetOverlayAnimation(std::string_view name, AnimationSwitch mode) +{ + return state_select(*this, overlayAnimState, name, mode); +} + +// 0040abf0, 0040abb0 Shows a frame of an overlay animation, still playing if it was. +void ANM2::SetOverlayFrame(std::string_view name, int frame) +{ + if (SetOverlayAnimation(name) && overlayAnimState.animData) overlayAnimState.SetFrameFloat((float)frame); +} + +// 0040ac30 Jumps the overlay to a frame. +void ANM2::SetOverlayFrame(int frame) +{ + if (overlayAnimState.animData) overlayAnimState.SetFrameFloat((float)frame); +} + +// 0040ac50 The frame the overlay is on, truncated, or -1. +int ANM2::GetOverlayFrame() const +{ + return overlayAnimState.animData ? (int)overlayAnimState.animFrame : -1; +} + +// 0040a9c0 Stops the overlay where it is. +void ANM2::StopOverlay() +{ + if (overlayAnimState.animData) overlayAnimState.isPlaying = false; +} + +// 0040ac60 Takes the overlay off. +void ANM2::RemoveOverlay() +{ + overlayAnimState.SetAnimationData(nullptr); +} + +// 0040a9f0, 0040a9d0 Whether the overlay plays, the named one if a name is given. +bool ANM2::IsOverlayPlaying(std::string_view name) const +{ + return overlayAnimState.is_playing(name); +} + +// 0040aa70, 0040aa50 Whether the overlay stopped, the named one if a name is given. +bool ANM2::IsOverlayFinished(std::string_view name) const +{ + return overlayAnimState.is_finished(name); +} + +// 0085db70 The overlay's name, or an empty one. +const std::string& ANM2::GetOverlayAnimation() const +{ + return overlayAnimState.GetAnimation(); +} + +// 0040b030, 0040b000 Whether an event fired on the main animation's last step. +bool ANM2::IsEventTriggered(std::string_view eventName) const +{ + return animState.animData && animState.IsEventTriggered(eventName); +} + +// 0040b090, 0040b060 Whether an event fired since the main animation started. +bool ANM2::WasEventTriggered(std::string_view eventName) const +{ + return animState.animData && animState.WasEventTriggered(eventName); +} + +// 0040b220, 0040b200 A layer by id, or a shared default layer for an id outside the sprite. +LayerState* ANM2::GetLayer(int layerId) +{ + static LayerState layerNone; + + if (layerId >= 0 && layerId < (int)layerStates.size()) return &layerStates[layerId]; + log_print(LOG_ASSERT, "%s: No layer with Id %d\n", filename.c_str(), layerId); + return &layerNone; +} + +// 0040b430, 0040b310 A layer by name, or null. +LayerState* ANM2::GetLayer(std::string_view name) +{ + for (LayerState& layer : layerStates) + if ((layer.layerData ? std::string_view(layer.layerData->name) : std::string_view()) == name) return &layer; + return nullptr; +} + +// 0040a7e0 Puts a layer's track back to its keyframe holding a frame. +void ANM2::SetLayerFrame(int layerId, int frame) +{ + if (animState.animData) animState.SetLayerFrame(layerId, frame); +} + +// 0040a860 Puts a named layer's track back to its keyframe holding a frame. +void ANM2::SetLayerFrame(std::string_view layerName, int frame) +{ + LayerState* layer = GetLayer(layerName); + if (!layer || !layer->layerData) { - LayerData* data = _layerState[i]._layerData; - const char* name = data ? string_text(data->_name) : ""; + log_print(LOG_WARN, "[warn] no layer named %.*s\n", (int)layerName.size(), layerName.data()); + return; + } + SetLayerFrame(layer->layerData->id, frame); +} - if (strcmp(name, SHADOW_LAYER_NAME) == 0) _shadowLayerIndex = i; - else if (name[0] == LIGHT_LAYER_PREFIX) +// 0040a8a0 The keyframe index a layer's track is on, or -1 without an animation. +int ANM2::GetLayerFrameIdx(int layerId) const +{ + return animState.animData ? animState.GetLayerFrameIdx(layerId) : -1; +} + +// 0040b1d0 The keyframe a null shows now on the main animation, by name. +const NullFrame* ANM2::GetNullFrame(std::string_view nullLayerName) const +{ + return animState.animData ? animState.GetNullFrame(nullLayerName) : nullptr; +} + +// 0040b0c0 A null's baked keyframe at an index in any animation, the last null of that name, or null. +const NullFrame* ANM2::GetNullFrame(std::string_view animName, std::string_view nullLayerName, int frame) const +{ + const AnimationData* animation = GetAnimationData(animName); + if (!animation || file->nullLayerNames.empty()) return nullptr; + + auto found = std::find(file->nullLayerNames.rbegin(), file->nullLayerNames.rend(), nullLayerName); + if (found == file->nullLayerNames.rend()) return nullptr; + + int nullLayerId = (int)(file->nullLayerNames.rend() - found) - 1; + for (const AnimationNullLayer& layer : animation->nullLayers) + if (layer.nullLayerId == nullLayerId && frame >= 0 && frame < (int)layer.frames.size()) + return &layer.frames[frame]; + log_print(LOG_INFO, "[warn] ANM2::GetNullFrame frame number %d out of bounds.\n", frame); + return nullptr; +} + +// 0040b1a0 The keyframe a null shows now on the main animation, by id. +const NullFrame* ANM2::GetNullFrameById(int nullLayerId) const +{ + return animState.animData ? animState.GetNullFrameById(nullLayerId) : nullptr; +} + +// 0040b4d0 A null's name by id. +// The original logs an id outside the file and reads past its names. Here that is an empty name. +const std::string& ANM2::GetNullLayerName(int nullLayerId) const +{ + if (file && nullLayerId >= 0 && nullLayerId < (int)file->nullLayerNames.size()) + return file->nullLayerNames[nullLayerId]; + + log_print(LOG_ASSERT, "%s: No null with Id %d\n", filename.c_str(), nullLayerId); + return EMPTY_NAME; +} + +// 0040b520 A null's id by name, or -1. +int ANM2::null_index_get(std::string_view name) const +{ + return name_index(file ? &file->nullLayerNames : nullptr, name); +} + +// 0078b3b0 Puts another loaded sprite on this one's animations and frames, playing as they play. +void ANM2::animation_copy(ANM2& dest) const +{ + if (!isLoaded || !dest.isLoaded) return; + + if (!animState.animData || !animState.isPlaying) dest.SetFrame(GetAnimation(), GetFrame()); + else + { + if (dest.SetAnimation(GetAnimation())) { - _layerState[i]._bitflags |= ANIM_RENDER_UNTINTED | ANIM_RENDER_LIGHT_PASS_ONLY; - _bitflags |= ANIM_RENDER_ENABLE_LAYER_LIGHTING; + dest.animState.Rewind(); + dest.animState.isPlaying = true; } + dest.SetFrame((float)GetFrame()); } - for (unsigned int i = 0; i < _numNullLayers; i++) - if (string_text(_nullLayerNames[i])[0] == LIGHT_LAYER_PREFIX) - _bitflags |= ANIM_RENDER_ENABLE_NULL_LAYER_LIGHTING; -} -// 004081d0 Builds a layer with no layer data and no spritesheet. -LayerState::LayerState() -{ - string_reset(_spriteSheetPath); - _spriteSheet = nullptr; - _spriteSheetRefCount = nullptr; - Init(nullptr); -} - -// 00408310 Points a layer at its layer data and resets its spritesheet, transform, color, blending and render flags. -void LayerState::Init(void* layerData) -{ - _layerData = (LayerData*)layerData; - if (_layerData) string_copy(_spriteSheetPath, _layerData->_spriteSheetPath); - else string_clear(_spriteSheetPath); - ((KAGE::SmartPointer*)&_spriteSheet)->reset(nullptr); - _spriteSheetLoaded = false; - _isUnknown31 = false; - - _flipX = false; - _flipY = false; - _size = g_vectorOne; - _rotation = 0; - _pos = g_vectorZero; - _color = COLOR_DEFAULT; - _visible = true; - - bool isPremultiplied = g_graphicsManager_flags & GRAPHICS_PREMULTIPLIED_ALPHA; - _blendMode[BLEND_EQUATION] = BLEND_EQUATION_ADD; - _blendMode[BLEND_RGB_SOURCE] = isPremultiplied ? BLEND_FACTOR_ONE : BLEND_FACTOR_SRC_ALPHA; - _blendMode[BLEND_RGB_DEST] = BLEND_FACTOR_ONE_MINUS_SRC_ALPHA; - _blendMode[BLEND_ALPHA_SOURCE] = BLEND_FACTOR_ONE; - _blendMode[BLEND_ALPHA_DEST] = BLEND_FACTOR_ONE_MINUS_SRC_ALPHA; - - _minFilterMode = DAT_00c3799c; - _magFilterMode = DAT_00c379a0; - _wrapSMode = DAT_00c379a4; - _wrapTMode = DAT_00c379a8; - _bitflags = 0; - _cropOffset = g_vectorZero; -} - -// 0040d850 Frees a cache entry's layers, animations with their tracks, frames and triggers, and null and event names. -// The entry's flag at +0 and its default animation name stay. -void AnmFileData::Clear() -{ - for (uint32_t i = 0; i < _layerCount; i++) + if (!overlayAnimState.animData) { - string_free(_layers[i]._name); - string_free(_layers[i]._spriteSheetPath); + if (dest.overlayAnimState.animData) dest.RemoveOverlay(); } - delete[] _layers; - _layers = nullptr; - _layerCount = 0; - - for (uint32_t i = 0; i < _animationCount; i++) + else if (!overlayAnimState.isPlaying) dest.SetOverlayFrame(GetOverlayAnimation(), GetOverlayFrame()); + else { - AnimationData& animation = _animations[i]; - - for (int j = 0; j < animation._layerCount; j++) - tracked_alloc(TRACKED_FREE, animation._animLayers[j]._animFrames, 0); - for (int j = 0; j < animation._nullLayerCount; j++) - tracked_alloc(TRACKED_FREE, animation._nullLayers[j]._nullFrames, 0); - delete[] animation._animLayers; - delete[] animation._nullLayers; - tracked_alloc(TRACKED_FREE, animation._eventTriggers, 0); - string_free(animation._name); + if (dest.SetOverlayAnimation(GetOverlayAnimation())) + { + dest.overlayAnimState.Rewind(); + dest.overlayAnimState.isPlaying = true; + } + dest.SetOverlayFrame(GetOverlayFrame()); } - delete[] _animations; - _animations = nullptr; - _animationCount = 0; - - string_array_free(_nullLayerNames, _nullLayerCount); - _nullLayerNames = nullptr; - _nullLayerCount = 0; - string_array_free(_eventNames, _eventCount); - _eventNames = nullptr; - _eventCount = 0; +} + +// 00837210 Plays on, then plays Idle once Appear has finished. +void ANM2::appear_update() +{ + Update(); + + if (animState.animData && !animState.isPlaying && animState.animData->name == APPEAR_ANIMATION) + Play(IDLE_ANIMATION); } diff --git a/src/anm2.h b/src/anm2.h index 843ddd1..d425bec 100644 --- a/src/anm2.h +++ b/src/anm2.h @@ -1,54 +1,369 @@ #pragma once -// The most layers, nulls and layer tracks an .anm2 can hold, and the size of AnimationData::_layerMap. -constexpr int ANM2_LAYER_LIMIT = 64; +#include "classes.h" +#include +#include +#include +#include +#include -// ANM2::_bitflags and LayerState::_bitflags, ORed together when a layer renders. -// REPENTOGON's AnimRenderFlags, plus the two bits a layer named with a leading '*' gets. +// The most layers and nulls an .anm2 holds, and the size of AnimationData::layerMap. +constexpr int ANM2_LAYER_LIMIT = 64; +constexpr int ANM2_EVENT_LIMIT = 16; +constexpr int ANM2_TRIGGER_LIMIT = 128; +constexpr int ANM2_FRAME_LIMIT = 5000; +constexpr float ANIMATION_FRAME_UNSET = -1; +constexpr int NO_SHADOW_LAYER = -1; +constexpr ColorMod COLOR_DEFAULT = {{1, 1, 1, 1}, {0, 0, 0, 0}, {0, 0, 0}}; +constexpr ColorMod CHAMPION_COLOR_DEFAULT = {{1, 1, 1, 0}, {0, 0, 0, 0}, {0, 0, 0}}; + +// ANM2::bitflags and LayerState::bitflags, ORed together when a layer renders. +// REPENTOGON's AnimRenderFlags, with names for the bits it leaves out. enum AnimRenderFlag : unsigned int { ANIM_RENDER_UNTINTED = 1 << 0, ANIM_RENDER_GLITCH = 1 << 1, ANIM_RENDER_LIGHT_PASS_ONLY = 1 << 2, + ANIM_RENDER_SIZE_WITH_SPRITE = 1 << 3, ANIM_RENDER_COLOROFFSET_CHAMPION = 1 << 4, ANIM_RENDER_STATIC = 1 << 5, ANIM_RENDER_IGNORE_GAME_TIME = 1 << 6, ANIM_RENDER_GOLDEN = 1 << 7, + ANIM_RENDER_SHADER_KEPT = 1 << 9, ANIM_RENDER_ENABLE_LAYER_LIGHTING = 1 << 10, ANIM_RENDER_ENABLE_NULL_LAYER_LIGHTING = 1 << 11 }; -// The five ints of LayerState::_blendMode, in REPENTOGON's BlendMode order. +// The parts of LayerState::blendMode, in REPENTOGON's BlendMode order. enum BlendModePart : int { BLEND_EQUATION, BLEND_RGB_SOURCE, BLEND_RGB_DEST, BLEND_ALPHA_SOURCE, - BLEND_ALPHA_DEST + BLEND_ALPHA_DEST, + BLEND_PART_COUNT }; // REPENTOGON's BlendEquation. enum BlendEquation : int { - BLEND_EQUATION_ADD = 0, - BLEND_EQUATION_SUBTRACT = 1, - BLEND_EQUATION_REVERSE_SUBTRACT = 2, - BLEND_EQUATION_MIN = 3, - BLEND_EQUATION_MAX = 4 + BLEND_EQUATION_ADD, + BLEND_EQUATION_SUBTRACT, + BLEND_EQUATION_REVERSE_SUBTRACT, + BLEND_EQUATION_MIN, + BLEND_EQUATION_MAX }; // REPENTOGON's BlendFactor, the ones the game supports. enum BlendFactor : int { - BLEND_FACTOR_ZERO = 0, - BLEND_FACTOR_ONE = 1, - BLEND_FACTOR_SRC_COLOR = 2, - BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, - BLEND_FACTOR_DST_COLOR = 4, - BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, - BLEND_FACTOR_SRC_ALPHA = 6, - BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, - BLEND_FACTOR_DST_ALPHA = 8, - BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9 + BLEND_FACTOR_ZERO, + BLEND_FACTOR_ONE, + BLEND_FACTOR_SRC_COLOR, + BLEND_FACTOR_ONE_MINUS_SRC_COLOR, + BLEND_FACTOR_DST_COLOR, + BLEND_FACTOR_ONE_MINUS_DST_COLOR, + BLEND_FACTOR_SRC_ALPHA, + BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + BLEND_FACTOR_DST_ALPHA, + BLEND_FACTOR_ONE_MINUS_DST_ALPHA +}; + +// Whether Play restarts the animation already shown. +enum PlayMode +{ + PLAY_UNFORCED, + PLAY_FORCED +}; + +// What SetAnimation keeps of the animation it replaces. +enum AnimationSwitch +{ + SWITCH_RESET, + SWITCH_KEEP_FRAME +}; + +// Whether Load loads the spritesheets right away or leaves them to LoadGraphics. +enum GraphicsLoad +{ + GRAPHICS_DEFER, + GRAPHICS_LOAD +}; + +// Vector declares a constructor it does not define yet, so values are built member by member. +inline Vector vector_make(float x, float y) +{ + Vector vector; + vector.x = x; + vector.y = y; + return vector; +} + +// A null or root keyframe after loading: interpolation baked into one-tick frames and the root multiplied in. +// startFrame and endFrame bound the ticks it shows on, end excluded. +struct NullFrame +{ + ColorMod color = COLOR_DEFAULT; + Vector pos{}; + Vector scale = vector_make(1, 1); + float rotation = 0; + int duration = 1; + int endFrame = 0; + int startFrame = 0; + bool isInterpolated = false; + bool isVisible = true; +}; + +// A layer keyframe: a null keyframe with the spritesheet rectangle it shows and the pivot it turns about. +struct AnimationFrame : NullFrame +{ + Vector crop{}; + Vector pivot{}; + float height = 0; + float width = 0; +}; + +// Where a sprite draws, and how many pixels each layer loses from its top left and bottom right. +struct SpriteDraw +{ + Vector position{}; + Vector topLeftClamp{}; + Vector bottomRightClamp{}; +}; + +struct ANM2; +struct LayerState; + +// 0040c1e0 One layer's track in an animation, its keyframes in time order. +struct AnimationLayer +{ + std::vector frames; + int layerId = -1; + bool isVisible = true; + + void RenderFrame(const SpriteDraw& draw, int frameIndex, const ANM2& animation) const; + static SourceQuad GetSourceQuad(const AnimationFrame& frame, const LayerState& layer, const SpriteDraw& draw, + const ANM2& animation); + static DestinationQuad GetDestQuad(const AnimationFrame& frame, const LayerState& layer, const SpriteDraw& draw, + const ANM2& animation); +}; + +// One null's track in an animation. +struct AnimationNullLayer +{ + std::vector frames; + int nullLayerId = 0; + bool isVisible = true; +}; + +// An event an animation fires on one of its frames. +struct AnimationData_EventTrigger +{ + int animationFrame = 0; + uint32_t eventId = 0; +}; + +// An animation as the game plays it. layerMap gives each layer id its track in animLayers, or -1. +struct AnimationData +{ + std::array layerMap; + std::string name; + std::vector animLayers; + std::vector nullLayers; + std::vector eventTriggers; + int index = 0; + int length = 1; + bool isLooping = true; + + AnimationData() { layerMap.fill(-1); } +}; + +// A layer of an .anm2 file, with its spritesheet's path relative to resources/. +struct LayerData +{ + std::string name; + std::string spriteSheetPath; + int id = 0; + int spriteSheetId = 0; +}; + +// A parsed .anm2, shared by every sprite that loads it. +struct AnmFileData +{ + std::string defaultAnimation; + std::vector animations; + std::vector layers; + std::vector eventNames; + std::vector nullLayerNames; +}; + +// 004086e0, 004087a0 Copies and destruction are the defaults. +// Plays one animation of a sprite's file: the frame, each track's keyframe and the events fired. +// currentlyTriggeredEvents holds the events of the last step, previouslyTriggeredEvents every event since the start. +struct AnimationState +{ + const AnimationData* animData = nullptr; + const AnmFileData* file = nullptr; + std::vector layerFrames; + std::vector nullLayerFrames; + float animFrame = ANIMATION_FRAME_UNSET; + uint32_t currentlyTriggeredEvents = 0; + uint32_t previouslyTriggeredEvents = 0; + bool isPlaying = false; + + void SetAnimationData(const AnimationData* data); + void ChangeAnimationKeepFrame(const AnimationData* data); + void AdvanceLayerPosition(int layerId, float targetFrame); + void AdvanceNullLayerPosition(int nullLayerId, float targetFrame); + void FireTriggersAtCurrentFrame(); + void AdvancePosition(int targetFrame); + void SetFrameFloat(float frame); + void SetLayerFrame(int layerId, int frame); + int GetLayerFrameIdx(int layerId) const; + void SetNullLayerFrame(int nullLayerId, int frame); + void Update(float playbackSpeed); + void Rewind(); + void Render(const SpriteDraw& draw, const ANM2& animation) const; + void RenderLayer(int layerId, const SpriteDraw& draw, const ANM2& animation) const; + + const AnimationFrame* GetLayerFrame(int layerId) const; + const NullFrame* GetNullFrameById(int nullLayerId) const; + const NullFrame* GetNullFrame(std::string_view nullLayerName) const; + bool IsEventTriggered(std::string_view eventName) const; + bool WasEventTriggered(std::string_view eventName) const; + int NextEventTrigger(std::string_view eventName) const; + + const std::string& GetAnimation() const; + int GetAnimationIndex() const; + int GetAnimationLength() const; + bool IsLoopingAnimation() const; + bool is_playing(std::string_view name) const; + bool is_finished(std::string_view name) const; +}; + +// 00407a60 Destruction is the default. +// How a sprite shows one layer: its spritesheet, transform, colour, blending and filtering. +struct LayerState +{ + ColorMod color = COLOR_DEFAULT; + Vector cropOffset{}; + Vector pos{}; + Vector size = vector_make(1, 1); + std::array blendMode{}; + std::shared_ptr spriteSheet; + std::string spriteSheetPath; + const LayerData* layerData = nullptr; + float rotation = 0; + unsigned int bitflags = 0; + unsigned int magFilterMode = 0; + unsigned int minFilterMode = 0; + unsigned int wrapSMode = 0; + unsigned int wrapTMode = 0; + bool isFlipX = false; + bool isFlipY = false; + bool isSpriteSheetLoaded = false; + bool isUnknown31 = false; + bool isVisible = true; + + LayerState(); + void Init(const LayerData* data); +}; + +// What a sprite holds. ANM2 copies it member by member. +struct ANM2Base +{ + AnimationState animState; + AnimationState overlayAnimState; + ColorMod championColor = CHAMPION_COLOR_DEFAULT; + ColorMod color = COLOR_DEFAULT; + Vector offset{}; + Vector scale = vector_make(1, 1); + std::shared_ptr file; + std::string filename; + std::vector layerStates; + float playbackSpeed = 1; + float rotation = 0; + int shadowLayerIndex = NO_SHADOW_LAYER; + unsigned int bitflags = 0; + bool isFlipX = false; + bool isFlipY = false; + bool isLoaded = false; + bool isOverlayRenderFirst = false; + bool isUnknown108 = false; +}; + +// 004074c0, 00408170 Construction and destruction are the defaults. +// Sprite's field accessors (004073d0, 00407410, 00407420, 00407430, 00417200, 00417210, 00420160, 00420170, 00431300, +// 00435c60, 0043ee80, 00440e40, 00456340, 00456360, 0049cb40) are the public fields. +// A sprite (Lua's Sprite): an .anm2 from the cache with a main and an overlay animation playing on it. +struct ANM2 : ANM2Base +{ + ANM2() = default; + ANM2(const ANM2& other); + ANM2& operator=(const ANM2& other); + + void Reset(); + void Load(std::string_view path, GraphicsLoad graphics); + void Reload(); + void LoadGraphics(); + bool ReplaceSpritesheet(int layerId, std::string_view path); + static void LoadDeliriumForm(ANM2& sprite, int type, int variant, bool isReloadAnm2); + + void Update(); + void Render(const SpriteDraw& draw) const; + void RenderLayer(int layerId, const SpriteDraw& draw) const; + + void Play(std::string_view name, PlayMode mode = PLAY_UNFORCED); + void PlayRandom(uint32_t seed); + void PlayIndex(int index); + bool SetAnimation(std::string_view name, AnimationSwitch mode = SWITCH_RESET); + void SetFrame(std::string_view name, int frame); + void SetFrame(float frame); + void SetLastFrame(); + int GetFrame() const; + void Stop(); + bool IsPlaying(std::string_view name = {}) const; + bool IsFinished(std::string_view name = {}) const; + const std::string& GetAnimation() const; + const std::string& GetDefaultAnimationName() const; + const AnimationData* GetAnimationData(std::string_view name) const; + + void PlayOverlay(std::string_view name, PlayMode mode = PLAY_UNFORCED); + bool SetOverlayAnimation(std::string_view name, AnimationSwitch mode = SWITCH_RESET); + void SetOverlayFrame(std::string_view name, int frame); + void SetOverlayFrame(int frame); + int GetOverlayFrame() const; + void StopOverlay(); + void RemoveOverlay(); + bool IsOverlayPlaying(std::string_view name = {}) const; + bool IsOverlayFinished(std::string_view name = {}) const; + const std::string& GetOverlayAnimation() const; + + bool IsEventTriggered(std::string_view eventName) const; + bool WasEventTriggered(std::string_view eventName) const; + + LayerState* GetLayer(int layerId); + LayerState* GetLayer(std::string_view name); + void SetLayerFrame(int layerId, int frame); + void SetLayerFrame(std::string_view layerName, int frame); + int GetLayerFrameIdx(int layerId) const; + + const NullFrame* GetNullFrame(std::string_view nullLayerName) const; + const NullFrame* GetNullFrame(std::string_view animName, std::string_view nullLayerName, int frame) const; + const NullFrame* GetNullFrameById(int nullLayerId) const; + const std::string& GetNullLayerName(int nullLayerId) const; + int null_index_get(std::string_view name) const; + + void animation_copy(ANM2& dest) const; + void appear_update(); +}; + +// The parsed-file cache: every .anm2 read so far, by resource path, kept while a sprite holds it or until Clear. +struct AnmCache +{ + static void Load(ANM2& sprite); + static void Preload(std::string_view path); + static void Clear(); + static void LogMemoryUsage(); }; diff --git a/src/anm2/README.md b/src/anm2/README.md deleted file mode 100644 index 0951ab6..0000000 --- a/src/anm2/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# ANM2 handling in isaac-ng.exe (Repentance+ v1.9.7.17) - -These notes reconstruct how the game parses `.anm2` files and how sprites play them, from the 32-bit `isaac-ng.exe` in the game root. -Addresses assume ImageBase `0x400000`. The `zhl.log` addresses on disk come from an older build and don't match this one. - -| File | Contents | -|---|---| -| `anm2.hpp` / `anm2.cpp` | Reimplementation: parser, load-time frame baking, AnimationState, Sprite API | -| `test.cpp` | Behaviour checks, plus an optional run against a real file | -| `docs/parser_decomp.md` | Field-by-field parser decompilation, with an address for every claim | -| `docs/cache_load_decomp.md` | AnmCache, the ANM2 object layout (0x114), and ctor/copy/Load/Reload | -| `docs/labels_*.json` | Function names for this build, for a disassembler | - -Build and test: - -``` -g++ -std=c++17 -O2 -msse2 -mfpmath=sse -ffp-contract=off anm2.cpp test.cpp -o anm2_test -./anm2_test path/to/file.anm2 AnimName EventName -``` - -`-ffp-contract=off` matters: the game never fuses multiply-adds, and the interpolated values must match bit for bit. - -## Pipeline - -1. **Load.** `ANM2::Load` (0x40bd50) calls `AnmCache::Load` (0x40db90). - - The cache key is djb2 of `mountPrefix + path`, lowercased with `\` turned into `/`. - - On a cache miss, `AnmCache::LoadFile` (0x40ed50) parses the file with rapidxml. - - The sprite borrows pointers into the cache entry, and entries are refcounted. -2. **Bake.** Everything is precomputed at load time: - - Interpolated keyframes become one-tick frames (0x415170 for layers, 0x414e00 for nulls and root). - - The RootAnimation is multiplied into every layer and null track, splitting frames at root-frame boundaries. - - Nothing is interpolated at runtime, and root frames are not kept. -3. **Play.** Each sprite holds two `AnimationState`s: main at +0x30 and overlay at +0x50. - - Each one keeps a float `frame` and a current keyframe index per track. - - It also keeps two event bitmasks: - - `eventsThisUpdate` (+0x18) answers `IsEventTriggered`. - - `eventsSinceStart` (+0x1c) answers `WasEventTriggered`. - -## Events and triggers - -- **Event table:** `` holds at most **16** names, and each id must equal its position. - The sprite looks an event name up linearly and tests bit `i` of the mask. -- **Triggers:** `` holds raw ints, at most 128 per animation, with no validation. -- **Firing (0x408c90):** for each trigger, if `(float)AtFrame == frame` exactly, the game sets bit `EventId & 31` in **both** masks. -- **`Update` (0x409030):** this is the only place frames are stepped. - - It computes `nf = floor(frame + PlaybackSpeed)`. - - If `nf < FrameNum`, it calls `AdvancePosition(nf)` and then stores `frame + speed`, so fractional frames are kept. - - `AdvancePosition` first clears `eventsThisUpdate`, then runs `frame = floor(frame)+1` and fires triggers on every whole frame up to `nf`. - So with speed > 1, no event is skipped mid-animation. - - If `nf >= FrameNum` and the animation loops, it calls `Rewind()` instead. - - Rewind sets the frame to 0, clears both masks and fires the frame-0 triggers. - - The frames between the old position and the end are **not** stepped, so with speed > 1 an event near the end of a loop can be skipped. - - If `nf >= FrameNum` and the animation doesn't loop, it calls `AdvancePosition(FrameNum-1)`, but only when that isn't behind the current frame, and then sets `playing = false`. -- **Masks while stopped:** `Update` returns immediately when stopped, so the masks are left as they were. - - If the update that finished the animation crossed an event frame, `IsEventTriggered` stays true from then on. - - The same happens after `Stop()`. - - In the normal speed-1 case the final update clears the mask, because it re-advances to the frame it is already on. -- **`Play(name)` (0x40a380):** it does `SetAnimationData` (frame=-1, masks cleared, indices -1), then `Rewind`, then `playing = true`. - - **Frame-0 events are already set when `Play` returns.** - - With the same name and no `force`: - - a non-looping animation is never restarted, even after it has finished; - - a looping animation restarts only if it was stopped. -- **`SetFrame(f)` (0x408e00):** clamps to `nextafterf(FrameNum, 0)` and clears only `eventsThisUpdate`. - - Triggers fire only when the clamped frame exactly equals AtFrame. - - Track indices are reset to 0 and moved forward to the **unclamped** f. - - `Sprite:SetFrame(name, f)` also stops playback; `SetOverlayFrame(name, f)` does not. -- **`NextEventTrigger` (0x40af10):** returns the nearest AtFrame strictly greater than `(int)frame` (truncated, not floored), or -1. -- **Lua `Sprite:IsEventTriggered` / `WasEventTriggered`:** these only look at the main state. -- **Playback speed:** `PlaybackSpeed` (+0x104) is shared by both states. A negative speed logs "cannot go backward" and fires nothing. - -## Bugs in the original - -These are not reproduced; each one is marked `ORIGINAL:` in the code. - -- **`AnimationState::ChangeAnimationKeepFrame` (0x408970)** is reached through `SetAnimation(name, false)`. It has two bugs: - - When the new animation has a different, non-zero null-animation count, the new null index array is stored into the *layer* slot (`mov [esi+8], ebx` at 0x408b6a). The null slot is left NULL, so the next `Update` dereferences NULL. - - It also copies the *old* layer count into the new array, which overflows the heap when the new animation has fewer layers. -- **Parser:** - - Every limit (16/64/128/5000/256) only logs and keeps writing. - - A missing required element (`Content`, `RootAnimation`, `Triggers`, …) is a NULL dereference. - - `LayerId="-1"` overwrites the animation's `Loop` flag. - - Frame attributes that are missing keep stale values from a reused scratch buffer, so a missing XScale can mean scale 0. - - An animation with no root frames applies an uninitialised root transform. -- **`GetLayerFrame` (0x40a220)** has an off-by-one bounds check (`jg`). -- **`ANM2::Load`** sets `loaded` even when loading failed. -- **`Sprite:Reload`** leaks one cache reference per call. - -## Not covered - -- **Rendering:** `AnimationLayer::RenderFrame` (0x409120) only reads the current baked frame, through `layerFrameIdx`. -- **Texture loading.** -- **The spritesheet path resolver** (0x67f670): it was only skimmed, and `ResolveRelativePath` here approximates it. diff --git a/src/anm2/anm2.cpp b/src/anm2/anm2.cpp deleted file mode 100644 index c064509..0000000 --- a/src/anm2/anm2.cpp +++ /dev/null @@ -1,944 +0,0 @@ -// See anm2.hpp. Build with SSE floats and no FMA contraction to keep float results identical to the -// game: e.g. `g++ -O2 -msse2 -mfpmath=sse -ffp-contract=off`. -#include "anm2.hpp" - -#include -#include -#include -#include -#include -#include -#include - -namespace anm2 { - -// ============================================================================================= -// Logging -// ============================================================================================= -static LogFn g_log = [](int level, const std::string& msg) { std::fprintf(stderr, "[%x] %s", level, msg.c_str()); }; -void SetLogger(LogFn fn) { g_log = std::move(fn); } - -static void Log(int level, const char* fmt, ...) { - char buf[1024]; - va_list ap; va_start(ap, fmt); std::vsnprintf(buf, sizeof buf, fmt, ap); va_end(ap); - if (g_log) g_log(level, buf); -} - -// ============================================================================================= -// Minimal XML DOM (the game uses rapidxml in-situ with default flags; .anm2 only needs elements -// and attributes). Lookups by name are exact and case-sensitive like rapidxml's. -// ============================================================================================= -namespace xml { -struct Attr { std::string name, value; }; -struct Node { - std::string name; - std::vector attrs; - std::vector children; - const Node* child(const char* n) const { // rapidxml first_node(name) 0x413c70 - for (auto& c : children) if (c.name == n) return &c; - return nullptr; - } -}; - -class Parser { -public: - explicit Parser(const std::string& s) : s_(s) {} - bool parse(Node& doc) { - doc.name.clear(); - return parseChildren(doc, /*top=*/true); - } -private: - const std::string& s_; - size_t p_ = 0; - - bool eof() const { return p_ >= s_.size(); } - void ws() { while (!eof() && (unsigned char)s_[p_] <= ' ') ++p_; } - bool starts(const char* t) const { return s_.compare(p_, std::strlen(t), t) == 0; } - bool skipPast(const char* t) { - size_t q = s_.find(t, p_); - if (q == std::string::npos) { p_ = s_.size(); return false; } - p_ = q + std::strlen(t); return true; - } - static bool nameChar(char c) { - return !((unsigned char)c <= ' ' || c == '/' || c == '>' || c == '=' || c == '<' || c == '?' || c == '!'); - } - static void appendUtf8(std::string& o, unsigned long cp) { - if (cp < 0x80) o += char(cp); - else if (cp < 0x800) { o += char(0xC0 | (cp >> 6)); o += char(0x80 | (cp & 0x3F)); } - else if (cp < 0x10000) { o += char(0xE0 | (cp >> 12)); o += char(0x80 | ((cp >> 6) & 0x3F)); o += char(0x80 | (cp & 0x3F)); } - else { o += char(0xF0 | (cp >> 18)); o += char(0x80 | ((cp >> 12) & 0x3F)); o += char(0x80 | ((cp >> 6) & 0x3F)); o += char(0x80 | (cp & 0x3F)); } - } - static std::string decode(const std::string& v) { // rapidxml default: decode entities in attr values - std::string o; - for (size_t i = 0; i < v.size(); ++i) { - if (v[i] != '&') { o += v[i]; continue; } - size_t semi = v.find(';', i); - if (semi == std::string::npos) { o += v[i]; continue; } - std::string e = v.substr(i + 1, semi - i - 1); - if (e == "amp") o += '&'; else if (e == "lt") o += '<'; else if (e == "gt") o += '>'; - else if (e == "quot") o += '"'; else if (e == "apos") o += '\''; - else if (!e.empty() && e[0] == '#') { - unsigned long cp = (e.size() > 1 && e[1] == 'x') ? std::strtoul(e.c_str() + 2, nullptr, 16) - : std::strtoul(e.c_str() + 1, nullptr, 10); - appendUtf8(o, cp); - } else { o += v[i]; continue; } - i = semi; - } - return o; - } - bool parseChildren(Node& parent, bool top) { - for (;;) { - size_t lt = s_.find('<', p_); - if (lt == std::string::npos) { p_ = s_.size(); return top; } - p_ = lt; - if (starts(""); continue; } - if (starts(""); continue; } - if (starts(""); continue; } - if (starts(""); continue; } - if (starts(""); return !top; } - ++p_; - Node n; - while (!eof() && nameChar(s_[p_])) n.name += s_[p_++]; - if (n.name.empty()) return false; // "expected element name" - for (;;) { - ws(); - if (eof()) return false; - if (s_[p_] == '/') { p_ += 2; parent.children.push_back(std::move(n)); break; } - if (s_[p_] == '>') { ++p_; if (!parseChildren(n, false)) return false; parent.children.push_back(std::move(n)); break; } - Attr a; - while (!eof() && nameChar(s_[p_])) a.name += s_[p_++]; - if (a.name.empty()) return false; // "expected attribute name" - ws(); if (eof() || s_[p_] != '=') return false; ++p_; ws(); - if (eof() || (s_[p_] != '"' && s_[p_] != '\'')) return false; - char q = s_[p_++]; - size_t e = s_.find(q, p_); - if (e == std::string::npos) return false; - a.value = decode(s_.substr(p_, e - p_)); - p_ = e + 1; - n.attrs.push_back(std::move(a)); - } - } - } -}; -} // namespace xml - -// ============================================================================================= -// Value converters (inlined everywhere in 0x40ed50) -// ============================================================================================= -static int ToInt(const std::string& v) { return std::atoi(v.c_str()); } -static float ToFloat(const std::string& v) { return (float)std::atof(v.c_str()); } -static float ToScale(const std::string& v) { float f = ToFloat(v); return f / 100.0f; } -static float ToColor(const std::string& v) { float f = ToFloat(v); return f / 255.0f; } -static bool ToBool(const std::string& v) { // 0x4100b6 - if (v.empty()) return false; - if (v == "true" || v == "True") return true; - return std::atoi(v.c_str()) != 0; -} - -// fmodf as the game does it: 0x499d20 = (float)fmod((double)x, (double)y) -static float FmodF(float x, float y) { return (float)std::fmod((double)x, (double)y); } - -// Spritesheet path resolver 0x67f670 (approximation; only skimmed): '\' -> '/', path is relative -// to the .anm2's directory, ".." pops a directory, result truncated to 0x104 chars. -static std::string ResolveRelativePath(const std::string& anmPath, const std::string& rel) { - auto split = [](std::string s) { - for (char& c : s) if (c == '\\') c = '/'; - std::vector parts; std::string cur; - for (char c : s) { if (c == '/') { if (!cur.empty()) parts.push_back(cur); cur.clear(); } else cur += c; } - if (!cur.empty()) parts.push_back(cur); - return parts; - }; - std::vector dir = split(anmPath); - if (!dir.empty()) dir.pop_back(); // drop file name - for (auto& part : split(rel)) { - if (part == "..") { if (!dir.empty()) dir.pop_back(); } - else if (part != ".") dir.push_back(part); - } - std::string out = (!anmPath.empty() && (anmPath[0] == '/' || anmPath[0] == '\\')) ? "/" : ""; - for (size_t i = 0; i < dir.size(); ++i) { if (i) out += '/'; out += dir[i]; } - if (out.size() > 0x104) out.resize(0x104); - return out; -} - -// ============================================================================================= -// Color helpers -// ============================================================================================= -Color LerpColor(const Color& a, const Color& b, float t) { // 0x6832e0: a*(1-t) + b*t, all 11 floats - float it = 1.0f - t; - Color o; - for (int i = 0; i < 4; ++i) o.tint[i] = a.tint[i] * it + b.tint[i] * t; - for (int i = 0; i < 4; ++i) o.colorize[i] = a.colorize[i] * it + b.colorize[i] * t; - for (int i = 0; i < 3; ++i) o.offset[i] = a.offset[i] * it + b.offset[i] * t; - return o; -} - -void MulColor(Color& self, const Color& other) { // 0x6831c0 - for (int i = 0; i < 4; ++i) self.tint[i] = other.tint[i] * self.tint[i]; - if (other.colorize[0] + other.colorize[1] + other.colorize[2] != 0.0f) { - if (self.colorize[0] + self.colorize[1] + self.colorize[2] == 0.0f) - for (int i = 0; i < 4; ++i) self.colorize[i] = other.colorize[i]; - else - for (int i = 0; i < 4; ++i) self.colorize[i] = (self.colorize[i] + other.colorize[i]) * 0.5f; - } - for (int i = 0; i < 3; ++i) self.offset[i] = other.offset[i] + self.offset[i]; -} - -static float WrapAngle(float x) { - if (std::fabs(x) > 360.0f) x = FmodF(x, 360.0f); - if (x > 180.0f) x -= 360.0f; - else if (x < -180.0f) x += 360.0f; - return x; -} - -float LerpAngleDeg(float a, float b, float t) { // 0x6828b0 - a = WrapAngle(a); - b = WrapAngle(b); - if (std::fabs(b - a) > 180.0f) { if (b > a) a += 360.0f; else b += 360.0f; } - return WrapAngle((b - a) * t + a); -} - -// ============================================================================================= -// Load-time interpolation: every interpolated keyframe (except the last) is expanded into `delay` -// one-tick frames. Nothing is interpolated at runtime. -// ============================================================================================= -void InterpolateLayerFrames(std::vector& src) { // 0x415170 - std::vector dst; - dst.reserve(src.size()); - int tick = 0; - const unsigned count = (unsigned)src.size(); - for (unsigned i = 0; i < count; ++i) { - const AnimationFrame& a = src[i]; - if (i != count - 1 && a.interpolated) { - if (i + 1 >= (unsigned)kMaxFrames) Log(0x10, "too many frames after interpolation\n"); - const AnimationFrame& b = src[i + 1]; - float t = 0.0f; - const float step = 1.0f / (float)a.delay; - for (int k = 0; k < a.delay; ++k) { // delay <= 0 emits nothing - AnimationFrame o; - o.xCrop = a.xCrop; o.yCrop = a.yCrop; o.width = a.width; o.height = a.height; - o.x = (b.x - a.x) * t + a.x; - o.y = (b.y - a.y) * t + a.y; - o.xScale = (b.xScale - a.xScale) * t + a.xScale; - o.yScale = (b.yScale - a.yScale) * t + a.yScale; - o.xPivot = a.xPivot; o.yPivot = a.yPivot; - o.delay = 1; - o.visible = a.visible; - o.color = LerpColor(a.color, b.color, t); - o.rotation = LerpAngleDeg(a.rotation, b.rotation, t); - o.interpolated = a.interpolated; - o.start = tick; o.end = tick + 1; ++tick; - dst.push_back(o); - t = step + t; // accumulated, not k/delay - } - } else { - AnimationFrame o = a; - o.start = tick; o.end = tick + a.delay; tick += a.delay; - dst.push_back(o); - } - } - src.swap(dst); -} - -void InterpolateNullFrames(std::vector& src) { // 0x414e00 - std::vector dst; - dst.reserve(src.size()); - int tick = 0; - const unsigned count = (unsigned)src.size(); - for (unsigned i = 0; i < count; ++i) { - const NullFrame& a = src[i]; - if (i != count - 1 && a.interpolated) { - if (i + 1 >= (unsigned)kMaxFrames) Log(0x10, "too many frames after interpolation\n"); - const NullFrame& b = src[i + 1]; - float t = 0.0f; - const float step = 1.0f / (float)a.delay; - for (int k = 0; k < a.delay; ++k) { - NullFrame o; - o.x = (b.x - a.x) * t + a.x; - o.y = (b.y - a.y) * t + a.y; - o.xScale = (b.xScale - a.xScale) * t + a.xScale; - o.yScale = (b.yScale - a.yScale) * t + a.yScale; - o.delay = 1; - o.visible = a.visible; - o.color = LerpColor(a.color, b.color, t); - o.rotation = LerpAngleDeg(a.rotation, b.rotation, t); - o.interpolated = a.interpolated; - o.start = tick; o.end = tick + 1; ++tick; - dst.push_back(o); - t = step + t; - } - } else { - NullFrame o = a; - o.start = tick; o.end = tick + a.delay; tick += a.delay; - dst.push_back(o); - } - } - src.swap(dst); -} - -// ============================================================================================= -// RootAnimation baking (inlined twice in the parser: layers 0x411df1, nulls 0x413017). -// Each track frame is cut wherever a root-frame boundary falls inside it; each piece gets the -// transform of the root frame active during it. Pieces keep the source `delay` (only start/end are -// updated) - the runtime only uses start/end. -// ============================================================================================= -template -static std::vector ApplyRoot(std::vector& src, const std::vector& root, const std::string& path) { - std::vector dst; - const int rootCount = (int)root.size(); - NullFrame identity; // ORIGINAL: with 0 root frames it applies stale scratch slot root[0] (undefined) - int g = 0, r = 0; - for (Fr& s : src) { - s.start = g; - for (int k = 0; k < s.delay; ++k) { - ++g; - const int prev = r; - bool emit = false; - if (r + 1 < rootCount) { - while (g >= root[r].end) { ++r; if (r + 1 >= rootCount) break; } - if (r > prev) emit = true; // a root frame ended on this tick - } - if (!emit && k == s.delay - 1) emit = true; // last tick of the source frame - if (!emit) continue; - if ((int)dst.size() >= kMaxFrames) - Log(0x10, "%s: too many frames after interpolation/root frame adjustment\n", path.c_str()); - const NullFrame& R = rootCount ? root[prev] : identity; - Fr o = s; - o.x = o.x * R.xScale + R.x; - o.y = R.yScale * o.y + R.y; - o.visible = o.visible && R.visible; - o.xScale = o.xScale * R.xScale; - o.yScale = R.yScale * o.yScale; - MulColor(o.color, R.color); - o.rotation = R.rotation + o.rotation; - o.end = g; - dst.push_back(o); - s.start = g; - } - } - return dst; -} - -// ============================================================================================= -// Frame attribute readers. Only tint (1) and offset (0) are reset per frame in the original; any -// other missing attribute keeps whatever was left in a reused 5000-entry scratch buffer. -// Here missing attributes take the struct defaults instead (pos 0, scale 1, delay 1, visible, rot 0). -// ============================================================================================= -static void ReadNullFrame(const xml::Node& fr, NullFrame& f) { - float tint[4] = {1, 1, 1, 1}, off[3] = {0, 0, 0}; - for (auto& a : fr.attrs) { - const std::string& n = a.name; const std::string& v = a.value; - if (n == "XPosition") f.x = ToFloat(v); - else if (n == "YPosition") f.y = ToFloat(v); - else if (n == "Delay") f.delay = ToInt(v); - else if (n == "Visible") f.visible = ToBool(v); - else if (n == "XScale") f.xScale = ToScale(v); - else if (n == "YScale") f.yScale = ToScale(v); - else if (n == "RedTint") tint[0] = ToColor(v); - else if (n == "GreenTint") tint[1] = ToColor(v); - else if (n == "BlueTint") tint[2] = ToColor(v); - else if (n == "AlphaTint") tint[3] = ToColor(v); - else if (n == "RedOffset") off[0] = ToColor(v); - else if (n == "GreenOffset") off[1] = ToColor(v); - else if (n == "BlueOffset") off[2] = ToColor(v); - else if (n == "Rotation") f.rotation = ToFloat(v); - else if (n == "Interpolated") f.interpolated = ToBool(v); - } - for (int i = 0; i < 4; ++i) f.color.tint[i] = tint[i]; - for (int i = 0; i < 3; ++i) f.color.offset[i] = off[i]; -} - -static void ReadLayerFrame(const xml::Node& fr, AnimationFrame& f) { - float tint[4] = {1, 1, 1, 1}, off[3] = {0, 0, 0}; - for (auto& a : fr.attrs) { - const std::string& n = a.name; const std::string& v = a.value; - if (n == "XPosition") f.x = ToFloat(v); - else if (n == "YPosition") f.y = ToFloat(v); - else if (n == "XPivot") f.xPivot = ToFloat(v); - else if (n == "YPivot") f.yPivot = ToFloat(v); - else if (n == "Width") f.width = ToFloat(v); - else if (n == "Height") f.height = ToFloat(v); - else if (n == "XScale") f.xScale = ToScale(v); - else if (n == "YScale") f.yScale = ToScale(v); - else if (n == "Delay") f.delay = ToInt(v); - else if (n == "Visible") f.visible = ToBool(v); - else if (n == "XCrop") f.xCrop = ToFloat(v); - else if (n == "YCrop") f.yCrop = ToFloat(v); - else if (n == "RedTint") tint[0] = ToColor(v); - else if (n == "GreenTint") tint[1] = ToColor(v); - else if (n == "BlueTint") tint[2] = ToColor(v); - else if (n == "AlphaTint") tint[3] = ToColor(v); - else if (n == "RedOffset") off[0] = ToColor(v); - else if (n == "GreenOffset") off[1] = ToColor(v); - else if (n == "BlueOffset") off[2] = ToColor(v); - else if (n == "Rotation") f.rotation = ToFloat(v); - else if (n == "Interpolated") f.interpolated = ToBool(v); - } - for (int i = 0; i < 4; ++i) f.color.tint[i] = tint[i]; - for (int i = 0; i < 3; ++i) f.color.offset[i] = off[i]; -} - -// Required child lookup. ORIGINAL: never NULL-checked; a missing element crashes the game. -static const xml::Node* Need(const xml::Node* parent, const char* name, const std::string& path) { - const xml::Node* n = parent ? parent->child(name) : nullptr; - if (!n) Log(0x10, "%s: missing <%s> (the original crashes here)\n", path.c_str(), name); - return n; -} - -// ============================================================================================= -// AnmCache::LoadFile 0x40ed50 -// ============================================================================================= -bool ParseAnm2(const std::string& path, const std::string& text, AnmData& d) { - d = AnmData{}; // entry->Clear() (ORIGINAL: defaultAnimation survives Clear(); see notes) - - xml::Node doc; - if (!xml::Parser(text).parse(doc)) { Log(0x10, "%s: XML parse error\n", path.c_str()); return false; } - const xml::Node* actor = Need(&doc, "AnimatedActor", path); - const xml::Node* content = Need(actor, "Content", path); - if (!content) return false; - - // ---- Spritesheets (not stored; each layer receives a copy of its sheet's path) ---- - // Children are never filtered by tag name. - const xml::Node* sheets = Need(content, "Spritesheets", path); - if (!sheets) return false; - std::string sheetPath[kMaxLayers]; - std::string pathBuf; // ORIGINAL: char[260] not cleared between elements -> a Path-less sheet reuses the previous one - int sheetCount = 0; - for (auto& e : sheets->children) { - int id = kMaxLayers; - for (auto& a : e.attrs) { - if (a.name == "Path") pathBuf = ResolveRelativePath(path, a.value); - else if (a.name == "Id") id = ToInt(a.value); - } - if (id >= kMaxLayers || id != sheetCount) - Log(0x10, "%s: invalid spritesheet id %d\n", path.c_str(), id); - if (id >= 0 && id < kMaxLayers) sheetPath[id] = pathBuf; // ORIGINAL: stored at [id] unchecked - ++sheetCount; - } - - // ---- Layers ---- - const xml::Node* layers = Need(content, "Layers", path); - if (!layers) return false; - LayerInfo layer[kMaxLayers]; - int layerCount = 0; - for (auto& e : layers->children) { - std::string name; int id = kMaxLayers; int sheet = -1; - for (auto& a : e.attrs) { - if (a.name == "Name") name = a.value; - else if (a.name == "Id") id = ToInt(a.value); - else if (a.name == "SpritesheetId") sheet = ToInt(a.value); - } - if (id >= kMaxLayers || id != layerCount) Log(0x10, "%s: invalid layer id %d\n", path.c_str(), id); - if (sheet < 0 || sheet >= sheetCount) Log(0x10, "%s: invalid spritesheet id %d\n", path.c_str(), sheet); - if (id >= 0 && id < kMaxLayers) { - LayerInfo& L = layer[id]; - L.spritesheetPath = (sheet >= 0 && sheet < kMaxLayers) ? sheetPath[sheet] : std::string(); - L.id = id; L.spritesheetId = sheet; L.name = name; - } - ++layerCount; - } - if (layerCount == 0) Log(0x10, "%s: no layers\n", path.c_str()); // only logged - for (int i = 0; i < layerCount && i < kMaxLayers; ++i) d.layers.push_back(layer[i]); - - // ---- Nulls ---- - const xml::Node* nulls = Need(content, "Nulls", path); - if (!nulls) return false; - std::string nullName[kMaxLayers]; - int nullCount = 0; - for (auto& e : nulls->children) { - int id = kMaxLayers; std::string name; - for (auto& a : e.attrs) { - if (a.name == "Id") id = ToInt(a.value); - else if (a.name == "Name") name = a.value; - } - if (id >= kMaxLayers || id != nullCount) Log(0x10, "%s: invalid Null ID %d\n", path.c_str(), id); - if (id >= 0 && id < kMaxLayers) nullName[id] = name; - ++nullCount; - } - for (int i = 0; i < nullCount && i < kMaxLayers; ++i) d.nullNames.push_back(nullName[i]); - - // ---- Events (max 16) ---- - const xml::Node* events = Need(content, "Events", path); - if (!events) return false; - std::string eventName[kMaxEvents]; - int eventCount = 0; - for (auto& e : events->children) { - int id = kMaxEvents; std::string name; - for (auto& a : e.attrs) { - if (a.name == "Id") id = ToInt(a.value); - else if (a.name == "Name") name = a.value; - } - if (id >= kMaxEvents || id != eventCount) Log(0x10, "%s: invalid Event ID %d\n", path.c_str(), id); - if (id >= 0 && id < kMaxEvents) eventName[id] = name; - ++eventCount; - } - for (int i = 0; i < eventCount && i < kMaxEvents; ++i) d.eventNames.push_back(eventName[i]); - - // ---- Animations ---- - const xml::Node* anims = Need(actor, "Animations", path); - if (!anims) return false; - for (auto& a : anims->attrs) if (a.name == "DefaultAnimation") d.defaultAnimation = a.value; - - // Iteration starts at first_node("Animation") and then follows next_sibling WITHOUT a name check. - size_t firstAnim = anims->children.size(); - for (size_t i = 0; i < anims->children.size(); ++i) - if (anims->children[i].name == "Animation") { firstAnim = i; break; } - - for (size_t ai = firstAnim; ai < anims->children.size(); ++ai) { - const xml::Node& an = anims->children[ai]; - if ((int)d.animations.size() >= kMaxAnimations) - Log(0x10, "%s: more than %d animations (the original overflows its stack here)\n", path.c_str(), kMaxAnimations); - - AnimationData A; - for (auto& a : an.attrs) { - if (a.name == "Name") A.name = a.value; - else if (a.name == "FrameNum") A.frameNum = ToInt(a.value); - else if (a.name == "Loop") A.loop = ToBool(a.value); - } - A.index = (int)d.animations.size(); - - // RootAnimation - const xml::Node* rootNode = Need(&an, "RootAnimation", path); - std::vector root; - if (rootNode) { - int t = 0; - for (auto& fr : rootNode->children) { - if ((int)root.size() >= kMaxFrames) Log(0x10, "%s: too many root frames\n", path.c_str()); - NullFrame f; ReadNullFrame(fr, f); - f.start = t; f.end = t + f.delay; t = f.end; - root.push_back(f); - } - } - InterpolateNullFrames(root); - - // LayerAnimations - if (const xml::Node* las = Need(&an, "LayerAnimations", path)) { - for (auto& ln : las->children) { - if ((int)A.layerAnims.size() >= kMaxLayers) Log(0x10, "%s: too many animation layers\n", path.c_str()); - LayerAnimation L; - for (auto& a : ln.attrs) { - if (a.name == "LayerId") L.layerId = ToInt(a.value); - else if (a.name == "Visible") L.visible = ToBool(a.value); - } - std::vector frames; - int t = 0; - for (auto& fr : ln.children) { - if ((int)frames.size() >= kMaxFrames) Log(0x10, "%s: too many animation frames\n", path.c_str()); - AnimationFrame f; ReadLayerFrame(fr, f); - f.start = t; f.end = t + f.delay; t = f.end; - frames.push_back(f); - } - InterpolateLayerFrames(frames); - L.frames = ApplyRoot(frames, root, path); - A.layerAnims.push_back(std::move(L)); - } - // map[LayerId] = index; last duplicate wins. - // ORIGINAL: unchecked; LayerId -1 overwrites Loop (+0x34), >=64 writes past the array. - for (int i = 0; i < (int)A.layerAnims.size(); ++i) { - int id = A.layerAnims[i].layerId; - if (id >= 0 && id < kMaxLayers) A.layerMap[id] = i; - } - } - - // NullAnimations (no id validation, no map) - if (const xml::Node* nas = Need(&an, "NullAnimations", path)) { - for (auto& nn : nas->children) { - if ((int)A.nullAnims.size() >= kMaxLayers) Log(0x10, "%s: too many null layers\n", path.c_str()); - NullAnimation N; - for (auto& a : nn.attrs) { - if (a.name == "NullId") N.nullId = ToInt(a.value); - else if (a.name == "Visible") N.visible = ToBool(a.value); - } - std::vector frames; - int t = 0; - for (auto& fr : nn.children) { - if ((int)frames.size() >= kMaxFrames) Log(0x10, "%s: too many null frames\n", path.c_str()); - NullFrame f; ReadNullFrame(fr, f); - f.start = t; f.end = t + f.delay; t = f.end; - frames.push_back(f); - } - InterpolateNullFrames(frames); - N.frames = ApplyRoot(frames, root, path); - A.nullAnims.push_back(std::move(N)); - } - } - - // Triggers (max 128; EventId and AtFrame are raw ints, never validated) - if (const xml::Node* trs = Need(&an, "Triggers", path)) { - for (auto& te : trs->children) { - if ((int)A.triggers.size() >= kMaxTriggers) Log(0x10, "%s: too many triggers\n", path.c_str()); - Trigger T; // ORIGINAL: local array not reset -> missing attrs keep a previous trigger's values - for (auto& a : te.attrs) { - if (a.name == "EventId") T.eventId = ToInt(a.value); - else if (a.name == "AtFrame") T.atFrame = ToInt(a.value); - } - A.triggers.push_back(T); - } - } - d.animations.push_back(std::move(A)); - } - return true; -} - -bool LoadAnm2File(const std::string& path, AnmData& out) { - std::ifstream f(path, std::ios::binary); - if (!f) { Log(1, "ERROR Could not open %s\n", path.c_str()); return false; } - std::stringstream ss; ss << f.rdbuf(); - return ParseAnm2(path, ss.str(), out); -} - -// ============================================================================================= -// AnimationState -// ============================================================================================= -static int FloorToInt(float f) { - // floor() on the double, stored back to float, then cvttss2si - float fl = (float)std::floor((double)f); - return (int)fl; -} - -int AnimationState::FindEvent(const char* name) const { - if (!anim_) Log(0x10, "AnimationData is NULL\n"); // logged, not returned - const AnmData* d = owner_->data_; - if (!d) return -1; - for (size_t i = 0; i < d->eventNames.size(); ++i) - if (std::strcmp(d->eventNames[i].c_str(), name) == 0) return (int)i; - return -1; -} - -// 0x408830: hard reset. Index arrays are reallocated to the new animation's sizes and filled -// with -1, frame = -1.0f, not playing, both event masks cleared. -void AnimationState::SetAnimationData(const AnimationData* a) { - anim_ = a; - layerFrameIdx_.assign(a ? a->layerAnims.size() : 0, -1); - nullFrameIdx_.assign(a ? a->nullAnims.size() : 0, -1); - frame_ = -1.0f; - playing_ = false; - eventsThisUpdate_ = 0; - eventsSinceStart_ = 0; -} - -// 0x408970: switch animation, keep frame / playing / masks / existing per-track indices. -// ORIGINAL BUGS (not reproduced): -// * it memcpy's the OLD layer count into the NEW index array -> heap overflow when the new animation -// has fewer layer-anims; -// * when the null-anim count changes to a non-zero value, the new null array is stored into the -// LAYER slot (`mov [esi+8], ebx` @0x408b6a) and the null slot is left NULL -> the next Update -// dereferences NULL. I.e. Sprite:SetAnimation(name, false) between animations with different -// non-zero null counts crashes the game. -void AnimationState::ChangeAnimationKeepFrame(const AnimationData* a) { - size_t nl = a ? a->layerAnims.size() : 0, nn = a ? a->nullAnims.size() : 0; - if (layerFrameIdx_.size() != nl) layerFrameIdx_.resize(nl, -1); - if (nullFrameIdx_.size() != nn) nullFrameIdx_.resize(nn, -1); - anim_ = a; -} - -// 0x408c90. Exact float equality between the current frame and AtFrame. Both masks get the bit; -// `bts reg, id` means bit (eventId & 31). -void AnimationState::FireTriggersAtCurrentFrame() { - if (!anim_) { Log(0x10, "AnimationData is NULL\n"); return; } // ORIGINAL: continues and crashes - for (const Trigger& t : anim_->triggers) { - if ((float)t.atFrame == frame_) { - eventsThisUpdate_ |= 1u << (t.eventId & 31); - eventsSinceStart_ |= 1u << (t.eventId & 31); - } - } -} - -// 0x40a1b0 -void AnimationState::Rewind() { - frame_ = 0.0f; - eventsThisUpdate_ = 0; - eventsSinceStart_ = 0; - FireTriggersAtCurrentFrame(); // events on frame 0 fire immediately on Play - for (int& i : layerFrameIdx_) i = 0; - for (int& i : nullFrameIdx_) i = 0; -} - -// 0x408b90: move forward while the current keyframe has ended. Never moves backward. -void AnimationState::AdvanceLayerPosition(int i, float t) { - if (!anim_ || i < 0 || i >= (int)anim_->layerAnims.size()) { Log(0x10, "id out of bounds\n"); return; } - const auto& frames = anim_->layerAnims[i].frames; - int& idx = layerFrameIdx_[i]; - while (idx >= 0 && idx + 1 < (int)frames.size() && t >= (float)frames[idx].end) ++idx; -} - -// 0x408c10 -void AnimationState::AdvanceNullLayerPosition(int i, float t) { - if (!anim_ || i < 0 || i >= (int)anim_->nullAnims.size()) { Log(0x10, "id out of bounds\n"); return; } - const auto& frames = anim_->nullAnims[i].frames; - int& idx = nullFrameIdx_[i]; - while (idx >= 0 && idx + 1 < (int)frames.size() && t >= (float)frames[idx].end) ++idx; -} - -// 0x408d00: step one whole frame at a time up to `target`, firing triggers on every integer frame -// passed. eventsThisUpdate is cleared first, so it reflects only frames crossed by this call. -void AnimationState::AdvancePosition(int target) { - int cur = FloorToInt(frame_); - if (target < cur) - Log(0x10, "Animation::AdvancePosition cannot go backward (new: %d, cur: %d)\n", target, cur); - const float t = (float)target; - eventsThisUpdate_ = 0; - while (t > frame_) { - frame_ = (float)std::floor((double)frame_) + 1.0f; - FireTriggersAtCurrentFrame(); - } - for (int i = 0; i < (int)anim_->layerAnims.size(); ++i) AdvanceLayerPosition(i, t); - for (int i = 0; i < (int)anim_->nullAnims.size(); ++i) AdvanceNullLayerPosition(i, t); -} - -// 0x409030 -void AnimationState::Update() { - if (!anim_ || !playing_) return; // NB: event masks are NOT cleared while stopped - const float oldFrame = frame_; - const float newFrame = frame_ + owner_->playbackSpeed; - const int nf = FloorToInt(newFrame); - if (nf >= anim_->frameNum) { - if (anim_->loop) { - // Frames between the old position and FrameNum-1 are NOT stepped through (only matters - // for speed > 1), and the fractional overshoot is dropped. - Rewind(); - return; - } - int last = anim_->frameNum - 1; - if (last >= FloorToInt(oldFrame)) AdvancePosition(last); - playing_ = false; // frame_ stays at FrameNum-1 (an integer) - return; - } - AdvancePosition(nf); // with speed < 0 this logs "cannot go backward" and fires nothing - frame_ = newFrame; // keep the fractional part -} - -// 0x408e00: jump directly to a frame. Clamped to just below FrameNum; triggers fire only if the -// clamped frame equals AtFrame exactly. eventsSinceStart is NOT cleared. Track indices are reset to 0 -// and advanced to the UNCLAMPED value. -void AnimationState::SetFrame(float f) { - float maxF = std::nextafterf((float)anim_->frameNum, 0.0f); - frame_ = (maxF < f) ? maxF : f; // minss - eventsThisUpdate_ = 0; - FireTriggersAtCurrentFrame(); - for (int i = 0; i < (int)anim_->layerAnims.size(); ++i) { layerFrameIdx_[i] = 0; AdvanceLayerPosition(i, f); } - for (int i = 0; i < (int)anim_->nullAnims.size(); ++i) { nullFrameIdx_[i] = 0; AdvanceNullLayerPosition(i, f); } -} - -// 0x408ef0 / 0x40a7e0: layerId goes through layerMap. -void AnimationState::SetLayerFrame(int layerId, int frame) { - const AnmData* d = owner_->data_; - if (!anim_) return; - if (layerId < 0 || !d || layerId >= (int)d->layers.size()) { Log(0x10, "LayerId out of bounds\n"); return; } - int la = (layerId < kMaxLayers) ? anim_->layerMap[layerId] : -1; - if (la < 0 || la >= (int)anim_->layerAnims.size()) { - Log(0x10, "id out of bounds\n"); - return; // ORIGINAL: logs, then writes layerFrameIdx[-1] = 0 anyway - } - layerFrameIdx_[la] = 0; - AdvanceLayerPosition(la, (float)frame); -} - -// 0x408fc0: index is the null-ANIMATION index (no map), bounds-checked against the sprite's null count. -void AnimationState::SetNullLayerFrame(int i, int frame) { - const AnmData* d = owner_->data_; - if (i < 0 || !d || i >= (int)d->nullNames.size()) Log(0x10, "layerId out of bounds\n"); - if (!anim_ || i < 0 || i >= (int)anim_->nullAnims.size()) { Log(0x10, "id out of bounds\n"); return; } - nullFrameIdx_[i] = 0; - AdvanceNullLayerPosition(i, (float)frame); -} - -bool AnimationState::IsEventTriggered(const char* name) const { // 0x40add0 - int i = FindEvent(name); - return i >= 0 && (eventsThisUpdate_ & (1u << i)) != 0; -} - -bool AnimationState::WasEventTriggered(const char* name) const { // 0x40ae70 - int i = FindEvent(name); - return i >= 0 && (eventsSinceStart_ & (1u << i)) != 0; -} - -// 0x40af10: nearest trigger frame strictly after the current frame (truncated, not floored), or -1. -int AnimationState::NextEventTrigger(const char* name) const { - int ev = FindEvent(name); - if (ev < 0) return -1; - int best = -1, bestDist = -1; - const int cur = (int)frame_; // cvttss2si - for (const Trigger& t : anim_->triggers) { - if (t.eventId != ev) continue; - int dist = t.atFrame - cur; - if (dist > 0 && (bestDist < 0 || dist < bestDist)) { best = t.atFrame; bestDist = dist; } - } - return best; -} - -const AnimationFrame* AnimationState::GetLayerFrame(int layerId) const { // 0x40a220 - if (!anim_) { Log(0x10, "AnimationData is NULL\n"); return nullptr; } - const AnmData* d = owner_->data_; - if (layerId < 0 || !d || layerId >= (int)d->layers.size()) Log(0x10, "LayerId out of bounds\n"); - // ORIGINAL quirk: the second bounds test is `layerId > layerCount` (jg), i.e. off by one. - if (layerId < 0 || layerId >= kMaxLayers || !d || layerId > (int)d->layers.size()) return nullptr; - int la = anim_->layerMap[layerId]; - if (la < 0 || la >= (int)anim_->layerAnims.size()) return nullptr; - int fi = layerFrameIdx_[la]; - const auto& fr = anim_->layerAnims[la].frames; - if (fi < 0 || fi >= (int)fr.size()) return nullptr; - return &fr[fi]; -} - -const NullFrame* AnimationState::GetNullFrameByID(int nullId) const { // 0x40ac70: first match with a valid index - if (!anim_) { Log(0x10, "AnimationData is NULL\n"); return nullptr; } - for (size_t i = 0; i < anim_->nullAnims.size(); ++i) { - const NullAnimation& n = anim_->nullAnims[i]; - int fi = nullFrameIdx_[i]; - if (n.nullId == nullId && fi >= 0 && fi < (int)n.frames.size()) return &n.frames[fi]; - } - return nullptr; -} - -const NullFrame* AnimationState::GetNullFrame(const char* name) const { // 0x40ace0 - const AnmData* d = owner_->data_; - if (!d) return nullptr; - for (size_t i = 0; i < d->nullNames.size(); ++i) - if (std::strcmp(d->nullNames[i].c_str(), name) == 0) return GetNullFrameByID((int)i); - return nullptr; -} - -// ============================================================================================= -// Sprite (ANM2) -// ============================================================================================= -void Sprite::Load(const AnmData* data) { - data_ = data; // ORIGINAL: borrowed pointers into the AnmCache entry - main_.SetAnimationData(nullptr); - overlay_.SetAnimationData(nullptr); - loaded_ = true; // ORIGINAL: set even if the cache load failed -} - -void Sprite::Reset() { - main_.SetAnimationData(nullptr); - overlay_.SetAnimationData(nullptr); - data_ = nullptr; - playbackSpeed = 1.0f; - overlayRenderFirst = false; - loaded_ = false; -} - -// 0x409100: both states advance with the same PlaybackSpeed. -void Sprite::Update() { - if (!loaded_) return; - main_.Update(); - overlay_.Update(); -} - -const AnimationData* Sprite::FindAnimation(const char* name) const { - if (data_) - for (const AnimationData& a : data_->animations) - if (std::strcmp(a.name.c_str(), name) == 0) return &a; - return nullptr; -} - -// 0x40a5d0 / 0x40aaf0 -bool Sprite::SetAnimation(const char* name, bool reset) { - const AnimationData* a = FindAnimation(name); - if (!a) { Log(1, "[warn] no animation named %s\n", name); return false; } - if (reset) main_.SetAnimationData(a); else main_.ChangeAnimationKeepFrame(a); - return true; -} - -bool Sprite::SetOverlayAnimation(const char* name, bool reset) { - const AnimationData* a = FindAnimation(name); - if (!a) { Log(1, "[warn] no animation named %s\n", name); return false; } - if (reset) overlay_.SetAnimationData(a); else overlay_.ChangeAnimationKeepFrame(a); - return true; -} - -// Shared logic of Play / PlayOverlay / PlayRandom / PlayIndex. Without `force`, playing the -// animation that is already current does nothing if it is non-looping (even when it has finished), -// or if it is looping and still playing. A stopped looping animation restarts. -static bool ShouldRestart(const AnimationState& s, const char* name, bool force) { - if (force || !s.anim()) return true; - if (std::strcmp(s.anim()->name.c_str(), name) != 0) return true; - if (!s.anim()->loop) return false; - return !s.playing(); -} - -void Sprite::Play(const char* name, bool force) { // 0x40a380 - if (!ShouldRestart(main_, name, force)) return; - if (SetAnimation(name, true)) { main_.Rewind(); main_.setPlaying(true); } -} - -void Sprite::PlayOverlay(const char* name, bool force) { // 0x40a940 - if (!ShouldRestart(overlay_, name, force)) return; - if (SetOverlayAnimation(name, true)) { overlay_.Rewind(); overlay_.setPlaying(true); } -} - -void Sprite::PlayRandom(uint32_t seed) { // 0x40a2b0: animation index = seed % count (unsigned) - if (!data_ || data_->animations.empty()) { Log(1, "[warn] PlayRandom: no animations\n"); return; } - const char* name = data_->animations[seed % (uint32_t)data_->animations.size()].name.c_str(); - if (!ShouldRestart(main_, name, false)) return; - if (SetAnimation(name, true)) { main_.Rewind(); main_.setPlaying(true); } -} - -void Sprite::PlayIndex(int index) { // 0x40a400 - if (!data_ || index < 0 || index >= (int)data_->animations.size()) { - Log(1, "[warn] Animation index out of range!\n"); return; - } - const char* name = data_->animations[index].name.c_str(); - if (!ShouldRestart(main_, name, false)) return; - if (SetAnimation(name, true)) { main_.Rewind(); main_.setPlaying(true); } -} - -// 0x40a6e0: selects (hard reset), jumps, and STOPS the main animation. -void Sprite::SetFrame(const char* name, int frame) { - if (!SetAnimation(name, true) || !main_.anim()) return; - main_.SetFrame((float)frame); - main_.setPlaying(false); -} - -void Sprite::SetFrame(float frame) { if (main_.anim()) main_.SetFrame(frame); } // 0x40a740 (keeps playing) - -void Sprite::SetLastFrame() { // 0x40a760: does not stop playback - if (main_.anim()) main_.AdvancePosition(main_.anim()->frameNum - 1); -} - -int Sprite::GetFrame() const { return main_.anim() ? FloorToInt(main_.frame()) : -1; } // 0x40a780 - -void Sprite::Stop() { if (main_.anim()) main_.setPlaying(false); } // 0x40a910 - -bool Sprite::IsPlaying(const char* name) const { // 0x40a4d0 - if (!main_.anim() || !main_.playing()) return false; - return name[0] == 0 || std::strcmp(main_.anim()->name.c_str(), name) == 0; -} - -bool Sprite::IsFinished(const char* name) const { // 0x40a550 - if (!main_.anim()) return name[0] == 0; - if (main_.playing()) return false; - return name[0] == 0 || std::strcmp(main_.anim()->name.c_str(), name) == 0; -} - -// 0x40b030 / 0x40b090: main state only (Repentogon adds overlay variants). -bool Sprite::IsEventTriggered(const char* name) const { return main_.anim() && main_.IsEventTriggered(name); } -bool Sprite::WasEventTriggered(const char* name) const { return main_.anim() && main_.WasEventTriggered(name); } - -void Sprite::SetLayerFrame(int layerId, int frame) { if (main_.anim()) main_.SetLayerFrame(layerId, frame); } - -// 0x40abf0: unlike SetFrame(name, frame), does NOT stop the overlay. -void Sprite::SetOverlayFrame(const char* name, int frame) { - if (!SetOverlayAnimation(name, true) || !overlay_.anim()) return; - overlay_.SetFrame((float)frame); -} - -void Sprite::SetOverlayFrame(int frame) { if (overlay_.anim()) overlay_.SetFrame((float)frame); } // 0x40ac30 - -int Sprite::GetOverlayFrame() const { return overlay_.anim() ? (int)overlay_.frame() : -1; } // 0x40ac50: truncates - -void Sprite::StopOverlay() { if (overlay_.anim()) overlay_.setPlaying(false); } // 0x40a9c0 - -void Sprite::RemoveOverlay() { overlay_.SetAnimationData(nullptr); } // 0x40ac60 - -bool Sprite::IsOverlayPlaying(const char* name) const { // 0x40a9f0 - if (!overlay_.anim() || !overlay_.playing()) return false; - return name[0] == 0 || std::strcmp(overlay_.anim()->name.c_str(), name) == 0; -} - -bool Sprite::IsOverlayFinished(const char* name) const { // 0x40aa70 - if (!overlay_.anim()) return name[0] == 0; - if (overlay_.playing()) return false; - return name[0] == 0 || std::strcmp(overlay_.anim()->name.c_str(), name) == 0; -} - -} // namespace anm2 diff --git a/src/anm2/anm2.hpp b/src/anm2/anm2.hpp deleted file mode 100644 index e1339eb..0000000 --- a/src/anm2/anm2.hpp +++ /dev/null @@ -1,225 +0,0 @@ -// Reimplementation of The Binding of Isaac: Repentance+ (isaac-ng.exe v1.9.7.17) .anm2 handling. -// Reverse-engineered from the shipped binary; addresses in comments refer to that build (ImageBase 0x400000). -// -// Scope: XML parsing + load-time frame baking (AnmCache::LoadFile 0x40ed50), and the runtime -// AnimationState / Sprite (ANM2) playback and event-trigger logic. Rendering and texture loading are -// out of scope (only the data the renderer consumes is produced). -// -// Behaviour is matched 1:1 for well-formed files. Where the original reads uninitialised memory, -// overflows fixed arrays, or crashes, this code picks a safe behaviour instead; every such spot is -// marked "ORIGINAL:" so you can see what the game actually does. -#pragma once -#include -#include -#include -#include - -namespace anm2 { - -// KAGE_LogMessage(level, fmt, ...) @0xa112c0. Levels seen: 1 = warn, 4 = info, 0x10 = error/assert. -using LogFn = std::function; -void SetLogger(LogFn fn); - -// --------------------------------------------------------------------------------------------- -// Data (what the parser produces). Original layouts given as offsets for cross-reference. -// --------------------------------------------------------------------------------------------- - -// ColorMod, 0x2c bytes. ctor 0x407170, Lerp 0x6832e0, operator*= 0x6831c0. -struct Color { - float tint[4] = {1, 1, 1, 1}; // +0x00 Red/Green/Blue/AlphaTint / 255 - float colorize[4] = {0, 0, 0, 0}; // +0x10 never written by the parser - float offset[3] = {0, 0, 0}; // +0x20 Red/Green/BlueOffset / 255 -}; - -// AnimationFrame, 0x6c bytes (layer keyframe after baking). -struct AnimationFrame { - float xCrop = 0, yCrop = 0; // +0x00 +0x04 - float width = 0, height = 0; // +0x08 +0x0c - float x = 0, y = 0; // +0x10 +0x14 XPosition/YPosition - float xScale = 1, yScale = 1; // +0x18 +0x1c XScale/100, YScale/100 - float xPivot = 0, yPivot = 0; // +0x20 +0x24 - int delay = 1; // +0x28 - bool visible = true; // +0x2c - Color color; // +0x30 - float rotation = 0; // +0x5c degrees - bool interpolated = false; // +0x60 - int start = 0; // +0x64 first tick (inclusive) - int end = 0; // +0x68 last tick (exclusive) -}; - -// NullFrame, 0x54 bytes. Used for null-layer frames AND root frames. -struct NullFrame { - float x = 0, y = 0; // +0x00 +0x04 - int delay = 1; // +0x08 - bool visible = true; // +0x0c - float xScale = 1, yScale = 1; // +0x10 +0x14 - Color color; // +0x18 - float rotation = 0; // +0x44 - bool interpolated = false; // +0x48 - int start = 0; // +0x4c - int end = 0; // +0x50 -}; - -struct LayerAnimation { // 0x10, ctor 0x40c1e0 - int layerId = -1; // +0x0 - std::vector frames;// +0x4 / +0x8 - bool visible = true; // +0xc -}; - -struct NullAnimation { // 0x10, ctor 0x40c210 - int nullId = 0; // +0x0 ORIGINAL: no default (stale stack value) - bool visible = true; // +0x4 ORIGINAL: no default - std::vector frames; // +0x8 / +0xc -}; - -struct Trigger { int eventId = 0; int atFrame = 0; }; // 8 bytes - -constexpr int kMaxLayers = 64; // spritesheets / layers / nulls / layer- and null-anims per animation -constexpr int kMaxEvents = 16; // "invalid Event ID" if id >= 16 -constexpr int kMaxTriggers = 128; -constexpr int kMaxFrames = 5000; // per track, before and after baking -constexpr int kMaxAnimations = 256; // ORIGINAL: stack array, no check at all - -struct AnimationData { // 0x13c, ctor 0x40bec0 - std::string name; // +0x000 - std::vector layerAnims; // +0x018 / +0x01c - std::vector nullAnims; // +0x020 / +0x024 - std::vector triggers; // +0x028 / +0x02c - int frameNum = 0; // +0x030 - bool loop = false; // +0x034 - int layerMap[kMaxLayers]; // +0x038 LayerId -> index into layerAnims, -1 = none - int index = 0; // +0x138 position in file - AnimationData() { for (int& v : layerMap) v = -1; } -}; - -struct LayerInfo { // 0x38, ctor 0x40d140 - int id = 0; // +0x00 - int spritesheetId = -1; // +0x04 - std::string name; // +0x08 - std::string spritesheetPath; // +0x20 resolved, relative to the .anm2's directory -}; - -// AnmCache entry (map node + 0x14). Sprites borrow pointers into this. -struct AnmData { - std::vector layers; // +0x04 / +0x08 - std::vector animations; // +0x0c / +0x10 - std::vector nullNames; // +0x14 / +0x18 - std::vector eventNames; // +0x1c / +0x20 - std::string defaultAnimation; // +0x24 -}; - -// AnmCache::LoadFile @0x40ed50 minus the file I/O. `path` is only used for messages and for -// resolving spritesheet paths. Returns false only if the XML is unusable (the original crashes on -// a missing required element; see anm2.cpp). -bool ParseAnm2(const std::string& path, const std::string& xmlText, AnmData& out); -bool LoadAnm2File(const std::string& path, AnmData& out); - -// Load-time baking helpers (exposed for testing). -void InterpolateLayerFrames(std::vector& frames); // 0x415170 -void InterpolateNullFrames(std::vector& frames); // 0x414e00 -float LerpAngleDeg(float a, float b, float t); // 0x6828b0 -Color LerpColor(const Color& a, const Color& b, float t); // 0x6832e0 -void MulColor(Color& self, const Color& other); // 0x6831c0 - -// --------------------------------------------------------------------------------------------- -// Runtime -// --------------------------------------------------------------------------------------------- -class Sprite; - -// AnimationState, 0x20 bytes. Sprite has two: main @+0x30 and overlay @+0x50. -class AnimationState { -public: - explicit AnimationState(Sprite* owner) : owner_(owner) {} - - void SetAnimationData(const AnimationData* a); // 0x408830 (hard reset) - void ChangeAnimationKeepFrame(const AnimationData* a); // 0x408970 - void Rewind(); // 0x40a1b0 - void Update(); // 0x409030 - void AdvancePosition(int targetFrame); // 0x408d00 - void SetFrame(float frame); // 0x408e00 - void SetLayerFrame(int layerId, int frame); // 0x408ef0 - void SetNullLayerFrame(int nullAnimIdx, int frame); // 0x408fc0 - - bool IsEventTriggered(const char* name) const; // 0x40add0 - bool WasEventTriggered(const char* name) const; // 0x40ae70 - int NextEventTrigger(const char* name) const; // 0x40af10 - - const AnimationFrame* GetLayerFrame(int layerId) const; // 0x40a220 - const NullFrame* GetNullFrameByID(int nullId) const; // 0x40ac70 - const NullFrame* GetNullFrame(const char* name) const; // 0x40ace0 - - const AnimationData* anim() const { return anim_; } - float frame() const { return frame_; } - bool playing() const { return playing_; } - void setPlaying(bool p) { playing_ = p; } - uint32_t eventsThisUpdate() const { return eventsThisUpdate_; } - uint32_t eventsSinceStart() const { return eventsSinceStart_; } - int layerFrameIndex(int layerAnimIdx) const { return layerFrameIdx_[layerAnimIdx]; } - -private: - void FireTriggersAtCurrentFrame(); // 0x408c90 - void AdvanceLayerPosition(int layerAnimIdx, float t); // 0x408b90 - void AdvanceNullLayerPosition(int nullAnimIdx, float t);// 0x408c10 - int FindEvent(const char* name) const; - - Sprite* owner_; // +0x00 - const AnimationData* anim_ = nullptr; // +0x04 - std::vector layerFrameIdx_; // +0x08 - std::vector nullFrameIdx_; // +0x0c - float frame_ = -1.0f; // +0x10 - bool playing_ = false; // +0x14 - uint32_t eventsThisUpdate_ = 0; // +0x18 IsEventTriggered - uint32_t eventsSinceStart_ = 0; // +0x1c WasEventTriggered -}; - -// ANM2 ("Sprite" in Lua), 0x114 bytes. Only the animation-relevant fields are reproduced. -class Sprite { -public: - Sprite() : main_(this), overlay_(this) {} - - void Load(const AnmData* data); // ANM2::Load 0x40bd50 + AnmCache::Load 0x40db90 (data part) - void Reset(); // 0x407f10 (animation part) - void Update(); // 0x409100 - - void Play(const char* name, bool force = false); // 0x40a380 - void PlayRandom(uint32_t seed); // 0x40a2b0 - void PlayIndex(int index); // 0x40a400 - bool SetAnimation(const char* name, bool reset = true); // 0x40a5d0 - void SetFrame(const char* name, int frame); // 0x40a6e0 - void SetFrame(float frame); // 0x40a740 (Lua SetFrame_1 converts int->float) - void SetLastFrame(); // 0x40a760 - int GetFrame() const; // 0x40a780 - void Stop(); // 0x40a910 - bool IsPlaying(const char* name = "") const; // 0x40a4d0 - bool IsFinished(const char* name = "") const; // 0x40a550 - bool IsEventTriggered(const char* name) const; // 0x40b030 - bool WasEventTriggered(const char* name) const; // 0x40b090 - void SetLayerFrame(int layerId, int frame); // 0x40a7e0 - - void PlayOverlay(const char* name, bool force = false); // 0x40a940 - bool SetOverlayAnimation(const char* name, bool reset = true);// 0x40aaf0 - void SetOverlayFrame(const char* name, int frame); // 0x40abf0 - void SetOverlayFrame(int frame); // 0x40ac30 - int GetOverlayFrame() const; // 0x40ac50 - void StopOverlay(); // 0x40a9c0 - void RemoveOverlay(); // 0x40ac60 - bool IsOverlayPlaying(const char* name = "") const; // 0x40a9f0 - bool IsOverlayFinished(const char* name = "") const; // 0x40aa70 - - float playbackSpeed = 1.0f; // +0x104 - bool overlayRenderFirst = false; // +0x70 - - AnimationState& main() { return main_; } - AnimationState& overlay() { return overlay_; } - const AnmData* data() const { return data_; } - -private: - friend class AnimationState; - const AnimationData* FindAnimation(const char* name) const; - - AnimationState main_, overlay_; // +0x30, +0x50 - const AnmData* data_ = nullptr; // stands in for the borrowed +0x74..+0x90 pointers - bool loaded_ = false; // +0x109 -}; - -} // namespace anm2 diff --git a/src/anm2/docs/cache_load_decomp.md b/src/anm2/docs/cache_load_decomp.md deleted file mode 100644 index 8183d41..0000000 --- a/src/anm2/docs/cache_load_decomp.md +++ /dev/null @@ -1,635 +0,0 @@ -# AnmCache + ANM2 (Sprite) lifecycle — isaac-ng.exe (Repentance+ 1.9.7.17) - -All addresses are VA (ImageBase 0x400000). "Confirmed" means read directly from asm; "guess" marks naming/semantics -I inferred but did not prove. The XML parser itself (0x40ed50) is out of scope; only its interface is given. - -Note: several labels in labels.json are misleading. `lua_Load`, `lua_Reload`, `lua_Reset`, `lua_ReplaceSpritesheet`, -`lua_LoadGraphics` are **native ANM2 member functions**. The Sprite Lua table (0x867200..) points straight at them, and they -have hundreds of native callers (Load 0x40bd50 has 369 call sites). - ---------------------------------------------------------------------------------------------------------------------- -## 0. Helpers referenced - -| addr | meaning | -|---|---| -| 0xa159d0 | `uint32 HashPath(const char* s /*ecx*/)`: djb2, case-folded and slash-normalised (below) | -| 0xa68490 | `uint64 GetTimeNs()` = QPC / QPF * 1e9 (constant at 0xbaa8b0 = 1e9) | -| 0xa16060 | `std::vector FileSystem::GetMountPrefixes()` (below) | -| 0xa17180 | `char* FileSystem::ResolvePath(const char*)` (this = 0xc379e0). Returns a heap string or NULL | -| 0x40ccd0 | `std::string::assign(const char*, size_t)` | -| 0x40cf50 | `std::string` copy-ctor | -| 0x40d040 | `std::string` dtor (0x40bf20 is a jmp thunk to it) | -| 0x40cae0 | `bool StrEqual(const char* a/*ecx*/, size_t la/*edx*/, const char* b, size_t lb)` | -| 0xa0f4e0 | tracked `operator new(size /*ecx*/)` | -| 0xa648b0 | tracked alloc/free: `fastcall(bool isFree /*cl*/, void* p /*edx*/, size_t sz, int 0)` | -| 0xaef5c4 / 0xaef638 | MSVC `eh vector constructor iterator` / `eh vector destructor iterator` | -| 0xaef15c | sized `operator delete(p, size)` | -| 0x416490 | `std::map::_Find_lower_bound` for g_AnmCache.files | -| 0x416440 | same, for g_AnmCache.textures | -| 0x414500 | `files.operator[](key)`: returns `&node->value` (node+0x14). Calls try_emplace 0x4158b0 | -| 0x414440 | `textures.operator[](key)` | -| 0x415d20 / 0x414d60 | `files.erase(node)` / `textures.erase(it)` | -| 0x414a80 | map iterator `operator++` | - -**Tracked free.** Every block has its size at `p-4`. Freeing does -`MemStats* s = g_memStats(0xc7de78) ? g_memStats+0x30 : &g_fallbackStat(0xc7f618); s->bytes(u64) -= *(u32*)(p-4); free(p-4);`. - -```cpp -uint32 HashPath(const char* s) { // 0xa159d0 - if (!s) return 0; - uint32 h = 5381; - for (; *s; ++s) { - uint8 c = *s; - if ((uint8)(c - 'A') <= 25) c += 0x20; // tolower (ASCII only) - if (c == '\\') c = '/'; - h = h * 33 + c; - } - return h; -} - -std::vector FileSystem::GetMountPrefixes() { // 0xa16060 (static, sret) - std::vector v; - // g_FileSystem(0xc379e0)+8 : std::vector mounts (begin 0xc379e8, end 0xc379ec) - for (int i = mounts.size() - 1; i >= 0; --i) { // NOTE: reverse order (last-mounted first) - strncmp(mounts[i]->name, "", 0); // dead call, result ignored (literal in binary) - v.push_back(mounts[i]->name /* Mount+0xc, const char* */); - } - return v; -} -``` - ---------------------------------------------------------------------------------------------------------------------- -## 1. AnmCache - -### 1.1 Globals (one static "AnmCache" object, dtor at 0x40d240, static init 0x401140) - -| addr | type | name | -|---|---|---| -| 0xc78ee0 | `std::map` (`_Myhead` @0xc78ee0, `_Mysize` @0xc78ee4) | `g_AnmCache.files` | -| 0xc78ee8 | `std::map` (head/size; node size 0x1c) | `g_AnmCache.textures` | -| 0xc798b8 | `std::vector` (begin/end/cap @ b8/bc/c0) | `s_mountPrefixes` (filled lazily) | -| 0xc79c40 | `uint64` | `s_totalAnm2LoadMs` | -| 0xc78da4 | `std::vector` (begin/end/cap @ a4/a8/ac) | heap-sprite pool, deleted in ~AnmCache. One push site at 0x960c97, which also stores to 0xc72214 | - -The map comparator is plain `uint32 <`. MSVC tree node: left@0, parent@4, right@8, color@0xc, isnil@0xd, value@0x10. - -### 1.2 `files` node layout (node size 0x54, confirmed by try_emplace 0x4158b0 init and erase `delete(node,0x54)`) - -``` -node+0x10 uint32 key // HashPath(prefix + path) -node+0x14 AnmFileData data (0x3c bytes) ─┐ -node+0x50 int refCount ─┘ value = {data, refCount} (0x40 bytes) -``` - -`AnmFileData` (offsets relative to data = node+0x14; ANM2 copy targets in the right column): - -| off | type | meaning | copied to ANM2 | -|---|---|---|---| -| +0x00 | bool | `needsReload`(?) flag. try_emplace and ParseAnm2 only ever write 0. Load re-parses if it is set and the file resolves. I never saw it set to 1 (**uncertain**) | – | -| +0x04 | LayerInfo* (count-prefixed new[], stride 0x38) | layers | ANM2 builds LayerState[] from it | -| +0x08 | uint | layerCount | +0x80 | -| +0x0c | AnimationData* (new[], stride 0x13c) | animations | +0x74 | -| +0x10 | uint | animationCount | +0x78 | -| +0x14 | std::string* (new[], stride 0x18) | null names | +0x84 | -| +0x18 | uint | nullCount | +0x88 | -| +0x1c | std::string* (new[], stride 0x18) | event names | +0x8c | -| +0x20 | uint | eventCount | +0x90 | -| +0x24 | std::string | default animation name | +0x18 (assign) | - -`LayerInfo` (0x38). Its dtor 0x40db70 destroys strings at +8 and +0x20. -`+0x00 int`, `+0x04 int` (probably layerId and spritesheetId; the parser agent should confirm), `+0x08 std::string name`, -`+0x20 std::string spritesheetPath` (fully resolved image path that LayerState copies). - -`AnimationData` (0x13c) begins with `+0x00 std::string name`. Its new[] dtor is just the string dtor. Other fields are as -in CONTEXT.md (+0x18 layerAnims, +0x1c count, +0x20 nullAnims, +0x24 count, +0x28 triggers, +0x2c count, +0x30 -FrameNum, +0x34 Loop, +0x38 int layerIdToLayerAnimIdx[]). - -### 1.3 Cache key: how a path is looked up (identical loop in Load / AddRef / RemoveRef / Preload / texture Has / Release) - -```cpp -static bool FindEntry(const char* path, Node*& out, uint32& keyOut) { - if (s_mountPrefixes.size() < 1) // lazy init - s_mountPrefixes = FileSystem::GetMountPrefixes(); // move-assign (0x4149d0 = vector dtor) - out = files.head; keyOut = 0; - for (const char* prefix : s_mountPrefixes) { - char buf[256]; - strncpy_s(buf, 256, prefix, 256); - strcat_s (buf, 256, path); - keyOut = HashPath(buf); - Node* n = files.lower_bound(keyOut); - out = (n != head && !(keyOut < n->key)) ? n : head; - if (out != head) break; // first prefix that hits wins - } - return out != head; -} -``` -- The key is **djb2(lowercase, '\\'→'/', mountPrefix + path)**. Nothing is appended. -- If nothing matches, `keyOut` is the hash for the **last** prefix tried. That is mount[0], the first-mounted one, - because GetMountPrefixes reverses the list. That is the key a newly parsed file is stored under. -- If there are no mounts at all, keyOut stays 0. ParseAnm2 then substitutes HashPath(path), but Load re-looks up key 0, - so Load reports "failed to load" (edge case, faithful). - -### 1.4 `void AnmCache::Load(const std::string& path, ANM2* spr)` — 0x40db90 -Static. Args are on the stack (`ret 8`) and ecx is unused. Callers: ANM2::Load 0x40bd83, ANM2::Reload 0x40beab. - -```cpp -void AnmCache::Load(const std::string& path, ANM2* spr) { - if (path.size() == 0) return; // no timing either - uint64 t0ms = GetTimeNs() / 1000000; - - Node* n; uint32 key; - FindEntry(path.c_str(), n, key); - - char* resolved = FileSystem::ResolvePath(&g_FileSystem /*0xc379e0*/, path.c_str()); - if (n == files.head || (n->data.needsReload && resolved != nullptr)) { - ParseAnm2(&files, path, key); // 0x40ed50, see 1.10 - n = files.lower_bound(key); if (n == head || key < n->key) n = head; - } - if (resolved) TrackedFree(resolved); - - if (n == files.head) { - KAGE_LogMessage(1, "AnmCache failed to load %s\n", path.c_str()); - } else { - AnmFileData& d = n->data; - // --- rebuild per-layer runtime state --- - if (spr->layerStates) delete[] spr->layerStates; // eh-vector-dtor, LayerState::~LayerState 0x407a60 - uint cnt = d.layerCount; - if (cnt) { - spr->layerStates = new LayerState[cnt]; // operator new(cnt*0xa0+4) 0xa0f4e0, count prefix, - // ctor 0x4081d0 per element - for (uint i = 0; i < d.layerCount; ++i) { - spr->layerStates[i].Init(&d.layers[i]); // 0x408310 - spr->layerStates[i].owner = spr; // +4 - } - cnt = d.layerCount; - } - // QUIRK: if cnt==0, layerStates was deleted but NOT nulled (dangling, would double-free on Reset). - spr->layerCount = cnt; // +0x80 - spr->animations = d.animations; // +0x74 (shared, not copied!) - spr->animCount = d.animationCount; // +0x78 - spr->nullNames = d.nullNames; // +0x84 - spr->nullCount = d.nullCount; // +0x88 - spr->eventNames = d.eventNames; // +0x8c - spr->eventCount = d.eventCount; // +0x90 - if (&spr->defaultAnimation != &d.defaultAnimation) - spr->defaultAnimation.assign(d.defaultAnimation); // +0x18 - } - uint64 t1ms = GetTimeNs() / 1000000; - s_totalAnm2LoadMs += t1ms - t0ms; // 0xc79c40 (timing covers cache hits too) -} -``` -The sprite only borrows pointers into the cache entry. The refCount (AddRef/RemoveRef) is what keeps an entry alive -through `Clear()`. - -### 1.5 `void AnmCache::AddRef(const std::string& path)` — 0x40e110 (static, `ret 4`) -```cpp -if (FindEntry(path.c_str(), n, key)) ++n->refCount; // node+0x50 -else KAGE_LogMessage(1, "[warn] AnmCache: cannot add reference to %s\n", path.c_str()); -``` -Callers: ANM2 copy-ctor (0x407866), ANM2::Load, ANM2::Reload. - -### 1.6 `void AnmCache::RemoveRef(const std::string& path)` — 0x40e2b0 (static, `ret 4`) -```cpp -if (FindEntry(path.c_str(), n, key)) { - if (n->refCount == 0) KAGE_LogMessage(0x10, "cannot remove reference at RefCount 0\n"); // level 0x10 = error/assert - if (n->refCount != 0) --n->refCount; -} else KAGE_LogMessage(1, "[warn] AnmCache: cannot remove reference to %s\n", path.c_str()); -``` -Callers: ANM2::Reset 0x407f3d, ANM2::Load 0x40bd60, plus 5 others elsewhere. - -### 1.7 `void AnmCache::Clear()` — 0x40e470 (static) -Removes only unreferenced entries: -```cpp -for (it = files.begin(); it != files.end(); ) { - if (it->refCount == 0) { - KAGE_LogMessage(1, "AnmCache: Clear %u.\n", it->key); - it->data.Clear(); // 0x40d850 - Node* victim = it; ++it; - files.erase(victim); // 0x415d20, then ~string(node+0x38), delete(node,0x54) - } else ++it; -} -``` -Callers: 0x68fd57, 0x8f8c6f, 0x9b248f (level/stage transitions; not identified further). - -### 1.8 `void AnmFileData::Clear()` — 0x40d850 (thiscall, this = node+0x14) -```cpp -delete[] layers; layers = nullptr; layerCount = 0; // eh-vec-dtor 0x40db70, size cnt*0x38+4 -for (uint a = 0; a < animationCount; ++a) { - AnimationData& A = animations[a]; - for (uint i = 0; i < A.layerAnimCount; ++i) TrackedFree(A.layerAnims[i].frames); // +4 - delete[] A.layerAnims; // stride 0x10, trivial dtor 0x40c200 - for (uint i = 0; i < A.nullAnimCount; ++i) TrackedFree(A.nullAnims[i].frames); // +8 - delete[] A.nullAnims; - TrackedFree(A.triggers); // +0x28 -} -delete[] animations; animations = nullptr; animationCount = 0; // dtor = ~string(name) -delete[] nullNames; nullNames = nullptr; nullCount = 0; -delete[] eventNames; eventNames = nullptr; eventCount = 0; -// needsReload (+0) and defaultAnimation (+0x24) are NOT touched here -``` - -### 1.9 `void AnmCache::LogMemoryUsage()` — 0x40d4c0 (static) -Called once, from the stats dump 0x6f4170. That routine is called from 0x9b7680. Just before the call it logs -`"Total entity spawn time: %llu ms"` and `"Total ANM2 loading time: " << s_totalAnm2LoadMs << " ms"` (0x6f4257) through an -ostringstream. -```cpp -uint32 bytes = 0, entries = 0; -for (auto& [key, v] : files) { - const AnmFileData& d = v.data; - bytes += d.animationCount * 0x13c; - for (uint a = 0; a < d.animationCount; ++a) { - const AnimationData& A = d.animations[a]; - bytes += A.layerAnimCount * 0x10; - for (i) bytes += A.layerAnims[i].frameCount * 0x6c; // LayerAnimation+8 - bytes += A.nullAnimCount * 0x10; - for (i) bytes += A.nullAnims[i].frameCount * 0x54; // NullAnimation+0xc - bytes += A.triggerCount * 8; - } - bytes += (d.nullCount + d.eventCount) * 0x18 + d.layerCount * 0x38 + 0x40; // 0x40 = sizeof(value) - ++entries; -} -KAGE_LogMessage(1, "AnmCache memory usage: %u bytes in %u entries.\n", bytes, entries); -``` -(The asm is an SSE4.1 `pmulld` vectorisation of these loops. Sums are 32-bit.) - -### 1.10 `ParseAnm2` interface — 0x40ed50 (decompiled by the other agent) -`void __thiscall AnmCache::ParseFile(std::map* files /*=0xc78ee0*/, const std::string& path, uint32 key)`, `ret 8`. -- It first resolves `path` through `(*(Game**)0xc7169c)+0x2a6c0 -> 0x8f5ad0(&tmpStr, path)` (probably mod-override path - resolution) and opens it with `FileSystem(0xc37a10)::Open(0xa178d0)(resolved, 0)`. On failure it logs - `"ERROR Could not open %s\n"` and returns **without creating an entry**. -- `if (key == 0) key = HashPath(path.c_str());` -- `AnmFileData* d = &files[key]` (operator[] 0x414500, which creates the node with refCount 0). Then `d->Clear(); d->needsReload = 0;` -- It reads the whole file through the file vtable (+4 size, +0x14 read, +0 close/delete) into a NUL-terminated buffer - and runs rapidxml. Then it fills d->layers/+0x8 (0x40f4eb), nulls +0x14/+0x18 (0x40f7fe), events +0x1c/+0x20 - (0x40fb2e), defaultAnimation +0x24 (0x40fbf4), animations +0xc/+0x10 (0x4139de). -- On a re-parse (reload) the refCount is kept, because operator[] returns the existing node. - -### 1.11 Preload — `void AnmCache::Preload(const char* path)` — 0x40ea50 (static, `ret 4`) -Called from the entity-config preloader 0x69ba90 (with the entity's anm2 path at config+0x74). The same routine logs -"Preload sound %d." for sounds. -```cpp -if (!*path) return; -uint32 key; Node* n; -if (!FindEntry(path, n, key)) { - ParseFile(&files, std::string(path), key); - if (!FindEntry-by-key(key, n)) return; // plain lower_bound with the same key -} -for (uint i = 0; i < n->data.layerCount; ++i) { - const char* img = n->data.layers[i].spritesheetPath.c_str(); // LayerInfo+0x20 - if (!TextureCache::Has(img)) { - Graphics_Prepare(*(void**)0xc71678); // 0x6fd350, unidentified (context/manager getter) - TexturePtr t = LoadImage(img); // 0x9588a0(&out, path) - TextureCache::Add(t); // 0x40e520 - } -} -// refCount is NOT incremented by preload -``` - -### 1.12 Texture side of the cache (`textures` map @0xc78ee8; node: key@0x10, TexturePtr@0x14 {obj,ctrl}) -- `bool TextureCache::Has(const char* name)`, 0x40e5d0: FindEntry-style prefix loop, but on `textures`. -- `void TextureCache::Add(TexturePtr t /*by value, 8 bytes*/)`, 0x40e520, `ret 8`: - `if (t) { const char* nm = t->name44 ? t->name44 : (t->name40 ? t->name40 : "unknown"); textures[HashPath(nm)] = t; }`, then releases the by-value arg. - The key here has **no prefix**, so the texture's own name (+0x44) must already contain the mount prefix for Has/Release to match. (Guess.) -- `void TextureCache::Release(const char* name)`, 0x40e740: finds the entry with the prefix loop. If found and - `ctrl==NULL || useCount(u16 @ctrl+4) <= 2` (read under the ctrl+8 lock, vfuncs +0xc lock(-1) / +0x10 unlock), it resets the - pointer (0x40c7f0(0)) and erases the entry. -- `void TextureCache::Purge()`, 0x40e910: the same `<= 2` rule applied to every texture entry. 14 callers. -- `void TextureCache::Preload(const char* name)`, 0x40ea10: `if (!Has(name)) Add(LoadImage(name));` - -`TexturePtr` is a KAGE intrusive/shared smart pointer `{T* obj; RefCtrl* ctrl}`. The ctrl vtable has +4 = TryAddRef, -returning bool, and +0xc = Release, returning true when the object dies. When Release returns true, the global deleter -hook `(*(void(**)(TexturePtr*))0xc7163c)(&sp)` is called. Helpers: copy-ctor 0x40c550, assign 0x40c3b0, dtor 0x40c440, -`reset(raw)` 0x40c7f0 / ctor-from-raw 0x40c4a0 (both allocate a new 0x18-byte ctrl block with vtable 0xb1a6e0). - -### 1.13 `AnmCache::~AnmCache()` — 0x40d240 (this = 0xc78ee0; called from 0x9ab8db and the atexit thunk 0xb1522e) -1. For each `ANM2*` in the pool vector 0xc78da4: inlined `~ANM2` (Reset, free the 4 AnimationState arrays, 2 strings), then `delete(p, 0x114)`. Then the pool is cleared. -2. `data.Clear()` for **every** file entry, with no refcount check. Then the tree is destroyed (0x415ae0) and the head is reset. -3. Every texture pointer is released, the tree is destroyed (0x415800) and the head is reset. - ---------------------------------------------------------------------------------------------------------------------- -## 2. ANM2 (Sprite) — object layout, sizeof = 0x114 - -The size is confirmed by `operator=(ANM2)` using `ret 0x114` (by-value param) and by `delete(p, 0x114)` in 0x40d240. - -| off | type | field | init (ctor+Reset) | source / evidence | -|---|---|---|---|---| -| 0x000 | std::string | filename | "" | Load assigns it. AddRef/RemoveRef receive `this` as `const std::string&`. GetFilename 0x4312e0 copies it | -| 0x018 | std::string | defaultAnimation | "" | GetDefaultAnimationName/GetDefaultAnimation 0x4a5cf0 returns &+0x18 | -| 0x030 | AnimationState (0x20) | main | owner=this | | -| 0x050 | AnimationState (0x20) | overlay | owner=this | RemoveOverlay 0x40ac60 = `overlay.SetAnimationData(nullptr)` | -| 0x070 | bool | overlayRenderFirst | 0 | SetOverlayRenderPriority 0x431300. Render 0x40a0d0 draws the overlay before main if set | -| 0x074 | AnimationData* | animations (borrowed from cache) | 0 | | -| 0x078 | uint | animationCount | 0 | PlayRandom uses `rand % +0x78` | -| 0x07c | LayerState* | layerStates (count-prefixed new[], stride 0xa0) | 0 | | -| 0x080 | uint | layerCount | 0 | GetLayerCount 0x440e40 | -| 0x084 | std::string* | nullNames (borrowed) | 0 | | -| 0x088 | uint | nullCount | 0 | | -| 0x08c | std::string* | eventNames (borrowed) | 0 | | -| 0x090 | uint | eventCount | 0 | | -| 0x094 | Vector (2 floats) | Offset | Vector::Zero (0xc7b640) | Lua Offset: get 0x49cb40 (`&+0x94`), set 0x456340 | -| 0x09c | Vector | Scale | Vector::One (0xc3793c) | Lua Scale: get 0x417200, set 0x420170 | -| 0x0a4 | float | Rotation | 0 | Lua Rotation: get 0x417210, set 0x43ee80 | -| 0x0a8 | ColorMod (0x2c: Tint RGBA, Colorize RGBA, Offset RGB) | Color | {1,1,1,1, 0,0,0,0, 0,0,0} | Lua Color: get 0x407410, set 0x4073d0 | -| 0x0d4 | ColorMod-shaped (0x2c) | **unknown** (second colour) | Reset: {1,1,1,**0**, 0,0,0,0, 0,0,0} (ctor writes alpha 1.0, then Reset overwrites it with 0) | copied/swapped like Color. Not exposed to Lua and not read in 0x409120..0x40a0d0 (**uncertain**) | -| 0x100 | bool | FlipX | 0 | get 0x407420 / set 0x435c60 | -| 0x101 | bool | FlipY | 0 | get 0x407430 / set 0x505b50 | -| 0x104 | float | PlaybackSpeed | 1.0 | get 0x456360 / set 0x440e50 | -| 0x108 | bool | **unknown** | 0 | only copied/swapped/reset in this module | -| 0x109 | bool | loaded | 0 | IsLoaded 0x420160. Render returns early if 0 | -| 0x10c | int | shadowLayerIndex | -1 | set by Load to the layer named exactly "shadow" (last match wins) | -| 0x110 | uint32 | renderFlags | 0 | OR-ed with LayerState+0x8c at render time (0x4091eb, 0x409a63, 0x409cc0). Load sets 0x400 if any layer name starts with '*' and 0x800 if any null name starts with '*'. At render, bit 4 means "draw only if debug global 0xc7977e", bit 2 is some crop/clip path | - -### 2.1 AnimationState (0x20) — confirmed -``` -+0x00 ANM2* owner -+0x04 AnimationData* anim -+0x08 int* layerFrameIdx (anim->layerAnimCount entries) -+0x0c int* nullFrameIdx (anim->nullAnimCount entries) -+0x10 float frame (-1.0f after SetAnimationData) -+0x14 bool playing -+0x18 u32 eventsThisUpdate -+0x1c u32 eventsSinceStart -``` - -### 2.2 LayerState (0xa0) — per layer, in ANM2+0x7c - -| off | type | field (name = guess unless noted) | Init(LayerInfo*) 0x408310 value | -|---|---|---|---| -| 0x00 | const LayerInfo* | info (cache-owned; name = info+8) | arg | -| 0x04 | ANM2* | owner (set by the creator) | – | -| 0x08 | std::string | spritesheetPath (confirmed; ReplaceSpritesheet edits it) | info ? info->spritesheetPath(+0x20) : "" | -| 0x20 | u32 x4 | texture sampler/wrap params (two pairs pushed to the texture through vfunc +0x44 and +0x48 in GetTexture) | copy of globals 0xc3799c..0xc379a8 | -| 0x30 | bool | graphicsLoaded (confirmed: LoadGraphics skips if set, ReplaceSpritesheet clears it) | 0 (the dword write clears 0x30..0x33) | -| 0x31 | bool | cleared by LoadGraphics (dirty flag?) | 0 | -| 0x32,0x33 | bool | copied only (flipX/flipY?) | 0 | -| 0x34 | Vector | size/scale | Vector::One | -| 0x3c | float | rotation | 0 | -| 0x40 | Vector | position/offset | Vector::Zero | -| 0x48 | ColorMod (0x2c) | color | default ColorMod | -| 0x74 | bool | visible | 1 | -| 0x78 | int | blend: mode/flags | 0 | -| 0x7c | int | blend: RGB src factor | `(g_0xc798e4 & 4) ? 1 : 6` (ONE if premultiplied, else SRC_ALPHA) | -| 0x80 | int | blend: RGB dst factor | 7 (ONE_MINUS_SRC_ALPHA) | -| 0x84 | int | blend: alpha src | 1 | -| 0x88 | int | blend: alpha dst | 7 | -| 0x8c | u32 | renderFlags (OR-ed with ANM2+0x110). '*'-prefixed layers get `|= 5` | 0 | -| 0x90 | Vector | crop offset? | Vector::Zero | -| 0x98 | TexturePtr {obj @0x98, ctrl @0x9c} | spritesheet texture (confirmed) | reset(nullptr) | - -LayerState functions: -- ctor 0x4081d0: zeroes the string and the fields listed, uses the same defaults, then `Init(nullptr)`. -- dtor 0x407a60: releases the TexturePtr at +0x98 and destroys the string at +8. It does **not** call TextureCache::Release. -- `TexturePtr GetTexture() const`, 0x408590 (sret): if a texture is present, it pushes +0x20/+0x24 to `tex->vfunc[0x44]` - when they differ from tex+0x30/+0x34, and +0x28/+0x2c to `tex->vfunc[0x48]` when they differ from tex+0x38/+0x3c. Then it - returns a copy. -- `void SetTexture(TexturePtr t /*by value*/)`, 0x408640: `if (t) memcpy(&+0x20, t.obj+0x30, 16); texture = t;` - ---------------------------------------------------------------------------------------------------------------------- -## 3. ANM2 lifecycle — pseudocode - -### 3.1 ctor `ANM2::ANM2()` — 0x4074c0 (170 callers) -```cpp -ANM2::ANM2() { - filename = ""; defaultAnimation = ""; - main.owner = this; main.layerFrameIdx = main.nullFrameIdx = nullptr; main.SetAnimationData(nullptr); - overlay.owner = this; overlay.layerFrameIdx = overlay.nullFrameIdx = nullptr; overlay.SetAnimationData(nullptr); - offset = {0,0}; /* +0x94/+0x98 */ scale(+0x9c/+0xa0) = {0,0}; // overwritten by Reset - color(+0xa8) = ColorMod{1,1,1,1, 0,0,0,0, 0,0,0}; - color2(+0xd4) = ColorMod{1,1,1,1, 0,0,0,0, 0,0,0}; - layerStates = nullptr; // +0x7c - Reset(); // 0x407f10 sets the real defaults -} -``` - -### 3.2 `void ANM2::Reset()` — 0x407f10 (Lua `Sprite:Reset`, also used by the dtor and operator=) -```cpp -void ANM2::Reset() { - if (filename.size()) AnmCache::RemoveRef(filename); - filename.clear(); - main.SetAnimationData(nullptr); - overlay.SetAnimationData(nullptr); - defaultAnimation.clear(); - animations = nullptr; animationCount = 0; - delete[] layerStates; layerStates = nullptr; layerCount = 0; // ~LayerState each - nullNames = nullptr; nullCount = 0; eventNames = nullptr; eventCount = 0; - offset = Vector::Zero; // 0xc7b640 - scale = Vector::One; // 0xc3793c - rotation = 0.0f; - color = ColorMod{1,1,1,1, 0,0,0,0, 0,0,0}; - color2 = ColorMod{1,1,1,0, 0,0,0,0, 0,0,0}; // note alpha 0 (literal) - flipX = flipY = false; // word write at +0x100 - playbackSpeed = 1.0f; - unk108 = false; loaded = false; // word write at +0x108 - overlayRenderFirst = false; // +0x70 - shadowLayerIndex = -1; - renderFlags = 0; -} -``` - -### 3.3 dtor `ANM2::~ANM2()` — 0x408170 (also used by many EH unwind funclets) -```cpp -ANM2::~ANM2() { Reset(); overlay.~AnimationState(); main.~AnimationState(); defaultAnimation.~string(); filename.~string(); } -``` - -### 3.4 copy-ctor `ANM2::ANM2(const ANM2& o)` — 0x407690 (`ret 4`, 40 callers) -```cpp -ANM2::ANM2(const ANM2& o) - : filename(o.filename), defaultAnimation(o.defaultAnimation), - main(this, o.main), overlay(this, o.overlay) // AnimationState copy 0x4086e0 -{ - overlayRenderFirst = o.overlayRenderFirst; - animations = o.animations; animationCount = o.animationCount; - layerStates = nullptr; - layerCount = o.layerCount; nullNames = o.nullNames; nullCount = o.nullCount; - eventNames = o.eventNames; eventCount = o.eventCount; - offset = {0,0}; // QUIRK: Offset is NOT copied (literal zero stores at 0x407767/0x407771) - scale = o.scale; rotation = o.rotation; - color = o.color; color2 = o.color2; - flipX = o.flipX; flipY = o.flipY; playbackSpeed = o.playbackSpeed; - unk108 = o.unk108; loaded = o.loaded; shadowLayerIndex = o.shadowLayerIndex; - renderFlags = 0; // QUIRK: not copied - if (loaded) AnmCache::AddRef(filename); - - layerStates = new LayerState[o.layerCount]; // ctor 0x4081d0 each - for (uint i = 0; i < o.layerCount; ++i) { - LayerState& d = layerStates[i]; const LayerState& s = o.layerStates[i]; - d.info = s.info; - d.spritesheetPath = s.spritesheetPath; - d.texture = s.GetTexture(); // 0x408590 + assign 0x40c3b0 - d.b30 = s.b30; d.b31 = s.b31; d.b32 = s.b32; d.b33 = s.b33; - d.size = s.size; d.rotation = s.rotation; d.pos = s.pos; // +0x34..+0x44 - d.color = s.color; // +0x48 (0x2c) - d.visible = s.visible; // +0x74 - memcpy(&d.blendMode, &s.blendMode, 0x1c); // +0x78..+0x94 (blend x5, flags, crop vector) - d.owner = this; - // +0x20..+0x2c sampler params keep the Init(nullptr) defaults - } -} -``` -`AnimationState::AnimationState(ANM2* owner, const AnimationState& s)`, 0x4086e0, `ret 8`: copies anim and makes a deep copy -of both index arrays (`operator new(count*4)`, memcpy) using `anim->layerAnimCount/nullAnimCount`. Then it copies frame, -playing and both masks. - -### 3.5 `ANM2& ANM2::operator=(ANM2 tmp /*by value*/)` — 0x407e90 (`ret 0x114`, copy-and-swap) -```cpp -ANM2& ANM2::operator=(ANM2 tmp) { swap(*this, tmp); /* inline ~ANM2(tmp) */ tmp.Reset(); ...; return *this; } -``` -`void swap(ANM2& a /*ecx*/, ANM2& b /*edx*/)`, 0x407ae0, fastcall. It swaps: -filename, defaultAnimation (raw 0x18-byte swap), main and overlay **except owner** (+4..+0x1c), +0x74..+0x90, -scale, rotation, color, color2, flipX, flipY, playbackSpeed, +0x108, loaded, shadowLayerIndex, renderFlags. -It does **not** swap +0x70 (overlayRenderFirst) or +0x94 (Offset). Afterwards it re-points `layerStates[i].owner` -in both objects. Net effect of `a = b`: `a` keeps its own Offset and overlayRenderFirst, and its renderFlags become 0 -(from the copy-ctor). - -### 3.6 `void ANM2::Load(const std::string& path, bool loadGraphics)` — 0x40bd50 (`ret 8`) -```cpp -void ANM2::Load(const std::string& path, bool loadGraphics) { - if (filename.size()) AnmCache::RemoveRef(filename); - if (this != (ANM2*)&path) filename.assign(path); - AnmCache::Load(path, this); // fills animations/layerStates/... (see 1.4) - AnmCache::AddRef(path); - if (loadGraphics) LoadGraphics(); - main.SetAnimationData(nullptr); - overlay.SetAnimationData(nullptr); - loaded = true; // QUIRK: set even when the cache load failed - shadowLayerIndex = -1; - for (uint i = 0; i < layerCount; ++i) { - const char* nm = layerStates[i].info ? layerStates[i].info->name.c_str() : ""; - if (strcmp(nm, "shadow") == 0) shadowLayerIndex = i; - else if (nm[0] == '*') { layerStates[i].renderFlags |= 5; renderFlags |= 0x400; } - } - for (uint i = 0; i < nullCount; ++i) - if (nullNames[i].c_str()[0] == '*') renderFlags |= 0x800; -} -``` -(The AnimationStates are reset only **after** AnmCache::Load has replaced `animations`. Before that they briefly hold -pointers into the old data.) - -### 3.7 `void ANM2::Reload()` — 0x40bea0 (Lua only; no native callers) -```cpp -void ANM2::Reload() { - if (filename.size()) { - AnmCache::Load(filename, this); - AnmCache::AddRef(filename); // QUIRK: no matching RemoveRef, so each Reload leaks one ref - LoadGraphics(); - } - // anim states, loaded flag and shadow index are NOT touched -} -``` - -### 3.8 `bool ANM2::ReplaceSpritesheet(int layer, const std::string& path)` — 0x40bf30 (`ret 8`) -```cpp -bool ANM2::ReplaceSpritesheet(int layer, const std::string& path) { - if (layer < 0 || layer >= (int)layerCount) return false; - LayerState& ls = layerStates[layer]; - if (StrEqual(ls.spritesheetPath, path)) return false; // unchanged - ls.spritesheetPath = path; - ls.graphicsLoaded = false; // +0x30 - return true; // texture loads on the next LoadGraphics() -} -``` - -### 3.9 `void ANM2::LoadGraphics(/*unused 4-byte arg*/)` — 0x40c000 (`ret 4`; 0x40bff0 is the Lua/zero-arg thunk that pushes garbage) -```cpp -void ANM2::LoadGraphics() { - for (uint i = 0; i < layerCount; ++i) { - LayerState& ls = layerStates[i]; - if (ls.graphicsLoaded) continue; - TexturePtr tex = LoadImage(ls.spritesheetPath.c_str()); // 0x9588a0(&tex, path) - bool ok = tex.obj && tex.obj->vfunc0(); // IsValid/IsLoaded - if (ok) TextureCache::Add(tex); // 0x40e520 (by-value copy) - TexturePtr old = ls.GetTexture(); // 0x408590 - if (old.obj) { - const char* oldName = old.obj->name44; // tex+0x44 - ls.SetTexture(TexturePtr(nullptr)); // 0x40c4a0 + 0x408640 - TextureCache::Release(oldName); // 0x40e740 (evicts if useCount <= 2) - } - ls.SetTexture(tex); // set even if !ok - ls.graphicsLoaded = ok; // +0x30 - ls.b31 = false; // +0x31 - } -} -``` - ---------------------------------------------------------------------------------------------------------------------- -## 4. AnimationState: what happens when an animation is set - -### 4.1 `void AnimationState::SetAnimationData(AnimationData* a)` — 0x408830 (`ret 4`; ~60 callers) -Used by Reset, Load, RemoveOverlay, and SetAnimation(name, reset=true). -```cpp -void AnimationState::SetAnimationData(AnimationData* a) { - anim = a; - if (layerFrameIdx) { KageFree(layerFrameIdx); layerFrameIdx = nullptr; } // 0xa648b0(cl=1) - if (nullFrameIdx) { KageFree(nullFrameIdx); nullFrameIdx = nullptr; } - if (anim) { - if (anim->layerAnimCount) { // +0x1c - layerFrameIdx = (int*)KageAlloc(anim->layerAnimCount * 4); // 0xa648b0(cl=0) - memset(layerFrameIdx, 0xFF, anim->layerAnimCount * 4); // all -1 - } - if (anim->nullAnimCount) { // +0x24 (only checked if anim != null) - nullFrameIdx = (int*)KageAlloc(anim->nullAnimCount * 4); - memset(nullFrameIdx, 0xFF, anim->nullAnimCount * 4); - } - } - frame = -1.0f; playing = false; eventsThisUpdate = 0; eventsSinceStart = 0; -} -``` -The arrays are sized by the **animation's** layer-animation and null-animation counts, not by the sprite's -layer/null counts. Rendering maps sprite layer id → layer-anim index through `anim->layerIdToLayerAnimIdx[id]` (+0x38). - -### 4.2 `void AnimationState::ChangeAnimationKeepFrame(AnimationData* a)` — 0x408970 (`ret 4`) -Used by SetAnimation(name, reset=false) 0x40a678 and by SetOverlayAnimation 0x40ab98. -```cpp -void AnimationState::ChangeAnimationKeepFrame(AnimationData* a) { - int oldL = anim ? anim->layerAnimCount : 0, newL = a ? a->layerAnimCount : 0; - int oldN = anim ? anim->nullAnimCount : 0, newN = a ? a->nullAnimCount : 0; - if (oldL != newL) { - if (newL <= 0) { if (layerFrameIdx) { KageFree(layerFrameIdx); layerFrameIdx = nullptr; } } - else { - int* p = (int*)KageAlloc(newL * 4); memset(p, 0xFF, newL * 4); - if (oldL > 0) memcpy(p, layerFrameIdx, oldL * 4); // QUIRK: copies OLD count, overflows if oldL > newL - if (layerFrameIdx) TrackedFree(layerFrameIdx); - layerFrameIdx = p; - } - } - if (oldN != newN) { - if (newN <= 0) { if (nullFrameIdx) { KageFree(nullFrameIdx); nullFrameIdx = nullptr; } } - else { - int* p = (int*)KageAlloc(newN * 4); memset(p, 0xFF, newN * 4); - if (oldN > 0) memcpy(p, nullFrameIdx, oldN * 4); - if (nullFrameIdx) { TrackedFree(nullFrameIdx); nullFrameIdx = nullptr; } - layerFrameIdx = p; // !!! BUG IN BINARY (0x408b6a): the new NULL array is stored into - // layerFrameIdx (leaking the layer array). nullFrameIdx ends NULL. - } - } - anim = a; // frame / playing / event masks are preserved -} -``` -(Re-check 0x408b63..0x408b6d if you doubt this. The store really is `mov [esi+8], ebx`.) - -### 4.3 Callers that select an animation -- `bool ANM2::SetAnimation(const char* name, bool reset)`, 0x40a5d0 (`ret 8`). The Lua wrapper 0x40a5b0 takes a std::string. - It does a linear `strcmp` over `animations[0..animationCount)` on `AnimationData::name` (+0). If nothing matches it logs - `"[warn] no animation named %s\n"` and returns false. Otherwise it calls - `reset ? main.SetAnimationData(&animations[i]) : main.ChangeAnimationKeepFrame(&animations[i])` and returns true. - SetOverlayAnimation 0x40aaf0 does the same on `overlay`. -- `void ANM2::Play(const char* name, bool force)`, 0x40a380 (Lua 0x40a360): - `if (force || !main.anim || strcmp(main.anim->name, name) || (!main.anim->loop && !main.playing)) { if (SetAnimation(name, true)) { main.Rewind(); main.playing = true; } }` - PlayRandom 0x40a2b0 (`animations[seed % animationCount]`) and the index variant 0x40a400 (`"[warn] Animation index out of range!"`) follow the same pattern. -- `void AnimationState::Rewind()`, 0x40a1b0: - `frame = 0; eventsThisUpdate = eventsSinceStart = 0; FireTriggersAtCurrentFrame(); fill layerFrameIdx[0..layerAnimCount) and nullFrameIdx[0..nullAnimCount) with 0;` -- `Stop` 0x40a910: `if (main.anim) main.playing = false;` - ---------------------------------------------------------------------------------------------------------------------- -## 5. Open questions / uncertainty -1. `AnmFileData+0 needsReload`: the only writes I found set it to 0 (node creation, ParseAnm2). It may be set elsewhere, - for example when a mod is toggled. I did not scan the whole binary for byte writes to node+0x14. -2. ANM2 +0xd4 (0x2c-byte colour struct whose Reset alpha is 0) and +0x108 (bool): purpose unknown. Neither is read in the - 0x401000..0x41d000 module. Look at entity render code outside it. -3. LayerState +0x20..+0x2c (texture param pairs), +0x31..+0x33, +0x78..+0x94: names are guesses from defaults and the - Repentance+ LayerState API (blend factors 1/6/7 match GL enum ordinals ONE/SRC_ALPHA/ONE_MINUS_SRC_ALPHA). -4. LayerInfo +0/+4 ints: likely layerId and spritesheetId. The parser decomp should confirm. -5. TextureCache key mismatch: Add uses the unprefixed `tex->name`, while Has/Release use `prefix+name`. This only works if - the texture name already includes the mount prefix (not verified). -6. Mount prefix strings come from `Mount+0xc` in FileSystem 0xc379e0+8. Their actual values (e.g. "resources/") were not - observed at runtime. diff --git a/src/anm2/docs/labels_isaac-ng_v1.9.7.17.json b/src/anm2/docs/labels_isaac-ng_v1.9.7.17.json deleted file mode 100644 index 6088fb5..0000000 --- a/src/anm2/docs/labels_isaac-ng_v1.9.7.17.json +++ /dev/null @@ -1,104 +0,0 @@ -{ -"0x407170": "Color::Color()", -"0x4071f0": "Color::operator=(const&)", -"0x4074c0": "ANM2::ANM2", -"0x407690": "ANM2::ANM2(copy)", -"0x407a60": "LayerState::~LayerState", -"0x407ae0": "swap(ANM2&,ANM2&)", -"0x407e90": "ANM2::operator=(ANM2)", -"0x407f10": "ANM2::Reset", -"0x408170": "ANM2::~ANM2", -"0x4081d0": "LayerState::LayerState", -"0x408310": "LayerState::Init(LayerInfo*)", -"0x408590": "LayerState::GetTexture", -"0x408640": "LayerState::SetTexture", -"0x4086e0": "AnimationState::AnimationState(owner,copy)", -"0x4087a0": "AnimationState::~AnimationState", -"0x408830": "AnimationState::SetAnimationData", -"0x408970": "AnimationState::ChangeAnimationKeepFrame", -"0x408b90": "AnimationState::AdvanceLayerPosition(idx,xmm2 frame)", -"0x408c10": "AnimationState::AdvanceNullLayerPosition(idx,xmm2 frame)", -"0x408c90": "AnimationState::FireTriggersAtCurrentFrame", -"0x408d00": "AnimationState::AdvancePosition(int)", -"0x408e00": "AnimationState::SetFrameFloat(xmm1)", -"0x408ef0": "AnimationState::SetLayerFrame(layer,frame)", -"0x408f70": "AnimationState::GetLayerFrameIdx(layer)", -"0x408fc0": "AnimationState::SetNullLayerFrame(null,frame)", -"0x409030": "AnimationState::Update", -"0x409100": "lua_Update", -"0x40a0d0": "lua_Render", -"0x40a140": "lua_RenderLayer", -"0x40a1b0": "AnimationState::Rewind", -"0x40a220": "AnimationState::GetLayerFrame(layer)->AnimationFrame*", -"0x40a2b0": "lua_PlayRandom", -"0x40a360": "lua_Play", -"0x40a380": "ANM2::Play(cstr,force)", -"0x40a4b0": "lua_IsPlaying", -"0x40a530": "lua_IsFinished", -"0x40a5b0": "lua_SetAnimation", -"0x40a5d0": "ANM2::SetAnimation(cstr,reset)", -"0x40a690": "lua_SetFrame", -"0x40a720": "lua_SetFrame_1", -"0x40a760": "lua_SetLastFrame", -"0x40a780": "lua_GetFrame", -"0x40a7e0": "lua_SetLayerFrame", -"0x40a910": "lua_Stop", -"0x40a920": "lua_PlayOverlay", -"0x40a9d0": "lua_IsOverlayPlaying", -"0x40aa50": "lua_IsOverlayFinished", -"0x40aad0": "lua_SetOverlayAnimation", -"0x40abb0": "lua_SetOverlayFrame", -"0x40ac50": "lua_GetOverlayFrame", -"0x40ac60": "lua_RemoveOverlay", -"0x40add0": "AnimationState::IsEventTriggered(name)", -"0x40ae70": "AnimationState::WasEventTriggered(name)", -"0x40af10": "AnimationState::NextEventTrigger(name)", -"0x40b000": "lua_IsEventTriggered", -"0x40b060": "lua_WasEventTriggered", -"0x40bd50": "ANM2::Load(path,loadGraphics)", -"0x40bea0": "ANM2::Reload", -"0x40bec0": "AnimationData::AnimationData()", -"0x40bf30": "ANM2::ReplaceSpritesheet", -"0x40bff0": "lua_LoadGraphics", -"0x40c000": "ANM2::LoadGraphics", -"0x40c1e0": "LayerAnimation::LayerAnimation()", -"0x40c210": "NullAnimation::NullAnimation()", -"0x40ca70": "memcmp_eq(ecx,edx,n)", -"0x40cae0": "str_eq(ecx,edx=len,s2,len2)", -"0x40d140": "LayerInfo::LayerInfo()", -"0x40d240": "AnmCache::~AnmCache", -"0x40d4c0": "AnmCache::LogMemoryUsage", -"0x40d850": "AnmFileData::Clear", -"0x40db90": "AnmCache::Load(path,ANM2*)", -"0x40e110": "AnmCache::AddRef", -"0x40e2b0": "AnmCache::RemoveRef", -"0x40e470": "AnmCache::Clear", -"0x40e520": "TextureCache::Add", -"0x40e5d0": "TextureCache::Has", -"0x40e740": "TextureCache::Release", -"0x40e910": "TextureCache::Purge", -"0x40ea10": "TextureCache::Preload", -"0x40ea50": "AnmCache::Preload", -"0x40ed50": "AnmCache::ParseFile(path,key)", -"0x413bf0": "xml_node::first_attribute(name)", -"0x413c70": "xml_node::first_node(name)", -"0x414e00": "InterpolateNullFrames(ecx=buf,edx=&count,scratch)", -"0x415170": "InterpolateLayerFrames(ecx=buf,edx=&count,scratch)", -"0x440e40": "lua_GetLayerCount", -"0x440e50": "set_PlaybackSpeed", -"0x456360": "get_PlaybackSpeed", -"0x499d20": "fmodf", -"0x4a5cf0": "lua_GetDefaultAnimationName", -"0x67f670": "ResolveRelativePath(out,anmPath,edx=rel)", -"0x6828b0": "LerpAngleDeg(xmm0 a,xmm1 b,xmm2 t)", -"0x6831c0": "Color::operator*=(other)", -"0x6832e0": "Color::Lerp(out,a,b,t)", -"0x85db20": "lua_GetAnimation", -"0x85db70": "lua_GetOverlayAnimation", -"0xa112c0": "KAGE_LogMessage(level,fmt,...)", -"0xa159d0": "HashPath(djb2 lower,/)", -"0xa16060": "FileSystem::GetMountPrefixes", -"0xa17180": "FileSystem::ResolvePath", -"0xa68490": "GetTimeNs", -"0xaf0917": "floor" -} \ No newline at end of file diff --git a/src/anm2/docs/parser_decomp.md b/src/anm2/docs/parser_decomp.md deleted file mode 100644 index 2dc008b..0000000 --- a/src/anm2/docs/parser_decomp.md +++ /dev/null @@ -1,537 +0,0 @@ -# isaac-ng.exe (Repentance+ 1.9.7.17) — ANM2 parser decompilation - -Target: `0x40ed50` (`AnmCache::LoadFile`), the frame-expansion helpers `0x414e00` / `0x415170`, and what they call. -Annotated dumps: `parse.asm` (0x40ed50-0x413b40) and `interp.asm` (0x414e00-0x4155c2). Labels were added to `labels.json`. -Addresses in [brackets] are the evidence for each claim. - ---------------------------------------------------------------------------------------------------- -## 0. Who calls it (load path) - -* `0x40ed50` is `__thiscall` on the global AnmCache map `0xc78ee0`. It takes 2 stack args, `(const std::string& path, uint32 hash)`, and ends with `ret 8`. - If `hash==0`, it is computed as `0xa159d0(path.c_str())` [0x40ee02]. - Callers: - * `0x40ddf9`, inside `AnmCache::Get` `0x40db90`. That function is called from `lua_Load` (0x40bd83) and `lua_Reload` (0x40beab). - It builds the candidate path for each content/mod directory (vector `0xc798b8..0xc798bc`, `strncpy_s`/`strcat_s`), hashes it, and looks it up in the cache map (`0x416490`). - It calls the parser when there is no entry. It also calls it when there is an entry whose byte flag `+0` is set and `0xa17180(path)` returns non-zero (reload). - After that it copies the cache data into the Sprite (0x40de78...). - * `0x40ec3f`, inside `AnmCache::Preload(const char*)` `0x40ea50`. This is the same lookup, done by C-string. -* Flow inside the parser: - 1. `0x8f5ad0` resolves the path. `0xa178d0` opens the file. - On failure it logs `"ERROR Could not open %s\n"` at level 1 and returns [0x40edee]. The cache entry is not touched. - 2. `entry = cacheMap[hash]` (`0x414500` → `0x4158b0`, value at node+0x14). - 3. `entry->Clear()` (`0x40d850`, which frees every array), then `entry->byte0 = 0` [0x40ee25-0x40ee32]. - 4. It reads the whole file into `buf = alloc(size+1)` and adds a NUL. It then runs rapidxml in-situ (doc at ebp-0x26638, `0x413b90` ctor, `0x4155d0` parse). - -XML access is rapidxml: node `+0x18 first_node`, `+0x20 first_attribute`, `+0x2c next_sibling`. -Attributes are `+0 name`, `+4 value`, `+0x10 parent`, `+0x18 next_attribute` (the next attribute is used only when parent != 0). A NULL name or value is read as `""` (0xc71640). -* `0x413c70 = first_node(name)`. It compares sizes, then bytes, and returns 0 if the node is missing. -* `0x413bf0 = first_attribute(name)`. With `name==0` it returns the first attribute. - -**No element is optional.** The code never checks a `first_node` result for NULL. It always reads `[node+0x18]` immediately. -So a missing `AnimatedActor`, `Content`, `Spritesheets`, `Layers`, `Nulls`, `Events`, `Animations`, `RootAnimation`, `LayerAnimations`, `NullAnimations` or `Triggers` crashes with a NULL deref. -The child-name lookups inside `` are inlined loops [0x410261, 0x410e02, 0x4122e3, 0x413472]. Each ends in `xor edi,edi; mov edi,[edi+0x18]`. - -Child elements are **never checked by tag name**. Every child of ``, ``, ``, ``, ``, ``, `` and so on is processed whatever its tag is. -Animations are iterated from `first_node("Animation")` along `next_sibling` [0x40fc0f, 0x4136ab]. Siblings after the first `` are not filtered by name either. -Attribute matching is an exact, case-sensitive `strcmp`. Unknown attributes are ignored. - -### Value converters (inlined everywhere) -* `int`: `atoi(value)`. Unparsable text gives 0. -* `float`: `(float)atof(value)` (`fstp dword`). -* `scale`: `f = (float)atof(v); f = f / 100.0f`. - This is done on x87 as `fld f; fdiv dword 100.0; fstp`. It is bit-identical to a single-precision `f/100.0f`. -* `color`: the same, but `/ 255.0f` (constant 0xbaaae4 = 255.0). This applies to **both tints and offsets**. -* `bool` (Loop, Visible, Interpolated) [0x4100b6-0x410186, 0x411586-0x411602]: - ``` - bool ParseBool(std::string s) { if (s.empty()) return false; - if (s == "true") return true; if (s == "True") return true; return atoi(s.c_str()) != 0; } - ``` - So "1" and "TRUE"-like numbers work, and "false", "FALSE" and "" give false. - ---------------------------------------------------------------------------------------------------- -## 1. Data structures - -### 1.1 Cache entry (`AnmData`, value of the AnmCache map, at map node + 0x14) -| off | type | meaning | -|---|---|---| -| +0x00 | u8 | flag. The parser clears it to 0 [0x40ee32]. The caller reloads when it is set. | -| +0x04 | LayerInfo* | `new[]` with a count cookie at ptr-4 [0x40f3e3-0x40f4eb] | -| +0x08 | int | layerCount [0x40f4f7] | -| +0x0c | AnimationData* | `new[]` with a cookie [0x4136fe-0x4139de] | -| +0x10 | int | animationCount [0x4139e1] | -| +0x14 | std::string* | null names, `new[]` with a cookie. **Only set if nullCount>0** [0x40f7fe] | -| +0x18 | int | nullCount [0x40f813] | -| +0x1c | std::string* | event names, `new[]` with a cookie. **Only set if eventCount>0** [0x40fb2e] | -| +0x20 | int | eventCount [0x40fb46] | -| +0x24 | std::string | DefaultAnimation [0x40fbf4]. Not reset by Clear(), so on a reload without the attribute the old value stays. | - -**The spritesheet table is not stored.** Spritesheet paths live only in a 64-entry local array (ebp-0x16a0) and are copied into each layer (`LayerInfo.+0x20`). -The Sprite object (`+0x80 layerCount`, `+0x8c eventNames`, ... in CONTEXT.md) is a separate object filled from this entry by `0x40db90`. - -### 1.2 LayerInfo (0x38) — ctor `0x40d140` -| off | type | field | -|---|---|---| -| +0x00 | int | Id | -| +0x04 | int | SpritesheetId | -| +0x08 | std::string | Name | -| +0x20 | std::string | resolved spritesheet path (copy of `spritesheetPath[SpritesheetId]`) | - -### 1.3 AnimationData (0x13c) — ctor `0x40bec0` -| off | type | field / ctor default | -|---|---|---| -| +0x000 | std::string | Name | -| +0x018 | LayerAnimation* | `new[]` with a cookie (NULL if 0) | -| +0x01c | int | layerAnimCount | -| +0x020 | NullAnimation* | `new[]` with a cookie (NULL if 0) | -| +0x024 | int | nullAnimCount | -| +0x028 | Trigger* | plain `new` with no cookie (NULL if 0) | -| +0x02c | int | triggerCount | -| +0x030 | int | FrameNum (ctor -1; the parser always writes it, default 0) | -| +0x034 | bool | Loop (default false) | -| +0x038 | int[64] | layerId → layer-animation index (ctor fills with -1, see §2.9) | -| +0x138 | int | index of this animation in file order [0x41022e] | - -There are **no root frames** in AnimationData. RootAnimation is baked into the layer and null frames at load time (§3.3). - -### 1.4 LayerAnimation (0x10) — ctor `0x40c1e0` -| off | type | field / default | -|---|---|---| -| +0x0 | int | LayerId (default -1) | -| +0x4 | AnimationFrame* | frames (plain `new`, NULL if 0 frames) | -| +0x8 | int | frameCount (count *after* expansion and root splitting) | -| +0xc | bool | Visible (default **true**) | - -### 1.5 NullAnimation (0x10) — ctor `0x40c210` (zeroes only +8/+0xc) -| off | type | field / default | -|---|---|---| -| +0x0 | int | NullId (**no default**: stale or uninitialized, see §2.10) | -| +0x4 | bool | Visible (**no default**) | -| +0x8 | NullFrame* | frames (plain `new`, NULL if 0) | -| +0xc | int | frameCount | - -### 1.6 AnimationFrame (0x6c) — ctor inlined [0x40fdfe] -| off | type | XML attr | conversion | -|---|---|---|---| -| +0x00 | float | XCrop | atof | -| +0x04 | float | YCrop | atof | -| +0x08 | float | Width | atof | -| +0x0c | float | Height | atof | -| +0x10 | float | XPosition | atof | -| +0x14 | float | YPosition | atof | -| +0x18 | float | XScale | atof/100 | -| +0x1c | float | YScale | atof/100 | -| +0x20 | float | XPivot | atof | -| +0x24 | float | YPivot | atof | -| +0x28 | int | Delay | atoi (after expansion: 1 for interpolated sub-frames, see §3) | -| +0x2c | bool | Visible | ParseBool | -| +0x30 | Color (0x2c) | | see 1.8 | -| +0x5c | float | Rotation | atof, degrees, no conversion | -| +0x60 | bool | Interpolated | ParseBool | -| +0x64 | int | **startFrame** (inclusive) | computed | -| +0x68 | int | **endFrame** (exclusive; = start of the next frame) | computed | - -**Correction to CONTEXT.md:** `+0x68` is the *end* frame (start + length). -The runtime `AdvanceLayerPosition` 0x408b90 advances while `frame >= (float)frames[idx].end(+0x68)`, so CONTEXT's "cumulative startFrame" is really the end tick. `+0x64` holds the start. - -ctor zeroes +0x00..+0x24 and sets the Color to tint (1,1,1,1) with the rest 0 (`0x407170`), and `+0x60 = 0`. -**+0x28 Delay, +0x2c Visible, +0x5c Rotation, +0x64 and +0x68 are not initialized.** - -### 1.7 NullFrame (0x54) — used for null frames AND root frames; ctor inlined [0x40fc50] -| off | type | XML attr | conversion | -|---|---|---|---| -| +0x00 | float | XPosition | atof | -| +0x04 | float | YPosition | atof | -| +0x08 | int | Delay | atoi | -| +0x0c | bool | Visible | ParseBool | -| +0x10 | float | XScale | atof/100 | -| +0x14 | float | YScale | atof/100 | -| +0x18 | Color (0x2c) | | | -| +0x44 | float | Rotation | atof | -| +0x48 | bool | Interpolated | ParseBool | -| +0x4c | int | startFrame (inclusive) | computed | -| +0x50 | int | endFrame (exclusive) | computed | - -ctor zeroes +0, +4, +0x10, +0x14, runs Color(), and sets +0x48=0. **+0x08, +0x0c, +0x44, +0x4c and +0x50 are uninitialized.** -**Correction to CONTEXT.md:** `+0x50` is the end frame, not the start. `+0x4c` is the start. - -### 1.8 Color (0x2c) — `0x407170` ctor, `0x4071f0` copy -`float tint[4] (RGBA, default 1)`, `float colorize[4] (default 0)`, `float offset[3] (RGB, default 0)`. -* `+0x00..+0x0c` RedTint/GreenTint/BlueTint/AlphaTint, each `/255`. -* `+0x10..+0x1c` colorize. The parser never writes it, so it is always 0. -* `+0x20..+0x28` RedOffset/GreenOffset/BlueOffset, each `/255`. - -So in an AnimationFrame the offsets are at +0x50/+0x54/+0x58. In a NullFrame they are at +0x38/+0x3c/+0x40. - -### 1.9 Trigger (8) -`int EventId (+0)`, `int AtFrame (+4)`. Both use atoi. There are no defaults (see §2.11). - ---------------------------------------------------------------------------------------------------- -## 2. Parser pseudocode (`0x40ed50`) - -```cpp -void AnmCache::LoadFile(const std::string& path, uint32 hash) -{ - std::string resolved = ResolvePath(path); // 0x8f5ad0 - File* f = FileSystem::Open(resolved.c_str(), 0); // 0xa178d0 - if (!f) { KAGE_LogMessage(1, "ERROR Could not open %s\n", path.c_str()); return; } - if (!hash) hash = HashString(path.c_str()); // 0xa159d0 - AnmData& d = s_cache[hash]; d.Clear(); d.flag = 0; - size_t n = f->Size(); char* text = Alloc(n+1); f->Read(text,1,n); text[n]=0; f->Close(1); - rapidxml::xml_document doc; doc.parse(text); - xml_node* actor = doc.first_node("AnimatedActor"); - xml_node* content = actor->first_node("Content"); -``` - -### 2.1 Spritesheets [0x40eec2-0x40f01d] -```cpp - std::string sheetPath[64]; // local only - char pathBuf[260]; // ebp-0x120, NOT cleared between elements - int sheetCount = 0; - for (xml_node* e = content->first_node("Spritesheets")->first_node(); e; e = e->next_sibling()) { - int id = 64; // default = invalid - for (attr a : e->attributes()) { - if (a.name == "Path") ResolveRelativePath(pathBuf, path.c_str(), a.value); // 0x67f670 - else if (a.name == "Id") id = atoi(a.value); - } - if (id >= 64 || id != sheetCount) // signed compare: jge 0x40 / jne - Log(0x10, "%s: invalid spritesheet id %d\n", path.c_str(), id); - sheetPath[id] = pathBuf; // written even when invalid (out-of-bounds if id>=64 or <0) - ++sheetCount; - } -``` -`0x67f670` is not fully reversed. It turns `\` into `/`, splits on `/`, takes the directory of the .anm2 path, appends the relative path and handles `".."` (string 0xb1ceb8), then `strncpy`s up to 0x104 chars into `pathBuf`. -The resulting path is relative to the .anm2 file's directory. -If an element has no Path attribute, the previous element's path is reused because the buffer is stale. An element with no attributes at all also logs "invalid spritesheet id 64". - -### 2.2 Layers [0x40f052-0x40f4f7] -```cpp - LayerInfo layer[64]; int layerCount = 0; - for (e : content->first_node("Layers")->children) { - std::string name; int id = 64; int sheet = -1; - for (a : e->attributes()) { - if (a.name=="Name") name = a.value; - else if (a.name=="Id") id = atoi(a.value); - else if (a.name=="SpritesheetId") sheet = atoi(a.value); - } - if (id >= 64 || id != layerCount) Log(0x10, "%s: invalid layer id %d\n", path, id); - if (sheet < 0 || sheet >= sheetCount) Log(0x10, "%s: invalid spritesheet id %d\n", path, sheet); - layer[id].spritesheetPath = sheetPath[sheet]; // unchecked index (sheet=-1 reads OOB) - layer[id].id = id; layer[id].spritesheetId = sheet; layer[id].name = name; - ++layerCount; - } - if (layerCount == 0) Log(0x10, "%s: no layers\n", path); // only a log, parsing continues - d.layers = new LayerInfo[layerCount]; copy layer[0..layerCount-1]; d.layerCount = layerCount; -``` -An element with no attributes skips straight to the error with id=64 and sheet=-1 [0x40f0b2→0x40f26a]. - -### 2.3 Nulls [0x40f514-0x40f813] -```cpp - std::string nullName[64]; int nullCount = 0; - for (e : content->first_node("Nulls")->children) { - int id = 64; std::string name; - for (a) { if (a.name=="Id") id = atoi(v); else if (a.name=="Name") name = v; } - if (id >= 64 || id != nullCount) Log(0x10, "%s: invalid Null ID %d\n", path, id); - nullName[id] = name; ++nullCount; - } - if (nullCount) d.nullNames = new std::string[nullCount] (copy); d.nullCount = nullCount; -``` - -### 2.4 Events [0x40f839-0x40fb46] — **maximum 16 events** -```cpp - std::string eventName[16]; int eventCount = 0; - for (e : content->first_node("Events")->children) { - int id = 16; std::string name; - for (a) { if (a.name=="Id") id = atoi(v); else if (a.name=="Name") name = v; } - if (id >= 16 || id != eventCount) Log(0x10, "%s: invalid Event ID %d\n", path, id); - eventName[id] = name; ++eventCount; - } - if (eventCount) d.eventNames = new std::string[eventCount]; d.eventCount = eventCount; -``` -Event IDs are 0..15. The runtime 32-bit `bts` masks therefore only ever use bits 0..15. Trigger EventIds are **not** validated against eventCount. - -### 2.5 Animations header [0x40fb5a-0x40fc14] -```cpp - AnimationData anim[256]; // local, ctor 0x40bec0. There is NO "too many animations" check (>256 overflows the stack) - int animCount = 0; - xml_node* anims = actor->first_node("Animations"); - for (a : anims->attributes()) if (a.name=="DefaultAnimation") d.defaultAnimation = a.value; - xml_node* animNode = anims->first_node("Animation"); - // 6 scratch buffers of 5000 frames, allocated ONCE and reused for every animation: - NullFrame* A = new NullFrame[5000]; // ebp-0x26698 root frames - NullFrame* B = new NullFrame[5000]; // ebp-0x26668 scratch for root interpolation - NullFrame* C = new NullFrame[5000]; // ebp-0x2669c null frames - NullFrame* D = new NullFrame[5000]; // ebp-0x26694 scratch / output for nulls - AnimationFrame* E = new AnimationFrame[5000]; // ebp-0x26670 layer frames - AnimationFrame* F = new AnimationFrame[5000]; // ebp-0x2668c scratch / output for layers -``` - -### 2.6 Per animation [0x40ff10-0x410269] -```cpp - for (; animNode; animNode = animNode->next_sibling()) { - std::string name; int frameNum = 0; bool loop = false; - for (a : animNode->attributes()) { - if (a.name=="Name") name = v; - else if (a.name=="FrameNum") frameNum = atoi(v); - else if (a.name=="Loop") loop = ParseBool(v); - } - AnimationData& an = anim[animCount]; an.index(+0x138) = animCount; ++animCount; - an.name = name; an.frameNum = frameNum; an.loop = loop; -``` -FrameNum is only stored. The parser does not use it to clamp or pad frames. - -### 2.7 RootAnimation [0x410261-0x410ddc] -```cpp - xml_node* root = FindChild(animNode, "RootAnimation"); // crash if missing - int rootCount = 0, t = 0; - for (xml_node* fr = root->first_node(); fr; fr = fr->next_sibling()) { - if (rootCount >= 5000) Log(0x10, "%s: too many root frames\n", path); // continues anyway (overflow) - NullFrame& f = A[rootCount++]; - float tint[4] = {1,1,1,1}, off[3] = {0,0,0}; // reset for every frame - for (a : fr->attributes()) switch(name): - XPosition: f.x = atof; YPosition: f.y = atof; Delay: f.delay = atoi; - Visible: f.visible = ParseBool; XScale: f.sx = atof/100; YScale: f.sy = atof/100; - RedTint/GreenTint/BlueTint/AlphaTint: tint[i] = atof/255; - RedOffset/GreenOffset/BlueOffset: off[i] = atof/255; - Rotation: f.rot = atof; Interpolated: f.interp = ParseBool; - f.color.tint = tint; f.color.offset = off; // colorize untouched - f.start = t; f.end = t + f.delay; t = f.end; // [0x410daa] - } - InterpolateNullFrames(A, &rootCount, B); // 0x414e00, result in place in A -``` -**Missing-attribute defaults:** only tint (1) and offset (0) are reset for each frame. Every other field keeps whatever the reused buffer slot held. -For a never-used slot that is: x, y, sx, sy = **0** (so a missing XScale means scale 0), interp=false, and delay, visible and rot uninitialized heap memory. -Otherwise it is the value from a previous animation, or the expanded output that `0x414e00` memcpy'd into that slot. -Real .anm2 files always write every attribute. For a reimplementation: use defaults of pos 0, scale 1, delay 1, visible true, rot 0, interp false, and note the difference. -The same is true for layer and null frames (buffers E and C). - -### 2.8 LayerAnimations [0x410de4-0x4122c2] -```cpp - LayerAnimation la[64]; // ctor per animation: id=-1, frames=0, count=0, visible=true - int laCount = 0; - for (xml_node* ln = FindChild(animNode,"LayerAnimations")->first_node(); ln; ln = ln->next_sibling()) { - if (laCount >= 64) Log(0x10, "%s: too many animation layers\n", path); // continues (overflow) - LayerAnimation& L = la[laCount++]; - for (a) { if (a.name=="LayerId") L.layerId = atoi(v); else if (a.name=="Visible") L.visible = ParseBool(v); } - int n = 0, t = 0; - for (xml_node* fr = ln->first_node(); fr; fr = fr->next_sibling()) { - if (n >= 5000) Log(0x10, "%s: too many animation frames\n", path); - AnimationFrame& f = E[n++]; - float tint[4]={1,1,1,1}, off[3]={0,0,0}; - attrs: XPosition(+0x10) YPosition(+0x14) XPivot(+0x20) YPivot(+0x24) Width(+8) Height(+0xc) - XScale(+0x18,/100) YScale(+0x1c,/100) Delay(+0x28,atoi) Visible(+0x2c) - XCrop(+0) YCrop(+4) Red/Green/Blue/AlphaTint(/255) Red/Green/BlueOffset(/255) - Rotation(+0x5c) Interpolated(+0x60) - f.color.tint = tint; f.color.offset = off; - f.start = t; f.end = t + f.delay; t = f.end; // [0x411db2] - } - InterpolateLayerFrames(E, &n, F); // 0x415170, result in place in E - // ---- root-frame adjustment (bakes RootAnimation into the layer), §3.3 ---- - int out = ApplyRoot(E, n, A, rootCount, F); // [0x411df1-0x4121a1] - if (out) { L.frames = new AnimationFrame[out]; copy F[0..out-1]; } - L.frameCount = out; - } - if (laCount) { - an.layerAnims = new LayerAnimation[laCount] (copy id, visible, frames, count); - an.layerAnimCount = laCount; - for (i = 0; i < laCount; ++i) an.layerMap[an.layerAnims[i].layerId] = i; // [0x4122a0] unchecked index - } else an.layerAnimCount = 0; -``` -LayerId is **not validated** against layerCount or against 0..63. -`layerMap[id]` with id=-1 writes into `+0x34` (Loop). id ≥ 64 writes past the array into +0x138 and beyond. -Two LayerAnimations with the same LayerId: the last one wins in the map. - -### 2.9 Note on `layerMap` (+0x38) -The map is rebuilt at the end (§2.12) in a temporary and *swapped* into the final array. So it is the final map that counts: -* For animation index ≥1, the slots that are not referenced are -1, because they come from the swapped-out ctor-initialized element. -* For **animation 0**, the slots that are not referenced are uninitialized stack memory [0x41384f-0x413957; nothing initializes ebp-0x267c0]. -Reimplement as "-1 everywhere, then map[layerId]=index". - -### 2.10 NullAnimations [0x4122c5-0x413477] -```cpp - NullAnimation na[64]; // ctor per animation only zeroes frames/count; NullId and Visible keep stale stack values - int naCount = 0; - for (nn : FindChild(animNode,"NullAnimations")->children) { - if (naCount >= 64) Log(0x10, "%s: too many null layers\n", path); - NullAnimation& N = na[naCount++]; - for (a) { if (a.name=="NullId") N.nullId = atoi(v); else if (a.name=="Visible") N.visible = ParseBool(v); } - int n = 0, t = 0; - for (fr : nn->children) { - if (n >= 5000) Log(0x10, "%s: too many null frames\n", path); - NullFrame& f = C[n++]; - // same attribute set and conversions as root frames (§2.7) - f.start = t; f.end = t + f.delay; t = f.end; // [0x412fd8] - } - InterpolateNullFrames(C, &n, D); // 0x414e00 - int out = ApplyRoot(C, n, A, rootCount, D); // [0x413017-0x41334a] - if (out) { N.frames = new NullFrame[out]; copy D[0..out-1]; } - N.frameCount = out; - } - if (naCount) an.nullAnims = new NullAnimation[naCount] (copy nullId, visible, frames, count); - an.nullAnimCount = naCount; -``` -NullId is not validated, and there is no null map. - -### 2.11 Triggers [0x413472-0x4136a2] — **maximum 128 (0x80)** -```cpp - Trigger tr[128]; int tc = 0; // local array NOT reset per animation or per trigger - for (te : FindChild(animNode,"Triggers")->children) { - if (tc >= 128) Log(0x10, "%s: too many triggers\n", path); // continues (overflow) - Trigger& T = tr[tc++]; - for (a) { if (a.name=="EventId") T.eventId = atoi(v); else if (a.name=="AtFrame") T.atFrame = atoi(v); } - } - if (tc) { an.triggers = new Trigger[tc]; copy; } - an.triggerCount = tc; - } // next animation -``` -AtFrame is the raw tick number. There is no conversion and it is not checked against FrameNum. - -### 2.12 Finish [0x4136f0-0x413b37] -```cpp - d.anims = new AnimationData[animCount]; // ctor 0x40bec0 - for (i...) { tmp = copy of anim[i] with map rebuilt (§2.9); swap(d.anims[i], tmp); } - d.animCount = animCount; - free A..F; destroy local arrays; destroy the xml document; free the text buffer. -} -``` - -### Limits summary -| limit | value | behaviour when exceeded | -|---|---|---| -| spritesheets | id < 64 and id == index | "%s: invalid spritesheet id %d" (level 0x10), still stored at [id] | -| layers | id < 64 and id == index | "%s: invalid layer id %d" | -| layer→spritesheet | 0 ≤ id < sheetCount | "%s: invalid spritesheet id %d" | -| no layers | count == 0 | "%s: no layers" | -| nulls | id < 64 and id == index | "%s: invalid Null ID %d" | -| events | **id < 16** and id == index | "%s: invalid Event ID %d" | -| animations | 256 (stack array) | no check | -| root frames / anim | 5000 | "%s: too many root frames" (when count ≥5000 before adding) | -| layer anims / anim | 64 | "%s: too many animation layers" | -| frames / layer anim | 5000 | "%s: too many animation frames" | -| null anims / anim | 64 | "%s: too many null layers" | -| frames / null anim | 5000 | "%s: too many null frames" | -| expanded frames | 5000 | "too many frames after interpolation\n" (checked as **i+1 ≥ 5000**, where i is the *source* index, not the output count; see §3) | -| root-adjusted frames | 5000 | "%s: too many frames after interpolation/root frame adjustment" | -| triggers / anim | 128 | "%s: too many triggers" | -Every check only logs and keeps going. None of them stops parsing or clamps a value (in the original that means memory corruption). - ---------------------------------------------------------------------------------------------------- -## 3. Frame expansion - -Both helpers use a custom calling convention: `ecx = frames (in/out)`, `edx = int* count (in/out)`, one stack arg `scratch` (caller cleans). -They write the output to `scratch`, then `memcpy(frames, scratch, out*size)` and set `*count = out` [0x415131, 0x41559b]. -**Interpolation is pre-baked at load time.** Each interpolated keyframe becomes `delay` one-tick frames. - -### 3.1 `0x415170` InterpolateLayerFrames (AnimationFrame) -```cpp -void InterpolateLayerFrames(AnimationFrame* src, int* count, AnimationFrame* dst) { - int out = 0, tick = 0; - for (unsigned i = 0; i < (unsigned)*count; ++i) { - AnimationFrame& a = src[i]; - if (i != *count - 1 && a.interpolated) { // last frame is never interpolated - if (i + 1 >= 5000) Log(0x10, "too many frames after interpolation\n"); - AnimationFrame& b = src[i+1]; - float t = 0.0f; - float step = 1.0f / (float)a.delay; // cvtdq2ps + divss - for (int k = 0; k < a.delay; ++k) { // delay <= 0: emits nothing, tick not advanced - AnimationFrame& o = dst[out++]; - o.xcrop=a.xcrop; o.ycrop=a.ycrop; o.width=a.width; o.height=a.height; // NOT interpolated - o.x = (b.x - a.x ) * t + a.x; // subss, mulss, addss (no FMA) - o.y = (b.y - a.y ) * t + a.y; - o.sx = (b.sx - a.sx) * t + a.sx; - o.sy = (b.sy - a.sy) * t + a.sy; - o.pivotX = a.pivotX; o.pivotY = a.pivotY; // NOT interpolated - o.delay = 1; - o.visible = a.visible; - o.color = Color::Lerp(a.color, b.color, t); // 0x6832e0 - o.rotation = LerpAngleDeg(a.rotation, b.rotation, t); // 0x6828b0 - o.interpolated = a.interpolated; // true - o.start = tick; o.end = tick + 1; ++tick; - t = step + t; // accumulated in float, NOT k/delay - } - } else { - AnimationFrame& o = dst[out++]; - o = a; // full copy - o.start = tick; o.end = tick + a.delay; tick += a.delay; - } - } - memcpy(src, dst, out * 0x6c); *count = out; -} -``` -### 3.2 `0x414e00` InterpolateNullFrames (NullFrame, used for root and null frames) -This is the same algorithm on the NullFrame fields. -* Interpolated: x, y, sx, sy (lerp), color (Color::Lerp), rotation (LerpAngleDeg). -* Copied from `a`: visible, interpolated. delay=1, start=tick, end=tick+1. -* A non-interpolated frame is a full copy with start=tick, end=tick+delay. -* The overflow check is the same `i+1 >= 5000` [0x414e63]. - -**Color::Lerp `0x6832e0(out, a, b, t)`:** for all 11 floats (tint RGBA, colorize RGBA, offset RGB), `out = a*(1-t) + b*t`. `(1-t)` is computed once as a float. - -**LerpAngleDeg `0x6828b0(a, b, t)`** (all single precision. `fmodf` = `0x499d20` = `(float)fmod((double)x,(double)y)`): -```cpp -static float Wrap(float x) { if (fabsf(x) > 360.f) x = fmodf(x, 360.f); - if (x > 180.f) x -= 360.f; else if (x < -180.f) x += 360.f; return x; } -float LerpAngleDeg(float a, float b, float t) { - a = Wrap(a); b = Wrap(b); - if (fabsf(b - a) > 180.f) { if (b > a) a += 360.f; else b += 360.f; } - return Wrap((b - a) * t + a); -} -``` -All comparisons are strict. Because `Wrap` is applied, interpolated sub-frames carry rotation normalized to [-180,180] (for example a keyframe at 270° comes out as -90° at t=0). Non-interpolated frames keep their raw rotation. - -### 3.3 Root-frame adjustment (inlined twice: layers [0x411df1-0x41219a], nulls [0x413017-0x413343]) -After interpolation, each layer or null track is re-timed against the (interpolated) root track `A[0..rootCount)`. -Every frame is split wherever a root frame boundary falls inside it, and each piece is multiplied by the root frame that is active during that piece: -```cpp -template // Fr = AnimationFrame or NullFrame -int ApplyRoot(Fr* src, int n, const NullFrame* root, int rootCount, Fr* dst) { - int out = 0, g = 0, r = 0; // g = global tick, r = current root index - for (int i = 0; i < n; ++i) { - Fr& s = src[i]; - s.start = g; // overwrites start - for (int k = 0; k < s.delay; ++k) { // delay <= 0: no output - ++g; // g = tick index + 1 - int prev = r; bool emit = false; - if (r + 1 < rootCount) { - while (g >= root[r].end) { ++r; if (r + 1 >= rootCount) break; } - if (r > prev) emit = true; // the root frame ends on this tick - } - if (!emit && k == s.delay - 1) emit = true; // last tick of the source frame - if (!emit) continue; - if (out >= 5000) Log(0x10, "%s: too many frames after interpolation/root frame adjustment\n", path); - const NullFrame& R = root[prev]; // root frame active during this piece (index BEFORE advancing) - Fr& o = dst[out++]; - o = s; // includes s.start (start of this piece) and s.delay (NOT updated) - o.x = o.x * R.sx + R.x; // mulss then addss - o.y = R.sy * o.y + R.y; - o.visible = o.visible && R.visible; - o.sx = o.sx * R.sx; o.sy = R.sy * o.sy; - o.color *= R.color; // 0x6831c0 - o.rotation = R.rotation + o.rotation; - o.end = g; // piece ends here - s.start = g; // next piece of this source frame starts here - } - } - return out; -} -``` -* The root transform does not rotate the position around the root. Pivot, crop and size are unchanged. The pieces' `delay` field keeps the source delay, so only start/end are correct afterwards. The runtime uses `end`. -* When a track outlasts the root animation, the last root frame stays in effect (r is capped at rootCount-1). -* **rootCount == 0**: the inner test is skipped and `root[0]` is still applied. That is a stale or uninitialized slot of buffer A, so the original's behaviour is undefined. A reimplementation should use the identity transform. - -**Color::operator*= `0x6831c0` (this = frame color, other = root color):** -```cpp -tint[i] = other.tint[i] * tint[i]; // i = 0..3 -if (other.colorize.r + other.colorize.g + other.colorize.b != 0) { - if (colorize.r + colorize.g + colorize.b == 0) colorize = other.colorize; // copy all 4 - else for (i<4) colorize[i] = (colorize[i] + other.colorize[i]) * 0.5f; -} -offset[i] = other.offset[i] + offset[i]; // i = 0..2 -``` -(The parser always leaves colorize at 0, so only the tint multiply and offset add matter for .anm2 data.) - ---------------------------------------------------------------------------------------------------- -## 4. Uncertainties -* `0x67f670` (spritesheet path resolution) was skimmed, not fully decompiled. It joins the directory of the .anm2 path with the relative path, handles `\`→`/` and `..`, and truncates to 0x104. -* `0x8f5ad0` (initial path resolution / mod redirect) and `0xa178d0` (file open) were not examined beyond their role. -* What the cache-entry byte `+0` means (it is cleared here, and the caller's reload test reads it) was not traced fully. -* The rapidxml parse flags were not examined. Entity decoding and whitespace handling follow rapidxml's defaults for whatever flags 0x4155d0 was instantiated with. diff --git a/src/anm2/test.cpp b/src/anm2/test.cpp deleted file mode 100644 index fccc151..0000000 --- a/src/anm2/test.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// Behaviour checks for the reimplementation. Build: -// g++ -std=c++17 -O2 -msse2 -mfpmath=sse -ffp-contract=off anm2.cpp test.cpp -o anm2_test -// Usage: ./anm2_test [file.anm2 animName eventName] -#include "anm2.hpp" -#include -#include - -using namespace anm2; - -static const char* kSynthetic = R"( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -)"; - -static int failures = 0; -#define CHECK(c) do { if (!(c)) { std::printf("FAIL %s:%d: %s\n", __FILE__, __LINE__, #c); ++failures; } } while (0) - -int main(int argc, char** argv) { - AnmData d; - CHECK(ParseAnm2("gfx/test/actor.anm2", kSynthetic, d)); - CHECK(d.layers.size() == 1 && d.layers[0].spritesheetPath == "gfx/test/sheets/body.png"); - CHECK(d.eventNames.size() == 3 && d.defaultAnimation == "Attack"); - - const AnimationData& atk = d.animations[0]; - // Layer: interpolated 4-frame key expanded to 4 one-tick frames, then cut at the root boundary (tick 3). - const auto& lf = atk.layerAnims[0].frames; - std::printf("Attack/body baked frames:\n"); - for (auto& f : lf) std::printf(" [%d,%d) x=%g sx=%g rot=%g delay=%d\n", f.start, f.end, f.x, f.xScale, f.rotation, f.delay); - CHECK(lf.size() == 5); - CHECK(lf[0].x == 10.0f && lf[0].xScale == 2.0f); // root pos 10, root scale 2 - CHECK(lf[1].x == 2.0f * 2.0f + 10.0f); // lerp 0->8 at t=.25 = 2 - CHECK(lf[3].x == 6.0f && lf[3].xScale == 1.0f); // second root frame (identity) - CHECK(lf[1].rotation == 175.0f && lf[2].rotation == 180.0f && lf[3].rotation == -175.0f); // shortest-path angle lerp - CHECK(lf[4].start == 4 && lf[4].end == 6 && lf[4].delay == 2); - // Null: one 6-tick frame split by the root boundary into [0,3) and [3,6). - CHECK(atk.nullAnims[0].frames.size() == 2 && atk.nullAnims[0].frames[0].x == 1.0f * 2.0f + 10.0f); - - Sprite s; - s.Load(&d); - s.Play("Attack"); - CHECK(s.IsEventTriggered("Start")); // frame-0 triggers fire inside Play (Rewind) - std::printf("\nAttack playback:\n"); - for (int u = 0; u < 8; ++u) { - s.Update(); - std::printf(" update %d: frame=%d playing=%d Shoot=%d End=%d wasStart=%d\n", u, s.GetFrame(), - s.main().playing(), s.IsEventTriggered("Shoot"), s.IsEventTriggered("End"), s.WasEventTriggered("Start")); - } - CHECK(s.IsFinished("Attack") && s.GetFrame() == 5); - CHECK(!s.IsEventTriggered("End")); // the finishing Update re-runs AdvancePosition(5), clearing the mask - - // ...but if the finishing Update itself crosses the event frame, the mask survives while stopped. - s.Play("Attack", true); - s.playbackSpeed = 2.0f; - s.Update(); s.Update(); // frames 2, 4 - s.Update(); // 6 >= FrameNum: AdvancePosition(5) fires End, stops - CHECK(!s.IsPlaying() && s.IsEventTriggered("End")); - s.Update(); s.Update(); // no-ops while stopped - CHECK(s.IsEventTriggered("End")); - s.playbackSpeed = 1.0f; - - s.Play("Attack"); // non-looping, same name, not forced: no-op - CHECK(!s.IsPlaying()); - s.Play("Attack", true); - CHECK(s.IsPlaying() && s.GetFrame() == 0); - - // Speed 2 on a loop: the loop wraps via Rewind, skipping frames >= old+1 that were never stepped. - s.Play("Idle"); - s.playbackSpeed = 2.0f; - s.Update(); CHECK(s.GetFrame() == 2 && s.IsEventTriggered("Shoot")); - s.Update(); CHECK(s.GetFrame() == 0 && !s.IsEventTriggered("Shoot")); - s.playbackSpeed = 1.0f; - - // SetFrame clamps to nextafter(FrameNum, 0) and fires only on exact equality. - s.SetFrame("Attack", 3); - CHECK(s.IsEventTriggered("Shoot") && !s.IsPlaying()); - s.SetFrame(100.0f); - CHECK(s.main().frame() < 6.0f && s.GetFrame() == 5 && !s.IsEventTriggered("End")); - CHECK(s.main().NextEventTrigger("Shoot") == -1); - s.SetFrame(1.0f); - CHECK(s.main().NextEventTrigger("Shoot") == 3); - - if (argc >= 4) { - AnmData real; - if (!LoadAnm2File(argv[1], real)) return 1; - Sprite r; r.Load(&real); r.Play(argv[2]); - std::printf("\n%s / %s (FrameNum=%d): '%s' fires at:", argv[1], argv[2], - r.main().anim() ? r.main().anim()->frameNum : -1, argv[3]); - if (r.IsEventTriggered(argv[3])) std::printf(" 0"); - for (int u = 0; u < 1000 && r.IsPlaying(); ++u) { r.Update(); if (r.IsEventTriggered(argv[3])) std::printf(" %d", r.GetFrame()); } - std::printf("\n"); - } - - std::printf("\n%s (%d failures)\n", failures ? "FAILED" : "all checks passed", failures); - return failures != 0; -} diff --git a/src/challenge_param.cpp b/src/challenge_param.cpp deleted file mode 100644 index e8d4734..0000000 --- a/src/challenge_param.cpp +++ /dev/null @@ -1,149 +0,0 @@ -#include "classes.h" -#include - -constexpr int PILLEFFECT_NULL = -1; -// An MSVC string keeps up to 15 characters in its own buffer. -constexpr uint32_t STRING_INLINE_CAPACITY = 15; -constexpr char TREE_BLACK = 1; - -// A node of an MSVC std::set. Its head is a nil node linked to itself while the set is empty. -struct UintSetNode -{ - UintSetNode* left; - UintSetNode* parent; - UintSetNode* right; - char color; - bool isNil; - unsigned int value; -}; -LAYOUT32(sizeof(UintSetNode) == 0x14); - -static void string_reset(std_string& text) -{ - text = {}; - text._capacity = STRING_INLINE_CAPACITY; -} - -static void set_head_reset(UintSetNode* head) -{ - head->left = head; - head->parent = head; - head->right = head; -} - -static UintSetNode* set_head_create() -{ - auto head = (UintSetNode*)operator_new(sizeof(UintSetNode)); - - set_head_reset(head); - head->color = TREE_BLACK; - head->isNil = true; - return head; -} - -// Frees a subtree, right branches by recursion and left ones in the loop. -static void set_erase(UintSetNode* node) -{ - while (!node->isNil) - { - UintSetNode* left = node->left; - - set_erase(node->right); - operator_delete(node, sizeof(UintSetNode)); - node = left; - } -} - -// Fills to with its own copy of the ints in from, with no storage when from is empty. -static void vector_copy(std_vector& to, std_vector& from) -{ - size_t size = (char*)from._end - (char*)from._begin; - - to = {}; - if (size == 0) return; - - to._begin = msvc::_Allocate(size); - to._end = (char*)to._begin + size; - to._capacity = to._end; - memmove(to._begin, from._begin, size); -} - -// 00424440 Clears the rules back to a plain run, keeping the name and the achievement and twin lists. -void ChallengeParam::Reset() -{ - auto head = (UintSetNode*)_roomset._head; - - set_erase(head->parent); - set_head_reset(head); - _roomset._size = 0; - _collectibleList._end = _collectibleList._begin; - _seedEffects._end = _seedEffects._begin; - _trinketList._end = _trinketList._begin; - - _addDamage = 0; - _minFireRate = 0; - _blackHearts = 0; - _coins = 0; - _difficulty = 0; - _endStage = 0; - _hearts = 0; - _maxHearts = 0; - _pathType = 0; - _playerType = 0; - _soulHearts = 0; - _startingCard = 0; - _startingPill = PILLEFFECT_NULL; - _curseFilter = 0; - _getCurse = 0; - - _bigRange = false; - _canShoot = true; - _isMegaSatan = false; - _isPathTypeSet = false; - _maxDamage = false; - _minShotSpeed = false; -} - -// 00424310 Builds an empty ChallengeParam in place, with the rules Reset gives. -ChallengeParams::ChallengeParams() -{ - auto param = (ChallengeParam*)this; - - *param = {}; - string_reset(param->_name); - param->_roomset._head = set_head_create(); - param->Reset(); -} - -// 0095c6a0 Moves a ChallengeParam into this storage, leaving the source empty with a new room set head. -ChallengeParams::ChallengeParams(void* other) -{ - auto param = (ChallengeParam*)this; - auto source = (ChallengeParam*)other; - - *param = *source; - string_reset(source->_name); - source->_roomset = {set_head_create(), 0}; - source->_achievementList = {}; - source->_collectibleList = {}; - source->_collectibleTwinList = {}; - source->_seedEffects = {}; - source->_trinketList = {}; -} - -// 0095c050 Copies a ChallengeParam into this storage, with its own name, room set and lists. -void* ChallengeParams::copy_constructor(ChallengeParam* other) -{ - auto param = (ChallengeParam*)this; - - *param = *other; - new (¶m->_name) msvc::string(&other->_name); - param->_roomset = {set_head_create(), 0}; - std_set_uint_copy(¶m->_roomset, &other->_roomset, 0); - vector_copy(param->_achievementList, other->_achievementList); - vector_copy(param->_collectibleList, other->_collectibleList); - vector_copy(param->_collectibleTwinList, other->_collectibleTwinList); - vector_copy(param->_seedEffects, other->_seedEffects); - vector_copy(param->_trinketList, other->_trinketList); - return this; -} diff --git a/src/challenge_params.cpp b/src/challenge_params.cpp new file mode 100644 index 0000000..2f095d9 --- /dev/null +++ b/src/challenge_params.cpp @@ -0,0 +1,12 @@ +#include "challenge_params.h" + +// 00424440 Puts the rules back to a plain run, keeping the name and the achievement and twin lists. +void ChallengeParam::Reset() +{ + ChallengeParam reset; + + reset.name = std::move(name); + reset.achievementList = std::move(achievementList); + reset.collectibleTwinList = std::move(collectibleTwinList); + *this = std::move(reset); +} diff --git a/src/challenge_params.h b/src/challenge_params.h new file mode 100644 index 0000000..9565012 --- /dev/null +++ b/src/challenge_params.h @@ -0,0 +1,57 @@ +#pragma once + +#include +#include +#include +#include + +constexpr int PILLEFFECT_NULL = -1; + +// The way a challenge forces through the floors, numbered as REPENTOGON does. +enum PathType : int +{ + PATH_TYPE_SHEOL = 0, + PATH_TYPE_CATHEDRAL = 1, + PATH_TYPE_REPENTANCE = 2, + PATH_TYPE_HOME = 3 +}; + +// A challenge's rules from challenges.xml: what the player starts with, which rooms and curses it allows and where it +// ends. The defaults are a plain run. +// Construction, copies, moves and destruction (00424310, 0095c050, 0095c6a0, 009584b0, 004269f0) are the defaults. +struct ChallengeParam +{ + std::string name; + std::set roomset; + std::vector achievementList; + std::vector collectibleList; + std::vector collectibleTwinList; + std::vector seedEffects; + std::vector trinketList; + + float addDamage = 0; + float minFireRate = 0; + + int blackHearts = 0; + int coins = 0; + int difficulty = 0; + int endStage = 0; + int hearts = 0; + int maxHearts = 0; + int playerType = 0; + int soulHearts = 0; + int startingCard = 0; + int startingPill = PILLEFFECT_NULL; + PathType pathType = PATH_TYPE_SHEOL; + uint32_t curseFilter = 0; + uint32_t getCurse = 0; + + bool isBigRange = false; + bool isCanShoot = true; + bool isMaxDamage = false; + bool isMegaSatan = false; + bool isMinShotSpeed = false; + bool isPathTypeSet = false; + + void Reset(); +}; diff --git a/src/font.cpp b/src/font.cpp index 3fb797f..0925161 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -1,75 +1,501 @@ -#include "classes.h" -#include "msvc.h" +#include "font.h" +#include "data.h" +#include "log.h" #include -#include +#include +#include +#include #include -// A length that asks for the text up to its terminating NUL. -constexpr int LENGTH_TO_END = -1; -// A glyph index for no glyph at all. -constexpr int GLYPH_NONE = -1; +constexpr char FONT_MAGIC[] = "BMF"; +constexpr uint32_t FONT_VERSION = 3; +constexpr size_t GLYPH_RECORD_SIZE = 20; +constexpr size_t KERNING_RECORD_SIZE = 10; +// Where the common block keeps its page count, after the line height, baseline and texture size. +constexpr size_t COMMON_PAGES = 8; +constexpr char PATH_SEPARATORS[] = "/\\"; -// Character code to glyph index, in Font::_charsBlock. -using GlyphNode = MsvcTreeNode; -LAYOUT32(offsetof(GlyphNode, _value) == 0x14 && sizeof(GlyphNode) == 0x18); - -// The glyph a character draws with, or the missing-character glyph. -static int glyph_find(Font& font, uint32_t character) +// The BMFont binary blocks the game reads. +enum FontBlock : uint32_t { - auto node = tree_find(font._charsBlock, character); - return node->_isNil ? font._missingCharacter : node->_value; + FONT_BLOCK_INFO = 1, + FONT_BLOCK_COMMON = 2, + FONT_BLOCK_PAGES = 3, + FONT_BLOCK_CHARS = 4, + FONT_BLOCK_KERNING = 5 +}; + +// The previous character a line starts with, which no kerning pair names. +constexpr uint32_t PREVIOUS_NONE = 0xffffffff; +constexpr uint32_t HYPHEN = '-'; +constexpr uint32_t DOT = '.'; +constexpr int ELLIPSIS_DOTS = 3; +constexpr char ELLIPSIS[] = "..."; +constexpr int ALIGN_COLUMNS = 3; +// How far up a block of lines moves, and a line left, in lines and line widths, by the alignment's row and column. +constexpr float ALIGN_SHIFTS[ALIGN_COLUMNS] = {0, 0.5f, 1}; +constexpr const char* COLOR_TEXTURE_SHADER = "KAGE_ColorTextureShader"; + +// The graphics layer's quads as an image renders them: the cell as 9 numbers and the screen corners and colors as 28. +constexpr int SOURCE_QUAD_FLOATS = 9; +constexpr int COLOR_QUAD_FLOATS = 28; +constexpr uint32_t QUAD_COUNT = 1; + +constexpr uint8_t UTF8_ASCII_END = 0x7f; +constexpr uint8_t UTF8_CONTINUATION_FIRST = 0x80; +constexpr uint8_t UTF8_CONTINUATION_LAST = 0xbf; +constexpr uint8_t UTF8_OVERLONG_LAST = 0xc1; +constexpr uint8_t UTF8_LEAD_LAST = 0xf4; +constexpr int UTF8_TRAILING_MAX = 3; +// ConvertUTF's trailingBytesForUTF8: a lead byte from each of these on has one more continuation byte. +constexpr uint8_t UTF8_LEADS[] = {0xc0, 0xe0, 0xf0, 0xf8, 0xfc}; +constexpr int UTF8_BITS = 6; +// ConvertUTF's offsetsFromUTF8, by trailing byte count. +constexpr uint32_t UTF8_OFFSETS[UTF8_TRAILING_MAX + 1] = {0, 0x3080, 0xe2080, 0x3c82080}; +constexpr uint32_t UTF16_HIGH_SURROGATE_FIRST = 0xd800; +constexpr uint32_t UTF16_HIGH_SURROGATE_LAST = 0xdbff; +constexpr uint32_t UNICODE_BMP_LAST = 0xffff; +constexpr uint32_t UNICODE_LAST = 0x10ffff; +constexpr uint32_t REPLACEMENT_CHARACTER = 0xfffd; +// The game's surrogate pair arithmetic, kept as it is: its low half keeps only these bits of the character. +constexpr uint32_t SURROGATE_HIGH_BIAS = 0x2800; +constexpr uint32_t SURROGATE_LOW_BIAS = 0x2400; +constexpr uint32_t SURROGATE_LOW_MASK = 0x33f; +constexpr int SURROGATE_SHIFT = 10; +constexpr int UTF16_UNIT_BITS = 16; + +// The second bytes ConvertUTF allows after the lead bytes that limit them. +struct Utf8SecondRange +{ + uint8_t lead; + uint8_t first; + uint8_t last; +}; + +constexpr Utf8SecondRange UTF8_SECOND_RANGES[] = { + {0xe0, 0xa0, 0xbf}, {0xed, 0x80, 0x9f}, {0xf0, 0x90, 0xbf}, {0xf4, 0x80, 0x8f}}; + +// ConvertUTF's isLegalUTF8 for a character with trailing continuation bytes. +static bool is_utf8_legal(const uint8_t* bytes, int trailing) +{ + if (trailing > UTF8_TRAILING_MAX) return false; + + for (int i = trailing; i >= 1; i--) + if (bytes[i] < UTF8_CONTINUATION_FIRST || bytes[i] > UTF8_CONTINUATION_LAST) return false; + for (auto& range : UTF8_SECOND_RANGES) + if (trailing >= 1 && bytes[0] == range.lead && (bytes[1] < range.first || bytes[1] > range.last)) return false; + return (bytes[0] < UTF8_CONTINUATION_FIRST || bytes[0] > UTF8_OVERLONG_LAST) && bytes[0] <= UTF8_LEAD_LAST; } -// 00a1a640 An unloaded font with no glyphs, kerning or pages, and no missing-character glyph. -Font::Font() +// 00a2bfe0 Decodes the UTF-8 character at text into outCodepoint and returns where the next one starts. +// An illegal or cut-off character decodes as 0 and skips its bytes. A character past the first 64K becomes the game's +// odd surrogate pair, high half in the low 16 bits. +const char* utf8_decode_next(const char* text, uint32_t* outCodepoint, const char* end) { - _isLoaded = false; - _numChars = 0; - _chars = nullptr; - _kerningPairs = {}; - _numPages = 0; - _pageTextures = nullptr; - _charsBlock = tree_create(); - _missingCharacter = GLYPH_NONE; -} + auto bytes = (const uint8_t*)text; -// 00a1b4a0 The kerning amount the font lists for second following first, or 0. -int Font::get_kerning(uint32_t first, uint32_t second) -{ - auto begin = (KerningPair*)_kerningPairs._begin; - auto end = (KerningPair*)_kerningPairs._end; - auto isBefore = [&](KerningPair& pair) { return std::tie(pair._first, pair._second) < std::tie(first, second); }; - KerningPair* pair = std::partition_point(begin, end, isBefore); + if (bytes[0] < UTF8_ASCII_END) + { + *outCodepoint = bytes[0]; + return text + 1; + } + if (!end) end = text + std::strlen(text); - return pair != end && pair->_first == first && pair->_second == second ? pair->_amount : 0; -} + auto isLeadOf = [&](uint8_t lead) { return bytes[0] >= lead; }; + int trailing = std::count_if(std::begin(UTF8_LEADS), std::end(UTF8_LEADS), isLeadOf); + const char* last = text + trailing; -// 00a1b8e0 The advance of length bytes of UTF-8 text, or all of it for -1, less kerning and never below 0. -int Font::get_string_width_n(uint8_t* str, int length) -{ - if (!_isLoaded || !str) return 0; - - uint8_t* end = length == LENGTH_TO_END ? str + std::strlen((char*)str) : str + length; - if (end <= str) return 0; + if (last >= end || !is_utf8_legal(bytes, trailing)) + { + *outCodepoint = 0; + return last < end ? last + 1 : end; + } uint32_t character = 0; + for (int i = 0; i <= trailing; i++) character = (i ? character << UTF8_BITS : 0) + bytes[i]; + character -= UTF8_OFFSETS[trailing]; + + if (character > UNICODE_LAST) *outCodepoint = REPLACEMENT_CHARACTER; + else if (character > UNICODE_BMP_LAST) + { + auto high = (uint16_t)((character >> SURROGATE_SHIFT) - SURROGATE_HIGH_BIAS); + auto low = (uint16_t)((character & SURROGATE_LOW_MASK) - SURROGATE_LOW_BIAS); + *outCodepoint = high | (uint32_t)low << UTF16_UNIT_BITS; + } + else if (character >= UTF16_HIGH_SURROGATE_FIRST && character <= UTF16_HIGH_SURROGATE_LAST) + *outCodepoint = REPLACEMENT_CHARACTER; + else *outCodepoint = character; + return last + 1; +} + +// A Vector set field by field, as its constructor is still the game's. +static Vector vector_get(float x, float y) +{ + Vector vector; + + vector.x = x; + vector.y = y; + return vector; +} + +// The next character of UTF-8 text, decoded, or of UTF-16 text, one code unit as the game reads it. +static uint32_t char_next(const char*& cursor, const char* end) +{ + uint32_t character = 0; + cursor = utf8_decode_next(cursor, &character, end); + return character; +} + +static uint32_t char_next(const char16_t*& cursor, const char16_t*) +{ + return *cursor++; +} + +// A .fnt read front to back as little-endian numbers, with zeros past its end. +struct FontReader +{ + std::string_view file; + size_t offset = 0; + + template + T read() + { + uint32_t value = 0; + + for (size_t i = sizeof(T); i-- > 0;) + value = value << CHAR_BIT | (offset + i < file.size() ? (uint8_t)file[offset + i] : 0); + offset += sizeof(T); + return (T)value; + } +}; + +// Loads a page image through the graphics layer's image manager (KAGE_Graphics_ImageManager::load_image_file). +static TexturePtr page_load(std::string path) +{ + TexturePtr page = {}; + + KAGE_Graphics_ImageManager::load_image_file(&page, (uint8_t*)path.data()); + return page; +} + +// Draws a glyph quad from its page image: the cell as a source quad (quad_set_rect), the screen rectangle as a colored +// quad (render_quad_set_rect), and the image's quad render (ImageBase slot 4, which slot 5 calls without a clip rect). +static void page_draw(TexturePtr& page, GlyphQuad& quad) +{ + float source[SOURCE_QUAD_FLOATS]; + float colored[COLOR_QUAD_FLOATS]; + + quad_set_rect(source, &quad.cellPosition, &quad.cellSize, 0); + render_quad_set_rect(colored, &quad.position, &quad.size, &quad.color); + ((KAGE::Graphics::ImageBase*)page._image)->FUN_00a129a0(source, colored, QUAD_COUNT); +} + +// The shader stack pop the game inlines after drawing text. +// Restoring the shader shader_push replaced reads the stack's deque, which only FUN_00684fc0 (its back) knows yet. +static void shader_pop() +{ + if (g_shaderStackSize == 0) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)"Shader stack empty\n"); + FUN_00684fc0(); + if (--g_shaderStackSize == 0) DAT_00c379d8 = 0; +} + +// 0085e470, 00a1a730 Loads a binary .fnt and its page images, which sit in the .fnt's folder. +// Every caller passes no image extension override, so that parameter is gone. +// A second chars block replaces the glyph map, where the game kept the first block's stale indices. +bool Font::Load(std::string_view path) +{ + Unload(); + + std::ifstream stream(resource_path(path), std::ios::binary); + std::string file((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); + FontReader reader = {file, std::size(FONT_MAGIC) - 1}; + if (!stream || file.compare(0, reader.offset, FONT_MAGIC) != 0) return false; + if (reader.read() != FONT_VERSION) return false; + + size_t slash = path.find_last_of(PATH_SEPARATORS); + std::string directory(slash == std::string_view::npos ? std::string_view() : path.substr(0, slash)); + uint16_t pageCount = 0; + + while (reader.offset < file.size()) + { + auto type = (FontBlock)reader.read(); + auto size = reader.read(); + size_t block = reader.offset; + if (block >= file.size()) break; + + switch (type) + { + case FONT_BLOCK_COMMON: + lineHeight = reader.read(); + base = reader.read(); + reader.offset = block + COMMON_PAGES; + pageCount = reader.read(); + break; + + case FONT_BLOCK_PAGES: + { + std::string names = file.substr(block, size); + size_t name = 0; + + pages.clear(); + for (uint16_t i = 0; i < pageCount; i++) + { + size_t nameEnd = std::min(names.find('\0', name), names.size()); + std::string page = names.substr(name, nameEnd - name); + + pages.push_back(page_load(directory.empty() ? page : directory + "/" + page)); + name = std::min(nameEnd + 1, names.size()); + } + break; + } + + case FONT_BLOCK_CHARS: + glyphs.resize(size / GLYPH_RECORD_SIZE); + glyphIndices.clear(); + for (size_t i = 0; i < glyphs.size(); i++) + { + FontGlyph& glyph = glyphs[i]; + + glyph.id = reader.read(); + glyph.x = reader.read(); + glyph.y = reader.read(); + glyph.width = reader.read(); + glyph.height = reader.read(); + glyph.xOffset = reader.read(); + glyph.yOffset = reader.read(); + glyph.xAdvance = reader.read(); + glyph.page = reader.read(); + glyph.channel = reader.read(); + glyphIndices[glyph.id] = i; + } + break; + + case FONT_BLOCK_KERNING: + kernings.resize(size / KERNING_RECORD_SIZE); + for (FontKerning& kerning : kernings) + { + kerning.first = reader.read(); + kerning.second = reader.read(); + kerning.amount = reader.read(); + } + std::sort(kernings.begin(), kernings.end(), [](FontKerning& a, FontKerning& b) + { return std::tie(a.first, a.second) < std::tie(b.first, b.second); }); + break; + + default: + break; + } + reader.offset = block + size; + } + + isLoaded = true; + return true; +} + +// 00a1ad90 Forgets the glyphs and page images. The kerning, missing glyph and metrics stay, as in the game. +// Releasing each page's image reference is the graphics layer's (TexturePtr::release). +void Font::Unload() +{ + glyphs.clear(); + pages.clear(); + glyphIndices.clear(); + isLoaded = false; +} + +// 00a1b410 The glyph a character draws with, else the fallback character's when it is not CHARACTER_NONE, else the +// missing-character glyph. +int Font::get_glyph_index(uint32_t character, int fallback) +{ + auto found = glyphIndices.find(character); + + if (found == glyphIndices.end() && fallback != CHARACTER_NONE) found = glyphIndices.find(fallback); + return found == glyphIndices.end() ? missingCharacter : found->second; +} + +// 00a1b3b0 Draws characters the font lacks with this character's glyph, or with nothing when it lacks that too. +void Font::SetMissingCharacter(uint32_t character) +{ + auto found = glyphIndices.find(character); + missingCharacter = found == glyphIndices.end() ? GLYPH_NONE : found->second; +} + +// 00a1ae70, 00a1b510 How far a character moves the pen, or 0 for none. +int Font::GetCharacterWidth(uint32_t character) +{ + int glyph = isLoaded ? get_glyph_index(character) : GLYPH_NONE; + return glyph == GLYPH_NONE ? 0 : glyphs[glyph].xAdvance; +} + +// 00a1b4a0 How far the font moves second back after first, or 0. +int Font::get_kerning(uint32_t first, uint32_t second) +{ + auto isBefore = [](FontKerning& pair, std::tuple key) + { return std::tie(pair.first, pair.second) < key; }; + auto pair = std::lower_bound(kernings.begin(), kernings.end(), std::tuple(first, second), isBefore); + + return pair != kernings.end() && pair->first == first && pair->second == second ? pair->amount : 0; +} + +// The advance of UTF-8 or UTF-16 text, less kerning and never below 0. A character that decodes as 0 ends it. +template +static int string_width(Font& font, std::basic_string_view text) +{ + if (!font.isLoaded || text.empty()) return 0; + + const Char* cursor = text.data(); + const Char* end = cursor + text.size(); uint32_t previous = 0; - uint8_t* cursor = utf8_decode_next(str, &character, end); int width = 0; - while (character != 0) + for (uint32_t character = char_next(cursor, end); character != 0; character = char_next(cursor, end)) { - int glyph = glyph_find(*this, character); + int glyph = font.get_glyph_index(character); if (glyph != GLYPH_NONE) { - width += _chars[glyph]._xAdvance - get_kerning(previous, character); + width += font.glyphs[glyph].xAdvance - font.get_kerning(previous, character); previous = character; } if (cursor >= end) break; - - character = 0; - cursor = utf8_decode_next(cursor, &character, end); } return std::max(width, 0); } + +// 00a1ae80, 00a1b8e0 The advance of UTF-8 text. +int Font::GetStringWidth(std::string_view text) +{ + return string_width(*this, text); +} + +// 00a1ba10 The advance of UTF-16 text. +int Font::GetStringWidth(std::u16string_view text) +{ + return string_width(*this, text); +} + +// 00a1bb10, 00a1c480 Splits text into lines at newlines, or wraps it at words, and cuts lines the settings truncate +// short of an ellipsis. The lines view the text. +template +TextLayout Font::measure_string(std::basic_string_view text, FontSettings& settings, Vector scale) +{ + TextLayout layout; + TextMeasure measure = {*this, scale.x}; + + if (settings.wrapMode == FONT_WRAP_WORDS) + { + layout.set(text, measure, settings.maxLineWidth, TextStorage::BORROWED); + return layout; + } + + layout.split_lines(text, layout.lines); + if (settings.wrapMode != FONT_WRAP_TRUNCATE) return layout; + + uint32_t maxWidth = settings.maxLineWidth; + uint32_t budget = maxWidth - std::min(maxWidth, (uint32_t)GetStringWidth(ELLIPSIS)); + + for (auto& line : layout.lines) + { + if (text_measure(measure, line.text) <= maxWidth) continue; + + line.flags |= TEXT_LINE_TRUNCATED; + line.text.remove_suffix(1); + while (!line.text.empty() && text_measure(measure, line.text) > budget) line.text.remove_suffix(1); + } + return layout; +} + +// 00a1b580 Draws a character's glyph with its kerning after the previous one and returns how far the pen moves. +// The settings' callback may change or reject it first. A glyph on a page the font lacks is not drawn, where the game +// read past its pages. +float Font::render_glyph(GlyphDraw& draw, uint32_t& previous, Vector position, Vector scale, FontSettings& settings) +{ + int index = get_glyph_index(draw.character, settings.missingCharacterOverride); + if (index == GLYPH_NONE) return 0; + + FontGlyph& glyph = glyphs[index]; + GlyphQuad& quad = draw.quad; + float kerning = (float)get_kerning(previous, draw.character) * scale.x; + float x = position.x - kerning; + + draw.advance = glyph.xAdvance; + quad.cellPosition = vector_get(glyph.x, glyph.y); + quad.cellSize = vector_get(glyph.width, glyph.height); + quad.position = vector_get((float)glyph.xOffset * scale.x + x, (float)glyph.yOffset * scale.y + position.y); + quad.size = vector_get((float)glyph.width * scale.x, (float)glyph.height * scale.y); + if (settings.glyphCallback && !settings.glyphCallback(draw, settings.glyphCallbackData)) return 0; + + if (glyph.page < pages.size()) page_draw(pages[glyph.page], quad); + previous = draw.character; + return (float)draw.advance * scale.x - kerning; +} + +// 00a1bd80, 00a1c7d0 Draws laid-out lines aligned at position, then each line's hyphen or ellipsis, stopping at the +// settings' character limit. +template +void Font::render_lines(TextLayout& layout, Vector position, Vector scale, KColor color, FontSettings& settings) +{ + if (!isLoaded) return; + + bool isAligned = settings.alignment >= ALIGN_TOP_LEFT && settings.alignment <= ALIGN_BOTTOM_RIGHT; + float shiftX = isAligned ? ALIGN_SHIFTS[settings.alignment % ALIGN_COLUMNS] : 0; + float shiftY = isAligned ? ALIGN_SHIFTS[settings.alignment / ALIGN_COLUMNS] : 0; + float height = (float)lineHeight * settings.lineHeightModifier * scale.y; + Vector pen = position; + auto maxCharacters = (uint16_t)settings.maxCharacters; + uint16_t count = 0; + + if (shiftY != 0) pen.y -= (float)(uint32_t)layout.lines.size() * height * shiftY; + shader_push((uint8_t*)COLOR_TEXTURE_SHADER); + for (auto& line : layout.lines) + { + const Char* cursor = line.text.data(); + const Char* end = cursor + line.text.size(); + uint32_t previous = PREVIOUS_NONE; + uint8_t index = 0; + auto glyph_render = [&](uint32_t character) { + GlyphDraw draw; + + draw.quad.color = color; + draw.character = character; + draw.index = index++; + pen.x += render_glyph(draw, previous, pen, scale, settings); + }; + + pen.x = position.x; + if (shiftX != 0) + { + float width = (float)(uint32_t)GetStringWidth(line.text) * scale.x; + + if (line.flags & TEXT_LINE_HYPHENATED) width += (float)(uint32_t)GetCharacterWidth(HYPHEN) * scale.x; + if (line.flags & TEXT_LINE_TRUNCATED) + width += (float)(uint32_t)GetCharacterWidth(DOT) * ELLIPSIS_DOTS * scale.x; + pen.x -= width * shiftX; + } + for (uint32_t character = cursor < end ? char_next(cursor, end) : 0; character != 0 && count < maxCharacters; + character = cursor < end ? char_next(cursor, end) : 0, count++) + glyph_render(character); + if (count >= maxCharacters) break; + + if (line.flags & TEXT_LINE_HYPHENATED) glyph_render(HYPHEN); + for (int dot = 0; dot < ELLIPSIS_DOTS && (line.flags & TEXT_LINE_TRUNCATED); dot++) glyph_render(DOT); + pen.y += height; + } + shader_pop(); +} + +// 00a1aec0, 00a1af90, 00a1b050, 00a1b140 Draws UTF-8 text laid out by the settings at position and scale. +void Font::DrawString(std::string_view text, Vector position, Vector scale, KColor color, FontSettings& settings) +{ + TextLayout layout = measure_string(text, settings, scale); + render_lines(layout, position, scale, color, settings); +} + +// 00a1b210, 00a1b2d0 Draws UTF-16 text laid out by the settings at position and scale. +void Font::DrawString(std::u16string_view text, Vector position, Vector scale, KColor color, FontSettings& settings) +{ + TextLayout layout = measure_string(text, settings, scale); + render_lines(layout, position, scale, color, settings); +} + +template TextLayout Font::measure_string(std::string_view, FontSettings&, Vector); +template TextLayout Font::measure_string(std::u16string_view, FontSettings&, Vector); diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..eb9dec0 --- /dev/null +++ b/src/font.h @@ -0,0 +1,166 @@ +#pragma once + +#include "classes.h" +#include "formatted_text.h" +#include +#include +#include + +// A glyph index for no glyph at all. +constexpr int GLYPH_NONE = -1; +// A character for no fallback character at all. +constexpr int CHARACTER_NONE = -1; + +// REPENTOGON's DrawStringAlignment: where the position puts the text's block of lines. +enum DrawStringAlignment : int +{ + ALIGN_TOP_LEFT, + ALIGN_TOP_CENTER, + ALIGN_TOP_RIGHT, + ALIGN_CENTER_LEFT, + ALIGN_CENTER, + ALIGN_CENTER_RIGHT, + ALIGN_BOTTOM_LEFT, + ALIGN_BOTTOM_CENTER, + ALIGN_BOTTOM_RIGHT +}; + +// What a string does with lines wider than FontSettings::maxLineWidth. +enum FontWrapMode : int +{ + FONT_WRAP_NONE, + FONT_WRAP_WORDS, + FONT_WRAP_TRUNCATE +}; + +// A glyph of a bitmap font: its cell in a page image, where it sits from the pen, and how far the pen then moves. +struct FontGlyph +{ + uint32_t id = 0; + uint16_t height = 0; + uint16_t width = 0; + uint16_t x = 0; + uint16_t y = 0; + int16_t xAdvance = 0; + int16_t xOffset = 0; + int16_t yOffset = 0; + uint8_t channel = 0; + uint8_t page = 0; +}; + +// How far the pen moves back between two characters. +struct FontKerning +{ + uint32_t first = 0; + uint32_t second = 0; + int16_t amount = 0; +}; + +// Where a glyph's cell of its page is drawn on screen, and its tint. +struct GlyphQuad +{ + KColor color; + Vector cellPosition; + Vector cellSize; + Vector position; + Vector size; +}; + +// A glyph about to be drawn, which a FontSettings glyph callback may change, or reject by returning false. +struct GlyphDraw +{ + GlyphQuad quad; + uint32_t character = 0; + int16_t advance = 0; + uint8_t index = 0; +}; + +using GlyphCallback = bool (*)(GlyphDraw& draw, void* userData); + +// How a string is drawn: aligned, cut to a number of characters, wrapped or truncated to a line width, with its line +// height scaled, and each glyph optionally passed through a callback. +// The setters Rebirth named on Font (00407280, 0085e450, 00a1a5c0 to 00a1a630) work on these settings. +struct FontSettings +{ + DrawStringAlignment alignment = ALIGN_TOP_LEFT; + FontWrapMode wrapMode = FONT_WRAP_NONE; + int missingCharacterOverride = -1; + int16_t maxCharacters = -1; + uint16_t maxLineWidth = 0; + float lineHeightModifier = 1; + GlyphCallback glyphCallback = nullptr; + void* glyphCallbackData = nullptr; + + // 00a1a540 Settings that draw everything top-left on one line per newline. + FontSettings() = default; + // 00a1a580 Default settings with an alignment. + FontSettings(DrawStringAlignment alignment) : alignment(alignment) {} + + // 00407280 Scales the space between lines. + void SetLineHeightModifier(float modifier) { lineHeightModifier = modifier; } + // 0085e450 Wraps lines at words to a width, with the line height back at 1. + void EnableAutoWrap(uint16_t width) + { + wrapMode = FONT_WRAP_WORDS; + maxLineWidth = width; + lineHeightModifier = 1; + } + // 00a1a5c0 Sets where the position puts the text. + void SetAlignment(DrawStringAlignment align) { alignment = align; } + // 00a1a5d0 Draws no more than count characters, -1 for all. + void SetMaxCharacters(int16_t count) { maxCharacters = count; } + // 00a1a5e0 The most characters drawn, -1 for all. + int16_t GetMaxCharacters() { return maxCharacters; } + // 00a1a5f0 Whether lines wrap at words. + bool IsAutoWrapEnabled() { return wrapMode == FONT_WRAP_WORDS; } + // 00a1a600 Cuts lines wider than width short, ending them in an ellipsis. + void EnableTruncation(uint16_t width) + { + wrapMode = FONT_WRAP_TRUNCATE; + maxLineWidth = width; + } + // 00a1a620 Whether long lines end in an ellipsis. + bool IsTruncationEnabled() { return wrapMode == FONT_WRAP_TRUNCATE; } + // 00a1a630 The character drawn for those the font lacks, before the font's own missing glyph. + void SetMissingCharacterOverride(int character) { missingCharacterOverride = character; } +}; + +// A BMFont bitmap font (binary .fnt, version 3): its glyphs, kerning and page images, measured and drawn as UTF-8 or +// UTF-16 text. +// Construction and destruction (00a1a640) are the defaults. +struct Font +{ + std::unordered_map glyphIndices; + std::vector glyphs; + std::vector kernings; + std::vector pages; + int missingCharacter = GLYPH_NONE; + uint16_t base = 0; + uint16_t lineHeight = 0; + bool isLoaded = false; + + bool Load(std::string_view path); + void Unload(); + + int GetCharacterWidth(uint32_t character); + int GetStringWidth(std::string_view text); + int GetStringWidth(std::u16string_view text); + // 00a1aea0 The distance between lines. + uint16_t GetLineHeight() { return lineHeight; } + // 00a1aeb0 The distance from a line's top to its baseline. + uint16_t GetBaselineHeight() { return base; } + void SetMissingCharacter(uint32_t character); + + void DrawString(std::string_view text, Vector position, Vector scale, KColor color, FontSettings& settings); + void DrawString(std::u16string_view text, Vector position, Vector scale, KColor color, FontSettings& settings); + template + TextLayout measure_string(std::basic_string_view text, FontSettings& settings, Vector scale); + + int get_glyph_index(uint32_t character, int fallback = CHARACTER_NONE); + int get_kerning(uint32_t first, uint32_t second); + float render_glyph(GlyphDraw& draw, uint32_t& previous, Vector position, Vector scale, FontSettings& settings); + template + void render_lines(TextLayout& layout, Vector position, Vector scale, KColor color, FontSettings& settings); +}; + +const char* utf8_decode_next(const char* text, uint32_t* outCodepoint, const char* end); diff --git a/src/formatted_text.cpp b/src/formatted_text.cpp index 013d63d..d1dc78a 100644 --- a/src/formatted_text.cpp +++ b/src/formatted_text.cpp @@ -1,163 +1,97 @@ -#include "classes.h" -#include "msvc.h" +#include "formatted_text.h" +#include "font.h" #include -#include -// FormattedText::_flags: its lines point into the caller's text rather than into copies of their own. -constexpr uint8_t FORMATTED_TEXT_BORROWED = 1; -// FormattedTextLine::_flags: the line ends inside a word too long for one line. -constexpr uint8_t FORMATTED_LINE_HYPHENATED = 2; -// The most 12-byte lines an MSVC vector holds. -constexpr uint32_t LINES_MAX = 0x15555555; -// deallocate frees 4-byte words. -constexpr uint32_t LINE_WORDS = sizeof(FormattedTextLine) / sizeof(uint32_t); -constexpr char ESCAPED_NEWLINE[] = "\\n"; -// A broken word's lines leave room for this after them. -constexpr char HYPHEN[] = "-"; -constexpr uint32_t ESCAPED_NEWLINE_LENGTH = sizeof(ESCAPED_NEWLINE) - 1; +// The written newline the layout also breaks at: a backslash and an n. +constexpr char ESCAPE = '\\'; +constexpr char ESCAPED_NEWLINE = 'n'; -using TextMeasure = uint32_t (*)(uint8_t* text, uint32_t length, void* userData); - -// What FormattedText::set measures text with. -struct TextMeasureContext +// Appends the line from start to end, its length cut to 16 bits as the game stores it. +template +static void line_push(std::vector>& lines, const Char* start, const Char* end, uint8_t flags = 0) { - Font* font; - float scale; -}; - -// The scaled pixel width of length bytes of text. -static uint32_t text_measure(uint8_t* text, uint32_t length, void* userData) -{ - auto context = (TextMeasureContext*)userData; - return (uint32_t)((float)(uint32_t)context->font->get_string_width_n(text, length) * context->scale); + lines.push_back({{start, (uint16_t)(end - start)}, flags}); } -static FormattedTextLine* lines_begin(std_vector& lines) +// The first character at or after start, or nullptr when the text has none. +template +static const Char* char_find(const Char* start, const Char* end, Char character) { - return (FormattedTextLine*)lines._begin; + const Char* found = std::find(start, end, character); + return found == end ? nullptr : found; } -static uint32_t lines_capacity(std_vector& lines) +// 00a56750 The width of UTF-8 text at the measure's scale, truncated as the layout measures it. +uint32_t text_measure(TextMeasure measure, std::string_view text) { - return (FormattedTextLine*)lines._capacity - lines_begin(lines); + return (uint32_t)((float)(uint32_t)measure.font.GetStringWidth(text) * measure.scale); } -// The storage MSVC's vector grows to for at least count lines: half as much again as now. -static uint32_t lines_growth(std_vector& lines, uint32_t count) +// 00a56bf0 The width of UTF-16 text at the measure's scale, truncated as the layout measures it. +uint32_t text_measure(TextMeasure measure, std::u16string_view text) { - uint32_t capacity = lines_capacity(lines); - return capacity > LINES_MAX - capacity / 2 ? LINES_MAX : std::max(capacity + capacity / 2, count); + return (uint32_t)((float)(uint32_t)measure.font.GetStringWidth(text) * measure.scale); } -// Moves the lines to new storage with room for capacity of them. -static void lines_reallocate(std_vector& lines, uint32_t capacity) +// 00a55b70 A layout of one line, viewing the caller's text. +template +TextLayout::TextLayout(Line line) : lines{line} { - auto begin = lines_begin(lines); - auto end = (FormattedTextLine*)lines._end; - auto storage = (FormattedTextLine*)msvc::_Allocate(capacity * sizeof(FormattedTextLine)); - - std::copy(begin, end, storage); - if (begin) deallocate(begin, lines_capacity(lines) * LINE_WORDS); - lines._begin = storage; - lines._end = storage + (end - begin); - lines._capacity = storage + capacity; } -// Appends the line from start to end, its length cut to 16 bits. -static void line_push(std_vector& lines, char* start, char* end, uint8_t flags = 0) +// 00a55c40 Lays text out into lines no wider than maxWidth, viewing the text or a shared copy of it. +template +void TextLayout::set(View text, TextMeasure measure, int maxWidth, TextStorage storage) { - uint32_t count = (FormattedTextLine*)lines._end - lines_begin(lines); - FormattedTextLine line = {}; + lines.clear(); + copy.reset(); + parse(text, maxWidth, lines, measure); + if (storage == TextStorage::BORROWED) return; - if (lines._end == lines._capacity) lines_reallocate(lines, lines_growth(lines, count + 1)); - line._flags = flags; - line._text = start; - line._length = (uint16_t)(end - start); - lines_begin(lines)[count] = line; - lines._end = lines_begin(lines) + count + 1; + copy = std::make_shared>(text); + for (Line& line : lines) line.text = View(copy->data() + (line.text.data() - text.data()), line.text.size()); } -// Gives every line its own copy of its text. -static void lines_own(std_vector& lines) +// 00a55ef0, 00a56060 Splits text at each newline, every piece a line, the empty ones too. +template +void TextLayout::split_lines(View text, std::vector& lines) { - for (auto line = lines_begin(lines); line != lines._end; line++) - { - auto text = (char*)operator_new_tracked(line->_length); + const Char* start = text.data(); + const Char* end = start + text.size(); - std::memcpy(text, line->_text, line->_length); - line->_text = text; - } + for (const Char* newline; (newline = char_find(start, end, (Char)'\n')); start = newline + 1) + line_push(lines, start, newline); + line_push(lines, start, end); } -// 00a55c40 Lays text out into lines no wider than maxWidth with a font at a scale. The lines point into text unless -// isCopySegments gives them copies of their own. -void FormattedText::set(uint8_t* text, void* measureContext, int maxWidth, float scale, uint8_t isCopySegments) -{ - TextMeasureContext context = {(Font*)measureContext, scale}; - - if (!(_flags & FORMATTED_TEXT_BORROWED)) - for (auto line = lines_begin(_lines); line != _lines._end; line++) tracked_alloc(TRACKED_FREE, line->_text, 0); - _lines._end = _lines._begin; - - parse(text, maxWidth, &_lines, (void*)text_measure, &context); - if (!isCopySegments) - { - _flags |= FORMATTED_TEXT_BORROWED; - return; - } - - _flags &= ~FORMATTED_TEXT_BORROWED; - lines_own(_lines); -} - -// 00a55e20 Copies other's lines, each with a copy of its text unless they point into a caller's text. -// The text this held is not freed, as in the game. -void* FormattedText::operator_assign(void* other) -{ - auto source = (FormattedText*)other; - - _flags = source->_flags; - if (source != this) - { - auto begin = lines_begin(source->_lines); - auto end = (FormattedTextLine*)source->_lines._end; - - if ((uint32_t)(end - begin) > lines_capacity(_lines)) lines_reallocate(_lines, lines_growth(_lines, end - begin)); - _lines._end = std::copy(begin, end, lines_begin(_lines)); - } - if (!(_flags & FORMATTED_TEXT_BORROWED)) lines_own(_lines); - return this; -} - -// 00a56350 Splits text into the lines of outLines, no wider than maxWidth as measureFn measures them. Lines break at -// spaces and at newlines, written or escaped, and a word too wide for a line is broken across lines. +// 00a56350, 00a56790 Splits text into lines no wider than maxWidth. Lines break at spaces and at newlines, written +// or escaped, and a word too wide for a line is broken across lines that end in a hyphen. // The game ignores newlines inside the rest of the text once no space is left in it, and so does this. -void FormattedText::parse(uint8_t* text, uint32_t maxWidth, void* outLines, void* measureFn, void* userData) +template +void TextLayout::parse(View text, uint32_t maxWidth, std::vector& lines, TextMeasure measure) { - auto& lines = *(std_vector*)outLines; - auto measure = (TextMeasure)measureFn; - auto cursor = (char*)text; - char* lineStart = cursor; - char* textEnd = cursor + std::strlen(cursor); + const Char space[] = {' '}; + const Char hyphen[] = {'-'}; + const Char* cursor = text.data(); + const Char* lineStart = cursor; + const Char* textEnd = cursor + text.size(); uint32_t lineWidth = 0; - uint32_t spaceWidth = measure((uint8_t*)" ", 1, userData); + uint32_t spaceWidth = text_measure(measure, View(space, 1)); while (cursor < textEnd) { - char* wordStart = cursor; - char* wordEnd = std::strchr(cursor, ' '); - char* newline = std::strchr(cursor, '\n'); - bool isEscaped = std::strncmp(cursor, ESCAPED_NEWLINE, ESCAPED_NEWLINE_LENGTH) == 0; + const Char* wordStart = cursor; + const Char* wordEnd = char_find(cursor, textEnd, (Char)' '); + const Char* newline = char_find(cursor, textEnd, (Char)'\n'); + bool isEscaped = cursor + 1 < textEnd && cursor[0] == ESCAPE && cursor[1] == ESCAPED_NEWLINE; bool isNewline = *cursor == '\n' || isEscaped; if (wordEnd && newline && newline < wordEnd) wordEnd = newline; if (!wordEnd) wordEnd = textEnd; - uint32_t length = wordEnd - cursor; - if (*cursor == '\n') length = 1; - if (isEscaped) length = ESCAPED_NEWLINE_LENGTH; + uint32_t length = isEscaped ? 2 : *cursor == '\n' ? 1 : wordEnd - cursor; + uint32_t wordWidth = text_measure(measure, View(cursor, length)); - uint32_t wordWidth = measure((uint8_t*)cursor, length, userData); cursor += length + !isNewline; if (lineWidth + wordWidth <= maxWidth && !isNewline) { @@ -173,23 +107,26 @@ void FormattedText::parse(uint8_t* text, uint32_t maxWidth, void* outLines, void lineWidth = isNewline ? 0 : wordWidth; if (lineWidth <= maxWidth) continue; - char* breakEnd = lineStart + length; - uint32_t hyphenWidth = measure((uint8_t*)HYPHEN, 1, userData); + const Char* breakEnd = lineStart + length; + uint32_t hyphenWidth = text_measure(measure, View(hyphen, 1)); while (lineStart < breakEnd) { - char* lineEnd = lineStart; + const Char* lineEnd = lineStart; while (hyphenWidth < maxWidth && lineEnd < breakEnd) - if (measure((uint8_t*)lineStart, ++lineEnd - lineStart, userData) + hyphenWidth >= maxWidth) break; + if (text_measure(measure, View(lineStart, ++lineEnd - lineStart)) + hyphenWidth >= maxWidth) break; if (lineEnd == lineStart) lineEnd++; - line_push(lines, lineStart, lineEnd, lineEnd < breakEnd ? FORMATTED_LINE_HYPHENATED : 0); + line_push(lines, lineStart, lineEnd, lineEnd < breakEnd ? TEXT_LINE_HYPHENATED : 0); lineStart = lineEnd; - lineWidth = measure((uint8_t*)lineEnd, breakEnd - lineEnd, userData); + lineWidth = text_measure(measure, View(lineEnd, breakEnd - lineEnd)); if (lineWidth <= maxWidth) break; } } - if (textEnd - lineStart > 0) line_push(lines, lineStart, textEnd); + if (textEnd > lineStart) line_push(lines, lineStart, textEnd); } + +template struct TextLayout; +template struct TextLayout; diff --git a/src/formatted_text.h b/src/formatted_text.h new file mode 100644 index 0000000..3f6005e --- /dev/null +++ b/src/formatted_text.h @@ -0,0 +1,65 @@ +#pragma once + +#include +#include +#include +#include +#include + +struct Font; + +// TextLine::flags: what is drawn after a line for the text cut from its end. +enum TextLineFlag : uint8_t +{ + TEXT_LINE_TRUNCATED = 1, + TEXT_LINE_HYPHENATED = 2 +}; + +// Whether laid-out lines view the caller's text or a copy of their own. +enum class TextStorage +{ + BORROWED, + COPIED +}; + +// The font and scale text is measured with while it is laid out. +struct TextMeasure +{ + Font& font; + float scale = 1; +}; + +// One laid-out line: a view of its text and the TextLineFlag marks drawn after it. +template struct TextLine +{ + std::basic_string_view text; + uint8_t flags = 0; +}; + +// Text laid out into lines, UTF-8 for most drawing and UTF-16 for the wide drawing calls. A copied text is shared by +// copies of the layout, so their lines stay valid. +// Copies, assignment, clearing and destruction (00a55e20, 00a55d60, 00a561f0) are the defaults. +template struct TextLayout +{ + using Line = TextLine; + using View = std::basic_string_view; + + std::vector lines; + std::shared_ptr> copy; + + TextLayout() = default; + TextLayout(Line line); + + void set(View text, TextMeasure measure, int maxWidth, TextStorage storage); + static void split_lines(View text, std::vector& lines); + static void parse(View text, uint32_t maxWidth, std::vector& lines, TextMeasure measure); +}; + +// UTF-8 text laid out into lines. +struct FormattedText : TextLayout +{ + using TextLayout::TextLayout; +}; + +uint32_t text_measure(TextMeasure measure, std::string_view text); +uint32_t text_measure(TextMeasure measure, std::u16string_view text); diff --git a/src/gl.h b/src/gl.h index ddaee3c..fbbd18b 100644 --- a/src/gl.h +++ b/src/gl.h @@ -13,6 +13,7 @@ X(BlendEquation) \ X(BlendFuncSeparate) \ X(CheckFramebufferStatus) \ + X(ClampColor) \ X(Clear) \ X(ClearColor) \ X(ClearDepth) \ diff --git a/src/log.h b/src/log.h index 3a99168..b1eae9e 100644 --- a/src/log.h +++ b/src/log.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + // The levels KAGE_LogMessage prints with, each with its own prefix. enum LogLevel : unsigned int { @@ -9,3 +12,10 @@ enum LogLevel : unsigned int LOG_ERROR = 8, LOG_ASSERT = 16 }; + +// Stops the game where it reaches a method of a taken-over class that is not written yet, as the generated stubs do. +[[noreturn]] inline void reconstruction_missing(const char* name) +{ + std::fprintf(stderr, "Reached %s, not reconstructed yet\n", name); + std::exit(1); +} diff --git a/src/main.cpp b/src/main.cpp index 244265a..ce969c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,80 @@ #include "classes.h" +#include "data.h" +#include "gl.h" +#include "platform.h" +#include +#include +#include +#include +#include -// The Linux entry point hands over to the game's own main. +constexpr const char* GAME_VERSION = "J460"; +constexpr const char* LOCALHOST_FLAG = "--localhost_match"; +constexpr const char* RESOURCES_FLAG = "--resources"; +constexpr const char* LOG_FILE = "log.txt"; +constexpr const char* LOCALHOST_LOG = "localhost/log_"; +constexpr const char* CLAMP_COLOR_EXTENSION = "GL_ARB_color_buffer_float"; +// GL 3.0, as major * 10 + minor. +constexpr int CLAMP_COLOR_VERSION = 30; +constexpr int VERSION_MINOR_DIGITS = 10; + +// The context's GL version as major * 10 + minor, 0 without one. +static int gl_version_get() +{ + const char* version = gl.GetString ? (const char*)gl.GetString(GL_VERSION) : nullptr; + int major = 0; + int minor = 0; + + if (version) std::sscanf(version, "%d.%d", &major, &minor); + return major * VERSION_MINOR_DIGITS + minor; +} + +// 00931050 Starts the engine and the game, logging the command line, then runs one frame at a time at 60 Hz until +// the window closes. "--localhost_match" logs to a timestamped file under localhost/ instead of log.txt. +// The theora log hook, COM, the Win32 window-move listener, Steam and the Windows power and timer settings are left +// out. A debug flag nothing sets (DAT_00c35e68) would skip the update and render. +int IsaacMain(int argc, uint8_t** argv) +{ + platform.directories_load(); + + std::string logPath = platform.userDataDirectory + LOG_FILE; + for (int i = 0; i < argc; i++) + { + if (std::strcmp((const char*)argv[i], LOCALHOST_FLAG) != 0) continue; + logPath = platform.userDataDirectory + LOCALHOST_LOG + std::to_string(std::time(nullptr)) + ".txt"; + break; + } + log_open(logPath); + platform.bindings_load(); + platform.engine_init(); + + log_printf(LOG_INFO, "Command Line: \n"); + for (int i = 0; i < argc; i++) log_printf(LOG_INFO, "\t%s\n", (const char*)argv[i]); + log_printf(LOG_INFO, "Game Version: %s \n", GAME_VERSION); + if (gl.ClampColor && (SDL_GL_ExtensionSupported(CLAMP_COLOR_EXTENSION) || gl_version_get() >= CLAMP_COLOR_VERSION)) + gl.ClampColor(GL_CLAMP_VERTEX_COLOR, GL_FALSE); + + FontKerningPair::IsaacStartup(argc, argv); + while (true) + { + g_manager->_framesPerSecond = platform.frame_begin(); + KAGE::System::update(); + Manager::Update(1); + g_manager->Render(); + if (g_game) FUN_008657c0(); + if (platform.isQuitRequested) break; + platform.frame_wait(); + } + + Isaac::Shutdown(); + kage_shutdown(); + return 0; +} + +// The Linux entry point: "--resources " says where the imported game files are, then the game's own main runs. int main(int argc, char** argv) { + for (int i = 1; i + 1 < argc; i++) + if (std::strcmp(argv[i], RESOURCES_FLAG) == 0) dataDirectory = std::string(argv[i + 1]) + "/"; return IsaacMain(argc, (uint8_t**)argv); } diff --git a/src/msvc.h b/src/msvc.h deleted file mode 100644 index 0322518..0000000 --- a/src/msvc.h +++ /dev/null @@ -1,113 +0,0 @@ -#pragma once - -#include "classes.h" -#include - -// What tracked_alloc does with its block. -enum TrackedAllocMode : uint8_t -{ - TRACKED_ALLOCATE = 0, - TRACKED_FREE = 1 -}; - -constexpr uint8_t TREE_BLACK = 1; - -// A node of an MSVC std::map the game keeps in a std_map. The tree's head is a black nil node that links to the -// leftmost node, the root and the rightmost node, and to itself while the map is empty. -template struct MsvcTreeNode -{ - MsvcTreeNode* _left; - MsvcTreeNode* _parent; - MsvcTreeNode* _right; - uint8_t _color; - bool _isNil; - Key _key; - Value _value; -}; - -template void tree_head_reset(Node* head) -{ - head->_left = head; - head->_parent = head; - head->_right = head; -} - -template std_map tree_create() -{ - auto head = (Node*)operator_new(sizeof(Node)); - - tree_head_reset(head); - head->_color = TREE_BLACK; - head->_isNil = true; - return {head, 0}; -} - -// The node holding key, or the nil head when the map lacks it. -template > Node* tree_find(std_map& map, Key key, Less isLess = {}) -{ - auto head = (Node*)map._head; - Node* bound = head; - - for (Node* node = head->_parent; !node->_isNil;) - { - if (isLess(node->_key, key)) node = node->_right; - else - { - bound = node; - node = node->_left; - } - } - return bound->_isNil || isLess(key, bound->_key) ? head : bound; -} - -// The node after this one in key order, or the head after the last. -template Node* tree_next(Node* node) -{ - if (!node->_right->_isNil) - { - node = node->_right; - while (!node->_left->_isNil) node = node->_left; - return node; - } - - Node* parent = node->_parent; - while (!parent->_isNil && node == parent->_right) - { - node = parent; - parent = parent->_parent; - } - return parent; -} - -// Frees a subtree, right branches by recursion and left ones in the loop, destroying each value first. -template void tree_erase(Node* node, void (*destroy)(decltype(Node::_value)&)) -{ - while (!node->_isNil) - { - Node* left = node->_left; - - tree_erase(node->_right, destroy); - if (destroy) destroy(node->_value); - operator_delete(node, sizeof(Node)); - node = left; - } -} - -// Empties a map, keeping its head. -template void tree_clear(std_map& map, void (*destroy)(decltype(Node::_value)&) = nullptr) -{ - auto head = (Node*)map._head; - - tree_erase(head->_parent, destroy); - tree_head_reset(head); - map._size = 0; -} - -// Frees a whole map, head and all, as its destructor does. -template void tree_destroy(std_map& map) -{ - auto head = (Node*)map._head; - - tree_erase(head->_parent, nullptr); - operator_delete(head, sizeof(Node)); -} diff --git a/src/options_config.cpp b/src/options_config.cpp index a264893..54e006c 100644 --- a/src/options_config.cpp +++ b/src/options_config.cpp @@ -1,149 +1,320 @@ #include "classes.h" +#include "data.h" +#include "log.h" #include "options_config.h" -#include +#include +#include +#include +#include +#include +#include +#include -constexpr float DEFAULT_VOLUME = 0.3f; -constexpr float DEFAULT_MAP_OPACITY = 0.3f; -constexpr int DEFAULT_ONLINE_PLAYER_VOLUME = 6; -constexpr int DEFAULT_ONLINE_PLAYER_OPACITY = 10; -constexpr int DEFAULT_ONLINE_INPUT_DELAY = 3; -constexpr int DEFAULT_MAX_SCALE = 99; -constexpr int DEFAULT_MAX_RENDER_SCALE = 2; -constexpr int DEFAULT_WINDOW_X = 8; -constexpr int DEFAULT_WINDOW_Y = 32; -// An MSVC string keeps up to 15 characters in its own buffer, and a pointer to the heap there past that. -constexpr uint32_t STRING_INLINE_CAPACITY = 15; +constexpr const char* CONFIG_INI = "config.ini"; +constexpr const char* OPTIONS_INI = "options.ini"; +constexpr std::string_view LEGACY_SAVE_FOLDER = "Binding of Isaac Afterbirth+"; +constexpr std::string_view SAVE_FOLDER = "Binding of Isaac Repentance+"; +constexpr std::string_view WHITESPACE = " \t\f\v\r\n"; +constexpr int LINE_LENGTH = 256; +constexpr int ONLINE_INPUT_DELAY_MAX = 5; +constexpr int ONLINE_LEVEL_MAX = 10; +constexpr WindowSetting LOAD_WINDOW_SETTINGS[] = {WINDOW_VSYNC, WINDOW_CURSOR, WINDOW_POSITION, WINDOW_FULLSCREEN}; -// A node of the MSVC std::map an .ini file is parsed into. -struct StringMapNode +// The pieces std::getline cuts text into at separator, which drops an empty last piece. +static std::vector text_split(std::string_view text, char separator) { - StringMapNode* left; - StringMapNode* parent; - StringMapNode* right; - char color; - bool isNil; - alignas(void*) std_string key; - std_string value; -}; -LAYOUT32(offsetof(StringMapNode, value) == 0x28 && sizeof(StringMapNode) == 0x40); + std::vector pieces; -static char* string_text(std_string& text) -{ - return text._capacity <= STRING_INLINE_CAPACITY ? text._buf : *(char**)text._buf; -} - -static std::string_view string_view_get(std_string& text) -{ - return {string_text(text), text._size}; -} - -// The value stored under key, or null when the map has none. -static std_string* keyvalue_find(std_map* map, std::string_view key) -{ - auto head = (StringMapNode*)map->_head; - StringMapNode* bound = head; - - for (StringMapNode* node = head->parent; !node->isNil;) + while (!text.empty()) { - if (string_view_get(node->key) < key) node = node->right; - else - { - bound = node; - node = node->left; - } + size_t end = text.find(separator); + pieces.push_back(text.substr(0, end)); + text = end == text.npos ? std::string_view() : text.substr(end + 1); } - - bool isFound = !bound->isNil && !(key < string_view_get(bound->key)); - return isFound ? &bound->value : nullptr; + return pieces; } -// 006841d0 A key's value as a bool, true for "true", "True" or a nonzero number, and the default when missing or empty. -// Its this is not an OptionsConfig but the key-value map an .ini file was parsed into. -uint8_t OptionsConfig::read_bool(uint8_t* key, uint8_t isDefault) +// The text without the whitespace around it. +static std::string_view text_trim(std::string_view text) { - std_string* value = keyvalue_find((std_map*)this, (char*)key); - if (!value || value->_size == 0) return isDefault; + size_t start = text.find_first_not_of(WHITESPACE); + if (start == text.npos) return {}; - char* text = string_text(*value); - return !strcmp(text, "true") || !strcmp(text, "True") || atoi(text) != 0; + return text.substr(start, text.find_last_not_of(WHITESPACE) + 1 - start); } -// 00924000 Puts every option options.ini holds back to its default, the window at the size it has now. -void OptionsConfig::reset_defaults() +// 00683d00 Reads key=value lines into a map, trimmed, skipping lines without exactly one '=' or with no key. +// A later line with the same key wins. +KeyValueMap keyvalue_map_parse(std::string_view text) { - int windowSize[2]; + KeyValueMap map; - _musicVolume = DEFAULT_VOLUME; - _sfxVolume = DEFAULT_VOLUME; - _mapOpacity = DEFAULT_MAP_OPACITY; - _brightness = 0; - _contrast = 1; - _exposure = 1; - _gamma = 1; - _hudOffset = 1; + for (std::string_view line : text_split(text, '\n')) + { + std::vector pair = text_split(text_trim(line), '='); + if (pair.size() != 2) continue; - _announcerVoiceMode = ANNOUNCER_VOICE_MODE_RANDOM; - _cameraStyle = CAMERA_STYLE_ACTIVE_CAM_ON; - _consoleFont = CONSOLE_FONT_DEFAULT; - _eosCrossplay = 0; - _historyHudMode = EXTRA_HUD_STYLE_OFF; - _onlineColorSet = 0; - _onlineHud = 0; - _onlineInputDelay = DEFAULT_ONLINE_INPUT_DELAY; - _onlinePlayerOpacity = DEFAULT_ONLINE_PLAYER_OPACITY; - _onlinePlayerVolume = DEFAULT_ONLINE_PLAYER_VOLUME; - _popupsMode = 1; - _touchMode = 1; - - _acceptedDataCollectionDisclaimer = false; - _acceptedPublicBeta_VERSION = false; - _ascentVoiceover = true; - _bossHpOnBottom = true; - _controlHotplugEnabled = true; - _enableAimLock = true; - _enableBulletVisibility = false; - _enableChargeBars = false; - _enableDebugConsole = false; - _enableEpicOverlay = true; - _enableFadedConsoleDisplay = false; - _enableFoundHUD = false; - _enableMods = true; - _enableMouseControl = false; - _enablePauseOnFocusLost = true; - _enableRumble = true; - _enableSaveCommandHistory = true; - _enableSteamCloud = true; - _enableVSync = true; - _filterEnabled = false; - _isExclusiveFullscreen = false; - _isFullscreen = false; - _itemInfoDisplayEnabled = false; - _onlineChatEnabled = true; - _onlineFilterEnabled = true; - _streamerMode = false; - _tryImportSave = false; - - glfw_get_window_size(windowSize, 0); - _maxRenderScale = DEFAULT_MAX_RENDER_SCALE; - _maxScale = DEFAULT_MAX_SCALE; - _windowHeight = windowSize[1]; - _windowPosX = DEFAULT_WINDOW_X; - _windowPosY = DEFAULT_WINDOW_Y; - _windowWidth = windowSize[0]; - - _optionsIniFilePath._size = 0; - string_text(_optionsIniFilePath)[0] = '\0'; + std::string_view key = text_trim(pair[0]); + if (!key.empty()) map.insert_or_assign(std::string(key), std::string(text_trim(pair[1]))); + } + return map; } -// 00925c60 Switches fullscreen on or off, going back to the saved window size, position and cursor when off. -void OptionsConfig::set_fullscreen(uint8_t isFullscreen) +// 00684590 A key's value, or an empty one when the map lacks it. +std::string keyvalue_map_get(KeyValueMap& map, std::string_view key) { - _isFullscreen = isFullscreen; - KAGE_Graphics::set_fullscreen(isFullscreen, _isExclusiveFullscreen); - if (_isFullscreen) return; - - int windowSize[] = {_windowWidth, _windowHeight}; - KAGE_Graphics::set_window_size(windowSize); - glfw_set_window_pos(_windowPosX, _windowPosY); - glfwSetInputMode(g_glfwWindow, _enableMouseControl ? GLFW_CURSOR_HIDDEN : GLFW_CURSOR_NORMAL); + auto found = map.find(key); + return found == map.end() ? std::string() : found->second; +} + +// 00684130 A key's value as an int, or the fallback when it is missing or empty. +int keyvalue_map_read_int(KeyValueMap& map, std::string_view key, int fallback) +{ + std::string value = keyvalue_map_get(map, key); + return value.empty() ? fallback : std::atoi(value.c_str()); +} + +// 006843a0 A key's value as a float, or the fallback when it is missing or empty. +float keyvalue_map_read_float(KeyValueMap& map, std::string_view key, float fallback) +{ + std::string value = keyvalue_map_get(map, key); + return value.empty() ? fallback : (float)std::atof(value.c_str()); +} + +// 006841d0 Whether a key reads "true", "True" or a nonzero number, or the fallback when it is missing or empty. +bool is_keyvalue_map_true(KeyValueMap& map, std::string_view key, bool isFallback) +{ + std::string value = keyvalue_map_get(map, key); + if (value.empty()) return isFallback; + + return value == "true" || value == "True" || std::atoi(value.c_str()) != 0; +} + +// The .ini file at path read up to its first NUL and parsed, or nothing when it cannot be read. +static std::optional ini_load(const char* path) +{ + char* text = (char*)SDL_LoadFile(path, nullptr); + if (!text) return std::nullopt; + + KeyValueMap map = keyvalue_map_parse(text); + SDL_free(text); + return map; +} + +// Reads an option, keeping its current value when the key is missing or empty. +static void option_read(KeyValueMap& map, const char* key, bool& value) +{ + value = is_keyvalue_map_true(map, key, value); +} + +// Floats, which atof reads. +static void option_read(KeyValueMap& map, const char* key, float& value) +{ + value = keyvalue_map_read_float(map, key, value); +} + +// Ints and the enums options.ini stores as ints. +template static void option_read(KeyValueMap& map, const char* key, T& value) +{ + value = (T)keyvalue_map_read_int(map, key, value); +} + +// Adds a key=value line, floats with 4 decimals. +static void line_write(std::string& text, const char* key, float value) +{ + char line[LINE_LENGTH]; + text.append(line, std::snprintf(line, sizeof(line), "%s=%.4f\r\n", key, value)); +} + +// Ints, bools and enums, all written as numbers. +static void line_write(std::string& text, const char* key, int value) +{ + char line[LINE_LENGTH]; + text.append(line, std::snprintf(line, sizeof(line), "%s=%d\r\n", key, value)); +} + +// Calls visit with each option options.ini holds under its own key, in the order Save writes them. +template static void options_visit(OptionsConfig& options, Visit visit) +{ + visit("SFXVolume", options.sfxVolume); + visit("MapOpacity", options.mapOpacity); + visit("Fullscreen", options.isFullscreen); + visit("Filter", options.isFilterEnabled); + visit("Exposure", options.exposure); + visit("Gamma", options.gamma); + visit("ControllerHotplug", options.isControllerHotplugEnabled); + visit("PopUps", options.popupsMode); + visit("CameraStyle", options.cameraStyle); + visit("ShowRecentItems", options.historyHudMode); + visit("HudOffset", options.hudOffset); + visit("TryImportSave", options.isTryImportSave); + visit("FoundHUD", options.isFoundHudEnabled); + visit("EnableMods", options.isModsEnabled); + visit("RumbleEnabled", options.isRumbleEnabled); + visit("ChargeBars", options.isChargeBarsEnabled); + visit("BulletVisibility", options.isBulletVisibilityEnabled); + visit("TouchMode", options.touchMode); + visit("AimLock", options.isAimLockEnabled); + visit("JacobEsauControls", options.jacobEsauControls); + visit("AscentVoiceOver", options.isAscentVoiceover); + visit("OnlineHud", options.onlineHud); + visit("StreamerMode", options.isStreamerMode); + visit("OnlinePlayerVolume", options.onlinePlayerVolume); + visit("OnlinePlayerOpacity", options.onlinePlayerOpacity); + visit("OnlineChatEnabled", options.isOnlineChatEnabled); + visit("OnlineChatFilterEnabled", options.isOnlineFilterEnabled); + visit("MultiplayerColorSet", options.onlineColorSet); + visit("OnlineInputDelay", options.onlineInputDelay); + visit("ItemInfoDisplayEnabled", options.isItemInfoDisplayEnabled); + visit("AcceptedPublicBeta_v1.9.7.17", options.isPublicBetaAccepted); + visit("AcceptedDataCollectionDisclaimer", options.isDataCollectionDisclaimerAccepted); + visit("EnableDebugConsole", options.isDebugConsoleEnabled); + visit("MaxScale", options.maxScale); + visit("MaxRenderScale", options.maxRenderScale); + visit("VSync", options.isVsyncEnabled); + visit("PauseOnFocusLost", options.isPauseOnFocusLostEnabled); + visit("SteamCloud", options.isSteamCloudEnabled); + visit("MouseControl", options.isMouseControlEnabled); + visit("BossHpOnBottom", options.isBossHpOnBottom); + visit("AnnouncerVoiceMode", options.announcerVoiceMode); + visit("ConsoleFont", options.consoleFont); + visit("FadedConsoleDisplay", options.isFadedConsoleDisplayEnabled); + visit("SaveCommandHistory", options.isSaveCommandHistoryEnabled); + visit("WindowWidth", options.windowWidth); + visit("WindowHeight", options.windowHeight); + visit("WindowPosX", options.windowPosX); + visit("WindowPosY", options.windowPosY); + visit("UseExclusiveFullscreen", options.isExclusiveFullscreen); + visit("EnableEpicOverlay", options.isEpicOverlayEnabled); + visit("EosCrossplay", options.eosCrossplay); +} + +// Where options.ini lives on Linux: in the save folder SDL keeps under the user's data directory. +std::string options_path() +{ + char* folder = SDL_GetPrefPath("", SAVE_FOLDER.data()); + std::string path = std::string(folder ? folder : "") + OPTIONS_INI; + + SDL_free(folder); + return path; +} + +// 00924000 Puts every option options.ini holds back to its default, keeping config.ini's switches and taking the +// window's current size. +// The original leaves jacobEsauControls as it was, unset before the first load. This resets it to its default 1. +void OptionsConfig::defaults_reset() +{ + RenderConfig kept = render; + + *this = {}; + render = kept; + window_size_load(*this); +} + +// 00924180 Reads config.ini's effect switches, each on unless the file turns it off. +void OptionsConfig::config_ini_load() +{ + render = {}; + std::optional map = ini_load(resource_path(CONFIG_INI).c_str()); + if (!map) return; + + option_read(*map, "EnableColorCorrection", render.isColorCorrectionEnabled); + option_read(*map, "EnableCaustics", render.isCausticsEnabled); + option_read(*map, "EnableShockwave", render.isShockwaveEnabled); + option_read(*map, "EnableLighting", render.isLightingEnabled); + option_read(*map, "EnableFilter", render.isFilterEnabled); + option_read(*map, "EnablePixelation", render.isPixelationEnabled); + option_read(*map, "EnableBloom", render.isBloomEnabled); + option_read(*map, "EnableWaterSurface", render.isWaterSurfaceEnabled); + option_read(*map, "EnableInterpolation", render.isInterpolationEnabled); + option_read(*map, "EnableColorModifier", render.isColorModifierEnabled); + render.isWaterOverlayEnabled = render.isWaterSurfaceEnabled; +} + +// 00924440 Reads options.ini at path, falling back to Afterbirth+'s and then to writing the defaults, and applies the +// sound and window options. +// Afterbirth+'s options keep everything but its gamma and HUD offset. Brightness and contrast are read, never saved. +// AscentVoiceOver is read as a number, so "true" turns it off. +void OptionsConfig::Load(std::string_view path) +{ + defaults_reset(); + optionsIniFilePath = path; + + std::optional map = ini_load(optionsIniFilePath.c_str()); + bool isLegacy = !map; + if (isLegacy) + { + std::string legacyPath = optionsIniFilePath; + size_t folder = legacyPath.rfind(SAVE_FOLDER); + + if (folder != legacyPath.npos) legacyPath.replace(folder, SAVE_FOLDER.size(), LEGACY_SAVE_FOLDER); + map = ini_load(legacyPath.c_str()); + } + if (!map) return Save(); + + KeyValueMap& values = *map; + g_manager->validate_language(keyvalue_map_read_int(values, "Language", 0)); + SetMusicVolume(keyvalue_map_read_float(values, "MusicVolume", musicVolume)); + if (!is_keyvalue_map_true(values, "MusicEnabled", true)) g_manager->_musicManager._isEnabled = false; + + options_visit(*this, [&](const char* key, auto& value) { option_read(values, key, value); }); + option_read(values, "Brightness", brightness); + option_read(values, "Contrast", contrast); + isAscentVoiceover = keyvalue_map_read_int(values, "AscentVoiceOver", 1) != 0; + g_manager->_sfxManager.ClearVolumeModifier(); + + onlinePlayerVolume = std::clamp(onlinePlayerVolume, 0, ONLINE_LEVEL_MAX); + onlinePlayerOpacity = std::clamp(onlinePlayerOpacity, 0, ONLINE_LEVEL_MAX); + onlineInputDelay = std::clamp(onlineInputDelay, 1, ONLINE_INPUT_DELAY_MAX); + if (windowPosX < WINDOW_POSITION_MIN || windowPosX > WINDOW_POSITION_MAX) windowPosX = DEFAULT_WINDOW_X; + if (windowPosY < WINDOW_POSITION_MIN || windowPosY > WINDOW_POSITION_MAX) windowPosY = DEFAULT_WINDOW_Y; + for (WindowSetting setting : LOAD_WINDOW_SETTINGS) window_apply(*this, setting); + + if (!isLegacy) return; + + gamma = 1; + hudOffset = 1; +} + +// 00924d10 Writes every option to options.ini, with the language and whether music plays. +void OptionsConfig::Save() +{ + std::string text = "[Options]\r\n"; + + line_write(text, "Language", g_manager->_stringTable._language); + line_write(text, "MusicVolume", musicVolume); + line_write(text, "MusicEnabled", g_manager->_musicManager._isEnabled); + options_visit(*this, [&](const char* key, auto value) { line_write(text, key, value); }); + text += "\r\n"; + if (SDL_SaveFile(optionsIniFilePath.c_str(), text.data(), text.size())) return; + + std::string message = "[warn] could not opn " + optionsIniFilePath + " for writing. options will not be saved.\n"; + KAGE_LogMessage(LOG_INFO, (uint8_t*)message.data()); +} + +// 00925c00 Sets the music volume, turning music off at 0, and moves the playing channel straight to it. +void OptionsConfig::SetMusicVolume(float volume) +{ + MusicManager& music = g_manager->_musicManager; + MusicChannel& channel = music._channels[music._currentChannel]; + + musicVolume = volume; + music._isEnabled = volume > 0; + channel._volume = musicVolume; + channel._targetVolume = musicVolume; +} + +// 00925c60 Switches fullscreen on or off, back to the saved window size, position and cursor when off. +void OptionsConfig::SetFullScreen(bool isEnabled) +{ + isFullscreen = isEnabled; + window_apply(*this, WINDOW_FULLSCREEN); +} + +// 00925ce0 Turns vsync on or off. The platform keeps it off for the session on a display that does not run at a +// multiple of 60Hz. +void OptionsConfig::vsync_set(bool isEnabled) +{ + isVsyncEnabled = isEnabled; + window_apply(*this, WINDOW_VSYNC); } diff --git a/src/options_config.h b/src/options_config.h index cf5f118..5a0b99d 100644 --- a/src/options_config.h +++ b/src/options_config.h @@ -1,13 +1,28 @@ #pragma once -// OptionsConfig::_cameraStyle, as REPENTOGON's CameraStyle. +#include +#include +#include + +constexpr float DEFAULT_VOLUME = 0.3f; +constexpr int DEFAULT_MAX_RENDER_SCALE = 2; +constexpr int DEFAULT_MAX_SCALE = 99; +constexpr int DEFAULT_ONLINE_INPUT_DELAY = 3; +constexpr int DEFAULT_ONLINE_PLAYER_OPACITY = 10; +constexpr int DEFAULT_ONLINE_PLAYER_VOLUME = 6; +constexpr int DEFAULT_WINDOW_X = 8; +constexpr int DEFAULT_WINDOW_Y = 32; +constexpr int WINDOW_POSITION_MIN = 8; +constexpr int WINDOW_POSITION_MAX = 0xffff; + +// The camera options, as REPENTOGON's CameraStyle. enum CameraStyle : int { CAMERA_STYLE_ACTIVE_CAM_ON = 1, CAMERA_STYLE_ACTIVE_CAM_OFF = 2 }; -// OptionsConfig::_historyHudMode, as REPENTOGON's ExtraHudStyle. +// The recent items HUD options, as REPENTOGON's ExtraHudStyle. enum ExtraHudStyle : int { EXTRA_HUD_STYLE_OFF = 0, @@ -15,7 +30,7 @@ enum ExtraHudStyle : int EXTRA_HUD_STYLE_ON_MINI = 2 }; -// OptionsConfig::_announcerVoiceMode, as REPENTOGON's AnnouncerVoiceMode. +// How often the announcer speaks, as REPENTOGON's AnnouncerVoiceMode. enum AnnouncerVoiceMode : int { ANNOUNCER_VOICE_MODE_RANDOM = 0, @@ -23,7 +38,7 @@ enum AnnouncerVoiceMode : int ANNOUNCER_VOICE_MODE_ALWAYS = 2 }; -// OptionsConfig::_consoleFont, as REPENTOGON's ConsoleFont. +// The debug console's font size, as REPENTOGON's ConsoleFont. enum ConsoleFont : int { CONSOLE_FONT_DEFAULT = 0, @@ -31,9 +46,116 @@ enum ConsoleFont : int CONSOLE_FONT_TINY = 2 }; -// The GLFW cursor modes the game sets on its window. Mouse control hides the cursor for the game's own crosshair. -enum CursorMode : int +// The window settings the platform layer applies, one at a time as the game changes them. +enum WindowSetting { - GLFW_CURSOR_NORMAL = 0x34001, - GLFW_CURSOR_HIDDEN = 0x34002 + WINDOW_CURSOR, + WINDOW_FULLSCREEN, + WINDOW_POSITION, + WINDOW_VSYNC }; + +// An .ini file's key=value pairs, keyed by the trimmed key. +using KeyValueMap = std::map>; + +// The effects config.ini switches, all on unless it turns them off. +struct RenderConfig +{ + bool isBloomEnabled = true; + bool isCausticsEnabled = true; + bool isColorCorrectionEnabled = true; + bool isColorModifierEnabled = true; + bool isFilterEnabled = true; + bool isInterpolationEnabled = true; + bool isLightingEnabled = true; + bool isPixelationEnabled = true; + bool isShockwaveEnabled = true; + bool isWaterOverlayEnabled = true; + bool isWaterSurfaceEnabled = true; +}; + +// The player's options, kept in options.ini as key=value lines, plus the effects config.ini switches. +// The defaults are the game's, with the window at whatever size it has when they are reset. +struct OptionsConfig +{ + std::string optionsIniFilePath; + RenderConfig render; + + float brightness = 0; + float contrast = 1; + float exposure = 1; + float gamma = 1; + float hudOffset = 1; + float mapOpacity = DEFAULT_VOLUME; + float musicVolume = DEFAULT_VOLUME; + float sfxVolume = DEFAULT_VOLUME; + + AnnouncerVoiceMode announcerVoiceMode = ANNOUNCER_VOICE_MODE_RANDOM; + CameraStyle cameraStyle = CAMERA_STYLE_ACTIVE_CAM_ON; + ConsoleFont consoleFont = CONSOLE_FONT_DEFAULT; + ExtraHudStyle historyHudMode = EXTRA_HUD_STYLE_OFF; + int eosCrossplay = 0; + int jacobEsauControls = 1; + int maxRenderScale = DEFAULT_MAX_RENDER_SCALE; + int maxScale = DEFAULT_MAX_SCALE; + int onlineColorSet = 0; + int onlineHud = 0; + int onlineInputDelay = DEFAULT_ONLINE_INPUT_DELAY; + int onlinePlayerOpacity = DEFAULT_ONLINE_PLAYER_OPACITY; + int onlinePlayerVolume = DEFAULT_ONLINE_PLAYER_VOLUME; + int popupsMode = 1; + int touchMode = 1; + int windowHeight = 0; + int windowPosX = DEFAULT_WINDOW_X; + int windowPosY = DEFAULT_WINDOW_Y; + int windowWidth = 0; + + bool isAimLockEnabled = true; + bool isAscentVoiceover = true; + bool isBossHpOnBottom = true; + bool isBulletVisibilityEnabled = false; + bool isChargeBarsEnabled = false; + bool isControllerHotplugEnabled = true; + bool isDataCollectionDisclaimerAccepted = false; + bool isDebugConsoleEnabled = false; + bool isEpicOverlayEnabled = true; + bool isExclusiveFullscreen = false; + bool isFadedConsoleDisplayEnabled = false; + bool isFilterEnabled = false; + bool isFoundHudEnabled = false; + bool isFullscreen = false; + bool isItemInfoDisplayEnabled = false; + bool isModsEnabled = true; + bool isMouseControlEnabled = false; + bool isOnlineChatEnabled = true; + bool isOnlineFilterEnabled = true; + bool isPauseOnFocusLostEnabled = true; + bool isPublicBetaAccepted = false; + bool isRumbleEnabled = true; + bool isSaveCommandHistoryEnabled = true; + bool isSteamCloudEnabled = true; + bool isStreamerMode = false; + bool isTryImportSave = false; + bool isVsyncEnabled = true; + + void defaults_reset(); + void config_ini_load(); + void Load(std::string_view path); + void Save(); + void SetMusicVolume(float volume); + void SetFullScreen(bool isEnabled); + void vsync_set(bool isEnabled); +}; + +std::string options_path(); + +KeyValueMap keyvalue_map_parse(std::string_view text); +std::string keyvalue_map_get(KeyValueMap& map, std::string_view key); +int keyvalue_map_read_int(KeyValueMap& map, std::string_view key, int fallback); +float keyvalue_map_read_float(KeyValueMap& map, std::string_view key, float fallback); +bool is_keyvalue_map_true(KeyValueMap& map, std::string_view key, bool isFallback); + +// The platform layer's side, written with the window: applies one window setting from the options, and reads the +// window's current size into windowWidth and windowHeight. +void window_apply(OptionsConfig& options, WindowSetting setting); +void window_size_load(OptionsConfig& options); diff --git a/src/platform.cpp b/src/platform.cpp new file mode 100644 index 0000000..9f16e64 --- /dev/null +++ b/src/platform.cpp @@ -0,0 +1,655 @@ +#include "platform.h" +#include "classes.h" +#include "data.h" +#include "gl.h" +#include "options_config.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +constexpr const char* SAVE_FOLDER = "Binding of Isaac Repentance+"; +constexpr const char* SAVE_FOLDER_ERROR = "Failed to obtain writable save data directory!"; +constexpr const char* SAVE_PATHS_NOTICE = + "This file is purely informational. Changing it will have no effect on saving or loading data.\n\n"; +constexpr const char* WINDOW_TITLE = "Binding of Isaac: Repentance+ v1.9.7.17"; +constexpr int WINDOW_HEIGHT = 540; +constexpr int WINDOW_WIDTH = 960; +constexpr SDL_WindowFlags WINDOW_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE; +// The context versions GLFW was asked for, the second only when the first fails. +constexpr int GL_MAJOR_VERSIONS[] = {2, 1}; +constexpr int DEPTH_BITS = 24; +constexpr int STENCIL_BITS = 8; +constexpr double CLEAR_DEPTH = -1000; +constexpr int RENDERBUFFER_MIN_SIZE = 8; +constexpr int ACTION_COUNT = 32; +constexpr int CONTROLLER_COUNT = 4; +constexpr ActionBinding EMPTY_BINDING = {-1, -1, -1, -1}; +// A frame shorter than this share of FRAME_TIME is short, and this many in a row switch the pacing over. +constexpr double SHORT_FRAME_RATIO = 1.1; +constexpr int PACING_SWITCH_FRAMES = 30; +constexpr int MESSAGE_LENGTH = 1024; +constexpr int MS_PER_SECOND = 1000; +constexpr int TARGET_HZ = 60; +constexpr float REFRESH_TOLERANCE = 0.04f; + +// One default binding: an input action and its button or key. +struct DefaultBinding +{ + int action; + int input; +}; + +// The engine's own controller defaults, in its standard button numbers. +constexpr DefaultBinding CONTROLLER_DEFAULTS[] = { + {0, 0}, {0, 43947}, {1, 1}, {1, 43948}, {2, 2}, {2, 43949}, {3, 3}, {3, 43950}, {4, 4}, + {4, 43951}, {5, 5}, {5, 43952}, {6, 6}, {6, 43953}, {7, 7}, {7, 43954}, {8, 8}, {9, 9}, + {10, 11}, {11, 12}, {12, 15}, {13, 14}, {14, 17}, {15, 18}, {19, 15}, {20, 0}, {20, 43947}, + {21, 1}, {21, 43948}, {22, 2}, {22, 43949}, {23, 3}, {23, 43950}, {24, 8}, {25, 11}, {26, 9}, + {27, 12}, {28, 6}, {29, 4}, {30, 13}, {31, 10}, +}; + +// The engine's keyboard defaults, in GLFW key numbers. +constexpr DefaultBinding KEYBOARD_DEFAULTS[] = { + {0, 65}, {1, 68}, {2, 87}, {3, 83}, {4, 263}, {5, 262}, {6, 265}, {7, 264}, {8, 69}, + {9, 32}, {10, 81}, {11, 341}, {12, 80}, {13, 258}, {14, 32}, {14, 257}, {15, 256}, {19, 257}, + {20, 263}, {21, 262}, {22, 265}, {23, 264}, {24, 81}, {25, 69}, {26, 88}, {27, 67}, {28, 258}, + {29, 341}, {30, 342}, {31, 340}, {18, 82}, {16, 70}, {17, 77}, +}; + +// The standard buttons whose GLFW gamepad number differs. +constexpr DefaultBinding PLATFORM_BUTTONS[] = {{17, 7}, {18, 5}}; + +// A vertex attribute a built-in shader binds by name, and the slot of KAGE's vertex format it reads. +struct ShaderAttribute +{ + const char* name; + int slot; +}; + +constexpr ShaderAttribute COLOR_ATTRIBUTES[] = {{"Position", 5}, {"Color", 6}, {"", 0}}; +constexpr ShaderAttribute TEXTURE_ATTRIBUTES[] = {{"Position", 5}, {"Color", 6}, {"TexCoord", 7}, {"", 0}}; + +constexpr const char* COLOR_VERTEX = R"( +attribute vec3 Position; +attribute vec4 Color; +varying vec4 Color0; +uniform mat4 Transform; + +void main( void ) +{ + Color0 = Color; + gl_Position = Transform * vec4( Position.xyz, 1.0 ); +} +)"; + +constexpr const char* COLOR_FRAGMENT = R"( +#ifndef GL_ES + #define lowp +#endif +varying lowp vec4 Color0; + +void main( void ) +{ + gl_FragColor = Color0; + if( gl_FragColor.a == 0.0 ) discard; +} +)"; + +constexpr const char* TEXTURE_VERTEX = R"( +attribute vec3 Position; +attribute vec4 Color; +attribute vec2 TexCoord; +varying vec4 Color0; +varying vec2 TexCoord0; +uniform mat4 Transform; + +void main( void ) +{ + gl_Position = Transform * vec4( Position.xyz, 1.0 ); + Color0 = Color; + TexCoord0 = TexCoord; +} +)"; + +constexpr const char* TEXTURE_FRAGMENT = R"( +#ifndef GL_ES + #define lowp + #define highp +#endif +varying lowp vec4 Color0; +varying highp vec2 TexCoord0; +uniform sampler2D Texture0; + +void main( void ) +{ + gl_FragColor = texture2D( Texture0, TexCoord0 ) * Color0; + if( gl_FragColor.a == 0.0 ) discard; +} +)"; + +constexpr const char* INDEXED_TEXTURE_FRAGMENT = R"( +#ifndef GL_ES + #define lowp + #define highp +#endif +varying lowp vec4 Color0; +varying highp vec2 TexCoord0; +uniform sampler2D Texture0; +uniform sampler2D Texture1; + +void main( void ) +{ + vec4 PaletteIndex = texture2D( Texture0, TexCoord0 ); + vec4 OutputColor = texture2D( Texture1, PaletteIndex.xy ) * Color0; + if( OutputColor.w == 0.0 ) discard; + gl_FragColor = OutputColor; +} +)"; + +// One of the engine's built-in shaders. +struct ShaderSource +{ + const char* name; + const ShaderAttribute* attributes; + const char* vertex; + const char* fragment; +}; + +constexpr ShaderSource SHADERS[] = { + {"KAGE_ColorShader", COLOR_ATTRIBUTES, COLOR_VERTEX, COLOR_FRAGMENT}, + {"KAGE_ColorTextureShader", TEXTURE_ATTRIBUTES, TEXTURE_VERTEX, TEXTURE_FRAGMENT}, + {"KAGE_IndexedTextureShader", TEXTURE_ATTRIBUTES, TEXTURE_VERTEX, INDEXED_TEXTURE_FRAGMENT}, +}; + +Platform platform; + +// The log file, which levels reach it, and whether the next message starts a line. +static std::mutex logMutex; +static FILE* logFile = nullptr; +static unsigned int logMask = 0; +static bool isLogLineStart = true; + +// 00a5f3a0 Opens the log file, replacing any open one, with every level written to it. +void log_open(const std::string& path) +{ + if (logFile) std::fclose(logFile); + logFile = std::fopen(path.c_str(), "wb"); + logMask = UINT8_MAX; +} + +// What a level's lines start with. +static const char* log_prefix(unsigned int flags) +{ + switch (flags) + { + case LOG_INFO: return "[INFO] - "; + case LOG_NET: return "[NET] - "; + case LOG_WARN: return "[WARN] - "; + case LOG_ERROR: return "[ERROR] - "; + case LOG_ASSERT: return "[ASSERT] - "; + default: return ""; + } +} + +// Prints a message to stdout, and to the log file when its level is in the mask, the level's prefix at a line start. +void log_printf(LogLevel level, const char* format, ...) +{ + std::lock_guard lock(logMutex); + bool isFileLogged = logFile && (logMask & level); + if ((level & UINT8_MAX) == 0 && !isFileLogged) return; + + va_list args; + va_start(args, format); + va_list sizing; + va_copy(sizing, args); + std::string text = isLogLineStart ? log_prefix(level) : ""; + size_t start = text.size(); + text.resize(start + std::vsnprintf(nullptr, 0, format, sizing)); + va_end(sizing); + std::vsnprintf(text.data() + start, text.size() - start + 1, format, args); + va_end(args); + + if (level & UINT8_MAX) + { + std::fputs(text.c_str(), stdout); + std::fflush(stdout); + } + if (isFileLogged) + { + std::fputs(text.c_str(), logFile); + std::fflush(logFile); + } + if (!text.empty()) isLogLineStart = text.back() == '\n'; +} + +// 00a112c0 Logs finished text at a level. The game's prototype has no format arguments, so callers format first. +void KAGE_LogMessage(uint32_t flags, uint8_t* format) +{ + log_printf((LogLevel)flags, "%s", (const char*)format); +} + +// 00a68490 The monotonic clock in nanoseconds. +uint64_t GetTimeNs() +{ + return (uint64_t)((double)SDL_GetPerformanceCounter() / SDL_GetPerformanceFrequency() * SDL_NS_PER_SECOND); +} + +// Creates a folder, showing the game's error box when it is not there afterwards. +static void folder_create(const std::string& path, const char* error) +{ + std::error_code result; + char message[MESSAGE_LENGTH]; + + std::filesystem::create_directory(path, result); + if (std::filesystem::is_directory(path, result)) return; + std::snprintf(message, sizeof(message), error, path.c_str()); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", message, nullptr); +} + +// 009a9510 Finds the save folder (SDL's per-user folder for the game) and the mods and mod data folders, removes the +// mods folder older versions kept with the saves, moves loose online logs into online_logs/desyncs/ and notes the +// folders in savedatapath.txt. +// The game's own folder, where it kept mods/, data/ and savedatapath.txt, is resources/ here. Mod data goes with saves. +void Platform::directories_load() +{ + char* prefPath = SDL_GetPrefPath("", SAVE_FOLDER); + userDataDirectory = prefPath ? prefPath : ""; + SDL_free(prefPath); + if (userDataDirectory.empty()) SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", SAVE_FOLDER_ERROR, nullptr); + + modsDirectory = dataDirectory + "mods/"; + modsSaveDirectory = userDataDirectory + "data/"; + folder_create(modsDirectory, "Modding data path %s is not a writable directory!"); + folder_create(modsSaveDirectory, "Modding save data path %s is not a writable directory!"); + + std::error_code result; + std::filesystem::remove_all(userDataDirectory + "mods/", result); + + std::string onlineLogs = userDataDirectory + "online_logs/"; + std::string desyncs = onlineLogs + "desyncs/"; + if (!std::filesystem::exists(desyncs, result)) + { + std::filesystem::create_directory(desyncs, result); + for (const auto& entry : std::filesystem::directory_iterator(onlineLogs, result)) + std::filesystem::rename(entry.path(), std::filesystem::path(desyncs) / entry.path().filename(), result); + } + + FILE* info = std::fopen((dataDirectory + "savedatapath.txt").c_str(), "w"); + if (!info) return; + std::fputs(SAVE_PATHS_NOTICE, info); + std::fprintf(info, "Save Data Path: %s\n", userDataDirectory.c_str()); + std::fprintf(info, "Modding Data Path: %s\n", modsDirectory.c_str()); + std::fclose(info); +} + +// The bindings a table of defaults gives each action, in table order, up to BINDING_SLOTS each. +static std::vector bindings_build(std::span defaults) +{ + std::vector bindings(ACTION_COUNT, EMPTY_BINDING); + + for (DefaultBinding binding : defaults) + { + int* slot = std::ranges::find(bindings[binding.action], -1); + if (slot == bindings[binding.action].end()) log_printf(LOG_ASSERT, "Mapping slot overflow\n"); + else *slot = binding.input; + } + return bindings; +} + +// 004307c0 Sets the engine's default input bindings, the controller's in GLFW's button numbers, before KAGE starts. +// Its window parameters are this file's constants. Its Epic Online Services keys and options.ini's EnableEpicOverlay +// are online, and its heap size has no heap to size, so they are left out. +void Platform::bindings_load() +{ + if (isEngineInitialized) + return log_printf(LOG_ASSERT, "SetEngineParameters must be called before calling KAGE::Initialize\n"); + + std::vector controller(std::begin(CONTROLLER_DEFAULTS), std::end(CONTROLLER_DEFAULTS)); + for (DefaultBinding& binding : controller) + for (DefaultBinding button : PLATFORM_BUTTONS) + if (binding.input == button.action) binding.input = button.input; + + bindings = {bindings_build(controller), bindings_build(KEYBOARD_DEFAULTS), CONTROLLER_COUNT}; +} + +// 00a5f0e0 Seeds rand from the clock in milliseconds, then starts KAGE: graphics, sound, input and video in turn, +// stopping at the first that fails (the game carries on either way). +// 00a710a0 (merged) Steam, EOS, the custom heap, the packed archives' mount points (resources/ is read directly), the +// multiplayer threads and the Windows timer and power settings are left out: SDL keeps the display awake itself. +void Platform::engine_init() +{ + std::srand((unsigned int)(GetTimeNs() / SDL_NS_PER_MS)); + if (isEngineInitialized) log_printf(LOG_ASSERT, "KAGE has already been initialized\n"); + if (!graphics_init()) return; + + // The sound manager was a global object. The OpenAL Soft device hooks after it have no place on SDL audio. + (new KAGE::Sound::ManagerOpenAL())->FUN_00a649b0(); + if (!FUN_00a21980() || !FUN_00a8c430()) return; + + isEngineInitialized = true; +} + +// Opens the window, shows it, then builds the renderer's built-in shaders and starting state. +// This is Graphics::Manager::Init at 00a18e90, whose stub stays for the generated vtable. +bool Platform::graphics_init() +{ + if (!SDL_Init(SDL_INIT_VIDEO)) log_printf(LOG_ASSERT, "SDL failed to initialize: %s\n", SDL_GetError()); + + window_size_set({WINDOW_WIDTH, WINDOW_HEIGHT}); + viewportSize = windowSize; + if (!window_create()) return false; + SDL_ShowWindow(window); + SDL_RaiseWindow(window); + + for (const ShaderSource& shader : SHADERS) + FUN_00a13fa0((uint8_t*)shader.name, (void*)shader.attributes, (void*)&shader); + state_reset(); + KAGE_Graphics().SetRenderTarget(nullptr, 1); + // The renderer's vertex buffer (a GraphicsBufferObject the original keeps at DAT_00c7367c) and its black clear + // color come next, with the renderer. + new KAGE::Graphics::GraphicsBufferObject(); + FUN_00a18460(0, 0, 0); + g_imageReleaseFn = (void*)&FUN_00a12240; + g_renderTargetReleaseFn = (void*)&FUN_00a12240; + return true; +} + +// 00a19df0 Creates the window hidden, with an OpenGL 2.0 compatibility context (1.0 if that fails), and the +// framebuffer the renderer draws the game into. +// The Win32 icon and the maximize box it removes have no SDL counterpart. +bool Platform::window_create() +{ + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, DEPTH_BITS); + SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, STENCIL_BITS); + window = SDL_CreateWindow(WINDOW_TITLE, windowSize.width, windowSize.height, WINDOW_FLAGS); + for (int major : GL_MAJOR_VERSIONS) + { + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, major); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); + if (window && (context = SDL_GL_CreateContext(window))) break; + } + // The original carries on without a context and crashes in its first GL call. This stops instead. + if (!context) + { + log_printf(LOG_ASSERT, "Failed to create OpenGL window / context: %s\n", SDL_GetError()); + return false; + } + + gl_load(); + log_printf(LOG_INFO, "OpenGL version %s\n", (const char*)gl.GetString(GL_VERSION)); + log_printf(LOG_INFO, "GLSL version %s\n", (const char*)gl.GetString(GL_SHADING_LANGUAGE_VERSION)); + if (!gl.GenFramebuffers) + { + log_printf(LOG_ERROR, "glGenFramebuffers is NULL!\n"); + return false; + } + + gl.GenFramebuffers(1, &framebuffer); + log_printf(LOG_INFO, "Framebuffer ID: %d\n", framebuffer); + gl.BindFramebuffer(GL_FRAMEBUFFER, framebuffer); + depth_renderbuffer_update(RENDERBUFFER_REBUILD); + gl.BindFramebuffer(GL_FRAMEBUFFER, 0); + + SDL_GetWindowPosition(window, &windowPosition.x, &windowPosition.y); + state_reset(); + return true; +} + +// Puts back the GL state the renderer expects: the vsync setting, blending, depth testing toward the viewer from a +// cleared depth of -1000, and back faces culled (Graphics::Manager slot 30, 00a19b60). +void Platform::state_reset() +{ + vsync_apply(); + gl.Enable(GL_BLEND); + gl.Enable(GL_DEPTH_TEST); + gl.Enable(GL_CULL_FACE); + gl.ClearDepth(CLEAR_DEPTH); + gl.DepthFunc(GL_GREATER); + gl.CullFace(GL_BACK); +} + +// 00a1a470 Swaps on the display's refresh when vsync is on. +void Platform::vsync_apply() +{ + SDL_GL_SetSwapInterval(isVsync ? 1 : 0); +} + +// The window's drawable size in pixels (Graphics::Manager slots 12 and 13, 00a19340 and 00a193c0). +Size Platform::framebuffer_size_get() +{ + Size size; + SDL_GetWindowSizeInPixels(window, &size.width, &size.height); + return size; +} + +// 00a18750 Gives the framebuffer a depth renderbuffer at the powers of two at or above the drawing size, 8 at least, +// keeping the one it has while that is big enough. +// The drawing size falls back to the window's. A bound render target's would come first, once render targets exist. +void Platform::depth_renderbuffer_update(RenderbufferMode mode) +{ + Size drawable = framebuffer_size_get(); + int width = drawingSize.width > 0 ? drawingSize.width : drawable.width; + int height = drawingSize.height > 0 ? drawingSize.height : drawable.height; + + if (mode == RENDERBUFFER_KEEP && depthRenderbuffer != 0) + { + int currentHeight = 0; + int currentWidth = 0; + + gl.BindRenderbuffer(GL_RENDERBUFFER, depthRenderbuffer); + gl.GetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, ¤tWidth); + gl.GetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, ¤tHeight); + if (width <= currentWidth && height <= currentHeight) return; + } + if (depthRenderbuffer != 0) gl.DeleteRenderbuffers(1, &depthRenderbuffer); + width = (int)std::bit_ceil((unsigned int)std::max(width, RENDERBUFFER_MIN_SIZE)); + height = (int)std::bit_ceil((unsigned int)std::max(height, RENDERBUFFER_MIN_SIZE)); + + int previous = 0; + gl.GetIntegerv(GL_FRAMEBUFFER_BINDING, &previous); + gl.BindFramebuffer(GL_FRAMEBUFFER, framebuffer); + gl.GenRenderbuffers(1, &depthRenderbuffer); + log_printf(LOG_INFO, "Renderbuffer ID: %d size %dx%d\n", depthRenderbuffer, width, height); + gl.BindRenderbuffer(GL_RENDERBUFFER, depthRenderbuffer); + gl.RenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height); + gl.FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer); + gl.BindFramebuffer(GL_FRAMEBUFFER, previous); +} + +// Sets the GL viewport to the game's viewport, at its offset when it has one. +void Platform::viewport_reset() +{ + SDL_FPoint offset = isViewportOffset ? viewportOffset : SDL_FPoint{}; + gl.Viewport((int)offset.x, (int)offset.y, viewportSize.width, viewportSize.height); +} + +// 00a19450 Resizes the window unless it has that size already. In fullscreen it keeps the size for later and warns. +void Platform::window_size_set(Size size) +{ + if (size == windowSize) return; + + windowSize = size; + if (isFullscreen) log_printf(LOG_WARN, "Setting size of window while in fullscreen, is this intended?\n"); + else if (window) SDL_SetWindowSize(window, size.width, size.height); +} + +// Moves the window, as GLFW's glfwSetWindowPos. +void Platform::window_position_set(SDL_Point position) +{ + SDL_SetWindowPosition(window, position.x, position.y); +} + +// 00a196b0 Switches between the window and fullscreen, at the display's own mode when exclusive, then tells the size +// listeners and resets the viewport, projection and depth buffer. The cursor hides in fullscreen. +// The original fakes borderless fullscreen with a topmost window a pixel wider than the display. SDL's desktop +// fullscreen does that job. +void Platform::fullscreen_set(FullscreenMode mode) +{ + bool isWanted = mode != FULLSCREEN_OFF; + if (isWanted == isFullscreen) return; + + const SDL_DisplayMode* displayMode = SDL_GetCurrentDisplayMode(SDL_GetDisplayForWindow(window)); + isFullscreen = isWanted; + SDL_SetWindowFullscreenMode(window, mode == FULLSCREEN_EXCLUSIVE ? displayMode : nullptr); + SDL_SetWindowFullscreen(window, isFullscreen); + if (!isFullscreen) + { + SDL_SetWindowSize(window, viewportSize.width, viewportSize.height); + window_position_set(windowPosition); + } + SDL_ShowWindow(window); + SDL_RaiseWindow(window); + SDL_SyncWindow(window); + + Size size; + SDL_GetWindowSize(window, &size.width, &size.height); + for (auto& listener : sizeListeners) listener(size); + viewport_reset(); + KAGE_Graphics().update_projection(); + depth_renderbuffer_update(RENDERBUFFER_KEEP); + isFullscreen ? SDL_HideCursor() : SDL_ShowCursor(); +} + +// Takes the window's events as GLFW's callbacks did: closing asks the game to quit, and a new size (00a19bf0), +// position or focus goes to its listeners and resets what depends on it. +// Win32's topmost-while-focused fullscreen window has no SDL counterpart. +void Platform::events_poll() +{ + SDL_Event event; + + while (SDL_PollEvent(&event)) + { + switch (event.type) + { + case SDL_EVENT_QUIT: + case SDL_EVENT_WINDOW_CLOSE_REQUESTED: + isQuitRequested = true; + break; + case SDL_EVENT_WINDOW_RESIZED: + if (event.window.data1 == 0 || event.window.data2 == 0) break; + windowSize = {event.window.data1, event.window.data2}; + for (auto& listener : sizeListeners) listener(windowSize); + viewport_reset(); + depth_renderbuffer_update(RENDERBUFFER_KEEP); + KAGE_Graphics().update_projection(); + break; + case SDL_EVENT_WINDOW_MOVED: + for (auto& listener : positionListeners) listener({event.window.data1, event.window.data2}); + if (isFullscreen) break; + windowPosition = {event.window.data1, event.window.data2}; + viewport_reset(); + break; + case SDL_EVENT_WINDOW_FOCUS_GAINED: + case SDL_EVENT_WINDOW_FOCUS_LOST: + for (auto& listener : focusListeners) listener(event.type == SDL_EVENT_WINDOW_FOCUS_GAINED); + break; + } + } +} + +// 00a266a0 Seconds since the platform started, as glfwGetTime. +double Platform::time_get() +{ + return (double)SDL_GetTicksNS() / SDL_NS_PER_SECOND; +} + +// Starts a frame and returns the frame rate the time since the last one makes, rounded. A long run of short frames +// (vsync on a faster display) forces the 60 Hz pacing on. +int Platform::frame_begin() +{ + double now = time_get(); + double frameTime = now - frameStart; + + frameStart = now; + if (FRAME_TIME / frameTime <= SHORT_FRAME_RATIO) shortFrameCount = 0; + else if (++shortFrameCount > PACING_SWITCH_FRAMES) + { + isPacingForced = true; + fullFrameCount = 0; + } + return (int)std::floor(1 / frameTime + 0.5); +} + +// Holds the frame to 60 Hz unless vsync paces it: sleeps the whole milliseconds left but one, then spins. A long run +// of frames with nothing left to sleep turns the forced pacing back off. +// The original spins without sleeping while a cutscene video is behind (0095dee0). No video plays yet. +void Platform::frame_wait() +{ + if (!isPacingForced && isVsync) return; + + int sleepMs = std::max((int)((FRAME_TIME - (time_get() - frameStart)) * MS_PER_SECOND) - 1, 0); + if (sleepMs > 0) + { + fullFrameCount = 0; + SDL_DelayNS(sleepMs * SDL_NS_PER_MS); + } + else if (++fullFrameCount > PACING_SWITCH_FRAMES) + { + isPacingForced = false; + shortFrameCount = 0; + } + while (time_get() - frameStart < FRAME_TIME) {} +} + +// Applies one window option, as the OptionsConfig setters did: windowed again, the window takes back its saved size, +// position and cursor. Vsync stays off for the session on a display not running at a multiple of 60 Hz. +void window_apply(OptionsConfig& options, WindowSetting setting) +{ + switch (setting) + { + case WINDOW_CURSOR: + options.isMouseControlEnabled ? SDL_HideCursor() : SDL_ShowCursor(); + break; + case WINDOW_FULLSCREEN: + if (!options.isFullscreen) platform.fullscreen_set(FULLSCREEN_OFF); + else platform.fullscreen_set(options.isExclusiveFullscreen ? FULLSCREEN_EXCLUSIVE : FULLSCREEN_BORDERLESS); + if (options.isFullscreen) break; + platform.window_size_set({options.windowWidth, options.windowHeight}); + platform.window_position_set({options.windowPosX, options.windowPosY}); + window_apply(options, WINDOW_CURSOR); + break; + case WINDOW_POSITION: + platform.window_position_set({options.windowPosX, options.windowPosY}); + break; + case WINDOW_VSYNC: + { + const SDL_DisplayMode* display = SDL_GetCurrentDisplayMode(SDL_GetDisplayForWindow(platform.window)); + int hz = display ? (int)display->refresh_rate : 0; + float cycles = 0; + float fraction = std::modf((float)hz / TARGET_HZ, &cycles); + bool isVsync = options.isVsyncEnabled; + + if (isVsync && std::min(fraction, 1 - fraction) > REFRESH_TOLERANCE) + { + log_printf(LOG_INFO, "Display Hz: %d, Target: 60.. disabling vsync for this session.\n", hz); + isVsync = false; + } + if (isVsync == platform.isVsync) break; + platform.isVsync = isVsync; + platform.vsync_apply(); + break; + } + } +} + +// The window's current size, which reset options take as theirs. +void window_size_load(OptionsConfig& options) +{ + SDL_GetWindowSize(platform.window, &options.windowWidth, &options.windowHeight); +} diff --git a/src/platform.h b/src/platform.h new file mode 100644 index 0000000..462e73b --- /dev/null +++ b/src/platform.h @@ -0,0 +1,109 @@ +#pragma once + +#include "log.h" +#include +#include +#include +#include +#include + +struct SDL_GLContextState; +struct SDL_Window; + +constexpr int BINDING_SLOTS = 4; +// The game's frame, 60 Hz, in seconds. +constexpr double FRAME_TIME = 1.0 / 60; + +// A width and a height in pixels. +struct Size +{ + int width = 0; + int height = 0; + + bool operator==(const Size&) const = default; +}; + +// The buttons or keys one input action is bound to, -1 in an empty slot. +using ActionBinding = std::array; + +// The default bindings of every input action, by action: GLFW gamepad buttons and GLFW keys. +struct InputBindings +{ + std::vector controller; + std::vector keyboard; + int controllerCount = 0; +}; + +// How the window fills the screen. +enum FullscreenMode +{ + FULLSCREEN_OFF, + FULLSCREEN_BORDERLESS, + FULLSCREEN_EXCLUSIVE +}; + +// Whether the depth renderbuffer is rebuilt even when the one it has is big enough. +enum RenderbufferMode +{ + RENDERBUFFER_KEEP, + RENDERBUFFER_REBUILD +}; + +// The engine's platform layer on SDL3: KAGE's System, the window half of its Graphics::Manager and the GLFW calls +// under them, with the folders the game saves into and the 60 Hz frame pacing. +// Listeners get the window's new size, position or focus, as the game registers them in IsaacStartup. +class Platform +{ +public: + InputBindings bindings; + std::string modsDirectory; + std::string modsSaveDirectory; + std::string userDataDirectory; + std::vector> focusListeners; + std::vector> positionListeners; + std::vector> sizeListeners; + SDL_FPoint viewportOffset = {}; + SDL_Point windowPosition = {}; + Size drawingSize = {-1, -1}; + Size viewportSize; + Size windowSize; + SDL_GLContextState* context = nullptr; + SDL_Window* window = nullptr; + unsigned int depthRenderbuffer = 0; + unsigned int framebuffer = 0; + bool isEngineInitialized = false; + bool isFullscreen = false; + bool isQuitRequested = false; + bool isViewportOffset = false; + bool isVsync = true; + + void directories_load(); + void bindings_load(); + void engine_init(); + void events_poll(); + double time_get(); + int frame_begin(); + void frame_wait(); + void window_size_set(Size size); + void window_position_set(SDL_Point position); + void fullscreen_set(FullscreenMode mode); + void vsync_apply(); + void depth_renderbuffer_update(RenderbufferMode mode); + Size framebuffer_size_get(); + +private: + double frameStart = 0; + int fullFrameCount = 0; + int shortFrameCount = 0; + bool isPacingForced = false; + + bool graphics_init(); + bool window_create(); + void state_reset(); + void viewport_reset(); +}; + +extern Platform platform; + +void log_open(const std::string& path); +void log_printf(LogLevel level, const char* format, ...) __attribute__((format(printf, 2, 3))); diff --git a/src/rich_text.cpp b/src/rich_text.cpp index 50bd785..1d353ea 100644 --- a/src/rich_text.cpp +++ b/src/rich_text.cpp @@ -1,53 +1,34 @@ -#include "classes.h" +#include "rich_text.h" #include "log.h" -#include "msvc.h" -#include -// The font path buffer the game formats into (MAX_PATH + 1). -constexpr int FONT_PATH_SIZE = 0x104; -constexpr int LOG_MESSAGE_SIZE = 1024; -constexpr const char* TEXT_ICONS_PATH = "gfx/ui/text_icons.anm2"; +constexpr std::string_view TEXT_ICONS_PATH = "gfx/ui/text_icons.anm2"; +// The animation each icon type is a frame of, empty for the collectible, which is an image of its own. +constexpr std::string_view ICON_ANIMATIONS[] = {"players", "pickups", "", "rooms"}; -// Icon id to its image, in RichTextIcon::_images. -using IconImageNode = MsvcTreeNode; -LAYOUT32(sizeof(IconImageNode) == 0x1c); - -static char* string_text(std_string& text) +// 009efb60 Loads the font at path and, the first time, the icon sprite, which it then fits to the font's line height. +// The game formatted the path into a buffer of 260 characters first. The whole path is used here. +void RichText::load_font(std::string_view path) { - return (char*)((msvc::string*)&text)->c_str(); + std::string message = "Failed to load font: " + std::string(path) + " \n"; + + fontPath = path; + if (!font.Load(fontPath)) KAGE_LogMessage(LOG_ASSERT, (uint8_t*)message.data()); + + if (!icons) + { + icons = std::make_unique(); + icons->Load(TEXT_ICONS_PATH, GRAPHICS_LOAD); + } + icons->maxHeight = font.lineHeight; } -// 009efb60 Loads the font at fontPath and, the first time, the icons drawn inline with the text, which it then fits to -// the font's line height. A path too long for the buffer is cut short and terminated, which the game left unterminated. -void RichText::load_font(std_string* fontPath) +// 009f2b10 The text_icons.anm2 animation an icon type is drawn from, or nothing, logged, for the collectible and +// unknown types. +std::string_view RichTextIcon::get_animation_name(RichTextIconType type) { - char path[FONT_PATH_SIZE]; + if (type >= ICON_PLAYER && type <= ICON_ROOM && type != ICON_COLLECTIBLE) return ICON_ANIMATIONS[type]; - if (fontPath != &_fontPath) ((msvc::string*)&_fontPath)->assign((uint8_t*)string_text(*fontPath), fontPath->_size); - snprintf(path, sizeof(path), "%s", string_text(_fontPath)); - _font.Unload(); - _font.Load((uint8_t*)path, false); - if (!_font._isLoaded) - { - char message[LOG_MESSAGE_SIZE]; - - snprintf(message, sizeof(message), "Failed to load font: %s \n", path); - KAGE_LogMessage(LOG_ASSERT, (uint8_t*)message); - } - - if (!_icons) - { - std_string iconsPath; - - _icons = (RichTextIcon*)operator_new(sizeof(RichTextIcon)); - _icons->constructor(); - _icons->_maxHeight = 0; - _icons->_iconType = 0; - _icons->_iconId = 0; - _icons->_images = tree_create(); - ((msvc::string*)&iconsPath)->string_from_cstr((uint8_t*)TEXT_ICONS_PATH); - _icons->Load(&iconsPath, true); - ((msvc::string*)&iconsPath)->_Tidy_deallocate(); - } - _icons->_maxHeight = _font._lineHeight; + std::string message = "Invalid icon type (" + std::to_string(type) + ") for get_animation_name() \n"; + KAGE_LogMessage(LOG_ERROR, (uint8_t*)message.data()); + return {}; } diff --git a/src/rich_text.h b/src/rich_text.h new file mode 100644 index 0000000..c86e808 --- /dev/null +++ b/src/rich_text.h @@ -0,0 +1,43 @@ +#pragma once + +#include "anm2.h" +#include "font.h" +#include +#include +#include +#include + +// What a rich text icon shows, each but the collectible an animation of gfx/ui/text_icons.anm2. +enum RichTextIconType : int +{ + ICON_PLAYER, + ICON_PICKUP, + ICON_COLLECTIBLE, + ICON_ROOM +}; + +// The icons rich text draws inline from gfx/ui/text_icons.anm2: the sprite, the height icons are fit to, the icon last +// set and the collectible images loaded for it so far. +// Its drawing (render, get_size, set_icon) waits on the ANM2 and graphics rework and is not reconstructed yet. +struct RichTextIcon : ANM2 +{ + std::map images; + float maxHeight = 0; + int iconId = 0; + RichTextIconType iconType = ICON_PLAYER; + + static std::string_view get_animation_name(RichTextIconType type); +}; + +// Text drawn in a font with icons inline (hearts, pickups, collectibles, rooms), its lines spaced by lineSpacing. +// Its layout and drawing (rich_text_layout, rich_text_render) are not reconstructed yet. +// Destruction (009efa10) is the default: the font unloads and the icons go with their pointer. +struct RichText +{ + Font font; + std::string fontPath; + std::unique_ptr icons; + float lineSpacing = 1; + + void load_font(std::string_view path); +}; diff --git a/src/string_table.cpp b/src/string_table.cpp index bd222d6..717dbfe 100644 --- a/src/string_table.cpp +++ b/src/string_table.cpp @@ -1,101 +1,196 @@ -#include "classes.h" -#include "msvc.h" -#include -#include +#include "string_table.h" +#include "data.h" +#include -constexpr const char* INVALID_LANGUAGE = "StringTable::InvalidLanguage"; -constexpr const char* INVALID_CATEGORY = "StringTable::InvalidCategory"; -constexpr const char* INVALID_KEY = "StringTable::InvalidKey"; -constexpr const char* UNTRANSLATED_STRING = "StringTable::UntranslatedString"; +constexpr std::string_view INVALID_LANGUAGE = "StringTable::InvalidLanguage"; +constexpr std::string_view INVALID_CATEGORY = "StringTable::InvalidCategory"; +constexpr std::string_view INVALID_KEY = "StringTable::InvalidKey"; +constexpr std::string_view INVALID_KEY_INDEX = "StringTable::InvalidKeyIndex"; +constexpr std::string_view UNTRANSLATED_STRING = "StringTable::UntranslatedString"; +constexpr std::string_view TABLE_EXTENSION = "sta"; constexpr char CATEGORY_SEPARATOR = '/'; +// Languages with an id from here up, like the file's "Key" column, get no column. +constexpr int LANGUAGE_ID_END = 20; -// Language id to its column in every string's translations. -using LanguageNode = MsvcTreeNode; -// Lowercased category name to its strings. -using CategoryNode = MsvcTreeNode; -// Lowercased key to its translations, one per language column. -using StringNode = MsvcTreeNode; -LAYOUT32(sizeof(LanguageNode) == 0x18 && sizeof(CategoryNode) == 0x28 && sizeof(StringNode) == 0x18); - -static bool is_text_before(const char* text, const char* other) +// A copy with ASCII capitals lowered, as the game matches names. +static std::string text_lower(std::string_view text) { - return std::strcmp(text, other) < 0; -} - -// A copy with ASCII capitals lowered, as the game matches names. No text reads as empty, where the game crashed. -static std::string text_lower(uint8_t* text) -{ - std::string lower = text ? (char*)text : ""; + std::string lower(text); for (char& character : lower) if (character >= 'A' && character <= 'Z') character += 'a' - 'A'; return lower; } -static void category_destroy(StringTableCategory& category) +// An attribute's text, or false when the element lacks it. +static bool attr_find(DataNode node, std::string_view name, std::string_view& value) { - FID_conflict__Tidy(&category._keys); - tree_destroy(category._strings); + return node["attrs"][name].get(value) == simdjson::SUCCESS; } -// 00a26920 Empties the table: every category along with its name, the default category and every language. +// The first child named tag, as rapidxml's first_node finds it, or false. +static bool node_first(DataNode node, std::string_view tag, DataNode& found) +{ + for (DataNode child : node_children(node)) + { + found = child; + if (node_tag(child) == tag) return true; + } + return false; +} + +// The document's first element named tag, as rapidxml's first_node finds it under the document, or false. +static bool root_find(Data& data, std::string_view tag, DataNode& root) +{ + if (node_tag(data.root) == "#document") return node_first(data.root, tag, root); + root = data.root; + return node_tag(root) == tag; +} + +// The children from the first one named tag on: all of them, or with isNamed only those named tag, as rapidxml's +// next_sibling walks them. +template +static void node_siblings_walk(DataNode node, std::string_view tag, bool isNamed, Visit visit) +{ + bool isFound = false; + + for (DataNode child : node_children(node)) + { + isFound = isFound || node_tag(child) == tag; + if (isFound && (!isNamed || node_tag(child) == tag)) visit(child); + } +} + +// The column of a language id, or -1 for an unknown language or a column past the language count. +static int column_find(std::map& languages, int language) +{ + auto found = languages.find(language); + return found == languages.end() || found->second < 0 || found->second >= (int)languages.size() ? -1 : found->second; +} + +// 00a26810 Loads a .sta file and makes its lowest language id current. Anything else empties the table. +// The extension is what follows the last dot, or all but the first character when there is none, as in the game. +bool StringTable::Load(std::string_view fileName) +{ + size_t dot = fileName.rfind('.'); + size_t extension = (dot == std::string_view::npos ? 0 : dot) + 1; + bool isTable = !fileName.empty() && fileName.substr(extension) == TABLE_EXTENSION; + bool isLoaded = false; + + clear(); + if (isTable) isLoaded = load_file(fileName); + if (isLoaded && !languages.empty()) language = languages.begin()->first; + return isLoaded; +} + +// 00a26f20, 00a27038 Reads the languages, giving each with an id below 20 the next column, then every category's keys +// and their strings in column order. The first named category becomes the default one, and a repeated category or key +// replaces the earlier one. +// A file without the root element reads as empty and one without languages has no translations, where the game crashed. +bool StringTable::load_file(std::string_view path) +{ + Data data; + DataNode languagesNode; + DataNode root; + int column = 0; + + data_load(data, path); + if (!data.isLoaded) return false; + if (!root_find(data, "stringtable", root)) return true; + + if (node_first(root, "languages", languagesNode)) + node_siblings_walk(languagesNode, "language", false, [&](DataNode languageNode) { + std::string_view id; + if (!attr_find(languageNode, "id", id)) return; + + int languageId = std::atoi(std::string(id).c_str()); + if (languageId < LANGUAGE_ID_END) languages[languageId] = column++; + }); + + node_siblings_walk(root, "category", true, [&](DataNode categoryNode) { + std::string_view categoryName; + if (!attr_find(categoryNode, "name", categoryName)) return; + + std::string name = text_lower(categoryName); + StringTableCategory& category = categories[name] = {}; + if (defaultCategory.empty()) defaultCategory = name; + + node_siblings_walk(categoryNode, "key", true, [&](DataNode keyNode) { + std::string_view keyName; + if (!attr_find(keyNode, "name", keyName)) return; + + std::vector& translations = category.strings[text_lower(keyName)] = {}; + category.keys.push_back(text_lower(keyName)); + node_siblings_walk(keyNode, "string", true, [&](DataNode stringNode) { + if (translations.size() < languages.size()) translations.emplace_back(node_text(stringNode)); + }); + }); + }); + return true; +} + +// 00a26920 Empties the table: every category, the default one and every language. void StringTable::clear() { - auto categories = (CategoryNode*)_categories._head; - - for (CategoryNode* node = categories->_left; node != categories; node = tree_next(node)) - tracked_alloc(TRACKED_FREE, node->_key, 0); - tree_clear(_categories, category_destroy); - _defaultCategory = nullptr; - _language = 0; - tree_clear(_languages); + categories.clear(); + defaultCategory.clear(); + language = 0; + languages.clear(); } -// 00a26a30 Translates "category/key", or a key of the default category, into the current language. -uint8_t* StringTable::translate(uint8_t* key) +// 00a26a30 Translates "category/key", or a key of the default category, into the current language. The key is +// lowered and its backslashes made slashes first. +std::string_view StringTable::translate(std::string_view key) { - auto lowerKey = (char*)path_join(key, nullptr, true, false); - char* separator = lowerKey ? std::strchr(lowerKey, CATEGORY_SEPARATOR) : nullptr; - auto category = (uint8_t*)_defaultCategory; - auto name = (uint8_t*)lowerKey; - uint8_t isMissing = false; + std::string path = text_lower(key); - if (separator) - { - *separator = '\0'; - category = (uint8_t*)lowerKey; - name = (uint8_t*)separator + 1; - } + for (char& character : path) + if (character == '\\') character = CATEGORY_SEPARATOR; - uint8_t* text = get_string(category, _language, name, &isMissing); - tracked_alloc(TRACKED_FREE, lowerKey, 0); + size_t separator = path.find(CATEGORY_SEPARATOR); + if (separator == std::string::npos) return get_string(defaultCategory, language, path); + std::string_view view = path; + return get_string(view.substr(0, separator), language, view.substr(separator + 1)); +} + +// A string by category and key in a language, or a text naming what was missing. +static std::string_view string_find(StringTable& table, std::string_view category, int language, std::string_view key, + bool& isMissing) +{ + int column = column_find(table.languages, language); + if (column < 0) return INVALID_LANGUAGE; + + auto categoryFound = table.categories.find(text_lower(category)); + if (categoryFound == table.categories.end()) return INVALID_CATEGORY; + + auto& strings = categoryFound->second.strings; + auto stringFound = strings.find(text_lower(key)); + if (stringFound == strings.end()) return INVALID_KEY; + if ((size_t)column >= stringFound->second.size()) return UNTRANSLATED_STRING; + + isMissing = false; + return stringFound->second[column]; +} + +// 00a26af0 A string by category and key in a language. A miss names what was missing and sets outIsMissing. +// A language column at the language count reads past the translations in the game, so it is an invalid language here. +std::string_view StringTable::get_string(std::string_view category, int language, std::string_view key, + bool* outIsMissing) +{ + bool isMissing = true; + std::string_view text = string_find(*this, category, language, key, isMissing); + + if (outIsMissing) *outIsMissing = isMissing; return text; } -// 00a26af0 A string by category and key, both matched lowercased, in a language. A miss names what was missing and -// sets outIsMissing. A language column equal to the language count reads past the translations in the game, so it is -// taken as an invalid language here. -uint8_t* StringTable::get_string(uint8_t* category, int language, uint8_t* key, uint8_t* outIsMissing) +// 00a26d30 The string at a key's place in its category's file order, in a language. +std::string_view StringTable::get_string_by_index(std::string_view category, int language, size_t keyIndex) { - *outIsMissing = true; + if (column_find(languages, language) < 0) return INVALID_LANGUAGE; - auto languageNode = tree_find(_languages, language); - if (languageNode->_isNil) return (uint8_t*)INVALID_LANGUAGE; - - int column = languageNode->_value; - if (column < 0 || column >= (int)_languages._size) return (uint8_t*)INVALID_LANGUAGE; - - std::string categoryName = text_lower(category); - auto categoryNode = tree_find(_categories, categoryName.data(), is_text_before); - if (categoryNode->_isNil) return (uint8_t*)INVALID_CATEGORY; - - std::string keyName = text_lower(key); - auto stringNode = tree_find(categoryNode->_value._strings, keyName.data(), is_text_before); - if (stringNode->_isNil) return (uint8_t*)INVALID_KEY; - - char* text = stringNode->_value[column]; - if (!text) return (uint8_t*)UNTRANSLATED_STRING; - - *outIsMissing = false; - return (uint8_t*)text; + auto found = categories.find(text_lower(category)); + if (found == categories.end()) return INVALID_CATEGORY; + if (keyIndex >= found->second.keys.size()) return INVALID_KEY_INDEX; + return get_string(category, language, found->second.keys[keyIndex]); } diff --git a/src/string_table.h b/src/string_table.h new file mode 100644 index 0000000..9da68f7 --- /dev/null +++ b/src/string_table.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include +#include +#include + +// A category of localized strings: each key's translations by language column, and the keys in file order. +// The game's map erase (00a27c80) is the default destruction. +struct StringTableCategory +{ + std::unordered_map> strings; + std::vector keys; +}; + +// The localized strings of a .sta file (stringtable.sta, stringtable_pc.sta): categories of keys, each translated +// into the languages the file lists, read in the current language. Lookups match names lowercased, and a miss returns +// a text naming what was missing. Every returned view is null-terminated. +// Construction and destruction (00a26710) are the defaults. +struct StringTable +{ + std::unordered_map categories; + std::map languages; + std::string defaultCategory; + int language = 0; + + bool Load(std::string_view fileName); + void clear(); + std::string_view translate(std::string_view key); + std::string_view get_string(std::string_view category, int language, std::string_view key, + bool* outIsMissing = nullptr); + std::string_view get_string_by_index(std::string_view category, int language, size_t keyIndex); + bool load_file(std::string_view path); +};