//
// SetupSongTriggerPopup::onSavePlaybackPos from 0x1001c3244 to 0x1001c3354 (272 bytes)
//
// 1 xrefs:
// > SetupSongTriggerPopup::init @ 0x1001c2edc
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall SetupSongTriggerPopup::onSavePlaybackPos(SetupSongTriggerPopup *a1, cocos2d::CCObject *a2)
{
FMODAudioEngine *v4; // x0
FMODAudioEngine *v5; // x0
signed int MusicTimeMS; // w21
LevelEditorLayer *m_levelEditorLayer; // x21
__int64 *v8; // x0
float v9; // s0
int v10; // w1
__int64 v11; // [xsp+8h] [xbp-28h] BYREF
v4 = FMODAudioEngine::sharedEngine();
if ( FMODAudioEngine::isMusicPlaying_1(v4, 0) )
{
v5 = FMODAudioEngine::sharedEngine();
MusicTimeMS = FMODAudioEngine::getMusicTimeMS(v5, 0);
}
else if ( GameManager::sharedState()->m_levelEditorLayer && a1->m_gameObject )
{
m_levelEditorLayer = GameManager::sharedState()->m_levelEditorLayer;
v8 = (__int64 *)((__int64 (__fastcall *)(EffectGameObject *))a1->m_gameObject->getPosition)(a1->m_gameObject);
v9 = sub_1000229B8(&v11, v8);
MusicTimeMS = (int)(float)(((float (__fastcall *)(LevelEditorLayer *, __int64 *, _QWORD, _QWORD, _QWORD, _QWORD, float))m_levelEditorLayer->timeForPos)(
m_levelEditorLayer,
&v11,
0,
0,
0,
0,
v9)
* 1000.0);
}
else
{
MusicTimeMS = 0;
}
if ( ((unsigned int (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2) )
{
if ( ((unsigned int (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2) != 1 )
return;
v10 = 410;
}
else
{
v10 = 408;
}
SetupTriggerPopup::updateValue(a1, v10, (float)(MusicTimeMS & (unsigned int)~(MusicTimeMS >> 31)));
}