//
// ButtonSprite::updateBGImage from 0x3c30cc to 0x3c3192 (198 bytes)
//
// 112 xrefs:
// > GJMessageCell::onDeleteMessage @ 0x428160
// > GJNotificationCell::onMute @ 0x42ba60
// > EditorUI::toggleSwipe @ 0x480f18
// > EditorUI::toggleFreeMove @ 0x480f74
// > EditorUI::toggleSnap @ 0x480fe0
// > EditorUI::toggleEnableRotate @ 0x4865e6
// > EditorUI::toggleEnableRotate @ 0x4865f8
// > EditorUI::resetUI @ 0x489c92
// > EditorUI::resetUI @ 0x489ca4
// > EditorUI::resetUI @ 0x489cb6
// > EditorUI::resetUI @ 0x489cc8
// > EditorUI::toggleMode @ 0x489da2
// > MoreSearchLayer::onSongMode @ 0x496ffc
// > MoreSearchLayer::onSongMode @ 0x497018
// > LevelInfoLayer::confirmOwnerDelete @ 0x49b064
// > ShareLevelLayer::selectRating @ 0x4a2564
// > LevelBrowserLayer::onProcessSelected @ 0x4a5126
// > InfoLayer::updateCommentModeButtons @ 0x53ce72
// > InfoLayer::updateCommentModeButtons @ 0x53ce8e
// > InfoLayer::toggleModRoom @ 0x53ec9a
// > InfoLayer::init @ 0x53fd48
// > InfoLayer::init @ 0x53fda6
// > InfoLayer::init @ 0x53fdea
// > LeaderboardsLayer::toggleTabButtons @ 0x563352
// > GJRateLevelLayer::selectRating @ 0x564b4e
// > GJRateLevelLayer::onCustomButton @ 0x566276
// > GJRateLevelListLayer::onCustomButton @ 0x56662c
// > GJRateEditorSoundLayer::onCustomButton @ 0x566a10
// > RateStarsLayer::selectRating @ 0x5691e6
// > SongSelectNode::onSongMode @ 0x57baf0
// > SongSelectNode::onSongMode @ 0x57bb0c
// > CustomizeObjectLayer::highlightSelected @ 0x57e8d2
// > CustomizeObjectLayer::highlightSelected @ 0x57e8e0
// > CustomizeObjectLayer::onSelectMode @ 0x57ed12
// > CustomizeObjectLayer::onSelectMode @ 0x57ed34
// > CustomizeObjectLayer::onSelectMode @ 0x57ed58
// > AccountLayer::onBackup @ 0x5840d8
// > AccountHelpLayer::verifyUnlink @ 0x5846bc
// > AccountHelpLayer::onUnlink @ 0x585294
// > GJMessagePopup::onRemove @ 0x5d76fa
// > GJWriteMessagePopup::onClearBody @ 0x5d77a2
// > FriendRequestPopup::onBlock @ 0x5da4aa
// > GJMessagePopup::onBlock @ 0x5da5da
// > GJSpecialColorSelect::highlightSelected @ 0x5e87be
// > GJSpecialColorSelect::highlightSelected @ 0x5e87d0
// > SetupPulsePopup::onSelectPulseMode @ 0x5ec4ee
// > SetupPulsePopup::onSelectPulseMode @ 0x5ec50c
// > SetupPulsePopup::onSelectTargetMode @ 0x5ece72
// > SetupPulsePopup::onSelectTargetMode @ 0x5ece90
// > MessagesProfilePage::onDeleteSelected @ 0x5efc12
// > FRequestProfilePage::onDeleteSelected @ 0x5f18f2
// > FriendsProfilePage::onUnfollow @ 0x5f51d6
// > FriendsProfilePage::onUnmute @ 0x5f5312
// > FriendsProfilePage::onUnblock @ 0x5f5452
// > ProfilePage::onBlockUser @ 0x5f7934
// > ProfilePage::createUnfriendAlert @ 0x5f7b58
// > ProfilePage::onFriend @ 0x5f7cd6
// > ColorSelectLiveOverlay::onSelectTab @ 0x602788
// > FollowRewardPage::onSpecialItem @ 0x6304dc
// > SetGroupIDLayer::updateZLayerButtons @ 0x63a972
// > CreateParticlePopup::onMode @ 0x663d00
// > CreateParticlePopup::onMode @ 0x663d22
// > CreateParticlePopup::onMode @ 0x663d48
// > CreateParticlePopup::onPage @ 0x665a68
// > MPLobbyLayer::onBtn1 @ 0x66a61e
// > SetupGradientPopup::updateZLayerButtons @ 0x68708c
// > SetupShaderEffectPopup::updateZLayerButtons @ 0x687f46
// > SetupAreaMoveTriggerPopup::onMode @ 0x68ed7e
// > HSVLiveOverlay::createHSVWidget @ 0x69c38a
// > CharacterColorPage::updateColorMode @ 0x69cf24
// > SelectArtLayer::onSelectCustom @ 0x6a8ab0
// > LevelSettingsLayer::updateGameplayModeButtons @ 0x6a9214
// > LevelSettingsLayer::updateGameplayModeButtons @ 0x6a923a
// > SetupAudioTriggerPopup::onProxMode @ 0x6af7da
// > SetupSequenceTriggerPopup::onSelect @ 0x6bc038
// > SetupSequenceTriggerPopup::onSelect @ 0x6bc062
// > MusicBrowser::updateViewItems @ 0x6bd7f4
// > MusicBrowser::updateViewItems @ 0x6bd818
// > MusicBrowser::updateViewItems @ 0x6bd842
// > MusicBrowser::setupList @ 0x6be3fa
// > MusicBrowser::setupList @ 0x6be424
// > SFXBrowser::updateViewItems @ 0x6c38bc
// > SFXBrowser::updateViewItems @ 0x6c38e0
// > SFXBrowser::updateViewItems @ 0x6c3906
// > EditorUI::updateDeleteButtons @ 0x6f61c4
// > EditorUI::updateDeleteButtons @ 0x6f61e2
// > EditorUI::updateDeleteButtons @ 0x6f6200
// > EditorUI::updateDeleteButtons @ 0x6f621e
// > EditorUI::updateViewButtons @ 0x6f6c16
// > EditorUI::setDpadStep @ 0x6f6e2c
// > TabbedPopupLayer::refreshTabButtons @ 0x72deb6
// > SFXFolderPickerPopup::updateShareHint @ 0x72f1c8
// > SFXFolderPickerPopup::updateActionBtn @ 0x72f238
// > AccountReviewPopup::onDeleteRow @ 0x733a0c
// > AccountReviewPopup::onDeleteFilterRow @ 0x733b90
// > AccountReviewPopup::selectTab @ 0x73499e
// > AccountReviewPopup::confirmDeleteSelected @ 0x734c18
// > ThreadOptionsPopup::onLeave @ 0x74ba72
// > ThreadOptionsPopup::onDismissRemoved @ 0x74bb38
// > ThreadOptionsPopup::onCancelRequest @ 0x74bcc0
// > InvitesPopup::declineInvite @ 0x74c650
// > MemberListPopup::onKickMember @ 0x74d95a
// > ThreadOptionsPopup::onHide @ 0x74db88
// > MessageThreadsPage::onDeleteSelected @ 0x751a26
// > ThreadViewPopup::refreshLockNotice @ 0x752ac4
// > ClearPlatformerSavesPopup::onDelete @ 0x761a76
// > DeathMarkerSettingsPopup::onClearMarkers @ 0x76df90
// > DeathTrackerOptionsPopup::onClearData @ 0x77060a
// > EditorSFXActionConfigLayer::refreshModeButtons @ 0x77bd98
// > PlatformerControlsPopup::refreshClassUI @ 0x79ca2c
// > RateStarsModLayer::selectRating @ 0x79e6fa
// > ReportPopup::onSubmit @ 0x79fe54
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:46:32 +0000
//
char *__fastcall ButtonSprite::updateBGImage(char *this, const char *a2)
{
int v2; // r5
char *v3; // r4
int v5; // r0
int v6; // r7
void (__fastcall *v7)(int, _BYTE *); // r8
char *v8; // r1
int v9; // r4
int (__fastcall *v10)(int, int); // r8
cocos2d::CCTextureCache *v11; // r0
int v12; // r0
_BYTE v13[16]; // [sp+Ch] [bp-14h] BYREF
v2 = *((_DWORD *)this + 137);
v3 = this;
if ( v2 )
{
(*(void (__fastcall **)(_DWORD))(*(_DWORD *)v2 + 268))(*((_DWORD *)this + 137));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v13, 0.0, 0.0, 40.0, 40.0);
v5 = cocos2d::extension::CCScale9Sprite::create(a2, v13);
*((_DWORD *)v3 + 137) = v5;
v6 = v5;
v7 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v5 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v13, 16.0, 16.0);
v7(v6, v13);
(*(void (__fastcall **)(char *, _DWORD, _DWORD))(*(_DWORD *)v3 + 232))(v3, *((_DWORD *)v3 + 137), 0);
if ( *((_DWORD *)v3 + 127) == 1 )
{
if ( (v3[568] & 1) != 0 )
v8 = *((char **)v3 + 144);
else
v8 = v3 + 569;
return (char *)ButtonSprite::setString((int)v3, v8);
}
else
{
return (char *)ButtonSprite::updateSpriteBGSize((ButtonSprite *)v3);
}
}
else
{
v9 = *((_DWORD *)this + 136);
if ( v9 )
{
v10 = *(int (__fastcall **)(int, int))(*(_DWORD *)v9 + 532);
v11 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)this);
v12 = cocos2d::CCTextureCache::addImage(v11, a2, 0);
return (char *)v10(v9, v12);
}
}
return this;
}