//
// CCSpriteGrayscale::createWithSpriteFrameName from 0x140049090 to 0x140049184 (244 bytes)
//
// 11 xrefs:
// > CreatorLayer::init @ 0x14009c577
// > GauntletSprite::addLockedSprite @ 0x1401f857a
// > GJPathPage::init @ 0x140285831
// > GJPathPage::init @ 0x140285f02
// > GJPathSprite::changeToLockedArt @ 0x1402894ba
// > LevelAreaInnerLayer::init @ 0x1402c723f
// > LevelListLayer::updateStatsArt @ 0x140305cc2
// > ProfilePage::loadPageFromUserInfo @ 0x1403c1e92
// > RewardUnlockLayer::init @ 0x1403ce208
// > SecretLayer5::init @ 0x1403f490d
// > ??> @ 0x1406c4c20
//
// 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
//
CCSpriteWithHue *__fastcall CCSpriteGrayscale::createWithSpriteFrameName(__int64 a1)
{
const char *v1; // rbx
cocos2d::CCSpriteFrameCache *v2; // rax
cocos2d::CCSpriteFrame *v3; // rdi
CCSpriteWithHue *v4; // rax
CCSpriteWithHue *v5; // rbx
bool (*initWithSpriteFrame)(CCSpriteWithHue *, cocos2d::CCSpriteFrame *); // r8
v1 = (const char *)a1;
if ( *(_QWORD *)(a1 + 24) > 0xFu )
v1 = *(const char **)a1;
v2 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v3 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v2, v1);
v4 = (CCSpriteWithHue *)operator new(0x298u, (const struct std::nothrow_t *)&unk_1405188C0);
v5 = v4;
if ( v4 )
{
memset(v4, 0, sizeof(CCSpriteWithHue));
cocos2d::CCSprite::CCSprite(v5);
v5->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (CCSpriteWithHue_vtbl *)&CCSpriteGrayscale::`vftable';
v5->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&CCSpriteGrayscale::`vftable';
v5->cocos2d::CCSprite::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCTextureProtocol_vtbl *)&CCSpriteGrayscale::`vftable';
}
else
{
v5 = nullptr;
}
if ( v5 )
{
if ( v3 )
{
initWithSpriteFrame = (bool (*)(CCSpriteWithHue *, cocos2d::CCSpriteFrame *))v5->initWithSpriteFrame;
if ( initWithSpriteFrame == CCSpriteWithHue::initWithSpriteFrame
? CCSpriteWithHue::initWithSpriteFrame(v5, v3)
: initWithSpriteFrame(v5, v3) )
{
cocos2d::CCObject::autorelease(v5);
return v5;
}
}
((void (__fastcall *)(CCSpriteWithHue *, __int64))v5->~CCSpriteWithHue)(v5, 1);
}
return nullptr;
}