//
// GJBaseGameLayer::processAreaEffects from 0x100140790 to 0x10014140c (3196 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::processAreaActions @ 0x100143339
// > GJBaseGameLayer::processAreaActions @ 0x100143356
// > GJBaseGameLayer::processAreaActions @ 0x100143370
// > GJBaseGameLayer::processAreaVisualActions @ 0x10014382f
// > GJBaseGameLayer::processAreaVisualActions @ 0x100143853
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall GJBaseGameLayer::processAreaEffects(
GJBaseGameLayer *a1,
std::vector *a2,
GJAreaActionType a3,
float a4,
bool a5)
{
unsigned __int64 value; // r8
std::unordered_set *p_m_unsortedAreaEffects; // rbx
unsigned __int64 v8; // r10
unsigned __int64 v9; // rdi
std::__hash_node_base *> *v10; // rax
std::__hash_node_base *>::__next_pointer next; // r9
unsigned __int64 v12; // r8
unsigned __int64 v13; // rax
std::__hash_node_base *>::__next_pointer v14; // rax
std::__vector_base::pointer begin; // rdi
EnterEffectInstance *end; // rax
unsigned __int64 v17; // rdx
__int64 v18; // rdx
__int64 v19; // rcx
bool v20; // zf
std::__vector_base::pointer v21; // r12
EnterEffectInstance *v22; // rcx
cocos2d::CCPoint v23; // xmm0_8
EnterEffectObject *m_gameObject; // r15
unsigned __int64 v25; // rsi
cocos2d::CCDictionary *p_m_anglePosition; // rdi
intptr_t m_specialTarget; // rbx
cocos2d::CCDictionary *m_parentGroupsDict; // rdi
GameObject *v29; // rax
GameObject *v30; // r14
double v31; // xmm0_8
const cocos2d::CCPoint *v32; // rax
GameObject **v33; // rax
GameObject *v34; // rbx
__int64 v35; // rsi
double v36; // xmm0_8
__int64 v37; // r14
const cocos2d::CCPoint *LastPosition; // rax
float v39; // xmm0_4
float v40; // xmm1_4
cocos2d::CCArray *v41; // r14
cocos2d::CCPoint *v42; // rbx
__m128 m_length_low; // xmm1
__m128 m_offset_low; // xmm0
__m128i v45; // xmm2
float v46; // xmm6_4
float v47; // xmm3_4
float v48; // xmm7_4
float v49; // xmm1_4
float m_sectionXFactor; // xmm1_4
float v51; // xmm2_4
float v52; // xmm7_4
float v53; // xmm4_4
float v54; // xmm3_4
float m_sectionYFactor; // xmm3_4
float v56; // xmm6_4
float v57; // xmm2_4
float v58; // xmm6_4
EnterEffectObject *v59; // r14
float v60; // xmm3_4
float v61; // xmm2_4
int m_directionType; // eax
bool m_inbound; // cl
bool m_twoDirections; // dl
int v65; // ecx
bool v66; // dl
float v67; // xmm1_4
int v68; // ecx
__m128 m_offsetY_low; // xmm1
int m_targetGroupIndex; // r15d
cocos2d::CCArray *v71; // r14
intptr_t m_targetID; // rbx
__int64 v73; // rbx
cocos2d::CCPoint v74; // xmm0_8
cocos2d::CCPoint v75; // xmm0_8
cocos2d::CCPoint v76; // xmm0_8
cocos2d::CCPoint v77; // xmm0_8
cocos2d::CCPoint v78; // xmm0_8
cocos2d::CCArray *v79; // rdi
__int64 v80; // rax
__int64 v81; // rsi
cocos2d::CCArray *v82; // r14
intptr_t v83; // r15
cocos2d::CCPoint v84; // xmm0_8
cocos2d::CCPoint v85; // xmm0_8
cocos2d::CCPoint v86; // xmm0_8
cocos2d::CCPoint v87; // xmm0_8
char v88[8]; // [rsp+0h] [rbp-C0h] BYREF
char v89[8]; // [rsp+8h] [rbp-B8h] BYREF
EnterEffectInstance *v90; // [rsp+10h] [rbp-B0h]
cocos2d::CCPoint *p_m_cameraPosition; // [rsp+18h] [rbp-A8h]
cocos2d::CCPoint *p_m_cameraPosition2; // [rsp+20h] [rbp-A0h]
PlayerObject **p_m_player1; // [rsp+28h] [rbp-98h]
PlayerObject **p_m_player2; // [rsp+30h] [rbp-90h]
GJBaseGameLayer *v95; // [rsp+38h] [rbp-88h]
float v96; // [rsp+40h] [rbp-80h]
unsigned int v97; // [rsp+44h] [rbp-7Ch]
_BOOL8 v98; // [rsp+48h] [rbp-78h]
float v99; // [rsp+50h] [rbp-70h] BYREF
__int64 v100; // [rsp+58h] [rbp-68h]
_BOOL4 v101; // [rsp+64h] [rbp-5Ch]
__int64 v102; // [rsp+68h] [rbp-58h]
EnterEffectObject *v103; // [rsp+70h] [rbp-50h]
int v104; // [rsp+7Ch] [rbp-44h]
bool (__fastcall *v105)(__int64, __int64); // [rsp+80h] [rbp-40h] BYREF
int v106; // [rsp+8Ch] [rbp-34h]
double v107[6]; // [rsp+90h] [rbp-30h] BYREF
v101 = a5;
v96 = a4;
v102 = *(_QWORD *)&a3;
value = a1->m_gameState.m_unsortedAreaEffects.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( !value )
goto LABEL_31;
p_m_unsortedAreaEffects = &a1->m_gameState.m_unsortedAreaEffects;
v8 = (0x101010101010101LL
* ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v8 <= 1 )
{
v9 = (int)v102 & (value - 1);
v10 = p_m_unsortedAreaEffects->__table_.__bucket_list_.__ptr_.__value_[v9];
if ( !v10 )
goto LABEL_31;
goto LABEL_9;
}
v9 = (int)v102;
if ( value <= (int)v102 )
{
if ( !((value | (int)v102) >> 32) )
{
v9 = (unsigned int)v102 % (unsigned int)value;
v10 = p_m_unsortedAreaEffects->__table_.__bucket_list_.__ptr_.__value_[v9];
if ( !v10 )
goto LABEL_31;
goto LABEL_9;
}
v9 = (int)v102 % value;
}
v10 = p_m_unsortedAreaEffects->__table_.__bucket_list_.__ptr_.__value_[v9];
if ( !v10 )
goto LABEL_31;
LABEL_9:
next = v10->__next_;
if ( !v10->__next_ )
goto LABEL_31;
if ( (unsigned int)v8 < 2 )
{
v12 = value - 1;
while ( 1 )
{
v14 = next[1].__next_;
if ( v14 == (std::__hash_node_base *>::__next_pointer)(int)v102 )
{
if ( LODWORD(next[2].__next_) == (_DWORD)v102 )
goto LABEL_27;
}
else if ( (v12 & (unsigned __int64)v14) != v9 )
{
goto LABEL_31;
}
next = next->__next_;
if ( !next )
goto LABEL_31;
}
}
while ( 1 )
{
v13 = (unsigned __int64)next[1].__next_;
if ( v13 == (int)v102 )
break;
if ( v13 < value )
goto LABEL_18;
if ( (value | v13) >> 32 )
{
v13 %= value;
LABEL_18:
if ( v13 != v9 )
goto LABEL_31;
goto LABEL_13;
}
if ( (unsigned int)v13 % (unsigned int)value != v9 )
goto LABEL_31;
LABEL_13:
next = next->__next_;
if ( !next )
goto LABEL_31;
}
if ( LODWORD(next[2].__next_) != (_DWORD)v102 )
goto LABEL_13;
LABEL_27:
begin = a2->__begin_;
end = a2->__end_;
_BitScanReverse64(&v17, 0xEEEEEEEEEEEEEEEFLL * (((char *)end - (char *)a2->__begin_) >> 4));
v18 = (2 * ((unsigned int)v17 ^ 0x3F)) ^ 0x7ELL;
v19 = 0;
v20 = end == a2->__begin_;
v105 = sub_10010DDF0;
if ( !v20 )
v19 = v18;
sub_10016BE30(begin, end, &v105, v19, 1);
LODWORD(v105) = v102;
sub_1000569A0(&a1->m_gameState.m_unsortedAreaEffects.__table_.__bucket_list_.__ptr_.__value_, (int *)&v105);
LABEL_31:
v21 = a2->__begin_;
v22 = a2->__end_;
if ( a2->__begin_ != v22 )
{
v97 = v102 - 5;
p_m_cameraPosition = &a1->m_gameState.m_cameraPosition;
p_m_cameraPosition2 = &a1->m_gameState.m_cameraPosition2;
p_m_player1 = &a1->m_player1;
p_m_player2 = &a1->m_player2;
v90 = v22;
v95 = a1;
while ( v21->m_paused )
{
LABEL_36:
if ( ++v21 == v22 )
return;
}
m_gameObject = v21->m_gameObject;
v25 = (unsigned __int64)a1;
EnterEffectInstance::updateTransitions(v21, v96, a1);
sub_10028CC30(&v105);
p_m_anglePosition = (cocos2d::CCDictionary *)&v99;
sub_10028CC30(&v99);
m_specialTarget = (unsigned int)m_gameObject->m_specialTarget;
if ( !(_DWORD)m_specialTarget )
m_specialTarget = (unsigned int)v21->m_centerID;
if ( (int)m_specialTarget < 0 )
{
if ( (unsigned int)m_specialTarget >= 0xFFFFFFFE )
{
if ( (_DWORD)m_specialTarget != -2 || (v33 = p_m_player2, !a1->m_gameState.m_isDualMode) )
v33 = p_m_player1;
v34 = *v33;
v35 = ((__int64 (__fastcall *)(GameObject *))(*v33)->getPosition)(*v33);
v36 = sub_10028CC90();
v37 = ((__int64 (__fastcall *)(GameObject *, __int64, double))v34->getPosition)(v34, v35, v36);
LastPosition = GameObject::getLastPosition(v34);
sub_10028CD00(v107, v37, LastPosition);
p_m_anglePosition = (cocos2d::CCDictionary *)&v99;
v25 = (unsigned __int64)v107;
sub_10028CC90();
LABEL_73:
m_length_low = (__m128)LODWORD(v21->m_length);
m_offset_low = (__m128)LODWORD(v21->m_offset);
m_length_low.f32[0] = (float)((float)(m_length_low.f32[0] + v21->m_lengthVariance) + m_offset_low.f32[0])
+ v21->m_offsetVariance;
m_gameObject->m_areaRange = (int)m_length_low.f32[0];
v45 = _mm_and_si128(_mm_loadl_epi64((const __m128i *)&v21->m_modFront), (__m128i)xmmword_100815500);
v46 = (float)(1.0 / fminf(*(float *)_mm_shuffle_epi32(v45, 245).i32, *(float *)v45.i32))
* _mm_cvtepi32_ps(_mm_cvttps_epi32(m_length_low)).f32[0];
v47 = *(float *)&v105 - v46;
v48 = 0.0;
v49 = 0.0;
if ( (float)(*(float *)&v105 - v46) > 0.0 )
{
m_sectionXFactor = a1->m_sectionXFactor;
if ( v47 >= 10000000.0 )
{
v49 = m_sectionXFactor * 10000000.0;
v51 = *(float *)&v105 + v46;
if ( (float)(*(float *)&v105 + v46) <= 0.0 )
goto LABEL_82;
goto LABEL_77;
}
v49 = m_sectionXFactor * v47;
}
v51 = *(float *)&v105 + v46;
if ( (float)(*(float *)&v105 + v46) <= 0.0 )
goto LABEL_82;
LABEL_77:
v52 = a1->m_sectionXFactor;
if ( v51 >= 10000000.0 )
v48 = v52 * 10000000.0;
else
v48 = v52 * v51;
LABEL_82:
v53 = *((float *)&v105 + 1) - v46;
v54 = 0.0;
if ( (float)(*((float *)&v105 + 1) - v46) > 0.0 )
{
m_sectionYFactor = a1->m_sectionYFactor;
if ( v53 >= 10000000.0 )
{
v54 = m_sectionYFactor * 10000000.0;
v56 = v46 + *((float *)&v105 + 1);
if ( v56 > 0.0 )
{
LABEL_86:
v57 = a1->m_sectionYFactor;
if ( v56 >= 10000000.0 )
v58 = v57 * 10000000.0;
else
v58 = v56 * v57;
LABEL_91:
v59 = (EnterEffectObject *)(unsigned int)(int)v54;
v60 = a1->m_sectionXFactor * 10000000.0;
v61 = v57 * 10000000.0;
m_directionType = m_gameObject->m_directionType;
m_inbound = m_gameObject->m_inbound;
if ( m_directionType != 2 )
{
v106 = (int)v49;
if ( m_directionType == 1 )
{
m_twoDirections = m_gameObject->m_twoDirections;
v59 = nullptr;
if ( m_inbound )
{
v65 = v106;
if ( m_twoDirections )
v65 = 0;
v106 = v65;
goto LABEL_100;
}
v68 = v106;
if ( !m_twoDirections )
v68 = 0;
v106 = v68;
v58 = v61;
}
else if ( m_inbound )
{
v59 = nullptr;
v58 = v61;
v48 = v60;
v106 = 0;
v67 = v99;
if ( v99 == 0.0 )
goto LABEL_109;
goto LABEL_108;
}
v67 = v99;
if ( v99 == 0.0 )
goto LABEL_109;
goto LABEL_108;
}
v66 = m_gameObject->m_twoDirections;
if ( !m_inbound )
{
v106 = 0;
if ( !v66 )
v59 = nullptr;
LABEL_130:
v48 = v60;
v67 = v99;
if ( v99 == 0.0 )
{
LABEL_109:
v21->m_easeIndex += 2;
*(float *)&v100 = v58;
*(float *)&v104 = v48;
if ( (_DWORD)v102 )
{
if ( m_directionType )
{
LABEL_111:
LODWORD(v21->m_offsetY) = m_offset_low.i32[0];
v21->m_offsetYVariance = v21->m_offsetVariance;
m_offsetY_low = m_offset_low;
LABEL_115:
_mm_storel_ps(
(double *)&v105,
_mm_add_ps(_mm_insert_ps(m_offset_low, m_offsetY_low, 16), (__m128)(unsigned __int64)v105));
if ( m_gameObject->m_twoDirections )
LODWORD(v21->m_modFront) |= 0x80000000;
v103 = v59;
m_targetGroupIndex = v21->m_targetGroupIndex;
if ( m_targetGroupIndex <= 0 )
{
m_targetID = (unsigned int)v21->m_targetID;
if ( (int)m_targetID >= 9999 )
m_targetID = 9999;
if ( (int)m_targetID <= 0 )
m_targetID = 0;
v71 = a1->m_groups.__begin_[m_targetID];
if ( !v71 )
{
v71 = (cocos2d::CCArray *)sub_10071F9E0(p_m_anglePosition, v25);
cocos2d::CCDictionary::setObject(a1->m_groupDict, v71, m_targetID);
a1->m_groups.__begin_[m_targetID] = v71;
}
}
else
{
v71 = (cocos2d::CCArray *)sub_1007200C0(
a1->m_targetGroupsArray,
(unsigned int)(m_targetGroupIndex - 1));
}
v104 = (int)*(float *)&v104;
v100 = (unsigned int)(int)*(float *)&v100;
v73 = (unsigned int)v102;
switch ( (int)v102 )
{
case 0:
*(double *)&v74 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaMoveGroupAction(
a1,
v71,
v21,
v74,
(int)v107,
v106,
v104,
(int)v103,
v100,
0,
0);
break;
case 1:
*(double *)&v78 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaRotateGroupAction(
a1,
v71,
v21,
v78,
(int)v107,
v106,
v104,
(int)v103,
v100,
0,
0);
break;
case 2:
*(double *)&v76 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaTransformGroupAction(
a1,
v71,
v21,
v76,
(int)v107,
v106,
v104,
(int)v103,
v100,
0,
0);
break;
case 3:
*(double *)&v77 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaFadeGroupAction(a1, v71, v21, v77, (bool)v107);
break;
case 4:
*(double *)&v75 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaTintGroupAction(a1, v71, v21, v75, (bool)v107);
break;
default:
break;
}
v79 = v71;
v80 = sub_100720070(v71);
if ( m_targetGroupIndex > 0 )
{
v98 = v80;
v81 = (unsigned int)v21->m_targetGroupIndex;
if ( (int)v81 <= 0 )
{
v83 = (unsigned int)v21->m_targetID;
if ( (int)v83 >= 9999 )
v83 = 9999;
if ( (int)v83 <= 0 )
v83 = 0;
v82 = a1->m_groups.__begin_[v83];
if ( !v82 )
{
v82 = (cocos2d::CCArray *)sub_10071F9E0(v79, v81);
cocos2d::CCDictionary::setObject(a1->m_groupDict, v82, v83);
v95->m_groups.__begin_[v83] = v82;
}
}
else
{
v82 = (cocos2d::CCArray *)sub_1007200C0(a1->m_targetGroupsArray, v81);
}
switch ( v73 )
{
case 0LL:
*(double *)&v84 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaMoveGroupAction(
a1,
v82,
v21,
v84,
(int)v107,
v106,
v104,
(int)v103,
v100,
v98,
1);
break;
case 1LL:
*(double *)&v87 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaRotateGroupAction(
a1,
v82,
v21,
v87,
(int)v107,
v106,
v104,
(int)v103,
v100,
v98,
1);
break;
case 2LL:
*(double *)&v85 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaTransformGroupAction(
a1,
v82,
v21,
v85,
(int)v107,
v106,
v104,
(int)v103,
v100,
v98,
1);
break;
case 3LL:
*(double *)&v86 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaFadeGroupAction(a1, v82, v21, v86, (bool)v107);
break;
case 4LL:
*(double *)&v23 = sub_10028CC60(v107);
GJBaseGameLayer::processAreaTintGroupAction(a1, v82, v21, v23, (bool)v107);
break;
default:
break;
}
sub_100720070(v82);
}
v22 = v90;
goto LABEL_36;
}
}
else if ( v21->m_moveAngleVariance == 0.0 )
{
m_gameObject->m_startAngle = 1;
cocos2d::ccpForAngle((float)(v21->m_moveAngle + -90.0) * 0.017453292);
p_m_anglePosition = (cocos2d::CCDictionary *)&m_gameObject->m_anglePosition;
v25 = (unsigned __int64)v107;
sub_10028CC90();
m_offset_low = (__m128)LODWORD(v21->m_offset);
if ( m_gameObject->m_directionType )
goto LABEL_111;
}
else
{
m_gameObject->m_startAngle = 0;
if ( m_directionType )
goto LABEL_111;
}
m_offsetY_low = (__m128)LODWORD(v21->m_offsetY);
goto LABEL_115;
}
LABEL_108:
m_gameObject->m_negativeTargetX = v67 < 0.0;
goto LABEL_109;
}
v106 = 0;
if ( v66 )
v59 = nullptr;
LABEL_100:
v58 = v61;
goto LABEL_130;
}
LABEL_90:
v57 = a1->m_sectionYFactor;
v58 = 0.0;
goto LABEL_91;
}
v54 = m_sectionYFactor * v53;
}
v56 = v46 + *((float *)&v105 + 1);
if ( v56 > 0.0 )
goto LABEL_86;
goto LABEL_90;
}
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v107);
_mm_storel_ps(
v107,
_mm_div_ps(
(__m128)*(unsigned __int64 *)&v107[0],
_mm_moveldup_ps((__m128)LODWORD(a1->m_gameState.m_cameraZoom))));
sub_10028CC60(v88);
v103 = m_gameObject;
switch ( (int)m_specialTarget )
{
case -11:
v39 = *(float *)v107;
v40 = *((float *)v107 + 1);
break;
case -10:
v39 = *(float *)v107;
v40 = *((float *)v107 + 1) * 0.5;
break;
case -9:
v39 = *(float *)v107;
goto LABEL_65;
case -8:
v40 = *((float *)v107 + 1);
v39 = *(float *)v107 * 0.5;
break;
case -7:
v39 = *(float *)v107 * 0.5;
goto LABEL_65;
case -6:
v40 = *((float *)v107 + 1);
goto LABEL_69;
case -5:
v40 = *((float *)v107 + 1) * 0.5;
LABEL_69:
v39 = 0.0;
break;
case -4:
v39 = 0.0;
LABEL_65:
v40 = 0.0;
break;
default:
v39 = *(float *)v107 * 0.5;
v40 = *((float *)v107 + 1) * 0.5;
break;
}
sub_10028CBE0(v89, v39, v40);
sub_10028CC90();
v42 = p_m_cameraPosition;
sub_10028CCE0(v89, p_m_cameraPosition);
sub_10028CC90();
sub_10028CD00(v89, v42, p_m_cameraPosition2);
p_m_anglePosition = (cocos2d::CCDictionary *)&v99;
v25 = (unsigned __int64)v89;
}
else
{
if ( !(_DWORD)m_specialTarget )
goto LABEL_73;
m_parentGroupsDict = a1->m_parentGroupsDict;
v25 = (unsigned int)m_specialTarget;
v29 = (GameObject *)cocos2d::CCDictionary::objectForKey(m_parentGroupsDict, (unsigned int)m_specialTarget);
if ( !v29 )
{
if ( (unsigned int)m_specialTarget >= 0x270F )
m_specialTarget = 9999;
v41 = a1->m_groups.__begin_[m_specialTarget];
if ( !v41 )
{
v41 = (cocos2d::CCArray *)sub_10071F9E0(m_parentGroupsDict, v25);
p_m_anglePosition = a1->m_groupDict;
v25 = (unsigned __int64)v41;
cocos2d::CCDictionary::setObject(p_m_anglePosition, v41, m_specialTarget);
a1->m_groups.__begin_[m_specialTarget] = v41;
if ( !v41 )
goto LABEL_73;
}
p_m_anglePosition = (cocos2d::CCDictionary *)v41;
if ( (unsigned int)sub_100720070(v41) != 1 )
goto LABEL_73;
p_m_anglePosition = (cocos2d::CCDictionary *)v41;
v25 = 0;
v29 = (GameObject *)sub_1007200C0(v41, 0);
if ( !v29 )
goto LABEL_73;
}
v30 = v29;
v103 = m_gameObject;
if ( v97 <= 0xFFFFFFFD && GJBaseGameLayer::resetAreaObjectValues(a1, v29, 1) )
((void (__fastcall *)(GJBaseGameLayer *, GameObject *))a1->updateObjectSection)(a1, v30);
((void (__fastcall *)(double *, GameObject *))v30->getRealPosition)(v107, v30);
v31 = sub_10028CC90();
((void (__fastcall *)(char *, GameObject *, double))v30->getRealPosition)(v88, v30, v31);
v32 = GameObject::getLastPosition(v30);
sub_10028CD00(v107, v88, v32);
p_m_anglePosition = (cocos2d::CCDictionary *)&v99;
v25 = (unsigned __int64)v107;
}
sub_10028CC90();
m_gameObject = v103;
goto LABEL_73;
}
}