//
// DrawGridLayer::draw from 0x46464c to 0x46599e (4946 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:48:56 +0000
//
void __fastcall DrawGridLayer::draw(DrawGridLayer *this)
{
int v2; // r1
int v3; // r2
int v4; // r5
int v5; // r6
int v6; // r3
GameManager *v7; // r0
GameManager *v8; // r0
unsigned int v9; // r2
cocos2d::CCArray *v10; // r0
int v11; // r3
float v12; // s20
const cocos2d::CCPoint *v13; // r0
cocos2d::CCDirector *v14; // r0
const cocos2d::CCPoint *v15; // r10
float v16; // s17
float v17; // s16
int v18; // r0
const cocos2d::CCPoint *v19; // r10
float v20; // s15
int v21; // r7
float v22; // s19
float v23; // s22
float v24; // r0
float v25; // s21
float v26; // s16
float v27; // s18
int v28; // s24
float v29; // s21
float v30; // r2
float v31; // r2
const cocos2d::CCPoint *v32; // r2
int v33; // r11
int v34; // r10
float v35; // r2
int v36; // r10
float v37; // r2
float v38; // r0
float v39; // s21
float v40; // s26
float v41; // r0
int v42; // s24
float v43; // s21
float v44; // r1
float v45; // r1
const cocos2d::CCPoint *v46; // r2
int v47; // r9
int v48; // r11
float v49; // r1
int v50; // r11
float v51; // r1
unsigned int v52; // r2
float v53; // r1
float v54; // r1
const cocos2d::CCPoint *v55; // r2
float v56; // r0
unsigned int v57; // r6
int v58; // r7
int v59; // r8
int v60; // r9
cocos2d::CCString *v61; // r0
float v62; // s21
cocos2d::CCString *v63; // r0
float v64; // r2
float v65; // r2
float v66; // r2
float v67; // r2
float v68; // r2
float v69; // r2
unsigned int v70; // r2
unsigned int v71; // r2
unsigned int v72; // r2
int v73; // r6
_DWORD *v74; // r8
int v75; // r7
int v76; // r11
int v77; // r3
float v78; // s24
int v79; // r2
float v80; // s22
float *v81; // r0
float v82; // s22
float v83; // s21
float v84; // s25
float v85; // s22
unsigned int v86; // r2
unsigned int v87; // r2
int v88; // r3
_DWORD *v89; // r3
float v90; // s22
GameObject **v91; // r8
GameObject **v92; // r6
int v93; // r7
unsigned int v94; // r2
GameObject *v95; // r11
GameObject *v96; // t1
unsigned int i; // r6
_BYTE *v98; // r0
float v99; // s25
float v100; // s22
float v101; // r1
float v102; // r1
const cocos2d::CCPoint *v103; // r2
int v104; // r3
float v105; // s15
float v106; // s15
float v107; // r2
float v108; // r1
float v109; // r2
float v110; // s15
float v111; // r1
const cocos2d::CCPoint *v112; // r2
int v113; // r3
float v114; // s21
float v115; // r2
float v116; // r2
const cocos2d::CCPoint *v117; // r2
int v118; // r3
int v119; // r2
cocos2d *v120; // r7
int v121; // r3
int v122; // r3
float v123; // s24
float v124; // r8
float v125; // r1
float v126; // r1
const cocos2d::CCPoint *v127; // r2
float v128; // r1
float v129; // r1
const cocos2d::CCPoint *v130; // r2
int v131; // r3
int v132; // r3
_DWORD *v133; // r2
int *v134; // r6
unsigned int v135; // r2
int v136; // r9
int v137; // t1
int v138; // s24
float v139; // r2
float v140; // r2
int v141; // r1
int v142; // r0
int v143; // r0
float v144; // s21
int v145; // r11
float v146; // r2
int v147; // r11
float v148; // r2
float v149; // r1
float v150; // r1
const cocos2d::CCPoint *v151; // r2
const cocos2d::CCPoint *v152; // r8
float v153; // r2
float v154; // r2
const cocos2d::CCPoint *v155; // r2
float v156; // r1
float v157; // r1
const cocos2d::CCPoint *v158; // r2
float v159; // s21
int v160; // r2
int v161; // r7
float v162; // s23
int LastGameplayRotated; // r10
LevelTools *v164; // r0
float v165; // s15
int v166; // r8
int v167; // r9
int v168; // r8
float v169; // r2
float v170; // s15
int v171; // r8
float v172; // r2
unsigned __int8 v173; // [sp+0h] [bp-6Ch]
unsigned __int8 v174; // [sp+0h] [bp-6Ch]
GameManager *GameVariable; // [sp+1Ch] [bp-50h]
int v176; // [sp+20h] [bp-4Ch]
int v177; // [sp+24h] [bp-48h]
int v178; // [sp+24h] [bp-48h]
int v179; // [sp+28h] [bp-44h]
int v180; // [sp+28h] [bp-44h]
int v181; // [sp+28h] [bp-44h]
int v182; // [sp+28h] [bp-44h]
int v183; // [sp+28h] [bp-44h]
int v184; // [sp+28h] [bp-44h]
int v185; // [sp+28h] [bp-44h]
int *v186; // [sp+28h] [bp-44h]
int v187; // [sp+28h] [bp-44h]
int v188; // [sp+28h] [bp-44h]
int v189; // [sp+30h] [bp-3Ch]
int v190; // [sp+30h] [bp-3Ch]
int v191; // [sp+30h] [bp-3Ch]
char v192[8]; // [sp+3Ch] [bp-30h] BYREF
float v193; // [sp+44h] [bp-28h] BYREF
float v194; // [sp+48h] [bp-24h]
float v195; // [sp+4Ch] [bp-20h] BYREF
float v196; // [sp+50h] [bp-1Ch]
float v197; // [sp+54h] [bp-18h] BYREF
float v198; // [sp+58h] [bp-14h]
float v199; // [sp+5Ch] [bp-10h] BYREF
float v200; // [sp+60h] [bp-Ch]
v2 = *((_DWORD *)this + 93);
if ( !*(_DWORD *)(v2 + 11856) )
return;
v3 = *(_DWORD *)(v2 + 1428);
v4 = v3 == 1;
v5 = *(unsigned __int8 *)(v2 + 11693);
if ( *(_BYTE *)(v2 + 11693) )
{
if ( v3 == 1 )
v5 = *(unsigned __int8 *)(v2 + 11694) ^ 1;
else
v5 = 1;
}
v6 = *(unsigned __int8 *)(v2 + 11696);
if ( *(_BYTE *)(v2 + 11696) )
v6 = v3 != 1;
v177 = v6;
v7 = (GameManager *)GameManager::sharedState(this);
GameVariable = (GameManager *)GameManager::getGameVariable(v7, "0121");
v8 = (GameManager *)GameManager::sharedState(GameVariable);
v176 = GameManager::getGameVariable(v8, "0209");
if ( v177 )
{
if ( *((_BYTE *)this + 368) )
{
v10 = *((cocos2d::CCArray **)this + 99);
*((_BYTE *)this + 368) = 0;
if ( v10 )
{
if ( cocos2d::CCArray::count(v10) )
qsort(
*(void **)(*(_DWORD *)(*((_DWORD *)this + 99) + 52) + 12),
**(_DWORD **)(*((_DWORD *)this + 99) + 52),
4u,
(int (*)(const void *, const void *))xCompReal);
}
}
}
cocos2d::ccGLBlendFunc((cocos2d *)((char *)&dword_0 + 1), 0x303u, v9);
if ( *(_BYTE *)(*(_DWORD *)(*((_DWORD *)this + 93) + 2084) + 373) )
v11 = 1000;
else
v11 = 80;
v12 = (float)((float)v11 * 30.0) + 90.0;
cocos2d::ccDrawColor4B(nullptr, 0, 0, 0x96u, v173);
glLineWidth(1.0);
v179 = *(unsigned __int8 *)(*((_DWORD *)this + 93) + 11697);
v13 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 97) + 96))(*((_DWORD *)this + 97));
v14 = (cocos2d::CCDirector *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v192, v13);
cocos2d::CCDirector::sharedDirector(v14);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v193);
v15 = *((const cocos2d::CCPoint **)this + 97);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, 0.0, 0.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v199, v15);
v16 = v199;
v17 = v193;
*(float *)&v18 = COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 97) + 84))(*((_DWORD *)this + 97)));
v19 = *((const cocos2d::CCPoint **)this + 97);
v20 = *(float *)&v18;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, 0.0, 0.0);
v21 = 0;
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v199, v19);
v22 = v200;
v23 = v194;
v24 = (*(float (__fastcall **)(_DWORD))(**((_DWORD **)this + 97) + 84))(*((_DWORD *)this + 97));
v25 = *((float *)this + 111);
v26 = v16 + (float)(v17 / v20);
v27 = v22 + (float)(v23 / v24);
v28 = (int)floorf(v16 / v25);
v29 = (float)v28 * v25;
while ( v29 < v26 )
{
v29 = (float)v28 * *((float *)this + 111);
if ( v29 >= -3000.0 && v29 <= 240000.0 )
{
if ( v29 == 0.0 || v29 == 240000.0 )
{
cocos2d::ccDrawColor4B(
(cocos2d *)((char *)&dword_FC + 3),
(unsigned __int8)&dword_FC + 3,
(unsigned __int8)&dword_FC + 3,
0x96u,
v174);
if ( v22 > -3000.0 )
v30 = v22;
else
v30 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v29, v30);
if ( v12 > v27 )
v31 = v27;
else
v31 = v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v29, v31);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v32);
}
else if ( v5 && v21 <= 1197 )
{
v33 = *((_DWORD *)this + 79) + 8 * v21;
v34 = 8 * v21 + 8;
if ( v22 > -3000.0 )
v35 = v22;
else
v35 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, (float)v28 * *((float *)this + 111), v35);
v21 += 2;
cocos2d::CCPoint::operator=(v33, &v199);
v36 = v34 + *((_DWORD *)this + 79);
if ( v12 > v27 )
v37 = v27;
else
v37 = v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v29, v37);
cocos2d::CCPoint::operator=(v36, &v199);
}
}
++v28;
}
v38 = fmodf(90.0, *((float *)this + 111));
v39 = *((float *)this + 111);
v40 = v38;
v41 = floorf((float)(v22 - v38) / v39);
v42 = (int)v41;
v43 = v40 + (float)((float)(int)v41 * v39);
while ( v43 < v27 )
{
v43 = v40 + (float)((float)v42 * *((float *)this + 111));
if ( v43 >= -3000.0 && v43 <= v12 && v43 != 90.0 )
{
if ( v43 == v12 )
{
cocos2d::ccDrawColor4B(
(cocos2d *)((char *)&dword_FC + 3),
(unsigned __int8)&dword_FC + 3,
(unsigned __int8)&dword_FC + 3,
0x96u,
v174);
glLineWidth(2.0);
if ( v16 > -3000.0 )
v44 = v16;
else
v44 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v44, v43);
if ( v26 < 240000.0 )
v45 = v26;
else
v45 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v45, v43);
v41 = COERCE_FLOAT(cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v46));
}
else if ( v5 && v21 <= 1197 )
{
v47 = *((_DWORD *)this + 79) + 8 * v21;
v48 = 8 * v21 + 8;
if ( v16 > -3000.0 )
v49 = v16;
else
v49 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v49, v40 + (float)((float)v42 * *((float *)this + 111)));
v21 += 2;
cocos2d::CCPoint::operator=(v47, &v199);
v50 = v48 + *((_DWORD *)this + 79);
if ( v26 < 240000.0 )
v51 = v26;
else
v51 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v51, v43);
v41 = COERCE_FLOAT(cocos2d::CCPoint::operator=(v50, &v199));
}
}
++v42;
}
if ( v5 && v21 )
{
cocos2d::ccDrawColor4B(nullptr, 0, 0, 0x96u, v174);
glLineWidth(1.0);
v41 = COERCE_FLOAT(cocos2d::ccDrawLines(*((cocos2d **)this + 79), (const cocos2d::CCPoint *)v21, v52));
}
if ( !v179 && v22 <= 90.0 && v27 >= 90.0 )
{
cocos2d::ccDrawColor4B(
(cocos2d *)((char *)&dword_FC + 3),
(unsigned __int8)&dword_FC + 3,
(unsigned __int8)&dword_FC + 3,
0x96u,
v174);
glLineWidth(2.0);
if ( v16 > -3000.0 )
v53 = v16;
else
v53 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v53, 90.0);
if ( v26 < 240000.0 )
v54 = v26;
else
v54 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v54, 90.0);
v41 = COERCE_FLOAT(cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v55));
}
v56 = COERCE_FLOAT(GameManager::sharedState((GameManager *)LODWORD(v41)));
if ( *(_BYTE *)(LODWORD(v56) + 721) && *((_DWORD *)this + 98) )
{
v57 = 0;
v58 = 0;
v59 = 0;
v60 = 0;
while ( 1 )
{
v56 = COERCE_FLOAT(cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 98)));
if ( v57 >= LODWORD(v56) )
break;
v61 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 98), v57);
v56 = COERCE_FLOAT(cocos2d::CCString::floatValue(v61));
v62 = v56;
if ( v56 >= -3000.0 )
{
if ( v56 >= v16 && v56 <= v26 )
{
v63 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 98), v57 + 1);
v56 = COERCE_FLOAT(cocos2d::CCString::floatValue(v63));
if ( v56 == 0.9 )
{
if ( v59 <= 1197 )
{
v189 = 8 * v59;
if ( v22 > -3000.0 )
v64 = v22;
else
v64 = -3000.0;
v180 = *((_DWORD *)this + 80) + 8 * v59;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v62, v64);
v59 += 2;
cocos2d::CCPoint::operator=(v180, &v199);
if ( v12 > v27 )
v65 = v27;
else
v65 = v12;
v181 = v189 + 8 + *((_DWORD *)this + 80);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v62, v65);
v56 = COERCE_FLOAT(cocos2d::CCPoint::operator=(v181, &v199));
}
}
else if ( v56 == 1.0 )
{
if ( v58 <= 1197 )
{
v190 = 8 * v58;
if ( v22 > -3000.0 )
v66 = v22;
else
v66 = -3000.0;
v182 = *((_DWORD *)this + 81) + 8 * v58;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v62, v66);
v58 += 2;
cocos2d::CCPoint::operator=(v182, &v199);
if ( v12 > v27 )
v67 = v27;
else
v67 = v12;
v183 = v190 + 8 + *((_DWORD *)this + 81);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v62, v67);
v56 = COERCE_FLOAT(cocos2d::CCPoint::operator=(v183, &v199));
}
}
else if ( v60 <= 1197 )
{
v191 = 8 * v60;
if ( v22 > -3000.0 )
v68 = v22;
else
v68 = -3000.0;
v184 = *((_DWORD *)this + 79) + 8 * v60;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v62, v68);
v60 += 2;
cocos2d::CCPoint::operator=(v184, &v199);
if ( v12 > v27 )
v69 = v27;
else
v69 = v12;
v185 = v191 + 8 + *((_DWORD *)this + 79);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v62, v69);
v56 = COERCE_FLOAT(cocos2d::CCPoint::operator=(v185, &v199));
}
}
if ( v62 > v26 )
break;
}
v57 += 2;
}
if ( v60 )
{
cocos2d::ccDrawColor4B((cocos2d *)((char *)&dword_FC + 3), 0x7Fu, 0, (unsigned __int8)&dword_FC + 3, v174);
glLineWidth(1.0);
v56 = COERCE_FLOAT(cocos2d::ccDrawLines(*((cocos2d **)this + 79), (const cocos2d::CCPoint *)v60, v70));
}
if ( v59 )
{
cocos2d::ccDrawColor4B(
(cocos2d *)((char *)&dword_FC + 3),
(unsigned __int8)&dword_FC + 3,
0,
(unsigned __int8)&dword_FC + 3,
v174);
glLineWidth(1.0);
v56 = COERCE_FLOAT(cocos2d::ccDrawLines(*((cocos2d **)this + 80), (const cocos2d::CCPoint *)v59, v71));
}
if ( v58 )
{
cocos2d::ccDrawColor4B((cocos2d *)((char *)&dword_7C + 3), 0xFFu, 0, 0xFFu, v174);
glLineWidth(1.0);
v56 = COERCE_FLOAT(cocos2d::ccDrawLines(*((cocos2d **)this + 81), (const cocos2d::CCPoint *)v58, v72));
}
}
if ( *(_BYTE *)(GameManager::sharedState((GameManager *)LODWORD(v56)) + 722) )
{
v73 = 0;
v74 = *((_DWORD **)this + 84);
v75 = 0;
while ( v74 )
{
v76 = v74[3];
if ( !*(_BYTE *)(v76 + 1660) )
{
v77 = *(_DWORD *)(v76 + 1648);
if ( v77 > 0
&& ((!GameVariable || !*(_BYTE *)(v76 + 1114)) && (!v176 || !*(_BYTE *)(v76 + 1095)) || *(_BYTE *)(v76 + 989)) )
{
v78 = *((float *)this + 106);
switch ( *(_DWORD *)(v76 + 1656) )
{
case 1:
v78 = *((float *)this + 105);
break;
case 2:
v78 = *((float *)this + 107);
break;
case 3:
v78 = *((float *)this + 108);
break;
case 4:
v78 = *((float *)this + 109);
break;
default:
break;
}
v79 = *(_DWORD *)(v76 + 1652);
if ( v79 > 0 )
v77 *= v79;
v80 = (float)v77;
v81 = (float *)(*(int (__fastcall **)(_DWORD))(*(_DWORD *)v76 + 96))(v74[3]);
v82 = 60.0 / v80;
v83 = *v81;
v84 = *v81 + (float)(v78 * *(float *)(v76 + 1272));
if ( v26 <= v84 )
v84 = v26;
v85 = v82 * v78;
if ( *v81 < v16 )
{
v138 = (int)ceilf((float)(v16 - v83) / v85);
v83 = v83 + (float)((float)v138 * v85);
}
else
{
v138 = 0;
}
while ( v83 < v84 )
{
if ( v22 > -3000.0 )
v139 = v22;
else
v139 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v83, v139);
if ( v12 > v27 )
v140 = v27;
else
v140 = v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v83, v140);
v141 = *(_DWORD *)(v76 + 1652);
if ( v141 > 0 && v138 % v141 )
{
if ( v73 <= 1197 )
{
v188 = 8 * v73;
v143 = *((_DWORD *)this + 80) + 8 * v73;
v73 += 2;
cocos2d::CCPoint::operator=(v143, &v197);
cocos2d::CCPoint::operator=(*((_DWORD *)this + 80) + v188 + 8, &v199);
}
}
else if ( v75 <= 1197 )
{
v187 = 8 * v75;
v142 = *((_DWORD *)this + 79) + 8 * v75;
v75 += 2;
cocos2d::CCPoint::operator=(v142, &v197);
cocos2d::CCPoint::operator=(*((_DWORD *)this + 79) + v187 + 8, &v199);
}
v83 = v83 + v85;
++v138;
}
}
}
v74 = (_DWORD *)*v74;
}
if ( v75 )
{
cocos2d::ccDrawColor4B(
(cocos2d *)((char *)&dword_FC + 3),
(unsigned __int8)&dword_FC + 3,
0,
(unsigned __int8)&dword_FC + 3,
v174);
glLineWidth(1.0);
cocos2d::ccDrawLines(*((cocos2d **)this + 79), (const cocos2d::CCPoint *)v75, v86);
}
if ( v73 )
{
cocos2d::ccDrawColor4B((cocos2d *)((char *)&dword_FC + 3), 0x7Fu, 0, (unsigned __int8)&dword_FC + 3, v174);
glLineWidth(1.0);
cocos2d::ccDrawLines(*((cocos2d **)this + 80), (const cocos2d::CCPoint *)v73, v87);
}
}
glLineWidth(1.0);
if ( v177 )
{
if ( v4 )
goto LABEL_170;
cocos2d::ccDrawColor4B(nullptr, 0xFFu, 0xFFu, 0x96u, v174);
v88 = *((_DWORD *)this + 99);
if ( v88 )
{
v89 = *(_DWORD **)(v88 + 52);
if ( *v89 )
{
v90 = -1.0;
v91 = (GameObject **)v89[3];
v92 = &v91[*v89] + 0x3FFFFFFF;
v93 = 0;
while ( v91 <= v92 )
{
v96 = *v91++;
v95 = v96;
if ( !v96 )
break;
v144 = *(float *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)v95 + 96))(v95);
if ( v144 < v16 || v144 > v26 )
{
if ( v144 > v26 )
break;
}
else if ( (!GameObject::getGroupDisabled(v95)
&& (!GameVariable || !*((_BYTE *)v95 + 1114))
&& (!v176 || !*((_BYTE *)v95 + 1095))
|| *((_BYTE *)v95 + 989))
&& !*((_BYTE *)v95 + 1292)
&& !*((_BYTE *)v95 + 1293)
&& v144 > v90 )
{
if ( v93 <= 1197 )
{
v178 = *((_DWORD *)this + 79) + 8 * v93;
v145 = 8 * v93 + 8;
if ( v22 > -3000.0 )
v146 = v22;
else
v146 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v144, v146);
v93 += 2;
cocos2d::CCPoint::operator=(v178, &v199);
v147 = v145 + *((_DWORD *)this + 79);
if ( v12 > v27 )
v148 = v27;
else
v148 = v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v144, v148);
cocos2d::CCPoint::operator=(v147, &v199);
}
v90 = v144;
}
}
if ( v93 )
{
cocos2d::ccDrawColor4B(nullptr, 0xFFu, 0xFFu, 0x96u, v174);
cocos2d::ccDrawLines(*((cocos2d **)this + 79), (const cocos2d::CCPoint *)v93, v94);
}
}
}
}
else if ( v4 )
{
goto LABEL_170;
}
glLineWidth(2.0);
cocos2d::ccDrawColor4B(nullptr, 0xFFu, 0xFFu, 0xFFu, v174);
for ( i = 0; i < cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 100)); ++i )
{
v98 = (_BYTE *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 100), i);
if ( (!GameVariable || !v98[1114]) && (!v176 || !v98[1095]) || v98[989] )
{
DrawGridLayer::getPortalMinMax((DrawGridLayer *)&v195, this, (int)v98);
v99 = v195;
v100 = v196;
if ( v195 >= -3000.0 && v195 <= v12 )
{
if ( v16 > -3000.0 )
v101 = v16;
else
v101 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v101, v195);
if ( v26 < 240000.0 )
v102 = v26;
else
v102 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v102, v99);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v103);
}
if ( v100 >= -3000.0 && v100 <= v12 )
{
if ( v16 > -3000.0 )
v149 = v16;
else
v149 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v149, v100);
if ( v26 < 240000.0 )
v150 = v26;
else
v150 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v150, v100);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v151);
}
}
}
LABEL_170:
v104 = *((_DWORD *)this + 93);
if ( !*(_DWORD *)(v104 + 1428) )
{
if ( *(_BYTE *)(*(_DWORD *)(v104 + 11856) + 492) )
{
cocos2d::ccDrawColor4B((cocos2d *)&word_32, 0xFFu, (unsigned __int8)&word_32, 0xFFu, v174);
glLineWidth(5.0);
LevelTools::posForTimeInternal(
(LevelTools *)&v199,
*((float *)this + 88),
*((cocos2d::CCArray **)this + 101),
*(LevelTools **)(*(_DWORD *)(*((_DWORD *)this + 93) + 2084) + 272),
*(_BYTE *)(*(_DWORD *)(*((_DWORD *)this + 93) + 2084) + 281),
1,
1,
(int *)(*((_DWORD *)this + 93) + 736),
0);
if ( v199 <= 0.0 )
{
v105 = v200;
if ( v200 > 0.0 )
{
*((_DWORD *)this + 90) = 0;
*((float *)this + 91) = v105;
}
}
else
{
*((float *)this + 90) = v199;
*((_DWORD *)this + 91) = 0;
}
}
else
{
cocos2d::ccDrawColor4B((cocos2d *)&word_32, 0xFFu, (unsigned __int8)&word_32, 0x64u, v174);
glLineWidth(3.0);
*((_DWORD *)this + 87) = -1082130432;
}
v106 = *((float *)this + 90);
if ( v106 <= 0.0 || v106 < v16 || v106 > v26 )
{
v110 = *((float *)this + 91);
if ( v110 <= 0.0 || v110 < v22 || v110 > v27 )
goto LABEL_196;
if ( v16 > -3000.0 )
v111 = v16;
else
v111 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v111, *((float *)this + 91));
v109 = *((float *)this + 91);
if ( v26 < 240000.0 )
v108 = v26;
else
v108 = 240000.0;
}
else
{
if ( v22 > -3000.0 )
v107 = v22;
else
v107 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, *((float *)this + 90), v107);
v108 = *((float *)this + 90);
if ( v12 > v27 )
v109 = v27;
else
v109 = v12;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v108, v109);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v112);
LABEL_196:
v113 = *((_DWORD *)this + 93);
v114 = *(float *)(v113 + 12028);
if ( (v114 != 0.0 || *(float *)(v113 + 12032) != 0.0) && v114 > 0.0 && v114 >= v16 && v114 <= v26 )
{
cocos2d::ccDrawColor4B((cocos2d *)((char *)&dword_FC + 3), 0x96u, 0, (unsigned __int8)&dword_FC + 3, v174);
glLineWidth(2.0);
if ( v22 > -3000.0 )
v115 = v22;
else
v115 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v114, v115);
if ( v12 > v27 )
v116 = v27;
else
v116 = v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v114, v116);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v117);
}
goto LABEL_209;
}
*((_DWORD *)this + 90) = 0;
*((_DWORD *)this + 91) = 0;
LABEL_209:
v118 = *((_DWORD *)this + 93);
if ( *(_DWORD *)(v118 + 1428) != 1 )
{
if ( *(_BYTE *)(v118 + 11885) )
{
if ( !*(_BYTE *)(v118 + 11695) )
{
v119 = *(_DWORD *)(v118 + 11856);
v120 = (cocos2d *)*(unsigned __int8 *)(v119 + 1053);
if ( !*(_BYTE *)(v119 + 1053) )
{
v152 = *(const cocos2d::CCPoint **)(v118 + 2436);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v199,
v193 * 0.5,
(float)(*(float *)(v119 + 632) * 0.5) + (float)(v194 * 0.5));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v195, v152);
cocos2d::ccDrawColor4B(v120, (unsigned __int8)v120, (unsigned __int8)v120, 0x32u, v174);
glLineWidth(2.0);
if ( v22 > -3000.0 )
v153 = v22;
else
v153 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v195, v153);
if ( v12 > v27 )
v154 = v27;
else
v154 = v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v195, v154);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v155);
if ( v16 > -3000.0 )
v156 = v16;
else
v156 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v156, v196);
if ( v26 < 240000.0 )
v157 = v26;
else
v157 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v157, v196);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v158);
}
}
}
}
v121 = *((_DWORD *)this + 93);
if ( *(_DWORD *)(v121 + 1428) )
{
if ( *(_BYTE *)(v121 + 866)
|| PlayerObject::isFlying(*(PlayerObject **)(v121 + 2076))
|| (v122 = *(_DWORD *)(*((_DWORD *)this + 93) + 2076), *(_BYTE *)(v122 + 1955))
|| *(_BYTE *)(v122 + 1958) )
{
v123 = COERCE_FLOAT(GJBaseGameLayer::getMinPortalY(*((GJBaseGameLayer **)this + 93)));
v124 = COERCE_FLOAT(GJBaseGameLayer::getMaxPortalY(*((GJBaseGameLayer **)this + 93)));
glLineWidth(2.0);
cocos2d::ccDrawColor4B((cocos2d *)((char *)&dword_FC + 3), 0xAFu, 0x32u, (unsigned __int8)&dword_FC + 3, v174);
if ( v123 != 90.0 )
{
if ( v16 > -3000.0 )
v125 = v16;
else
v125 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v125, v123);
if ( v26 < 240000.0 )
v126 = v26;
else
v126 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v126, v123);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v127);
}
if ( v16 > -3000.0 )
v128 = v16;
else
v128 = -3000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, v128, v124);
if ( v26 < 240000.0 )
v129 = v26;
else
v129 = 240000.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v129, v124);
cocos2d::ccDrawLine((cocos2d *)&v197, (const cocos2d::CCPoint *)&v199, v130);
}
}
if ( !v4 )
{
v131 = *((_DWORD *)this + 93);
if ( *(_BYTE *)(v131 + 11698) )
{
v132 = *(_DWORD *)(v131 + 11724);
if ( v132 )
{
v133 = *(_DWORD **)(v132 + 52);
if ( *v133 )
{
v134 = (int *)v133[3];
v186 = &v134[*v133 - 1];
while ( v134 <= v186 )
{
v137 = *v134++;
v136 = v137;
if ( !v137 )
break;
if ( (!GameVariable || !*(_BYTE *)(v136 + 1114)) && (!v176 || !*(_BYTE *)(v136 + 1095))
|| *(_BYTE *)(v136 + 989) )
{
if ( *((_BYTE *)this + 440) )
cocos2d::CCPoint::operator=(v136 + 1616, &flt_D2B8B8);
v159 = *(float *)(v136 + 1272);
v160 = *(_DWORD *)(v136 + 892);
if ( v160 == 1006 )
{
v159 = (float)(*(float *)(v136 + 1412) + *(float *)(v136 + 1416)) + *(float *)(v136 + 1420);
}
else if ( v160 == 3602 )
{
v159 = *(float *)(v136 + 1772);
}
if ( v159 > 0.0 )
{
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v136 + 680))(&v195, v136);
if ( v195 <= v26 && v196 <= v12 && (!*(_BYTE *)(v136 + 550) || *(_BYTE *)(v136 + 989)) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v197, (const cocos2d::CCPoint *)(v136 + 1616));
v161 = *(unsigned __int8 *)(v136 + 1293);
if ( *(_BYTE *)(v136 + 1293) )
{
v198 = v196;
v197 = v195 + (float)(v159 * 311.58);
}
else if ( v197 == 0.0 && v198 == 0.0 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, (const cocos2d::CCPoint *)&v195);
v162 = COERCE_FLOAT(
LevelTools::timeForPos(
&v199,
*((cocos2d::CCArray **)this + 101),
*(LevelTools **)(*(_DWORD *)(*((_DWORD *)this + 93) + 2084) + 272),
*(_DWORD *)(v136 + 1588),
*(_DWORD *)(v136 + 1592),
v161,
*(_BYTE *)(*(_DWORD *)(*((_DWORD *)this + 93) + 2084) + 281),
1,
v161,
v161));
LastGameplayRotated = LevelTools::getLastGameplayRotated((LevelTools *)LODWORD(v162));
LevelTools::posForTimeInternal(
(LevelTools *)&v199,
v162 + v159,
*((cocos2d::CCArray **)this + 101),
*(LevelTools **)(*(_DWORD *)(*((_DWORD *)this + 93) + 2084) + 272),
*(_BYTE *)(*(_DWORD *)(*((_DWORD *)this + 93) + 2084) + 281),
v161,
1,
(int *)(*((_DWORD *)this + 93) + 736),
v161);
v164 = (LevelTools *)cocos2d::CCPoint::operator=(&v197, &v199);
if ( LastGameplayRotated == LevelTools::getLastGameplayRotated(v164) )
{
if ( LastGameplayRotated )
v197 = v195;
else
v198 = v196;
}
cocos2d::CCPoint::operator=(v136 + 1616, &v197);
}
if ( v197 >= v16 && v198 >= v22 && v4 <= 1197 )
{
v165 = v195;
v166 = 8 * v4;
v4 += 2;
v167 = *((_DWORD *)this + 79) + v166;
v168 = v166 + 8;
if ( v16 >= v195 )
v165 = v16;
if ( v22 < v196 )
v169 = v196;
else
v169 = v22;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v165, v169);
cocos2d::CCPoint::operator=(v167, &v199);
v170 = v197;
v171 = v168 + *((_DWORD *)this + 79);
if ( v26 <= v197 )
v170 = v26;
if ( v27 > v198 )
v172 = v198;
else
v172 = v27;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v199, v170, v172);
cocos2d::CCPoint::operator=(v171, &v199);
}
}
}
}
}
if ( v4 )
{
glLineWidth(2.0);
cocos2d::ccDrawColor4B(
(cocos2d *)&dword_64,
(unsigned __int8)&dword_64,
(unsigned __int8)&dword_64,
0x4Bu,
v174);
cocos2d::ccDrawLines(*((cocos2d **)this + 79), (const cocos2d::CCPoint *)v4, v135);
}
}
}
}
}
glLineWidth(1.0);
*((_BYTE *)this + 440) = 0;
}