//
// CCScrollLayerExt::CCScrollLayerExt from 0x2e82d4 to 0x2e85a4 (720 bytes)
//
// 1 xrefs:
// > TableView::TableView @ 0x2e8e50
//
// 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
//
// Alternative name is '_ZN16CCScrollLayerExtC1EN7cocos2d6CCRectE'
CCScrollLayerExt *CCScrollLayerExt::CCScrollLayerExt(CCScrollLayerExt *a1, cocos2d::CCRect a2)
{
cocos2d::CCPoint *p_m_touchPosition; // r8
float x; // r6
CCContentLayer *v5; // r0
CCContentLayer_vtbl *v6; // r3
CCContentLayer *v7; // r8
void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
CCContentLayer *m_contentLayer; // r0
float v10; // s15
int v11; // r0
cocos2d::CCLayerColor *v12; // r0
cocos2d::CCLayerColor_vtbl *v13; // r3
cocos2d::CCLayerColor *v14; // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCSize *ContentSize; // r0
float v17; // s16
const cocos2d::CCSize *v18; // r0
float v19; // s15
CCContentLayer *v20; // r0
float v21; // s15
float *v22; // r0
cocos2d::CCLayerColor *v23; // r0
cocos2d::CCLayerColor_vtbl *v24; // r3
float width; // s14
cocos2d::CCLayerColor *v26; // r6
void (__fastcall *v27)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCSize v29; // [sp+4h] [bp-14h] BYREF
cocos2d::CCPoint v30; // [sp+Ch] [bp-Ch] BYREF
p_m_touchPosition = &a1->m_touchPosition;
x = a2.origin.x;
cocos2d::CCLayer::CCLayer(a1);
a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (CCScrollLayerExt_vtbl *)&off_A3E388;
a1->cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)&off_A3E5D0;
a1->cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&off_A3E608;
a1->cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&off_A3E614;
a1->cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&off_A3E624;
a1->cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)&off_A3E634;
cocos2d::CCPoint::CCPoint(p_m_touchPosition);
cocos2d::CCPoint::CCPoint(&a1->m_touchStartPosition);
a1->m_cutContent = 1;
a1->m_disableMovement = 0;
cocos2d::CCLayer::setTouchEnabled(a1, 1);
a1->m_disableVertical = 0;
a1->m_disableHorizontal = 0;
cocos2d::CCNode::setContentSize(a1, (const cocos2d::CCSize *)(LODWORD(x) + 8));
cocos2d::CCNode::setPosition(a1, (const cocos2d::CCPoint *)LODWORD(x));
a1->m_vScrollbarVisible = 0;
a1->m_peekLimitTop = 50.0;
a1->m_peekLimitBottom = 50.0;
a1->m_hScrollbarVisible = 0;
a1->m_delegate = nullptr;
a1->m_scrollLimitBottom = 0.0;
a1->m_scrollLimitTop = 0.0;
a1->m_touch = nullptr;
cocos2d::CCPoint::operator=(p_m_touchPosition, &stru_AC53F0);
cocos2d::CCPoint::operator=(&a1->m_touchStartPosition, &stru_AC53F0);
a1->m_touchDown = 0;
a1->m_notAtEndOfScroll = 0;
v30.x = 1.1801e-38;
v5 = CCContentLayer::create((const cocos2d::ccColor4B *)&v30, *(float *)(LODWORD(x) + 8), 0.0);
v6 = v5->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_contentLayer = v5;
v7 = v5;
setAnchorPoint = v6->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v30, 0.0, 0.0);
setAnchorPoint(v7, &v30);
cocos2d::CCNode::addChild(a1, a1->m_contentLayer);
m_contentLayer = a1->m_contentLayer;
v10 = *(float *)(LODWORD(x) + 12);
a1->m_verticalScrollbar = nullptr;
v11 = (int)m_contentLayer->getContentSize(m_contentLayer);
cocos2d::CCSize::CCSize(&v29, 4.0, (float)(v10 * v10) / *(float *)(v11 + 4));
v30.x = -0.00000016596;
v12 = (cocos2d::CCLayerColor *)cocos2d::CCLayerColor::create(
(cocos2d::CCLayerColor *)&v30,
(const cocos2d::_ccColor4B *)LODWORD(v29.width),
v29.height,
COERCE_FLOAT(180));
v13 = v12->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14 = v12;
a1->m_verticalScrollbar = v12;
setPosition = v13->setPosition;
ContentSize = cocos2d::CCNode::getContentSize(a1);
v17 = ContentSize->width - v29.width * 0.5;
v18 = cocos2d::CCNode::getContentSize(a1);
v19 = v18->height - v29.height * 0.5;
cocos2d::CCPoint::CCPoint(&v30, v17, v19);
setPosition(v14, &v30);
a1->m_verticalScrollbar->setTouchEnabled(a1->m_verticalScrollbar, 0);
cocos2d::CCNode::addChild(a1, a1->m_verticalScrollbar);
a1->m_verticalScrollbar->setVisible(a1->m_verticalScrollbar, 0);
v20 = a1->m_contentLayer;
v21 = *(float *)(LODWORD(x) + 8);
a1->m_horizontalScrollbar = nullptr;
v22 = (float *)v20->getContentSize(v20);
cocos2d::CCSize::CCSize(&v29, (float)(v21 * v21) / *v22, 4.0);
v30.x = -0.00000016596;
v23 = (cocos2d::CCLayerColor *)cocos2d::CCLayerColor::create(
(cocos2d::CCLayerColor *)&v30,
(const cocos2d::_ccColor4B *)LODWORD(v29.width),
v29.height,
COERCE_FLOAT(180));
v24 = v23->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
width = v29.width;
v26 = v23;
a1->m_horizontalScrollbar = v23;
v27 = v24->setPosition;
cocos2d::CCPoint::CCPoint(&v30, width * 0.5, v29.height * 0.5);
v27(v26, &v30);
a1->m_horizontalScrollbar->setTouchEnabled(a1->m_horizontalScrollbar, 0);
cocos2d::CCNode::addChild(a1, a1->m_horizontalScrollbar);
a1->m_horizontalScrollbar->setVisible(a1->m_horizontalScrollbar, 0);
LODWORD(v30.x) = CCScrollLayerExt::updateIndicators;
v30.y = 0.0;
cocos2d::CCNode::schedule(a1, CCScrollLayerExt::updateIndicators, 0);
return a1;
}