//
// LevelEditorLayer::updateDebugDraw from 0x379df8 to 0x37b1b0 (5048 bytes)
//
// 0 xrefs:
//
// 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 LevelEditorLayer::updateDebugDraw(LevelEditorLayer *a1)
{
GameManager *v2; // r0
float v3; // s14
cocos2d::CCDirector *v4; // r0
GameManager *v5; // r0
cocos2d::CCDictionary *m_keyframeGroups; // r3
cocos2d::CCArray **p_m_cameraGuideTriggers; // r7
unsigned int v8; // r6
float v9; // s18
float v10; // s19
int v11; // r8
float v12; // s16
int v13; // r0
float v14; // s21
const cocos2d::CCPoint *v15; // r0
float v16; // s23
cocos2d::CCDrawNode **p_m_debugDrawNode; // r5
float v18; // s17
float height; // s16
float v20; // s24
float v21; // s16
float v22; // s24
float v23; // s16
int v24; // r0
cocos2d::CCDrawNode *v25; // r5
cocos2d::CCDictElement *m_pElements; // r10
int v27; // r8
cocos2d::CCPoint *v28; // r5
int v29; // r6
int v30; // r7
int v31; // r9
int v32; // s15
cocos2d::CCArray *m_pObject; // r6
int v34; // r0
cocos2d::CCDictElement *next; // r3
EffectGameObject *m_traceInObject; // r0
unsigned int m_unk3b24; // r2
EffectGameObject *m_traceOutObject; // r0
unsigned int v39; // r2
std::vector *, std::allocator *>> *, std::allocator *, std::allocator *>> *>> *p_m_sections; // r7
std::array **p_m_debugDrawPoints; // r5
signed int v42; // r11
unsigned int m_leftSectionIndex; // r10
cocos2d::CCDrawNode *v44; // r0
std::array *m_debugDrawPoints; // r1
std::vector *, std::allocator *>> *v46; // r2
int v47; // r3
int v48; // r6
const cocos2d::CCRect *v49; // r0
int v50; // r2
bool v51; // r3
int v52; // r2
bool v53; // r3
int v54; // r2
bool v55; // r3
cocos2d::ccColor4F *v56; // r1
int v57; // r2
bool v58; // r3
int v59; // r6
int v60; // r2
int v61; // r2
int v62; // r2
int v63; // r2
int v64; // r2
int v65; // r2
int v66; // r2
bool v67; // r3
GameObject *m_selectedObject; // r8
int m_objectID; // r3
int b_low; // r1
int v71; // r6
cocos2d::CCArray *Group; // r0
cocos2d::CCArray *v73; // r5
std::vector *p_m_playerPoints; // r11
GameManager *v75; // r0
std::vector *v76; // r2
std::vector *m_finish; // r3
std::vector> *p_m_player2Points; // r10
int v79; // r6
GameManager *v80; // r0
cocos2d::CCPoint *v81; // r9
cocos2d::CCPoint *v82; // r6
cocos2d::CCDrawNode **v83; // r4
int v84; // r11
const cocos2d::CCPoint *v85; // r0
float v86; // s16
float v87; // s17
int v88; // r0
GJEffectManager *m_effectManager; // r0
GroupCommandObject2 *KeyframeCommand; // r6
unsigned int i; // r10
KeyframeObject *m_start; // r2
int v93; // r1
KeyframeObject *v94; // r7
double m_unk170; // d7
float v96; // s20
cocos2d::CCPoint *v97; // r0
cocos2d::CCPoint *v98; // r11
cocos2d::CCPoint *v99; // r9
int v100; // r9
float v101; // s16
double v102; // d8
double v103; // d11
float v104; // s15
float v105; // s14
int v106; // r2
bool v107; // r3
cocos2d::CCDrawNode *m_debugDrawNode; // r0
unsigned int j; // r7
KeyframeObject *v110; // r0
int v111; // r2
const cocos2d::CCPoint *p_m_unk190; // r1
const cocos2d::CCPoint *v113; // r2
cocos2d::CCDrawNode *v114; // r0
int v115; // r6
bool v116; // r3
int v117; // r2
bool v118; // r3
int v119; // r2
bool v120; // r3
int v121; // s17
int m_blackChildOpacity_low; // s18
int v123; // s16
float v124; // r8
float v125; // r0
cocos2d::ccArray *data; // r3
float v127; // r9
cocos2d::CCDrawNode **v128; // r7
int v129; // r5
float v130; // s17
float v131; // s18
float v132; // s19
float x; // r1
int v134; // r0
bool v135; // zf
int v136; // r0
bool v137; // zf
int v138; // r0
bool v139; // zf
int v140; // r0
bool v141; // zf
int v142; // r0
bool v143; // zf
int v144; // r0
bool v145; // zf
int v146; // r7
int v147; // r5
int v148; // r6
_BOOL4 m_isDualMode; // r3
std::vector *v150; // r8
_BOOL4 v151; // r2
int v152; // r7
int v153; // r5
int v154; // r9
cocos2d::CCDrawNode *v155; // r3
cocos2d::CCPoint *v156; // r1
const cocos2d::CCPoint *v157; // r0
const cocos2d::CCPoint *v158; // r2
cocos2d::CCDrawNode *v159; // r3
cocos2d::CCPoint *v160; // r1
const cocos2d::CCPoint *v161; // r0
const cocos2d::CCPoint *v162; // r2
float v163; // [sp+28h] [bp-C4h]
cocos2d::CCRect *v164; // [sp+28h] [bp-C4h]
cocos2d::CCRect *v165; // [sp+28h] [bp-C4h]
cocos2d::CCDictElement *v166; // [sp+2Ch] [bp-C0h]
int k; // [sp+2Ch] [bp-C0h]
float v168; // [sp+2Ch] [bp-C0h]
_BOOL4 v169; // [sp+2Ch] [bp-C0h]
cocos2d::CCPoint *m_bottomSectionIndex; // [sp+30h] [bp-BCh]
int v171; // [sp+30h] [bp-BCh]
cocos2d::CCPoint *MinY; // [sp+30h] [bp-BCh]
cocos2d::CCPoint *v173; // [sp+30h] [bp-BCh]
int m; // [sp+34h] [bp-B8h]
cocos2d::CCRect *arr; // [sp+34h] [bp-B8h]
cocos2d::CCRect *v176; // [sp+38h] [bp-B4h]
cocos2d::CCRect *v177; // [sp+38h] [bp-B4h]
cocos2d::CCRect *v178; // [sp+38h] [bp-B4h]
_BOOL4 GameVariable; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v180; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v181; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v182; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v183; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v184; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v185; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v186; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v187; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v188; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v189; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v190; // [sp+3Ch] [bp-B0h]
cocos2d::CCDrawNode *v191; // [sp+3Ch] [bp-B0h]
cocos2d::CCPoint *v192; // [sp+3Ch] [bp-B0h]
PlayerObject *v193; // [sp+40h] [bp-ACh]
int v194; // [sp+48h] [bp-A4h]
_DWORD *v195; // [sp+4Ch] [bp-A0h]
_BOOL4 v196; // [sp+50h] [bp-9Ch]
int v197; // [sp+58h] [bp-94h]
int v198; // [sp+5Ch] [bp-90h]
cocos2d::CCSize v199; // [sp+6Ch] [bp-80h] BYREF
cocos2d::CCPoint v200; // [sp+74h] [bp-78h] BYREF
cocos2d::CCPoint v201; // [sp+7Ch] [bp-70h] BYREF
cocos2d::CCPoint v202; // [sp+84h] [bp-68h] BYREF
cocos2d::CCPoint v203; // [sp+8Ch] [bp-60h] BYREF
cocos2d::CCPoint v204; // [sp+94h] [bp-58h] BYREF
cocos2d::CCPoint v205; // [sp+9Ch] [bp-50h] BYREF
cocos2d::CCRect v206; // [sp+A4h] [bp-48h] BYREF
cocos2d::CCRect v207; // [sp+B4h] [bp-38h] BYREF
cocos2d::ccColor4F v208; // [sp+C4h] [bp-28h] BYREF
cocos2d::CCRect v209; // [sp+D4h] [bp-18h] BYREF
GJBaseGameLayer::updateDebugDraw(a1);
v2 = GameManager::sharedState();
byte_AC5D00 = GameManager::getGameVariable(v2, "0181");
clock_gettime(0, (struct timespec *)&v209);
dbl_AC5D08 = (double)SLODWORD(v209.origin.x) + (double)SLODWORD(v209.origin.y) / 1000000000.0;
if ( byte_AC5D00 )
{
dbl_AC5CF8 = 0.519999981;
}
else
{
v3 = fmod((double)SLODWORD(v209.origin.x) + (double)SLODWORD(v209.origin.y) / 1000000000.0, 2.0) * 0.5;
dbl_AC5CF8 = (float)(1.0 - v3);
}
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v199, v4);
v163 = 0.25 / a1->m_objectLayer->getScale(a1->m_objectLayer);
cocos2d::CCRect::CCRect(&v206, &a1->m_debugDrawNode->m_rDrawArea);
v5 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v5, "0121");
cocos2d::CCDrawNode::enableDrawArea(a1->m_debugDrawNode, &v206);
if ( cocos2d::CCArray::count(a1->m_cameraGuideTriggers) )
{
p_m_cameraGuideTriggers = &a1->m_cameraGuideTriggers;
v8 = 0;
v9 = v199.width + v199.width;
v10 = v199.height + v199.height;
while ( v8 < cocos2d::CCArray::count(*p_m_cameraGuideTriggers) )
{
v11 = cocos2d::CCArray::objectAtIndex(*p_m_cameraGuideTriggers, v8);
v12 = *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v11 + 96))(v11);
v13 = (*(int (__fastcall **)(int))(*(_DWORD *)v11 + 96))(v11);
cocos2d::CCRect::CCRect(&v207, v12 - (float)(v9 * 0.5), *(float *)(v13 + 4) - (float)(v10 * 0.5), v9, v10);
if ( *(_DWORD *)(v11 + 884) == 2016
&& cocos2d::CCRect::intersectsRect(&v206, &v207)
&& (!GameVariable || !*(_BYTE *)(v11 + 1106) || *(_BYTE *)(v11 + 981)) )
{
v14 = *(float *)(v11 + 1660);
if ( v14 > 0.0 )
{
v15 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(int))(*(_DWORD *)v11 + 96))(v11);
cocos2d::CCPoint::CCPoint(&v200, v15);
v16 = *(float *)(v11 + 1552);
if ( v16 > 3.0 )
{
v16 = 3.0;
}
else if ( v16 <= 0.4 )
{
v16 = 0.4;
}
else if ( v16 > 3.0 )
{
v16 = 3.0;
}
p_m_debugDrawNode = &a1->m_debugDrawNode;
v18 = v199.width / v16;
height = v199.height;
cocos2d::CCPoint::CCPoint(&v201, (const cocos2d::CCPoint *)(v11 + 1300));
v20 = 320.0 / v16;
v21 = height / v16;
if ( (float)(480.0 / v16) != v18 || v21 != v20 )
{
v85 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(int))(*(_DWORD *)v11 + 96))(v11);
cocos2d::CCPoint::CCPoint(&v203, v85);
v86 = v21 * 0.5;
v87 = v18 * 0.5;
if ( (float)(v203.y - v86) < 0.0 )
v203.y = v86 + 0.0;
cocos2d::CCPoint::CCPoint(&v204, (float)(v203.x - v87) + v201.x, (float)(v203.y - v86) + v201.y);
cocos2d::CCPoint::CCPoint(&v205, (float)(v87 + v203.x) + v201.x, (float)(v86 + v203.y) + v201.y);
v209.origin.x = 1.0;
memset(&v208, 0, sizeof(v208));
v88 = (int)*p_m_debugDrawNode;
v209.origin.y = 0.5;
v209.size.width = 0.0;
v209.size.height = v14;
cocos2d::CCDrawNode::drawRect(v88, (int)&v204, (int)&v205, (int)&v208, v163, (int)&v209, 0);
}
v22 = v20 * 0.5;
v23 = (float)(480.0 / v16) * 0.5;
if ( (float)(v200.y - v22) < 0.0 )
v200.y = v22 + 0.0;
cocos2d::CCPoint::CCPoint(&v202, (float)(v200.x - v23) + v201.x, (float)(v200.y - v22) + v201.y);
cocos2d::CCPoint::CCPoint(&v203, (float)(v23 + v200.x) + v201.x, (float)(v22 + v200.y) + v201.y);
cocos2d::CCPoint::CCPoint(&v204, v200.x - (float)((float)a1->m_gameState.m_unkInt1 / v16), v200.y);
memset(&v208, 0, sizeof(v208));
v24 = (int)*p_m_debugDrawNode;
v209.origin.x = 0.0;
v209.origin.y = 1.0;
v209.size.width = 0.0;
v209.size.height = v14;
cocos2d::CCDrawNode::drawRect(v24, (int)&v202, (int)&v203, (int)&v208, v163, (int)&v209, 0);
v25 = *p_m_debugDrawNode;
cocos2d::CCPoint::CCPoint(&v205, v204.x, v202.y);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v208, v204.x, v203.y);
v209.origin.x = 1.0;
v209.size.width = 0.0;
v209.origin.y = 1.0;
v209.size.height = v14;
cocos2d::CCDrawNode::drawSegment(
v25,
&v205,
(const cocos2d::CCPoint *)&v208,
v163,
(const cocos2d::ccColor4F *)&v209);
}
}
++v8;
}
}
m_keyframeGroups = a1->m_keyframeGroups;
if ( m_keyframeGroups )
{
m_pElements = m_keyframeGroups->m_pElements;
v166 = m_pElements ? (cocos2d::CCDictElement *)m_pElements->hh.next : nullptr;
v27 = 0;
v28 = nullptr;
while ( m_pElements )
{
if ( ++v27 > 5 )
{
v27 = 0;
LABEL_38:
v29 = 50;
v30 = 255;
LABEL_39:
v31 = v29;
}
else
{
switch ( v27 )
{
case 2:
v29 = 50;
v30 = 150;
goto LABEL_33;
case 3:
v29 = 255;
v31 = 0;
v30 = 255;
break;
case 4:
v29 = 0;
v30 = 255;
LABEL_33:
v31 = 255;
break;
case 5:
v29 = 255;
v30 = 0;
goto LABEL_39;
default:
goto LABEL_38;
}
}
memset(&v208, 0, sizeof(v208));
v208.a = 1.0;
v208.r = (float)v31 / 255.0;
v208.g = (float)v30 / 255.0;
v32 = v29;
m_pObject = (cocos2d::CCArray *)m_pElements->m_pObject;
v208.b = (float)v32 / 255.0;
if ( m_pObject )
{
if ( cocos2d::CCArray::count(m_pObject) > 1u )
{
v34 = cocos2d::CCArray::objectAtIndex(m_pObject, 0);
if ( !GameVariable || !*(_BYTE *)(v34 + 1106) || *(_BYTE *)(v34 + 981) )
{
m_effectManager = a1->m_effectManager;
memset(&v209, 0, 12);
KeyframeCommand = GJEffectManager::createKeyframeCommand(
m_effectManager,
0,
m_pObject,
nullptr,
0,
0,
1,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
(std::vector *const)&v209);
std::_Vector_base::~_Vector_base((void **)&v209);
if ( KeyframeCommand )
{
if ( KeyframeCommand->m_keyframes.m_start != KeyframeCommand->m_keyframes.m_finish )
{
for ( i = 0; ; ++i )
{
m_start = KeyframeCommand->m_keyframes.m_start;
v93 = 1022611261;
if ( i >= 1022611261 * (((char *)KeyframeCommand->m_keyframes.m_finish - (char *)m_start) >> 4) - 1 )
break;
v94 = &m_start[i];
m_unk170 = v94->m_unk170;
if ( m_unk170 > 0.0 )
{
v96 = m_unk170 / 50.0;
if ( !v28 )
{
v97 = (cocos2d::CCPoint *)operator new[](0x190u);
v98 = v97 + 50;
v28 = v97;
v99 = v97;
do
cocos2d::CCPoint::CCPoint(v99++);
while ( v99 != v98 );
}
v100 = 0;
do
{
v193 = (PlayerObject *)&v28[v100];
v101 = (float)v100++;
v102 = (float)(v96 * v101);
v103 = COERCE_DOUBLE(
((__int64 (__fastcall *)(tk_spline *, int, _DWORD, _DWORD))tk::spline::operator())(
&v94->m_spline1,
v93,
LODWORD(v102),
HIDWORD(v102)));
v104 = tk::spline::operator()(&v94->m_spline2, HIDWORD(v103), LODWORD(v102), HIDWORD(v102));
v105 = v103;
cocos2d::CCPoint::CCPoint(&v207.origin, v105, v104);
cocos2d::CCPoint::operator+(&v209, &v94->m_unk190, &v207);
cocos2d::CCPoint::operator=(v193, COERCE_FLOAT(&v209), v106, v107);
}
while ( v100 != 50 );
m_debugDrawNode = a1->m_debugDrawNode;
v209.size.height = v94->m_unk1b8;
v209.origin.x = 0.0;
v209.origin.y = 1.0;
v209.size.width = 1.0;
cocos2d::CCDrawNode::drawLines(m_debugDrawNode, v28, 0x32u, v163, (const cocos2d::ccColor4F *)&v209);
}
}
for ( j = 0; ; ++j )
{
v110 = KeyframeCommand->m_keyframes.m_start;
if ( j >= 1022611261 * (((char *)KeyframeCommand->m_keyframes.m_finish - (char *)v110) >> 4) - 1 )
break;
v111 = j;
if ( !v110[v111].m_unk01e )
{
p_m_unk190 = &v110[v111].m_unk190;
v113 = &v110[v111 + 1].m_unk190;
v114 = a1->m_debugDrawNode;
v208.a = v113[5].x;
cocos2d::CCDrawNode::drawSegment(v114, p_m_unk190, v113, v163, &v208);
}
}
}
}
}
}
}
GJEffectManager::resetTempGroupCommands(a1->m_effectManager, 0);
if ( v166 )
next = (cocos2d::CCDictElement *)v166->hh.next;
else
next = nullptr;
m_pElements = v166;
v166 = next;
}
if ( v28 )
operator delete(v28);
}
cocos2d::CCDrawNode::disableDrawArea(a1->m_debugDrawNode);
m_traceInObject = a1->m_traceInObject;
if ( m_traceInObject )
{
m_unk3b24 = a1->m_unk3b24;
if ( a1->m_unk3b28 < m_unk3b24 )
{
a1->m_unk3b28 = m_unk3b24;
processTrace(m_traceInObject, a1, (unsigned int *)&a1->m_unk3b30, 1);
}
drawTrace(a1, (const cocos2d::ccColor4F **)&a1->m_unk3b30, 1, a1->m_debugDrawNode);
}
else if ( !a1->m_traceOutObject )
{
goto LABEL_61;
}
m_traceOutObject = a1->m_traceOutObject;
if ( m_traceOutObject )
{
v39 = a1->m_unk3b24;
if ( a1->m_unk3b2c < v39 )
{
a1->m_unk3b2c = v39;
processTrace(m_traceOutObject, a1, (unsigned int *)&a1->m_unk3b48, 0);
}
drawTrace(a1, (const cocos2d::ccColor4F **)&a1->m_unk3b48, 0, a1->m_debugDrawNode);
}
LABEL_61:
p_m_sections = &a1->m_sections;
if ( a1->m_drawTriggerBoxes )
{
p_m_debugDrawPoints = &a1->m_debugDrawPoints;
v42 = 0;
v198 = a1->m_sections.m_finish - a1->m_sections.m_start;
m_leftSectionIndex = a1->m_leftSectionIndex;
for ( k = a1->m_leftSectionIndex; k <= a1->m_rightSectionIndex && k < v198; ++k )
{
v46 = p_m_sections->m_start[m_leftSectionIndex];
if ( v46 )
v47 = p_m_sections->m_start[m_leftSectionIndex]->m_finish - v46->m_start;
else
v47 = -1;
v194 = v47;
m_bottomSectionIndex = (cocos2d::CCPoint *)a1->m_bottomSectionIndex;
v176 = (cocos2d::CCRect *)(4 * (_DWORD)m_bottomSectionIndex);
while ( (int)m_bottomSectionIndex <= a1->m_topSectionIndex && (int)m_bottomSectionIndex < v194 )
{
v195 = *(std::vector **)((char *)p_m_sections->m_start[m_leftSectionIndex]->m_start
+ (unsigned int)v176);
if ( v195 )
{
v197 = *(int *)((char *)a1->m_sectionSizes.m_start[m_leftSectionIndex]->m_start + (unsigned int)v176);
for ( m = 0; m < v197; ++m )
{
v48 = *(_DWORD *)(*v195 + 4 * m);
if ( (*(int (__fastcall **)(int))(*(_DWORD *)v48 + 168))(v48)
&& LevelEditorLayer::validGroup(a1, (GameObject *)v48, 0)
&& (!GameVariable || !*(_BYTE *)(v48 + 1106) || *(_BYTE *)(v48 + 981))
&& (*(_DWORD *)(v48 + 1076) == 1 && *(_BYTE *)(v48 + 1284)
|| (*(int (__fastcall **)(int))(*(_DWORD *)v48 + 892))(v48) == 30 && !*(_BYTE *)(v48 + 826))
&& (*(int (__fastcall **)(int))(*(_DWORD *)v48 + 852))(v48)
&& !*(_BYTE *)(v48 + 1158) )
{
v49 = (const cocos2d::CCRect *)(*(int (__fastcall **)(int))(*(_DWORD *)v48 + 656))(v48);
cocos2d::CCRect::CCRect(&v209, v49);
v196 = (int)(*(float (__fastcall **)(int))(*(_DWORD *)v48 + 176))(v48) % 90 != 0;
if ( v196 )
GameObject::calculateOrientedBox((GameObject *)v48);
cocos2d::CCPoint::CCPoint(&v203);
cocos2d::CCPoint::CCPoint(&v204);
cocos2d::CCPoint::CCPoint(&v205);
cocos2d::CCPoint::CCPoint(&v207.origin);
if ( v196 )
{
v115 = (*(int (__fastcall **)(int))(*(_DWORD *)v48 + 772))(v48);
cocos2d::CCPoint::operator=((PlayerObject *)&v203, COERCE_FLOAT(v115 + 264), (int)&v203, v116);
cocos2d::CCPoint::operator=((PlayerObject *)&v204, COERCE_FLOAT(v115 + 272), v117, v118);
cocos2d::CCPoint::operator=((PlayerObject *)&v205, COERCE_FLOAT(v115 + 280), v119, v120);
v56 = (cocos2d::ccColor4F *)(v115 + 288);
}
else
{
cocos2d::CCPoint::operator=((PlayerObject *)&v203, COERCE_FLOAT(&v209), (int)&v203, 0);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v208,
v209.origin.x + v209.size.width,
v209.origin.y + v209.size.height);
cocos2d::CCPoint::operator=((PlayerObject *)&v205, COERCE_FLOAT(&v208), v50, v51);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v208, v203.x, v205.y);
cocos2d::CCPoint::operator=((PlayerObject *)&v204, COERCE_FLOAT(&v208), v52, v53);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v208, v205.x, v203.y);
v56 = &v208;
}
cocos2d::CCPoint::operator=((PlayerObject *)&v207, *(float *)&v56, v54, v55);
if ( v42 >= 392 )
break;
v59 = v42;
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v42],
COERCE_FLOAT(&v203),
v57,
v58);
v42 += 8;
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v59 + 1],
COERCE_FLOAT(&v204),
v60,
v59 * 8 + 8);
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v59 + 2],
COERCE_FLOAT(&v204),
v61,
v59 * 8 + 16);
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v59 + 3],
COERCE_FLOAT(&v205),
v62,
v59 * 8 + 24);
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v59 + 4],
COERCE_FLOAT(&v205),
v63,
v59 * 8 + 32);
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v59 + 5],
COERCE_FLOAT(&v207),
v64,
v59 * 8 + 40);
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v59 + 6],
COERCE_FLOAT(&v207),
v65,
v59 * 8 + 48);
cocos2d::CCPoint::operator=(
(PlayerObject *)&(*p_m_debugDrawPoints)->__elems_[v59 + 7],
COERCE_FLOAT(&v203),
v66,
v67);
}
}
}
m_bottomSectionIndex = (cocos2d::CCPoint *)((char *)m_bottomSectionIndex + 1);
v176 = (cocos2d::CCRect *)((char *)v176 + 4);
}
++m_leftSectionIndex;
}
if ( v42 )
{
v44 = a1->m_debugDrawNode;
m_debugDrawPoints = a1->m_debugDrawPoints;
v209.origin.x = 0.0;
v209.origin.y = 1.0;
v209.size.width = 1.0;
v209.size.height = 1.0;
cocos2d::CCDrawNode::drawLines(v44, m_debugDrawPoints->__elems_, v42, v163, (const cocos2d::ccColor4F *)&v209);
}
}
cocos2d::CCDrawNode::enableDrawArea(a1->m_debugDrawNode, &v206);
m_selectedObject = a1->m_editorUI->m_selectedObject;
if ( m_selectedObject )
{
m_objectID = m_selectedObject->m_objectID;
if ( (unsigned int)(m_objectID - 3602) <= 1 || m_objectID == 3605 )
{
b_low = LODWORD(m_selectedObject[1].m_sAdditionalTransform.b);
v71 = *(_DWORD *)&m_selectedObject[1].m_unk28c;
if ( b_low > 0 )
{
Group = GJBaseGameLayer::getGroup(a1, b_low);
v73 = Group;
if ( Group )
{
if ( cocos2d::CCArray::count(Group) )
{
v121 = *(_DWORD *)&m_selectedObject[1].m_isColorSpriteBlack;
m_blackChildOpacity_low = LODWORD(m_selectedObject[1].m_blackChildOpacity);
v123 = *(_DWORD *)&m_selectedObject[1].m_blackChildOpacityLocked;
v168 = COERCE_FLOAT(cocos2d::CCRect::getMinX(&v206));
MinY = (cocos2d::CCPoint *)cocos2d::CCRect::getMinY(&v206);
v124 = COERCE_FLOAT(cocos2d::CCRect::getMaxX(&v206));
v125 = COERCE_FLOAT(cocos2d::CCRect::getMaxY(&v206));
data = v73->data;
v127 = v125;
if ( data->num )
{
v128 = &a1->m_debugDrawNode;
v129 = 0;
arr = (cocos2d::CCRect *)data->arr;
v177 = (cocos2d::CCRect *)((char *)arr + 4 * data->num + -4);
v130 = (float)v121 * 3.0;
v131 = v130 + (float)((float)m_blackChildOpacity_low * 3.0);
v132 = v131 + (float)((float)v123 * 3.0);
do
{
if ( arr > v177 )
break;
x = arr->origin.x;
arr = (cocos2d::CCRect *)((char *)arr + 4);
if ( x == 0.0 )
break;
(*(void (__fastcall **)(cocos2d::CCPoint *))(*(_DWORD *)LODWORD(x) + 672))(&v205);
if ( v130 > 0.0 )
{
v208.g = 0.0;
v208.r = 1.0;
v208.a = 1.0;
v208.b = 0.0;
if ( !v71 )
{
memset(&v209, 0, sizeof(v209));
v129 += cocos2d::CCDrawNode::drawCircle(
*v128,
&v205,
v130,
(const cocos2d::ccColor4F *)&v209,
v163,
&v208,
(unsigned int)v130);
}
if ( (unsigned int)(v71 - 1) > 1 )
{
v135 = v71 == 3;
}
else
{
v180 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v205.x - v130, *(float *)&MinY);
cocos2d::CCPoint::CCPoint(&v209.origin, v205.x - v130, v127);
v134 = cocos2d::CCDrawNode::drawSegment(v180, &v207.origin, &v209.origin, v163, &v208);
v135 = v71 == 1;
v129 += v134;
}
if ( v135 )
{
v181 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v130 + v205.x, *(float *)&MinY);
cocos2d::CCPoint::CCPoint(&v209.origin, v130 + v205.x, v127);
v129 += cocos2d::CCDrawNode::drawSegment(v181, &v207.origin, &v209.origin, v163, &v208);
}
if ( (unsigned int)(v71 - 4) > 1 )
{
v137 = v71 == 6;
}
else
{
v182 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v168, v205.y - v130);
cocos2d::CCPoint::CCPoint(&v209.origin, v124, v205.y - v130);
v136 = cocos2d::CCDrawNode::drawSegment(v182, &v207.origin, &v209.origin, v163, &v208);
v137 = v71 == 4;
v129 += v136;
}
if ( v137 )
{
v183 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v168, v130 + v205.y);
cocos2d::CCPoint::CCPoint(&v209.origin, v124, v130 + v205.y);
v129 += cocos2d::CCDrawNode::drawSegment(v183, &v207.origin, &v209.origin, v163, &v208);
}
}
if ( v131 != v130 )
{
v208.r = 0.0;
v208.g = 1.0;
v208.a = 1.0;
v208.b = 0.0;
if ( !v71 )
{
memset(&v209, 0, sizeof(v209));
v129 += cocos2d::CCDrawNode::drawCircle(
*v128,
&v205,
v131,
(const cocos2d::ccColor4F *)&v209,
v163,
&v208,
(unsigned int)v131);
}
if ( (unsigned int)(v71 - 1) > 1 )
{
v139 = v71 == 3;
}
else
{
v184 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v205.x - v131, *(float *)&MinY);
cocos2d::CCPoint::CCPoint(&v209.origin, v205.x - v131, v127);
v138 = cocos2d::CCDrawNode::drawSegment(v184, &v207.origin, &v209.origin, v163, &v208);
v139 = v71 == 1;
v129 += v138;
}
if ( v139 )
{
v185 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v131 + v205.x, *(float *)&MinY);
cocos2d::CCPoint::CCPoint(&v209.origin, v131 + v205.x, v127);
v129 += cocos2d::CCDrawNode::drawSegment(v185, &v207.origin, &v209.origin, v163, &v208);
}
if ( (unsigned int)(v71 - 4) > 1 )
{
v141 = v71 == 6;
}
else
{
v186 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v168, v205.y - v131);
cocos2d::CCPoint::CCPoint(&v209.origin, v124, v205.y - v131);
v140 = cocos2d::CCDrawNode::drawSegment(v186, &v207.origin, &v209.origin, v163, &v208);
v141 = v71 == 4;
v129 += v140;
}
if ( v141 )
{
v187 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v168, v131 + v205.y);
cocos2d::CCPoint::CCPoint(&v209.origin, v124, v131 + v205.y);
v129 += cocos2d::CCDrawNode::drawSegment(v187, &v207.origin, &v209.origin, v163, &v208);
}
}
if ( v132 != v131 )
{
v208.r = 0.0;
v208.b = 1.0;
v208.a = 1.0;
v208.g = 0.0;
if ( !v71 )
{
memset(&v209, 0, sizeof(v209));
v129 += cocos2d::CCDrawNode::drawCircle(
*v128,
&v205,
v132,
(const cocos2d::ccColor4F *)&v209,
v163,
&v208,
(unsigned int)v132);
}
if ( (unsigned int)(v71 - 1) > 1 )
{
v143 = v71 == 3;
}
else
{
v188 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v205.x - v132, *(float *)&MinY);
cocos2d::CCPoint::CCPoint(&v209.origin, v205.x - v132, v127);
v142 = cocos2d::CCDrawNode::drawSegment(v188, &v207.origin, &v209.origin, v163, &v208);
v143 = v71 == 1;
v129 += v142;
}
if ( v143 )
{
v189 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v132 + v205.x, *(float *)&MinY);
cocos2d::CCPoint::CCPoint(&v209.origin, v132 + v205.x, v127);
v129 += cocos2d::CCDrawNode::drawSegment(v189, &v207.origin, &v209.origin, v163, &v208);
}
if ( (unsigned int)(v71 - 4) > 1 )
{
v145 = v71 == 6;
}
else
{
v190 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v168, v205.y - v132);
cocos2d::CCPoint::CCPoint(&v209.origin, v124, v205.y - v132);
v144 = cocos2d::CCDrawNode::drawSegment(v190, &v207.origin, &v209.origin, v163, &v208);
v145 = v71 == 4;
v129 += v144;
}
if ( v145 )
{
v191 = *v128;
cocos2d::CCPoint::CCPoint(&v207.origin, v168, v132 + v205.y);
cocos2d::CCPoint::CCPoint(&v209.origin, v124, v132 + v205.y);
v129 += cocos2d::CCDrawNode::drawSegment(v191, &v207.origin, &v209.origin, v163, &v208);
}
}
}
while ( v129 <= 100 );
}
}
}
}
}
}
cocos2d::CCDrawNode::disableDrawArea(a1->m_debugDrawNode);
p_m_playerPoints = &a1->m_playerPoints;
if ( a1->m_playerPoints.m_start != a1->m_playerPoints.m_finish )
{
v75 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v75, "0152") )
{
v146 = 1;
v169 = a1->m_playbackMode == Playing;
v147 = 0;
v148 = a1->m_playerPoints.m_finish - a1->m_playerPoints.m_start;
while ( v147 < v148 - 1 )
{
if ( cocos2d::CCRect::containsPoint(&v206, &p_m_playerPoints->m_start[v147])
|| cocos2d::CCRect::containsPoint(&v206, &p_m_playerPoints->m_start[v146]) )
{
v159 = a1->m_debugDrawNode;
v160 = p_m_playerPoints->m_start;
if ( v147 == v148 - 2 && v169 )
{
v173 = p_m_playerPoints->m_start;
v165 = (cocos2d::CCRect *)a1->m_debugDrawNode;
v161 = a1->m_player1->getPosition(a1->m_player1);
v159 = (cocos2d::CCDrawNode *)v165;
v160 = v173;
v162 = v161;
}
else
{
v162 = &v160[v146];
}
v209.origin.y = 1.0;
v209.size.height = 1.0;
v209.origin.x = 0.2;
v209.size.width = 0.2;
cocos2d::CCDrawNode::drawSegment(v159, &v160[v147], v162, 0.5, (const cocos2d::ccColor4F *)&v209);
}
++v147;
++v146;
}
v76 = a1->m_player2Points.m_start;
m_finish = a1->m_player2Points.m_finish;
if ( v76 != m_finish )
{
p_m_player2Points = &a1->m_player2Points;
v79 = 0;
v171 = -1431655765 * (((char *)m_finish - (char *)v76) >> 2);
while ( v79 < v171 )
{
m_isDualMode = a1->m_gameState.m_isDualMode;
v150 = &p_m_player2Points->m_start[v79];
if ( a1->m_gameState.m_isDualMode )
{
v151 = v169;
if ( v79 != v171 - 1 )
v151 = 0;
m_isDualMode = v151;
}
v152 = 0;
v164 = (cocos2d::CCRect *)m_isDualMode;
v153 = v150->m_finish - p_m_player2Points->m_start[v79].m_start;
while ( v152 < v153 - 1 )
{
v154 = v152;
if ( cocos2d::CCRect::containsPoint(&v206, &v150->m_start[v152])
|| cocos2d::CCRect::containsPoint(&v206, &v150->m_start[v154 + 1]) )
{
v155 = a1->m_debugDrawNode;
v156 = v150->m_start;
if ( v164 && v152 == v153 - 2 )
{
v192 = v150->m_start;
v178 = (cocos2d::CCRect *)a1->m_debugDrawNode;
v157 = a1->m_player2->getPosition(a1->m_player2);
v155 = (cocos2d::CCDrawNode *)v178;
v156 = v192;
v158 = v157;
}
else
{
v158 = &v156[v154 + 1];
}
v209.origin.y = 1.0;
v209.size.width = 1.0;
v209.size.height = 1.0;
v209.origin.x = 0.2;
cocos2d::CCDrawNode::drawSegment(v155, &v156[v154], v158, 0.5, (const cocos2d::ccColor4F *)&v209);
}
++v152;
}
++v79;
}
}
}
}
if ( a1->m_touchPoints.m_start != a1->m_touchPoints.m_finish )
{
v80 = GameManager::sharedState();
if ( GameManager::getGameVariable(v80, "0149") )
{
v81 = a1->m_touchPoints.m_finish;
v82 = a1->m_touchPoints.m_start;
v83 = &a1->m_debugDrawNode;
while ( v82 != v81 )
{
cocos2d::CCPoint::CCPoint(&v204, v82);
if ( cocos2d::CCRect::containsPoint(&v206, &v204) )
{
v84 = (int)*v83;
cocos2d::CCPoint::CCPoint(&v205, v204.x - 2.0, v204.y - 2.0);
cocos2d::CCPoint::CCPoint(&v207.origin, v204.x + 2.0, v204.y + 2.0);
v208.r = 1.0;
v208.g = 0.5;
v208.a = 1.0;
v208.b = 0.0;
memset(&v209, 0, sizeof(v209));
cocos2d::CCDrawNode::drawRect(v84, (int)&v205, (int)&v207, (int)&v208, 0.0, (int)&v209, 0);
}
++v82;
}
}
}
}