//
// EditorSFXManager::encodeSound from 0x77ebdc to 0x77ed9c (448 bytes)
//
// 2 xrefs:
// > EditorSFXManager::serializeAll @ 0x77eed0
// > EditorSFXManager::deserializeAll @ 0x780c0a
//
// 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:26 +0000
//
EditorSFXManager *__fastcall EditorSFXManager::encodeSound(EditorSFXManager *this, SFXTriggerGameObject *a2, int a3)
{
int v5; // r2
int v6; // r3
int v7; // r3
int v8; // r0
int v9; // r1
int v10; // r2
int v11; // r3
int v12; // r2
const void *v13; // r1
size_t v14; // r2
int v16; // [sp+0h] [bp-14h] BYREF
int v17; // [sp+4h] [bp-10h]
int v18; // [sp+8h] [bp-Ch]
if ( a3 )
{
v5 = *(_DWORD *)(a3 + 1660);
v16 = 0;
v17 = 0;
v18 = 0;
sub_77EB20(&v16, 1, v5);
if ( fabsf(*(float *)(a3 + 1680) - 1.0) >= 0.0001 )
sub_77EAB4(&v16, 2);
sub_77EB20(&v16, 3, *(_DWORD *)(a3 + 1672));
sub_77EB20(&v16, 4, *(_DWORD *)(a3 + 1676));
sub_77EB20(&v16, 5, *(_DWORD *)(a3 + 1684));
sub_77EB20(&v16, 6, *(_DWORD *)(a3 + 1692));
sub_77EB20(&v16, 7, *(_DWORD *)(a3 + 1688));
sub_77EB20(&v16, 8, *(_DWORD *)(a3 + 1696));
if ( fabsf(*(float *)(a3 + 1744)) >= 0.0001 )
sub_77EAB4(&v16, 9);
sub_77EB20(&v16, 10, *(_DWORD *)(a3 + 1780));
sub_77EB20(&v16, 11, *(_DWORD *)(a3 + 1784));
if ( fabsf(*(float *)(a3 + 1788)) >= 0.0001 )
sub_77EAB4(&v16, 12);
sub_77EB7C(&v16, 13, *(unsigned __int8 *)(a3 + 1792));
sub_77EB7C(&v16, 14, *(unsigned __int8 *)(a3 + 1701));
sub_77EB20(&v16, 15, *(_DWORD *)(a3 + 1664));
sub_77EB7C(&v16, 16, *(unsigned __int8 *)(a3 + 1700));
v6 = *(unsigned __int8 *)(a3 + 1796);
if ( (v6 & 1) != 0 )
v7 = *(_DWORD *)(a3 + 1800);
else
v7 = v6 >> 1;
if ( v7 )
{
if ( (v16 & 1) != 0 )
v11 = v17;
else
v11 = (int)(unsigned __int8)v16 >> 1;
if ( v11 )
std::string::push_back(&v16, 44);
v12 = *(unsigned __int8 *)(a3 + 1796);
if ( (v12 & 1) != 0 )
{
v13 = *(const void **)(a3 + 1804);
v14 = *(_DWORD *)(a3 + 1800);
}
else
{
v13 = (const void *)(a3 + 1797);
v14 = v12 >> 1;
}
std::string::append(&v16, v13, v14);
}
v8 = v16;
v9 = v17;
v10 = v18;
v16 = 0;
v17 = 0;
v18 = 0;
*(_DWORD *)this = v8;
*((_DWORD *)this + 1) = v9;
*((_DWORD *)this + 2) = v10;
std::string::~string((int)&v16);
}
else
{
*(_DWORD *)this = 0;
*((_DWORD *)this + 1) = 0;
*((_DWORD *)this + 2) = 0;
std::string::__init((int *)this, &unk_B6B226, 0);
}
return this;
}