//
// GJBaseGameLayer::applyShake from 0x4777d0 to 0x4778ec (284 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::updateCamera @ 0x4873ce
//
// 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 GJBaseGameLayer::applyShake(GJBaseGameLayer *a1, cocos2d::CCPoint *a2)
{
cocos2d::CCPoint *p_m_unkPoint34; // r7
float *p_y; // r6
double m_unkUint64_1; // d7
double m_totalTime; // d6
float m_unkUint16; // s11
float v9; // s14
float v10; // s16
float v11; // s17
float v12; // s17
int v13; // r0
float m_unkUint15; // s15
float v15; // s14
p_m_unkPoint34 = &a1->m_gameState.m_unkPoint34;
p_y = &a1->m_gameState.m_unkPoint34.y;
m_unkUint64_1 = a1->m_gameState.m_unkUint64_1;
m_totalTime = a1->m_gameState.m_totalTime;
if ( m_unkUint64_1 < 0.0
|| (m_unkUint16 = a1->m_gameState.m_unkUint16, m_unkUint16 <= 0.0)
|| (v9 = m_totalTime - m_unkUint64_1, v9 > m_unkUint16) )
{
a1->m_gameState.m_unkUint64_1 = m_totalTime;
if ( a1->m_staticCameraShake )
{
v10 = 1.0;
if ( (float)((float)rand() * 4.6566e-10) > 0.5 )
v11 = 1.0;
else
v11 = -1.0;
if ( (float)((float)rand() * 4.6566e-10) <= 0.5 )
v10 = -1.0;
}
else
{
v12 = (float)rand();
v13 = rand();
v11 = (float)((float)(v12 * 4.6566e-10) + (float)(v12 * 4.6566e-10)) - 1.0;
v10 = (float)((float)((float)v13 * 4.6566e-10) + (float)((float)v13 * 4.6566e-10)) - 1.0;
}
m_unkUint15 = a1->m_gameState.m_unkUint15;
p_m_unkPoint34->x = v11 * m_unkUint15;
*p_y = v10 * m_unkUint15;
}
v15 = *p_y;
a2->x = a2->x + p_m_unkPoint34->x;
a2->y = a2->y + v15;
}