//
// cocos2d::CCSprite::updateTransform from 0x100238164 to 0x100238550 (1004 bytes)
//
// 75 xrefs:
// > ??> @ 0x1007635c8
// > ??> @ 0x1007736f8
// > ??> @ 0x100774030
// > ??> @ 0x100775198
// > ??> @ 0x100777d48
// > ??> @ 0x10077b4e8
// > ??> @ 0x10077ba88
// > ??> @ 0x100785d38
// > ??> @ 0x100790ad8
// > ??> @ 0x1007998c8
// > ??> @ 0x1007acd20
// > ??> @ 0x1007ad2d8
// > ??> @ 0x1007b3290
// > ??> @ 0x1007b8d50
// > ??> @ 0x1007b9ea0
// > ??> @ 0x1007c3ec0
// > ??> @ 0x1007c46f8
// > ??> @ 0x1007c7600
// > ??> @ 0x1007c80e0
// > ??> @ 0x1007c9900
// > ??> @ 0x1007c9eb8
// > ??> @ 0x1007cfb90
// > ??> @ 0x1007d0378
// > ??> @ 0x1007d0b88
// > ??> @ 0x1007e5350
// > ??> @ 0x1007ea378
// > ??> @ 0x1007ea930
// > ??> @ 0x1007ec560
// > ??> @ 0x1007ecae8
// > ??> @ 0x1007ef910
// > ??> @ 0x1007f53f8
// > ??> @ 0x1007f5c30
// > ??> @ 0x1007f6428
// > ??> @ 0x1007f6c20
// > ??> @ 0x1007f7418
// > ??> @ 0x1007f7c10
// > ??> @ 0x1007f8408
// > ??> @ 0x1007f8c00
// > ??> @ 0x1007f93e8
// > ??> @ 0x1007f9bf8
// > ??> @ 0x1007fa460
// > ??> @ 0x1007fac70
// > ??> @ 0x1007fb480
// > ??> @ 0x1007fbc90
// > ??> @ 0x1007fc4a0
// > ??> @ 0x1007fccb0
// > ??> @ 0x1007fd4c0
// > ??> @ 0x1007fdcd0
// > ??> @ 0x1007fe4e0
// > ??> @ 0x1007fecf0
// > ??> @ 0x1007ff518
// > ??> @ 0x1007ffd70
// > ??> @ 0x100800598
// > ??> @ 0x100800dc0
// > ??> @ 0x1008015e8
// > ??> @ 0x100801e10
// > ??> @ 0x100802620
// > ??> @ 0x100802e30
// > ??> @ 0x100803640
// > ??> @ 0x100803e50
// > ??> @ 0x100804660
// > ??> @ 0x100804e70
// > ??> @ 0x100805680
// > ??> @ 0x100805e90
// > ??> @ 0x1008066a0
// > ??> @ 0x100806eb0
// > ??> @ 0x1008076c0
// > ??> @ 0x100807ed0
// > ??> @ 0x1008086e0
// > ??> @ 0x100808ef0
// > ??> @ 0x100809700
// > ??> @ 0x100809f10
// > ??> @ 0x10080ae98
// > ??> @ 0x100810ea8
// > ??> @ 0x100816230
//
// 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 cocos2d::CCSprite::updateTransform(cocos2d::CCSprite *a1)
{
cocos2d::CCNode *m_pParent; // x8
__int64 v3; // x9
float x; // s0
float y; // s1
float v6; // s16
float tx; // s17
float ty; // s18
float a; // s19
float b; // s20
float d; // s21
float c; // s4
float v13; // s2
float v14; // s5
float v15; // s1
float v16; // s6
float v17; // s3
float v18; // s2
float v19; // s22
float v20; // s4
float v21; // s16
float v22; // s1
float v23; // s17
float v24; // s7
float m_fBlVertexMod; // s0
float v26; // s18
float v27; // s20
float v28; // s16
float v29; // s19
float m_fVertexZ; // s0
__int64 v31; // x9
__int64 v32; // x8
float m_fBrVertexMod; // s21
float v34; // s16
float v35; // s19
float v36; // s20
float v37; // s21
float m_fTlVertexMod; // s19
float v39; // s17
float v40; // s5
__int64 v41; // x8
float m_fTrVertexMod; // s5
float v43; // s4
cocos2d::CCTextureAtlas *m_pobTextureAtlas; // x0
cocos2d::CCAffineTransform v45; // [xsp+0h] [xbp-40h] BYREF
cocos2d::CCAffineTransform v46; // [xsp+18h] [xbp-28h] BYREF
if ( !((unsigned int (__fastcall *)(cocos2d::CCSprite *))a1->isDirty)(a1) )
goto LABEL_37;
if ( !a1->m_bVisible )
goto LABEL_6;
m_pParent = a1->m_pParent;
if ( !m_pParent || m_pParent == a1->m_pobBatchNode )
{
a1->m_bShouldBeHidden = 0;
((void (__fastcall *)(cocos2d::CCAffineTransform *__return_ptr, cocos2d::CCSprite *))a1->nodeToParentTransform)(
&v46,
a1);
}
else
{
if ( HIBYTE(m_pParent[1].m_fRotationX) == 1 )
{
LABEL_6:
a1->m_sQuad.bl.vertices.x = 0.0;
*(_QWORD *)&a1->m_sQuad.bl.vertices.y = 0;
a1->m_sQuad.tr.vertices.z = 0.0;
v3 = *(_QWORD *)&a1->m_sQuad.bl.vertices.x;
*(_QWORD *)&a1->m_sQuad.tr.vertices.x = v3;
a1->m_sQuad.tl.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.tl.vertices.x = v3;
a1->m_sQuad.br.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.br.vertices.x = v3;
a1->m_bShouldBeHidden = 1;
goto LABEL_33;
}
a1->m_bShouldBeHidden = 0;
((void (__fastcall *)(cocos2d::CCAffineTransform *__return_ptr, cocos2d::CCSprite *))a1->nodeToParentTransform)(
&v45,
a1);
cocos2d::CCAffineTransformConcat(&v46, &v45, (const cocos2d::CCAffineTransform *)&a1->m_pParent[1].m_fRotationY);
}
a1->m_transformToBatch = v46;
if ( !a1->m_bDontDraw )
{
if ( !a1->_realOpacity )
{
a1->m_sQuad.bl.vertices.x = 0.0;
*(_QWORD *)&a1->m_sQuad.bl.vertices.y = 0;
a1->m_sQuad.tr.vertices.z = 0.0;
v31 = *(_QWORD *)&a1->m_sQuad.bl.vertices.x;
*(_QWORD *)&a1->m_sQuad.tr.vertices.x = v31;
a1->m_sQuad.tl.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.tl.vertices.x = v31;
a1->m_sQuad.br.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.br.vertices.x = v31;
goto LABEL_33;
}
sub_100022AFC(&v46, (double *)&a1->m_obRect.size);
x = a1->m_obOffsetPosition.x;
y = a1->m_obOffsetPosition.y;
v6 = y + v46.b;
tx = a1->m_transformToBatch.tx;
ty = a1->m_transformToBatch.ty;
a = a1->m_transformToBatch.a;
b = a1->m_transformToBatch.b;
d = a1->m_transformToBatch.d;
c = a1->m_transformToBatch.c;
v13 = y * c;
v14 = tx + (float)((float)(y * c) + (float)(x * a));
v15 = y * d;
v16 = ty + (float)(v15 + (float)(x * b));
v17 = tx + (float)(v13 + (float)((float)(x + v46.a) * a));
v18 = ty + (float)(v15 + (float)((float)(x + v46.a) * b));
v19 = v6 * c;
v20 = tx + (float)((float)(v6 * c) + (float)((float)(x + v46.a) * a));
v21 = v6 * d;
v22 = ty + (float)(v21 + (float)((float)(x + v46.a) * b));
v23 = tx + (float)(v19 + (float)(x * a));
v24 = ty + (float)(v21 + (float)(x * b));
if ( !a1->m_bUseVertexMod )
{
m_fVertexZ = a1->m_fVertexZ;
a1->m_sQuad.bl.vertices.x = v14;
a1->m_sQuad.bl.vertices.y = v16;
a1->m_sQuad.bl.vertices.z = m_fVertexZ;
a1->m_sQuad.br.vertices.x = v17;
a1->m_sQuad.br.vertices.y = v18;
a1->m_sQuad.br.vertices.z = m_fVertexZ;
a1->m_sQuad.tl.vertices.x = v23;
a1->m_sQuad.tl.vertices.y = v24;
a1->m_sQuad.tl.vertices.z = m_fVertexZ;
a1->m_sQuad.tr.vertices.x = v20;
v32 = 516;
a1->m_sQuad.tr.vertices.y = v22;
LABEL_32:
*(float *)((char *)&a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v32) = m_fVertexZ;
goto LABEL_33;
}
m_fBlVertexMod = a1->m_fBlVertexMod;
v26 = v23 - v14;
if ( m_fBlVertexMod == 0.0 )
{
m_fVertexZ = a1->m_fVertexZ;
v28 = v14;
v29 = v16;
}
else
{
v27 = 1.0 - m_fBlVertexMod;
v28 = v23 - (float)(v26 * (float)(1.0 - m_fBlVertexMod));
v29 = v24 - (float)((float)(v24 - v16) * (float)(1.0 - m_fBlVertexMod));
m_fVertexZ = a1->m_fVertexZ;
a1->m_sQuad.bl.texCoords.v = a1->m_fTextureTop - (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom) * v27);
}
a1->m_sQuad.bl.vertices.x = v28;
a1->m_sQuad.bl.vertices.y = v29;
a1->m_sQuad.bl.vertices.z = m_fVertexZ;
m_fBrVertexMod = a1->m_fBrVertexMod;
v34 = v20 - v17;
v35 = v17;
v36 = v18;
if ( m_fBrVertexMod != 0.0 )
{
v37 = 1.0 - m_fBrVertexMod;
v35 = v20 - (float)(v34 * v37);
v36 = v22 - (float)((float)(v22 - v18) * v37);
a1->m_sQuad.br.texCoords.v = a1->m_fTextureTop - (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom) * v37);
}
a1->m_sQuad.br.vertices.x = v35;
a1->m_sQuad.br.vertices.y = v36;
a1->m_sQuad.br.vertices.z = m_fVertexZ;
m_fTlVertexMod = a1->m_fTlVertexMod;
if ( m_fTlVertexMod == 0.0 )
{
a1->m_sQuad.tl.vertices.x = v23;
a1->m_sQuad.tl.vertices.y = v24;
v41 = 468;
v40 = m_fVertexZ;
}
else
{
v39 = 1.0 - m_fTlVertexMod;
a1->m_sQuad.tl.vertices.x = v14 + (float)(v26 * (float)(1.0 - m_fTlVertexMod));
a1->m_sQuad.tl.vertices.y = v16 + (float)((float)(v24 - v16) * (float)(1.0 - m_fTlVertexMod));
a1->m_sQuad.tl.vertices.z = m_fVertexZ;
if ( m_fTlVertexMod < 0.0 )
goto LABEL_26;
if ( a1->m_bRectRotated )
{
v40 = a1->m_fTextureLeft + (float)((float)(a1->m_fTextureRight - a1->m_fTextureLeft) * v39);
v41 = 476;
}
else
{
v40 = a1->m_fTextureBottom + (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom) * v39);
v41 = 480;
}
}
*(float *)((char *)&a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable + v41) = v40;
LABEL_26:
m_fTrVertexMod = a1->m_fTrVertexMod;
if ( m_fTrVertexMod == 0.0 )
{
a1->m_sQuad.tr.vertices.x = v20;
a1->m_sQuad.tr.vertices.y = v22;
v32 = 516;
}
else
{
v43 = 1.0 - m_fTrVertexMod;
a1->m_sQuad.tr.vertices.x = v17 + (float)(v34 * (float)(1.0 - m_fTrVertexMod));
a1->m_sQuad.tr.vertices.y = v18 + (float)((float)(v22 - v18) * (float)(1.0 - m_fTrVertexMod));
a1->m_sQuad.tr.vertices.z = m_fVertexZ;
if ( m_fTrVertexMod < 0.0 )
goto LABEL_33;
if ( a1->m_bRectRotated )
{
m_fVertexZ = a1->m_fTextureLeft + (float)((float)(a1->m_fTextureRight - a1->m_fTextureLeft) * v43);
v32 = 524;
}
else
{
m_fVertexZ = a1->m_fTextureBottom + (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom) * v43);
v32 = 528;
}
}
goto LABEL_32;
}
LABEL_33:
if ( !a1->m_bDontDraw )
{
m_pobTextureAtlas = a1->m_pobTextureAtlas;
if ( m_pobTextureAtlas )
cocos2d::CCTextureAtlas::updateQuad(m_pobTextureAtlas, &a1->m_sQuad, a1->m_uAtlasIndex);
}
a1->m_bRecursiveDirty = 0;
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->setDirty)(a1, 0);
LABEL_37:
cocos2d::CCNode::updateTransform(a1);
}