//
// TouchControlEditLayer::create from 0x140452140 to 0x140452452 (786 bytes)
//
// 2 xrefs:
// > PlatformerControlsPopup::onTouch @ 0x1404518fc
// > ??> @ 0x140927884
//
// 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 11:32:27 +0000
//
// Hidden C++ exception states: #wind=4
char *__fastcall TouchControlEditLayer::create(char a1, __int64 a2)
{
char *v4; // rdi
int v5; // r9d
__int64 v6; // rdx
char *v8; // [rsp+70h] [rbp+18h] BYREF
v4 = (char *)operator new(0x540u);
v8 = v4;
memset(v4, 0, 0x540u);
SetupTriggerPopup::SetupTriggerPopup((__int64)v4);
*(_QWORD *)v4 = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 40) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 41) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 42) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 43) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 44) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 51) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 54) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 68) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 83) = &TouchControlEditLayer::`vftable';
*((_QWORD *)v4 + 84) = &TouchControlEditLayer::`vftable';
v4[1000] = 0;
*((_QWORD *)v4 + 126) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1044));
UIButtonConfig::reset((__int64)(v4 + 1016));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1084));
UIButtonConfig::reset((__int64)(v4 + 1056));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1124));
UIButtonConfig::reset((__int64)(v4 + 1096));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1164));
UIButtonConfig::reset((__int64)(v4 + 1136));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1204));
UIButtonConfig::reset((__int64)(v4 + 1176));
*((_QWORD *)v4 + 152) = 0;
*((_QWORD *)v4 + 153) = 0;
*((_QWORD *)v4 + 154) = 0;
*((_QWORD *)v4 + 155) = 0;
*((_QWORD *)v4 + 156) = 0;
*((_QWORD *)v4 + 157) = 0;
*((_QWORD *)v4 + 158) = 0;
*((_QWORD *)v4 + 159) = 0;
*((_DWORD *)v4 + 320) = 0;
*((_QWORD *)v4 + 161) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1296));
*((_DWORD *)v4 + 326) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1308));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v4 + 1316));
*((_DWORD *)v4 + 331) = 0;
v4[1328] = 0;
*((_QWORD *)v4 + 167) = 0;
if ( (unsigned __int8)SetupTriggerPopup::init((_DWORD)v4, 0, 0, v5, 1133248512, 1, 0) )
{
v4[1000] = a1;
*((_QWORD *)v4 + 126) = a2;
v4[744] = 1;
(*(void (__fastcall **)(char *))(*(_QWORD *)v4 + 1096LL))(v4);
sub_14060B340(v4);
LOWORD(v8) = 0;
BYTE2(v8) = 0;
(**((void (__fastcall ***)(__int64, char **))v4 + 51))((__int64)(v4 + 408), &v8);
LOBYTE(v6) = 50;
(*(void (__fastcall **)(char *, __int64))(*((_QWORD *)v4 + 51) + 40LL))(v4 + 408, v6);
v4[596] = 1;
TouchControlEditLayer::buildNodes(v4);
TouchControlEditLayer::buildHud(v4);
TouchControlEditLayer::updateHandles(v4);
TouchControlEditLayer::updateJumpGuide(v4);
(*(void (__fastcall **)(char *))(*(_QWORD *)v4 + 1136LL))(v4);
v4[744] = 0;
TouchControlEditLayer::refreshHud(v4);
TouchControlEditLayer::updateHudVisibility(v4);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v4);
return v4;
}
else
{
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v4 + 8LL))(v4, 1);
return nullptr;
}
}