#include "classes.h" // 008e3db0 void AnimationLayer::RenderFrame() { code *pcVar1; Vector pos; byte bVar2; AnimationLayer AVar3; uint uVar4; float *widgetButtonFrame; void *glyphs; byte *pbVar5; char *cmpName; AnimationState *overlayAnim; int modCount; ModManager modIter; bool bVar6; float viewY; undefined1 glyphBuffer [20]; undefined8 rngShifts; undefined4 local_198; undefined4 local_194; undefined4 local_190; undefined4 local_18c; undefined4 local_188; undefined4 local_184; undefined4 local_180; undefined4 local_17c; undefined4 local_178; undefined4 local_174; undefined4 local_170; undefined4 local_16c; undefined4 local_168; undefined4 local_164; undefined4 local_160; undefined4 uStack_15c; undefined4 uStack_158; undefined4 uStack_154; Vector textScale; undefined4 local_148; undefined4 uStack_144; Vector VStack_140; ANM2 *local_134; AnimationLayer *menu; Manager *gameManager; Vector iconPos; Vector origin; Vector local_118; float local_110; Vector local_10c; AnimationLayer local_104; float originY; float originX; char baseLabel [72]; char baseLabelEnabled [72]; byte textBuffer [68]; uint local_24; undefined1 *puStack_20; void *local_1c; undefined1 *puStack_18; undefined4 local_14; KColor disabledModColor; Manager *manager; MenuManager *menuManager; ANM2 *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((this + 4)); AVar3 = this[0x11]; origin.x = (g_menuManager->_ViewPosition).x + (float)this[2] + 200.0; origin.y = (g_menuManager->_ViewPosition).y + (float)this[3] + 0.0; menu = this; originY = origin.y; originX = origin.x; if (AVar3 == (AnimationLayer)0x0) { LAB_008e3e98: bVar2 = (GHIDRA_CAST((local_134)))->ANM2::SetAnimation(&DAT_00b6767c,1); pbVar5 = puStack_20; if (bVar2 != 0) { (GHIDRA_CAST((GHIDRA_CAST((this + 0x10)))))->AnimationState::Rewind(); *GHIDRA_CAST((this + 0x15)) = 1; pbVar5 = puStack_20; } } else { if (0xf < *GHIDRA_CAST((GHIDRA_CAST(AVar3) + 0x14))) { AVar3 = *GHIDRA_CAST(AVar3); } pbVar5 = &DAT_00b6767c; do { bVar2 = *GHIDRA_CAST(AVar3); bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_008e3e80: uVar4 = -GHIDRA_UINT(bVar6) | 1; goto LAB_008e3e85; } if (bVar2 == 0) break; bVar2 = *GHIDRA_CAST((GHIDRA_CAST(AVar3) + 1)); bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_008e3e80; AVar3 = (AnimationLayer)(GHIDRA_INT(AVar3) + 2); pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008e3e85: if ((uVar4 != 0) || ((pbVar5 = textBuffer + 100, *GHIDRA_CAST((GHIDRA_INT(this[0x11]) + 0x34)) != '\0' && (pbVar5 = textBuffer + 100, *GHIDRA_CAST((this + 0x15)) == '\0')))) goto LAB_008e3e98; } puStack_20 = pbVar5; if ((*GHIDRA_CAST((GHIDRA_CAST(&(this[0x46])) + 0x1))) != '\0') { if (*GHIDRA_CAST((this + 0x20)) == '\0') { AnimationState::Render(GHIDRA_CAST((this + 0x10)),&origin,&g_vectorZero,&g_vectorZero); AnimationState::Render(GHIDRA_CAST((this + 0x18)),&origin,&g_vectorZero,&g_vectorZero); originY = origin.y; originX = origin.x; } else { AnimationState::Render(GHIDRA_CAST((this + 0x18)),&origin,&g_vectorZero,&g_vectorZero); AnimationState::Render(GHIDRA_CAST((this + 0x10)),&origin,&g_vectorZero,&g_vectorZero); originY = origin.y; originX = origin.x; } } if (((g_menuControllerIndex != 0) && (this[0x11] != (AnimationLayer)0x0)) && (widgetButtonFrame = (GHIDRA_CAST((GHIDRA_CAST((this + 0x10)))))->AnimationState::GetNullFrame(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 = (AnimationLayer) ((GHIDRA_UINT(((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((g_manager)) + 0x2a6c4)))) - GHIDRA_INT(g_manager->_modManager) >> 2) * 0x19 )) >> 5) + 1); if (local_104 != (AnimationLayer)0x0) { 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) >> ((byte)rngShifts & 0x1f) ^ GHIDRA_UINT(local_118.y); uVar4 = uVar4 << ((byte)((ulonglong)rngShifts >> 0x20) & 0x1f) ^ uVar4; local_118.y = (float)(uVar4 >> (SUB41(local_10c.y,0) & 0x1f) ^ uVar4); sprintf_s(textBuffer,0x40,GHIDRA_CAST("Piece%d")); AVar3 = this[0x11]; if (AVar3 == (AnimationLayer)0x0) { LAB_008e414c: bVar2 = (GHIDRA_CAST((GHIDRA_CAST((this + 4)))))->ANM2::SetAnimation(textBuffer,1); if (bVar2 != 0) { (GHIDRA_CAST((GHIDRA_CAST((this + 0x10)))))->AnimationState::Rewind(); *GHIDRA_CAST((this + 0x15)) = 1; } } else { if (0xf < *GHIDRA_CAST((GHIDRA_CAST(AVar3) + 0x14))) { AVar3 = *GHIDRA_CAST(AVar3); } pbVar5 = textBuffer; do { bVar2 = *GHIDRA_CAST(AVar3); bVar6 = bVar2 < *pbVar5; if (bVar2 != *pbVar5) { LAB_008e4134: uVar4 = -GHIDRA_UINT(bVar6) | 1; goto LAB_008e4139; } if (bVar2 == 0) break; bVar2 = *GHIDRA_CAST((GHIDRA_CAST(AVar3) + 1)); bVar6 = bVar2 < pbVar5[1]; if (bVar2 != pbVar5[1]) goto LAB_008e4134; AVar3 = (AnimationLayer)(GHIDRA_INT(AVar3) + 2); pbVar5 = pbVar5 + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008e4139: if ((uVar4 != 0) || ((*GHIDRA_CAST((GHIDRA_INT(this[0x11]) + 0x34)) != '\0' && (*GHIDRA_CAST((this + 0x15)) == '\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[0x46])) + 0x1))) != '\0') { if (*GHIDRA_CAST((this + 0x20)) == '\0') { AnimationState::Render (GHIDRA_CAST((this + 0x10)),&VStack_140,&g_vectorZero,&g_vectorZero); overlayAnim = GHIDRA_CAST((this + 0x18)); } else { AnimationState::Render (GHIDRA_CAST((this + 0x18)),&VStack_140,&g_vectorZero,&g_vectorZero); overlayAnim = GHIDRA_CAST((this + 0x10)); } AnimationState::Render(overlayAnim,&VStack_140,&g_vectorZero,&g_vectorZero); } } while (GHIDRA_INT(local_110) < GHIDRA_INT(local_104)); } AVar3 = this[0x11]; if (AVar3 != (AnimationLayer)0x0) { if (0xf < *GHIDRA_CAST((GHIDRA_CAST(AVar3) + 0x14))) { AVar3 = *GHIDRA_CAST(AVar3); } cmpName = "Bottom"; do { bVar2 = *GHIDRA_CAST(AVar3); bVar6 = bVar2 < (byte)*cmpName; if (bVar2 != *cmpName) { LAB_008e4255: uVar4 = -GHIDRA_UINT(bVar6) | 1; goto LAB_008e425a; } if (bVar2 == 0) break; bVar2 = *GHIDRA_CAST((GHIDRA_CAST(AVar3) + 1)); bVar6 = bVar2 < (byte)cmpName[1]; if (bVar2 != cmpName[1]) goto LAB_008e4255; AVar3 = (AnimationLayer)(GHIDRA_INT(AVar3) + 2); cmpName = cmpName + 2; } while (bVar2 != 0); uVar4 = 0; LAB_008e425a: if ((uVar4 == 0) && ((*GHIDRA_CAST((GHIDRA_INT(this[0x11]) + 0x34)) == '\0' || (*GHIDRA_CAST((this + 0x15)) != '\0')))) goto LAB_008e428b; } bVar2 = (GHIDRA_CAST((GHIDRA_CAST((this + 4)))))->ANM2::SetAnimation(GHIDRA_CAST("Bottom"),1); if (bVar2 != 0) { (GHIDRA_CAST((GHIDRA_CAST((this + 0x10)))))->AnimationState::Rewind(); *GHIDRA_CAST((this + 0x15)) = 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[0x46])) + 0x1))) != '\0') { if (*GHIDRA_CAST((this + 0x20)) == '\0') { AnimationState::Render(GHIDRA_CAST((this + 0x10)),&local_10c,&g_vectorZero,&g_vectorZero) ; overlayAnim = GHIDRA_CAST((this + 0x18)); } else { AnimationState::Render(GHIDRA_CAST((this + 0x18)),&local_10c,&g_vectorZero,&g_vectorZero) ; overlayAnim = GHIDRA_CAST((this + 0x10)); } AnimationState::Render(overlayAnim,&local_10c,&g_vectorZero,&g_vectorZero); } modIter = gameManager->_modManager; modCount = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameManager)) + 0x2a6c4)))) - GHIDRA_INT(modIter) >> 2; if ((g_manager->_optionsConfig)._enableMods == 0) { local_104 = (AnimationLayer)0x0; 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((*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 = GHIDRA_CAST(((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); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); modIter = (ModManager)(GHIDRA_INT(modIter) + 4); local_14 = 0xffffffff; local_104 = (AnimationLayer)local_10c.y; } while (GHIDRA_UINT(local_10c.y) < GHIDRA_UINT((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameManager)) + 0x2a6c4)))) - GHIDRA_INT(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 = (AnimationLayer)(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((*GHIDRA_CAST(modIter) + 0xfc)) == '\0') { local_148 = 0x3f008081; uStack_144 = 0x3f008081; VStack_140.x = 0.5019608; } VStack_140.y = 1.0; if (*GHIDRA_CAST((*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); std::vector<12byte>::clear(); std::vector<12byte>::_Tidy(); this = menu; local_14 = 0xffffffff; if (*menu == (AnimationLayer)local_118.y) { local_10c.y = *GHIDRA_CAST((menu + 0x11)); if ((AnimationLayer)local_10c.y == (AnimationLayer)0x0) { LAB_008e45d3: bVar2 = (GHIDRA_CAST((GHIDRA_CAST((menu + 4)))))->ANM2::SetAnimation(GHIDRA_CAST("Cursor"),1); menuSprite = local_134; if (bVar2 != 0) { (GHIDRA_CAST((&local_134->_animState)))->AnimationState::Rewind(); (menuSprite->_animState)._isPlaying = 1; this = menu; } } else { AVar3 = (AnimationLayer)local_10c.y; if (0xf < *GHIDRA_CAST((GHIDRA_CAST(local_10c.y) + 0x14))) { AVar3 = *GHIDRA_CAST(local_10c.y); } cmpName = "Cursor"; do { bVar2 = *GHIDRA_CAST(AVar3); bVar6 = bVar2 < (byte)*cmpName; if (bVar2 != *cmpName) { LAB_008e45b0: uVar4 = -GHIDRA_UINT(bVar6) | 1; goto LAB_008e45b5; } if (bVar2 == 0) break; bVar2 = *GHIDRA_CAST((GHIDRA_CAST(AVar3) + 1)); bVar6 = bVar2 < (byte)cmpName[1]; if (bVar2 != cmpName[1]) goto LAB_008e45b0; AVar3 = (AnimationLayer)(GHIDRA_INT(AVar3) + 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 + 0x15)) == '\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[0x46])) + 0x1))) != '\0') { if (*GHIDRA_CAST((this + 0x20)) == '\0') { AnimationState::Render (GHIDRA_CAST((this + 0x10)),&iconPos,&g_vectorZero,&g_vectorZero); overlayAnim = GHIDRA_CAST((this + 0x18)); } else { AnimationState::Render (GHIDRA_CAST((this + 0x18)),&iconPos,&g_vectorZero,&g_vectorZero); overlayAnim = GHIDRA_CAST((this + 0x10)); } AnimationState::Render(overlayAnim,&iconPos,&g_vectorZero,&g_vectorZero); } } modIter = (ModManager)(GHIDRA_INT(modIter) + 4); local_118.y = (float)local_104; } while (GHIDRA_UINT(local_104) < GHIDRA_UINT((*GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((gameManager)) + 0x2a6c4)))) - GHIDRA_INT(gameManager->_modManager) >> 2))); } } menuManager = g_menuManager; AVar3 = *this; viewY = -216.0; modCount = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST((g_manager)) + 0x2a6c4)))) - GHIDRA_INT(g_manager->_modManager) >> 2; if (4 < GHIDRA_INT(AVar3)) { scrollRow = modCount + -7; if (GHIDRA_INT(AVar3) < modCount + -3) { scrollRow = GHIDRA_INT(AVar3) + -4; } viewY = -216.0 - (float)(scrollRow * 0x19); } g_menuManager->_viewPositionSet[0x10].y = viewY; menuManager->_state = 1; ExceptionList = local_1c; return; }