//
// PlayerObject::updateGlowColor from 0x438358 to 0x438728 (976 bytes)
//
// 4 xrefs:
// > MenuGameLayer::resetPlayer @ 0x492682
// > MenuGameLayer::init @ 0x4931f8
// > GJBaseGameLayer::createPlayer @ 0x5a5440
// > GJBaseGameLayer::createPlayer @ 0x5a55d0
//
// 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:20 +0000
//
int __fastcall PlayerObject::updateGlowColor(PlayerObject *this)
{
int v2; // r0
__int16 v3; // r2
unsigned __int8 v4; // r3
int v5; // r0
unsigned __int8 *v6; // r0
int v7; // r3
int v8; // r1
int v9; // r5
int v10; // r2
unsigned __int8 v11; // r0
int v12; // r7
__int16 v13; // r1
unsigned __int8 v14; // r3
float *v15; // r5
int v16; // r0
char v17; // r3
int v18; // r0
int v19; // r0
int v20; // r11
int v21; // r10
int v22; // r9
int v23; // r3
float v24; // s15
int v25; // r11
int v26; // s18
int v27; // s15
int v28; // r10
int *v29; // r0
int v30; // r2
void (__fastcall *v31)(int *, float *); // r2
float v32; // r1
float v33; // r2
float v34; // r3
int v35; // r0
char *v36; // r1
int v37; // r5
int v38; // r8
void (__fastcall *v39)(int, int); // r9
int v40; // r1
__int16 v41; // r2
char v42; // r3
int v43; // r0
char *v44; // r1
unsigned __int8 v46[4]; // [sp+4h] [bp-40h] BYREF
int v47; // [sp+8h] [bp-3Ch] BYREF
float v48[4]; // [sp+Ch] [bp-38h] BYREF
float v49[4]; // [sp+1Ch] [bp-28h] BYREF
float v50[3]; // [sp+2Ch] [bp-18h] BYREF
float v51; // [sp+38h] [bp-Ch]
v2 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 373) + 472))(*((_DWORD *)this + 373));
v3 = *(_WORD *)v2;
v4 = *(_BYTE *)(v2 + 2);
v5 = *((_DWORD *)this + 374);
*(_WORD *)v46 = v3;
v46[2] = v4;
v6 = (unsigned __int8 *)(*(int (__fastcall **)(int))(*(_DWORD *)v5 + 472))(v5);
v7 = *v6;
v8 = v6[1];
v9 = v6[2];
LOWORD(v6) = *(_WORD *)v46;
*((_BYTE *)this + 1892) = v46[2];
v10 = v46[0];
*((_WORD *)this + 945) = (_WORD)v6;
*((_BYTE *)this + 1893) = v7;
*((_BYTE *)this + 1894) = v8;
*((_BYTE *)this + 1895) = v9;
if ( v10 || *(_WORD *)&v46[1] )
{
if ( v7 || v8 || v9 )
{
v11 = v46[2];
*((_WORD *)this + 1053) = *(_WORD *)v46;
v12 = 0;
*((_BYTE *)this + 2108) = v11;
*((_BYTE *)this + 2109) = v7;
*((_BYTE *)this + 2110) = v8;
*((_BYTE *)this + 2111) = v9;
}
else
{
v13 = *(_WORD *)v46;
v12 = 0;
v14 = v46[2];
*((_WORD *)this + 1053) = *(_WORD *)v46;
*((_BYTE *)this + 2108) = v14;
*(_WORD *)((char *)this + 2109) = v13;
*((_BYTE *)this + 2111) = v14;
}
}
else
{
if ( v7 || v8 || v9 )
{
*((_BYTE *)this + 2106) = v7;
*((_BYTE *)this + 2107) = v8;
*((_BYTE *)this + 2108) = v9;
*((_BYTE *)this + 2109) = v7;
*((_BYTE *)this + 2110) = v8;
*((_BYTE *)this + 2111) = v9;
}
else
{
*((_WORD *)this + 1053) = -1;
*(_WORD *)((char *)this + 2109) = -1;
*((_BYTE *)this + 2108) = -1;
*((_BYTE *)this + 2111) = -1;
}
v12 = 1;
}
v15 = v48;
v16 = GameToolbox::strongColor(*((unsigned __int16 *)this + 1053) | (*((unsigned __int8 *)this + 2108) << 16));
v17 = BYTE1(v16);
*((_BYTE *)this + 2106) = v16;
*((_BYTE *)this + 2108) = BYTE2(v16);
v18 = *((unsigned __int8 *)this + 2110);
*((_BYTE *)this + 2107) = v17;
v19 = GameToolbox::strongColor(*((unsigned __int8 *)this + 2109) | (v18 << 8) | (*((unsigned __int8 *)this + 2111) << 16));
v20 = *((unsigned __int8 *)this + 2106);
v21 = *((unsigned __int8 *)this + 2107);
v22 = *((unsigned __int8 *)this + 2108);
*(_WORD *)((char *)this + 2109) = v19;
*((_BYTE *)this + 2111) = BYTE2(v19);
memset(v48, 0, sizeof(v48));
v23 = *((unsigned __int8 *)this + 2111);
v24 = (float)v20;
v25 = *((unsigned __int8 *)this + 2109);
v48[3] = 1.0;
v26 = v23;
v48[0] = v24 / 255.0;
v27 = v21;
v28 = *((unsigned __int8 *)this + 2110);
v48[1] = (float)v27 / 255.0;
v48[2] = (float)v22 / 255.0;
memset(v49, 0, sizeof(v49));
v29 = *((int **)this + 436);
v30 = *v29;
v49[3] = 1.0;
v31 = *(void (__fastcall **)(int *, float *))(v30 + 680);
v49[0] = (float)v25 / 255.0;
v49[1] = (float)v28 / 255.0;
v49[2] = (float)v26 / 255.0;
v31(v29, v48);
(*(void (__fastcall **)(_DWORD, float *))(**((_DWORD **)this + 446) + 680))(*((_DWORD *)this + 446), v48);
(*(void (__fastcall **)(_DWORD, float *))(**((_DWORD **)this + 447) + 680))(*((_DWORD *)this + 447), v48);
(*(void (__fastcall **)(_DWORD, float *))(**((_DWORD **)this + 440) + 680))(*((_DWORD *)this + 440), v48);
(*(void (__fastcall **)(_DWORD, float *))(**((_DWORD **)this + 440) + 696))(*((_DWORD *)this + 440), v48);
if ( !*((_BYTE *)this + 2154) )
v15 = v49;
v32 = v15[1];
v33 = v15[2];
v34 = v15[3];
v50[0] = *v15;
v50[1] = v32;
v50[2] = v33;
v51 = v34;
(*(void (__fastcall **)(_DWORD, float *))(**((_DWORD **)this + 442) + 680))(*((_DWORD *)this + 442), v50);
v35 = *((_DWORD *)this + 442);
v51 = v51 * 0.5;
(*(void (__fastcall **)(int, float *))(*(_DWORD *)v35 + 696))(v35, v50);
if ( !*((_BYTE *)this + 1808) )
(*(void (__fastcall **)(_DWORD, char *))(**((_DWORD **)this + 386) + 480))(
*((_DWORD *)this + 386),
(char *)this + 2109);
if ( *((_BYTE *)this + 1604) || *((_BYTE *)this + 1956) )
{
if ( *((_BYTE *)this + 1674) )
v36 = (char *)this + 2109;
else
v36 = (char *)v46;
(*(void (__fastcall **)(_DWORD, char *))(**((_DWORD **)this + 388) + 480))(*((_DWORD *)this + 388), v36);
}
*((_BYTE *)this + 1673) = v12;
if ( !v12 && !*((_BYTE *)this + 1482) )
goto LABEL_24;
if ( *((_BYTE *)this + 1957) )
{
v12 = 1;
LABEL_24:
v37 = 0;
goto LABEL_27;
}
v12 = 1;
if ( *((_BYTE *)this + 1958) )
goto LABEL_24;
v37 = 1;
LABEL_27:
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 376) + 172))(*((_DWORD *)this + 376), v37);
v38 = *((_DWORD *)this + 381);
v39 = *(void (__fastcall **)(int, int))(*(_DWORD *)v38 + 172);
if ( v37 )
v40 = (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 377) + 176))(*((_DWORD *)this + 377));
else
v40 = 0;
v39(v38, v40);
if ( *((_BYTE *)this + 1896) )
{
v41 = *(_WORD *)((char *)this + 1897);
v42 = *((_BYTE *)this + 1899);
}
else
{
v41 = *(_WORD *)((char *)this + 2109);
v42 = *((_BYTE *)this + 2111);
}
v43 = *((_DWORD *)this + 376);
LOWORD(v47) = v41;
BYTE2(v47) = v42;
(*(void (__fastcall **)(int, int *))(*(_DWORD *)v43 + 480))(v43, &v47);
(*(void (__fastcall **)(_DWORD, int *))(**((_DWORD **)this + 381) + 480))(*((_DWORD *)this + 381), &v47);
if ( v12 && (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 433) + 176))(*((_DWORD *)this + 433)) )
{
GJRobotSprite::showGlow(*((GJRobotSprite **)this + 433));
}
else
{
GJRobotSprite::hideGlow(*((GJRobotSprite **)this + 433));
if ( !v12 )
goto LABEL_43;
}
if ( (*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 434) + 176))(*((_DWORD *)this + 434)) )
{
GJRobotSprite::showGlow(*((GJRobotSprite **)this + 434));
goto LABEL_38;
}
LABEL_43:
GJRobotSprite::hideGlow(*((GJRobotSprite **)this + 434));
LABEL_38:
GJRobotSprite::updateGlowColor(*((_DWORD *)this + 433), v47, 0);
GJRobotSprite::updateGlowColor(*((_DWORD *)this + 434), v47, 0);
if ( *((_BYTE *)this + 2153) )
v44 = (char *)this + 2106;
else
v44 = (char *)this + 2109;
return (*(int (__fastcall **)(_DWORD, char *))(**((_DWORD **)this + 347) + 480))(*((_DWORD *)this + 347), v44);
}