//
// PlayLayer::applyEnterEffect from 0x311fb0 to 0x3123d4 (1060 bytes)
//
// 1 xrefs:
// > PlayLayer::updateVisibility @ 0x315e6a
//
// 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 PlayLayer::applyEnterEffect(PlayLayer *a1, GameObject *a2, int a3, bool a4)
{
_BOOL4 v4; // r8
cocos2d::CCPoint *p_m_enterEffectPosition; // r6
cocos2d::CCPoint v9; // r1
float RelativeModNew; // s16
_BOOL4 v11; // r2
__int16 m_enterType; // r3
const cocos2d::CCPoint *v13; // r0
cocos2d::CCDirector *v14; // r0
float v15; // s15
float y; // s14
int v17; // r3
float v18; // s15
float v19; // s15
cocos2d::CCDirector *v20; // r0
__int16 m_exitType; // r3
float v22; // r1
float v23; // s14
void (__fastcall *setPosition)(GameObject *__hidden, const cocos2d::CCPoint *); // r10
float v25; // s15
float v26; // s14
float v27; // s15
float v28; // r2
_BOOL4 m_hasNoAudioScale; // r5
bool v30; // [sp+8h] [bp-20h]
cocos2d::CCPoint v31; // [sp+Ch] [bp-1Ch] BYREF
cocos2d::CCPoint v32; // [sp+14h] [bp-14h] BYREF
cocos2d::CCPoint v33; // [sp+1Ch] [bp-Ch] BYREF
v4 = a4;
p_m_enterEffectPosition = &a1->m_enterEffectPosition;
cocos2d::CCPoint::CCPoint(&v33, &a1->m_enterEffectPosition);
LODWORD(v9.x) = &v33;
v9.y = 70.0;
RelativeModNew = PlayLayer::getRelativeModNew(a1, v9, 0.0, 0.0, v4, v30);
v11 = GameObject::ignoreEnter(a2) || RelativeModNew == 1.0;
if ( v4 )
m_enterType = a2->m_enterType;
else
m_enterType = a2->m_exitType;
if ( m_enterType == -1 || a3 == -14 && m_enterType != -14 )
{
if ( v11 )
{
v13 = (const cocos2d::CCPoint *)((int (__fastcall *)(GameObject *, int))a2->getPosition)(a2, m_enterType + 1);
cocos2d::CCPoint::CCPoint(&v33, v13);
if ( p_m_enterEffectPosition->x != v33.x || a1->m_enterEffectPosition.y != v33.y )
a2->setPosition(a2, p_m_enterEffectPosition);
if ( a2->m_unk3E8 )
{
a2->m_unk3E8 = 0;
if ( !a2->m_usesAudioScale || a2->m_hasNoAudioScale )
{
((void (__fastcall *)(GameObject *, int))a2->setRScaleX)(a2, 1065353216);
((void (__fastcall *)(GameObject *, int))a2->setRScaleY)(a2, 1065353216);
}
}
return;
}
if ( v4 )
a2->m_enterType = a3;
else
a2->m_exitType = a3;
switch ( a3 )
{
case -13:
case -12:
v20 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCSize *)&v33, v20);
v19 = 0.0;
if ( (float)(a1->m_gameState.m_cameraPosition2.y + (float)(v33.y * 0.5)) < a1->m_enterEffectPosition.y )
v19 = 180.0;
if ( a3 == -13 )
v19 = v19 + 180.0;
goto LABEL_35;
case -11:
v18 = vcvts_n_f32_s32(rand(), 0x1Fu);
v19 = (float)((float)(v18 + v18) - 1.0) * 180.0;
LABEL_35:
*(float *)&a2->m_unk3D8 = v19;
break;
case -10:
case -9:
v14 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCSize *)&v33, v14);
v15 = a1->m_gameState.m_cameraPosition2.y + (float)(v33.y * 0.5);
y = a1->m_enterEffectPosition.y;
if ( a3 == -10 )
{
if ( v15 >= y )
v17 = -1036779520;
else
v17 = -1022951424;
}
else if ( v15 >= y )
{
v17 = 1110704128;
}
else
{
v17 = 1124532224;
}
a2->m_unk3D8 = v17;
break;
default:
break;
}
LABEL_40:
if ( v4 )
goto LABEL_41;
LABEL_42:
m_exitType = a2->m_exitType;
goto LABEL_43;
}
if ( !v11 )
goto LABEL_40;
a2->m_unk3E8 = 1;
if ( !v4 )
{
a2->m_exitType = -1;
goto LABEL_42;
}
a2->m_enterType = -1;
LABEL_41:
m_exitType = a2->m_enterType;
LABEL_43:
switch ( m_exitType )
{
case -13:
case -12:
case -11:
case -10:
case -9:
cocos2d::ccpForAngle(&v31, (float)(*(float *)&a2->m_unk3D8 - 90.0) * 0.017453);
setPosition = a2->setPosition;
v25 = (float)(1.0 - RelativeModNew) * 100.0;
v22 = v25 * v31.x;
v23 = v31.y;
goto LABEL_50;
case -8:
v26 = 100.0;
setPosition = a2->setPosition;
v27 = 1.0 - RelativeModNew;
goto LABEL_48;
case -7:
v26 = -100.0;
setPosition = a2->setPosition;
v27 = 1.0 - RelativeModNew;
LABEL_48:
v28 = 0.0;
v22 = v27 * v26;
goto LABEL_51;
case -6:
v22 = 0.0;
v23 = -100.0;
setPosition = a2->setPosition;
v25 = 1.0 - RelativeModNew;
goto LABEL_50;
case -5:
v22 = 0.0;
v23 = 100.0;
setPosition = a2->setPosition;
v25 = 1.0 - RelativeModNew;
LABEL_50:
v28 = v25 * v23;
LABEL_51:
cocos2d::CCPoint::CCPoint(&v32, v22, v28);
cocos2d::CCPoint::operator+(&v33, p_m_enterEffectPosition, &v32);
setPosition(a2, &v33);
goto LABEL_58;
case -4:
if ( a2->m_usesAudioScale )
{
m_hasNoAudioScale = a2->m_hasNoAudioScale;
if ( !a2->m_hasNoAudioScale )
goto LABEL_57;
}
((void (__fastcall *)(GameObject *, _DWORD))a2->setRScaleX)(
a2,
(float)((float)(1.0 - RelativeModNew) * 0.75) + 1.0);
((void (__fastcall *)(GameObject *, _DWORD))a2->setRScaleY)(
a2,
(float)((float)(1.0 - RelativeModNew) * 0.75) + 1.0);
break;
case -3:
if ( a2->m_usesAudioScale )
{
m_hasNoAudioScale = a2->m_hasNoAudioScale;
if ( !a2->m_hasNoAudioScale )
goto LABEL_57;
}
((void (__fastcall *)(GameObject *, _DWORD))a2->setRScaleX)(a2, LODWORD(RelativeModNew));
((void (__fastcall *)(GameObject *, _DWORD))a2->setRScaleY)(a2, LODWORD(RelativeModNew));
break;
default:
m_hasNoAudioScale = 1;
goto LABEL_57;
}
m_hasNoAudioScale = 0;
LABEL_57:
a2->setPosition(a2, p_m_enterEffectPosition);
if ( m_hasNoAudioScale )
{
LABEL_58:
if ( !a2->m_usesAudioScale || a2->m_hasNoAudioScale )
{
((void (__fastcall *)(GameObject *, int))a2->setRScaleX)(a2, 1065353216);
((void (__fastcall *)(GameObject *, int))a2->setRScaleY)(a2, 1065353216);
}
}
if ( RelativeModNew == 0.0 )
{
a2->m_unk3E8 = 1;
if ( v4 )
a2->m_enterType = -1;
else
a2->m_exitType = -1;
}
}