//
// GJBaseGameLayer::speedForShaderTarget from 0x472344 to 0x47241c (216 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateShaderLayer @ 0x472600
// > GJBaseGameLayer::updateShaderLayer @ 0x47261a
//
// 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
//
cocos2d::CCPoint *GJBaseGameLayer::speedForShaderTarget(
cocos2d::CCPoint *__return_ptr retstr,
GJBaseGameLayer *a2,
int a3)
{
const cocos2d::CCPoint *v6; // r6
PlayerObject *m_player2; // r0
const cocos2d::CCPoint *LastPosition; // r0
int v9; // r2
bool v10; // r3
GameObject *MainObject; // r0
GameObject *v12; // r5
const cocos2d::CCPoint *v13; // r0
int v14; // r2
bool v15; // r3
cocos2d::CCPoint v17; // [sp+4h] [bp-14h] BYREF
cocos2d::CCPoint v18; // [sp+Ch] [bp-Ch] BYREF
cocos2d::CCPoint::CCPoint(retstr);
if ( a3 == -1 )
goto LABEL_4;
if ( a3 == -2 )
{
if ( a2->m_gameState.m_isDualMode )
{
v6 = a2->m_player2->getPosition(a2->m_player2);
m_player2 = a2->m_player2;
goto LABEL_6;
}
LABEL_4:
v6 = a2->m_player1->getPosition(a2->m_player1);
m_player2 = a2->m_player1;
LABEL_6:
LastPosition = GameObject::getLastPosition(m_player2);
cocos2d::CCPoint::operator-(&v18, v6, LastPosition);
LABEL_9:
cocos2d::CCPoint::operator=((PlayerObject *)retstr, COERCE_FLOAT(&v18), v9, v10);
return retstr;
}
if ( a3 <= 0 )
{
cocos2d::CCPoint::operator-(&v18, &a2->m_gameState.m_cameraStepDiff);
goto LABEL_9;
}
MainObject = GJBaseGameLayer::tryGetMainObject(a2, a3);
v12 = MainObject;
if ( MainObject )
{
MainObject->getRealPosition(&v17, MainObject);
v13 = GameObject::getLastPosition(v12);
cocos2d::CCPoint::operator-(&v18, &v17, v13);
}
else
{
cocos2d::CCPoint::CCPoint(&v18, &stru_AC68C0);
}
cocos2d::CCPoint::operator=((PlayerObject *)retstr, COERCE_FLOAT(&v18), v14, v15);
return retstr;
}