//
// GJTransformControl::init from 0x387720 to 0x3878c0 (416 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool GJTransformControl::init(GJTransformControl *a1)
{
_BOOL4 v2; // r8
int v3; // r5
cocos2d::CCNode *v4; // r0
GJTransformControl_vtbl *v5; // r3
cocos2d::CCNode *v6; // r0
cocos2d::CCSprite *v7; // r0
CCMenuItemSpriteExtra *v8; // r0
cocos2d::CCMenu *v9; // r0
cocos2d::CCArray *v10; // r0
cocos2d::CCArray *v11; // r0
char *v12; // r1
int v13; // r9
cocos2d::CCSprite *v14; // r6
GameManager *v15; // r0
float v16; // s15
cocos2d::CCSprite *v18[3]; // [sp+20h] [bp-14h] BYREF
v2 = cocos2d::CCLayer::init(a1);
if ( !v2 )
return v2;
v3 = 1;
a1->setTouchEnabled(a1, 1);
a1->setAnchorPoint(a1, (const cocos2d::CCPoint *)&flt_AC5D38);
v4 = cocos2d::CCNode::create();
v5 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainNode = v4;
v5->addChild(a1, v4);
v6 = cocos2d::CCNode::create();
a1->m_mainNodeParent = v6;
a1->m_mainNode->addChild(a1->m_mainNode, v6);
a1->m_touchID = -1;
v7 = cocos2d::CCSprite::createWithSpriteFrameName("warpLockOffBtn_001.png");
v18[1] = (cocos2d::CCSprite *)GJTransformControl::onToggleLockScale;
v18[2] = nullptr;
v8 = CCMenuItemSpriteExtra::create(
v7,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJTransformControl::onToggleLockScale, (unsigned int)a1));
a1->m_warpLockButton = v8;
v9 = cocos2d::CCMenu::createWithItem(v8);
v10 = (cocos2d::CCArray *)((int (__fastcall *)(cocos2d::CCNode *, cocos2d::CCMenu *))a1->m_mainNodeParent->addChild)(
a1->m_mainNodeParent,
v9);
v11 = (cocos2d::CCArray *)cocos2d::CCArray::create(v10);
a1->m_warpSprites = v11;
cocos2d::CCObject::retain(v11);
do
{
sub_776584((int)v18, "warpBtn_02_001.png");
switch ( v3 )
{
case 10:
v12 = "warpBtn_03_001.png";
LABEL_5:
sub_7753D4((int)v18, v12);
break;
case 11:
sub_7753D4((int)v18, "warpBtn_03_001.png");
v13 = 1119092736;
goto LABEL_12;
case 1:
case 12:
v12 = "warpBtn_01_001.png";
goto LABEL_5;
}
v13 = 0;
LABEL_12:
v14 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v18[0]);
if ( v3 == 12 || v3 == 1 )
a1->addChild_0(a1, v14, 100);
else
a1->m_mainNodeParent->addChild_0(a1->m_mainNodeParent, v14, 100);
v14->setTag(v14, v3);
((void (__fastcall *)(cocos2d::CCSprite *, int))v14->setRotation)(v14, v13);
cocos2d::CCArray::addObject(a1->m_warpSprites, v14);
++v3;
sub_774008(v18);
}
while ( v3 != 13 );
v15 = GameManager::sharedState();
v16 = 0.5;
if ( !GameManager::getGameVariable(v15, "0169") )
v16 = 1.0;
a1->m_buttonScale = v16;
GJTransformControl::scaleButtons(a1, 1.0);
return v2;
}