//
// GJChestSprite::create from 0x1403d15e0 to 0x1403d16a2 (194 bytes)
//
// 16 xrefs:
// > DailyLevelNode::init @ 0x1400d2bcd
// > FollowRewardPage::init @ 0x14013b5eb
// > GauntletNode::generateNode @ 0x1401fd6bc
// > GauntletNode::generateNode @ 0x1401fd729
// > GauntletNode::generateNode @ 0x1401fd903
// > GauntletNode::generateNode @ 0x1401fd96f
// > GJPathRewardPopup::init @ 0x14028a22b
// > GJPathRewardPopup::init @ 0x14028a298
// > RewardUnlockLayer::init @ 0x1403ce432
// > SecretRewardsLayer::init @ 0x1403d3340
// > SecretRewardsLayer::init @ 0x1403d3ae6
// > SecretRewardsLayer::generateChestItems @ 0x1403d5e44
// > SecretLayer3::init @ 0x1403eae4a
// > SecretLayer3::init @ 0x1403eb156
// > SecretLayer4::init @ 0x1403f0a42
// > ??> @ 0x1406d7c70
//
// 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
//
// Hidden C++ exception states: #wind=1
GJChestSprite *GJChestSprite::create(int a1)
{
GJChestSprite *v2; // rbx
bool v3; // al
GJChestSprite_vtbl *v4; // r8
v2 = (GJChestSprite *)operator new(0x268u);
cocos2d::CCSprite::CCSprite(v2);
v2->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (GJChestSprite_vtbl *)&GJChestSprite::`vftable';
v2->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&GJChestSprite::`vftable';
v2->cocos2d::CCSprite::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCTextureProtocol_vtbl *)&GJChestSprite::`vftable';
*(_QWORD *)&v2->m_chestType = 0;
v2->m_dark = 0;
v3 = cocos2d::CCSprite::init(v2);
v4 = v2->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v3 )
{
v2->m_chestType = a1;
v4->setContentSize(v2, &stru_1406C2568);
GJChestSprite::switchToState(v2, Closed, 0);
cocos2d::CCObject::autorelease(v2);
return v2;
}
else
{
((void (__fastcall *)(GJChestSprite *, __int64))v4->~GJChestSprite)(v2, 1);
return nullptr;
}
}