//
// png_set_palette_to_rgb from 0x6594fc to 0x659528 (44 bytes)
//
// 1 xrefs:
// > cocos2d::CCImage::_initWithPngData @ 0x5e1b7a
//
// 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
//
int __fastcall png_set_palette_to_rgb(int result)
{
int v1; // r1
int v2; // r3
if ( result )
{
v1 = *(_DWORD *)(result + 312);
if ( (v1 & 0x40) != 0 )
{
return png_app_error(result, "invalid after png_start_read_image or png_read_update_info");
}
else
{
v2 = *(_DWORD *)(result + 316);
*(_DWORD *)(result + 312) = v1 | 0x4000;
*(_DWORD *)(result + 316) = v2 | 0x2001000;
}
}
return result;
}