//
// cocos2d::CCLayerRGBA::setOpacity from 0x7d75f8 to 0x7d764e (86 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCControlButton::setOpacity @ 0x7a8116
// > `non-virtual thunk to'cocos2d::CCLayerRGBA::setOpacity @ 0x7d765c
// > cocos2d::CCLayerColor::setOpacity @ 0x7d7664
//
// 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:00:40 +0000
//
int __fastcall cocos2d::CCLayerRGBA::setOpacity(int this, unsigned __int8 a2)
{
int v2; // r4
int v3; // r3
const void *v4; // r0
void *v5; // r0
void *v6; // r5
int v7; // r1
v2 = this;
v3 = *(unsigned __int8 *)(this + 328);
*(_BYTE *)(this + 321) = a2;
*(_BYTE *)(this + 320) = a2;
if ( v3 )
{
v4 = *(const void **)(this + 196);
if ( v4
&& (v5 = _dynamic_cast(
v4,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCRGBAProtocol,
-2),
(v6 = v5) != nullptr)
&& (*(int (__fastcall **)(void *))(*(_DWORD *)v5 + 44))(v5) )
{
v7 = (*(int (__fastcall **)(void *))(*(_DWORD *)v6 + 12))(v6);
}
else
{
v7 = 255;
}
return (*(int (__fastcall **)(int, int))(*(_DWORD *)v2 + 588))(v2, v7);
}
return this;
}