//
// GJChestSprite::create from 0x10021cc80 to 0x10021cd29 (169 bytes)
//
// 15 xrefs:
// > RewardUnlockLayer::init @ 0x10021c537
// > DailyLevelNode::init @ 0x100232f5c
// > GJPathRewardPopup::init @ 0x100303242
// > GJPathRewardPopup::init @ 0x1003032ae
// > SecretLayer4::init @ 0x1003b16c0
// > FollowRewardPage::init @ 0x100420393
// > SecretLayer3::init @ 0x1004a463d
// > SecretLayer3::init @ 0x1004a48a0
// > GauntletNode::generateNode @ 0x100575388
// > GauntletNode::generateNode @ 0x1005753fa
// > GauntletNode::generateNode @ 0x100575631
// > GauntletNode::generateNode @ 0x1005756a3
// > SecretRewardsLayer::init @ 0x100630e17
// > SecretRewardsLayer::init @ 0x100631436
// > SecretRewardsLayer::generateChestItems @ 0x100634434
//
// 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
//
GJChestSprite *__fastcall GJChestSprite::create(int a1)
{
GJChestSprite *v1; // rbx
v1 = (GJChestSprite *)operator new(0x260u);
cocos2d::CCSprite::CCSprite(v1);
v1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (GJChestSprite_vtbl *)off_1008E06A0;
v1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)off_1008E0B78;
v1->cocos2d::CCSprite::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCTextureProtocol_vtbl *)off_1008E0BF8;
*(_QWORD *)&v1->m_chestType = 0;
v1->m_dark = 0;
if ( cocos2d::CCSprite::init(v1) )
{
v1->m_chestType = a1;
((void (__fastcall *)(GJChestSprite *, void *))v1->setContentSize)(v1, &unk_10099F3F8);
GJChestSprite::switchToState(v1, Closed, 0);
cocos2d::CCObject::autorelease(v1);
}
else
{
((void (__fastcall *)(GJChestSprite *))v1->~GJChestSprite_0)(v1);
return nullptr;
}
return v1;
}