//
// GJTransformControl::init from 0x1003fb8c4 to 0x1003fbb20 (604 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008143a8
//
// 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 __fastcall GJTransformControl::init(GJTransformControl *a1)
{
_BOOL4 v2; // w19
__int64 v3; // x21
cocos2d::CCNode *v4; // x0
cocos2d::CCNode *v5; // x0
cocos2d::CCSprite *v6; // x0
CCMenuItemSpriteExtra *v7; // x0
cocos2d::CCMenu *v8; // x0
cocos2d::CCArray *v9; // x0
float v10; // s8
const std::string::value_type *v11; // x1
std::string *v12; // x0
cocos2d::CCSprite *v13; // x24
GJTransformControl *m_mainNodeParent; // x0
GameManager *v15; // x0
_BOOL4 GameVariable; // w0
float v17; // s0
std::string v19; // [xsp+8h] [xbp-68h] BYREF
cocos2d::SEL_MenuHandler v20; // 0:x3.16
v2 = cocos2d::CCLayer::init(a1);
if ( !v2 )
return v2;
v3 = 1;
((void (__fastcall *)(GJTransformControl *, __int64))a1->setTouchEnabled)(a1, 1);
((void (__fastcall *)(GJTransformControl *, int *))a1->setAnchorPoint)(a1, &dword_10086E8B0);
v4 = cocos2d::CCNode::create();
a1->m_mainNode = v4;
((void (__fastcall *)(GJTransformControl *, cocos2d::CCNode *))a1->addChild)(a1, v4);
v5 = cocos2d::CCNode::create();
a1->m_mainNodeParent = v5;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCNode *))a1->m_mainNode->addChild)(a1->m_mainNode, v5);
a1->m_touchID = -1;
v6 = cocos2d::CCSprite::createWithSpriteFrameName("warpLockOffBtn_001.png");
v20.ptr = (void (__cdecl *)(cocos2d::CCObject *))GJTransformControl::onToggleLockScale;
v20.adj = 0;
v7 = CCMenuItemSpriteExtra::create(v6, nullptr, a1, v20);
a1->m_warpLockButton = v7;
v8 = cocos2d::CCMenu::createWithItem(v7);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCMenu *))a1->m_mainNodeParent->addChild)(a1->m_mainNodeParent, v8);
v9 = (cocos2d::CCArray *)sub_10024A15C();
a1->m_warpSprites = v9;
cocos2d::CCObject::retain(v9);
do
{
sub_100009900(&v19, "warpBtn_02_001.png");
v10 = 0.0;
if ( (int)v3 <= 10 )
{
v11 = "warpBtn_01_001.png";
if ( (_DWORD)v3 != 1 )
{
if ( (_DWORD)v3 != 10 )
goto LABEL_11;
v11 = "warpBtn_03_001.png";
}
LABEL_9:
std::string::assign(&v19, v11);
goto LABEL_11;
}
if ( (_DWORD)v3 != 11 )
{
v11 = "warpBtn_01_001.png";
if ( (_DWORD)v3 != 12 )
goto LABEL_11;
goto LABEL_9;
}
std::string::assign(&v19, "warpBtn_03_001.png");
v10 = 90.0;
LABEL_11:
if ( (v19.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v12 = &v19;
else
v12 = (std::string *)v19.__r_.__value_.__r.__words[0];
v13 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v12);
m_mainNodeParent = a1;
if ( (_DWORD)v3 != 1 )
{
m_mainNodeParent = a1;
if ( (_DWORD)v3 != 12 )
m_mainNodeParent = (GJTransformControl *)a1->m_mainNodeParent;
}
((void (__fastcall *)(GJTransformControl *, cocos2d::CCSprite *, __int64))m_mainNodeParent->addChild_0)(
m_mainNodeParent,
v13,
100);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v13->setTag)(v13, v3);
((void (__fastcall *)(cocos2d::CCSprite *, float))v13->setRotation)(v13, v10);
sub_10024A2D0((__int64)a1->m_warpSprites);
if ( SHIBYTE(v19.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v19.__r_.__value_.__l.__data_);
v3 = (unsigned int)(v3 + 1);
}
while ( (_DWORD)v3 != 13 );
v15 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v15, "0169");
v17 = 1.0;
if ( GameVariable )
v17 = 0.5;
a1->m_buttonScale = v17;
GJTransformControl::scaleButtons(a1, 1.0);
return v2;
}