//
// ButtonSprite::updateBGImage from 0x140042fc0 to 0x1400430db (283 bytes)
//
// 114 xrefs:
// > AccountLayer::onBackup @ 0x140093a34
// > AccountHelpLayer::onUnlink @ 0x1400953cd
// > AccountHelpLayer::FLAlert_Clicked @ 0x1400958ec
// > CharacterColorPage::updateColorMode @ 0x1400a2484
// > CharacterColorPage::updateColorMode @ 0x1400a2551
// > CharacterColorPage::updateColorMode @ 0x1400a261e
// > ClearPlatformerSavesPopup::onDelete @ 0x1400a41ad
// > AccountReviewPopup::selectTab @ 0x1400b3081
// > AccountReviewPopup::confirmDeleteSelected @ 0x1400b9633
// > AccountReviewPopup::onDeleteRow @ 0x1400bb046
// > AccountReviewPopup::onDeleteFilterRow @ 0x1400bc486
// > ReportPopup::onSubmit @ 0x1400c1cec
// > SFXFolderPickerPopup::updateShareHint @ 0x1400c5f80
// > SFXFolderPickerPopup::updateActionBtn @ 0x1400c5ff8
// > MessageThreadsPage::onDeleteSelected @ 0x1400d6bcc
// > ThreadViewPopup::refreshLockNotice @ 0x1400db03b
// > MemberListPopup::onKickMember @ 0x1400ed261
// > ThreadOptionsPopup::onLeave @ 0x1400f51b2
// > ThreadOptionsPopup::onDismissRemoved @ 0x1400f534b
// > ThreadOptionsPopup::onHide @ 0x1400f5772
// > ThreadOptionsPopup::onCancelRequest @ 0x1400f5925
// > InvitesPopup::declineInvite @ 0x1400f970d
// > DeathMarkerSettingsPopup::onClearMarkers @ 0x14011d5de
// > DeathTrackerOptionsPopup::onClearData @ 0x14012020d
// > ColorSelectLiveOverlay::onSelectTab @ 0x14012622c
// > CustomizeObjectLayer::onSelectMode @ 0x14014319c
// > CustomizeObjectLayer::onSelectMode @ 0x1401431c5
// > CustomizeObjectLayer::onSelectMode @ 0x1401431f0
// > CustomizeObjectLayer::highlightSelected @ 0x1401440e1
// > CustomizeObjectLayer::highlightSelected @ 0x140144112
// > GJNotificationCell::onMute @ 0x14015c3e0
// > GJMessageCell::onDeleteMessage @ 0x14015d6e8
// > SongSelectNode::onSongMode @ 0x140168903
// > SongSelectNode::onSongMode @ 0x140168926
// > EditorSFXActionConfigLayer::init @ 0x140183bf8
// > EditorSFXActionConfigLayer::refreshModeButtons @ 0x140184884
// > EditorUI::resetUI @ 0x1401afc47
// > EditorUI::resetUI @ 0x1401afc66
// > EditorUI::resetUI @ 0x1401afc85
// > EditorUI::resetUI @ 0x1401afca4
// > EditorUI::toggleMode @ 0x1401afe2b
// > EditorUI::toggleSwipe @ 0x1401b3429
// > EditorUI::toggleFreeMove @ 0x1401b3505
// > EditorUI::toggleSnap @ 0x1401b3663
// > EditorUI::toggleEnableRotate @ 0x1401b3798
// > EditorUI::toggleEnableRotate @ 0x1401b37bb
// > EditorUI::setDpadStep @ 0x1401f3f52
// > EditorUI::updateDeleteButtons @ 0x1401f5259
// > EditorUI::updateDeleteButtons @ 0x1401f527e
// > EditorUI::updateDeleteButtons @ 0x1401f52a3
// > EditorUI::updateDeleteButtons @ 0x1401f52c5
// > EditorUI::updateViewButtons @ 0x1401f8179
// > FollowRewardPage::onSpecialItem @ 0x14020e832
// > FRequestProfilePage::onDeleteSelected @ 0x1402113d8
// > FriendsProfilePage::onUnfollow @ 0x1402159ee
// > FriendsProfilePage::onUnmute @ 0x140215c2e
// > FriendsProfilePage::onUnblock @ 0x140215e75
// > FriendRequestPopup::onBlock @ 0x1403a2e2f
// > GJMessagePopup::onRemove @ 0x1403a4622
// > GJMessagePopup::onBlock @ 0x1403a47ff
// > GJSpecialColorSelect::onSelectColor @ 0x1403bf731
// > GJSpecialColorSelect::onSelectColor @ 0x1403bf771
// > HSVLiveOverlay::createHSVWidget @ 0x1403c12de
// > InfoLayer::init @ 0x1403cf51a
// > InfoLayer::init @ 0x1403cf5d0
// > InfoLayer::init @ 0x1403cf63a
// > InfoLayer::updateCommentModeButtons @ 0x1403d2aff
// > InfoLayer::updateCommentModeButtons @ 0x1403d2b21
// > InfoLayer::toggleModRoom @ 0x1403d2d7f
// > LeaderboardsLayer::toggleTabButtons @ 0x1403dca1a
// > LevelBrowserLayer::onProcessSelected @ 0x1403e96be
// > GJRateLevelLayer::onCustomButton @ 0x14041a0e7
// > sub_14041B3F0 @ 0x14041b495
// > LevelInfoLayer::confirmOwnerDelete @ 0x1404231ec
// > MoreSearchLayer::onSongMode @ 0x1404400eb
// > MoreSearchLayer::onSongMode @ 0x14044010e
// > PlatformerControlsPopup::refreshClassUI @ 0x140450f0f
// > PlatformerControlsPopup::refreshClassUI @ 0x140450f3a
// > PlatformerControlsPopup::refreshClassUI @ 0x140450f61
// > LevelSettingsLayer::updateGameplayModeButtons @ 0x14045a1e2
// > LevelSettingsLayer::updateGameplayModeButtons @ 0x14045a222
// > SelectArtLayer::onSelectCustom @ 0x14045c211
// > MessagesProfilePage::onDeleteSelected @ 0x1404769eb
// > MusicBrowser::setupList @ 0x14047cf5d
// > MusicBrowser::setupList @ 0x14047cf8a
// > MusicBrowser::setupList @ 0x14047cfc4
// > MusicBrowser::setupList @ 0x14047cff1
// > MusicBrowser::setupList @ 0x14047d023
// > ProfilePage::onFriend @ 0x14055732f
// > ProfilePage::onBlockUser @ 0x1405575af
// > ProfilePage::createUnfriendAlert @ 0x140559176
// > RateStarsLayer::selectRating @ 0x14055ed95
// > GJRateLevelLayer::selectRating @ 0x1405600e5
// > SetGroupIDLayer::updateZLayerButtons @ 0x140594413
// > SetupAreaMoveTriggerPopup::onMode @ 0x1405a54de
// > SetupGradientPopup::updateZLayerButtons @ 0x1405b74d3
// > CreateParticlePopup::onMode @ 0x1405c7850
// > CreateParticlePopup::onMode @ 0x1405c7879
// > CreateParticlePopup::onMode @ 0x1405c78b3
// > CreateParticlePopup::onPage @ 0x1405c7afe
// > SetupPulsePopup::onSelectPulseMode @ 0x1405d0501
// > SetupPulsePopup::onSelectPulseMode @ 0x1405d0523
// > SetupPulsePopup::onSelectTargetMode @ 0x1405d0730
// > SetupPulsePopup::onSelectTargetMode @ 0x1405d0752
// > SetupSequenceTriggerPopup::onSelect @ 0x1405d9ebf
// > SetupSequenceTriggerPopup::onSelect @ 0x1405d9f0a
// > SetupAudioTriggerPopup::onProxMode @ 0x1405dba21
// > SetupShaderEffectPopup::updateZLayerButtons @ 0x1405e0906
// > SFXBrowser::setupList @ 0x14061a397
// > SFXBrowser::setupList @ 0x14061a3c4
// > SFXBrowser::setupList @ 0x14061a3f6
// > ShareLevelLayer::selectRating @ 0x140631a52
// > TabbedPopupLayer::refreshTabButtons @ 0x14066ce70
// > ??> @ 0x14090f68c
//
// 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:30 +0000
//
void __fastcall ButtonSprite::updateBGImage(__int64 a1, const char *a2)
{
__int64 v4; // rcx
__int64 v5; // rax
_QWORD *v6; // rax
_QWORD *v7; // rdi
__int64 v8; // rbx
__int64 v9; // rax
_QWORD *v10; // rdx
__int64 v11; // rdi
__int64 v12; // rbx
cocos2d::CCTextureCache *v13; // rax
struct cocos2d::CCTexture2D *v14; // rax
_BYTE v15[24]; // [rsp+30h] [rbp-18h] BYREF
char v16; // [rsp+50h] [rbp+8h] BYREF
v4 = *(_QWORD *)(a1 + 656);
if ( v4 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 528LL))(v4);
v5 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v15, 0.0, 0.0, 40.0, 40.0);
v6 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create(a2, v5);
*(_QWORD *)(a1 + 656) = v6;
v7 = v6;
v8 = *v6;
v9 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v16, 16.0, 16.0);
(*(void (__fastcall **)(_QWORD *, __int64))(v8 + 312))(v7, v9);
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)a1 + 456LL))(a1, *(_QWORD *)(a1 + 656), 0);
if ( *(_DWORD *)(a1 + 600) == 1 )
{
v10 = (_QWORD *)(a1 + 680);
if ( *(_QWORD *)(a1 + 704) > 0xFu )
v10 = (_QWORD *)*v10;
ButtonSprite::setString(a1, v10);
}
else
{
ButtonSprite::updateSpriteBGSize(a1);
}
}
else
{
v11 = *(_QWORD *)(a1 + 648);
if ( v11 )
{
v12 = *(_QWORD *)(v11 + 344);
v13 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
v14 = cocos2d::CCTextureCache::addImage(v13, a2, 0);
(*(void (__fastcall **)(__int64, struct cocos2d::CCTexture2D *))(v12 + 24))(v11 + 344, v14);
}
}
}