//
// LevelEditorLayer::updateDebugDraw from 0x1402e6c70 to 0x1402e88cd (7261 bytes)
//
// 2 xrefs:
// > ??> @ 0x140586370
// > ??> @ 0x1406d37dc
//
// 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
//
// Hidden C++ exception states: #wind=6
void LevelEditorLayer::updateDebugDraw(LevelEditorLayer *a1)
{
LevelEditorLayer *v1; // rdi
GameManager *v2; // rcx
__int64 v3; // rcx
double v4; // xmm0_8
double v5; // xmm1_8
float v6; // xmm0_4
cocos2d::CCDirector *v7; // rax
float v8; // xmm13_4
GameManager *v9; // rcx
bool GameVariable; // r14
float v11; // xmm13_4
float v12; // xmm14_4
unsigned int v13; // esi
float v14; // xmm7_4
float *v15; // rbx
float v16; // xmm6_4
float *v17; // rax
float v18; // xmm11_4
float v19; // xmm8_4
float v20; // xmm7_4
float v21; // xmm9_4
float v22; // xmm6_4
float v23; // xmm6_4
float v24; // xmm0_4
float v25; // xmm9_4
double v26; // xmm0_8
float v27; // xmm6_4
float v28; // xmm7_4
float v29; // xmm0_4
float v30; // xmm10_4
double v31; // xmm0_8
double v32; // xmm0_8
double v33; // xmm0_8
const struct cocos2d::CCPoint *v34; // rax
const struct cocos2d::CCPoint *v35; // rbx
const struct cocos2d::CCPoint *v36; // rax
struct cocos2d::CCPoint *v37; // r12
int v38; // eax
cocos2d::CCDictionary *m_keyframeGroups; // rbx
cocos2d::CCDictElement *m_pElements; // rbx
cocos2d::CCDictElement *next; // r15
int v42; // eax
int v43; // eax
int v44; // ecx
__int64 v45; // rdx
cocos2d::CCArray *m_pObject; // rbx
struct cocos2d::CCObject *v47; // rax
GroupCommandObject2 *v48; // r13
std::_Vector_val>::pointer Myfirst; // r8
std::_Vector_val>::pointer v50; // r14
std::_Vector_val>::pointer Mylast; // r8
float v52; // r9d
__int64 v53; // r15
__int64 v54; // rbx
cocos2d::CCPoint *v55; // rsi
int v56; // ebx
struct cocos2d::CCPoint *v57; // rsi
double v58; // xmm0_8
float v59; // xmm1_4
GLfloat m_unk1b8; // xmm0_4
int v61; // esi
signed __int64 v62; // r8
__int64 v63; // rbx
std::_Simple_types::value_type *v64; // rdx
__int64 v65; // rax
__int64 v66; // r8
__int64 m_traceInObject; // rcx
unsigned int m_unk3b24; // eax
__int64 m_traceOutObject; // rcx
unsigned int v70; // eax
__int64 v71; // rax
signed int v72; // r14d
__int64 m_leftSectionIndex; // r8
__int64 v74; // rdx
__int64 v75; // r9
_QWORD *p_Myfirst; // rcx
__int64 v77; // rax
__int64 m_bottomSectionIndex; // rcx
__int64 v79; // r13
_QWORD *v80; // r12
__int64 v81; // rsi
__int64 v82; // r15
__int16 *v83; // rbx
int v84; // eax
int m_currentLayer; // ecx
const struct cocos2d::CCRect *v86; // rax
float v87; // xmm0_4
__int64 v88; // rbx
__int64 v89; // rdx
double v90; // xmm0_8
__int64 v91; // rax
double v92; // xmm0_8
__int64 v93; // rax
double v94; // xmm0_8
__int64 v95; // rax
__int64 v96; // rcx
int v97; // r14d
__int64 v98; // rcx
__int64 v99; // rcx
__int64 v100; // rcx
__int64 v101; // rcx
__int64 v102; // rcx
__int64 v103; // rcx
__int64 v104; // rcx
GameObject *m_selectedObject; // rbx
int m_objectID; // eax
int m_followers; // r14d
int b_low; // eax
__int64 v109; // rsi
cocos2d::CCArray *v110; // r15
float v111; // xmm8_4
float v112; // xmm6_4
float v113; // xmm7_4
bool v114; // bl
float MinX; // xmm9_4
float MaxX; // xmm11_4
int v117; // esi
cocos2d::ccArray *data; // r15
__int64 num; // rax
cocos2d::CCObject **arr; // r15
double v121; // xmm0_8
bool v122; // al
double v123; // xmm0_8
const struct cocos2d::CCPoint *v124; // rax
const struct cocos2d::CCPoint *v125; // rbx
const struct cocos2d::CCPoint *v126; // rax
unsigned __int8 v127; // al
double v128; // xmm0_8
const struct cocos2d::CCPoint *v129; // rax
const struct cocos2d::CCPoint *v130; // rbx
const struct cocos2d::CCPoint *v131; // rax
unsigned __int8 v132; // al
double v133; // xmm0_8
const struct cocos2d::CCPoint *v134; // rax
const struct cocos2d::CCPoint *v135; // rbx
const struct cocos2d::CCPoint *v136; // rax
unsigned __int8 v137; // al
double v138; // xmm0_8
const struct cocos2d::CCPoint *v139; // rax
const struct cocos2d::CCPoint *v140; // rbx
const struct cocos2d::CCPoint *v141; // rax
double v142; // xmm0_8
bool v143; // al
double v144; // xmm0_8
const struct cocos2d::CCPoint *v145; // rax
const struct cocos2d::CCPoint *v146; // rbx
const struct cocos2d::CCPoint *v147; // rax
unsigned __int8 v148; // al
double v149; // xmm0_8
const struct cocos2d::CCPoint *v150; // rax
const struct cocos2d::CCPoint *v151; // rbx
const struct cocos2d::CCPoint *v152; // rax
unsigned __int8 v153; // al
double v154; // xmm0_8
const struct cocos2d::CCPoint *v155; // rax
const struct cocos2d::CCPoint *v156; // rbx
const struct cocos2d::CCPoint *v157; // rax
unsigned __int8 v158; // al
double v159; // xmm0_8
const struct cocos2d::CCPoint *v160; // rax
const struct cocos2d::CCPoint *v161; // rbx
const struct cocos2d::CCPoint *v162; // rax
double v163; // xmm0_8
bool v164; // al
double v165; // xmm0_8
const struct cocos2d::CCPoint *v166; // rax
const struct cocos2d::CCPoint *v167; // rbx
const struct cocos2d::CCPoint *v168; // rax
unsigned __int8 v169; // al
double v170; // xmm0_8
const struct cocos2d::CCPoint *v171; // rax
const struct cocos2d::CCPoint *v172; // rbx
const struct cocos2d::CCPoint *v173; // rax
unsigned __int8 v174; // al
double v175; // xmm0_8
const struct cocos2d::CCPoint *v176; // rax
const struct cocos2d::CCPoint *v177; // rbx
const struct cocos2d::CCPoint *v178; // rax
unsigned __int8 v179; // al
double v180; // xmm0_8
const struct cocos2d::CCPoint *v181; // rax
const struct cocos2d::CCPoint *v182; // rbx
const struct cocos2d::CCPoint *v183; // rax
GameManager *v184; // rcx
float x; // r13d
__int64 v186; // r15
int v187; // r14d
__int64 v188; // rbx
__int64 v189; // rsi
const struct cocos2d::CCPoint *v190; // r8
std::_Vector_val>>::pointer v191; // rax
std::_Vector_val>>::pointer v192; // rcx
__int64 v193; // rdx
float v194; // ecx
__int64 v195; // r14
std::_Vector_val>>::pointer v196; // r15
__int64 v197; // r13
int v198; // r12d
__int64 v199; // rbx
__int64 v200; // rsi
const struct cocos2d::CCPoint *v201; // r8
bool v202; // zf
GameManager *v203; // rcx
std::_Vector_val>::pointer v204; // r14
std::_Vector_val>::pointer i; // rsi
double v206; // xmm0_8
__int64 v207; // rax
__int64 v208; // rbx
__int64 v209; // rax
bool v210; // [rsp+78h] [rbp-90h]
char v211; // [rsp+78h] [rbp-90h]
float v212; // [rsp+7Ch] [rbp-8Ch]
int v213; // [rsp+7Ch] [rbp-8Ch]
int v214; // [rsp+7Ch] [rbp-8Ch]
cocos2d::CCPoint v215; // [rsp+80h] [rbp-88h] BYREF
struct cocos2d::CCPoint *v216; // [rsp+88h] [rbp-80h] BYREF
cocos2d::CCPoint v217; // [rsp+90h] [rbp-78h] BYREF
cocos2d::CCPoint v218; // [rsp+98h] [rbp-70h] BYREF
__int64 v219; // [rsp+A0h] [rbp-68h]
float v220; // [rsp+A8h] [rbp-60h]
__int64 v221; // [rsp+B0h] [rbp-58h] BYREF
__int64 v222; // [rsp+B8h] [rbp-50h] BYREF
unsigned __int64 v223; // [rsp+C0h] [rbp-48h]
cocos2d::CCRect v224; // [rsp+C8h] [rbp-40h] BYREF
GroupCommandObject2 *v225; // [rsp+D8h] [rbp-30h] BYREF
float v226; // [rsp+E0h] [rbp-28h]
float v227; // [rsp+E4h] [rbp-24h]
struct cocos2d::CCPoint *v228; // [rsp+E8h] [rbp-20h]
__int64 v229; // [rsp+F0h] [rbp-18h]
cocos2d::CCRect v230; // [rsp+F8h] [rbp-10h] BYREF
__int128 v231; // [rsp+158h] [rbp+50h] BYREF
cocos2d::CCRect v232; // [rsp+168h] [rbp+60h] BYREF
std::vector Block; // [rsp+178h] [rbp+70h] BYREF
struct cocos2d::_ccColor4F v234; // [rsp+190h] [rbp+88h] BYREF
__int128 v235; // [rsp+1A0h] [rbp+98h] BYREF
v1 = a1;
v223 = (unsigned __int64)a1;
GJBaseGameLayer::updateDebugDraw(a1);
v2 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v221 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v221);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = (GameManager *)qword_1406C2ED8;
}
byte_1406C2C75 = GameManager::getGameVariable(v2, "0181");
v4 = sub_14003CF30();
dbl_1406C2F18 = v4;
if ( byte_1406C2C75 )
{
v5 = 0.5199999809265137;
}
else
{
v6 = fmod(v4, 2.0) * 0.5;
v5 = (float)(1.0 - v6);
}
qword_1406C2F20 = *(_QWORD *)&v5;
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v7);
v8 = 0.25 / v1->m_objectLayer->getScale(v1->m_objectLayer);
v212 = v8;
cocos2d::CCRect::CCRect(&v224, &v1->m_debugDrawNode->m_rDrawArea);
v9 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v221 = (__int64)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v221);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v9 = (GameManager *)qword_1406C2ED8;
}
GameVariable = GameManager::getGameVariable(v9, "0121");
v210 = GameVariable;
cocos2d::CCDrawNode::enableDrawArea(v1->m_debugDrawNode, &v224);
if ( cocos2d::CCArray::count(v1->m_cameraGuideTriggers) )
{
v11 = v226 * 2.0;
v12 = v227 * 2.0;
v13 = 0;
if ( cocos2d::CCArray::count(v1->m_cameraGuideTriggers) )
{
v14 = v11 * 0.5;
v220 = v11 * 0.5;
do
{
v15 = (float *)cocos2d::CCArray::objectAtIndex(v1->m_cameraGuideTriggers, v13);
v16 = *(float *)((*(__int64 (__fastcall **)(float *))(*(_QWORD *)v15 + 200LL))(v15) + 4);
v17 = (float *)(*(__int64 (__fastcall **)(float *))(*(_QWORD *)v15 + 200LL))(v15);
cocos2d::CCRect::CCRect(&v230, *v17 - v14, v16 - (float)(v12 * 0.5), v11, v12);
if ( *((_DWORD *)v15 + 259) == 2016
&& cocos2d::CCRect::intersectsRect(&v224, &v230)
&& (!GameVariable || !*((_BYTE *)v15 + 1302) || *((_BYTE *)v15 + 1141)) )
{
v18 = v15[470];
if ( v18 > 0.0 )
{
(*(void (__fastcall **)(float *))(*(_QWORD *)v15 + 200LL))(v15);
cocos2d::CCPoint::CCPoint(&v217);
v19 = fminf(v15[440], 3.0);
if ( v19 < 0.40000001 )
v19 = 0.40000001;
v20 = 320.0 / v19;
v21 = v226 / v19;
v22 = v227 / v19;
cocos2d::CCPoint::CCPoint(&v215);
if ( (float)(480.0 / v19) == v21 && v22 == v20 )
{
v27 = v212;
}
else
{
(*(void (__fastcall **)(float *))(*(_QWORD *)v15 + 200LL))(v15);
cocos2d::CCPoint::CCPoint(&v218);
v23 = v22 * 0.5;
v24 = v218.y - v23;
if ( (float)(v218.y - v23) < 0.0 )
v218.y = v23 + 0.0;
v25 = v21 * 0.5;
v26 = cocos2d::CCPoint::CCPoint(v24, (float)(v218.x - v25) + v215.x);
cocos2d::CCPoint::CCPoint(*(float *)&v26, (float)(v25 + v218.x) + v215.x);
LODWORD(v231) = 1065353216;
*(_QWORD *)((char *)&v231 + 4) = 1056964608;
*((float *)&v231 + 3) = v18;
v235 = 0;
v27 = v212;
cocos2d::CCDrawNode::drawRect(v1->m_debugDrawNode, &v221, &v225, &v235, LODWORD(v212), &v231, 0);
}
v28 = v20 * 0.5;
v29 = v217.y - v28;
if ( (float)(v217.y - v28) < 0.0 )
v217.y = v28 + 0.0;
v30 = (float)(480.0 / v19) * 0.5;
v31 = cocos2d::CCPoint::CCPoint(v29, (float)(v217.x - v30) + v215.x);
cocos2d::CCPoint::CCPoint(*(float *)&v31, (float)(v30 + v217.x) + v215.x);
cocos2d::CCPoint::CCPoint(
(float)v1->m_gameState.m_unkInt1 / v19,
v217.x - (float)((float)v1->m_gameState.m_unkInt1 / v19));
v232.origin.x = 0.0;
*(_QWORD *)&v232.origin.y = 1065353216;
v232.size.height = v18;
v235 = 0;
v32 = cocos2d::CCDrawNode::drawRect(v1->m_debugDrawNode, &v222, &v216, &v235, LODWORD(v27), &v232, 0);
v234.r = 1.0;
*(_QWORD *)&v234.g = 1065353216;
v234.a = v18;
v33 = cocos2d::CCPoint::CCPoint(*(float *)&v32, *(float *)&v219);
v35 = v34;
cocos2d::CCPoint::CCPoint(*(float *)&v33, *(float *)&v219);
cocos2d::CCDrawNode::drawSegment(v1->m_debugDrawNode, v36, v35, v27, &v234);
v14 = v220;
}
}
++v13;
}
while ( v13 < cocos2d::CCArray::count(v1->m_cameraGuideTriggers) );
}
v8 = v212;
}
v37 = nullptr;
v216 = nullptr;
v38 = 0;
m_keyframeGroups = v1->m_keyframeGroups;
if ( m_keyframeGroups )
{
m_pElements = m_keyframeGroups->m_pElements;
if ( m_pElements )
{
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
while ( 1 )
{
v219 = (__int64)next;
v42 = v38 + 1;
if ( v42 > 5 )
break;
v213 = v42;
switch ( v42 )
{
case 1:
v213 = 1;
goto LABEL_45;
case 2:
v213 = 2;
v43 = 255;
v44 = 150;
LODWORD(v45) = 50;
break;
case 3:
v213 = 3;
v43 = 0;
v44 = 255;
LODWORD(v45) = 255;
break;
case 4:
v213 = 4;
v43 = 255;
v44 = 255;
LODWORD(v45) = 0;
break;
case 5:
v213 = 5;
v43 = 255;
v44 = 0;
LABEL_46:
LODWORD(v45) = v43;
break;
default:
LABEL_45:
v43 = 50;
v44 = 255;
goto LABEL_46;
}
v232.origin.x = (float)v43 / 255.0;
v232.origin.y = (float)v44 / 255.0;
v232.size.width = (float)(int)v45 / 255.0;
v232.size.height = 1.0;
m_pObject = (cocos2d::CCArray *)m_pElements->m_pObject;
if ( m_pObject )
{
if ( cocos2d::CCArray::count(m_pObject) > 1 )
{
v47 = cocos2d::CCArray::objectAtIndex(m_pObject, 0);
if ( !GameVariable || !BYTE2(v47[23].m_nLuaID) || BYTE1(v47[20].m_uReference) )
{
memset(&Block, 0, sizeof(Block));
v48 = GJEffectManager::createKeyframeCommand(
v1->m_effectManager,
0,
m_pObject,
nullptr,
0,
0,
1,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
&Block);
v225 = v48;
Myfirst = Block._Mypair._Myval2._Myfirst;
if ( Block._Mypair._Myval2._Myfirst )
{
if ( (unsigned __int64)(4 * (Block._Mypair._Myval2._Myend - Block._Mypair._Myval2._Myfirst)) >= 0x1000 )
{
Myfirst = *((std::_Vector_val>::pointer *)Block._Mypair._Myval2._Myfirst - 1);
if ( (unsigned __int64)((char *)Block._Mypair._Myval2._Myfirst - (char *)Myfirst - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(Myfirst);
memset(&Block, 0, sizeof(Block));
}
if ( v48 )
{
v50 = v48->m_keyframes._Mypair._Myval2._Myfirst;
Mylast = v48->m_keyframes._Mypair._Myval2._Mylast;
if ( v50 != Mylast )
{
v52 = 0.0;
v220 = 0.0;
if ( ((__int64)((unsigned __int128)(((char *)Mylast - (char *)v50) * (__int128)0x4924924924924925LL) >> 64) >> 7)
+ ((unsigned __int64)((unsigned __int128)(((char *)Mylast - (char *)v50)
* (__int128)0x4924924924924925LL) >> 64) >> 63)
- 1 )
{
v53 = 0;
do
{
if ( v50[v53].m_unk170 > 0.0 )
{
if ( !v37 )
{
v229 = 50;
v37 = (struct cocos2d::CCPoint *)operator new(0x190u);
v216 = v37;
v228 = v37;
v54 = 50;
v55 = v37;
do
{
cocos2d::CCPoint::CCPoint(v55++);
--v54;
}
while ( v54 );
}
v56 = 0;
v57 = v37;
do
{
sub_1404C6400(&v50[v53].m_spline2);
v58 = sub_1404C6400(&v50[v53].m_spline1);
v59 = v58;
cocos2d::CCPoint::CCPoint(*(float *)&v58, v59);
cocos2d::CCPoint::operator+(&v50[v53].m_unk190, &v221);
cocos2d::CCPoint::operator=(v57, &v221);
++v56;
++v57;
}
while ( v56 < 50 );
m_unk1b8 = v50[v53].m_unk1b8;
*(_QWORD *)&v231 = 0x3F80000000000000LL;
DWORD2(v231) = 1065353216;
*((GLfloat *)&v231 + 3) = m_unk1b8;
v37 = v216;
v1 = (LevelEditorLayer *)v223;
cocos2d::CCDrawNode::drawLines(
*(cocos2d::CCDrawNode **)(v223 + 14192),
v216,
0x32u,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
v48 = v225;
v52 = v220;
}
++LODWORD(v52);
v220 = v52;
++v53;
Mylast = v48->m_keyframes._Mypair._Myval2._Mylast;
v50 = v48->m_keyframes._Mypair._Myval2._Myfirst;
}
while ( SLODWORD(v52) < ((__int64)((unsigned __int128)(((char *)Mylast - (char *)v50)
* (__int128)0x4924924924924925LL) >> 64) >> 7)
+ ((unsigned __int64)((unsigned __int128)(((char *)Mylast - (char *)v50)
* (__int128)0x4924924924924925LL) >> 64) >> 63)
- 1 );
next = (cocos2d::CCDictElement *)v219;
}
v61 = 0;
v62 = (char *)Mylast - (char *)v50;
v45 = (__int64)((unsigned __int128)(v62 * (__int128)0x4924924924924925LL) >> 64) >> 7;
if ( v45
+ ((unsigned __int64)((unsigned __int128)(v62 * (__int128)0x4924924924924925LL) >> 64) >> 63)
- 1 )
{
v63 = 0;
do
{
v64 = &v50[v63];
v65 = v63 * 448 + 448;
++v63;
if ( !v64->m_unk01e )
{
v232.size.height = *(float *)((char *)&v50->m_unk1b8 + v65);
cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
&v64->m_unk190,
(const struct cocos2d::CCPoint *)((char *)&v50->m_unk190 + v65),
v8,
(const struct cocos2d::_ccColor4F *)&v232);
}
++v61;
v50 = v48->m_keyframes._Mypair._Myval2._Myfirst;
v45 = (__int64)((unsigned __int128)(((char *)v48->m_keyframes._Mypair._Myval2._Mylast - (char *)v50)
* (__int128)0x4924924924924925LL) >> 64) >> 7;
}
while ( v61 < v45
+ ((unsigned __int64)((unsigned __int128)(((char *)v48->m_keyframes._Mypair._Myval2._Mylast
- (char *)v50)
* (__int128)0x4924924924924925LL) >> 64) >> 63)
- 1 );
v37 = v216;
}
}
GameVariable = v210;
}
}
}
}
GJEffectManager::resetTempGroupCommands(v1->m_effectManager, v45);
m_pElements = next;
if ( !next )
{
if ( v37 )
j_j_free(v37);
goto LABEL_81;
}
next = (cocos2d::CCDictElement *)next->hh.next;
v38 = v213;
}
v213 = 0;
goto LABEL_45;
}
}
LABEL_81:
cocos2d::CCDrawNode::disableDrawArea(v1->m_debugDrawNode);
m_traceInObject = (__int64)v1->m_traceInObject;
if ( m_traceInObject )
{
m_unk3b24 = v1->m_unk3b24;
if ( v1->m_unk3b28 < m_unk3b24 )
{
v1->m_unk3b28 = m_unk3b24;
sub_1402E3B00(m_traceInObject, v1, (void **)&v1->m_unk3b30._Mypair._Myval2._Myfirst, 1);
}
LOBYTE(v66) = 1;
sub_1402E5800(v1, &v1->m_unk3b30._Mypair._Myval2._Myfirst, v66, v1->m_debugDrawNode);
}
else if ( !v1->m_traceOutObject )
{
goto LABEL_91;
}
m_traceOutObject = (__int64)v1->m_traceOutObject;
if ( m_traceOutObject )
{
v70 = v1->m_unk3b24;
if ( v1->m_unk3b2c < v70 )
{
v1->m_unk3b2c = v70;
sub_1402E3B00(m_traceOutObject, v1, (void **)&v1->m_unk3b48._Mypair._Myval2._Myfirst, 0);
}
sub_1402E5800(v1, &v1->m_unk3b48._Mypair._Myval2._Myfirst, 0, v1->m_debugDrawNode);
}
LABEL_91:
v71 = v1->m_sections._Mypair._Myval2._Mylast - v1->m_sections._Mypair._Myval2._Myfirst;
if ( v1->m_drawTriggerBoxes )
{
v72 = 0;
m_leftSectionIndex = v1->m_leftSectionIndex;
v214 = m_leftSectionIndex;
if ( (int)m_leftSectionIndex <= v1->m_rightSectionIndex )
{
v74 = v1->m_leftSectionIndex;
v222 = v74;
v71 = (int)v71;
v221 = (int)v71;
v75 = 0xFFFFFFFFLL;
do
{
if ( v74 >= v71 )
break;
p_Myfirst = &v1->m_sections._Mypair._Myval2._Myfirst[v74]->_Mypair._Myval2._Myfirst;
if ( p_Myfirst )
v77 = (__int64)(p_Myfirst[1] - *p_Myfirst) >> 3;
else
LODWORD(v77) = -1;
m_bottomSectionIndex = v1->m_bottomSectionIndex;
v220 = *(float *)&m_bottomSectionIndex;
if ( (int)m_bottomSectionIndex <= v1->m_topSectionIndex )
{
v79 = m_bottomSectionIndex;
v219 = m_bottomSectionIndex;
v77 = (int)v77;
v223 = (int)v77;
do
{
if ( v79 >= v77 )
break;
v80 = &v1->m_sections._Mypair._Myval2._Myfirst[v74]->_Mypair._Myval2._Myfirst[v79]->_Mypair._Myval2._Myfirst;
if ( v80 )
{
v81 = 0;
v82 = v1->m_sectionSizes._Mypair._Myval2._Myfirst[v74]->_Mypair._Myval2._Myfirst[v79];
if ( v82 > 0 )
{
while ( 1 )
{
v83 = *(__int16 **)(*v80 + 8 * v81);
if ( (*(unsigned __int8 (__fastcall **)(__int16 *, __int64, __int64, __int64))(*(_QWORD *)v83 + 328LL))(
v83,
v74,
m_leftSectionIndex,
v75) )
{
v74 = (unsigned int)v83[605];
v84 = v83[606];
if ( !v83[606] )
v84 = -1;
m_currentLayer = v1->m_currentLayer;
if ( (v1->m_currentLayer == -1 || m_currentLayer == (_DWORD)v74 || m_currentLayer == v84)
&& (!v210 || !*((_BYTE *)v83 + 1302) || *((_BYTE *)v83 + 1141))
&& (*((_DWORD *)v83 + 314) == 1 && *((_BYTE *)v83 + 1488)
|| (*(unsigned int (__fastcall **)(__int16 *, __int64))(*(_QWORD *)v83 + 1632LL))(v83, v74) == 30
&& !*((_BYTE *)v83 + 978))
&& (*(unsigned __int8 (__fastcall **)(__int16 *, __int64))(*(_QWORD *)v83 + 1552LL))(v83, v74)
&& !*((_BYTE *)v83 + 1354) )
{
v86 = (const struct cocos2d::CCRect *)(*(__int64 (__fastcall **)(__int16 *))(*(_QWORD *)v83
+ 1168LL))(v83);
cocos2d::CCRect::CCRect(&v232, v86);
v87 = (*(float (__fastcall **)(__int16 *))(*(_QWORD *)v83 + 344LL))(v83);
if ( (int)v87 == 90 * ((int)v87 / 90) )
{
cocos2d::CCPoint::CCPoint(&v215);
cocos2d::CCPoint::CCPoint(&v218);
cocos2d::CCPoint::CCPoint(&v217);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v216);
v90 = cocos2d::CCPoint::operator=(&v215, &v232);
cocos2d::CCPoint::CCPoint(*(float *)&v90, v232.size.width + v232.origin.x);
v92 = cocos2d::CCPoint::operator=(&v217, v91);
cocos2d::CCPoint::CCPoint(*(float *)&v92, v215.x);
v94 = cocos2d::CCPoint::operator=(&v218, v93);
cocos2d::CCPoint::CCPoint(*(float *)&v94, v217.x);
v89 = v95;
}
else
{
*((_BYTE *)v83 + 744) = 1;
(*(void (__fastcall **)(__int16 *))(*(_QWORD *)v83 + 1400LL))(v83);
(*(void (__fastcall **)(__int16 *))(*(_QWORD *)v83 + 1168LL))(v83);
cocos2d::CCPoint::CCPoint(&v215);
cocos2d::CCPoint::CCPoint(&v218);
cocos2d::CCPoint::CCPoint(&v217);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v216);
v88 = (*(__int64 (__fastcall **)(__int16 *))(*(_QWORD *)v83 + 1392LL))(v83);
cocos2d::CCPoint::operator=(&v215, v88 + 320);
cocos2d::CCPoint::operator=(&v218, v88 + 328);
cocos2d::CCPoint::operator=(&v217, v88 + 336);
v89 = v88 + 344;
}
cocos2d::CCPoint::operator=(&v216, v89);
if ( v72 >= 392 )
{
LABEL_124:
v79 = v219;
v74 = v222;
break;
}
v96 = (__int64)&v1->m_debugDrawPoints->_Elems[v72];
v97 = v72 + 1;
cocos2d::CCPoint::operator=(v96, &v215);
v98 = (__int64)&v1->m_debugDrawPoints->_Elems[v97++];
cocos2d::CCPoint::operator=(v98, &v218);
v99 = (__int64)&v1->m_debugDrawPoints->_Elems[v97++];
cocos2d::CCPoint::operator=(v99, &v218);
v100 = (__int64)&v1->m_debugDrawPoints->_Elems[v97++];
cocos2d::CCPoint::operator=(v100, &v217);
v101 = (__int64)&v1->m_debugDrawPoints->_Elems[v97++];
cocos2d::CCPoint::operator=(v101, &v217);
v102 = (__int64)&v1->m_debugDrawPoints->_Elems[v97++];
cocos2d::CCPoint::operator=(v102, &v216);
v103 = (__int64)&v1->m_debugDrawPoints->_Elems[v97++];
cocos2d::CCPoint::operator=(v103, &v216);
v104 = (__int64)&v1->m_debugDrawPoints->_Elems[v97];
v72 = v97 + 1;
cocos2d::CCPoint::operator=(v104, &v215);
}
}
if ( ++v81 >= v82 )
goto LABEL_124;
}
}
}
++LODWORD(v220);
v219 = ++v79;
v77 = v223;
}
while ( SLODWORD(v220) <= v1->m_topSectionIndex );
LODWORD(m_leftSectionIndex) = v214;
v75 = 0xFFFFFFFFLL;
}
m_leftSectionIndex = (unsigned int)(m_leftSectionIndex + 1);
v214 = m_leftSectionIndex;
v222 = ++v74;
v71 = v221;
}
while ( (int)m_leftSectionIndex <= v1->m_rightSectionIndex );
if ( v72 > 0 )
{
v231 = xmmword_140624310;
cocos2d::CCDrawNode::drawLines(
v1->m_debugDrawNode,
v1->m_debugDrawPoints->_Elems,
v72,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
}
}
}
cocos2d::CCDrawNode::enableDrawArea(v1->m_debugDrawNode, &v224);
m_selectedObject = v1->m_editorUI->m_selectedObject;
if ( m_selectedObject )
{
m_objectID = m_selectedObject->m_objectID;
if ( m_objectID == 3602 || ((m_objectID - 3603) & 0xFFFFFFFD) == 0 )
{
m_followers = (int)m_selectedObject[1].m_followers;
b_low = LODWORD(m_selectedObject[1].m_sAdditionalTransform.b);
if ( b_low > 0 )
{
if ( b_low > 9999 )
b_low = 9999;
v109 = (unsigned int)b_low;
v110 = v1->m_groups._Mypair._Myval2._Myfirst[b_low];
if ( v110
|| (v110 = (cocos2d::CCArray *)cocos2d::CCArray::create(9999),
cocos2d::CCDictionary::setObject(v1->m_groupDict, v110, (unsigned int)v109),
(v1->m_groups._Mypair._Myval2._Myfirst[v109] = v110) != nullptr) )
{
if ( cocos2d::CCArray::count(v110) )
{
v111 = (float)SLODWORD(m_selectedObject[1].m_fTextureBottom) * 3.0;
v112 = (float)((float)SLODWORD(m_selectedObject[1].m_fTextureTop) * 3.0) + v111;
v113 = (float)((float)*((int *)&m_selectedObject[1].m_fTextureTop + 1) * 3.0) + v112;
v114 = v111 > 0.0;
MinX = cocos2d::CCRect::getMinX(&v224);
cocos2d::CCRect::getMinY(&v224);
MaxX = cocos2d::CCRect::getMaxX(&v224);
cocos2d::CCRect::getMaxY(&v224);
v117 = 0;
data = v110->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v223 = (unsigned __int64)&arr[num - 1];
if ( (unsigned __int64)arr <= v223 )
{
while ( *arr )
{
(*arr)->__vftable[16].encodeWithCoder(*arr, (DS_Dictionary *)&v215);
if ( v114 )
{
LODWORD(v121) = 1065353216;
v231 = xmmword_1406240D0;
if ( !m_followers )
{
*(_OWORD *)&Block._Mypair._Myval2._Myfirst = 0;
v122 = cocos2d::CCDrawNode::drawCircle(
v1->m_debugDrawNode,
&v215,
v111,
(const struct cocos2d::_ccColor4F *)&Block,
v8,
(const struct cocos2d::_ccColor4F *)&v231,
(int)v111);
LABEL_153:
v117 += v122;
goto LABEL_154;
}
if ( (unsigned int)(m_followers - 1) <= 1
&& (v123 = cocos2d::CCPoint::CCPoint(1.0, v215.x - v111),
v125 = v124,
cocos2d::CCPoint::CCPoint(*(float *)&v123, v215.x - v111),
v121 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v126,
v125,
v8,
(const struct cocos2d::_ccColor4F *)&v231),
v117 += v127,
m_followers == 1)
|| m_followers == 3 )
{
v128 = cocos2d::CCPoint::CCPoint(*(float *)&v121, v215.x + v111);
v130 = v129;
cocos2d::CCPoint::CCPoint(*(float *)&v128, v215.x + v111);
v121 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v131,
v130,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
v117 += v132;
}
if ( (unsigned int)(m_followers - 4) <= 1
&& (v133 = cocos2d::CCPoint::CCPoint(*(float *)&v121, MaxX),
v135 = v134,
cocos2d::CCPoint::CCPoint(*(float *)&v133, MinX),
v121 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v136,
v135,
v8,
(const struct cocos2d::_ccColor4F *)&v231),
v117 += v137,
m_followers == 4)
|| m_followers == 6 )
{
v138 = cocos2d::CCPoint::CCPoint(*(float *)&v121, MaxX);
v140 = v139;
cocos2d::CCPoint::CCPoint(*(float *)&v138, MinX);
cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v141,
v140,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
goto LABEL_153;
}
}
LABEL_154:
if ( v112 == v111 )
goto LABEL_166;
LODWORD(v142) = 0;
v231 = xmmword_140624150;
if ( !m_followers )
{
*(_OWORD *)&Block._Mypair._Myval2._Myfirst = 0;
v143 = cocos2d::CCDrawNode::drawCircle(
v1->m_debugDrawNode,
&v215,
v112,
(const struct cocos2d::_ccColor4F *)&Block,
v8,
(const struct cocos2d::_ccColor4F *)&v231,
(int)v112);
LABEL_165:
v117 += v143;
goto LABEL_166;
}
if ( (unsigned int)(m_followers - 1) <= 1
&& (v144 = cocos2d::CCPoint::CCPoint(0.0, v215.x - v112),
v146 = v145,
cocos2d::CCPoint::CCPoint(*(float *)&v144, v215.x - v112),
v142 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v147,
v146,
v8,
(const struct cocos2d::_ccColor4F *)&v231),
v117 += v148,
m_followers == 1)
|| m_followers == 3 )
{
v149 = cocos2d::CCPoint::CCPoint(*(float *)&v142, v215.x + v112);
v151 = v150;
cocos2d::CCPoint::CCPoint(*(float *)&v149, v215.x + v112);
v142 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v152,
v151,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
v117 += v153;
}
if ( (unsigned int)(m_followers - 4) <= 1
&& (v154 = cocos2d::CCPoint::CCPoint(*(float *)&v142, MaxX),
v156 = v155,
cocos2d::CCPoint::CCPoint(*(float *)&v154, MinX),
v142 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v157,
v156,
v8,
(const struct cocos2d::_ccColor4F *)&v231),
v117 += v158,
m_followers == 4)
|| m_followers == 6 )
{
v159 = cocos2d::CCPoint::CCPoint(*(float *)&v142, MaxX);
v161 = v160;
cocos2d::CCPoint::CCPoint(*(float *)&v159, MinX);
cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v162,
v161,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
goto LABEL_165;
}
LABEL_166:
if ( v113 != v112 )
{
LODWORD(v163) = 0;
v231 = xmmword_140624260;
if ( m_followers )
{
if ( (unsigned int)(m_followers - 1) <= 1
&& (v165 = cocos2d::CCPoint::CCPoint(0.0, v215.x - v113),
v167 = v166,
cocos2d::CCPoint::CCPoint(*(float *)&v165, v215.x - v113),
v163 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v168,
v167,
v8,
(const struct cocos2d::_ccColor4F *)&v231),
v117 += v169,
m_followers == 1)
|| m_followers == 3 )
{
v170 = cocos2d::CCPoint::CCPoint(*(float *)&v163, v215.x + v113);
v172 = v171;
cocos2d::CCPoint::CCPoint(*(float *)&v170, v215.x + v113);
v163 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v173,
v172,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
v117 += v174;
}
if ( (unsigned int)(m_followers - 4) > 1
|| (v175 = cocos2d::CCPoint::CCPoint(*(float *)&v163, MaxX),
v177 = v176,
cocos2d::CCPoint::CCPoint(*(float *)&v175, MinX),
v163 = cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v178,
v177,
v8,
(const struct cocos2d::_ccColor4F *)&v231),
v117 += v179,
m_followers != 4) )
{
if ( m_followers != 6 )
goto LABEL_178;
}
v180 = cocos2d::CCPoint::CCPoint(*(float *)&v163, MaxX);
v182 = v181;
cocos2d::CCPoint::CCPoint(*(float *)&v180, MinX);
cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
v183,
v182,
v8,
(const struct cocos2d::_ccColor4F *)&v231);
}
else
{
*(_OWORD *)&Block._Mypair._Myval2._Myfirst = 0;
v164 = cocos2d::CCDrawNode::drawCircle(
v1->m_debugDrawNode,
&v215,
v113,
(const struct cocos2d::_ccColor4F *)&Block,
v8,
(const struct cocos2d::_ccColor4F *)&v231,
(int)v113);
}
v117 += v164;
}
LABEL_178:
if ( v117 <= 100 )
{
++arr;
v114 = v111 > 0.0;
if ( (unsigned __int64)arr <= v223 )
continue;
}
break;
}
}
}
}
}
}
}
}
cocos2d::CCDrawNode::disableDrawArea(v1->m_debugDrawNode);
if ( v1->m_playerPoints._Mypair._Myval2._Myfirst != v1->m_playerPoints._Mypair._Myval2._Mylast )
{
v184 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v232.origin = (cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v232.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v184 = (GameManager *)qword_1406C2ED8;
}
if ( !GameManager::getGameVariable(v184, "0152") )
{
x = *(float *)&v1->m_playbackMode;
v215.x = x;
v186 = v1->m_playerPoints._Mypair._Myval2._Mylast - v1->m_playerPoints._Mypair._Myval2._Myfirst;
v187 = 0;
if ( (int)v186 - 1 > 0 )
{
v188 = 0;
do
{
v189 = v188 * 8 + 8;
if ( cocos2d::CCRect::containsPoint(&v224, &v1->m_playerPoints._Mypair._Myval2._Myfirst[v188])
|| cocos2d::CCRect::containsPoint(
&v224,
(const struct cocos2d::CCPoint *)((char *)v1->m_playerPoints._Mypair._Myval2._Myfirst + v189)) )
{
*(_OWORD *)&Block._Mypair._Myval2._Myfirst = xmmword_1406241A0;
if ( v187 == (_DWORD)v186 - 2 && LODWORD(x) == 1 )
v190 = v1->m_player1->getPosition_0(v1->m_player1);
else
v190 = (std::_Vector_val>::pointer)((char *)v1->m_playerPoints._Mypair._Myval2._Myfirst
+ v189);
cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
&v1->m_playerPoints._Mypair._Myval2._Myfirst[v188],
v190,
0.5,
(const struct cocos2d::_ccColor4F *)&Block);
}
++v187;
++v188;
}
while ( v187 < (int)v186 - 1 );
}
v191 = v1->m_player2Points._Mypair._Myval2._Myfirst;
v192 = v1->m_player2Points._Mypair._Myval2._Mylast;
if ( v191 != v192 )
{
v193 = v192 - v191;
v223 = v193;
v194 = 0.0;
v220 = 0.0;
v219 = (int)v193;
if ( (int)v193 > 0 )
{
v195 = 0;
do
{
v196 = v1->m_player2Points._Mypair._Myval2._Myfirst;
if ( !v1->m_gameState.m_isDualMode || LODWORD(v194) != (_DWORD)v193 - 1 || (v211 = 1, LODWORD(x) != 1) )
v211 = 0;
v197 = v196[v195]._Mypair._Myval2._Mylast - v196[v195]._Mypair._Myval2._Myfirst;
v198 = 0;
if ( (int)v197 - 1 > 0 )
{
v199 = 0;
do
{
v200 = v199 * 8 + 8;
if ( cocos2d::CCRect::containsPoint(&v224, &v196[v195]._Mypair._Myval2._Myfirst[v199])
|| cocos2d::CCRect::containsPoint(
&v224,
(const struct cocos2d::CCPoint *)((char *)v196[v195]._Mypair._Myval2._Myfirst + v200)) )
{
v231 = xmmword_140624320;
if ( v211 && v198 == (_DWORD)v197 - 2 )
v201 = v1->m_player2->getPosition_0(v1->m_player2);
else
v201 = (std::_Vector_val>::pointer)((char *)v196[v195]._Mypair._Myval2._Myfirst
+ v200);
cocos2d::CCDrawNode::drawSegment(
v1->m_debugDrawNode,
&v196[v195]._Mypair._Myval2._Myfirst[v199],
v201,
0.5,
(const struct cocos2d::_ccColor4F *)&v231);
}
++v198;
++v199;
}
while ( v198 < (int)v197 - 1 );
v194 = v220;
LODWORD(v193) = v223;
}
++LODWORD(v194);
v220 = v194;
++v195;
v202 = v219-- == 1;
x = v215.x;
}
while ( !v202 );
}
}
}
}
if ( v1->m_touchPoints._Mypair._Myval2._Myfirst != v1->m_touchPoints._Mypair._Myval2._Mylast )
{
v203 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v232.origin = (cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v232.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v203 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v203, "0149") )
{
v204 = v1->m_touchPoints._Mypair._Myval2._Mylast;
for ( i = v1->m_touchPoints._Mypair._Myval2._Myfirst; i != v204; ++i )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v216);
if ( cocos2d::CCRect::containsPoint(&v224, (const struct cocos2d::CCPoint *)&v216) )
{
*(_OWORD *)&Block._Mypair._Myval2._Myfirst = 0;
v231 = xmmword_140624110;
v206 = cocos2d::CCPoint::CCPoint(0.0, *(float *)&v216 + 2.0);
v208 = v207;
cocos2d::CCPoint::CCPoint(*(float *)&v206, *(float *)&v216 - 2.0);
cocos2d::CCDrawNode::drawRect(v1->m_debugDrawNode, v209, v208, &v231, 0, &Block, 0);
}
}
}
}
}