//
// TableView::checkBoundaryOfContent from 0x2ea138 to 0x2ea4f0 (952 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
//
void TableView::checkBoundaryOfContent(TableView *a1, float a2)
{
int v3; // r7
cocos2d::CCArray *m_cellArray; // r0
TableViewCell *v5; // r5
TableViewCell *v6; // r6
int v7; // r7
int v8; // r7
int v9; // r7
const cocos2d::CCPoint *v10; // r0
float y; // s16
CCIndexPath *v12; // r6
float v13; // s16
CCIndexPath *v14; // r0
int m_row; // r3
float v16; // r9
TableViewCell *v17; // r0
cocos2d::CCObject *v18; // r5
const cocos2d::CCSize *v19; // r0
bool (__fastcall *v20)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // r9
cocos2d::CCArray *v21; // r0
_BOOL4 isDuplicateIndexPath; // r2
cocos2d::CCArray *m_indexPathArray; // r0
cocos2d::CCObject *v24; // r1
float v25; // s16
TableViewCell *v26; // r0
void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int (__fastcall *getTag)(const cocos2d::CCObject *__hidden); // r9
const cocos2d::CCSize *v29; // r0
bool (__fastcall *isEqual)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // r9
const cocos2d::CCSize *v31; // r0
TableViewDelegate *m_tableDelegate; // r0
TableViewDelegate *v33; // r0
void (__fastcall *v34)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-90h]
int (__fastcall *v35)(const cocos2d::CCObject *__hidden); // [sp+4h] [bp-90h]
cocos2d::CCPoint v36; // [sp+Ch] [bp-88h] BYREF
CCIndexPath v37; // [sp+14h] [bp-80h] BYREF
CCIndexPath v38; // [sp+50h] [bp-44h] BYREF
v3 = cocos2d::CCArray::count(a1->m_cellArray);
m_cellArray = a1->m_cellArray;
if ( m_cellArray && v3 > 0 )
{
v5 = (TableViewCell *)cocos2d::CCArray::objectAtIndex(m_cellArray, 0);
v6 = (TableViewCell *)cocos2d::CCArray::objectAtIndex(a1->m_cellArray, v3 - 1);
if ( v3 == 1 )
{
v7 = a1->m_dataSource->numberOfRowsInSection(a1->m_dataSource, v5->m_indexPath.m_section, a1);
cocos2d::CCObject::CCObject(&v37);
v8 = v7 - 1;
v37.__vftable = (CCIndexPath_vtbl *)&off_A3E680;
v37.m_row = 0;
v37.m_section = 0;
cocos2d::CCObject::CCObject(&v38);
v38.m_row = v8;
v38.__vftable = (CCIndexPath_vtbl *)&off_A3E680;
v38.m_section = 0;
if ( v5->m_indexPath.m_section == v37.m_section && v5->m_indexPath.m_row == v37.m_row )
{
TableView::checkLastCell(a1, v6);
}
else if ( !v6->m_indexPath.m_section && v6->m_indexPath.m_row == v8 )
{
TableView::checkFirstCell(a1, v5);
}
CCIndexPath::~CCIndexPath(&v38);
CCIndexPath::~CCIndexPath(&v37);
}
else
{
TableView::checkFirstCell(a1, v5);
TableView::checkLastCell(a1, v6);
}
return;
}
v9 = a1->m_dataSource->numberOfRowsInSection(a1->m_dataSource, 0, a1);
if ( !v9 )
return;
v10 = a1->m_contentLayer->getPosition(a1->m_contentLayer);
cocos2d::CCPoint::CCPoint(&v36, v10);
y = v36.y;
if ( (float)(y - a1->m_contentLayer->getContentSize(a1->m_contentLayer)->height) < 0.0 )
{
v13 = v36.y;
if ( v13 > a1->getContentSize(a1)->height )
return;
v14 = CCIndexPath::CCIndexPathWithSectionRow(0, 0);
m_row = v14->m_row;
v12 = v14;
if ( m_row < 0 )
return;
if ( m_row >= v9 )
return;
if ( TableView::isDuplicateInVisibleCellArray(a1, v14) )
return;
v25 = COERCE_FLOAT(
((int (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v12,
a1));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, &a1->m_lastCellPos);
if ( TableView::checkBoundaryOfCell(a1, (TableViewCell *)&v37) == 1 )
return;
v26 = a1->m_dataSource->cellForRowAtIndexPath(a1->m_dataSource, v12, a1);
v18 = v26;
if ( !v26 )
return;
setAnchorPoint = v26->setAnchorPoint;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.0, 1.0);
setAnchorPoint((cocos2d::CCNode *)v18, (const cocos2d::CCPoint *)&v38);
getTag = v18->__vftable[3].getTag;
v29 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v38, v29->width, v25);
((void (__fastcall *)(cocos2d::CCObject *, CCIndexPath *))getTag)(v18, &v38);
isEqual = v18->__vftable[2].isEqual;
v31 = a1->m_contentLayer->getContentSize(a1->m_contentLayer);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.0, v31->height - v25);
isEqual(v18, &v38);
CCIndexPath::operator=(&v18[6].m_nTag, v12);
cocos2d::CCArray::insertObject(a1->m_cellArray, v18, 0);
isDuplicateIndexPath = TableView::isDuplicateIndexPath(a1, v12);
if ( isDuplicateIndexPath )
goto LABEL_35;
m_indexPathArray = a1->m_indexPathArray;
v24 = v12;
LABEL_34:
cocos2d::CCArray::insertObject(m_indexPathArray, v24, 0);
goto LABEL_35;
}
v12 = CCIndexPath::CCIndexPathWithSectionRow(0, v9 - 1);
if ( v12->m_row >= v9 )
return;
if ( TableView::isDuplicateInVisibleCellArray(a1, v12) )
return;
v16 = COERCE_FLOAT(
((int (__fastcall *)(TableViewDelegate *, CCIndexPath *, TableView *))a1->m_tableDelegate->cellHeightForRowAtIndexPath)(
a1->m_tableDelegate,
v12,
a1));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, &a1->m_lastCellPos);
if ( TableView::checkBoundaryOfCell(a1, (TableViewCell *)&v37) == 1 )
return;
v17 = a1->m_dataSource->cellForRowAtIndexPath(a1->m_dataSource, v12, a1);
v18 = v17;
if ( !v17 )
return;
v34 = v17->setAnchorPoint;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.0, 1.0);
v34((cocos2d::CCNode *)v18, (const cocos2d::CCPoint *)&v38);
v35 = v18->__vftable[3].getTag;
v19 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v38, v19->width * 0.5, v16);
((void (__fastcall *)(cocos2d::CCObject *, CCIndexPath *))v35)(v18, &v38);
v20 = v18->__vftable[2].isEqual;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, &a1->m_lastCellPos);
v20(v18, &v38);
CCIndexPath::operator=(&v18[6].m_nTag, v12);
v21 = a1->m_cellArray;
if ( v9 == 1 )
cocos2d::CCArray::insertObject(v21, v18, 0);
else
cocos2d::CCArray::addObject(v21, v18);
isDuplicateIndexPath = TableView::isDuplicateIndexPath(a1, v12);
if ( isDuplicateIndexPath )
goto LABEL_35;
m_indexPathArray = a1->m_indexPathArray;
v24 = v12;
if ( v9 == 1 )
goto LABEL_34;
cocos2d::CCArray::addObject(m_indexPathArray, v12);
LABEL_35:
m_tableDelegate = a1->m_tableDelegate;
if ( m_tableDelegate )
((void (__fastcall *)(TableViewDelegate *, CCIndexPath *, cocos2d::CCObject *, TableView *, void *))m_tableDelegate->TableViewWillDisplayCellForRowAtIndexPath)(
m_tableDelegate,
v12,
v18,
a1,
&_stack_chk_guard);
((void (__fastcall *)(CCContentLayer *, cocos2d::CCObject *, _BOOL4))a1->m_contentLayer->addChild)(
a1->m_contentLayer,
v18,
isDuplicateIndexPath);
v33 = a1->m_tableDelegate;
if ( v33 )
v33->TableViewDidDisplayCellForRowAtIndexPath(v33, v12, (TableViewCell *)v18, a1);
}