//
// EditorSFXManager::encodeDataTo from 0x7810b4 to 0x781262 (430 bytes)
//
// 1 xrefs:
// > GameManager::encodeDataTo @ 0x41de88
//
// 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:59:28 +0000
//
int __fastcall EditorSFXManager::encodeDataTo(int this, DS_Dictionary *a2)
{
int v2; // r6
cocos2d::CCArray *v4; // r0
cocos2d::CCArray *v5; // r7
const char *i; // r8
int v7; // r10
cocos2d::CCString *v8; // r0
const char *CString; // r0
size_t v10; // r0
char *v11; // r1
cocos2d::CCArray *v12; // r0
cocos2d::CCArray *v13; // r7
const char *v14; // r8
int v15; // r10
cocos2d::CCString *v16; // r0
const char *v17; // r0
size_t v18; // r0
char *v19; // r1
const char *v20; // [sp+4h] [bp-18h]
const char *v21; // [sp+4h] [bp-18h]
int v22; // [sp+8h] [bp-14h] BYREF
int v23; // [sp+Ch] [bp-10h]
char *v24; // [sp+10h] [bp-Ch]
v2 = this;
if ( a2 )
{
DS_Dictionary::setIntegerForKey(a2, "editorSFXVersion", 1);
EditorSFXManager::ensureLoaded(v2);
EditorSFXManager::serializeAll((EditorSFXManager *)&v22, v2);
DS_Dictionary::setStringForKey(a2, "editorSFX", &v22);
std::string::~string((int)&v22);
v4 = *(cocos2d::CCArray **)(v2 + 72);
if ( v4 )
v4 = (cocos2d::CCArray *)cocos2d::CCArray::count(v4);
v5 = v4;
DS_Dictionary::setIntegerForKey(a2, "editorSFXFavoriteCount", (int)v4);
for ( i = nullptr; (int)i < (int)v5; ++i )
{
v7 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v2 + 72), (unsigned int)i);
if ( v7 )
{
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"editorSFXFavorite_%d", i);
CString = (const char *)cocos2d::CCString::getCString(v8);
v22 = 0;
v23 = 0;
v24 = nullptr;
v20 = CString;
v10 = strlen(CString);
std::string::__init(&v22, v20, v10);
if ( (v22 & 1) != 0 )
v11 = v24;
else
v11 = (char *)&v22 + 1;
DS_Dictionary::setSubDictForKey(a2, v11, 0, 1);
(*(void (__fastcall **)(int, DS_Dictionary *))(*(_DWORD *)v7 + 24))(v7, a2);
DS_Dictionary::stepOutOfSubDict(a2);
std::string::~string((int)&v22);
}
}
v12 = *(cocos2d::CCArray **)(v2 + 76);
if ( v12 )
v12 = (cocos2d::CCArray *)cocos2d::CCArray::count(v12);
v13 = v12;
DS_Dictionary::setIntegerForKey(a2, "editorSFXMyCount", (int)v12);
v14 = nullptr;
DS_Dictionary::setIntegerForKey(a2, "editorSFXNextLocalID", *(_DWORD *)(v2 + 80));
while ( (int)v14 < (int)v13 )
{
v15 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v2 + 76), (unsigned int)v14);
if ( v15 )
{
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"editorSFXMy_%d", v14);
v17 = (const char *)cocos2d::CCString::getCString(v16);
v22 = 0;
v23 = 0;
v24 = nullptr;
v21 = v17;
v18 = strlen(v17);
std::string::__init(&v22, v21, v18);
if ( (v22 & 1) != 0 )
v19 = v24;
else
v19 = (char *)&v22 + 1;
DS_Dictionary::setSubDictForKey(a2, v19, 0, 1);
(*(void (__fastcall **)(int, DS_Dictionary *))(*(_DWORD *)v15 + 24))(v15, a2);
DS_Dictionary::stepOutOfSubDict(a2);
std::string::~string((int)&v22);
}
++v14;
}
return DS_Dictionary::setFloatForKey(a2, "editorSFXGlobalVolume", *(float *)(v2 + 96));
}
return this;
}