//
// CCSpriteGrayscale::createWithSpriteFrameName from 0x14004d150 to 0x14004d247 (247 bytes)
//
// 12 xrefs:
// > sub_14006C4D0 @ 0x14006c53d
// > CreatorLayer::init @ 0x140135af7
// > GauntletSprite::addLockedSprite @ 0x1402fd35a
// > GJPathPage::init @ 0x140393560
// > GJPathPage::init @ 0x140393c3e
// > GJPathSprite::changeToLockedArt @ 0x1403972ca
// > LevelAreaInnerLayer::init @ 0x1403e056c
// > LevelListLayer::updateStatsArt @ 0x14042db0c
// > ProfilePage::loadPageFromUserInfo @ 0x140554ae9
// > RewardUnlockLayer::init @ 0x140563ae8
// > SecretLayer5::init @ 0x140589f72
// > ??> @ 0x14091010c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 11:25:33 +0000
//
cocos2d::CCSprite *__fastcall CCSpriteGrayscale::createWithSpriteFrameName(__int64 a1)
{
const char *v1; // rbx
cocos2d::CCSpriteFrameCache *v2; // rax
cocos2d::CCSpriteFrame *v3; // rdi
cocos2d::CCSprite *v4; // rax
cocos2d::CCSprite *v5; // rbx
__int64 (__fastcall *v6)(__int64 *, 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 = (cocos2d::CCSprite *)operator new(0x298u, (const struct std::nothrow_t *)&unk_1406ED620);
v5 = v4;
if ( v4 )
{
memset(v4, 0, 0x298u);
cocos2d::CCSprite::CCSprite(v5);
*(_QWORD *)v5 = &CCSpriteGrayscale::`vftable';
*((_QWORD *)v5 + 40) = &CCSpriteGrayscale::`vftable';
*((_QWORD *)v5 + 43) = &CCSpriteGrayscale::`vftable';
}
else
{
v5 = nullptr;
}
if ( v5 )
{
if ( v3 )
{
v6 = *(__int64 (__fastcall **)(__int64 *, cocos2d::CCSpriteFrame *))(*(_QWORD *)v5 + 912LL);
if ( v6 == CCSpriteWithHue::initWithSpriteFrame
? CCSpriteWithHue::initWithSpriteFrame((__int64 *)v5, v3)
: (unsigned __int8)v6((__int64 *)v5, v3) )
{
cocos2d::CCObject::autorelease(v5);
return v5;
}
}
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(*(_QWORD *)v5 + 8LL))(v5, 1);
}
return nullptr;
}