//
// ButtonSprite::updateBGImage from 0x10005f988 to 0x10005fa98 (272 bytes)
//
// 71 xrefs:
// > LevelInfoLayer::confirmOwnerDelete @ 0x100028998
// > SetupAreaMoveTriggerPopup::onMode @ 0x100035fd0
// > SetGroupIDLayer::updateZLayerButtons @ 0x10003deb4
// > CustomizeObjectLayer::onSelectMode @ 0x10004f5c0
// > CustomizeObjectLayer::onSelectMode @ 0x10004f5e0
// > CustomizeObjectLayer::onSelectMode @ 0x10004f604
// > CustomizeObjectLayer::highlightSelected @ 0x100050670
// > CustomizeObjectLayer::highlightSelected @ 0x100050698
// > MoreSearchLayer::onSongMode @ 0x100056c80
// > MoreSearchLayer::onSongMode @ 0x100056c98
// > RateStarsLayer::selectRating @ 0x1000808bc
// > ColorSelectLiveOverlay::onSelectTab @ 0x1000f6394
// > GJUserCell::onUnblockUser @ 0x1001116f0
// > GJUserCell::onCancelFriendRequest @ 0x1001117fc
// > GJUserCell::onRemoveFriend @ 0x10011198c
// > GJRequestCell::onDeleteRequest @ 0x1001120e8
// > GJMessageCell::onDeleteMessage @ 0x10011276c
// > CharacterColorPage::updateColorMode @ 0x10012a010
// > SongSelectNode::onSongMode @ 0x100147970
// > SongSelectNode::onSongMode @ 0x100147988
// > AccountLayer::onBackup @ 0x100165f18
// > AccountHelpLayer::onUnlink @ 0x10016753c
// > AccountHelpLayer::verifyUnlink @ 0x10016791c
// > LevelSettingsLayer::updateGameplayModeButtons @ 0x10017b534
// > LevelSettingsLayer::updateGameplayModeButtons @ 0x10017b564
// > SelectArtLayer::onSelectCustom @ 0x10017ce84
// > SetupAudioTriggerPopup::onProxMode @ 0x10017f0ec
// > SetupShaderEffectPopup::updateZLayerButtons @ 0x100189d2c
// > ProfilePage::onFriend @ 0x10019af6c
// > ProfilePage::onBlockUser @ 0x10019b194
// > HSVLiveOverlay::createHSVWidget @ 0x10019ffc0
// > GJSpecialColorSelect::highlightSelected @ 0x1001af628
// > GJSpecialColorSelect::highlightSelected @ 0x1001af660
// > GJRateLevelLayer::selectRating @ 0x1001b16f4
// > GJRateLevelLayer::onCustomButton @ 0x1001b1968
// > FRequestProfilePage::onDeleteSelected @ 0x1001b6bf0
// > MessagesProfilePage::onDeleteSelected @ 0x1001cca9c
// > SetupSequenceTriggerPopup::onSelect @ 0x1001d36e8
// > SetupSequenceTriggerPopup::onSelect @ 0x1001d3724
// > ShareLevelLayer::selectRating @ 0x100276174
// > CreateParticlePopup::onMode @ 0x1002cdd60
// > CreateParticlePopup::onMode @ 0x1002cdd80
// > CreateParticlePopup::onMode @ 0x1002cddac
// > CreateParticlePopup::onPage @ 0x1002cdfa4
// > FriendRequestPopup::onBlock @ 0x1002d9ca8
// > GJMessagePopup::onBlock @ 0x1002db42c
// > GJMessagePopup::onRemove @ 0x1002db548
// > GJWriteMessagePopup::onClearBody @ 0x1002dcde0
// > SetupGradientPopup::updateZLayerButtons @ 0x1003435f4
// > InfoLayer::init @ 0x100350d3c
// > InfoLayer::init @ 0x100350db8
// > InfoLayer::updateCommentModeButtons @ 0x100351ecc
// > InfoLayer::updateCommentModeButtons @ 0x100351ee4
// > LeaderboardsLayer::toggleTabButtons @ 0x1003b1cb4
// > SetupPulsePopup::onSelectTargetMode @ 0x1003b6198
// > SetupPulsePopup::onSelectTargetMode @ 0x1003b61b0
// > SetupPulsePopup::onSelectPulseMode @ 0x1003b6404
// > SetupPulsePopup::onSelectPulseMode @ 0x1003b6420
// > MusicBrowser::setupList @ 0x1003c26a0
// > MusicBrowser::setupList @ 0x1003c26c4
// > EditorUI::toggleSwipe @ 0x1003c7240
// > EditorUI::toggleFreeMove @ 0x1003c7340
// > EditorUI::toggleSnap @ 0x1003c73d0
// > EditorUI::toggleEnableRotate @ 0x1003c742c
// > EditorUI::toggleEnableRotate @ 0x1003c744c
// > EditorUI::updateDeleteButtons @ 0x1003e9530
// > EditorUI::updateDeleteButtons @ 0x1003e954c
// > EditorUI::updateDeleteButtons @ 0x1003e9568
// > EditorUI::updateDeleteButtons @ 0x1003e9584
// > LevelBrowserLayer::onDeleteSelected @ 0x100416050
// > FollowRewardPage::onSpecialItem @ 0x100425864
//
// 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
//
void __fastcall ButtonSprite::updateBGImage(ButtonSprite *a1, const char *a2)
{
cocos2d::extension::CCScale9Sprite *m_BGSprite; // x0
cocos2d::extension::CCScale9Sprite *v5; // x20
std::string *p_m_caption; // x1
cocos2d::CCSprite *m_subBGSprite; // x19
cocos2d::CCTextureCache *v8; // x0
cocos2d::CCTexture2D *v9; // x0
float v10[4]; // [xsp+0h] [xbp-20h] BYREF
cocos2d::CCRect v11; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
m_BGSprite = a1->m_BGSprite;
if ( m_BGSprite )
{
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *))m_BGSprite->removeMeAndCleanup)(m_BGSprite);
sub_100022990(v10, 0.0, 0.0, 40.0, 40.0);
v5 = cocos2d::extension::CCScale9Sprite::create(a2, v11);
a1->m_BGSprite = v5;
sub_100022988(v10, 16.0, 16.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, float *))v5->setContentSize)(v5, v10);
((void (__fastcall *)(ButtonSprite *, cocos2d::extension::CCScale9Sprite *, _QWORD))a1->addChild_0)(
a1,
a1->m_BGSprite,
0);
if ( a1->m_mode == 1 )
{
p_m_caption = &a1->m_caption;
if ( a1->m_caption.m_data.m_short.shortStorage.__elems_[22] < 0 )
p_m_caption = (std::string *)p_m_caption->m_data.m_long.capacitym1;
ButtonSprite::setString(a1, (const char *)p_m_caption);
}
else
{
ButtonSprite::updateSpriteBGSize(a1);
}
}
else
{
m_subBGSprite = a1->m_subBGSprite;
if ( m_subBGSprite )
{
v8 = cocos2d::CCTextureCache::sharedTextureCache();
v9 = cocos2d::CCTextureCache::addImage(v8, a2, 0);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCTexture2D *))m_subBGSprite->setTexture)(m_subBGSprite, v9);
}
}
}