//
// cocos2d::CCMenuItemImage::initWithNormalImage from 0x1003c0470 to 0x1003c05a4 (308 bytes)
//
// 7 xrefs:
// > SliderThumb::create @ 0x1003036cd
// > SliderThumb::init @ 0x100303740
// > SliderTouchLogic::init @ 0x100303d0e
// > cocos2d::CCMenuItemImage::create_3 @ 0x1003c0632
// > cocos2d::CCMenuItemImage::create @ 0x1003c06ff
// > cocos2d::CCMenuItemImage::create_1 @ 0x1003c07d9
// > cocos2d::CCMenuItemImage::create_2 @ 0x1003c0898
//
// 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
//
bool __fastcall cocos2d::CCMenuItemImage::initWithNormalImage(
cocos2d::CCMenuItemImage *a1,
const char *a2,
const char *a3,
const char *a4,
cocos2d::CCObject *a5,
cocos2d::SEL_MenuHandler a6)
{
cocos2d::CCSprite *v9; // r15
cocos2d::CCSprite *v10; // r12
cocos2d::CCSprite *v11; // r13
cocos2d::CCNode *m_pNormalImage; // rdi
__int64 v13; // rax
float v15; // [rsp+8h] [rbp-48h] BYREF
cocos2d::SEL_MenuHandler v16; // [rsp+10h] [rbp-40h]
cocos2d::CCObject *v17; // [rsp+20h] [rbp-30h]
v17 = a5;
v16 = a6;
if ( a2 )
{
v9 = cocos2d::CCSprite::create_1(a2);
if ( a3 )
goto LABEL_3;
LABEL_6:
v10 = nullptr;
if ( a4 )
goto LABEL_4;
goto LABEL_7;
}
v9 = nullptr;
if ( !a3 )
goto LABEL_6;
LABEL_3:
v10 = cocos2d::CCSprite::create_1(a3);
if ( a4 )
{
LABEL_4:
v11 = cocos2d::CCSprite::create_1(a4);
goto LABEL_8;
}
LABEL_7:
v11 = nullptr;
LABEL_8:
sub_10028CBE0(&v15, 0.5, 0.5);
((void (__fastcall *)(cocos2d::CCMenuItemImage *, float *))a1->setAnchorPoint)(a1, &v15);
a1->m_pListener = v17;
a1->m_pfnSelector = v16;
*(_WORD *)&a1->m_bSelected = 256;
((void (__fastcall *)(cocos2d::CCMenuItemImage *, cocos2d::CCSprite *))a1->setNormalImage)(a1, v9);
((void (__fastcall *)(cocos2d::CCMenuItemImage *, cocos2d::CCSprite *))a1->setSelectedImage)(a1, v10);
((void (__fastcall *)(cocos2d::CCMenuItemImage *, cocos2d::CCSprite *))a1->setDisabledImage)(a1, v11);
m_pNormalImage = a1->m_pNormalImage;
if ( m_pNormalImage )
{
v13 = ((__int64 (__fastcall *)(cocos2d::CCNode *))m_pNormalImage->getContentSize)(m_pNormalImage);
((void (__fastcall *)(cocos2d::CCMenuItemImage *, __int64))a1->setContentSize)(a1, v13);
}
((void (__fastcall *)(cocos2d::CCMenuItemImage *, __int64))a1->setCascadeColorEnabled)(a1, 1);
((void (__fastcall *)(cocos2d::CCMenuItemImage *, __int64))a1->setCascadeOpacityEnabled)(a1, 1);
return 1;
}