//
// CCScrollLayerExt::CCScrollLayerExt from 0x10042de60 to 0x10042e1f2 (914 bytes)
//
// 2 xrefs:
// > sub_10042E470 @ 0x10042e475
// > TableView::TableView @ 0x100621840
//
// 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
//
CCScrollLayerExt *__fastcall CCScrollLayerExt::CCScrollLayerExt(CCScrollLayerExt *a1, cocos2d::CCRect a2)
{
__int64 v2; // rsi
CCContentLayer *v4; // r12
__int64 v5; // rax
cocos2d::CCLayerColor *v6; // r15
__int64 v7; // rax
float v8; // xmm0_4
float v9; // xmm1_4
float *v10; // rax
cocos2d::CCLayerColor *v11; // r14
CCScrollLayerExt *result; // rax
float v13; // [rsp+0h] [rbp-40h]
int v14; // [rsp+4h] [rbp-3Ch] BYREF
float v15; // [rsp+Ch] [rbp-34h]
float v16; // [rsp+10h] [rbp-30h] BYREF
float v17; // [rsp+14h] [rbp-2Ch]
cocos2d::CCLayer::CCLayer(a1);
a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (CCScrollLayerExt_vtbl *)off_100935C30;
a1->cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)off_1009360C0;
a1->cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&off_100936130;
a1->cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)off_100936148;
a1->cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)off_100936168;
a1->cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)off_100936188;
sub_10028CC30(&a1->m_touchPosition);
sub_10028CC30(&a1->m_touchStartPosition);
a1->m_cutContent = 1;
a1->m_disableMovement = 0;
((void (__fastcall *)(CCScrollLayerExt *, __int64, double, double))a1->setTouchEnabled)(
a1,
1,
*(double *)&a2.origin,
*(double *)&a2.size);
*(_WORD *)&a1->m_disableHorizontal = 0;
((void (__fastcall *)(CCScrollLayerExt *, __int64))a1->setContentSize)(a1, v2 + 8);
((void (__fastcall *)(CCScrollLayerExt *))a1->setPosition)(a1);
*(_WORD *)&a1->m_vScrollbarVisible = 0;
a1->m_delegate = nullptr;
*(_OWORD *)&a1->m_scrollLimitTop = xmmword_10081BC90;
a1->m_touch = nullptr;
sub_10028CC90(&a1->m_touchPosition, &dbl_1009A1648);
sub_10028CC90(&a1->m_touchStartPosition, &dbl_1009A1648);
*(_WORD *)&a1->m_touchDown = 0;
v16 = 1.1801041e-38;
v4 = CCContentLayer::create((const cocos2d::ccColor4B *)&v16, *(float *)(v2 + 8), 0.0);
a1->m_contentLayer = v4;
sub_10028CBE0(&v16, 0.0, 0.0);
((void (__fastcall *)(CCContentLayer *, float *))v4->setAnchorPoint)(v4, &v16);
((void (__fastcall *)(CCScrollLayerExt *, CCContentLayer *))a1->addChild)(a1, a1->m_contentLayer);
a1->m_verticalScrollbar = nullptr;
v15 = *(float *)(v2 + 12);
v5 = ((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_10028CBF0(&v16, 4.0, (float)(v15 * v15) / *(float *)(v5 + 4));
v14 = -1271778766;
v6 = cocos2d::CCLayerColor::create((const cocos2d::ccColor4B *)&v14, v16, v17);
a1->m_verticalScrollbar = v6;
v15 = *(float *)((__int64 (__fastcall *)(CCScrollLayerExt *))a1->getContentSize)(a1);
v13 = v16;
v7 = ((__int64 (__fastcall *)(CCScrollLayerExt *))a1->getContentSize)(a1);
v8 = v15 - v13 * 0.5;
v9 = *(float *)(v7 + 4) - v17 * 0.5;
sub_10028CBE0((float *)&v14, v8, v9);
((void (__fastcall *)(cocos2d::CCLayerColor *, int *))v6->setPosition)(v6, &v14);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_verticalScrollbar->setTouchEnabled)(
a1->m_verticalScrollbar,
0);
((void (__fastcall *)(CCScrollLayerExt *, cocos2d::CCLayerColor *))a1->addChild)(a1, a1->m_verticalScrollbar);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_verticalScrollbar->setVisible)(
a1->m_verticalScrollbar,
0);
a1->m_horizontalScrollbar = nullptr;
v15 = *(float *)(v2 + 8);
v10 = (float *)((__int64 (__fastcall *)(CCContentLayer *))a1->m_contentLayer->getContentSize)(a1->m_contentLayer);
sub_10028CBF0(&v16, (float)(v15 * v15) / *v10, 4.0);
v14 = -1271778766;
v11 = cocos2d::CCLayerColor::create((const cocos2d::ccColor4B *)&v14, v16, v17);
a1->m_horizontalScrollbar = v11;
sub_10028CBE0((float *)&v14, v16 * 0.5, 0.5 * v17);
((void (__fastcall *)(cocos2d::CCLayerColor *, int *))v11->setPosition)(v11, &v14);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_horizontalScrollbar->setTouchEnabled)(
a1->m_horizontalScrollbar,
0);
((void (__fastcall *)(CCScrollLayerExt *, cocos2d::CCLayerColor *))a1->addChild)(a1, a1->m_horizontalScrollbar);
((void (__fastcall *)(cocos2d::CCLayerColor *, _QWORD))a1->m_horizontalScrollbar->setVisible)(
a1->m_horizontalScrollbar,
0);
cocos2d::CCNode::schedule_2(a1, (cocos2d::SEL_SCHEDULE)(unsigned __int64)CCScrollLayerExt::updateIndicators);
return result;
}