//
// GJRotationControl::init from 0xbd3d60 to 0xbd4198 (1080 bytes)
//
// 2 xrefs:
// > ??> @ 0xb2d20
// > ??> @ 0x14e19b0
//
// This function is hookable on this platform (idp: arm, 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 13:03:39 +0000
//
__int64 __fastcall GJRotationControl::init(CCTextInputNode **this)
{
unsigned __int8 v2; // w0
unsigned int v3; // w23
long double v5; // q0
const char *v6; // x1
__int64 v7; // x0
const char *v8; // x1
__int64 v9; // x0
cocos2d::CCMenu *v10; // x0
cocos2d::CCMenuItem *v11; // x1
cocos2d::CCMenu *v12; // x26
void (__fastcall *v13)(cocos2d::CCMenu *, _BYTE *); // x27
const char *v14; // x4
__int64 v15; // x26
void (__fastcall *v16)(__int64, _BYTE *); // x27
__int64 v17; // x0
__int64 v18; // x3
__int64 v19; // x26
__int64 v20; // x22
void (__fastcall *v21)(__int64, _BYTE *); // x26
const char *v22; // x1
__int64 v23; // x22
__int64 v24; // x22
__int64 (__fastcall *v25)(__int64, _BYTE *); // x26
cocos2d::CCMenu *v26; // x0
cocos2d::CCMenu *v27; // x22
_BYTE v28[16]; // [xsp+70h] [xbp+70h] BYREF
__int64 v29[2]; // [xsp+80h] [xbp+80h] BYREF
void *v30; // [xsp+90h] [xbp+90h]
v2 = cocos2d::CCLayer::init((cocos2d::CCLayer *)this);
v3 = v2;
if ( v2 )
{
(*((void (__fastcall **)(CCTextInputNode **, __int64))*this + 125))(this, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 60.0, 0.0);
*(__n128 *)&v5 = cocos2d::CCPoint::operator=((char *)this + 412, v28);
(*((void (__fastcall **)(CCTextInputNode **, void *, long double))*this + 37))(this, &unk_155E9F0, v5);
v7 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_rotationControlBtn01_001.png", v6);
*(this + 53) = (CCTextInputNode *)v7;
(*((void (__fastcall **)(CCTextInputNode **, __int64, __int64))*this + 58))(this, v7, 1);
v9 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"warpLockOffBtn_001.png", v8);
v10 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(
v9,
0,
(__int64)this,
(__int64)GJRotationControl::onToggleLockRotation,
0);
*(this + 56) = v10;
v12 = (cocos2d::CCMenu *)cocos2d::CCMenu::createWithItem(v10, v11);
v13 = *(void (__fastcall **)(cocos2d::CCMenu *, _BYTE *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 110.0, 35.0);
v13(v12, v28);
(*((void (__fastcall **)(CCTextInputNode **, cocos2d::CCMenu *, __int64))*this + 58))(this, v12, 3);
ControlMenuTouch::addMenu((ControlMenuTouch *)(this + 60), v12);
v15 = CCTextInputNode::create(
(CCTextInputNode *)&byte_11E1A70,
48.0,
19.2,
"Thonburi",
(const char *)&off_18,
"bigFont.fnt",
v14);
*(this + 58) = (CCTextInputNode *)v15;
v16 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v15 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 110.0, 0.0);
v16(v15, v28);
CCTextInputNode::setMaxLabelScale(*(this + 58), 0.48);
CCTextInputNode::setMaxLabelWidth(*(this + 58), 48.0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)*(this + 58) + 72) + 344LL))(
*((_QWORD *)*(this + 58) + 72),
0);
v29[0] = 0;
v17 = (__int64)*(this + 58);
v29[1] = 0;
*(_DWORD *)(v17 + 592) = 7;
v18 = (__int64)*(this + 58);
v30 = nullptr;
*(_DWORD *)(v18 + 700) = 1;
*((_DWORD *)*(this + 58) + 176) = 2;
v19 = (__int64)*(this + 58);
std::string::__init(v29, "0123456789.-", 0xCu);
CCTextInputNode::setAllowedChars(v19, (__int64)v29);
if ( (v29[0] & 1) != 0 )
operator delete(v30);
*((_BYTE *)*(this + 58) + 424) = 1;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v28, 0.0, 0.0, 40.0, 40.0);
v20 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", v28);
v21 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v20 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v28, 80.0, 32.0);
v21(v20, v28);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, 0.625);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 912LL))(v20, 90);
(*(void (__fastcall **)(__int64, float, float))(*(_QWORD *)v20 + 248LL))(v20, 0.0, -0.5);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 58) + 464LL))(
*(this + 58),
v20,
0xFFFFFFFFLL);
(*((void (__fastcall **)(CCTextInputNode **, _QWORD, __int64))*this + 58))(this, *(this + 58), 2);
v23 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_updateBtn_001.png", v22);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v23 + 160LL))(v23, 0.4);
v24 = CCMenuItemSpriteExtra::create(v23, 0, (__int64)this, (__int64)GJRotationControl::onApplyAngle, 0);
*(this + 59) = (CCTextInputNode *)v24;
v25 = *(__int64 (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v24 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 151.0, 0.0);
v26 = (cocos2d::CCMenu *)v25(v24, v28);
v27 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v26);
(*(void (__fastcall **)(cocos2d::CCMenu *, void *))(*(_QWORD *)v27 + 184LL))(v27, &unk_155E9F0);
(*(void (__fastcall **)(cocos2d::CCMenu *, void *))(*(_QWORD *)v27 + 320LL))(v27, &unk_155E9F8);
(*(void (__fastcall **)(cocos2d::CCMenu *, _QWORD))(*(_QWORD *)v27 + 456LL))(v27, *(this + 59));
(*((void (__fastcall **)(CCTextInputNode **, cocos2d::CCMenu *, __int64))*this + 58))(this, v27, 3);
ControlMenuTouch::addMenu((ControlMenuTouch *)(this + 60), v27);
GJRotationControl::setAngle((GJRotationControl *)this, 0.0);
}
return v3;
}