//
// GJBaseGameLayer::processAreaEffects from 0x1001f42ec to 0x1001f4a8c (1952 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::processAreaActions @ 0x1001f62f8
// > GJBaseGameLayer::processAreaActions @ 0x1001f6314
// > GJBaseGameLayer::processAreaActions @ 0x1001f632c
// > GJBaseGameLayer::processAreaVisualActions @ 0x1001f657c
// > GJBaseGameLayer::processAreaVisualActions @ 0x1001f65a0
//
// 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 __fastcall GJBaseGameLayer::processAreaEffects(
GJBaseGameLayer *a1,
std::vector *a2,
GJAreaActionType a3,
float a4,
bool a5)
{
EnterEffectInstance *end; // x9
std::__vector_base::pointer begin; // x22
EnterEffectObject *m_gameObject; // x26
int m_specialTarget; // w24
GameObject *MainObject; // x0
GameObject *v14; // x24
double v15; // d0
float32x2_t *LastPosition; // x1
float32x2_t *v17; // x0
PlayerObject **p_m_player1; // x8
GameObject *v19; // x24
double *v20; // x0
double v21; // d0
__int64 v22; // x25
float32x2_t *v23; // x1
cocos2d::CCDirector *v24; // x0
__n128 v25; // q0
__n128 v26; // q1
float v27; // s1
float32x2_t v28; // d0
float v29; // s1
float v30; // s1
float v31; // s2
float v32; // s3
float v33; // s3
float v34; // s5
float v35; // s1
float v36; // s2
float m_sectionXFactor; // s2
float v38; // s4
float v39; // s1
float v40; // s6
float v41; // s4
float m_sectionYFactor; // s4
float v43; // s3
float v44; // s5
float v45; // s3
int v46; // w10
float v47; // s13
float v48; // s12
int m_directionType; // w8
int v50; // w9
int v51; // w9
float m_offsetVariance; // s1
__int32 m_offsetY_low; // s1
__int16 v54; // w23
int m_targetGroupIndex; // w19
int v56; // w8
char v57; // w24
int i; // w9
cocos2d::CCArray *v59; // x0
cocos2d::CCArray *v60; // x28
__int16 v61; // w0
std::__vector_base::pointer v62; // [xsp+20h] [xbp-C0h]
int v63; // [xsp+30h] [xbp-B0h]
int v64; // [xsp+34h] [xbp-ACh]
float32x2_t v65; // [xsp+38h] [xbp-A8h] BYREF
float32x2_t v66; // [xsp+40h] [xbp-A0h] BYREF
float32x2_t v67; // [xsp+48h] [xbp-98h] BYREF
__int64 v68; // [xsp+50h] [xbp-90h] BYREF
bool (__fastcall *v69)(__int64, __int64); // [xsp+58h] [xbp-88h] BYREF
cocos2d::CCPoint v70; // 0:s0.4,4:s1.4
cocos2d::CCPoint v71; // 0:s0.4,4:s1.4
cocos2d::CCPoint v72; // 0:s0.4,4:s1.4
cocos2d::CCPoint v73; // 0:s0.4,4:s1.4
cocos2d::CCPoint v74; // 0:s0.4,4:s1.4
LODWORD(v69) = a3;
if ( sub_100018814(&a1->m_gameState.m_unsortedAreaEffects.__table_.__bucket_list_.__ptr_.__value_, (int *)&v69) )
{
v69 = sub_1001D9AEC;
sub_10020E0CC();
LODWORD(v69) = a3;
sub_10001B104(&a1->m_gameState.m_unsortedAreaEffects.__table_.__bucket_list_.__ptr_.__value_, (int *)&v69);
}
begin = a2->__begin_;
end = a2->__end_;
if ( a2->__begin_ != end )
{
v62 = a2->__end_;
while ( begin->m_paused )
{
LABEL_117:
if ( ++begin == end )
return;
}
m_gameObject = begin->m_gameObject;
EnterEffectInstance::updateTransitions(begin, a4, a1);
sub_1000229B0(&v69);
sub_1000229B0(&v68);
if ( m_gameObject->m_specialTarget )
m_specialTarget = m_gameObject->m_specialTarget;
else
m_specialTarget = begin->m_centerID;
if ( (m_specialTarget & 0x80000000) == 0 )
{
MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_specialTarget);
if ( !MainObject )
goto LABEL_44;
v14 = MainObject;
if ( (unsigned int)(a3 - 5) <= 0xFFFFFFFD && GJBaseGameLayer::resetAreaObjectValues(a1, MainObject, 1) )
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, v14);
((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *))v14->getRealPosition)(&v67, v14);
v15 = sub_1000229D0(&v69, (double *)&v67);
((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *, double))v14->getRealPosition)(&v66, v14, v15);
LastPosition = (float32x2_t *)GameObject::getLastPosition(v14);
v17 = &v66;
goto LABEL_20;
}
if ( (unsigned int)m_specialTarget >= 0xFFFFFFFE )
{
if ( m_specialTarget != -2 || (p_m_player1 = &a1->m_player2, !a1->m_gameState.m_isDualMode) )
p_m_player1 = &a1->m_player1;
v19 = *p_m_player1;
v20 = (double *)((__int64 (__fastcall *)(PlayerObject *))(*p_m_player1)->getPosition)(*p_m_player1);
v21 = sub_1000229D0(&v69, v20);
v22 = ((__int64 (__fastcall *)(GameObject *, double))v19->getPosition)(v19, v21);
LastPosition = (float32x2_t *)GameObject::getLastPosition(v19);
v17 = (float32x2_t *)v22;
LABEL_20:
sub_1000229F0(v17, LastPosition, &v67);
v23 = &v67;
LABEL_43:
sub_1000229D0(&v68, (double *)v23);
LABEL_44:
v28.i32[0] = LODWORD(begin->m_offset);
v29 = (float)((float)(begin->m_length + begin->m_lengthVariance) + v28.f32[0]) + begin->m_offsetVariance;
m_gameObject->m_areaRange = (int)v29;
v30 = (float)(int)v29;
v31 = fabsf(begin->m_modFront);
v32 = fabsf(begin->m_modBack);
if ( v31 > v32 )
v31 = v32;
v33 = (float)(1.0 / v31) * v30;
v34 = *(float *)&v69 - v33;
v35 = 0.0;
v36 = 0.0;
if ( (float)(*(float *)&v69 - v33) > 0.0 )
{
m_sectionXFactor = a1->m_sectionXFactor;
if ( v34 >= 10000000.0 )
v36 = m_sectionXFactor * 10000000.0;
else
v36 = v34 * m_sectionXFactor;
}
v38 = *(float *)&v69 + v33;
if ( (float)(*(float *)&v69 + v33) > 0.0 )
{
v39 = a1->m_sectionXFactor;
if ( v38 >= 10000000.0 )
v35 = v39 * 10000000.0;
else
v35 = v38 * v39;
}
v40 = *((float *)&v69 + 1) - v33;
v41 = 0.0;
if ( (float)(*((float *)&v69 + 1) - v33) > 0.0 )
{
m_sectionYFactor = a1->m_sectionYFactor;
if ( v40 >= 10000000.0 )
v41 = m_sectionYFactor * 10000000.0;
else
v41 = v40 * m_sectionYFactor;
}
v43 = v33 + *((float *)&v69 + 1);
if ( v43 <= 0.0 )
{
v44 = a1->m_sectionYFactor;
v45 = 0.0;
}
else
{
v44 = a1->m_sectionYFactor;
if ( v43 >= 10000000.0 )
v45 = v44 * 10000000.0;
else
v45 = v43 * v44;
}
v46 = (int)v41;
v47 = a1->m_sectionXFactor * 10000000.0;
v48 = v44 * 10000000.0;
m_directionType = m_gameObject->m_directionType;
if ( m_directionType == 2 )
{
if ( m_gameObject->m_twoDirections )
v51 = (int)v41;
else
v51 = 0;
if ( m_gameObject->m_twoDirections )
v46 = 0;
if ( m_gameObject->m_inbound )
v51 = v46;
else
v48 = v45;
v64 = v51;
v50 = 0;
}
else
{
v50 = (int)v36;
if ( m_directionType == 1 )
{
if ( !m_gameObject->m_inbound )
{
if ( !m_gameObject->m_twoDirections )
v50 = 0;
v63 = v50;
v64 = 0;
v47 = v35;
LABEL_85:
if ( *(float *)&v68 != 0.0 )
m_gameObject->m_negativeTargetX = *(float *)&v68 < 0.0;
begin->m_easeIndex += 2;
if ( !a3 )
{
if ( begin->m_moveAngleVariance != 0.0 )
{
m_gameObject->m_startAngle = 0;
if ( m_directionType )
goto LABEL_91;
goto LABEL_96;
}
m_gameObject->m_startAngle = 1;
cocos2d::ccpForAngle((float)(begin->m_moveAngle + -90.0) * 0.017453);
sub_1000229D0(&m_gameObject->m_anglePosition, (double *)&v67);
m_directionType = m_gameObject->m_directionType;
v28.i32[0] = LODWORD(begin->m_offset);
}
if ( m_directionType )
{
LABEL_91:
m_offsetVariance = begin->m_offsetVariance;
LODWORD(begin->m_offsetY) = v28.i32[0];
begin->m_offsetYVariance = m_offsetVariance;
m_offsetY_low = v28.i32[0];
LABEL_97:
v28.i32[1] = m_offsetY_low;
v69 = (bool (__fastcall *)(__int64, __int64))vadd_f32(v28, (float32x2_t)v69);
if ( m_gameObject->m_twoDirections )
begin->m_modFront = -fabsf(begin->m_modFront);
v54 = 0;
m_targetGroupIndex = begin->m_targetGroupIndex;
v56 = -1;
v57 = 1;
for ( i = m_targetGroupIndex; ; i = begin->m_targetGroupIndex )
{
v59 = i < 1
? GJBaseGameLayer::getGroup(a1, begin->m_targetID)
: (cocos2d::CCArray *)sub_10024A388(a1->m_targetGroupsArray, (unsigned int)(v56 + i));
v60 = v59;
if ( a3 <= Rotate )
{
if ( a3 )
{
if ( a3 == Rotate )
{
v71.x = sub_1000229B8((__int64 *)&v67, (__int64 *)&v69);
GJBaseGameLayer::processAreaRotateGroupAction(
a1,
v60,
begin,
v71,
(int)&v67,
v63,
(int)v47,
v64,
(int)v48,
v54,
SHIBYTE(v54));
}
}
else
{
v74.x = sub_1000229B8((__int64 *)&v67, (__int64 *)&v69);
GJBaseGameLayer::processAreaMoveGroupAction(
a1,
v60,
begin,
v74,
(int)&v67,
v63,
(int)v47,
v64,
(int)v48,
v54,
SHIBYTE(v54));
}
}
else
{
switch ( a3 )
{
case 4:
v72.x = sub_1000229B8((__int64 *)&v67, (__int64 *)&v69);
GJBaseGameLayer::processAreaTintGroupAction(a1, v60, begin, v72, (bool)&v67);
break;
case 3:
v73.x = sub_1000229B8((__int64 *)&v67, (__int64 *)&v69);
GJBaseGameLayer::processAreaFadeGroupAction(a1, v60, begin, v73, (bool)&v67);
break;
case 2:
v70.x = sub_1000229B8((__int64 *)&v67, (__int64 *)&v69);
GJBaseGameLayer::processAreaTransformGroupAction(
a1,
v60,
begin,
v70,
(int)&v67,
v63,
(int)v47,
v64,
(int)v48,
v54,
SHIBYTE(v54));
break;
}
}
v61 = sub_10024A36C(v60);
if ( ((m_targetGroupIndex > 0) & (unsigned __int8)v57) == 0 )
break;
v57 = 0;
v56 = 0;
v54 += v61;
}
end = v62;
goto LABEL_117;
}
LABEL_96:
m_offsetY_low = LODWORD(begin->m_offsetY);
goto LABEL_97;
}
v64 = 0;
if ( m_gameObject->m_twoDirections )
v50 = 0;
}
else
{
if ( m_gameObject->m_inbound )
v46 = 0;
else
v48 = v45;
v64 = v46;
if ( m_gameObject->m_inbound )
v50 = 0;
else
v47 = v35;
}
}
v63 = v50;
goto LABEL_85;
}
v24 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v24);
v67 = vdiv_f32(v67, vld1_dup_f32(&a1->m_gameState.m_cameraZoom));
sub_1000229B8((__int64 *)&v66, &qword_10086C9A0);
if ( m_specialTarget <= -8 )
{
if ( m_specialTarget <= -10 )
{
if ( m_specialTarget != -11 )
{
if ( m_specialTarget == -10 )
{
v27 = v67.f32[1];
v25.n128_u32[0] = v67.i32[0];
LABEL_41:
v26.n128_f32[0] = v27 * 0.5;
goto LABEL_42;
}
LABEL_40:
v27 = v67.f32[1];
v25.n128_f32[0] = v67.f32[0] * 0.5;
goto LABEL_41;
}
v26.n128_u32[0] = v67.u32[1];
v25.n128_u32[0] = v67.i32[0];
LABEL_42:
sub_100022980(v25, v26, &v65);
sub_1000229D0(&v66, (double *)&v65);
sub_1000229DC((float32x2_t *)&a1->m_gameState.m_cameraPosition, &v66, &v65);
sub_1000229D0(&v69, (double *)&v65);
sub_1000229F0(
(float32x2_t *)&a1->m_gameState.m_cameraPosition,
(float32x2_t *)&a1->m_gameState.m_cameraPosition2,
&v65);
v23 = &v65;
goto LABEL_43;
}
if ( m_specialTarget != -9 )
{
v26.n128_u32[0] = v67.u32[1];
v25.n128_f32[0] = v67.f32[0] * 0.5;
goto LABEL_42;
}
v25.n128_u32[0] = v67.i32[0];
LABEL_37:
v26.n128_u32[0] = 0;
goto LABEL_42;
}
if ( m_specialTarget > -6 )
{
if ( m_specialTarget != -5 )
{
if ( m_specialTarget != -4 )
goto LABEL_40;
v25.n128_u32[0] = 0;
goto LABEL_37;
}
v26.n128_f32[0] = v67.f32[1] * 0.5;
}
else
{
if ( m_specialTarget == -7 )
{
v25.n128_f32[0] = v67.f32[0] * 0.5;
goto LABEL_37;
}
v26.n128_u32[0] = v67.u32[1];
}
v25.n128_u32[0] = 0;
goto LABEL_42;
}
}