//
// CCPartAnimSprite::transformSprite from 0x57776c to 0x577974 (520 bytes)
//
// 2 xrefs:
// > CCPartAnimSprite::setDisplayFrame @ 0x577a48
// > ??> @ 0x2faf0
//
// 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 CCPartAnimSprite::transformSprite(CCPartAnimSprite *a1, SpriteDescription *a2)
{
CCSpritePart *v4; // x19
CCSpritePart_vtbl *v5; // x1
float x; // s0
CCSpritePart_vtbl *v7; // x1
float y; // s0
char *v9; // x0
unsigned int *v10; // x2
int v11; // w1
_DWORD *v12; // [xsp+50h] [xbp+50h] BYREF
v4 = (CCSpritePart *)cocos2d::CCArray::objectAtIndex(a1->m_spriteParts, a2->m_tag);
cocos2d::CCNode::stopAllActions(v4);
v4->setPosition(v4, &a2->m_position);
v5 = v4->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
x = a2->m_scale.x;
if ( a2->m_flipped.x == 0.0 )
v5->setScaleX(v4, x);
else
v5->setScaleX(v4, -x);
v7 = v4->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
y = a2->m_scale.y;
if ( a2->m_flipped.y == 0.0 )
v7->setScaleY(v4, y);
else
v7->setScaleY(v4, -y);
v4->setRotation(v4, a2->m_rotation);
if ( a2->m_usesCustomTag )
{
v4->setDisplayFrame(v4, a2->m_texture);
sub_D18D28(&v12, &a2->m_texture->m_strFrameName);
CCSpritePart::frameChanged((__int64)v4, (const void **)&v12);
v9 = (char *)(v12 - 6);
if ( v12 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = v12 - 2;
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(v12 - 2);
*(v12 - 2) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v9);
}
}
if ( v4->getZOrder(v4) != a2->m_zValue )
((void (__fastcall *)(CCPartAnimSprite *, CCSpritePart *))a1->reorderChild)(a1, v4);
CCSpritePart::setBeingUsed(v4, 1);
v4->setVisible(v4, 1);
}