//
// BoomScrollLayer::ccTouchEnded from 0x56e128 to 0x56e2f0 (456 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'BoomScrollLayer::ccTouchEnded @ 0x56e2fc
// > ??> @ 0xc0e28
// > ??> @ 0x1135770
//
// 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 BoomScrollLayer::ccTouchEnded(BoomScrollLayer *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
cocos2d::CCTouch *m_touch; // x0
cocos2d::CCDirector *v5; // x0
int m_page; // w22
float v7; // s8
double v8; // d0
float v9; // s2
float v10; // s0
float m_minimumTouchLengthToChangePage; // s1
const cocos2d::CCPoint *v12; // x0
cocos2d::CCPoint v13; // [xsp+40h] [xbp+40h] BYREF
cocos2d::CCPoint v14[2]; // [xsp+48h] [xbp+48h] BYREF
cocos2d::CCPoint v15; // 0:kr08_8.8
cocos2d::CCPoint v16; // 0:s0.4,4:s1.4
m_touch = a1->m_touch;
if ( m_touch == a2 )
{
a1->m_touch = nullptr;
cocos2d::CCTouch::getLocationInView(m_touch);
v5 = cocos2d::CCDirector::sharedDirector();
v15 = cocos2d::CCDirector::convertToGL(v5, &v13);
cocos2d::CCPoint::operator=(&v13, v15.x, v15.y);
m_page = a1->m_page;
v7 = v13.x - a1->m_touchX;
clock_gettime(0, (struct timespec *)v14);
v8 = (double)(__int64)v14[0] + (double)(__int64)v14[1] / 1000000000.0 - a1->m_touchTime;
v9 = fabsf(v7);
if ( v8 == 0.0 )
v10 = a1->m_maxSpeed + 1.0;
else
v10 = v9 / v8;
m_minimumTouchLengthToChangePage = a1->m_minimumTouchLengthToChangePage;
a1->m_touchQuotient = v10;
if ( m_minimumTouchLengthToChangePage > v9
&& (a1->m_unkFloat1 >= v10 || (float)(m_minimumTouchLengthToChangePage * 0.25) > v9) )
{
goto LABEL_8;
}
v12 = a1->m_extendedLayer->getPosition(a1->m_extendedLayer);
cocos2d::CCPoint::CCPoint(v14, v12);
m_page = BoomScrollLayer::pageNumberForPosition(a1, v16);
if ( m_page != a1->m_page )
goto LABEL_8;
if ( v7 >= 0.0 )
goto LABEL_11;
if ( a1->m_looped )
{
++m_page;
}
else
{
if ( m_page >= BoomScrollLayer::getTotalPages(a1) - 1 )
{
LABEL_11:
if ( v7 > 0.0 && (m_page > 0 || a1->m_looped) )
--m_page;
goto LABEL_8;
}
++m_page;
}
LABEL_8:
BoomScrollLayer::moveToPage(a1, m_page);
}
}