//
// EditorSFXManager::playAction from 0xcc4a18 to 0xcc4e0c (1012 bytes)
//
// 58 xrefs:
// > LevelEditorLayer::saveLevel @ 0x7a7cf4
// > LevelEditorLayer::doAutoSave @ 0x7a7e84
// > LevelEditorLayer::doAutoBackup @ 0x7a8400
// > EditorUI::onSettings @ 0x7c05a8
// > EditorUI::playSoundForCreatedObject @ 0x7c21d4
// > EditorUI::playSoundForCreatedObject @ 0x7c21ec
// > EditorUI::selectBuildTab @ 0x7c2b60
// > EditorUI::onCreateButton @ 0x7c2e3c
// > EditorUI::zoomIn @ 0x7c72f0
// > EditorUI::zoomOut @ 0x7c7320
// > EditorUI::triggerSwipeMode @ 0x7c7360
// > EditorUI::editObject @ 0x7c8b48
// > EditorUI::onPlaytest @ 0x7ce6cc
// > EditorUI::onStopPlaytest @ 0x7ce9a8
// > EditorUI::onPause @ 0x7cea50
// > EditorUI::onDelete @ 0x7d1a88
// > EditorUI::clickOnPosition @ 0x7d1cf0
// > EditorUI::onDeleteSelected @ 0x7d1da8
// > EditorUI::undoLastAction @ 0x7d1ec4
// > EditorUI::redoLastAction @ 0x7d1f30
// > EditButtonBar::onRight @ 0x86136c
// > EditButtonBar::onLeft @ 0x8613ac
// > EditButtonBar::onDotClicked @ 0x861440
// > EditorPauseLayer::onResume @ 0x8b6640
// > EditorPauseLayer::onExitEditor @ 0x8b6e2c
// > GJTransformControl::ccTouchMoved @ 0xbd2ca0
// > EditorUI::ccTouchMoved @ 0xbd5c8c
// > EditorUI::ccTouchEnded @ 0xbd6340
// > EditorUI::ccTouchEnded @ 0xbd65bc
// > EditorUI::ccTouchEnded @ 0xbd68c0
// > EditorUI::handleEditorAction @ 0xbd72e0
// > EditorUI::handleEditorAction @ 0xbd73a8
// > EditorUI::handleEditorAction @ 0xbd7504
// > EditorUI::handleEditorAction @ 0xbd817c
// > EditorUI::handleEditorAction @ 0xbd823c
// > EditorUI::onPaste @ 0xbda0b8
// > EditorUI::onPasteInPlace @ 0xbda200
// > EditorUI::onDuplicate @ 0xbdaa04
// > EditorUI::onCopy @ 0xbdada0
// > EditorUI::selectObjectsInRect @ 0xbdd1f0
// > EditorUI::onDeselectAll @ 0xbdd568
// > EditorUI::onDpadStep @ 0xbe21c8
// > EditorUI::transformObjectCall @ 0xc01880
// > EditorUI::transformObjectCall @ 0xc018e0
// > EditorUI::transformObjectCall @ 0xc018f0
// > EditorUI::moveObjectCall @ 0xc024fc
// > EditorUI::moveObjectCall @ 0xc026f0
// > EditorUI::moveObjectCall @ 0xc02700
// > EditorUI::moveObjectCall @ 0xc02710
// > EditorUI::moveObjectCall @ 0xc02720
// > EditorUI::moveObjectCall @ 0xc02730
// > EditorUI::activateScaleControl @ 0xc027b8
// > EditorUI::activateTransformControl @ 0xc029cc
// > DeathMarkerLayer::playMarkerSound @ 0xc9d614
// > DeathMarkerLayer::playPendingLabelSound @ 0xc9d650
// > EditorSFXManager::playAction @ 0xcc4e44
// > EditorSFXManager::playAction @ 0xcc4e58
// > ??> @ 0xf2e90
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:06:19 +0000
//
__int64 __fastcall EditorSFXManager::playAction(EditorSFXManager *this, int a2)
{
cocos2d::CCArray **Binding; // x0
cocos2d::CCArray **v5; // x21
cocos2d::CCArray *v6; // x0
cocos2d::JniHelper *v7; // x0
double v8; // d0
double v9; // d9
__int64 *v10; // x0
double v11; // d0
int v12; // w22
unsigned int *v13; // x0
unsigned int *v14; // x2
int v15; // w1
cocos2d::CCArray *v16; // x2
cocos2d::CCArray *v17; // x1
int i; // w0
unsigned __int64 v19; // x26
unsigned __int64 v20; // x3
unsigned int v21; // w1
unsigned int v22; // w1
__int64 v23; // x0
__int64 v24; // x21
float v25; // s0
float v26; // s9
float v27; // s8
int v28; // w23
char v29; // w22
float v30; // s0
GameManager *v31; // x0
int v32; // w1
int v33; // w3
int v34; // w1
int v35; // w4
cocos2d::CCArray *v36; // x3
cocos2d::CCArray *v37; // x4
char *v38; // x0
cocos2d::CCArray *v39; // x0
__int64 v40; // [xsp+60h] [xbp+60h]
int v41; // [xsp+6Ch] [xbp+6Ch] BYREF
unsigned __int64 v42; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCArray *v43; // [xsp+78h] [xbp+78h]
cocos2d::CCArray *v44; // [xsp+80h] [xbp+80h]
cocos2d::CCArray *v45; // [xsp+88h] [xbp+88h]
v41 = a2;
if ( !*((_BYTE *)this + 196) )
{
Binding = (cocos2d::CCArray **)EditorSFXManager::findBinding(this, a2);
v5 = Binding;
if ( Binding )
{
v6 = *Binding;
if ( v6 )
{
v7 = (cocos2d::JniHelper *)cocos2d::CCArray::count(v6);
if ( (_DWORD)v7 )
{
cocos2d::JniHelper::getPlatformTimestamp(v7);
v9 = v8;
v10 = std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
(_QWORD *)this + 5,
&v41);
v11 = 0.0;
if ( v10 )
v11 = *((double *)v10 + 3);
if ( v9 - v11 >= EditorSFXManager::getActionMinInterval(this, v41) )
{
v12 = cocos2d::CCArray::count(*v5);
if ( *((_DWORD *)v5 + 2) == 1 )
{
v32 = *((_DWORD *)v5 + 3);
v33 = v32 + 1;
v22 = v32 % v12;
*((_DWORD *)v5 + 3) = v33 % v12;
goto LABEL_30;
}
v13 = (unsigned int *)v5[5];
v14 = (unsigned int *)v5[6];
v15 = *((_DWORD *)v5 + 18);
if ( v13 == v14 )
{
v16 = v5[5];
if ( v15 != v12 )
*((_DWORD *)v5 + 17) = -1;
}
else
{
if ( v15 == v12 )
{
v34 = *((_DWORD *)v5 + 16);
v35 = v34 + 1;
v22 = v13[v34];
*((_DWORD *)v5 + 16) = v35;
if ( v35 < (int)(v14 - v13) )
goto LABEL_30;
*((_DWORD *)v5 + 17) = v22;
goto LABEL_29;
}
*((_DWORD *)v5 + 17) = -1;
v16 = (cocos2d::CCArray *)&v14[~((unsigned __int64)((char *)(v14 - 1) - (char *)v13) >> 2)];
v5[6] = v16;
}
if ( v12 > (unsigned __int64)((v5[7] - (cocos2d::CCArray *)v13) >> 2) )
{
std::__split_buffer::__split_buffer(
(__int64 *)&v42,
v12,
(v16 - (cocos2d::CCArray *)v13) >> 2,
(__int64)(v5 + 7));
v36 = v5[5];
v37 = v5[6];
v38 = (char *)v43 - (v37 - v36);
v43 = (cocos2d::CCArray *)v38;
if ( v37 - v36 > 3 )
{
memcpy(v38, v36, v37 - v36);
v36 = v5[5];
v38 = (char *)v43;
v37 = v5[6];
}
v5[5] = (cocos2d::CCArray *)v38;
v43 = v36;
v17 = v44;
v5[6] = v44;
v44 = v37;
v39 = v5[7];
v5[7] = v45;
v45 = v39;
v42 = (unsigned __int64)v36;
if ( v36 != v37 )
v44 = (cocos2d::CCArray *)((char *)v37
+ 4 * ~((unsigned __int64)((cocos2d::CCArray *)((char *)v37 - 4) - v36) >> 2));
if ( v36 )
{
operator delete(v36);
v17 = v5[6];
}
}
else
{
v17 = v5[6];
}
LODWORD(v42) = 0;
if ( v12 > 0 )
{
for ( i = 0; i < v12; LODWORD(v42) = i )
{
if ( v5[7] == v17 )
{
std::vector::__push_back_slow_path((__int64)(v5 + 5), &v42);
v17 = v5[6];
}
else
{
if ( v17 )
{
*(_DWORD *)v17 = i;
v17 = v5[6];
}
v17 = (cocos2d::CCArray *)((char *)v17 + 4);
v5[6] = v17;
}
i = v42 + 1;
}
}
v40 = (__int64)v17;
v19 = (unsigned __int64)v5[5];
v20 = (unsigned int)rand() % 0x7FFFFFFFuLL;
if ( !v20 )
v20 = 1;
v42 = v20;
std::shuffle,std::linear_congruential_engine>(
v19,
v40,
(__int64)&v42);
if ( v12 > 1 )
{
v21 = *((_DWORD *)v5 + 17);
if ( (v21 & 0x80000000) == 0 )
{
v13 = (unsigned int *)v5[5];
if ( v21 != *v13 )
{
LABEL_27:
v14 = (unsigned int *)v5[6];
*((_DWORD *)v5 + 16) = 0;
*((_DWORD *)v5 + 18) = v12;
v22 = *v13;
*((_DWORD *)v5 + 16) = 1;
if ( (int)(v14 - v13) > 1 || (*((_DWORD *)v5 + 17) = v22, v14 == v13) )
{
LABEL_30:
v23 = cocos2d::CCArray::objectAtIndex(*v5, v22);
v24 = v23;
if ( v23 )
{
if ( *(int *)(v23 + 1864) > 0 )
{
*(double *)std::unordered_map::operator[]((__int64)this + 40, &v41) = v9;
v25 = *((float *)this + 48);
if ( v25 > 0.0 )
{
v26 = *(float *)(v24 + 1884);
v27 = *(float *)(v24 + 1992);
v28 = *(_DWORD *)(v24 + 1952);
v29 = *(_BYTE *)(v24 + 1945);
*(float *)(v24 + 1884) = v25 * v26;
v30 = *((float *)this + 48);
*(_DWORD *)(v24 + 1952) = -999999;
*(_BYTE *)(v24 + 1945) = (unsigned __int8)&dword_0 + 1;
*(float *)(v24 + 1992) = v30 * v27;
v31 = (GameManager *)GameManager::sharedState((GameManager *)((char *)&dword_0 + 1));
GameManager::playSFXTrigger(v31, (SFXTriggerGameObject *)v24);
*(_DWORD *)(v24 + 1952) = v28;
*(float *)(v24 + 1884) = v26;
*(_BYTE *)(v24 + 1945) = v29;
*(float *)(v24 + 1992) = v27;
}
}
}
return _stack_chk_guard;
}
LABEL_29:
v5[6] = (cocos2d::CCArray *)&v14[~((unsigned __int64)((char *)(v14 - 1) - (char *)v13) >> 2)];
goto LABEL_30;
}
*v13 = v13[1];
v13[1] = v21;
}
}
v13 = (unsigned int *)v5[5];
goto LABEL_27;
}
}
}
}
}
return _stack_chk_guard;
}