//
// GameObject::addColorSpriteToSelf from 0x645b20 to 0x645c58 (312 bytes)
//
// 3 xrefs:
// > GameObject::addColorSpriteToParent @ 0x64689c
// > EditorUI::spriteFromObjectString @ 0x697088
// > ??> @ 0x2e308
//
// 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 GameObject::addColorSpriteToSelf(GameObject *a1)
{
cocos2d::CCSprite *m_colorSprite; // x2
__int64 v3; // x2
const cocos2d::CCSize *v4; // x0
cocos2d::CCSprite *v5; // x19
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCSize v7; // [xsp+48h] [xbp+48h] BYREF
cocos2d::CCPoint v8; // [xsp+50h] [xbp+50h] BYREF
if ( a1 != a1->m_colorSprite->getParent(a1->m_colorSprite) )
{
m_colorSprite = a1->m_colorSprite;
a1->m_colorSpriteLocked = 1;
m_colorSprite->removeFromParentAndCleanup(m_colorSprite, 0);
if ( a1->m_colorZLayerRelated )
v3 = 100;
else
v3 = 4294967196LL;
a1->addChild_0(a1, a1->m_colorSprite, v3);
a1->m_colorSprite->setScale(a1->m_colorSprite, 1.0);
a1->m_colorSprite->setRotation(a1->m_colorSprite, 0.0);
v4 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize(&v7, v4);
v5 = a1->m_colorSprite;
setPosition = v5->setPosition;
cocos2d::CCPoint::CCPoint(&v8, v7.width * 0.5, v7.height * 0.5);
setPosition(v5, &v8);
}
}