//
// cocos2d::tgaRGBtogreyscale from 0x7f7e28 to 0x7f7eac (132 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 12:01:11 +0000
//
void __fastcall cocos2d::tgaRGBtogreyscale(int a1)
{
unsigned int v2; // r0
unsigned int v3; // r7
signed int v4; // r6
_BYTE *v5; // r0
_BYTE *v6; // r5
_BYTE *v7; // r1
int v8; // r2
int v9; // r3
int v10; // r0
int v11; // r3
v2 = *(unsigned __int8 *)(a1 + 5);
if ( v2 != 8 )
{
v3 = v2 >> 3;
v4 = *(__int16 *)(a1 + 8) * *(__int16 *)(a1 + 6);
v5 = malloc(v4);
v6 = v5;
if ( v5 )
{
v7 = v5;
v8 = 0;
while ( v7 - v6 < v4 )
{
v9 = *(_DWORD *)(a1 + 12);
v10 = *(unsigned __int8 *)(v9 + v8);
v11 = v9 + v8;
v8 += v3;
*v7++ = (unsigned int)((double)*(unsigned __int8 *)(v11 + 1) * 0.59
+ (double)v10 * 0.3
+ (double)*(unsigned __int8 *)(v11 + 2) * 0.11);
}
free(*(void **)(a1 + 12));
*(_DWORD *)(a1 + 12) = v6;
*(_BYTE *)(a1 + 5) = 8;
*(_BYTE *)(a1 + 4) = 3;
}
}
}