//
// CreateParticlePopup::applyTexturePage from 0x10046ab60 to 0x10046ad3d (477 bytes)
//
// 3 xrefs:
// > CreateParticlePopup::onPage @ 0x100467da0
// > CreateParticlePopup::onSelectParticleTexture @ 0x100469118
// > CreateParticlePopup::onTexturePage @ 0x1004691d8
//
// This function is hookable on this platform (idp: pc, 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 12:30:31 +0000
//
__int64 __fastcall CreateParticlePopup::applyTexturePage(__int64 a1, _BOOL8 a2)
{
__int64 v2; // rbx
__int64 v3; // rax
__int64 v4; // r14
__int64 v5; // rax
int v6; // r12d
__int64 v7; // r15
__int64 result; // rax
__int64 v9; // r14
__int64 v10; // rax
__int64 CString; // rax
char v12; // [rsp+0h] [rbp-50h]
unsigned __int64 v13; // [rsp+8h] [rbp-48h] BYREF
double v14; // [rsp+10h] [rbp-40h] BYREF
unsigned __int64 v15; // [rsp+18h] [rbp-38h] BYREF
float v16[12]; // [rsp+20h] [rbp-30h] BYREF
v2 = a1;
if ( *(_DWORD *)(a1 + 928) >= 5u )
*(_DWORD *)(a1 + 928) = 0;
v3 = *(_QWORD *)(a1 + 896);
if ( (int)((unsigned __int64)(*(_QWORD *)(a1 + 904) - v3) >> 3) > 0 )
{
v4 = 0;
do
{
a1 = *(_QWORD *)(v3 + 8 * v4);
a2 = (unsigned int)v4 / 0x58 == *(_DWORD *)(v2 + 928);
(*(void (__fastcall **)(__int64, _BOOL8))(*(_QWORD *)a1 + 344LL))(a1, a2);
++v4;
v3 = *(_QWORD *)(v2 + 896);
}
while ( v4 < (int)((unsigned __int64)(*(_QWORD *)(v2 + 904) - v3) >> 3) );
}
v5 = cocos2d::CCDirector::sharedDirector(a1, a2);
cocos2d::CCDirector::getWinSize(v16, v5);
sub_100278250((float *)&v13, (float)(v16[0] * 0.5) + -56.0, (float)(0.5 * v16[1]) + 75.0);
v6 = *(_DWORD *)(v2 + 992);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v2 + 888) + 344LL))(
*(_QWORD *)(v2 + 888),
v6 / 88 == *(_DWORD *)(v2 + 928));
v7 = *(_QWORD *)(v2 + 888);
sub_100278250((float *)&v15, (float)(v6 % 88 % 11) * 24.0, (float)(v6 % 88 / 11) * -24.0);
sub_100278350(&v14, &v13, &v15);
result = (*(__int64 (__fastcall **)(__int64, double *))(*(_QWORD *)v7 + 184LL))(v7, &v14);
v9 = *(_QWORD *)(v2 + 920);
if ( v9 )
{
v10 = sub_10088E820("%i/%i", v12);
CString = cocos2d::CCString::getCString(v10);
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 928LL))(v9, CString);
}
return result;
}