//
// PlayLayer::getCurrentPercent from 0x312674 to 0x3126e0 (108 bytes)
//
// 2 xrefs:
// > PlayLayer::updateProgressbar @ 0x31270c
// > PlayLayer::getCurrentPercentInt @ 0x3129a2
//
// 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
//
float PlayLayer::getCurrentPercent(PlayLayer *a1)
{
const cocos2d::CCPoint *v2; // r0
float m_levelLength; // s15
int m_timestamp; // r3
float x; // s14
float v6; // s15
v2 = a1->m_player1->getPosition(a1->m_player1);
m_levelLength = a1->m_levelLength;
m_timestamp = a1->m_level->m_timestamp;
if ( m_timestamp > 0 )
m_levelLength = (float)(2 * m_timestamp);
x = v2->x;
if ( m_timestamp > 0 )
x = (float)(int)a1->m_gameState.m_currentProgress;
v6 = (float)(x / m_levelLength) * 100.0;
if ( v6 <= 0.0 )
return 0.0;
if ( v6 >= 100.0 )
return 100.0;
return v6;
}