//
// GJBaseGameLayer::toggleAudioVisualizer from 0x5992bc to 0x5993ea (302 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::init @ 0x5b54ca
// > GameOptionsLayer::didToggle @ 0x5d3a0e
// > GameSettingsLayer::didChangeGV @ 0x7106d2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:53:10 +0000
//
cocos2d::CCDirector *__fastcall GJBaseGameLayer::toggleAudioVisualizer(GJBaseGameLayer *this, int a2)
{
cocos2d::CCDirector *result; // r0
FMODLevelVisualizer *WinSize; // r0
int v6; // r0
int v7; // r7
int (__fastcall *v8)(int, _BYTE *); // r10
FMODLevelVisualizer *v9; // r0
int v10; // r0
int v11; // r7
void (__fastcall *v12)(int, _BYTE *); // r9
_BYTE v13[4]; // [sp+4h] [bp-1Ch] BYREF
float v14; // [sp+8h] [bp-18h]
float v15[2]; // [sp+Ch] [bp-14h] BYREF
_BYTE v16[8]; // [sp+14h] [bp-Ch] BYREF
result = (cocos2d::CCDirector *)FMODAudioEngine::sharedEngine(this);
*((_BYTE *)result + 944) = a2;
if ( *((unsigned __int8 *)this + 11468) != a2 )
{
*((_BYTE *)this + 11468) = a2;
if ( !*((_DWORD *)this + 2865) )
{
cocos2d::CCDirector::sharedDirector(result);
WinSize = (FMODLevelVisualizer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v13);
v6 = FMODLevelVisualizer::create(WinSize);
*((_DWORD *)this + 2865) = v6;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 2810) + 232))(*((_DWORD *)this + 2810), v6, 100);
v7 = *((_DWORD *)this + 2865);
v8 = *(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v7 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v15, 0.0, 0.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v16, v15[0] + 20.0, v14 * 0.5);
v9 = (FMODLevelVisualizer *)v8(v7, v16);
v10 = FMODLevelVisualizer::create(v9);
*((_DWORD *)this + 2866) = v10;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 2810) + 232))(*((_DWORD *)this + 2810), v10, 100);
v11 = *((_DWORD *)this + 2866);
v12 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v15, 0.0, 0.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v16, v15[0] + 35.0, v14 * 0.5);
v12(v11, v16);
}
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 2865) + 172))(
*((_DWORD *)this + 2865),
*((unsigned __int8 *)this + 11468));
return (cocos2d::CCDirector *)(*(int (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 2866) + 172))(
*((_DWORD *)this + 2866),
*((unsigned __int8 *)this + 11468));
}
return result;
}